{"id": 26, "source": "method", "repo": "1024-lab/smart-admin", "text": "public NoticeTypeVO getByNoticeTypeId(Long noticceTypeId) { return SmartBeanUtil.copy(noticeTypeDao.selectById(noticceTypeId), NoticeTypeVO.class); }", "tokens": 47} {"id": 36, "source": "method", "repo": "1024-lab/smart-admin", "text": "public ResponseDTO addEmployee(@Valid @RequestBody EmployeeAddForm employeeAddForm) { return employeeService.addEmployee(employeeAddForm); }", "tokens": 33} {"id": 394, "source": "method", "repo": "19misterx98/seedcrackerx", "text": "public int getStep(Biome biome) { return this.getConfig().getSalt(biome) / 10000; }", "tokens": 29} {"id": 431, "source": "method", "repo": "19misterx98/seedcrackerx", "text": "public String getName() { return \"warped fungus\"; }", "tokens": 15} {"id": 463, "source": "method", "repo": "19misterx98/seedcrackerx", "text": "public synchronized void dump() { synchronized (this.baseSet) { this.baseSet.addAll(this.scheduledSet); this.scheduledSet.clear(); } }", "tokens": 36} {"id": 522, "source": "method", "repo": "19misterx98/seedcrackerx", "text": "public void blockUpdateExploit(BlockPos pos, Vec3i size, Thread startCracker) { ArrayList floorBlocks = new ArrayList<>(); for (int xo = -size.getX(); xo <= size.getX(); xo++) { for (int zo = -size.getZ(); zo <= size.getZ(); zo++) { floorBlocks.add(pos.offset(xo, -1, zo)); } } SeedCracker.get().getDataStorage().blockUpdateQueue.add(floorBlocks, pos, startCracker); }", "tokens": 123} {"id": 553, "source": "method", "repo": "19misterx98/seedcrackerx", "text": "public static void reloadSearchPositions() { SEARCH_POSITIONS = buildSearchPositions(CHUNK_POSITIONS, pos -> pos.getY() > 90 && pos.getY() < 40); }", "tokens": 45} {"id": 556, "source": "method", "repo": "19misterx98/seedcrackerx", "text": "public IglooFinder(Level world, ChunkPos chunkPos) { super(world, chunkPos); Direction.Plane.HORIZONTAL.forEach(direction -> { JigsawFinder finder = new JigsawFinder(world, chunkPos, direction, size); finder.searchPositions = SEARCH_POSITIONS.get(direction); //finder.setDebug(); buildStructure(finder); this.finders.add(finder); }); }", "tokens": 87} {"id": 579, "source": "method", "repo": "19misterx98/seedcrackerx", "text": "public List findInChunk() { List result = new ArrayList<>(); if (this.structure.isEmpty()) { return result; } //FOR DEBUGGING PIECES. if (this.debug) { Minecraft.getInstance().execute(() -> { int y = this.rotation.ordinal() * (this.height + 5) + this.mirror.ordinal() * (this.height + 5) * 2 + 120; if (this.chunkPos.x() % 2 == 0 && this.chunkPos.z() % 2 == 0) { this.structure.forEach((pos, state) -> { this.world.setBlock(this.chunkPos.getWorldPosition().offset(pos).offset(0, y, 0), state, 0); }); } }); } for (BlockPos center : this.searchPositions) { boolean found = true; for (Map.Entry entry : this.structure.entrySet()) { BlockPos pos = this.chunkPos.getWorldPosition().offset(center.offset(entry.getKey())); BlockState state = this.world.getBlockState(pos); //Blockstate may change when it gets placed in the world, that's why it's using the block here. if (entry.getValue() != null && !state.getBlock().equals(entry.getValue().getBlock())) { found = false; break; } } if (found) { result.add(this.chunkPos.getWorldPosition().offset(center)); } } return result; }", "tokens": 331} {"id": 697, "source": "method", "repo": "3arthqu4ke/3arthh4ck", "text": "private GameType getGameTypeStartingWith(String arg) { for (GameType gameType : GameType.values()) { if (gameType.getName().startsWith(arg.toLowerCase())) { return gameType; } } return null; }", "tokens": 48} {"id": 746, "source": "method", "repo": "3arthqu4ke/3arthh4ck", "text": "public static String concatenate(String[] args, int startIndex) { return concatenate(args, startIndex, args.length); }", "tokens": 28} {"id": 886, "source": "method", "repo": "3arthqu4ke/3arthh4ck", "text": "public String getString() { return this.string; }", "tokens": 12} {"id": 953, "source": "method", "repo": "3arthqu4ke/3arthh4ck", "text": "/** Submits the given Runnable to an {@link ExecutorService}. The Future that results from the call is returned. @param runnable the runnable to run on a separate thread. @return the Future returned by the ExecutorService. */ public Future submitRunnable(Runnable runnable) { return EXECUTOR.submit(runnable); }", "tokens": 65} {"id": 976, "source": "method", "repo": "3arthqu4ke/3arthh4ck", "text": "public void invoke(PacketEvent.Receive event) { SPacketKeepAlive packet = event.getPacket(); if (!module.handled && (!module.isOld() || (packet.getId() > 0 && packet.getId() < 1000))) { module.startTime = System.currentTimeMillis() - module.startTime; module.serverPing = (int) packet.getId(); module.ping = module.startTime; module.handled = true; event.setCancelled(true); } }", "tokens": 109} {"id": 1179, "source": "method", "repo": "3arthqu4ke/3arthh4ck", "text": "public void invoke(GuiScreenEvent event) { if (module.awaitScreen) { module.awaitScreen = false; mc.displayGuiScreen( new LogScreen(module, module.message, module.serverData)); event.setCancelled(true); } }", "tokens": 57} {"id": 1240, "source": "method", "repo": "3arthqu4ke/3arthh4ck", "text": "public String getDescription() { return \"Makes you jump far.\"; }", "tokens": 16} {"id": 1262, "source": "method", "repo": "3arthqu4ke/3arthh4ck", "text": "public void invoke(MotionUpdateEvent event) { AxisAlignedBB bb = module.bb; double[] offsets = module.offsets; if (module.stepping && module.mode.getValue() == StepMode.Slow && event.getStage() == Stage.PRE && offsets != null && bb != null) { boolean noMovementKeys = MovementUtil.noMovementKeys(); if (module.index++ < offsets.length && !noMovementKeys) { if (module.useTimer.getValue() && module.index == offsets.length - 1) { Managers.TIMER.reset(); } double y = (module.index / (double) offsets.length) * module.currHeight; mc.player.setPosition(module.x, module.y + y, module.z); event.setCancelled(true); } else if (noMovementKeys) { module.reset(); } else { if (PingBypassModule.CACHE.isEnabled() && !PingBypassModule.CACHE.get().isOld()) { mc.player.connection.sendPacket( new C2SStepPacket( offsets, module.x, module.y, module.z)); } else { for (double offset : offsets) { mc.player.connection.sendPacket( new CPacketPlayer.Position( module.x, module.y + offset, module.z, true)); } } mc.player.setEntityBoundingBox(bb); mc.player.resetPositionToBB(); module.reset(); if (module.autoOff.getValue()) { module.disable(); } } } else if (module.stepping && (bb == null || offsets == null)) { module.reset(); } }", "tokens": 351} {"id": 1290, "source": "method", "repo": "3arthqu4ke/3arthh4ck", "text": "public Freecam() { super(\"Freecam\", Category.Player); this.listeners.add(new ListenerPacket(this)); this.listeners.add(new ListenerUpdate(this)); this.listeners.add(new ListenerOverlay(this)); this.listeners.add(new ListenerPush(this)); this.listeners.add(new ListenerPosLook(this)); this.listeners.add(new ListenerMove(this)); this.listeners.add(new ListenerMotion(this)); SimpleData data = new SimpleData(this, \"Allows you to look around freely. This module is mostly\" + \" meant for packet exploits, Spectate is more legit.\"); data.register(mode, \"-Cancel cancels movement packets.\" + \"\\n-Spanish good for dupes.\" + \"\\n-Position very legit freecam and, unless you toggle\" + \" freecam while standing in the air, almost undetectable.\"); data.register(speed, \"The speed you want to move with while in freecam.\"); this.setData(data); }", "tokens": 236} {"id": 1355, "source": "method", "repo": "3arthqu4ke/3arthh4ck", "text": "private void invalidate(Vec3i... offsets) { for (Vec3i vec3i : offsets) { mut_pos.incrementX(vec3i.getX()); mut_pos.incrementY(vec3i.getY()); mut_pos.incrementZ(vec3i.getZ()); Hole hole = holes.get(mut_pos); if (hole != null && (hole.isAirPart(mut_pos))) { holes.remove(mut_pos); hole.invalidate(); } } }", "tokens": 121} {"id": 1461, "source": "method", "repo": "3arthqu4ke/3arthh4ck", "text": "public static boolean canPlaceCrystal(BlockPos pos, boolean ignoreCrystals, boolean noBoost2, List entities) { return canPlaceCrystal(pos, ignoreCrystals, noBoost2, entities, noBoost2, 0); }", "tokens": 53} {"id": 1465, "source": "method", "repo": "3arthqu4ke/3arthh4ck", "text": "public static float getDamage(IBlockState state, ItemStack stack, BlockPos pos, boolean onGround, boolean isOnGround) { return getDigSpeed(stack, state, onGround, isOnGround) / (state.getBlockHardness(mc.world, pos) * (canHarvestBlock(pos, stack) ? 30 : 100)); }", "tokens": 79} {"id": 1621, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "void readRejectsUnsupportedVersion() throws IOException { Path file = tempDir.resolve(\"accounts.json\"); JsonObject root = new JsonObject(); root.add(\"version\", new JsonPrimitive(2L)); root.add(\"accounts\", new JsonObject()); Files.createDirectories(file.getParent()); Files.writeString(file, root.toString()); TestStore store = new TestStore(codec, lock, 1L, file); assertThrows(AuthStoreException.class, store::read); }", "tokens": 98} {"id": 1719, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "void listDatapacksOfOneWorld() { Profile profile = profile(\"main\", \"fabric\"); Path saves = profile.path().resolve(Worlds.SAVES); createFile(saves.resolve(\"World A\").resolve(Worlds.DATAPACKS).resolve(\"terralith.zip\")); createFile(saves.resolve(\"World B\").resolve(Worlds.DATAPACKS).resolve(\"incendium.zip\")); createFile(profile.path().resolve(\"resourcepacks\").resolve(\"faithful.jar\")); modsByFileName.put(\"faithful.jar\", List.of(mod(\"faithful\", \"Faithful\"))); ListCommand command = list(); command.setVersionArg(List.of(\"main\")); command.setWorld(\"World A\"); command.run(); assertTrue(console.output().contains(\"terralith.zip\")); assertFalse(console.output().contains(\"incendium.zip\")); assertFalse(console.output().contains(\"Faithful\")); }", "tokens": 211} {"id": 1736, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "void resolveDefaultServerWorld() throws IOException { Profile profile = server(); Path world = dir(profile.path().resolve(Worlds.DEFAULT_SERVER_WORLD)); assertEquals(world, Worlds.resolveWorld(profile, null)); }", "tokens": 49} {"id": 1858, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "static ProgressBar dummy() { return DummyProgressBarService.DUMMY; }", "tokens": 15} {"id": 1899, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "public void error(CacheFunction function, String message, Throwable cause) { LoggerFactory.getLogger(function.toString()).error(message, cause); }", "tokens": 31} {"id": 2022, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "void findsTheHomeItself() throws IOException { Path home = createHome(root, \"java\"); assertEquals(home, finder.find(home).orElseThrow()); }", "tokens": 35} {"id": 2025, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "public void scansSubDirs(@TempDir Path dir) throws Exception { FakeJdks.create(dir.resolve(\"jdk-8\"), 8); FakeJdks.create(dir.resolve(\"jdk-17\"), 17); Files.createFile(dir.resolve(\"stray-file\")); List result = service.scanSubDirsOf(source, dir); assertEquals(2, result.size()); assertTrue(result.stream().anyMatch(java -> java.version() == 8)); assertTrue(result.stream().anyMatch(java -> java.version() == 17)); }", "tokens": 126} {"id": 2046, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "public int retries() { return delegate.retries(); }", "tokens": 12} {"id": 2103, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "/** Splits the content of a java argument file into arguments. Arguments are separated by whitespace, can be quoted with {@code \"} or {@code '} and lines starting with {@code #} are comments. Inside quotes a {@code \\} escapes the next character. @param content the content of the argument file. @return the arguments in the file. @see Java Command-Line Argument Files */ static List parseArgFile(String content) { List result = new ArrayList<>(); StringBuilder current = null; char quote = 0; for (int i = 0; i < content.length(); i++) { char c = content.charAt(i); if (quote != 0) { if (c == quote) { quote = 0; } else if (c == '\\\\' && i + 1 < content.length()) { char next = content.charAt(++i); switch (next) { case 'n' -> current.append('\\n'); case 'r' -> current.append('\\r'); case 't' -> current.append('\\t'); case 'f' -> current.append('\\f'); case '\\n', '\\r' -> { // line continuation, skip leading whitespace of the next line while (i + 1 < content.length() && Character.isWhitespace(content.charAt(i + 1))) { i++; } } default -> current.append(next); } } else { current.append(c); } } else if (Character.isWhitespace(c)) { if (current != null) { result.add(current.toString()); current = null; } } else if (c == '#' && current == null) { while (i + 1 < content.length() && content.charAt(i + 1) != '\\n' && content.charAt(i + 1) != '\\r') { i++; } } else { if (current == null) { current = new StringBuilder(); } if (c == '\"' || c == '\\'') { quote = c; } else { current.append(c); } } } if (current != null) { result.add(current.toString()); } return result; }", "tokens": 511} {"id": 2141, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "private void garbageCollectHmc(Process process) { if (config.free()) { // TODO: implement //throw new McLaunchedExitHmcException(process); } }", "tokens": 39} {"id": 2200, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "private void extract(Download download, Path destination) throws HeadlessMcException { try ( InputStream rawInputStream = download.getInputStream(); ZipInputStream zip = new ZipInputStream(rawInputStream) ) { ZipEntry entry; while ((entry = zip.getNextEntry()) != null) { Path target = destination.resolve(entry.getName()).normalize(); if (!target.startsWith(destination)) { throw new HeadlessMcIOException(\"Zip slip detected: \" + entry.getName()); } if (entry.isDirectory()) { Files.createDirectories(target); } else { Files.createDirectories(target.getParent()); Files.copy(zip, target, StandardCopyOption.REPLACE_EXISTING); } } // TODO: this is here because of JavaDownloadBuilder Line 188, // this might not read the InputStream completely?! rawInputStream.transferTo(new OutputStream() { @Override public void write(int b) { } @Override public void write(byte @NonNull[] b) throws IOException { } @Override public void write(byte @NonNull[] b, int off, int len) throws IOException { } }); } catch (IOException e) { throw new HeadlessMcIOException(\"Failed to extract modpack to \" + destination, e); } }", "tokens": 249} {"id": 2201, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "public List gameVersions() { return game_versions; }", "tokens": 16} {"id": 2226, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "default void close() throws HeadlessMcException, IOException { }", "tokens": 12} {"id": 2258, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "public DownloadBuilder download(URI url) { return new MockDownloadBuilder(url, mockDownloadService); }", "tokens": 23} {"id": 2294, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "private boolean isObjectArrayWithSmallerDimensionalityThan(TypeHierarchy u) { return JAVA_LANG_OBJECT.representsType(typeOfArray()) && arrayDimensionality() <= u.arrayDimensionality(); }", "tokens": 46} {"id": 2365, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "private VersionID id(String... arg) { return VersionID.resolve(platformService, VersionArg.parse(arg)); }", "tokens": 30} {"id": 2440, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "public Optional tryGetVersion(String fileName) { throw new UnsupportedOperationException(); }", "tokens": 20} {"id": 2461, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "public VersionID match( PlatformService platformService, Version version, VersionProcessor processor ) throws HeadlessMcException { VanillaVersion exactVanillaMatch; if ((exactVanillaMatch = vanillaVersionService.getVersion(version.getId()).orElse(null)) != null) { return createVersionId(platformService, exactVanillaMatch, null); } NameMatchResult match = filterByParent( match( // TODO: this might not always be feasible, or good, e.g. on Purpur, // instead try to get VanillaVersion first and filter builds??? versionService.getVersions(), version ), version ); if (match.versions().isEmpty()) { throw new VersionMatchException(\"Failed to find platform version for \" + version + \" on \" + getPlatformName()); } if (match.isAmbiguous()) { return resolveAmbiguousMatch(match, platformService, version, processor); } PlatformVersion first = match.versions().getFirst(); if (first instanceof VanillaVersion vanillaVersion) { return createVersionId(platformService, vanillaVersion, null); } if (first instanceof BoundPlatformVersion boundPlatformVersion) { VanillaVersion vanillaVersion = boundPlatformVersion.getVanillaVersion(vanillaVersionService); return createVersionId(platformService, vanillaVersion, first); } VanillaVersion vanillaVersion = getVanillaVersion(version, processor); return createVersionId(platformService, vanillaVersion, first); }", "tokens": 291} {"id": 2464, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "public VersionMatcherServiceImpl( PlatformService platforms, AppFiles files, FileService fileService, JsonService jsonService ) { this(platforms, fileCache(jsonService, fileService.getPath(files.getCacheDir(), CACHE_FILE))); }", "tokens": 52} {"id": 2523, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "public void failingTest() { FakeProcess process = FakeProcess.withLines(true, \"Starting\", \"Error!\", \"Done\"); CommandTest commandTest = commandTest(testCase(contains(\"Error\"), failure()), process); commandTest.run(); assertFalse(commandTest.wasSuccessful()); assertEquals(List.of(\"Starting\", \"Error!\"), output); }", "tokens": 74} {"id": 2536, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "public void updateTimeoutOnEmptyTestRemovesTheTimeout() { timeoutHandler.setTimeout(10L); runner(testCase()).updateTimeout(); assertFalse(timeoutHandler.hasTimeout()); }", "tokens": 39} {"id": 2537, "source": "method", "repo": "3arthqu4ke/headlessmc", "text": "private TestCaseRunner runner(TestCase testCase) { return new TestCaseRunner(testCase, timeoutHandler); }", "tokens": 21} {"id": 2685, "source": "method", "repo": "648540858/wvp-gb28181-pro", "text": "public void setEnabled(String enabled) { this.enabled = enabled; }", "tokens": 17} {"id": 2695, "source": "method", "repo": "648540858/wvp-gb28181-pro", "text": "public long getDelay(@NotNull TimeUnit unit) { return unit.convert(delayTime - System.currentTimeMillis(), TimeUnit.MILLISECONDS); }", "tokens": 29} {"id": 2778, "source": "method", "repo": "648540858/wvp-gb28181-pro", "text": "public void updateGPS(List commonGBChannels) { int limitCount = 1000; for (int i = 0; i < commonGBChannels.size(); i += limitCount) { int end = Math.min(i + limitCount, commonGBChannels.size()); List batchList = commonGBChannels.subList(i, end); commonGBChannelMapper.updateGps(batchList); } }", "tokens": 99} {"id": 2836, "source": "method", "repo": "648540858/wvp-gb28181-pro", "text": "public String toString() { return \"JCommunicationModuleAttribute{\" + \"gprs=\" + gprs + \", cdma=\" + cdma + \", tdScdma=\" + tdScdma + \", wcdma=\" + wcdma + \", cdma2000=\" + cdma2000 + \", tdLte=\" + tdLte + \", other=\" + other + '}'; }", "tokens": 101} {"id": 3020, "source": "method", "repo": "648540858/wvp-gb28181-pro", "text": "public void setSrcPort(int srcPort) { this.srcPort = srcPort; }", "tokens": 21} {"id": 3040, "source": "method", "repo": "648540858/wvp-gb28181-pro", "text": "public void closeRTPServerByMediaServerId(String mediaServerId, String app, String stream) { MediaServer mediaServer = mediaServerService.getOne(mediaServerId); if (mediaServer == null) { return; } closeRTPServer(mediaServer, app, stream); }", "tokens": 61} {"id": 3052, "source": "method", "repo": "648540858/wvp-gb28181-pro", "text": "private void clearSendRtpItem(SendRtpInfo sendRtpItem) { if (sendRtpItem == null) { return; } sendRtpServerService.delete(sendRtpItem); }", "tokens": 40} {"id": 3057, "source": "method", "repo": "648540858/wvp-gb28181-pro", "text": "public int removeAllPlatformChannel(String serverId, Integer platformId) { RedisRpcRequest request = buildRequest(\"platform/removeAllChannel\", platformId); request.setToId(serverId); RedisRpcResponse response = redisRpcConfig.request(request, 20, TimeUnit.SECONDS); if(response == null) { return 0; } return Integer.parseInt(response.getBody().toString()); }", "tokens": 86} {"id": 3150, "source": "method", "repo": "648540858/wvp-gb28181-pro", "text": "private static int count(String value, String needle) { int count = 0; int index = 0; while ((index = value.indexOf(needle, index)) >= 0) { count++; index += needle.length(); } return count; }", "tokens": 57} {"id": 3203, "source": "method", "repo": "721806280/lark-notice-plugin", "text": "/** Returns all available notification occasions for UI selection rendering in Jelly files. @return An array containing all values of {@link NoticeOccasionEnum}. */ public NoticeOccasionEnum[] getAllNoticeOccasions() { return NoticeOccasionEnum.values(); }", "tokens": 51} {"id": 3411, "source": "method", "repo": "721806280/lark-notice-plugin", "text": "public static String buildMessageButtonChangeLog(Locale locale) { return get(locale, \"build.message.button.change.log\"); }", "tokens": 30} {"id": 3493, "source": "method", "repo": "721806280/lark-notice-plugin", "text": "/** Clears all cached senders so future resolution reflects current configuration. */ public void clear() { cache().clear(); }", "tokens": 27} {"id": 3589, "source": "method", "repo": "721806280/lark-notice-plugin", "text": "private static String icon(BuildField.Kind kind) { return switch (kind) { case PROJECT -> \"\ud83d\udccb\"; case JOB -> \"\ud83d\udd22\"; case STATUS -> \"\ud83c\udf1f\"; case DURATION -> \"\ud83d\udd50\"; case EXECUTOR -> \"\ud83d\udc64\"; }; }", "tokens": 57} {"id": 3623, "source": "method", "repo": "721806280/lark-notice-plugin", "text": "/** Resolves available notifier configs from multibranch branch property. @param job Jenkins job @return optional config list from {@link LarkBranchJobProperty} */ private static Optional> resolveFromBranchProperty(Job job) { return Optional.ofNullable(job.getProperty(BranchJobProperty.class)) .map(BranchJobProperty::getBranch) .map(branch -> branch.getProperty(LarkBranchJobProperty.class)) .flatMap(NotifierConfigService::resolveFromProvider); }", "tokens": 105} {"id": 3626, "source": "method", "repo": "721806280/lark-notice-plugin", "text": "private RobotConfigTestService() { throw new UnsupportedOperationException(\"Utility class cannot be instantiated\"); }", "tokens": 20} {"id": 3842, "source": "method", "repo": "721806280/lark-notice-plugin", "text": "public void toRobotTypeShouldMapToRuntimeType() { assertEquals(RobotType.DING_TALK, RobotProtocolType.DING_TALK.toRobotType()); assertEquals(RobotType.WECHAT_WORK, RobotProtocolType.WECHAT_WORK.toRobotType()); assertEquals(RobotType.LARK, RobotProtocolType.LARK_COMPATIBLE.toRobotType()); }", "tokens": 76} {"id": 3973, "source": "method", "repo": "721806280/lark-notice-plugin", "text": "public void setUp(JenkinsRule rule) { this.jenkins = rule; TestRobots.install(\"robot-lark\", RobotProtocolType.LARK_COMPATIBLE, \"http://127.0.0.1:1/open-apis/bot/v2/hook/x\"); }", "tokens": 63} {"id": 4006, "source": "method", "repo": "721806280/lark-notice-plugin", "text": "/** Builds a runtime sender configuration. @param robotType robot platform @param webhook webhook URL @param keys security keyword, may be {@code null} @return runtime configuration */ public static RobotConfigModel configModel(RobotType robotType, String webhook, String keys) { RobotConfigModel model = new RobotConfigModel(); model.setRobotType(robotType); model.setWebhook(webhook); model.setKeys(keys); return model; }", "tokens": 93} {"id": 4151, "source": "method", "repo": "734839030/seezoon-stack", "text": "public SysDict findByTypeAndCode(@NotBlank String type, @NotBlank String code) { SysDictCondition condition = new SysDictCondition(); condition.setType(type); condition.setCode(code); return this.findOne(condition); }", "tokens": 50} {"id": 4194, "source": "method", "repo": "734839030/seezoon-stack", "text": "public static DataAuthority getInstance() { return instance; }", "tokens": 12} {"id": 4232, "source": "method", "repo": "734839030/seezoon-stack", "text": "public FileHandler minioFileHandler() { return new MinioHandler(seezoonProperties.getFile()); }", "tokens": 24} {"id": 4872, "source": "method", "repo": "839128/bus", "text": "/** Returns the target project id. @return the result */ public Long getTargetProjectId() { return targetProjectId; }", "tokens": 24} {"id": 4997, "source": "method", "repo": "839128/bus", "text": "/** Reads the fully. @param b the b. @throws IOException if the operation cannot be completed. */ public void readFully(byte[] b) throws IOException { readFully(b, 0, b.length); }", "tokens": 48} {"id": 5065, "source": "method", "repo": "839128/bus", "text": "/** Executes the inverted operation. @return the operation result. */ public ByteLut inverted() { return new ByteLut(name + \" inverse\", ByteLutCollection.invert(lutTable != null ? lutTable : DEFAULT_GRAY_LUT), source == null ? null : source.reversed()); }", "tokens": 66} {"id": 5150, "source": "method", "repo": "839128/bus", "text": "/** Creates a single typed attribute. @param descriptor attribute descriptor @param value attribute value @param value type @return immutable attributes */ public static Attributes of(AttributeDescriptor descriptor, T value) { return builder().put(descriptor, value).build(); }", "tokens": 63} {"id": 5276, "source": "method", "repo": "839128/bus", "text": "/** Schedules periodic health checks. */ private void scheduleHealthCheck() { ScheduledExecutorService currentScheduler = ensureScheduler(); long intervalSeconds = bindingOptions.resolveWorkerHealthIntervalSeconds(); currentScheduler .scheduleWithFixedDelay(this::safeHealthCheck, intervalSeconds, intervalSeconds, TimeUnit.SECONDS); }", "tokens": 60} {"id": 5592, "source": "method", "repo": "a466350665/smart-sso", "text": "public TicketGrantingTicketContent get(String tgt) { ExpirationWrapper wrapper = tgtMap.get(tgt); if (wrapper == null || wrapper.checkExpired()) { return null; } return wrapper.getObject(); }", "tokens": 56} {"id": 5988, "source": "method", "repo": "aaberg/sql2o", "text": "public void setParameter(PreparedStatement statement, int paramIdx, InputStream value) throws SQLException { statement.setBinaryStream(paramIdx, value); }", "tokens": 33} {"id": 5990, "source": "method", "repo": "aaberg/sql2o", "text": "public void setParameter(PreparedStatement statement, int paramIdx, Integer value) throws SQLException { if (value == null) { statement.setNull(paramIdx, Types.INTEGER); } else { statement.setInt(paramIdx, value); } }", "tokens": 55} {"id": 6183, "source": "method", "repo": "aaberg/sql2o", "text": "public void insertUser(Query insertQuery, int idx) { insertQuery.addParameter(\"name\", \"a name \" + idx) .addParameter(\"email\", String.format(\"test%s@email.com\", idx)) .addParameter(\"text\", \"some text\").addToBatch(); }", "tokens": 62} {"id": 6285, "source": "method", "repo": "aaberg/sql2o", "text": "public boolean isUsableForClass(String className) { return className.startsWith(\"com.ibm.db2.jcc.DB2\"); }", "tokens": 32} {"id": 6333, "source": "method", "repo": "aatarasoff/spring-thrift-starter", "text": "public KeyedObjectPool thriftClientsPool() { GenericKeyedObjectPoolConfig poolConfig = new GenericKeyedObjectPoolConfig<>(); poolConfig.setMaxTotal(maxTotalThreads); poolConfig.setMaxIdlePerKey(maxIdleThreads); poolConfig.setMaxTotalPerKey(maxThreads); poolConfig.setJmxEnabled(false); //cause spring will autodetect itself return new ThriftClientPool(thriftClientPoolFactory(), poolConfig); }", "tokens": 107} {"id": 6476, "source": "method", "repo": "abdelrahmanbayoumi/azkar-app", "text": "private void onPlayClicked() { if (isMediaPlaying()) { pauseOrStopMedia(null); } else { final String audioPath = timedAzkarList.get(currentIndex).getAudio(); Logger.debug(audioPath); final File audioFile = new File(System.getProperty(\"java.io.tmpdir\") + \"/\" + Constants.APP_NAME + \"/\" + \"downloaded_audio.mp3\"); if (audioFile.delete()) { Logger.debug(\"File deleted successfully\"); } progressBox.setVisible(true); new Thread(() -> { if (FileDownloader.downloadFile(audioPath, audioFile)) { Platform.runLater(() -> playMedia(audioFile)); } else { Platform.runLater(() -> BuilderUI.showOkAlert(Alert.AlertType.ERROR, Utility.toUTF(bundle.getString(\"errorDownloadingAudio\")), bundle)); } Platform.runLater(() -> progressBox.setVisible(false)); }).start(); } }", "tokens": 202} {"id": 6518, "source": "method", "repo": "abdelrahmanbayoumi/azkar-app", "text": "public void initialize(URL location, ResourceBundle resources) { azkarSettings = Settings.getInstance().getAzkarSettings(); playIcon = new FontAwesomeIconView(FontAwesomeIcon.PLAY); playIcon.setStyle(\"-fx-fill: -fx-reverse-secondary;\"); playIcon.setGlyphSize(30); pauseIcon = new FontAwesomeIconView(FontAwesomeIcon.PAUSE); pauseIcon.setGlyphSize(30); pauseIcon.setStyle(\"-fx-fill: -fx-reverse-secondary;\"); audioBox.setOnAction(event -> { playButton.setDisable(Muezzin.NO_SOUND.equals(audioBox.getValue())); prayerVolumeBox.setDisable(Muezzin.NO_SOUND.equals(audioBox.getValue())); if (stopIfPlaying()) { setPlayIcon(); } Settings.getInstance().getPrayerTimeSettings().setAdhanAudio(getValue().getFileName()); }); PopOverUtil.init(uploadButton, Utility.toUTF(LanguageBundle.getInstance().getResourceBundle().getString(\"uploadNewAudioTooltip\"))); prayerVolumeSlider.valueProperty().addListener((observable, oldValue, newValue) -> { azkarSettings.setPrayerVolume((int) prayerVolumeSlider.getValue()); playButton.requestFocus(); previousValue = (double) oldValue; // multiply duration by percentage calculated by // slider position if (prayerVolumeSlider.getValue() > 0) { volume.setIcon(OctIcon.UNMUTE); } else if (prayerVolumeSlider.getValue() == 0) { volume.setIcon(OctIcon.MUTE); } if (null != MEDIA_PLAYER) { MEDIA_PLAYER.setVolume(azkarSettings.getPrayerVolume() / 100.0); } }); root.setDisable(Settings.getInstance().getPrayerTimeSettings().isPrayersReminderStopped()); Settings.getInstance().getPrayerTimeSettings().addObserver((o, arg) -> root.setDisable(Settings.getInstance().getPrayerTimeSettings().isPrayersReminderStopped())); }", "tokens": 428} {"id": 6519, "source": "method", "repo": "abdelrahmanbayoumi/azkar-app", "text": "private void uploadAudio() { final FileChooser fileChooser = new FileChooser(); fileChooser.setInitialDirectory(new File(System.getProperty(\"user.home\"))); // TODO: support & test other audio formats fileChooser.getExtensionFilters().addAll( new FileChooser.ExtensionFilter(\"Audio Files\", \"*.mp3\") ); final File selectedFile = fileChooser.showOpenDialog(uploadButton.getScene().getWindow()); if (selectedFile != null && selectedFile.isFile()) { Path audioSourcePath = selectedFile.toPath(); String audioTargetPath = Constants.assetsPath + \"/audio/adhan/\" + selectedFile.getName(); Path path = Paths.get(audioTargetPath); try { Files.copy(audioSourcePath, path, StandardCopyOption.REPLACE_EXISTING); setMuezzins(); Muezzin newMuezzin = audioBox.getItems().stream() .filter(muezzin -> muezzin.getFileName().equals(selectedFile.getName())).findAny() .orElse(Muezzin.NO_SOUND); audioBox.setValue(newMuezzin); } catch (IOException e) { Logger.error(null, e, getClass().getName() + \".uploadAudio()\"); final ResourceBundle bundle = LanguageBundle.getInstance().getResourceBundle(); BuilderUI.showOkAlert(Alert.AlertType.ERROR, Utility.toUTF(bundle.getString(\"errorUploadAudio\")), bundle); } } }", "tokens": 301} {"id": 6709, "source": "method", "repo": "abdelrahmanbayoumi/azkar-app", "text": "public void setDelete(TableViewButton delete) { this.delete = delete; }", "tokens": 19} {"id": 6736, "source": "method", "repo": "abdelrahmanbayoumi/azkar-app", "text": "public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; City city = (City) o; return Double.compare(city.latitude, latitude) == 0 && Double.compare(city.longitude, longitude) == 0 && Double.compare(city.timezone, timezone) == 0 && countryCode.equals(city.countryCode) && englishName.equals(city.englishName) && Objects.equals(arabicName, city.arabicName); }", "tokens": 123} {"id": 6745, "source": "method", "repo": "abdelrahmanbayoumi/azkar-app", "text": "public double getLatitude() { return latitude; }", "tokens": 11} {"id": 6888, "source": "method", "repo": "abdelrahmanbayoumi/azkar-app", "text": "public void initialize(URL url, ResourceBundle rb) { }", "tokens": 13} {"id": 6896, "source": "method", "repo": "abdelrahmanbayoumi/azkar-app", "text": "public void run() { task.run(); Logger.debug(\"run():- \" + Thread.currentThread().getName()); }", "tokens": 27} {"id": 6976, "source": "method", "repo": "abdelrahmanbayoumi/azkar-app", "text": "public PreferencesType getKey() { return key; }", "tokens": 12} {"id": 6985, "source": "method", "repo": "abdelrahmanbayoumi/azkar-app", "text": "/** Increment the counter for a specific statistic */ public void increment(StatisticsType key) { int currentValue = getInt(key); set(key, String.valueOf(currentValue + 1)); }", "tokens": 40} {"id": 7015, "source": "method", "repo": "abdelrahmanbayoumi/azkar-app", "text": "/** Copy file from source to destination if the destination file is not exist or not a directory if the destination file is exist and not a directory the file will not be copied @param from source path to copy from @param to destination path to copy to @throws IOException if the file is not found or can't be read */ public static void copyIfNotExist(Path from, Path to) throws IOException { File f = new File(to.toString()); if (f.exists() && !f.isDirectory()) { return; } Files.copy(from, to, StandardCopyOption.REPLACE_EXISTING); }", "tokens": 125} {"id": 7207, "source": "method", "repo": "abel533/mapper", "text": "public void testSafeUpdateNull2() { SqlSession sqlSession = getSqlSession(); try { CountryMapper mapper = sqlSession.getMapper(CountryMapper.class); mapper.updateByExample(null, null); } finally { sqlSession.close(); } }", "tokens": 53} {"id": 7208, "source": "method", "repo": "abel533/mapper", "text": "public void testSafeUpdateByExampleNull() { SqlSession sqlSession = getSqlSession(); try { CountryMapper mapper = sqlSession.getMapper(CountryMapper.class); mapper.updateByExampleSelective(new Country(), null); } finally { sqlSession.close(); } }", "tokens": 57} {"id": 7234, "source": "method", "repo": "abel533/mapper", "text": "public Criteria andCountrynameNotEqualTo(String value) { addCriterion(\"countryname <>\", value, \"countryname\"); return (Criteria) this; }", "tokens": 34} {"id": 7268, "source": "method", "repo": "abel533/mapper", "text": "public void setIsValid(Integer isValid) { this.isValid = isValid; }", "tokens": 17} {"id": 7406, "source": "method", "repo": "abel533/mapper", "text": "protected void addOrCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { if (notNull) { throw new MapperException(\"Between values for \" + property + \" cannot be null\"); } else { return; } } if (property == null) { return; } criteria.add(new Criterion(condition, value1, value2, true)); }", "tokens": 94} {"id": 7501, "source": "method", "repo": "abel533/mapper", "text": "public void testUnderlineToCamelhump() { Assert.assertEquals(\"foo\", StringUtil.underlineToCamelhump(\"foo\")); Assert.assertEquals(\"foo\", StringUtil.underlineToCamelhump(\"Foo\")); }", "tokens": 46} {"id": 7595, "source": "method", "repo": "abel533/mapper", "text": "public SqlSessionFactory getFactory() { if (factory == null) { builderMapperHelper(); factory = factoryBuilder.build(config); } return factory; }", "tokens": 34} {"id": 7906, "source": "method", "repo": "abrensch/brouter", "text": "public double getTotalEnergy() { return 0.; }", "tokens": 13} {"id": 8024, "source": "method", "repo": "abrensch/brouter", "text": "boolean checkStraightHold(VoiceHint input, VoiceHint inputLastSaved, double minRange) { if (input.indexInTrack == 0) return false; boolean badOneWay = false; if (input.badWays != null) { for (MessageData md: input.badWays) { if (md.isBadOneway()) badOneWay = true; } } if (badOneWay && input.lowerBadWayAngle == -181.f && input.higherBadWayAngle == 181.f) return false; if ((input.lowerBadWayAngle != -181.f && Math.abs(input.lowerBadWayAngle) > 135.f && Math.abs(input.higherBadWayAngle) > 35.f) || (input.higherBadWayAngle != 181.f && input.higherBadWayAngle > 135.f && Math.abs(input.lowerBadWayAngle) > 35.f)) return false; return ((Math.abs(input.lowerBadWayAngle) < 35.f || input.higherBadWayAngle < 35.f) || input.goodWay.getPrio() < input.maxBadPrio || input.goodWay.getPrio() > input.oldWay.getPrio()) && (inputLastSaved == null || inputLastSaved.distanceToNext > minRange) && (input.distanceToNext > minRange) ; }", "tokens": 329} {"id": 8049, "source": "method", "repo": "abrensch/brouter", "text": "/** encode internal lookup data to a byte array */ public byte[] encode() { if (!lookupDataValid) throw new IllegalArgumentException(\"internal error: encoding undefined data?\"); return encode(lookupData); }", "tokens": 42} {"id": 8078, "source": "method", "repo": "abrensch/brouter", "text": "public String usedTagList() { StringBuilder sb = new StringBuilder(); for (int inum = 0; inum < lookupValues.size(); inum++) { if (lookupIdxUsed[inum]) { if (sb.length() > 0) { sb.append(','); } sb.append(lookupNames.get(inum)); } } return sb.toString(); }", "tokens": 82} {"id": 8240, "source": "method", "repo": "abrensch/brouter", "text": "static String genFilenameXY(int srtmLonIdx, int srtmLatIdx) { String slonidx = \"0\" + srtmLonIdx; String slatidx = \"0\" + srtmLatIdx; return \"srtm_\" + slonidx.substring(slonidx.length() - 2) + \"_\" + slatidx.substring(slatidx.length() - 2); }", "tokens": 94} {"id": 8263, "source": "method", "repo": "abrensch/brouter", "text": "private int getTileIndex(int ilon, int ilat) { int lon = ilon / 45000000; int lat = ilat / 30000000; if (lon < 0 || lon > 7 || lat < 0 || lat > 5) throw new IllegalArgumentException(\"illegal pos: \" + ilon + \",\" + ilat); return lon * 6 + lat; }", "tokens": 97} {"id": 8314, "source": "method", "repo": "abrensch/brouter", "text": "public OsmLink(OsmNode source, OsmNode target) { n1 = source; n2 = target; }", "tokens": 25} {"id": 8316, "source": "method", "repo": "abrensch/brouter", "text": "/** Get the relevant next-pointer for the given source */ public final OsmLink getNext(OsmNode source) { return n2 != source && n2 != null ? next : previous; /* if ( n2 != null && n2 != source ) { return next; } else if ( n1 != null && n1 != source ) { return previous; } else { throw new IllegalArgumentException( \"internal error: gextNext: unknown source\" ); } */ }", "tokens": 101} {"id": 8319, "source": "method", "repo": "abrensch/brouter", "text": "public final boolean isReverse(OsmNode source) { return n1 != source && n1 != null; /* if ( n2 != null && n2 != source ) { return false; } else if ( n1 != null && n1 != source ) { return true; } else { throw new IllegalArgumentException( \"internal error: isReverse: unknown source\" ); } */ }", "tokens": 83} {"id": 8345, "source": "method", "repo": "abrensch/brouter", "text": "public boolean isInMemoryBounds(int npaths, boolean extend) { // long total = nodesCreated * 76L + linksCreated * 48L; long total = nodesCreated * 95L + npaths * 200L; if (extend) { total += 100000; // when extending, try to have 1 MB space long delta = total + 1900000 - currentmaxmem; if (delta > 0) { currentmaxmem += delta; if (currentmaxmem > maxmem) { currentmaxmem = maxmem; } } } return total <= currentmaxmem; }", "tokens": 141} {"id": 8460, "source": "method", "repo": "abrensch/brouter", "text": "public boolean hasUpToDateLookups() { BExpressionMetaData meta = new BExpressionMetaData(); meta.readMetaData(new File(profileDir, \"lookups.dat\")); return meta.lookupVersion == 10; }", "tokens": 47} {"id": 8693, "source": "method", "repo": "abrensch/brouter", "text": "private boolean contains(long id, byte[] rv) { // determine the first empty array int bp = size; // treat size as bitpattern int idx = 1; while (bp != 0) { if ((bp & 1) == 1) { // array at idx is valid, check if (contains(idx, id, rv)) { return true; } } idx++; bp >>= 1; } return false; }", "tokens": 95} {"id": 8965, "source": "method", "repo": "abtsoftware/scichart.android.examples", "text": "public final boolean isInitialized() { return isInitialized; }", "tokens": 13} {"id": 8990, "source": "method", "repo": "abtsoftware/scichart.android.examples", "text": "private static int sqr(int value) { return value * value; }", "tokens": 17} {"id": 9161, "source": "method", "repo": "abtsoftware/scichart.android.examples", "text": "private void addPointAnimated() { requireActivity().runOnUiThread(() -> { animator.cancel(); UpdateSuspender.using(binding.surface, () -> { yValue = random.nextDouble() * MAX_Y_VALUE; dataSeries.append(currentXValue, yValue); }); animator.start(); currentXValue += X_RANGE_STEP; animateVisibleRangeIfNeeded(); }); }", "tokens": 83} {"id": 9177, "source": "method", "repo": "abtsoftware/scichart.android.examples", "text": "private void refreshData() { requireActivity().runOnUiThread(() -> { animator1.cancel(); animator2.cancel(); UpdateSuspender.using(binding.surface, () -> { for (int i = 0; i < X_VALUES_COUNT; i++) { dataSeries1.updateYAt(i, getRandomYValue()); dataSeries2.updateYAt(i, getRandomYValue()); } }); animator1.start(); animator2.start(); }); }", "tokens": 101} {"id": 9232, "source": "method", "repo": "abtsoftware/scichart.android.examples", "text": "private void resetChart() { new Handler().postDelayed(() -> { final SciChartSurface surface = binding.surface; UpdateSuspender.using(surface, () -> { for (int i = 0; i < surface.getRenderableSeries().size(); i++) { surface.getRenderableSeries().get(i).getDataSeries().clear(); } }); }, 100); maLow = new MovingAverage(MA_LOW); maHigh = new MovingAverage(MA_HIGH); }", "tokens": 103} {"id": 9467, "source": "method", "repo": "abtsoftware/scichart.android.examples", "text": "private NumericAxis3D createNumericAxis3D() { return sciChart3DBuilder.newNumericAxis3D() .withDrawMajorBands(false) .withDrawLabels(false) .withDrawMajorGridLines(false) .withDrawMajorTicks(false) .withDrawMinorGridLines(false) .withDrawMinorTicks(false) .withPlaneBoderThickness(0f) .build(); }", "tokens": 90} {"id": 9538, "source": "method", "repo": "abtsoftware/scichart.android.examples", "text": "public void run() { UpdateSuspender.using(binding.surface, this::appendData); }", "tokens": 21} {"id": 9610, "source": "method", "repo": "adafruit/bluefruit_le_connect_android_v2", "text": "protected static Bundle createFragmentArgs(@Nullable String singlePeripheralIdentifier) { // if singlePeripheralIdentifier is null, uses multi-connect Bundle args = new Bundle(); args.putString(ARG_SINGLEPERIPHERALIDENTIFIER, singlePeripheralIdentifier); return args; }", "tokens": 54} {"id": 9670, "source": "method", "repo": "adafruit/bluefruit_le_connect_android_v2", "text": "CustomVersionViewHolder(View view) { super(view); chooseButton = view.findViewById(R.id.chooseButton); }", "tokens": 28} {"id": 9841, "source": "method", "repo": "adafruit/bluefruit_le_connect_android_v2", "text": "public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_uart_packetitem, parent, false); return new TimestampItemAdapter.ItemViewHolder(view); }", "tokens": 56} {"id": 9905, "source": "method", "repo": "adafruit/bluefruit_le_connect_android_v2", "text": "/** Adjusts a vertical value of the supplied value from the preview scale to the view scale. */ public float scaleY(float vertical) { return vertical * mOverlay.mHeightScaleFactor; }", "tokens": 40} {"id": 10085, "source": "method", "repo": "adafruit/bluefruit_le_connect_android_v2", "text": "private BleScanner() { mIsScanning = false; }", "tokens": 13} {"id": 10196, "source": "method", "repo": "adafruit/bluefruit_le_connect_android_v2", "text": "public void startUpdatesCheck(@NonNull Context context, @NonNull BlePeripheral blePeripheral) { if (mIsCheckingFirmwareUpdates) { Log.w(TAG, \"Already checking firmware updates. Skipped...\"); return; } mIsCheckingFirmwareUpdates = true; DfuUpdater.checkUpdatesForPeripheral(context, blePeripheral, false, false, DfuUpdater.getIgnoredVersion(context), (isUpdateAvailable, latestRelease, deviceDfuInfo) -> { mIsCheckingFirmwareUpdates = false; final Handler mainHandler = new Handler(Looper.getMainLooper()); mainHandler.post(() -> mDfuCheckResult.setValue(new DfuCheckResult(blePeripheral, isUpdateAvailable, latestRelease, deviceDfuInfo))); }); }", "tokens": 152} {"id": 10309, "source": "method", "repo": "adafruit/bluefruit_le_connect_android_v2", "text": "public static float convertDpToPixel(final Context context, final float dp) { if (context != null) { return dp * context.getResources().getDisplayMetrics().density; } else { return 0f; } }", "tokens": 48} {"id": 10347, "source": "method", "repo": "adafruit/bluefruit_le_connect_android_v2", "text": "/** Constructs a new Rectangle whose upper-left corner is the specified Point, and whose width and height are both zero. @param p a Point that is the top left corner of the Rectangle */ public Rectangle(Point p) { this(p.x, p.y, 0, 0); }", "tokens": 76} {"id": 10473, "source": "method", "repo": "adafruit/bluefruit_le_connect_android_v2", "text": "/** Store details of sent messages so we can handle \"deliveryComplete\" callbacks from the mqttClient @param topic @param msg @param messageToken @param invocationContext @param activityToken */ private void storeSendDetails(final String topic, final MqttMessage msg, final IMqttDeliveryToken messageToken, final String invocationContext, final String activityToken) { savedTopics.put(messageToken, topic); savedSentMessages.put(messageToken, msg); savedActivityTokens.put(messageToken, activityToken); savedInvocationContexts.put(messageToken, invocationContext); }", "tokens": 122} {"id": 10555, "source": "method", "repo": "adelf/idea-php-dotenv-plugin", "text": "public boolean acceptFile(VirtualFile file) { return file.getFileType().equals(GoFileType.INSTANCE); }", "tokens": 24} {"id": 10650, "source": "method", "repo": "adelf/idea-php-dotenv-plugin", "text": "public static boolean property(PsiBuilder b, int l) { if (!recursion_guard_(b, l, \"property\")) return false; if (!nextTokenIs(b, KEY_CHARS)) return false; boolean r; Marker m = enter_section_(b); r = property_0(b, l + 1); if (!r) r = property_1(b, l + 1); exit_section_(b, m, PROPERTY, r); return r; }", "tokens": 105} {"id": 10677, "source": "method", "repo": "adelf/idea-php-dotenv-plugin", "text": "public void accept(@NotNull DotEnvVisitor visitor) { visitor.visitProperty(this); }", "tokens": 20} {"id": 10755, "source": "method", "repo": "adelf/idea-php-dotenv-plugin", "text": "public ID getName() { return KEY; }", "tokens": 15} {"id": 10818, "source": "method", "repo": "adelf/idea-php-dotenv-plugin", "text": "public static EnvironmentVariablesUsagesProvider[] getEnvVariablesUsagesProviders() { return usageProvidersEP.getExtensions(); }", "tokens": 25} {"id": 10857, "source": "method", "repo": "adelf/idea-php-dotenv-plugin", "text": "public void testIncorrectDelimiterInspection() { doInspectionTest(new IncorrectDelimiterInspection(), Collections.singletonList(\"INCORRECT-DELIMITER\")); }", "tokens": 29} {"id": 10936, "source": "method", "repo": "adjust/android_sdk", "text": "private static boolean resolveContentProvider(final Context applicationContext, final String authority) { try { return (applicationContext.getPackageManager() .resolveContentProvider(authority, 0) != null); } catch (Exception e) { return false; } }", "tokens": 54} {"id": 10998, "source": "method", "repo": "adjust/android_sdk", "text": "public void addGlobalCallbackParameter(String key, String value) { addGlobalCallbackParameter(key, value, null); }", "tokens": 27} {"id": 11020, "source": "method", "repo": "adjust/android_sdk", "text": "public void disablePlayStoreKidsComplianceInDelay(String bridgeToken) { if (!isBridgeAuthorized(bridgeToken)) { return; } if (!isInitialized()) { return; } Adjust.disablePlayStoreKidsComplianceInDelay(); }", "tokens": 50} {"id": 11028, "source": "method", "repo": "adjust/android_sdk", "text": "public void getAttribution(final String callback) { getAttribution(callback, null); }", "tokens": 19} {"id": 11165, "source": "method", "repo": "adjust/android_sdk", "text": "private void readActivityStateI(Context context) { try { activityState = Util.readObject(context, ACTIVITY_STATE_FILENAME, ACTIVITY_STATE_NAME, ActivityState.class); } catch (Exception e) { logger.error(\"Failed to read %s file (%s)\", ACTIVITY_STATE_NAME, e.getMessage()); activityState = null; } }", "tokens": 81} {"id": 11185, "source": "method", "repo": "adjust/android_sdk", "text": "public void setCallbackParameters(Map callbackParameters) { this.callbackParameters = callbackParameters; }", "tokens": 26} {"id": 11317, "source": "method", "repo": "adjust/android_sdk", "text": "URLGetConnection(HttpsURLConnection httpsURLConnection, URL url) { this.httpsURLConnection = httpsURLConnection; this.url = url; }", "tokens": 29} {"id": 11350, "source": "method", "repo": "adjust/android_sdk", "text": "/** Called to disable SDK. */ public void disable() { this.startEnabled = false; if (checkActivityHandler(false, \"enabled mode\", \"disabled mode\")) { activityHandler.setEnabled(false); } }", "tokens": 46} {"id": 11443, "source": "method", "repo": "adjust/android_sdk", "text": "private void checkDeeplinkInSessionResponseI(SessionResponseData sessionResponseData) { if (sessionResponseData.jsonResponse == null) { return; } String deeplinkString = sessionResponseData.jsonResponse.optString(\"deeplink\", null); if (deeplinkString == null) { return; } sessionResponseData.deeplink = Uri.parse(deeplinkString); }", "tokens": 78} {"id": 11546, "source": "method", "repo": "adjust/android_sdk", "text": "private boolean containsFireAdId(Map parameters) { if (parameters == null) { return false; } return parameters.containsKey(\"fire_adid\"); }", "tokens": 39} {"id": 11641, "source": "method", "repo": "adjust/android_sdk", "text": "/** Get a long value from shared preferences. @param key Key for which long value should be retrieved @param defaultValue Default value to be returned if nothing found in shared preferences @return Long value for given key saved in shared preferences */ private synchronized long getLong(final String key, final long defaultValue) { if (sharedPreferences != null) { try { return sharedPreferences.getLong(key, defaultValue); } catch (ClassCastException e) { return defaultValue; } } else { return defaultValue; } }", "tokens": 103} {"id": 11824, "source": "method", "repo": "adjust/android_sdk", "text": "private void teardown(boolean shutdownNow) { if (executor != null) { if (shutdownNow) { debug(\"test library executor shutdownNow\"); executor.shutdownNow(); } else { debug(\"test library executor shutdown\"); executor.shutdown(); } } executor = null; infoToServer = null; if (waitControlQueue != null) { waitControlQueue.clear(); } waitControlQueue = null; }", "tokens": 83} {"id": 11861, "source": "method", "repo": "advanced-rocketry/advancedrocketry", "text": "/** Adds the. @param listener the listener */ public void add(ICriterionTrigger.Listener listener) { this.listeners.add(listener); }", "tokens": 32} {"id": 11904, "source": "method", "repo": "advanced-rocketry/advancedrocketry", "text": "/** @return the power per tick the satellite produces */ public int getPowerPerTick() { return satelliteProperties.getPowerGeneration(); }", "tokens": 29} {"id": 11991, "source": "method", "repo": "advanced-rocketry/advancedrocketry", "text": "public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { TileEntity tile = world.getTileEntity(pos); //Do some fancy fluid stuff if (FluidUtils.containsFluid(player.getHeldItem(hand))) { FluidUtil.interactWithFluidHandler(player, hand, ((TileFluidHatch) tile).getFluidTank()); } else if(!world.isRemote) player.openGui(LibVulpes.instance, guiId.MODULAR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); return true; }", "tokens": 139} {"id": 12120, "source": "method", "repo": "advanced-rocketry/advancedrocketry", "text": "/** @return the multiplier compared to Earth(1040W) for peak insolation of the body, ignoring the atmosphere */ public double getPeakInsolationMultiplierWithoutAtmosphere() { //Set peak insolation multiplier without atmosphere -- we do this here because I've had problems with it in the past in the XML loader, and people keep asking to change it peakInsolationMultiplierWithoutAtmosphere = AstronomicalBodyHelper.getStellarBrightness(star, getSolarOrbitalDistance()) * 1.308d; return peakInsolationMultiplierWithoutAtmosphere; }", "tokens": 129} {"id": 12553, "source": "method", "repo": "advanced-rocketry/advancedrocketry", "text": "public NBTTagCompound writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); nbt.setInteger(\"selected\", radioButton.getOptionSelected()); inv.writeToNBT(nbt); nbt.setBoolean(\"oofluid\", outOfFluid); return nbt; }", "tokens": 50} {"id": 12807, "source": "method", "repo": "adyen/adyen-java-api-library", "text": "public void setTerminalApiCloudEndpoint(String terminalApiCloudEndpoint) { this.terminalApiCloudEndpoint = terminalApiCloudEndpoint; }", "tokens": 29} {"id": 12866, "source": "method", "repo": "adyen/adyen-java-api-library", "text": "public void setMerchantDevice(MerchantDevice merchantDevice) { this.merchantDevice = merchantDevice; }", "tokens": 22} {"id": 12980, "source": "method", "repo": "adyen/adyen-java-api-library", "text": "/** Sets the value of the customerApprovedFlag property. @param value allowed object is {@link Boolean } */ public void setCustomerApprovedFlag(Boolean value) { this.customerApprovedFlag = value; }", "tokens": 43} {"id": 13016, "source": "method", "repo": "adyen/adyen-java-api-library", "text": "/** Gets the value of the disableCancelFlag property. @return possible object is {@link Boolean } */ public boolean isDisableCancelFlag() { if (disableCancelFlag == null) { return false; } else { return disableCancelFlag; } }", "tokens": 52} {"id": 13028, "source": "method", "repo": "adyen/adyen-java-api-library", "text": "/** Gets the value of the cumulativeAmount property. @return possible object is {@link BigDecimal } */ public BigDecimal getCumulativeAmount() { return cumulativeAmount; }", "tokens": 35} {"id": 13094, "source": "method", "repo": "adyen/adyen-java-api-library", "text": "/** Create an instance of {@link SensitiveMobileData } @return the sensitive mobile data */ public SensitiveMobileData createSensitiveMobileData() { return new SensitiveMobileData(); }", "tokens": 39} {"id": 13110, "source": "method", "repo": "adyen/adyen-java-api-library", "text": "/** Create an instance of {@link KeyTransport } @return the key transport */ public KeyTransport createKeyTransport() { return new KeyTransport(); }", "tokens": 31} {"id": 13216, "source": "method", "repo": "adyen/adyen-java-api-library", "text": "/** Gets the value of the cardReaderPowerOffRequest property. @return possible object is {@link CardReaderPowerOffRequest } */ public CardReaderPowerOffRequest getCardReaderPowerOffRequest() { return cardReaderPowerOffRequest; }", "tokens": 50} {"id": 13296, "source": "method", "repo": "adyen/adyen-java-api-library", "text": "public String getUniqueTerminalId() { return uniqueTerminalId; }", "tokens": 15} {"id": 13404, "source": "method", "repo": "adyen/adyen-java-api-library", "text": "/** Should make a payment */ public void testPaymentSuccess() throws Exception { Client client = createMockClientFromFile(\"mocks/checkout/paymentResponse.json\"); CardDetails cardDetails = new CardDetails() .type(CardDetails.TypeEnum.SCHEME) .encryptedCardNumber(\"5136333333333335\") .holderName(\"John Doe\") .cvc(\"737\") .encryptedExpiryMonth(\"08\") .encryptedExpiryYear(\"2018\"); PaymentRequest paymentRequest = new PaymentRequest() .merchantAccount(\"YOUR_MERCHANT_ACCOUNT\") .reference(\"YOUR_REFERENCE\") .amount(new Amount().currency(\"EUR\").value(1000L)) .returnUrl(\"https://your-company.example.org/checkout?shopperOrder=12xy..\") .paymentMethod(new CheckoutPaymentMethod(cardDetails)); PaymentsApi checkout = new PaymentsApi(client); PaymentResponse paymentResponse = checkout.payments(paymentRequest); assertEquals(\"993617895204576J\", paymentResponse.getPspReference()); assertEquals( CheckoutRedirectAction.TypeEnum.REDIRECT, paymentResponse.getAction().getCheckoutRedirectAction().getType()); assertEquals( \"https://checkoutshopper-test.adyen.com/checkoutshopper/threeDS/redirect?MD=M2R...\", paymentResponse.getAction().getCheckoutRedirectAction().getUrl()); }", "tokens": 322} {"id": 13511, "source": "method", "repo": "adyen/adyen-java-api-library", "text": "public void asyncEncryptedSetsPoiIdInEncryptedPayload() throws Exception { Client client = createMockClientFromFile(\"mocks/clouddevice/payment-async-success.json\"); NexoSecurityManager manager = new NexoSecurityManager(DEFAULT_CREDENTIALS); EncryptedCloudDeviceApi api = new EncryptedCloudDeviceApi(client, DEFAULT_CREDENTIALS); CloudDeviceApiRequest cloudDeviceApiRequest = createCloudDeviceAPIPaymentRequest(); cloudDeviceApiRequest.getSaleToPOIRequest().getMessageHeader().setPOIID(null); api.async(\"TestMerchantAccount\", \"MX915-284251016\", cloudDeviceApiRequest); ArgumentCaptor bodyCaptor = ArgumentCaptor.forClass(String.class); verify(client.getHttpClient()) .request(anyString(), bodyCaptor.capture(), any(), anyBoolean(), isNull(), any(), any()); String capturedJson = bodyCaptor.getValue(); CloudDeviceApiSecuredRequest securedRequest = CloudDeviceApiSecuredRequest.fromJson(capturedJson); String decryptedJson = manager.decrypt(securedRequest.getSaleToPOIRequest()); Assertions.assertTrue( decryptedJson.contains(\"\\\"POIID\\\":\\\"MX915-284251016\\\"\"), \"Encrypted payload must contain POIID set to deviceId, but was: \" + decryptedJson); }", "tokens": 278} {"id": 13545, "source": "method", "repo": "adyen/adyen-java-api-library", "text": "/** Load payload as String from JSON file @param filepath @return @throws Exception */ private static String loadFromJson(String filepath) throws Exception { return new String(Files.readAllBytes(Paths.get(filepath))); }", "tokens": 48} {"id": 13828, "source": "method", "repo": "ageerle/ruoyi-ai", "text": "private static HarnessToolExecutionResult failure(HarnessToolCall call, String code, String message, long duration) { return new HarnessToolExecutionResult(call.toolCallId(), call.toolName(), true, code == null || code.isBlank() ? \"tool_execution_failed\" : code, message == null || message.isBlank() ? \"Tool execution failed\" : message, duration); }", "tokens": 77} {"id": 13942, "source": "method", "repo": "ageerle/ruoyi-ai", "text": "private static JsonNode parseJson(String value, String failureCode, String message) { try { return OBJECT_MAPPER.readTree(value); } catch (IOException error) { throw new CommandToolException(failureCode, message, error); } }", "tokens": 52} {"id": 14228, "source": "method", "repo": "agentdid127/resourcepackconverter", "text": "public ChestConverter1_15(PackConverter packConverter) { super(packConverter); }", "tokens": 21} {"id": 14360, "source": "method", "repo": "agentdid127/resourcepackconverter", "text": "public static float multiply(JsonArray lhs, JsonArray rhs, int i) { return lhs.get(i).getAsFloat() * rhs.get(i).getAsFloat(); }", "tokens": 39} {"id": 14376, "source": "method", "repo": "agentdid127/resourcepackconverter", "text": "public static void setStream(PrintStream stream) { Logger.stream = stream; }", "tokens": 18} {"id": 14460, "source": "method", "repo": "agonyforge/arbitrader", "text": "public FeeComputation getFeeComputation() { return feeComputation; }", "tokens": 13} {"id": 14514, "source": "method", "repo": "agonyforge/arbitrader", "text": "public BigDecimal getFixedExposure() { return fixedExposure; }", "tokens": 13} {"id": 14548, "source": "method", "repo": "agonyforge/arbitrader", "text": "private String computeKey(Exchange exchange, Throwable t) { return exchange.getExchangeSpecification().getExchangeName() + \": \" + t.getClass().getSimpleName() + \" \" + t.getMessage(); }", "tokens": 42} {"id": 14566, "source": "method", "repo": "agonyforge/arbitrader", "text": "public SpreadService(TradingConfiguration tradingConfiguration, TickerService tickerService) { this.tradingConfiguration = tradingConfiguration; this.tickerService = tickerService; }", "tokens": 35} {"id": 14614, "source": "method", "repo": "agonyforge/arbitrader", "text": "/** Write an entry in the trade history file. @param arbitrageLog A log message to write to the TRADE_HISTORY_FILE. */ void persistArbitrageToCsvFile(ArbitrageLog arbitrageLog) { final File csvFile = new File(TRADE_HISTORY_FILE); try { if (!csvFile.exists()) { // Add headers first FileUtils.write(csvFile, arbitrageLog.csvHeaders(), StandardCharsets.UTF_8, csvFile.exists()); } FileUtils.write(csvFile, arbitrageLog.toCsv(), StandardCharsets.UTF_8, csvFile.exists()); } catch (IOException e) { LOGGER.error(\"Unable to log the trade into the csv file. Reason: {}\", e.getMessage()); } }", "tokens": 163} {"id": 14638, "source": "method", "repo": "agonyforge/arbitrader", "text": "public BigDecimal getEntryBalance() { return entryBalance; }", "tokens": 13} {"id": 14706, "source": "method", "repo": "agonyforge/arbitrader", "text": "public BigDecimal getIn() { return in; }", "tokens": 11} {"id": 14826, "source": "method", "repo": "agonyforge/arbitrader", "text": "public void testCollectIncrementsByOne() { errorCollectorService.collect(exchange, new NullPointerException(\"Boom!\")); errorCollectorService.collect(exchange, new NullPointerException(\"Boom!\")); List report = errorCollectorService.report(); assertEquals(2, report.size()); assertEquals(HEADER, report.get(0)); assertEquals(EXCHANGE_NAME + \": NullPointerException Boom! x 2\", report.get(1)); }", "tokens": 95} {"id": 14883, "source": "method", "repo": "agonyforge/arbitrader", "text": "public void testSetAndGet() { exchangeFeeCache.setCachedFee(exchange, currencyPair, new ExchangeFee(new BigDecimal(\"0.0025\"), null)); exchangeFeeCache.setCachedFee(exchange, CurrencyPair.BTC_USD, new ExchangeFee(new BigDecimal(\"0.0010\"), new BigDecimal(\"0.0002\"))); exchangeFeeCache.setCachedFee(exchange, CurrencyPair.ETH_USD, new ExchangeFee(new BigDecimal(\"0.0030\"), new BigDecimal(\"0.0001\"))); exchangeFeeCache.setCachedFee(exchange, CurrencyPair.BCC_USD, new ExchangeFee(new BigDecimal(\"0.0030\"), null)); assertTrue(exchangeFeeCache.getCachedFee(exchange, currencyPair).isPresent()); assertEquals(new BigDecimal(\"0.0025\"), exchangeFeeCache.getCachedFee(exchange, currencyPair).get().getTradeFee()); assertFalse(exchangeFeeCache.getCachedFee(exchange, currencyPair).get().getMarginFee().isPresent()); }", "tokens": 216} {"id": 14888, "source": "method", "repo": "agonyforge/arbitrader", "text": "public void setUp() throws IOException { MockitoAnnotations.initMocks(this); objectMapper = new JsonConfiguration().objectMapper(); longExchange = new ExchangeBuilder(\"Long\", CurrencyPair.BTC_USD) .withTradeService() .withOrderBook(100, 100) .withBalance(Currency.USD, new BigDecimal(\"100.00\").setScale(USD_SCALE, RoundingMode.HALF_EVEN)) .build(); shortExchange = new ExchangeBuilder(\"Short\", CurrencyPair.BTC_USD) .withBalance(Currency.USD, new BigDecimal(\"500.00\").setScale(USD_SCALE, RoundingMode.HALF_EVEN)) .build(); }", "tokens": 148} {"id": 14993, "source": "method", "repo": "agricraft/agricraft", "text": "public static Predicate hash() { return predicate(HASH); }", "tokens": 16} {"id": 15223, "source": "method", "repo": "agricraft/agricraft", "text": "public void deserializeNBT(CompoundTag tag) { // read the plants if(tag.contains(AgriNBT.ENTRIES)) { this.plants = tag.getList(AgriNBT.ENTRIES, 10).stream() // filter for CompoundNBT, should always be the case, but is here for safety .filter(plantTag -> plantTag instanceof CompoundTag) // cast to CompoundNBT .map(plantTag -> (CompoundTag) plantTag) // fetch plant from NBT .map(plantTag -> AgriApi.getPlantRegistry().get(plantTag.getString(AgriNBT.PLANT))) // filter for presence of plant in optional .filter(Optional::isPresent) // get plants from optionals .map(Optional::get) // collect to list .collect(Collectors.toList()); } else { this.plants = new ArrayList<>(); } // Populate pages this.initializePages(); // read the index this.setCurrentIndex(tag.contains(AgriNBT.INDEX) ? tag.getInt(AgriNBT.INDEX) : 0); }", "tokens": 224} {"id": 15334, "source": "method", "repo": "agricraft/agricraft", "text": "public boolean isTradeable() { return false; }", "tokens": 12} {"id": 15400, "source": "method", "repo": "agricraft/agricraft", "text": "public int getCeilingCount() { return this.ceilingCount; }", "tokens": 16} {"id": 15473, "source": "method", "repo": "agricraft/agricraft", "text": "public Optional createGreenHouse(Level world, BlockPos pos) { return GreenHouseHandler.getInstance().createGreenHouse(world, pos); }", "tokens": 32} {"id": 15540, "source": "method", "repo": "agricraft/agricraft", "text": "public GenePair(GeneStat gene, Allele first, Allele second) { this.gene = gene; if (first.isDominant(second)) { this.dominant = first; this.recessive = second; } else { this.dominant = second; this.recessive = first; } }", "tokens": 74} {"id": 15546, "source": "method", "repo": "agricraft/agricraft", "text": "public List getParents() { return parents; }", "tokens": 16} {"id": 15554, "source": "method", "repo": "agricraft/agricraft", "text": "public void onPageOpened(Player player, ItemStack stack, IAgriJournalItem journal) {}", "tokens": 20} {"id": 15611, "source": "method", "repo": "agricraft/agricraft", "text": "public GrowConditionBase> dimensionFromKey( BiFunction, IAgriGrowthResponse> response, List tooltips) { return new GrowConditionAmbient<>( RequirementType.DIMENSION, response, Functions.DIMENSION_KEY, tooltips, IAgriGrowCondition.CacheType.FULL ); }", "tokens": 74} {"id": 16067, "source": "method", "repo": "aidenlab/juicebox", "text": "public static ChromosomeHandler getChromosomeSetIntersection(ChromosomeHandler handler1, ChromosomeHandler handler2) { return handler1.getIntersectionWith(handler2); }", "tokens": 35} {"id": 16094, "source": "method", "repo": "aidenlab/juicebox", "text": "private Iterator getNewContactRecordIterator() { return getIteratorContainer().getNewContactRecordIterator(); //return new ContactRecordIterator(reader, this, blockCache); }", "tokens": 39} {"id": 16229, "source": "method", "repo": "aidenlab/juicebox", "text": "public void updateColorSlider(double low, double high) { mainViewPanel.updateColorSlider(hic, low, high, high * 2); }", "tokens": 35} {"id": 16365, "source": "method", "repo": "aidenlab/juicebox", "text": "public List getThresholdOptions() { return optionToStringList(thresholdOption); }", "tokens": 20} {"id": 16368, "source": "method", "repo": "aidenlab/juicebox", "text": "protected int determineHowManyChromosomesWillActuallyRun(Dataset ds, ChromosomeHandler chromosomeHandler, HiCZoom zoom) { int maxProgressStatus = 0; for (Chromosome chr : chromosomeHandler.getChromosomeArrayWithoutAllByAll()) { Matrix matrix = ds.getMatrix(chr, chr); if (matrix == null) continue; if (matrix.getZoomData(zoom) == null) continue; maxProgressStatus++; } return maxProgressStatus; }", "tokens": 98} {"id": 16408, "source": "method", "repo": "aidenlab/juicebox", "text": "private void determineCountsFromInput(String[] args) throws NumberFormatException { uniqueReadPairs = Long.parseLong(args[1]); dupReadPairs = Long.parseLong(args[2]); opticalDups = Long.parseLong(args[3]); }", "tokens": 55} {"id": 16412, "source": "method", "repo": "aidenlab/juicebox", "text": "private static void inPlaceParallelSubtractRowMeans(double[][] matrix, int dim, BitSet bitSet) { double[] rowMeans = new double[dim]; AtomicInteger index = new AtomicInteger(0); ParallelizedJuicerTools.launchParallelizedCode(() -> { int i = index.getAndIncrement(); while (i < dim) { if (bitSet.get(i)) { rowMeans[i] = getVectorMean(matrix[i]); } i = index.getAndIncrement(); } }); AtomicInteger index2 = new AtomicInteger(0); ParallelizedJuicerTools.launchParallelizedCode(() -> { int i = index2.getAndIncrement(); while (i < dim) { if (bitSet.get(i)) { for (int j = 0; j < dim; j++) { matrix[i][j] -= rowMeans[j]; } } i = index2.getAndIncrement(); } }); }", "tokens": 199} {"id": 16509, "source": "method", "repo": "aidenlab/juicebox", "text": "public void mergeScores() { cumulativeInternalControl.mergeScores(); cumulativeInternalList.mergeScores(); }", "tokens": 24} {"id": 16550, "source": "method", "repo": "aidenlab/juicebox", "text": "public static RealMatrix gaussBlur(RealMatrix inputData, int window) { //int numRows = inputData.getRowDimension() - window; //int numCols = inputData.getColumnDimension() - window; //RealMatrix outputData = MatrixTools.cleanArray2DMatrix(numRows, numCols); //RealMatrix outputData = MatrixTools.deepCopy(inputData); int numRows = inputData.getRowDimension(); int numCols = inputData.getColumnDimension(); RealMatrix outputData = new Array2DRowRealMatrix(numRows, numCols); int[] boxSizes = boxesForGauss(window, 3); boxBlur(inputData, outputData, (boxSizes[0]-1)/2); boxBlur(outputData, inputData, (boxSizes[1]-1)/2); boxBlur(inputData, outputData, (boxSizes[2]-1)/2); //double outputDataSum = 0; //for (int i = window/2; i < (numRows-window/2); i++) { // for (int j = window/2; j < (numCols-window/2); j++) { // double sumVal = 0; // for (int rowOffset = 0; rowOffset < window; rowOffset++) { // for (int colOffset = 0; colOffset < window; colOffset++) { // sumVal = sumVal + (inputData.getEntry(i - (int) window/2 + rowOffset, j - (int) window/2 + colOffset) * //Math.exp(-1*(Math.pow((0-window/2+rowOffset),2)+Math.pow((0-window/2+colOffset),2))/(2*Math.pow(window/3,2)))*(1.0d/(2*Math.PI*Math.pow(window/3,2)))); // } // } // outputData.setEntry(i-(window/2),j-(window/2), sumVal); // outputDataSum += sumVal; // } //} return outputData; }", "tokens": 461} {"id": 16552, "source": "method", "repo": "aidenlab/juicebox", "text": "public static void unsafeHandleUpdatingOfNormalizations(SuperAdapter superAdapter, File[] files, boolean isControl, int numCPUThreads) { Dataset ds = superAdapter.getHiC().getDataset(); if (isControl) { ds = superAdapter.getHiC().getControlDataset(); } String[] filePaths = new String[files.length]; for (int i = 0; i < filePaths.length; i++) { filePaths[i] = files[i].getAbsolutePath(); } try { NormVectorInfo normVectorInfo = completeCalculationsNecessaryForUpdatingCustomNormalizations(ds, filePaths, false, numCPUThreads); for (NormalizationType customNormType : normVectorInfo.getNormalizationVectorsMap().keySet()) { ds.addNormalizationType(customNormType); for (NormalizationVector normalizationVector : normVectorInfo.getNormalizationVectorsMap().get(customNormType).values()) { if (normalizationVector == null) { System.out.println(\"error encountered\"); } ds.addNormalizationVectorDirectlyToRAM(normalizationVector); } } System.out.println(\"all custom norms added v2\"); } catch (Exception e) { e.printStackTrace(); } }", "tokens": 256} {"id": 16568, "source": "method", "repo": "aidenlab/juicebox", "text": "void merge(BlockPP other) { for (Map.Entry entry : other.getContactRecordMap().entrySet()) { Point point = entry.getKey(); ContactCount otherValue = entry.getValue(); ContactCount value = contactRecordMap.get(point); if (value == null) { contactRecordMap.put(point, otherValue); } else { value.incrementCount(otherValue.getCounts()); } } }", "tokens": 95} {"id": 16612, "source": "method", "repo": "aidenlab/juicebox", "text": "protected Pair getRandomizedPositions(int chr1, int chr2, int frag1, int frag2, int bp1, int bp2) { FragmentCalculation fragMapToUse; if (fragmentCalculationsForRandomization != null) { FragmentCalculation fragMap1 = findFragMap(fragmentCalculationsForRandomization, chromosomeHandler.getChromosomeFromIndex(chr1).getName(), bp1, frag1); FragmentCalculation fragMap2 = findFragMap(fragmentCalculationsForRandomization, chromosomeHandler.getChromosomeFromIndex(chr2).getName(), bp2, frag2); if (fragMap1 == null && fragMap2 == null) { //noMapFoundCount += 1; return null; } else if (fragMap1 != null && fragMap2 != null && fragMap1 != fragMap2) { //mapDifferentCount += 1; return null; } if (fragMap1 != null) { fragMapToUse = fragMap1; } else { fragMapToUse = fragMap2; } } else { // use default map fragMapToUse = fragmentCalculation; } int newBP1 = randomizePos(fragMapToUse, chromosomeHandler.getChromosomeFromIndex(chr1).getName(), frag1); int newBP2 = randomizePos(fragMapToUse, chromosomeHandler.getChromosomeFromIndex(chr2).getName(), frag2); return new Pair<>(newBP1, newBP2); }", "tokens": 311} {"id": 16796, "source": "method", "repo": "aidenlab/juicebox", "text": "private boolean isDragNotAcceptable(DropTargetDragEvent event) { // Check the available data flavors here // Currently accepting all flavors return (event.getDropAction() & DnDConstants.ACTION_COPY_OR_MOVE) == 0; }", "tokens": 55} {"id": 16817, "source": "method", "repo": "aidenlab/juicebox", "text": "public void setAction(Action action) { Action oldValue = getAction(); firePropertyChange(\"action\", oldValue, action); mainButton.setAction(action); }", "tokens": 34} {"id": 16944, "source": "method", "repo": "aikar/commands", "text": "public boolean isCommandIssuer(Class type) { return CommandSender.class.isAssignableFrom(type); }", "tokens": 21} {"id": 17227, "source": "method", "repo": "aikar/commands", "text": "public Map getPassedArgs() { return this.passedArgs; }", "tokens": 20} {"id": 17233, "source": "method", "repo": "aikar/commands", "text": "public void setPage(int page, int perPage) { this.setPage(page); this.setPerPage(perPage); }", "tokens": 31} {"id": 17320, "source": "method", "repo": "aikar/commands", "text": "public void setResolver(ContextResolver resolver) { this.resolver = resolver; }", "tokens": 22} {"id": 17551, "source": "method", "repo": "aikar/commands", "text": "public void setDefaultConfig(@NotNull CommandConfig defaultConfig) { this.defaultConfig = defaultConfig; }", "tokens": 22} {"id": 17614, "source": "method", "repo": "aikar/commands", "text": "public void sendMessageInternal(String message) { this.source.sendMessage(TextSerializers.LEGACY_FORMATTING_CODE.deserialize(message)); }", "tokens": 32} {"id": 17641, "source": "method", "repo": "aikar/commands", "text": "public boolean testPermission(@NotNull CommandSource source) { return this.hasAnyPermission(manager.getCommandIssuer(source)); }", "tokens": 26} {"id": 17670, "source": "method", "repo": "aikar/commands", "text": "public List complete(CommandCause cause, ArgumentReader.Mutable arguments) throws CommandException { String[] args = argToStrlist(arguments); return getTabCompletions(manager.getCommandIssuer(cause), this.name, args) .stream() .map(CommandCompletion::of) .collect(Collectors.toList()); }", "tokens": 74} {"id": 17823, "source": "method", "repo": "aimacode/aima-java", "text": "/** Induces the decision list from the specified set of examples @param ds a set of examples for constructing the decision list */ public void train(DataSet ds) { this.decisionList = decisionListLearning(ds); }", "tokens": 49} {"id": 17827, "source": "method", "repo": "aimacode/aima-java", "text": "public void train(DataSet ds) { List targets = new ArrayList(); for (Example e : ds.examples) { targets.add(e.targetValue()); } result = Util.mode(targets); }", "tokens": 49} {"id": 17865, "source": "method", "repo": "aimacode/aima-java", "text": "public Object visitTermEquality(TermEquality equality, Object arg) { return equality; }", "tokens": 19} {"id": 17916, "source": "method", "repo": "aimacode/aima-java", "text": "public boolean isUnknownDueToTimeout() { return timedOut && proofs.size() == 0; }", "tokens": 24} {"id": 18232, "source": "method", "repo": "aimacode/aima-java", "text": "public double rayCast(Ray2D ray) { final Ray2D transformedRay = ray.transform(transform); final double squaredHorizontal = horizontalLength*horizontalLength; final double squaredVertical = verticalLength*verticalLength; final double squaredDirectionX = transformedRay.getDirection().getX()*transformedRay.getDirection().getX(); final double divisor = squaredHorizontal*transformedRay.getDirection().getY()*transformedRay.getDirection().getY()+squaredVertical*squaredDirectionX; if(Util.compareDoubles(divisor,0.0d)) return Double.POSITIVE_INFINITY; final double squareRoot = Math.sqrt(squaredHorizontal*squaredVertical*(squaredDirectionX*(squaredVertical-center.getY()*center.getY()+transformedRay.getStart().getY()*(2*center.getY()-transformedRay.getStart().getY()))+transformedRay.getDirection().getY()*(transformedRay.getDirection().getY()*(squaredHorizontal-center.getX()*center.getX()+transformedRay.getStart().getX()*(2*center.getX()-transformedRay.getStart().getX()))+2*transformedRay.getDirection().getX()*(transformedRay.getStart().getX()*(transformedRay.getStart().getY()-center.getY())+center.getX()*(center.getY()-transformedRay.getStart().getY()))))); if(Util.compareDoubles(squareRoot,Double.NaN)) return Double.POSITIVE_INFINITY; final double tmpFactor1 = squaredVertical*transformedRay.getDirection().getX(); final double tmpFactor2 = squaredHorizontal*transformedRay.getDirection().getY(); final double factors = tmpFactor1*center.getX() - tmpFactor1*transformedRay.getStart().getX() + tmpFactor2*center.getY() - tmpFactor2*transformedRay.getStart().getY(); final double result = (factors-Math.abs(squareRoot))/divisor; if(result >= 0) { final Point2D intersection = transformedRay.getStart().add(transformedRay.getDirection().multiply(result)); return transformInverse.multiply(intersection).vec(ray.getStart()).length(); } return Double.POSITIVE_INFINITY; }", "tokens": 473} {"id": 18275, "source": "method", "repo": "aimacode/aima-java", "text": "public void testEmptyBoard() { Assert.assertFalse(goalTest.test(board)); }", "tokens": 19} {"id": 18284, "source": "method", "repo": "aimacode/aima-java", "text": "public void testAgentActionNumber7() { VacuumEnvironment tve = new VacuumEnvironment( VacuumEnvironment.LocationState.Dirty, VacuumEnvironment.LocationState.Clean); tve.addAgent(agent, VacuumEnvironment.LOCATION_A); Assert.assertEquals(VacuumEnvironment.LOCATION_A, tve.getAgentLocation(agent)); Assert.assertEquals(1, tve.getAgents().size()); tve.step(); // cleans A Assert.assertEquals(VacuumEnvironment.LOCATION_A, tve.getAgentLocation(agent)); Assert.assertEquals(VacuumEnvironment.LocationState.Clean, tve.getLocationState(VacuumEnvironment.LOCATION_A)); tve.step(); // moves to B Assert.assertEquals(VacuumEnvironment.LOCATION_B, tve.getAgentLocation(agent)); Assert.assertEquals(VacuumEnvironment.LocationState.Clean, tve.getLocationState(VacuumEnvironment.LOCATION_B)); tve.step(); // NOOP Assert.assertEquals(VacuumEnvironment.LOCATION_B, tve.getAgentLocation(agent)); Assert.assertEquals(VacuumEnvironment.LocationState.Clean, tve.getLocationState(VacuumEnvironment.LOCATION_A)); Assert.assertEquals(VacuumEnvironment.LocationState.Clean, tve.getLocationState(VacuumEnvironment.LOCATION_B)); Assert.assertEquals(9, tve.getPerformanceMeasure(agent), 0.001); }", "tokens": 340} {"id": 18296, "source": "method", "repo": "aimacode/aima-java", "text": "public MockDataSetSpecification(String targetAttributeName) { setTarget(targetAttributeName); }", "tokens": 20} {"id": 18338, "source": "method", "repo": "aimacode/aima-java", "text": "public void testAddRuleAndFact() { weaponsKB.tell(\"(Missile(x) => Weapon(x))\"); Assert.assertEquals(1, weaponsKB.getNumberRules()); weaponsKB.tell(\"American(West)\"); Assert.assertEquals(1, weaponsKB.getNumberRules()); Assert.assertEquals(1, weaponsKB.getNumberFacts()); }", "tokens": 82} {"id": 18474, "source": "method", "repo": "aimacode/aima-java", "text": "/** Constructor with additional functional argument to control the rotation of the agent symbol. @param viewRoot the pane where the button grid is added @param actionToOrientationFn maps actions to direction values. Value interpretation: 0 = facing up, 90 = facing right, null = no change. */ public VacuumEnvironmentViewCtrl(StackPane viewRoot, Function actionToOrientationFn) { super(viewRoot, env -> ((VacuumEnvironment) env).getXDimension(), env -> ((VacuumEnvironment) env).getYDimension()); this.actionToOrientationFn = actionToOrientationFn; }", "tokens": 139} {"id": 18717, "source": "method", "repo": "aionnetwork/aion", "text": "public Event(int event, Object value, String address) { this.event = event; this.value = value; this.address = address; }", "tokens": 33} {"id": 18807, "source": "method", "repo": "aionnetwork/aion", "text": "/** Resets internal data containing network and path. */ public void resetInternal() { networkConfigDir = null; baseConfigFile = null; baseGenesisFile = null; baseForkFile = null; logDir = null; databaseDir = null; keystoreDir = null; absoluteLogDir = false; absoluteDatabaseDir = false; absoluteKeystoreDir = false; network = null; dataDir = null; execDir = null; execConfigDir = null; execConfigFile = null; }", "tokens": 99} {"id": 19350, "source": "method", "repo": "aionnetwork/aion", "text": "private static final byte[] egcd32(byte[] x, byte[] y, byte[] a, byte[] b) { int an, bn = 32, qn, i; for (i = 0; i < 32; i++) { x[i] = y[i] = 0; } x[0] = 1; an = numsize(a, 32); if (an == 0) { return y; /* division by zero */ } byte[] temp = new byte[32]; while (true) { qn = bn - an + 1; divmod(temp, b, bn, a, an); bn = numsize(b, bn); if (bn == 0) { return x; } mula32(y, x, temp, qn, -1); qn = an - bn + 1; divmod(temp, a, an, b, bn); an = numsize(a, an); if (an == 0) { return y; } mula32(x, y, temp, qn, -1); } }", "tokens": 256} {"id": 19394, "source": "method", "repo": "aionnetwork/aion", "text": "public void putToBatchInternal(byte[] key, byte[] value) { writeBatch.put(ByteArrayWrapper.wrap(key), value); }", "tokens": 31} {"id": 19484, "source": "method", "repo": "aionnetwork/aion", "text": "/** @param _ver short @param _ctrl byte @param _action byte @param _len byte */ Header(short _ver, byte _ctrl, byte _action, int _len) { this.ver = _ver; this.ctrl = _ctrl; this.action = _action; this.len = _len < 0 ? 0 : _len; }", "tokens": 93} {"id": 19623, "source": "method", "repo": "aionnetwork/aion", "text": "/** Converts string hex representation to data bytes Accepts following hex: - with or without 0x prefix - with no leading 0, like 0xabc v.s. 0x0abc @param data String like '0xa5e..' or just 'a5e..' @return decoded bytes array */ public static byte[] hexStringToBytes(String data) { if (data == null) { return EMPTY_BYTE_ARRAY; } if (data.startsWith(\"0x\")) { data = data.substring(2); } if ((data.length() & 1) == 1) { data = \"0\" + data; } return Hex.decode(data); }", "tokens": 152} {"id": 19866, "source": "method", "repo": "akto-api-security/akto", "text": "public static Map mapIssueDescriptions(List issues, Map idToResultMap) { if (CollectionUtils.isEmpty(issues) || MapUtils.isEmpty(idToResultMap)) { return Collections.emptyMap(); } Map finalResult = new HashMap<>(); for (TestingRunIssues issue : issues) { if (StringUtils.isNotBlank(issue.getDescription())) { TestingRunResult result = idToResultMap.get(issue.getId()); if (result != null) { finalResult.put(result.getHexId(), issue.getDescription()); } } } return finalResult; }", "tokens": 143} {"id": 20079, "source": "method", "repo": "akto-api-security/akto", "text": "public Builder setUrl(String url) { this.url = url; return this; }", "tokens": 20} {"id": 20199, "source": "method", "repo": "akto-api-security/akto", "text": "public String getCollName() { return \"sensitive_param_info\"; }", "tokens": 17} {"id": 20288, "source": "method", "repo": "akto-api-security/akto", "text": "Category(String label, String description, List samplePhrases) { this.label = label; this.description = description; this.samplePhrases = samplePhrases; }", "tokens": 41} {"id": 20359, "source": "method", "repo": "akto-api-security/akto", "text": "public int getLastUpdateTime() { return lastUpdateTime; }", "tokens": 14} {"id": 20482, "source": "method", "repo": "akto-api-security/akto", "text": "public void setUp() { Context.accountId.set(ACCOUNT_ID); Context.userId.set(1); SingleTypeInfoDao.instance.getMCollection().drop(); }", "tokens": 36} {"id": 20510, "source": "method", "repo": "akto-api-security/akto", "text": "public static void bulkWriteSampleData(List> writesForSampleData) { SampleDataDao.instance.getMCollection().bulkWrite(writesForSampleData); }", "tokens": 41} {"id": 20617, "source": "method", "repo": "Alanosy/exam-platform", "text": "public CaptchaException(String msg) { super(msg); }", "tokens": 15} {"id": 20740, "source": "method", "repo": "Alanosy/exam-platform", "text": "public List rankByExam(int limit) { int size = limit < 1 ? 5 : limit; return examRecordMapper.selectMaps( Wrappers.query() .select(true, List.of( \"exam_id\", \"count(1) as submit_cnt\", \"sum(case when passed = 1 then 1 else 0 end) as pass_cnt\", \"ifnull(round(avg(total_score), 1), 0) as avg_score\")) .eq(\"status\", ExamRecord.STATUS_SUBMITTED) .isNotNull(\"exam_id\") .groupBy(\"exam_id\") .orderByDesc(\"submit_cnt\")) .stream() .limit(size) .map(item -> { RecordExamStatVo vo = new RecordExamStatVo(); Long submitCount = num(item, \"submitCnt\", \"submit_cnt\"); Long passCount = num(item, \"passCnt\", \"pass_cnt\"); vo.setExamId(num(item, \"examId\", \"exam_id\")); vo.setSubmitCount(submitCount); vo.setPassCount(passCount); vo.setPassRate(rate(passCount, submitCount)); vo.setAvgScore(dec(item, \"avgScore\", \"avg_score\")); return vo; }).toList(); }", "tokens": 301} {"id": 20747, "source": "method", "repo": "Alanosy/exam-platform", "text": "private String text(BigDecimal value) { if (ObjectUtil.isNull(value)) { return \"0\"; } return value.stripTrailingZeros().toPlainString(); }", "tokens": 35} {"id": 20754, "source": "method", "repo": "Alanosy/exam-platform", "text": "public static MarkAiResult fail(String message) { MarkAiResult result = new MarkAiResult(); result.setSuccess(false); result.setMessage(message); return result; }", "tokens": 38} {"id": 20801, "source": "method", "repo": "Alanosy/exam-platform", "text": "private LambdaQueryWrapper buildQueryWrapper(SysDictDataBo bo) { LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.eq(bo.getDictSort() != null, SysDictData::getDictSort, bo.getDictSort()); lqw.like(StringUtils.isNotBlank(bo.getDictLabel()), SysDictData::getDictLabel, bo.getDictLabel()); lqw.eq(StringUtils.isNotBlank(bo.getDictType()), SysDictData::getDictType, bo.getDictType()); lqw.orderByAsc(SysDictData::getDictSort, SysDictData::getDictCode); return lqw; }", "tokens": 137} {"id": 20807, "source": "method", "repo": "Alanosy/exam-platform", "text": "public void syncDef(String tenantId) { workflowService.syncDef(tenantId); }", "tokens": 19} {"id": 21007, "source": "method", "repo": "aleixrodriala/newtube", "text": "private void postSubtitleChange(String vssId, String languageCode) { if (isRemoteDisabled()) { return; } RxHelper.disposeActions(mPostStateAction); mPostStateAction = RxHelper.execute( mRemoteControlService.postSubtitleChangeObserve(vssId, languageCode) ); }", "tokens": 68} {"id": 21096, "source": "method", "repo": "aleixrodriala/newtube", "text": "protected Integer[] getPackageSignatureHash() { return AMAZON_YOUTUBE_PKG_HASH; }", "tokens": 25} {"id": 21176, "source": "method", "repo": "aleixrodriala/newtube", "text": "private List getBackupDirs() { initBackupDirs(); return mBackupDirs; }", "tokens": 21} {"id": 21179, "source": "method", "repo": "aleixrodriala/newtube", "text": "private static PackageInfo packageInfo(Context context) { try { return context.getPackageManager().getPackageInfo(context.getPackageName(), 0); } catch (PackageManager.NameNotFoundException e) { return null; } }", "tokens": 46} {"id": 21219, "source": "method", "repo": "aleixrodriala/newtube", "text": "private synchronized void restoreState() { String data = mPrefs.getProfileData(BLOCKED_CHANNEL_DATA); String[] split = Helpers.splitData(data); mChannels = Helpers.parseList(split, 0, Channel::fromString); // null restoreOldData(split); }", "tokens": 63} {"id": 21234, "source": "method", "repo": "aleixrodriala/newtube", "text": "public void persistNow() { Utils.post(mPersistStateInt); }", "tokens": 17} {"id": 21569, "source": "method", "repo": "aleixrodriala/newtube", "text": "/** 403: expired/invalid signed URL - no retry can heal it. 416: the server refuses the requested byte range - retrying the SAME DataSpec can never heal it either; failing fast surfaces {@code onPlayerError} so the app-level reload fetches a fresh manifest. */ static boolean isFatalTransportError(Throwable exception) { for (Throwable e = exception; e != null; e = e.getCause()) { if (e instanceof HttpDataSource.InvalidResponseCodeException) { int code = ((HttpDataSource.InvalidResponseCodeException) e).responseCode; if (code == 403 || code == 416) { return true; } } // These cannot be healed by replaying the same media DataSpec six times. Surface // immediately so the app-level connectivity recovery owns the retry lifecycle. if (e instanceof UnknownHostException || e instanceof NoRouteToHostException) { return true; } String message = e.getMessage(); if (message != null && (message.contains(\"ERR_NAME_NOT_RESOLVED\") || message.contains(\"ERR_INTERNET_DISCONNECTED\"))) { return true; } } return false; }", "tokens": 254} {"id": 21752, "source": "method", "repo": "aleixrodriala/newtube", "text": "private void animateDrag(float target) { if (mDragAnimator != null) { mDragAnimator.cancel(); } ValueAnimator animator = ValueAnimator.ofFloat(mDrag, target); animator.setDuration(DRAG_MS); animator.setInterpolator(Motion.STANDARD); animator.addUpdateListener(a -> { mDrag = (float) a.getAnimatedValue(); invalidate(); }); mDragAnimator = animator; animator.start(); }", "tokens": 93} {"id": 21872, "source": "method", "repo": "aleixrodriala/newtube", "text": "public void decoderListWarmsLastAndIndependently() { List order = new ArrayList<>(); new PlayerInfrastructureWarmup(Runnable::run, () -> order.add(\"transport\"), () -> { order.add(\"cache\"); throw new IllegalStateException(\"test\"); }, () -> order.add(\"codecs\")).schedule(); assertEquals(java.util.Arrays.asList(\"transport\", \"cache\", \"codecs\"), order); }", "tokens": 93} {"id": 22121, "source": "method", "repo": "alexxiyang/shiro-redis", "text": "private SessionInMemory createSessionInMemory(Session session) { SessionInMemory sessionInMemory = new SessionInMemory(); sessionInMemory.setCreateTime(new Date()); sessionInMemory.setSession(session); return sessionInMemory; }", "tokens": 42} {"id": 22167, "source": "method", "repo": "alexxiyang/shiro-redis", "text": "public Collection byType(Class aClass) { return null; }", "tokens": 24} {"id": 22205, "source": "method", "repo": "alibaba/testable-mock", "text": "private String callFromDifferentMethod() { if (\"special_case\".equals(MOCK_CONTEXT.get(\"case\"))) { return \"mock_special\"; } switch (SOURCE_METHOD) { case \"callerOne\": return \"mock_one\"; default: return \"mock_others\"; } }", "tokens": 64} {"id": 22659, "source": "method", "repo": "alibaba/testable-mock", "text": "/** Get mock class name from source class name @param sourceClassName source class name @return mock class name */ public static String getMockClassName(String sourceClassName) { return sourceClassName + MOCK_POSTFIX; }", "tokens": 46} {"id": 22683, "source": "method", "repo": "alibaba/testable-mock", "text": "public static String[] getPkgPrefixBlackList() { return pkgPrefixBlackList; }", "tokens": 17} {"id": 22737, "source": "method", "repo": "alibaba/testable-mock", "text": "public ClassLoader getClassLoader(JavaFileManager.Location location) { return cl; }", "tokens": 17} {"id": 22855, "source": "method", "repo": "alibaba/testable-mock", "text": "private static void handleCircleReferenceOfArrayField(Object instance, Class type, Map, Object> classPool) throws IllegalAccessException { if (type.isArray()) { for (int i = 0; i < Math.min(Array.getLength(instance), FIRST); i++) { Object arrayIns = Array.get(instance, i); if (arrayIns != null) { handleCircleReferenceOfArrayField(arrayIns, arrayIns.getClass().getComponentType(), classPool); } } } else if (!classPool.containsKey(type)) { for (int i = 0; i < Math.min(Array.getLength(instance), FIRST); i++) { handleCircleReference(Array.get(instance, i), type, classPool); } } }", "tokens": 169} {"id": 22914, "source": "method", "repo": "alibaba/testable-mock", "text": "/** Get the last visit method in source file @return method name */ public static String currentSourceMethodName() { return Thread.currentThread().getStackTrace()[INDEX_OF_SOURCE_METHOD].getMethodName(); }", "tokens": 41} {"id": 23051, "source": "method", "repo": "alicanakkus/modular-architecture-hexagonal-demo-project", "text": "Status(Integer value) { this.value = value; }", "tokens": 14} {"id": 23057, "source": "method", "repo": "alicanakkus/modular-architecture-hexagonal-demo-project", "text": "private void validateVoidUseCaseHandlerDetection(T useCase, VoidUseCaseHandler useCaseHandler) { if (Objects.isNull(useCaseHandler)) { log.error(\"Void use case handler cannot be detected for the use case: {}, handlers: {}\", useCase, UseCaseHandlerRegistry.INSTANCE.getRegistryForVoidUseCaseHandlers()); throw new PaymentApiBusinessException(\"paymentapi.useCaseHandler.notDetected\"); } }", "tokens": 91} {"id": 23079, "source": "method", "repo": "alicanakkus/modular-architecture-hexagonal-demo-project", "text": "private void doPayment(Long accountId, String price, String balanceAmountBeforePayment, String balanceAmountAfterPayment) { // given Balance balanceBeforePayment = Balance.builder() .id(1L) .accountId(accountId) .amount(new BigDecimal(balanceAmountBeforePayment)) .build(); Balance balanceAfterPayment = Balance.builder() .id(1L) .accountId(accountId) .amount(new BigDecimal(balanceAmountAfterPayment)) .build(); Payment expectedPayment = Payment.builder() .id(1L) .accountId(accountId) .accountId(accountId) .price(new BigDecimal(price)) .referenceCode(\"ref1\") .state(PaymentState.SUCCESS) .build(); // and BalanceFakeAdapter balanceAdapter = new BalanceFakeAdapter(balanceBeforePayment, balanceAfterPayment); var balanceTransactionCreateUseCaseHandler = new BalanceTransactionCreateUseCaseHandler(balanceAdapter); var balanceRetrieveUseCaseHandler = new BalanceRetrieveUseCaseHandler(balanceAdapter); PaymentCreateUseCaseHandler paymentCreateUseCaseHandler = new PaymentCreateUseCaseHandler( retrieveFakeAccountLockPort(), new PaymentFakeAdapter(expectedPayment), new BalanceValidator()); //when PaymentCreate paymentCreate = PaymentCreate.builder() .accountId(accountId) .price(new BigDecimal(price)) .referenceCode(\"ref1\") .build(); Payment payment = paymentCreateUseCaseHandler.handle(paymentCreate); //then assertThat(payment).isNotNull().isEqualTo(Payment.builder() .id(1L) .accountId(accountId) .price(new BigDecimal(price)) .referenceCode(\"ref1\") .state(PaymentState.SUCCESS) .build()); }", "tokens": 358} {"id": 23086, "source": "method", "repo": "alicanakkus/modular-architecture-hexagonal-demo-project", "text": "public Balance update(Balance balance, BalanceTransactionCreate balanceTransactionCreate) { if (balance.getAccountId().equals(FAILED_BALANCE_UPDATE_ACCOUNT_ID)) throw new RuntimeException(\"error\"); updatedBalance.setAmount(updatedBalance.getAmount().add(balanceTransactionCreate.getAmount())); return updatedBalance; }", "tokens": 66} {"id": 23331, "source": "method", "repo": "alicanakkus/modular-architecture-hexagonal-demo-project", "text": "void should_retrieve_ticket() { // given TicketRetrieve ticketRetrieve = TicketRetrieve.builder() .accountId(10L) .build(); // when List tickets = ticketAdapter.retrieve(ticketRetrieve); // then assertThat(tickets).isNotNull().hasSize(3) .extracting(\"accountId\", \"meetupId\", \"price\") .containsExactlyInAnyOrder( tuple(10L, 1001L, BigDecimal.valueOf(100.11)), tuple(10L, 1002L, BigDecimal.valueOf(100.12)), tuple(10L, 1003L, BigDecimal.valueOf(100.13)) ); }", "tokens": 159} {"id": 23544, "source": "method", "repo": "alipay/alipay-easysdk", "text": "private static boolean existsInFileSystem(String certPath) { try { return new File(certPath).exists(); } catch (Throwable e) { return false; } }", "tokens": 37} {"id": 23742, "source": "method", "repo": "aliyun/aliyun-log-android-sdk", "text": "public void dns(DnsRequest dnsRequest) { if (checkNetworkDiagnosis()) { networkDiagnosis.dns(dnsRequest); } }", "tokens": 27} {"id": 23830, "source": "method", "repo": "aliyun/aliyun-log-android-sdk", "text": "public void networkDiagnosis_mtr_request() { networkDiagnosis.mtr(new MtrRequest()); verify(networkDiagnosisFeature).mtr((MtrRequest)any()); }", "tokens": 40} {"id": 23884, "source": "method", "repo": "aliyun/aliyun-log-android-sdk", "text": "public Span setSpanId(String spanID) { synchronized (lock) { this.spanID = spanID; return this; } }", "tokens": 30} {"id": 23913, "source": "method", "repo": "aliyun/aliyun-log-android-sdk", "text": "ContextManager() { android.content.Context ctx = Utils.getContext(); if (null == ctx) { sharedPreferences = null; } else { sharedPreferences = ctx.getSharedPreferences(\"sls_cached_span\", android.content.Context.MODE_PRIVATE); } }", "tokens": 61} {"id": 24444, "source": "method", "repo": "almasb/fxglgames", "text": "private EntityBuilder newTank(SpawnData data) { return entityBuilder(data) .bbox(new HitBox(new Point2D(5, 5), BoundingShape.box(26, 26))) //.anchorFromCenter() .collidable() .with(new HealthIntComponent(10)) .with(new MoveComponent()) .with(new TankViewComponent()) .with(new CellMoveComponent(BLOCK_SIZE / 2, BLOCK_SIZE / 2, 300).allowRotation(true)) .with(new ActionComponent()) .with(new StateComponent()) .with(new TankAIComponent()); }", "tokens": 154} {"id": 24609, "source": "method", "repo": "almasb/fxglgames", "text": "private void spawnDroplet() { entityBuilder() .type(Type.DROPLET) .at(FXGLMath.random(0, getAppWidth() - 64), 0) .viewWithBBox(\"droplet.png\") .collidable() .with(new OffscreenCleanComponent()) .buildAndAttach(); }", "tokens": 76} {"id": 24644, "source": "method", "repo": "almasb/fxglgames", "text": "public static WeaponType fromMultiplier(int multiplier) { if (multiplier > 200) return TRIPLE; if (multiplier > 100) return DOUBLE; return SINGLE; }", "tokens": 45} {"id": 24752, "source": "method", "repo": "almasb/fxglgames", "text": "public Entity spawnMine(SpawnData data) { var beepSwitch = new IntervalSwitchComponent(false, Duration.seconds(0.5)); var e = entityBuilder(data) .type(MINE) .viewWithBBox(texture(\"mine.png\", 315 * 0.2, 315 * 0.2)) .with(beepSwitch) .with(new MineComponent()) .with(new CollidableComponent(false)) .zIndex(ENEMIES_Z_INDEX) .build(); var overlay = texture(\"mine_red.png\", 315 * 0.2, 315 * 0.2); overlay.visibleProperty().bind(beepSwitch.valueProperty()); e.getViewComponent().addChild(overlay); // enable collidable after a while runOnce(() -> { if (e.isActive()) { e.getComponent(CollidableComponent.class).setValue(true); } }, Duration.seconds(1.35)); return e; }", "tokens": 228} {"id": 24779, "source": "method", "repo": "almasb/fxglgames", "text": "public void onGameUpdate(double tpf) { // not quite correct since this includes pick ups and other entities // but should be sufficient var numEntities = (getGameWorld().getEntities().size() - byType(BOMBER, BULLET, PICKUP_CRYSTAL).size()) * 1.0; var value = min(numEntities / MAX_ENEMIES_PRESSURE, 1.0); pressureProp.setValue(value); if (isOnCooldown && value < 0.25) { isOnCooldown = false; isSpawningEnemies = true; } if (value == 1.0) { isOnCooldown = true; isSpawningEnemies = false; } }", "tokens": 151} {"id": 24816, "source": "method", "repo": "almasb/fxglgames", "text": "public Grade(Duration gradeTime, Duration userTime) { super(15); HBox.setHgrow(this, Priority.ALWAYS); setAlignment(Pos.CENTER); getChildren().add(userTime.lessThanOrEqualTo(gradeTime) ? STAR_FULL.copy() : STAR_EMPTY.copy()); getChildren().add(getUIFactoryService().newText(String.format(\"<%.2f\", gradeTime.toSeconds()), Color.WHITE, 16.0)); }", "tokens": 106} {"id": 24835, "source": "method", "repo": "almasb/fxglgames", "text": "public Entity newDoorBot(SpawnData data) { return entityBuilder(data) .type(DOOR_BOT) .bbox(new HitBox(BoundingShape.box(data.get(\"width\"), data.get(\"height\")))) .opacity(0) .with(new CollidableComponent(false)) .build(); }", "tokens": 80} {"id": 25023, "source": "method", "repo": "almasb/fxglgames", "text": "public void init() { labelScore.setFont(getUIFactoryService().newFont(18)); labelHighScore.setFont(getUIFactoryService().newFont(18)); labelHighScore.setVisible(false); laserMeter.setLabelVisible(false); laserMeter.setMinValue(0); laserMeter.setMaxValue(Config.LASER_METER_MAX); laserMeter.setCurrentValue(0); laserMeter.setBackgroundFill(Color.WHITE); laserMeter.setFill(Color.BLUE); laserMeter.setWidth(110); laserMeter.setHeight(10); FXGLTextFlow flow = getUIFactoryService().newTextFlow(); // TODO: bind dynamically to trigger flow.append(\"Press \", Color.WHITE).append(MouseButton.SECONDARY, Color.BLUE); paneLaserReady.getChildren().add(flow); paneLaserReady.visibleProperty().bind(laserMeter.currentValueProperty().isEqualTo(Config.LASER_METER_MAX, 0.0)); }", "tokens": 211} {"id": 25061, "source": "method", "repo": "almasb/fxglgames", "text": "public BulletComponent(double speed) { this.speed = speed; }", "tokens": 17} {"id": 25093, "source": "method", "repo": "almasb/fxglgames", "text": "private void placeGenerals() { for (int i = 0; i < 5; i++) { spawn(\"General\", 25 + i*100, getAppHeight() - (i % 2 == 0 ? 300 : 400)); } }", "tokens": 63} {"id": 25101, "source": "method", "repo": "almasb/fxglgames", "text": "public void destroy() { animations.forEach(Animation::stop); }", "tokens": 15} {"id": 25139, "source": "method", "repo": "almasb/fxglgames", "text": "public void onUpdate(double tpf) { if (attackTimer.elapsed(nextAttack)) { shoot(); nextAttack = Duration.seconds(1); attackTimer.capture(); } }", "tokens": 38} {"id": 25181, "source": "method", "repo": "almasb/fxglgames", "text": "public void onUpdate(double tpf) { if (occupiedBy != null && !occupiedBy.isActive()) { occupiedBy = null; } }", "tokens": 31} {"id": 25222, "source": "method", "repo": "almasb/fxglgames", "text": "private void gameOver(String winner) { getDialogService().showConfirmationBox(\"Winner: \" + winner + \"\\nContinue?\", yes -> { if (yes) getGameController().startNewGame(); else getGameController().exit(); }); }", "tokens": 57} {"id": 25273, "source": "method", "repo": "almasb/fxglgames", "text": "private void gameOver() { showMessage(\"Level Complete!\", getGameController()::gotoMainMenu); }", "tokens": 23} {"id": 25311, "source": "method", "repo": "almasb/fxglgames", "text": "public Way(List waypoints) { this.waypoints = waypoints; }", "tokens": 22} {"id": 25350, "source": "method", "repo": "alphawallet/alpha-wallet-android", "text": "public static void sendBalanceTo(String tokenSymbol, String amountStr, String receiverAddress) { click(withId(R.id.nav_wallet_text)); ensureBalanceFetched(); click(withSubstring(tokenSymbol)); click(withText(\"Send\")); onView(withHint(\"0\")).perform(replaceText(amountStr)); onView(withHint(R.string.recipient_address)).perform(replaceText(receiverAddress)); click(withId(R.string.action_next)); Helper.wait(6); try { click(withId(R.string.action_confirm)); } catch (Error | Exception e) { Helper.wait(2); waitForLoadingComplete(\"Calculating Gas Limit\"); click(withId(R.string.action_confirm)); } }", "tokens": 162} {"id": 25377, "source": "method", "repo": "alphawallet/alpha-wallet-android", "text": "protected void writeStartSyncBlock(Realm realm, long currentBlock) { if (realm == null) return; realm.executeTransaction(r -> { String key = TokensRealmSource.databaseKey(token.tokenInfo.chainId, token.getAddress()); RealmAuxData rd = r.where(RealmAuxData.class) .equalTo(\"instanceKey\", key) .findFirst(); if (rd == null) { rd = r.createObject(RealmAuxData.class, key); //create asset in realm } rd.setFunctionId(String.valueOf(currentBlock)); r.insertOrUpdate(rd); }); }", "tokens": 134} {"id": 25434, "source": "method", "repo": "alphawallet/alpha-wallet-android", "text": "public String getValue() { return resultType; }", "tokens": 11} {"id": 25475, "source": "method", "repo": "alphawallet/alpha-wallet-android", "text": "private Function balanceOfBatch(String address, Set tokenIds) { //create address list List
batchAddresses = new ArrayList<>(tokenIds.size()); List tokenIdList = new ArrayList<>(tokenIds.size()); for (BigInteger id : tokenIds) { batchAddresses.add(new Address(address)); tokenIdList.add(new Uint256(id)); } //populate list of addresses with wallet address return new Function(\"balanceOfBatch\", Arrays.asList( new DynamicArray<>(Address.class, batchAddresses), new DynamicArray<>(Uint256.class, tokenIdList)), Collections.singletonList(new TypeReference>() {})); }", "tokens": 158} {"id": 25534, "source": "method", "repo": "alphawallet/alpha-wallet-android", "text": "/** Check if a wallet needs to be backed up. @param walletAddr @return */ public Single getBackupWarning(String walletAddr) { return walletRepository.getWalletBackupWarning(walletAddr); }", "tokens": 47} {"id": 25807, "source": "method", "repo": "alphawallet/alpha-wallet-android", "text": "public CustomViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.item_simple_radio, parent, false); return new CustomViewHolder(itemView); }", "tokens": 51} {"id": 25839, "source": "method", "repo": "alphawallet/alpha-wallet-android", "text": "private Pair getMinMax(JSONArray valueArray) { double min = Double.MAX_VALUE; double max = 0.0; try { for (int i = 0; i < valueArray.length(); i++) { JSONArray valueElement = valueArray.getJSONArray(i); double value = valueElement.getDouble(1); if (value < min) min = value; if (value > max) max = value; } } catch (Exception e) { Timber.e(e); } if (min == Double.MAX_VALUE) min = 0.0; return new Pair<>(min, max); }", "tokens": 135} {"id": 25864, "source": "method", "repo": "alphawallet/alpha-wallet-android", "text": "public boolean onCreateOptionsMenu(Menu menu) { if (!(wallet.type == WalletType.HARDWARE || wallet.type == WalletType.WATCH)) { getMenuInflater().inflate(R.menu.menu_wallet_manage, menu); } return super.onCreateOptionsMenu(menu); }", "tokens": 60} {"id": 25878, "source": "method", "repo": "alphawallet/alpha-wallet-android", "text": "public void onBindViewHolder(BinderViewHolder holder, @SuppressLint(\"RecyclerView\") int position) { Bundle addition = new Bundle(); addition.putString(TransactionHolder.DEFAULT_ADDRESS_ADDITIONAL, wallet.address); holder.bind(items.get(position).value, addition); if (itemLimit > 0) { holder.setFromTokenView(); } else if (position > lastItemPos && dataInteract != null && System.currentTimeMillis() > fetchData && position > items.size() - 5) { fetchData = System.currentTimeMillis() + 2500; handler.post(checkData); } lastItemPos = position; }", "tokens": 141} {"id": 26144, "source": "method", "repo": "alphawallet/alpha-wallet-android", "text": "private void setPriceSlider(BigDecimal gweiPrice) { int progress = (int) (((gweiPrice.floatValue() * 10.0f) - minimumPrice) / scaleFactor); gasPriceSlider.setProgress(progress); }", "tokens": 52} {"id": 26248, "source": "method", "repo": "alphawallet/alpha-wallet-android", "text": "private byte[] convertToEncodedItem(String baseType, Object data) { byte[] hashBytes; try { if (baseType.toLowerCase().startsWith(\"uint\") || baseType.toLowerCase().startsWith(\"int\")) { hashBytes = convertToBigInt(data).toByteArray(); } else if (baseType.equals(\"string\")) { hashBytes = ((String) data).getBytes(); } else if (baseType.equals(\"bytes\")) { hashBytes = Numeric.hexStringToByteArray((String) data); } else { byte[] b = convertArgToBytes((String) data); BigInteger bi = new BigInteger(1, b); hashBytes = Numeric.toBytesPadded(bi, 32); } } catch (Exception e) { e.printStackTrace(); hashBytes = new byte[0]; } return hashBytes; }", "tokens": 175} {"id": 26249, "source": "method", "repo": "alphawallet/alpha-wallet-android", "text": "private List setTokenIds(String date, long city, long venue, long category, int quantity) { List tokens = new ArrayList<>(); while(quantity > 0) { String tokenId = \"\"; tokenId += Numeric.toHexStringNoPrefixZeroPadded(Numeric.toBigInt(date.getBytes()), 38); tokenId += Numeric.toHexStringNoPrefixZeroPadded(BigInteger.valueOf(city), 2); tokenId += Numeric.toHexStringNoPrefixZeroPadded(BigInteger.valueOf(venue), 2); //Padding tokenId += \"00000000000000\"; tokenId += Numeric.toHexStringNoPrefixZeroPadded(BigInteger.valueOf(category), 2); // Must increment the numero to change the token id as 721 can only map one token to one address tokenId += Numeric.toHexStringNoPrefixZeroPadded(BigInteger.valueOf(numero++), 4); //pad the final zeros on tokenId += Numeric.toHexStringNoPrefixZeroPadded(BigInteger.ZERO, 2); BigInteger token = new BigInteger(tokenId, 16); tokens.add(token); quantity--; } return tokens; }", "tokens": 267} {"id": 26497, "source": "method", "repo": "amithkoujalgi/ollama4j", "text": "/** Registers multiple tools in the tool registry. @param tools a list of {@link Tools.Tool} objects to register. Each tool contains its specification and function. */ public void registerTools(List tools) { toolRegistry.addTools(tools); }", "tokens": 59} {"id": 26717, "source": "method", "repo": "amithkoujalgi/ollama4j", "text": "void testGlobalListenerNotification() throws Exception { Ollama ollama = new Ollama(); AtomicReference notifiedModel = new AtomicReference<>(); AtomicReference notifiedResponse = new AtomicReference<>(); ModelPullListener listener = (modelName, response) -> { notifiedModel.set(modelName); notifiedResponse.set(response); }; ollama.setModelPullListener(listener); ModelPullResponse mockResponse = new ModelPullResponse(); mockResponse.setStatus(\"pulling\"); Method method = Ollama.class.getDeclaredMethod( \"processModelPullResponse\", ModelPullResponse.class, String.class, ModelPullListener.class); method.setAccessible(true); method.invoke(ollama, mockResponse, \"test-model\", null); assertEquals(\"test-model\", notifiedModel.get()); assertEquals(\"pulling\", notifiedResponse.get().getStatus()); }", "tokens": 173} {"id": 26735, "source": "method", "repo": "amithkoujalgi/ollama4j", "text": "void testEmbedWithEmbedRequestModel() { Ollama ollama = Mockito.mock(Ollama.class); String model = \"llama2\"; List inputs = List.of(\"some prompt text\"); try { when(ollama.embed(new OllamaEmbedRequest(model, inputs))) .thenReturn(new OllamaEmbedResult()); ollama.embed(new OllamaEmbedRequest(model, inputs)); verify(ollama, times(1)).embed(new OllamaEmbedRequest(model, inputs)); } catch (OllamaException e) { throw new RuntimeException(e); } }", "tokens": 119} {"id": 26741, "source": "method", "repo": "amithkoujalgi/ollama4j", "text": "void testGetRoleNotFound() { Ollama ollama = mock(Ollama.class); String roleName = \"non-existing-role\"; try { when(ollama.getRole(roleName)).thenThrow(new RoleNotFoundException(\"Role not found\")); } catch (RoleNotFoundException exception) { throw new RuntimeException(\"Failed to run test: testGetRoleNotFound\"); } try { ollama.getRole(roleName); fail(\"Expected RoleNotFoundException not thrown\"); } catch (RoleNotFoundException exception) { assertEquals(\"Role not found\", exception.getMessage()); } try { verify(ollama, times(1)).getRole(roleName); } catch (RoleNotFoundException exception) { throw new RuntimeException(\"Failed to run test: testGetRoleNotFound\"); } }", "tokens": 150} {"id": 26798, "source": "method", "repo": "amithkoujalgi/ollama4j", "text": "/** Test deserialization of ModelPullResponse with empty string error field. Verifies that empty error strings are preserved as empty strings, not converted to null. */ public void testEmptyErrorFieldIsNull() { String emptyErrorJson = \"{\\\"error\\\":\\\"\\\",\\\"status\\\":\\\"pulling manifest\\\"}\"; ModelPullResponse response = deserialize(emptyErrorJson, ModelPullResponse.class); assertNotNull(response); assertEquals(\"pulling manifest\", response.getStatus()); assertEquals(\"\", response.getError()); // Empty string, not null }", "tokens": 99} {"id": 26904, "source": "method", "repo": "AMPLIFIER-sp-z-o-o/ampli-sync", "text": "public static Database getInstance() { if (datasource == null) { datasource = new Database(); datasource.createPool(); return datasource; } else { return datasource; } }", "tokens": 35} {"id": 27102, "source": "method", "repo": "AMPLIFIER-sp-z-o-o/ampli-sync", "text": "void shouldRejectInvalidReceivePayloadBeforeApplyingDeletes() { SyncDevClient client = createClient(DEV_USER_ID); String testRunId = newId(); try (SyncDevice deviceA = createDevice(client, testRunId, \"device-a\"); SyncDevice deviceB = createDevice(client, testRunId, \"device-b\")) { deviceA.prepopulate(); deviceB.prepopulate(); String customerId = newId(); Map customer = customer( customerId, \"Validation Customer\", \"validation@example.com\", \"Warsaw\" ); deviceA.insertRow(DemoCustomersFixture.TABLE, customer); deviceA.push(); deviceA.pullTable(DemoCustomersFixture.TABLE); deviceB.pullTable(DemoCustomersFixture.TABLE); String rowId = deviceA.findFirstValue( DemoCustomersFixture.TABLE, \"rowid\", \"id\", customerId ); PayloadBuilder.PushPayload payload = new PayloadBuilder.PushPayload( List.of(new TableChanges( DemoCustomersFixture.TABLE, List.of(Map.of( \"id\", newId(), \"name\", \"Invalid Date Customer\", \"email\", \"invalid-date@example.com\", \"city\", \"Warsaw\", \"created_at\", \"invalidtimestamp\" )), List.of() )), List.of(new DeletedRecord(DemoCustomersFixture.TABLE, rowId)) ); int statusCode = client.sendChangesAndReturnStatus( testRunId + \"-device-a\", payload ); assertEquals(403, statusCode); deviceB.pullTable(DemoCustomersFixture.TABLE); SyncDeviceAssertions.assertRowValues( deviceB, DemoCustomersFixture.TABLE, \"id\", customerId, customer ); } }", "tokens": 376} {"id": 27149, "source": "method", "repo": "amplitude/amplitude-android", "text": "/** @deprecated - We removed Diagnostics class and this function has no-op. Will completely remove it in the near future. */ public AmplitudeClient setDiagnosticEventMaxCount(int eventMaxCount) { return this; }", "tokens": 47} {"id": 27229, "source": "method", "repo": "amplitude/amplitude-android", "text": "/** Sets user properties. This is a convenience wrapper around the {@link Identify} API to set multiple user properties with a single command. @param userProperties the user properties @param extra the extra unstructured data for middleware */ public void setUserProperties(final JSONObject userProperties, MiddlewareExtra extra) { if (userProperties == null || userProperties.length() == 0 || !contextAndApiKeySet(\"setUserProperties\")) { return; } Identify identify = convertPropertiesToIdentify(userProperties); if (identify != null) { identify(identify, false, extra); } }", "tokens": 120} {"id": 27422, "source": "method", "repo": "amplitude/amplitude-android", "text": "/** Increment a user property by some numerical value. If the user property does not have a value set, it will be initialized to 0 before being incremented. Value can be negative to decrement a user property value. @param property the user property to increment @param value the value (can be negative) to increment. Server-side we convert the string into a number if possible. @return the same Identify object */ public Identify add(String property, String value) { addToUserProperties(Constants.AMP_OP_ADD, property, value); return this; }", "tokens": 116} {"id": 27472, "source": "method", "repo": "amplitude/amplitude-android", "text": "/** Post-insert a value or values to a user property. Post-insert means inserting the value(s) at the end of a given list. if the user property does not have a value set, it will be initialized to an empty list before the new values are prepended. If the user property has an existing value and it is not a list, it will be converted into a list with the new value(s) post-insert. If the user property has an existing value, it will do no operation. @param property the user property to which to postInsert @param value the values being preInsert @return the same Identify object */ public Identify postInsert(String property, long value) { addToUserProperties(Constants.AMP_OP_POSTINSERT, property, value); return this; }", "tokens": 164} {"id": 27747, "source": "method", "repo": "amplitude/amplitude-android", "text": "public void testSetUserProperties() throws JSONException { ShadowLooper looper = Shadows.shadowOf(amplitude.logThread.getLooper()); // setting null or empty user properties does nothing amplitude.setUserProperties(null); looper.runToEndOfTasks(); assertEquals(getUnsentEventCount(), 0); assertEquals(getUnsentIdentifyCount(), 0); amplitude.setUserProperties(new JSONObject()); looper.runToEndOfTasks(); assertEquals(getUnsentEventCount(), 0); assertEquals(getUnsentIdentifyCount(), 0); JSONObject userProperties = new JSONObject().put(\"key1\", \"value1\").put(\"key2\", \"value2\"); amplitude.setUserProperties(userProperties); looper.runToEndOfTasks(); looper.runToEndOfTasks(); assertEquals(getUnsentEventCount(), 0); assertEquals(getUnsentIdentifyCount(), 1); JSONObject event = getLastUnsentIdentify(); assertEquals(Constants.IDENTIFY_EVENT, event.optString(\"event_type\")); assertTrue(Utils.compareJSONObjects( event.optJSONObject(\"event_properties\"), new JSONObject() )); JSONObject userPropertiesOperations = event.optJSONObject(\"user_properties\"); assertEquals(userPropertiesOperations.length(), 1); assertTrue(userPropertiesOperations.has(Constants.AMP_OP_SET)); JSONObject setOperations = userPropertiesOperations.optJSONObject(Constants.AMP_OP_SET); assertTrue(Utils.compareJSONObjects(userProperties, setOperations)); }", "tokens": 276} {"id": 28018, "source": "method", "repo": "anarsultanov/examples", "text": "public BookBatchLoader(BookServiceGrpc.BookServiceFutureStub futureStub) { this.futureStub = futureStub; }", "tokens": 27} {"id": 28048, "source": "method", "repo": "anarsultanov/examples", "text": "private void updateRandomStock() { var random = ThreadLocalRandom.current(); var stocks = repository.getStocks(); var randomStock = stocks.stream().skip(random.nextInt(stocks.size())).findFirst().orElseThrow(); var newPrice = randomStock.getPrice() + random.nextDouble(-5.0, 5.0); randomStock.updatePrice(newPrice); }", "tokens": 84} {"id": 28064, "source": "method", "repo": "anarsultanov/examples", "text": "public void onError(Throwable t) { sink.tryEmitError(t); }", "tokens": 18} {"id": 28128, "source": "method", "repo": "anarsultanov/examples", "text": "public OAuth2Authentication extractAuthentication(Map claims) { OAuth2Authentication authentication = super.extractAuthentication(claims); authentication.setDetails(claims); return authentication; }", "tokens": 39} {"id": 28288, "source": "method", "repo": "andream7/cuit_sharing", "text": "public int getTno() { return tno; }", "tokens": 13} {"id": 28386, "source": "method", "repo": "andream7/cuit_sharing", "text": "public int compareTo(Student student) { return this.score- student.score; }", "tokens": 19} {"id": 28418, "source": "method", "repo": "andream7/cuit_sharing", "text": "static int sumOfArray(int a[]) { int sum=0; for(int i:a) sum+=i; return sum; }", "tokens": 32} {"id": 28510, "source": "method", "repo": "andreschaffer/event-sourcing-cqrs-examples", "text": "public void setAmount(BigDecimal amount) { this.amount = amount; }", "tokens": 17} {"id": 28588, "source": "method", "repo": "andreschaffer/event-sourcing-cqrs-examples", "text": "void newClientHasBeenEnrolled() { UUID id = randomUUID(); String name = \"john\"; Email email = new Email(\"john@example.com\"); Client client = new Client(id, name, email); List newEvents = client.getNewEvents(); assertThat(newEvents.size(), equalTo(1)); assertThat(newEvents.get(0), instanceOf(ClientEnrolledEvent.class)); ClientEnrolledEvent event = (ClientEnrolledEvent) newEvents.get(0); assertThat(event.getAggregateId(), equalTo(id)); assertThat(event.getName(), equalTo(name)); assertThat(event.getEmail(), equalTo(email)); assertThat(client.getId(), equalTo(id)); assertThat(client.getName(), equalTo(name)); assertThat(client.getEmail(), equalTo(email)); }", "tokens": 168} {"id": 28621, "source": "method", "repo": "andreschaffer/event-sourcing-cqrs-examples", "text": "public Response postWithdrawal(String accountId, JsonNode withdrawalDto) { return client.target(resourcesUrls.withdrawalsUrl(accountId)).request() .post(json(withdrawalDto)); }", "tokens": 42} {"id": 28658, "source": "method", "repo": "andrewauclair/moderndocking", "text": "public AlwaysDisplayedPanel(DockingAPI docking, String title, String persistentID) { super(docking, title, persistentID); }", "tokens": 25} {"id": 28807, "source": "method", "repo": "andrewauclair/moderndocking", "text": "/** Create a new instance @param name The name of the property @param value The value of the property */ public ShortProperty(String name, short value) { super(name); this.value = value; }", "tokens": 45} {"id": 28922, "source": "method", "repo": "andrewauclair/moderndocking", "text": "/** Load a WindowLayout from an XML file @param file File to load WindowLayout from @return The loaded WindowLayout */ public WindowLayout loadWindowLayoutFromFile(File file) { XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); XMLStreamReader reader; try { reader = factory.createXMLStreamReader(Files.newInputStream(file.toPath())); } catch (Exception e) { logger.log(Level.INFO, e.getMessage(), e); return null; } WindowLayout layout = null; try { while (reader.hasNext()) { int next = reader.nextTag(); if (next == XMLStreamConstants.START_ELEMENT && reader.getLocalName().equals(\"layout\")) { layout = readLayoutFromReader(reader); break; } } } catch (XMLStreamException e) { logger.log(Level.INFO, e.getMessage(), e); } finally { try { reader.close(); } catch (XMLStreamException e) { logger.log(Level.INFO, e.getMessage(), e); } } return layout; }", "tokens": 246} {"id": 28946, "source": "method", "repo": "andrewauclair/moderndocking", "text": "/** Set the value of a dockable property @param persistentID The persistent ID of the dockable we're setting a property for @param property The name of the property we're configuring @param value The value of the property @return This WindowLayoutBuilderAPI instance */ public WindowLayoutBuilderAPI setProperty(String persistentID, String property, float value) { Map props = properties.getOrDefault(persistentID, new HashMap<>()); props.put(property, new Property.FloatProperty(property, value)); properties.put(persistentID, props); return this; }", "tokens": 119} {"id": 29078, "source": "method", "repo": "andrewauclair/moderndocking", "text": "/** Get the persistent ID of the selected tab @return The persistent ID of the selected tab */ public String getSelectedTabID() { return panels.get(tabs.getSelectedIndex()).getDockable().getPersistentID(); }", "tokens": 43} {"id": 29081, "source": "method", "repo": "andrewauclair/moderndocking", "text": "/** Check if this tabbed panel is using top tabs @return Are the tabs placed on the top? */ public boolean isUsingTopTabs() { return tabs.getTabPlacement() == JTabbedPane.TOP; }", "tokens": 44} {"id": 29200, "source": "method", "repo": "andrewauclair/moderndocking", "text": "/** Remove our drag source motion listener */ public void removeListeners() { dragSource.removeDragSourceMotionListener(this); }", "tokens": 27} {"id": 29329, "source": "method", "repo": "andrewauclair/moderndocking", "text": "/** Create a new tab panel node with a single dockable to start @param docking The docking instance this node belongs to @param selectedTabID Persistent ID of first dockable @param selectedTabClassName The name of the class for the selected tab, used to create the dockable if not found @param anchor The anchor associated with this node */ public DockingTabPanelNode(DockingAPI docking, String selectedTabID, String selectedTabClassName, String anchor, String titleText, String tabText) { this.docking = docking; addTab(selectedTabID, selectedTabClassName, anchor, titleText, tabText); this.selectedTabID = selectedTabID; }", "tokens": 133} {"id": 29364, "source": "method", "repo": "andrewauclair/moderndocking", "text": "/** Is Modern Docking using an existing drag threhsold? */ public static boolean isUseExistingDragThreshold() { return useExistingDragThreshold; }", "tokens": 33} {"id": 29455, "source": "method", "repo": "andrewauclair/moderndocking", "text": "/** Create a new ApplicationLayoutMenuItem for the specified layout. The layout name will be used as the display text. @param layoutName Name of the ApplicationLayout this ApplicationLayoutMenuItem will restore */ public ApplicationLayoutMenuItem(String layoutName) { super(layoutName); this.layoutName = layoutName; addActionListener(this); }", "tokens": 70} {"id": 29534, "source": "method", "repo": "annimon/own-programming-language-tutorial", "text": "public ColorValue(Color effect) { this.color = effect; }", "tokens": 16} {"id": 29723, "source": "method", "repo": "annimon/own-programming-language-tutorial", "text": "private void applyHeaderParams(MapValue headerParams, Request.Builder builder) { for (Map.Entry p : headerParams) { builder.header(p.getKey().asString(), p.getValue().asString()); } }", "tokens": 52} {"id": 29729, "source": "method", "repo": "annimon/own-programming-language-tutorial", "text": "public String toString() { return asString(); }", "tokens": 11} {"id": 29774, "source": "method", "repo": "annimon/own-programming-language-tutorial", "text": "protected RequestBodyValue(RequestBody requestBody, int methodsCount) { super(4 + methodsCount); this.requestBody = requestBody; this.mediaType = requestBody.contentType(); init(); }", "tokens": 38} {"id": 29782, "source": "method", "repo": "annimon/own-programming-language-tutorial", "text": "public static Headers getHeaders(Value arg, String msg) { if (arg.type() != Types.MAP) { throw new TypeException(\"Map expected\" + msg); } final Map headers = new LinkedHashMap<>(); for (Map.Entry entry : ((MapValue) arg)) { headers.put(entry.getKey().asString(), entry.getValue().asString()); } return Headers.of(headers); }", "tokens": 96} {"id": 30184, "source": "method", "repo": "annimon/own-programming-language-tutorial", "text": "public String toString() { return \"do \" + statement + \" while \" + condition; }", "tokens": 20} {"id": 30262, "source": "method", "repo": "annimon/own-programming-language-tutorial", "text": "public void visit(AssignmentExpression s) { super.visit(s); if (s.target instanceof VariableExpression varExpr) { final String variable = varExpr.name; if (moduleConstants.contains(variable)) { results.add(LinterResult.warning( \"Variable \\\"%s\\\" overrides constant\".formatted(variable))); } } }", "tokens": 73} {"id": 30313, "source": "method", "repo": "annimon/own-programming-language-tutorial", "text": "public Node visit(FunctionDefineStatement s, T t) { final Arguments newArgs = new Arguments(); boolean changed = visit(s.arguments, newArgs, t); final Node body = s.body.accept(this, t); if (changed || body != s.body) { return new FunctionDefineStatement(s.name, newArgs, consumeStatement(body), s.getRange()); } return s; }", "tokens": 93} {"id": 30325, "source": "method", "repo": "annimon/own-programming-language-tutorial", "text": "public static Map getInfo(Node node, boolean grabModuleConstants) { Map variableInfos = new HashMap<>(); node.accept(new VariablesGrabber(grabModuleConstants), variableInfos); return variableInfos; }", "tokens": 57} {"id": 30560, "source": "method", "repo": "anotheria/moskito", "text": "private void setupCustomThresholds(CustomThresholdProvider customThresholdProvider, OnDemandStatsProducer producer){ List thresholdNames = customThresholdProvider.getCustomThresholdNames(); ThresholdRepository repository = ThresholdRepository.getInstance(); for (String name :thresholdNames){ repository.createCustomThreshold(name, customThresholdProvider, producer); } }", "tokens": 73} {"id": 30918, "source": "method", "repo": "anotheria/moskito", "text": "protected Number getBarrierValueAsNumber(){ return barrierValue; }", "tokens": 14} {"id": 30974, "source": "method", "repo": "anotheria/moskito", "text": "public long getOverwritePuts(String intervalName) { return overwritePuts.getValueAsLong(intervalName); }", "tokens": 24} {"id": 31029, "source": "method", "repo": "anotheria/moskito", "text": "public DummyStatProducer(String aProducerId){ producerId = aProducerId; ServiceStats stat1 = new ServiceStats(\"first\"); ServiceStats stat2 = new ServiceStats(\"second\"); ServiceStats stat3 = new ServiceStats(\"third\"); ServiceStats stat4 = new ServiceStats(\"dynamic\"); dynamic = stat4; for (int i=0; i<100; i++){ stat1.addRequest(); stat2.addRequest();stat2.addRequest(); stat3.addRequest();stat3.addRequest();stat3.addRequest(); } stats.add(stat1);stats.add(stat2);stats.add(stat3);stats.add(stat4); ProducerRegistryFactory.getProducerRegistryInstance().registerProducer(this); }", "tokens": 171} {"id": 31104, "source": "method", "repo": "anotheria/moskito", "text": "public void init(Properties configuredProperties) throws ConnectorInitException { Properties properties = new Properties(getDefaultProperties()); properties.putAll(configuredProperties); initWithDefaultProperties(properties); }", "tokens": 38} {"id": 31343, "source": "method", "repo": "anotheria/moskito", "text": "protected String getPageName() { return \"threads_overview\"; }", "tokens": 14} {"id": 31409, "source": "method", "repo": "anotheria/moskito", "text": "public void setParameter(String parameter) { this.parameter = parameter; }", "tokens": 17} {"id": 31537, "source": "method", "repo": "ant-intl/antom-ai-tools", "text": "public String unprotectResponseFromChannel(InboundChannelMessage message) { String merchantId = ChannelRequestContext.current().getMerchantId(); SecurityVerifyRequest request = buildPayResponseVerify(message, message.getRawBody()); request.setMerchantId(merchantId); request.setAlgorithm(SecuritySignAlgorithm.HMAC_SHA256_BASE64); if (!platform.verify(request)) { throw new SecurityException(\"Synthetic response verification failed\"); } return message.getRawBody(); }", "tokens": 102} {"id": 31717, "source": "method", "repo": "apace100/origins-fabric", "text": "/** Check if the specified entities has the specified origin in the specified origin layer. @param commandContext the command context @return the number of players that has the specified origin in the specified origin layer @throws CommandSyntaxException if the entity is not found or if the entity is not an instance of {@link ServerPlayerEntity} */ private static int hasOrigin(CommandContext commandContext) throws CommandSyntaxException { Collection targets = EntityArgumentType.getPlayers(commandContext, \"targets\"); OriginLayer originLayer = LayerArgumentType.getLayer(commandContext, \"layer\"); Origin origin = OriginArgumentType.getOrigin(commandContext, \"origin\"); ServerCommandSource serverCommandSource = commandContext.getSource(); int processedTargets = 0; if (origin.equals(Origin.EMPTY) || originLayer.getOrigins().contains(origin.getIdentifier())) { for (ServerPlayerEntity target : targets) { OriginComponent originComponent = ModComponents.ORIGIN.get(target); if ((origin.equals(Origin.EMPTY) || originComponent.hasOrigin(originLayer)) && originComponent.getOrigin(originLayer).equals(origin)) processedTargets++; } if (processedTargets == 0) serverCommandSource.sendError(Text.translatable(\"commands.execute.conditional.fail\")); else if (processedTargets == 1) serverCommandSource.sendFeedback(() -> Text.translatable(\"commands.execute.conditional.pass\"), true); else { int finalProcessedTargets = processedTargets; serverCommandSource.sendFeedback(() -> Text.translatable(\"commands.execute.conditional.pass_count\", finalProcessedTargets), true); } } else serverCommandSource.sendError(Text.translatable(\"commands.origin.unregistered_in_layer\", origin.getIdentifier(), originLayer.getIdentifier())); return processedTargets; }", "tokens": 368} {"id": 31771, "source": "method", "repo": "apace100/origins-fabric", "text": "public Entity moveToWorld(ServerWorld destination) { Entity entity = this.getOwner(); if (entity != null && entity.getWorld().getRegistryKey() != destination.getRegistryKey()) { this.setOwner((Entity)null); } return super.moveToWorld(destination); }", "tokens": 57} {"id": 31836, "source": "method", "repo": "apace100/origins-fabric", "text": "public Optional getUpgrade(AdvancementEntry advancement) { return upgrades.stream() .filter(ou -> ou.advancementCondition().equals(advancement.id())) .findFirst(); }", "tokens": 43} {"id": 31870, "source": "method", "repo": "apace100/origins-fabric", "text": "public String getTranslationKey() { return getOrCreateTranslationKey(); }", "tokens": 12} {"id": 31923, "source": "method", "repo": "apace100/origins-fabric", "text": "public static void register(Identifier id, OriginLayer layer) { if (LAYERS.containsKey(id)) { throw new IllegalArgumentException(\"Duplicate origin layer id tried to register: '\" + id + \"'\"); } layer.id = id; LAYERS.put(id, layer); }", "tokens": 60} {"id": 31993, "source": "method", "repo": "apace100/origins-fabric", "text": "public void renderBackground(DrawContext context, int mouseX, int mouseY, float delta) { if (!showDirtBackground) { this.renderInGameBackground(context); } else { this.renderBackgroundTexture(context); } context.drawGuiTexture(WINDOW_BACKGROUND, guiLeft, guiTop, -4, WINDOW_WIDTH, WINDOW_HEIGHT); }", "tokens": 77} {"id": 32112, "source": "method", "repo": "apollographql/federation-jvm", "text": "private static GraphQLArgument fieldsArgument(String value) { return newArgument(fieldsArgument).value(value).build(); }", "tokens": 28} {"id": 32132, "source": "method", "repo": "apollographql/federation-jvm", "text": "private GraphQLCodeRegistry.Builder updateCodeRegistryWithEntityResolvers( Set entityTypeNames) { final List errors = new ArrayList<>(); final GraphQLCodeRegistry.Builder newCodeRegistry = GraphQLCodeRegistry.newCodeRegistry(originalSchema.getCodeRegistry()); if (!entityTypeNames.isEmpty()) { final boolean areEntitiesResolvable = resolvableEntitiesExist(entityTypeNames); if (entityTypeResolver != null) { newCodeRegistry.typeResolver(_Entity.typeName, entityTypeResolver); } else if (!areEntitiesResolvable) { // add fake entity union resolver as this type will never be resolved locally newCodeRegistry.typeResolver( _Entity.typeName, env -> { throw new IllegalStateException( \"_Entity type resolver should never be called on non-resolvable entities\"); }); } else if (!newCodeRegistry.hasTypeResolver(_Entity.typeName)) { errors.add(new FederationError(\"Missing a type resolver for _Entity\")); } if (areEntitiesResolvable) { // need _entities resolver final FieldCoordinates _entities = FieldCoordinates.coordinates( originalSchema.getQueryType().getName(), _Entity.fieldName); if (entitiesDataFetcher != null) { newCodeRegistry.dataFetcher(_entities, entitiesDataFetcher); } else if (entitiesDataFetcherFactory != null) { newCodeRegistry.dataFetcher(_entities, entitiesDataFetcherFactory); } else if (!newCodeRegistry.hasDataFetcher(_entities)) { errors.add(new FederationError(\"Missing a data fetcher for _entities\")); } } } if (!errors.isEmpty()) { throw new SchemaProblem(errors); } return newCodeRegistry; }", "tokens": 341} {"id": 32219, "source": "method", "repo": "apollographql/federation-jvm", "text": "public void verifyAnyCoercingCanParseValue() { Coercing coercing = _Any.type.getCoercing(); Assertions.assertEquals(1, coercing.parseValue(1, GraphQLContext.getDefault(), Locale.US)); }", "tokens": 48} {"id": 32497, "source": "method", "repo": "appiumtestdistribution/appiumtestdistribution", "text": "private void setFramedCapturedScreen(String framedCapturedScreen) { this.framedCapturedScreen = framedCapturedScreen; }", "tokens": 29} {"id": 32789, "source": "method", "repo": "apple/app-store-server-library-java", "text": "/** The original SKU of the item. @return currentSku @see SKU */ public String getCurrentSku() { return currentSku; }", "tokens": 52} {"id": 32798, "source": "method", "repo": "apple/app-store-server-library-java", "text": "/** @return items @see SubscriptionChangeMetadataItem */ public List getItems() { return items; }", "tokens": 55} {"id": 32883, "source": "method", "repo": "apple/app-store-server-library-java", "text": "public AdvancedCommerceSubscriptionRevokeRequest storefront(String storefront) { this.storefront = storefront; return this; }", "tokens": 26} {"id": 32946, "source": "method", "repo": "apple/app-store-server-library-java", "text": "public ConsumptionRequest consumptionPercentage(Integer consumptionPercentage) { this.consumptionPercentage = consumptionPercentage; return this; }", "tokens": 26} {"id": 33063, "source": "method", "repo": "apple/app-store-server-library-java", "text": "/** The type of subscription offer. @return offerType @see offerType */ public OfferType getOfferType() { return offerType != null ? OfferType.fromValue(offerType) : null; }", "tokens": 68} {"id": 33415, "source": "method", "repo": "archimatetool/archi", "text": "public boolean isUsedFor(IEditorPart editor) { return editor instanceof ICanvasEditor; }", "tokens": 21} {"id": 33489, "source": "method", "repo": "archimatetool/archi", "text": "public void createPartControl(Composite parent) { // Show error message if(fNullInput != null) { createErrorComposite(parent); } else { super.createPartControl(parent); doCreatePartControl(parent); } }", "tokens": 50} {"id": 33770, "source": "method", "repo": "archimatetool/archi", "text": "public void update(ViewerCell cell) { cell.setText(getColumnText(cell.getElement(), cell.getColumnIndex())); cell.setForeground(getForeground(cell.getElement(), cell.getColumnIndex())); cell.setImage(getColumnImage(cell.getElement(), cell.getColumnIndex())); }", "tokens": 56} {"id": 33838, "source": "method", "repo": "archimatetool/archi", "text": "public IIconDelegate getIconDelegate() { return BusinessRoleFigure.getIconDelegate(); }", "tokens": 19} {"id": 33848, "source": "method", "repo": "archimatetool/archi", "text": "public EClass providerFor() { return IArchimatePackage.eINSTANCE.getLocation(); }", "tokens": 18} {"id": 34024, "source": "method", "repo": "archimatetool/archi", "text": "/** @generated */ public EClass getTechnologyInterface() { return technologyInterfaceEClass; }", "tokens": 35} {"id": 34066, "source": "method", "repo": "archimatetool/archi", "text": "/** @generated */ public EList getProperties() { if (properties == null) { properties = new EObjectContainmentEList(IProperty.class, this, IArchimatePackage.FOLDER__PROPERTIES); } return properties; }", "tokens": 71} {"id": 34455, "source": "method", "repo": "archy-x/aureliumskills", "text": "public double getXp() { return xp; }", "tokens": 12} {"id": 34657, "source": "method", "repo": "archy-x/aureliumskills", "text": "private void removeEmpty(PersistentDataContainer container, MetaType metaType, ModifierType modifierType) { if (!container.isEmpty()) { return; } PersistentDataContainer parent = meta.getPersistentDataContainer(); NamespacedKey metaKey = new NamespacedKey(plugin, getContainerName(metaType, modifierType)); parent.remove(metaKey); }", "tokens": 68} {"id": 34767, "source": "method", "repo": "archy-x/aureliumskills", "text": "public void tickTimer() { var task = new TaskRunnable() { @Override public void run() { for (UUID id : errorMessageTimer.keySet()) { int timer = errorMessageTimer.get(id); if (timer != 0) { errorMessageTimer.put(id, errorMessageTimer.get(id) - 1); } } } }; plugin.getScheduler().timerSync(task, 0, 5 * 50, TimeUnit.MILLISECONDS); }", "tokens": 98} {"id": 34887, "source": "method", "repo": "archy-x/aureliumskills", "text": "public void sendMessage(Component component) { // Don't send empty messages if (plugin.getMessageProvider().componentToString(component).isEmpty()) { return; } if (player != null) { AdventureUtil.sendMessage(player, component, plugin.getAudiences()); } }", "tokens": 59} {"id": 34957, "source": "method", "repo": "archy-x/aureliumskills", "text": "protected double optionDouble(String option) { return plugin.configDouble(Option.valueOf(configPrefix + option.toUpperCase(Locale.ROOT))); }", "tokens": 32} {"id": 35040, "source": "method", "repo": "archy-x/aureliumskills", "text": "private long updateLeaderboardsSync() { if (sorting) return 0; long start = System.currentTimeMillis(); try { setSorting(true); // Initialize lists Map> skillLeaderboards = new ConcurrentHashMap<>(); for (Skill skill : plugin.getSkillRegistry().getValues()) { skillLeaderboards.put(skill, new ArrayList<>()); } List powerLeaderboard = new ArrayList<>(); List averageLeaderboard = new ArrayList<>(); // Add players already in memory addLoadedPlayersToLeaderboards(skillLeaderboards, powerLeaderboard, averageLeaderboard); // Add offline players addOfflinePlayers(skillLeaderboards, powerLeaderboard, averageLeaderboard, previousFetchTime); // Sort leaderboards and set as current sortLeaderboards(skillLeaderboards, powerLeaderboard, averageLeaderboard); setSorting(false); previousFetchTime = start; return System.currentTimeMillis() - start; } catch (Exception e) { plugin.logger().warn(\"Error updating leaderboards: \" + e.getMessage()); e.printStackTrace(); setSorting(false); } return System.currentTimeMillis() - start; }", "tokens": 234} {"id": 35215, "source": "method", "repo": "archy-x/aureliumskills", "text": "private void loadBackup(File file, Runnable onComplete) throws Exception { ConfigurationNode root = YamlConfigurationLoader.builder() .defaultOptions(opts -> opts.shouldCopyDefaults(false)) .path(file.toPath()).build().load(); int version = root.node(\"backup_version\").getInt(0); if (version == 2) { loadV2(root, onComplete); } else if (version == 1) { loadV1(root); } else { throw new IllegalStateException(\"Invalid backup_version\"); } }", "tokens": 117} {"id": 35229, "source": "method", "repo": "archy-x/aureliumskills", "text": "private List getAbilityDataRows(Map abilityDataMap, Map manaAbilityDataMap) { List rows = new ArrayList<>(); if (abilityDataMap.isEmpty()) { return rows; } for (AbilityData abilityData : abilityDataMap.values()) { String categoryId = abilityData.getAbility().getId().toString(); for (Map.Entry dataEntry : abilityData.getDataMap().entrySet()) { var row = new KeyValueRow(ABILITY_DATA_ID, categoryId, dataEntry.getKey(), String.valueOf(dataEntry.getValue())); rows.add(row); } } for (ManaAbilityData data : manaAbilityDataMap.values()) { if (data.getCooldown() <= 0) continue; String categoryId = data.getManaAbility().getId().toString(); var row = new KeyValueRow(ABILITY_DATA_ID, categoryId, \"cooldown\", String.valueOf(data.getCooldown())); rows.add(row); } return rows; }", "tokens": 228} {"id": 35518, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "public List getMixins() { return null; }", "tokens": 15} {"id": 35541, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "public static void resetShadowCulling() { SHADOW_CULLING_CONTROLLER_STACK.pop(); }", "tokens": 22} {"id": 35585, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "private static RenderType unwrapIrisRenderType2(RenderType renderType) { return renderType instanceof WrappableRenderType wrapped ? wrapped.unwrap() : renderType; }", "tokens": 30} {"id": 35680, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "public void beforeExpand() { unmap(); }", "tokens": 11} {"id": 35820, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "public VertexConsumer setUv1(int u, int v) { getDelegate().setUv1(u, v); return this; }", "tokens": 28} {"id": 35934, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "public void setupBufferState() { vertexFormat.setupBufferState(); }", "tokens": 16} {"id": 36017, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "public boolean isAccelerated() { return delegate .getAccelerated () .isAccelerated (); }", "tokens": 22} {"id": 36080, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "public void add(MeshUploader uploader) { var mesh = uploader .getServerMesh (); var count = uploader .getMeshCount (); var upload = get (mesh); upload.meshUploads.add(uploader); upload.meshCounter += count; }", "tokens": 59} {"id": 36167, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "public static FeatureStatus getDefaultGuiAccelerationSetting() { return FeatureConfig.CONFIG.acceleratedEntityRenderingGuiAcceleration.get(); }", "tokens": 27} {"id": 36172, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "public static boolean testItem(ItemStack itemStack) { return !PREDEFINED_ITEM_BLACKLIST_VALUES.contains(itemStack.getItem()) && getItemFilterType().test(ITEM_FILTER_VALUES, itemStack.getItem()); }", "tokens": 46} {"id": 36240, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "private GuiRenderTypes( String name, VertexFormat format, VertexFormat.Mode formatMode, int bufferSize, boolean affectsCrumbling, boolean sortOnUpload, Runnable setupState, Runnable clearState ) { super( name, format, formatMode, bufferSize, affectsCrumbling, sortOnUpload, setupState, clearState ); }", "tokens": 67} {"id": 36264, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "public void renderGradientFast( RenderType renderType, int minX, int minY, int maxX, int maxY, int colorFrom, int colorTo, int blitOffset, Operation original ) { if ( ! CoreFeature.isLoaded () || ! CoreFeature.isGuiBatching () || CoreFeature.shouldByPassGuiBatching () ) { original.call( renderType, minX, minY, maxX, maxY, colorFrom, colorTo, blitOffset ); return; } var last = pose.last(); GuiBatchingController.INSTANCE.submitGradient( last.pose (), last.normal (), renderType, minX, minY, maxX, maxY, blitOffset, colorFrom, colorTo ); }", "tokens": 152} {"id": 36267, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "public void renderBlitFast( ResourceLocation atlasLocation, int minX, int maxX, int minY, int maxY, int blitOffset, float minU, float maxU, float minV, float maxV, float red, float green, float blue, float alpha, Operation original ) { if ( ! CoreFeature.isLoaded () || ! CoreFeature.isGuiBatching () || CoreFeature.shouldByPassGuiBatching () ) { original.call( atlasLocation, minX, maxX, minY, maxY, blitOffset, minU, maxU, minV, maxV, red, green, blue, alpha ); return; } var last = pose.last(); GuiBatchingController.INSTANCE.submitBlit( last.pose (), last.normal (), atlasLocation, minX, maxX, minY, maxY, blitOffset, FastColor.ARGB32.color( (int) (alpha * 255.0f), (int) (red * 255.0f), (int) (green * 255.0f), (int) (blue * 255.0f) ), minU, maxU, minV, maxV ); }", "tokens": 264} {"id": 36355, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "public ISequenceKey getEffectKey(int index) { return effectKeys[index]; }", "tokens": 20} {"id": 36386, "source": "method", "repo": "Argon4W/AcceleratedRendering", "text": "public int getColor() { return (flag & 0xFFFFFF); }", "tokens": 15} {"id": 36444, "source": "method", "repo": "arnaudroger/simpleflatmapper", "text": "public final CsvReader reader(CharSequence content) throws IOException { return reader(charBuffer(content)); }", "tokens": 21} {"id": 36701, "source": "method", "repo": "arnaudroger/simpleflatmapper", "text": "public String toString() { return \"DynamicJdbcSetRowMapper{}\"; }", "tokens": 16} {"id": 36861, "source": "method", "repo": "arnaudroger/simpleflatmapper", "text": "public void testCustomSetter() throws Exception { Object o = new Object(); newFieldMapperAndMapToPS(new ConstantGetter(o), Object.class, new SetterProperty(new Setter() { @Override public void set(PreparedStatement target, Object value) throws Exception { ps.setString(35, \"aa\"); } })); verify(ps).setString(35, \"aa\"); }", "tokens": 96} {"id": 36993, "source": "method", "repo": "arnaudroger/simpleflatmapper", "text": "public boolean isKey() { return has(KeyProperty.class); }", "tokens": 16} {"id": 37097, "source": "method", "repo": "arnaudroger/simpleflatmapper", "text": "private Enumerable enumerable(int startRow, Sheet sheet, MappingContext mappingContext) { return new JoinMapperEnumerable(mapper, mappingContext, new RowEnumerable(startRow, sheet)); }", "tokens": 59} {"id": 37125, "source": "method", "repo": "arnaudroger/simpleflatmapper", "text": "public String getColumnName(Method method) { return aliasProvider.getAliasForMethod(method); }", "tokens": 22} {"id": 37146, "source": "method", "repo": "arnaudroger/simpleflatmapper", "text": "public String toString() { return \"StringUUIDGetter{\" + \"bytesGetter=\" + bytesGetter + '}'; }", "tokens": 23} {"id": 37315, "source": "method", "repo": "arnaudroger/simpleflatmapper", "text": "public I591(long id) { this.id = id; }", "tokens": 18} {"id": 37369, "source": "method", "repo": "arnaudroger/simpleflatmapper", "text": "public boolean next() { while (delegate.next()) { if (predicate.test(delegate.currentValue())) { return true; } } return false; }", "tokens": 33} {"id": 37656, "source": "method", "repo": "artipie/artipie", "text": "public void reqLineStringIsCorrect() { MatcherAssert.assertThat( new RequestLine(\"GET\", \"/pub/WWW/TheProject.html\", \"HTTP/1.1\").toString(), Matchers.equalTo(\"GET /pub/WWW/TheProject.html HTTP/1.1\") ); }", "tokens": 60} {"id": 37717, "source": "method", "repo": "artipie/artipie", "text": "public void onSubscribe(final Subscription subscription) { this.origin.onSubscribe(subscription); }", "tokens": 21} {"id": 37757, "source": "method", "repo": "artipie/artipie", "text": "void returnsEmptyArrayIfAliasesDoNotExists(final Vertx vertx, final VertxTestContext ctx) throws Exception { this.requestAndAssert( vertx, ctx, new TestRequest(\"/api/v1/storages\"), resp -> MatcherAssert.assertThat( resp.body().toJsonArray().isEmpty(), new IsEqual<>(true) ) ); }", "tokens": 74} {"id": 37861, "source": "method", "repo": "artipie/artipie", "text": "public CompletionStage applyToEither( final CompletionStage other, final Function func ) { return this.delegate.applyToEither(other, func); }", "tokens": 46} {"id": 38006, "source": "method", "repo": "artipie/artipie", "text": "/** Returns list of revisions for the recipe. @return CompletionStage with the list. */ public CompletionStage> getRecipeRevisions() { return this.core.getRevisions(this.getRecipeRevkey()); }", "tokens": 48} {"id": 38082, "source": "method", "repo": "artipie/artipie", "text": "public AstoDocker(String registryName, Storage storage) { this.registryName = registryName; this.storage = storage; }", "tokens": 29} {"id": 38083, "source": "method", "repo": "artipie/artipie", "text": "/** Reads link to blob by manifest reference. @param ref Manifest reference. @return Blob digest, empty if no link found. */ private CompletableFuture> readLink(final ManifestReference ref) { final Key key = Layout.manifest(this.name, ref); return this.storage.exists(key).thenCompose( exists -> { if (exists) { return this.storage.value(key) .thenCompose(Content::asStringFuture) .thenApply(val -> Optional.of(new Digest.FromString(val))); } return CompletableFuture.completedFuture(Optional.empty()); } ); }", "tokens": 130} {"id": 38221, "source": "method", "repo": "artipie/artipie", "text": "/** Checks that chart has required version and delete archive from storage in case of existence of the key. @param chart Chart yaml. @param vers Version which should be deleted. If it is empty, all versions should be deleted. @param key Key to archive which will be deleted in case of compliance. @return Was chart by passed key deleted? */ private CompletionStage wasChartDeleted( final ChartYaml chart, final Optional vers, final Key key ) { final CompletionStage res; if (!vers.isPresent() || chart.version().equals(vers.get())) { res = this.storage.exists(key).thenCompose( exists -> { final CompletionStage result; if (exists) { result = this.storage.delete(key).thenApply(noth -> true); } else { result = CompletableFuture.completedFuture(false); } return result; } ); } else { res = CompletableFuture.completedFuture(false); } return res; }", "tokens": 208} {"id": 38311, "source": "method", "repo": "artipie/artipie", "text": "public Maybe loadAsset(final String path, final Path tmp) { return Maybe.fromFuture( this.breaker.>executeWithFallback( future -> future.complete(this.wrapped.loadAsset(path, tmp)), exception -> Maybe.empty() ).toCompletionStage().toCompletableFuture() ).flatMap(m -> m); }", "tokens": 83} {"id": 38653, "source": "method", "repo": "askimed/nf-test", "text": "public Integer process(@Parameters(description = \"source files\") List scripts) { return generate(scripts, new ProcessTestGenerator()); }", "tokens": 31} {"id": 38657, "source": "method", "repo": "askimed/nf-test", "text": "protected int generate(List scripts, ITestGenerator generator) { Config config = null; try { File configFile = new File(Config.FILENAME); if (configFile.exists()) { config = Config.parse(configFile); } else { System.out.println(AnsiColors.red(\"Error: This pipeline has no nf-test config file.\")); return 2; } } catch (Exception e) { System.out.println(AnsiColors.red(\"Error: Syntax errors in nf-test config file: \" + e)); return 2; } try { int count = 0; if (scripts.isEmpty()) { System.out.println(AnsiColors.red(\"Error: No script files provided.\")); return 1; } for (File script : scripts) { if (!script.exists()) { System.out.println(AnsiColors.red(\"Error: script '\" + script.getAbsolutePath() + \"' not found.\")); return 1; } String targetPath = FileUtil.path(config.getTestsDir(), script.getPath() + \".test\"); File target = new File(targetPath); System.out.println(); count += generator.generate(script, target); } System.out.println(); System.out.println(AnsiColors.green(\"SUCCESS:\") + \" Generated \" + count + \" test files.\"); System.out.println(); return 0; } catch (Throwable e) { System.out.println(AnsiColors.red(\"Error: \" + e)); return 1; } }", "tokens": 328} {"id": 38686, "source": "method", "repo": "askimed/nf-test", "text": "public String getTestsDir() { return testsDir; }", "tokens": 13} {"id": 38858, "source": "method", "repo": "askimed/nf-test", "text": "public void testSuiteExecutionStarted(ITestSuite testSuite) { activeTestSuite = new TestSuiteExecutionResult(testSuite); activeTestSuite.setStartTime(System.currentTimeMillis()); testSuites.add(activeTestSuite); }", "tokens": 46} {"id": 38895, "source": "method", "repo": "askimed/nf-test", "text": "public Closure getClosure() { return closure; }", "tokens": 12} {"id": 38970, "source": "method", "repo": "askimed/nf-test", "text": "public static void generateDotFile(DependencyResolver resolver, String outputPath) { try (FileWriter writer = new FileWriter(outputPath)) { writer.write(\"digraph G {\\n\"); writer.write(\"\\tnode [shape=note,colorscheme=pastel19\\n];\\n\"); writer.write(\"\\trankdir=LR;\\n\"); for (DependencyGraph.Node node: resolver.getGraph().getNodes()) { writer.write(\"\\t\" + quote(getNodeId(resolver.getBaseDir(), node.getMetaFile())) + \" [label=\" + quote(getNodeName(resolver.getBaseDir(), node.getMetaFile())) + \", \" + getStyle(node) + \"]\\n\"); for (IMetaFile dependency: resolver.getGraph().getDependencies(node.getFilename())) { writer.write(String.format(\"\\t%s -> %s;\\n\", quote(getNodeId(resolver.getBaseDir(), node.getMetaFile())), quote(getNodeId(resolver.getBaseDir(), dependency)))); } } writer.write(\"}\"); } catch (IOException e) { e.printStackTrace(); } }", "tokens": 231} {"id": 39321, "source": "method", "repo": "askimed/nf-test", "text": "public void testSyntaxErrorInConfig() throws Exception { Files.copy(new File(\"test-data/nf-test-error.config\").toPath(), new FileOutputStream(new File(\"nf-test.config\"))); App app = new App(); int exitCode = app.run(new String[] { \"generate\", \"workflow\", \"test-data/pipeline/dsl2/trial.nf\" }); assertEquals(2, exitCode); assertFalse(new File(\"tests/test-data/pipeline/dsl2/trial.nf.test\").exists()); }", "tokens": 120} {"id": 39513, "source": "method", "repo": "asmcup/runtime", "text": "public void decompile(byte[] ram) { int pc = 0; int end = 255; while (read8(ram, end) == 0 && end > 0) { end--; } while (pc <= end) { pc += decompileCommand(ram, pc); } }", "tokens": 67} {"id": 39682, "source": "method", "repo": "asmcup/runtime", "text": "public RecordedRobot(Recorder recorder, int id, byte[] rom) { this(recorder, id, new RecordedVM(rom)); }", "tokens": 32} {"id": 39722, "source": "method", "repo": "asmcup/runtime", "text": "public int getGold() { return gold; }", "tokens": 12} {"id": 39735, "source": "method", "repo": "asmcup/runtime", "text": "protected static float floatModPositive(float dividend, float divisor) { return ((dividend % divisor) + divisor) % divisor; }", "tokens": 31} {"id": 39746, "source": "method", "repo": "asmcup/runtime", "text": "public void removeRobot(Robot robot) { robots.remove(robot); }", "tokens": 18} {"id": 39772, "source": "method", "repo": "asmcup/runtime", "text": "public int recv(Robot robot, float frequency) { // TODO read data on radio return 0; }", "tokens": 24} {"id": 39814, "source": "method", "repo": "asmcup/runtime", "text": "public DefaultContextMenu(JTextComponent jTextComponent) { setTextComponent(jTextComponent); undoManager = new UndoManager(); clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); undo = new JMenuItem(\"Undo\"); undo.setEnabled(false); undo.setAccelerator(KeyStroke.getKeyStroke(\"control Z\")); undo.addActionListener(event -> undoManager.undo()); add(undo); redo = new JMenuItem(\"Redo\"); redo.setEnabled(false); redo.setAccelerator(KeyStroke.getKeyStroke(\"control Y\")); redo.addActionListener(event -> undoManager.redo()); add(redo); add(new JSeparator()); cut = new JMenuItem(\"Cut\"); cut.setEnabled(false); cut.setAccelerator(KeyStroke.getKeyStroke(\"control X\")); cut.addActionListener(event -> jTextComponent.cut()); add(cut); copy = new JMenuItem(\"Copy\"); copy.setEnabled(false); copy.setAccelerator(KeyStroke.getKeyStroke(\"control C\")); copy.addActionListener(event -> jTextComponent.copy()); add(copy); paste = new JMenuItem(\"Paste\"); paste.setEnabled(false); paste.setAccelerator(KeyStroke.getKeyStroke(\"control V\")); paste.addActionListener(event -> jTextComponent.paste()); add(paste); delete = new JMenuItem(\"Delete\"); delete.setEnabled(false); delete.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)); delete.addActionListener(event -> jTextComponent.replaceSelection(\"\")); add(delete); add(new JSeparator()); selectAll = new JMenuItem(\"Select All\"); selectAll.setEnabled(false); selectAll.setAccelerator(KeyStroke.getKeyStroke(\"control A\")); selectAll.addActionListener(event -> jTextComponent.selectAll()); add(selectAll); }", "tokens": 349} {"id": 39842, "source": "method", "repo": "asmcup/runtime", "text": "public void showCodeEditor() { sandbox.codeEditor.setVisible(true); }", "tokens": 18} {"id": 39937, "source": "method", "repo": "asmcup/runtime", "text": "public int read16(int addr) { return read8(addr) | (read8(addr + 1) << 8); }", "tokens": 32} {"id": 39984, "source": "method", "repo": "asmcup/runtime", "text": "public void testWriteOpcodeDataTooLarge() { compiler.writeOp(0, 0b1000000); }", "tokens": 29} {"id": 39987, "source": "method", "repo": "asmcup/runtime", "text": "public void testParseLiteralNAN() { Compiler.parseLiteralByte(\"#nan\"); }", "tokens": 19} {"id": 40213, "source": "method", "repo": "aspose-cells/aspose.cells-for-java", "text": "public void pageEndSaving(PageEndSavingArgs args) { System.out.println(\"End saving page index \" + args.getPageIndex() + \" of pages \" + args.getPageCount()); //don't output pages after page index 8. if (args.getPageIndex() >= 8) { args.setHasMorePages(false); } }", "tokens": 77} {"id": 40250, "source": "method", "repo": "aspose-cells/aspose.cells-for-java", "text": "public static void main(String[] args) throws Exception { // ExStart:1 // Instantiating a Workbook object Workbook workbook = new Workbook(srcDir + \"sourcePivotTable.xlsx\"); // Access first worksheet Worksheet worksheet = workbook.getWorksheets().get(0); // Access first pivot table inside the worksheet PivotTable pivotTable = worksheet.getPivotTables().get(0); ; // Access pivot table refresh by who property System.out.println(\"Pivot table refresh by who = \" + pivotTable.getRefreshedByWho()); // Access pivot table refresh date System.out.println(\"Pivot table refresh date = \" + pivotTable.getRefreshDate()); // ExEnd:1 // Print message System.out.println(\"GetPivotTableRefreshDate executed successfully\"); }", "tokens": 158} {"id": 40252, "source": "method", "repo": "aspose-cells/aspose.cells-for-java", "text": "public static void main(String[] args) throws Exception { // The path to the documents directory. String dataDir = Utils.getSharedDataDir(ModifyPivotTableQuickStyle.class) + \"PivotTables/\"; // Open the template file containing the pivot table. Workbook wb = new Workbook(dataDir + \"sample1.xlsx\"); // Add Pivot Table style Style style1 = wb.createStyle(); com.aspose.cells.Font font1 = style1.getFont(); font1.setColor(Color.getRed()); Style style2 = wb.createStyle(); com.aspose.cells.Font font2 = style2.getFont(); font2.setColor(Color.getBlue()); int i = wb.getWorksheets().getTableStyles().addPivotTableStyle(\"tt\"); // Get and Set the table style for different categories TableStyle ts = wb.getWorksheets().getTableStyles().get(i); int index = ts.getTableStyleElements().add(TableStyleElementType.FIRST_COLUMN); TableStyleElement e = ts.getTableStyleElements().get(index); e.setElementStyle(style1); index = ts.getTableStyleElements().add(TableStyleElementType.GRAND_TOTAL_ROW); e = ts.getTableStyleElements().get(index); e.setElementStyle(style2); // Set Pivot Table style name PivotTable pt = wb.getWorksheets().get(0).getPivotTables().get(0); pt.setPivotTableStyleName(\"tt\"); // Save the file. wb.save(dataDir + \"ModifyPivotTableQuickStyle_out.xlsx\"); }", "tokens": 327} {"id": 40412, "source": "method", "repo": "aspose-cells/aspose.cells-for-java", "text": "public static void main(String[] args) throws Exception { // The path to the documents directory. String dataDir = Utils.getSharedDataDir(GetValidationAppliedonCell.class) + \"TechnicalArticles/\"; // Instantiate the workbook from sample Excel file Workbook workbook = new Workbook(dataDir + \"book1.xlsx\"); // Access its first worksheet Worksheet worksheet = workbook.getWorksheets().get(0); // Cell C1 has the Decimal Validation applied on it. // It can take only the values Between 10 and 20 Cell cell = worksheet.getCells().get(\"C1\"); // Access the valditation applied on this cell Validation validation = cell.getValidation(); // Read various properties of the validation System.out.println(\"Reading Properties of Validation\"); System.out.println(\"--------------------------------\"); System.out.println(\"Type: \" + validation.getType()); System.out.println(\"Operator: \" + validation.getOperator()); System.out.println(\"Formula1: \" + validation.getFormula1()); System.out.println(\"Formula2: \" + validation.getFormula2()); System.out.println(\"Ignore blank: \" + validation.getIgnoreBlank()); }", "tokens": 248} {"id": 40636, "source": "method", "repo": "aspose-cells/aspose.cells-for-java", "text": "private void updateProjectPom(Document pomDocument) { // Get the root element Node projectNode = pomDocument.getFirstChild(); // Adding Dependencies here Element dependenciesTag = pomDocument.createElement(\"dependencies\"); projectNode.appendChild(dependenciesTag); for (Metadata dependency : getAsposeProjectMavenDependencies()) { addAsposeMavenDependency(pomDocument, dependenciesTag, dependency); } }", "tokens": 76} {"id": 40677, "source": "method", "repo": "aspose-cells/aspose.cells-for-java", "text": "/** @param wiz */ public void uninitialize(WizardDescriptor wiz) { this.wiz.putProperty(\"projdir\", null); this.wiz.putProperty(\"name\", null); this.wiz = null; panels = null; }", "tokens": 52} {"id": 40714, "source": "method", "repo": "aspose-cells/aspose.cells-for-java", "text": "public void nextPanel() { if (!hasNext()) { throw new NoSuchElementException(); } index++; }", "tokens": 21} {"id": 41120, "source": "method", "repo": "aspose-pdf/aspose.pdf-for-java", "text": "public static void setFieldAlignment(Path inputFile, Path outputFile) { FormEditor editor = new FormEditor(); try { editor.bindPdf(inputFile.toString()); editor.setFieldAlignment(\"First Name\", FormFieldFacade.ALIGN_CENTER); editor.save(outputFile.toString()); } finally { editor.close(); } }", "tokens": 68} {"id": 41343, "source": "method", "repo": "aspose-pdf/aspose.pdf-for-java", "text": "public static void mergeWithSectionSeparatorsAndBookmarks(List inputFiles, Path outputFile) { try (Document outputDocument = new Document()) { int sectionIndex = 1; for (Path inputFile : inputFiles) { try (Document sourceDocument = new Document(inputFile.toString())) { int sourcePageCount = sourceDocument.getPages().size(); Page separatorPage = outputDocument.getPages().add(); separatorPage.getParagraphs().add(new TextFragment( \"Section \" + sectionIndex + \": \" + inputFile.getFileName())); OutlineItemCollection sectionBookmark = new OutlineItemCollection(outputDocument.getOutlines()); sectionBookmark.setTitle(\"Section \" + sectionIndex); sectionBookmark.setAction(new GoToAction(separatorPage)); outputDocument.getOutlines().add(sectionBookmark); int firstContentPageNumber = outputDocument.getPages().size() + 1; appendPageRange(sourceDocument, outputDocument, 1, sourcePageCount); if (sourcePageCount > 0 && firstContentPageNumber <= outputDocument.getPages().size()) { OutlineItemCollection contentBookmark = new OutlineItemCollection(outputDocument.getOutlines()); contentBookmark.setTitle(\"Section \" + sectionIndex + \" Content\"); contentBookmark.setAction(new GoToAction(outputDocument.getPages().get_Item(firstContentPageNumber))); sectionBookmark.add(contentBookmark); } } sectionIndex++; } outputDocument.save(outputFile.toString()); } }", "tokens": 303} {"id": 41466, "source": "method", "repo": "aspose-pdf/aspose.pdf-for-java", "text": "public static void createTable(Path outputFile) { try (Document document = new Document()) { Page page = document.getPages().add(); Table table = new Table(); table.setBorder(new BorderInfo(BorderSide.All, 5, Color.getLightGray())); table.setDefaultCellBorder(new BorderInfo(BorderSide.All, 5, Color.getLightGray())); for (int rowCount = 0; rowCount < 10; rowCount++) { Row row = table.getRows().add(); row.getCells().add(\"Column (\" + rowCount + \", 1)\"); row.getCells().add(\"Column (\" + rowCount + \", 2)\"); row.getCells().add(\"Column (\" + rowCount + \", 3)\"); } page.getParagraphs().add(table); document.save(outputFile.toString()); } }", "tokens": 180} {"id": 41574, "source": "method", "repo": "aspose-pdf/aspose.pdf-for-java", "text": "/** Dispose all of the cached cursors. */ public static void disposeCursors() { for (Cursor cursor : m_idToCursorMap.values()) { cursor.dispose(); } m_idToCursorMap.clear(); }", "tokens": 50} {"id": 41592, "source": "method", "repo": "aspose-pdf/aspose.pdf-for-java", "text": "public ModuleWizardStep modifySettingsStep(@NotNull SettingsStep settingsStep) { return StdModuleTypes.JAVA.modifySettingsStep(settingsStep, this); }", "tokens": 34} {"id": 41692, "source": "method", "repo": "aspose-words/aspose.words-for-java", "text": "public void removeBlankPages() throws Exception { //ExStart //ExFor:Document.RemoveBlankPages //ExSummary:Shows how to remove blank pages from the document. Document doc = new Document(getMyDir() + \"Blank pages.docx\"); Assert.assertEquals(2, doc.getPageCount()); doc.removeBlankPages(); doc.updatePageLayout(); Assert.assertEquals(1, doc.getPageCount()); //ExEnd }", "tokens": 87} {"id": 41895, "source": "method", "repo": "aspose-words/aspose.words-for-java", "text": "public void ignoreStoreItemId() throws Exception { //ExStart:IgnoreStoreItemId //GistId:a76df4b18bee76d169e55cdf6af8129c //ExFor:AdvancedCompareOptions //ExFor:AdvancedCompareOptions.IgnoreStoreItemId //ExSummary:Shows how to compare SDT with same content but different store item id. Document docA = new Document(getMyDir() + \"Document with SDT 1.docx\"); Document docB = new Document(getMyDir() + \"Document with SDT 2.docx\"); // Configure options to compare SDT with same content but different store item id. CompareOptions compareOptions = new CompareOptions(); compareOptions.getAdvancedOptions().setIgnoreStoreItemId(false); docA.compare(docB, \"user\", new Date(), compareOptions); Assert.assertEquals(8, docA.getRevisions().getCount()); compareOptions.getAdvancedOptions().setIgnoreStoreItemId(true); docA.getRevisions().rejectAll(); docA.compare(docB, \"user\", new Date(), compareOptions); Assert.assertEquals(0, docA.getRevisions().getCount()); //ExEnd:IgnoreStoreItemId }", "tokens": 263} {"id": 41918, "source": "method", "repo": "aspose-words/aspose.words-for-java", "text": "public void strokeBackThemeColors() throws Exception { //ExStart:StrokeBackThemeColors //GistId:b9e728d2381f759edd5b31d64c1c4d3f //ExFor:Stroke.BackThemeColor //ExFor:Stroke.BackTintAndShade //ExSummary:Shows how to set back theme color and tint and shade. Document doc = new Document(getMyDir() + \"Stroke gradient outline.docx\"); Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true); Stroke stroke = shape.getStroke(); stroke.setBackThemeColor(ThemeColor.DARK_2); stroke.setBackTintAndShade(0.2d); doc.save(getArtifactsDir() + \"Shape.StrokeBackThemeColors.docx\"); //ExEnd:StrokeBackThemeColors doc = new Document(getArtifactsDir() + \"Shape.StrokeBackThemeColors.docx\"); shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true); Assert.assertEquals(ThemeColor.DARK_2, shape.getStroke().getBackThemeColor()); double precision = 1e-6; Assert.assertEquals(0.2d, shape.getStroke().getBackTintAndShade(), precision); }", "tokens": 266} {"id": 41943, "source": "method", "repo": "aspose-words/aspose.words-for-java", "text": "/** Provides an up-to-date collection of cells which make up the column represented by this facade. */ private ArrayList getColumnCells() { ArrayList columnCells = new ArrayList(); for (Row row : mTable.getRows()) { Cell cell = row.getCells().get(mColumnIndex); if (cell != null) { columnCells.add(cell); } } return columnCells; }", "tokens": 82} {"id": 41954, "source": "method", "repo": "aspose-words/aspose.words-for-java", "text": "/** Starts printing without showing the print dialog. @throws PrinterException If printing fails. */ public void printSilently() throws PrinterException { PrinterJob printerJob = PrinterJob.getPrinterJob(); printerJob.setPrintable(this); handleBeginPrint(); printerJob.print(); handleEndPrint(); }", "tokens": 67} {"id": 42225, "source": "method", "repo": "aspose-words/aspose.words-for-java", "text": "public ArrayList retrieveAllNodesOnPages(int startPage, int endPage, /*NodeType*/int nodeType) throws Exception { if (startPage < 1 || startPage > collector.getDocument().getPageCount()) { throw new IllegalStateException(\"'startPage' is out of range\"); } if (endPage < 1 || endPage > collector.getDocument().getPageCount() || endPage < startPage) { throw new IllegalStateException(\"'endPage' is out of range\"); } checkPageListsPopulated(); ArrayList pageNodes = new ArrayList<>(); for (int page = startPage; page <= endPage; page++) { // Some pages can be empty. if (!reversePageLookup.containsKey(page)) { continue; } for (Node node : reversePageLookup.get(page)) { if (node.getParentNode() != null && (nodeType == NodeType.ANY || node.getNodeType() == nodeType) && !pageNodes.contains(node)) { pageNodes.add(node); } } } return pageNodes; }", "tokens": 223} {"id": 42234, "source": "method", "repo": "aspose-words/aspose.words-for-java", "text": "private void saveTableOfContents(ArrayList topics) throws Exception { Document tocDoc = new Document(mTocTemplate); // We use a custom mail merge event handler defined below, // and a custom mail merge data source based on collecting the topics we created. tocDoc.getMailMerge().setFieldMergingCallback(new HandleTocMergeField()); tocDoc.getMailMerge().executeWithRegions(new TocMailMergeDataSource(topics)); tocDoc.save(mDstDir + \"contents.html\"); }", "tokens": 112} {"id": 42888, "source": "method", "repo": "assert-kth/depclean", "text": "/** Returns the coordinates of every artifact a first-level dependency itself resolves to. */ private static Set namesOf(final ResolvedDependency dependency) { return dependency.getModuleArtifacts().stream() .map(DepCleanGradleAction::getName) .collect(Collectors.toSet()); }", "tokens": 60} {"id": 42961, "source": "method", "repo": "assert-kth/depclean", "text": "/** Returns all the artifacts of the project. @param allDependencies All dependencies of the project. @return All artifacts of the project. */ public Set getAllArtifacts(final Set allDependencies) { Set allArtifacts = new HashSet<>(); for (ResolvedDependency dependency : allDependencies) { Set partialAllArtifacts = new HashSet<>(dependency.getModuleArtifacts()); for (ResolvedArtifact artifact : partialAllArtifacts) { ArtifactConfigurationMap.put(artifact, dependency.getConfiguration()); allArtifacts.add(artifact); } } return allArtifacts; }", "tokens": 119} {"id": 42992, "source": "method", "repo": "assert-kth/depclean", "text": "public String getDescription(Locale locale) { return \"Used and potentially unused dependencies detected by DepClean's bytecode analysis.\"; }", "tokens": 27} {"id": 43051, "source": "method", "repo": "assert-kth/depclean", "text": "/** Creates the renderer. @param sink the sink to render into @param snapshot the analysis result to render @param projectName the name (or coordinates) of the analysed project @param reused whether the result was reused from an earlier {@code depclean:depclean} run */ public DepCleanReportRenderer( Sink sink, AnalysisSnapshot snapshot, String projectName, boolean reused) { super(sink); this.snapshot = snapshot; this.projectName = projectName; this.reused = reused; this.categories = Arrays.asList( new Category(\"Used direct dependencies\", \"used-direct\", snapshot.getUsedDirect()), new Category( \"Used transitive dependencies\", \"used-transitive\", snapshot.getUsedTransitive()), new Category( \"Used inherited direct dependencies\", \"used-inherited-direct\", snapshot.getUsedInheritedDirect()), new Category( \"Used inherited transitive dependencies\", \"used-inherited-transitive\", snapshot.getUsedInheritedTransitive()), new Category( \"Potentially unused direct dependencies\", \"unused-direct\", snapshot.getUnusedDirect()), new Category( \"Potentially unused transitive dependencies\", \"unused-transitive\", snapshot.getUnusedTransitive()), new Category( \"Potentially unused inherited direct dependencies\", \"unused-inherited-direct\", snapshot.getUnusedInheritedDirect()), new Category( \"Potentially unused inherited transitive dependencies\", \"unused-inherited-transitive\", snapshot.getUnusedInheritedTransitive()), new Category(\"Ignored dependencies\", \"ignored\", snapshot.getIgnored())); }", "tokens": 295} {"id": 43136, "source": "method", "repo": "assert-kth/depclean", "text": "public Path getSourceDirectory() { return new File(project.getBuild().getSourceDirectory()).toPath(); }", "tokens": 21} {"id": 43201, "source": "method", "repo": "assert-kth/depclean", "text": "void testRunCommandWithTheCommandAsASingleString() throws IOException, InterruptedException { String[] output = MavenInvoker.runCommand(javaExecutable() + \" -version\", null); // `java -version` writes to the standard error, so the standard output is empty, but the // command must be found and must succeed. assertThat(output).isEmpty(); }", "tokens": 75} {"id": 43276, "source": "method", "repo": "assert-kth/sorald", "text": "/** Creates an explicit access to a this variable (of the form type.this). @param the actual type of this @param type the reference to the type that holds the this variable @return a type.this expression */ public CtThisAccess createThisAccess(CtTypeReference type) { return createThisAccess(type, false); }", "tokens": 97} {"id": 43281, "source": "method", "repo": "assert-kth/sorald", "text": "/** Creates a list of statements that contains the assignments of a set of variables. @param variables the variables to be assigned @param expressions the assigned expressions @return a list of variable assignments */ public CtStatementList createVariableAssignments(List> variables, List> expressions) { CtStatementList result = factory.Core().createStatementList(); for (int i = 0; i < variables.size(); i++) { result.addStatement(createVariableAssignment(variables.get(i).getReference(), variables.get(i).getModifiers().contains(ModifierKind.STATIC), expressions.get(i))); } return result; }", "tokens": 145} {"id": 43348, "source": "method", "repo": "assert-kth/sorald", "text": "public CLIConfigForStaticAnalyzer setRuleParameters( Map> ruleParameters) { this.ruleParameters = ruleParameters; return this; }", "tokens": 37} {"id": 43409, "source": "method", "repo": "assert-kth/sorald", "text": "/** @return Mapping from key to all warnings mined for that key after repairs. */ public Map> minedViolationsAfter() { return Collections.unmodifiableMap(minedViolationsAfter); }", "tokens": 49} {"id": 43442, "source": "method", "repo": "assert-kth/sorald", "text": "public MineSonarWarnings( List eventHandlers, CLIConfigForStaticAnalyzer cliOptions) { this.eventHandlers = Collections.unmodifiableList(eventHandlers); this.cliOptions = cliOptions; }", "tokens": 47} {"id": 43463, "source": "method", "repo": "assert-kth/sorald", "text": "protected void repairInternal(CtReturn ctReturn) { CtLiteral elem2Replace = ctReturn.getFactory().createLiteral(-1); ctReturn.getReturnedExpression().replace(elem2Replace); }", "tokens": 46} {"id": 43622, "source": "method", "repo": "assert-kth/sorald", "text": "/** Scan a project for rule violations. @param target Targeted file or directory of the project. @param baseDir Base directory of the project. @param rules Rules to scan for. @return All violations in the target. */ public static Set scanProject(File target, File baseDir, List rules) { return scanProject(target, baseDir, rules, null); }", "tokens": 83} {"id": 43665, "source": "method", "repo": "assert-kth/sorald", "text": "public Collection findViolations( File projectRoot, List files, List rules, CLIConfigForStaticAnalyzer cliOptions) { return analyze(projectRoot, files, rules, cliOptions); }", "tokens": 48} {"id": 43785, "source": "method", "repo": "assert-kth/sorald", "text": "/** Assert that the statistics output does not contain a crash report. */ private static void assertNoCrashReport(Path statsOutputFile) throws IOException { JSONObject jo = FileUtils.readJSON(statsOutputFile); JSONArray ja = jo.getJSONArray(StatsMetadataKeys.CRASHES); assertThat(ja.toList(), is(empty())); }", "tokens": 67} {"id": 44041, "source": "method", "repo": "assert-kth/sorald", "text": "/** Register the specified event with all handlers. @param event An event @param handlers The handlers to operate on */ public static void fireEvent( SoraldEvent event, Collection handlers) { handlers.forEach(handler -> handler.registerEvent(event)); }", "tokens": 59} {"id": 44517, "source": "method", "repo": "astrazeneca-ngs/vardictjava", "text": "public Object[][] dataForIsBEGIN_ATGC_AMP_ATGCs_END_Test() { return new Object[][] { {\"A&ACGT\", true}, {\"A&\", false}, {\"A&ASGT\", false} }; }", "tokens": 55} {"id": 44680, "source": "method", "repo": "astrelsky/ghidra-cpp-class-analyzer", "text": "public int getTypeCount() { return worker.getTables().getTypeTable().getRecordCount(); }", "tokens": 21} {"id": 44795, "source": "method", "repo": "astrelsky/ghidra-cpp-class-analyzer", "text": "public final Table getVtableTable() { return vtableTable.getTable(); }", "tokens": 16} {"id": 44830, "source": "method", "repo": "astrelsky/ghidra-cpp-class-analyzer", "text": "/** @return the baseKeys */ protected long[] getBaseKeys() { return baseKeys; }", "tokens": 20} {"id": 44873, "source": "method", "repo": "astrelsky/ghidra-cpp-class-analyzer", "text": "public Address getAddress() { VtableRecord record = getRecord(); return getManager().decodeAddress(record.getLongValue(ADDRESS)); }", "tokens": 30} {"id": 45459, "source": "method", "repo": "astrelsky/ghidra-cpp-class-analyzer", "text": "public final void markDataAsConstant(Address address) { Data data = program.getListing().getDataAt(address); if (data == null) { return; } SettingsDefinition[] settings = data.getDataType().getSettingsDefinitions(); for (SettingsDefinition setting : settings) { if (setting instanceof MutabilitySettingsDefinition) { MutabilitySettingsDefinition mutabilitySetting = (MutabilitySettingsDefinition) setting; mutabilitySetting.setChoice(data, MutabilitySettingsDefinition.CONSTANT); } } }", "tokens": 107} {"id": 45512, "source": "method", "repo": "aterai/java-swing-tips", "text": "public LocalDate getCurrentLocalDate() { return currentLocalDate; }", "tokens": 12} {"id": 45671, "source": "method", "repo": "aterai/java-swing-tips", "text": "public void dragEnter(DropTargetDragEvent e) { getGhostGlassPane(e.getDropTargetContext().getComponent()).ifPresent(glassPane -> { // DnDTabbedPane tabbedPane = glassPane.tabbedPane; Transferable t = e.getTransferable(); DataFlavor[] f = e.getCurrentDataFlavors(); if (t.isDataFlavorSupported(f[0])) { // && tabbedPane.dragTabIndex >= 0) { e.acceptDrag(e.getDropAction()); } else { e.rejectDrag(); } }); }", "tokens": 110} {"id": 45852, "source": "method", "repo": "aterai/java-swing-tips", "text": "private MainPanel() { super(new BorderLayout()); // System.out.println(UIManager.getInt(\"Menu.submenuPopupOffsetX\")); UIManager.put(\"Menu.submenuPopupOffsetX\", -16); // System.out.println(UIManager.getInt(\"Menu.submenuPopupOffsetY\")); UIManager.put(\"Menu.submenuPopupOffsetY\", -3); EventQueue.invokeLater(() -> getRootPane().setJMenuBar(createMenuBar())); add(new JScrollPane(new JTextArea())); setPreferredSize(new Dimension(320, 240)); }", "tokens": 116} {"id": 45860, "source": "method", "repo": "aterai/java-swing-tips", "text": "private MainPanel() { super(new GridLayout(2, 1)); StyledDocument doc = new SimpleSyntaxDocument(); Style def = doc.getStyle(StyleContext.DEFAULT_STYLE); StyleConstants.setForeground(doc.addStyle(\"red\", def), Color.RED); StyleConstants.setForeground(doc.addStyle(\"green\", def), Color.GREEN); StyleConstants.setForeground(doc.addStyle(\"blue\", def), Color.BLUE); JTextPane textPane = new JTextPane(doc); textPane.setText(\"JTextPane(StyledDocument)\\nred green, blue.\"); textPane.setSelectedTextColor(null); textPane.setSelectionColor(new Color(0x64_32_64_FF, true)); textPane.setComponentPopupMenu(new TextComponentPopupMenu()); add(new JScrollPane(textPane)); add(new JScrollPane(new JEditorPane(\"text/html\", \"JEditorPane\"))); setPreferredSize(new Dimension(320, 240)); }", "tokens": 211} {"id": 46012, "source": "method", "repo": "aterai/java-swing-tips", "text": "protected void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g.create(); // g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, VALUE_TEXT_ANTIALIAS_ON); // g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, VALUE_ANTIALIAS_ON); float w = getWidth(); g2.setPaint(Color.RED); g2.draw(new Line2D.Float(0f, baseline, w, baseline)); g2.setPaint(Color.GREEN); float ascent = baseline - lm.getAscent(); g2.draw(new Line2D.Float(0f, ascent, w, ascent)); g2.setPaint(Color.BLUE); float descent = baseline + lm.getDescent(); g2.draw(new Line2D.Float(0f, descent, w, descent)); g2.setPaint(Color.ORANGE); float leading = baseline + lm.getDescent() + lm.getLeading(); g2.draw(new Line2D.Float(0f, leading, w, leading)); g2.setPaint(Color.CYAN); float xh = baseline - corpusSize; g2.draw(new Line2D.Float(0f, xh, w, xh)); g2.setPaint(Color.BLACK); g2.drawGlyphVector(gv, w - xx, baseline); g2.dispose(); }", "tokens": 309} {"id": 46044, "source": "method", "repo": "aterai/java-swing-tips", "text": "public void removeUpdate(DocumentEvent e) { update((StyledDocument) e.getDocument(), e.getOffset()); }", "tokens": 26} {"id": 46104, "source": "method", "repo": "aterai/java-swing-tips", "text": "public TableSorter() { super(); mouseListener = new MouseHandler(); modelListener = new TableModelHandler(); }", "tokens": 25} {"id": 46148, "source": "method", "repo": "aterai/java-swing-tips", "text": "public void paintIcon(Component c, Graphics g, int x, int y) { Graphics2D g2 = (Graphics2D) g.create(); int w = getIconWidth(); int h = getIconHeight(); int gap = w / DividerLocationDragLayerUI.ICON_GAP_DIVISOR; g2.setColor(Color.ORANGE); g2.translate(x, y); g2.fillRect(0, 0, w, h); g2.setColor(Color.CYAN); g2.setStroke(new BasicStroke(w / 8f)); g2.drawLine(gap, gap, w - gap, h - gap); g2.drawLine(gap, h - gap, w - gap, gap); g2.dispose(); }", "tokens": 161} {"id": 46164, "source": "method", "repo": "aterai/java-swing-tips", "text": "public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { Component c = super.getTreeCellRendererComponent( tree, value, selected, expanded, leaf, row, hasFocus); DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; Object uo = node.getUserObject(); if (c instanceof JLabel && uo instanceof SizeNode) { JLabel l = (JLabel) c; SizeNode n = (SizeNode) uo; l.setPreferredSize(null); // reset prev preferred size l.setText(n.getLabel()); // recalculate preferred size // Font font = l.getFont(); // FontRenderContext frc = l.getFontMetrics(font).getFontRenderContext(); // Rectangle2D r = font.getStringBounds(n.label, frc); // int iconWidth = 20 + 2; // int w = iconWidth + (int) r.getWidth(); // int h = n.height; // System.out.println(w + \" : \" + l.getPreferredSize().width); // l.setPreferredSize(new Dimension(w, h)); Dimension d = l.getPreferredSize(); d.height = n.getHeight(); l.setPreferredSize(d); } return c; }", "tokens": 274} {"id": 46230, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public boolean isCancelled(Cancellable e) { if (!(e instanceof EntityExplodeEvent event)) return e.isCancelled(); return event.blockList().contains(this.getBlock()); }", "tokens": 37} {"id": 46264, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public static Map getAllKeyedRecipesByName() { return allKeyedRecipesByName; }", "tokens": 27} {"id": 46351, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public void processItem(ModifierContext context) { if (onlyExecuteModifiers) { CustomItem customItem = CustomItemRegistry.getItem(item); DynamicItemModifier.modify(context, customItem.getModifiers()); } else { ItemStack customItem = CustomItemRegistry.getProcessedItem(item, context); if (ItemUtils.isEmpty(customItem)) return; context.getItem().setItem(customItem); context.getItem().setMeta(ItemUtils.getItemMeta(customItem)); } }", "tokens": 101} {"id": 46358, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public DynamicItemModifier copy() { ItemWeightClass m = new ItemWeightClass(getName()); m.setWeightClass(this.weightClass); m.setPriority(this.getPriority()); return m; }", "tokens": 43} {"id": 46521, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public boolean isApplyEnemyDebuffs() { return applyEnemyDebuffs; }", "tokens": 19} {"id": 46574, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public static String getNexoBlock(Block b){ return NexoWrapper.getNexoBlock(b); }", "tokens": 24} {"id": 46626, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public static void unmarkNextDamageInstanceNoImmunity(Entity entity, String toDamageType){ Collection damageTypes = noImmunityNextDamage.getOrDefault(entity.getUniqueId(), new HashSet<>()); damageTypes.remove(toDamageType); if (damageTypes.isEmpty()) noImmunityNextDamage.remove(entity.getUniqueId()); else noImmunityNextDamage.put(entity.getUniqueId(), damageTypes); }", "tokens": 94} {"id": 46762, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public float getAnvilSkill(){ return getFloat(\"anvilSkill\"); }", "tokens": 15} {"id": 46796, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public void setDamageResistance(boolean setBonus, float value) { setFloat(setBonus ? \"setDamageResistance\" : \"damageResistancePerPiece\", value); }", "tokens": 36} {"id": 46903, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public PotionEffectWrapper copy() { return new ChocolateMilk(getEffect(), defaultIcon).setCharges(charges); }", "tokens": 31} {"id": 46957, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public double getQualityPotionExperienceMultiplier() { return qualityPotionExperienceMultiplier; }", "tokens": 17} {"id": 46996, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public static void removeUniqueAttribute(LivingEntity e, String identifier, Attribute type){ ValhallaMMO.getNms().removeUniqueAttribute(e, identifier, type); }", "tokens": 34} {"id": 47011, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public MathEval setConstant(String nam, Double val) { if (constants.get(nam) != null) { throw new IllegalArgumentException(\"Constants may not be redefined\"); } validateName(nam); constants.put(nam, val); return this; }", "tokens": 61} {"id": 47041, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public float toolPower(ItemStack tool, Block b) { if (!ItemUtils.isEmpty(tool)) { net.minecraft.world.item.ItemStack craftItemStack = CraftItemStack.asNMSCopy(tool); net.minecraft.world.level.block.Block nmsBlock = ((CraftWorld) b.getWorld()).getHandle().getBlockState(new BlockPos(b.getX(), b.getY(), b.getZ())).getBlock(); return craftItemStack.getDestroySpeed(nmsBlock.defaultBlockState()); } return 1; }", "tokens": 107} {"id": 47089, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public void setItemModel(ItemMeta meta, String model){ Number asNumber = Catch.catchOrElse(() -> model.contains(\".\") || model.contains(\",\") ? Float.parseFloat(model) : Integer.parseInt(model), -1); if (asNumber.floatValue() < 0 || asNumber.intValue() < 0) { meta.setItemModel(StringUtils.isEmpty(model) ? null : NamespacedKey.fromString(model)); } else { CustomModelDataComponent component = meta.getCustomModelDataComponent(); if (asNumber instanceof Float f) { List floats = new ArrayList<>(List.of(f)); component.setFloats(floats); meta.setCustomModelDataComponent(component); } else if (asNumber instanceof Integer i) meta.setCustomModelData(i); } }", "tokens": 164} {"id": 47093, "source": "method", "repo": "Athlaeos/ValhallaMMO", "text": "public String getItemModel(ItemMeta meta) { return !meta.hasItemModel() || meta.getItemModel() == null ? null : meta.getItemModel().toString(); }", "tokens": 37} {"id": 47164, "source": "method", "repo": "AugmentOS-Community/AugmentOS", "text": "static void logBoxTree(byte[] data, String logTag) { try { for (BmffBox box : parseTopLevel(data)) { logBox(logTag, box, 0); } } catch (IOException e) { Log.w(logTag, \"logBoxTree failed\", e); } }", "tokens": 68} {"id": 47244, "source": "method", "repo": "AugmentOS-Community/AugmentOS", "text": "public synchronized void start(K900CommandHandler k900CommandHandler, Context context, IConfigurationManager configurationManager, long intervalMs) { mK900CommandHandler = k900CommandHandler; mContext = context != null ? context.getApplicationContext() : null; mConfigurationManager = configurationManager; mIntervalMs = clampInterval(intervalMs); mRunning = true; mRequestInFlight = false; logControl(\"start\", null); mHandler.removeCallbacks(mPollRunnable); mHandler.post(mPollRunnable); }", "tokens": 112} {"id": 47496, "source": "method", "repo": "AugmentOS-Community/AugmentOS", "text": "public int getMaxRequestSize() { return maxRequestSize; }", "tokens": 14} {"id": 47786, "source": "method", "repo": "AugmentOS-Community/AugmentOS", "text": "public void parseServerVersionCode_splitsMajorMinorPatch() { // XYYYZZZ format: 17026001 -> major 17, minor 26, patch 1, build 0 byte[] version = controller.parseServerVersionCode(17026001L); assertThat(version).containsExactly((byte) 17, (byte) 26, (byte) 1, (byte) 0); }", "tokens": 104} {"id": 47790, "source": "method", "repo": "AugmentOS-Community/AugmentOS", "text": "public void recoveryTimeoutCanBeSupersededByExactTargetOnLaterBoot() { reserve(); assertThat(store.fail(OWNER, \"recovery_timeout\")).isEqualTo(TransitionResult.APPLIED); assertThat(store.completeLateExactTargetAfterRecoveryTimeout(OWNER, BOOT_B, TARGET)) .isEqualTo(TransitionResult.APPLIED); assertThat(store.read().getTerminalStatus()).isEqualTo(TerminalStatus.SUCCESS); assertThat(store.read().getTerminalCode()).isEqualTo(\"verified\"); assertThat(store.read().getVerificationBootId()).isEqualTo(BOOT_B); }", "tokens": 119} {"id": 47855, "source": "method", "repo": "AugmentOS-Community/AugmentOS", "text": "public void nativeCleanupRunsOnWorkerAndReturnsOnlyAfterDisabledState() throws Exception { manager.apState = AsgConstants.WIFI_AP_STATE_DISABLED; java.util.concurrent.atomic.AtomicReference failure = new java.util.concurrent.atomic.AtomicReference<>(); Thread worker = new Thread( () -> { try { manager.stopHotspotAndAwaitDisabled(); } catch (Exception e) { failure.set(e); } }); worker.start(); worker.join(2000); assertThat(worker.isAlive()).isFalse(); assertThat(failure.get()).isNull(); manager.startHotspot(); advance(1000); assertThat(commands()) .extracting(i -> i.getBooleanExtra(\"enable\", false)) .containsExactly(false); // A definitive pre-handoff abandonment restores ordinary start admission. manager.abandonHotspotReplacement(); manager.startHotspot(); advance(500); assertThat(commands()) .extracting(i -> i.getBooleanExtra(\"enable\", false)) .containsExactly(false, false, true); manager.gateway = \"192.168.43.1\"; advance(200); assertThat(manager.isHotspotEnabled()).isTrue(); }", "tokens": 262} {"id": 47900, "source": "method", "repo": "AugmentOS-Community/AugmentOS", "text": "public void rejectsNullAndEmpty() { assertFalse(IcePostPolicy.isHotspotHostCandidate(null)); assertFalse(IcePostPolicy.isHotspotHostCandidate(\"\")); }", "tokens": 34} {"id": 47953, "source": "method", "repo": "AugmentOS-Community/AugmentOS", "text": "public void setUp() { serviceManager = mock(AsgClientServiceManager.class); captureService = mock(MediaCaptureService.class); bluetoothManager = mock(K900BluetoothManager.class); hardwareManager = mock(IHardwareManager.class); stateManager = mock(IStateManager.class); batteryTasks = new ArrayDeque<>(); AsgSettings asgSettings = mock(AsgSettings.class); linkState = new LinkStateMachine(); when(serviceManager.getAsgSettings()).thenReturn(asgSettings); when(serviceManager.getMediaCaptureService()).thenReturn(captureService); when(serviceManager.getBluetoothManager()).thenReturn(bluetoothManager); when(bluetoothManager.getLinkStateMachine()).thenReturn(linkState); // Keep the forward-to-phone path inert; this suite only exercises the capture gate. when(bluetoothManager.isConnected()).thenReturn(false); when(asgSettings.isSaveInGalleryMode()).thenReturn(false); when(asgSettings.getButtonPhotoSize()).thenReturn(\"medium\"); when(captureService.isRecordingVideo()).thenReturn(false); subscriber = new ButtonEventSubscriber( serviceManager, hardwareManager, stateManager, batteryTasks::add); }", "tokens": 245} {"id": 48008, "source": "method", "repo": "AugmentOS-Community/AugmentOS", "text": "public void productionFloorStartsAtMentraThree() { assertEquals(51518114L, FLOOR); }", "tokens": 29} {"id": 48102, "source": "method", "repo": "AugmentOS-Community/SmartGlassesManager", "text": "public static String getChosenTranscribeLanguage(Context context) { String transcribeLanguageString = PreferenceManager.getDefaultSharedPreferences(context).getString(context.getResources().getString(R.string.SHARED_PREF_TRANSCRIBE_LANGUAGE), \"\"); if (transcribeLanguageString.equals(\"\")){ saveChosenTranscribeLanguage(context, \"English\"); transcribeLanguageString = \"English\"; } return transcribeLanguageString; }", "tokens": 91} {"id": 48135, "source": "method", "repo": "AugmentOS-Community/SmartGlassesManager", "text": "public void onDisableBleScoEvent(DisableBleScoAudioEvent receivedEvent) { Log.d(TAG, \"onDisableBleScoEvent called\"); restartAudioWithNoBleSco(); }", "tokens": 42} {"id": 48176, "source": "method", "repo": "AugmentOS-Community/SmartGlassesManager", "text": "public void startAudio(){ //make a new queue to hold data to send send_queue = new ArrayBlockingQueue(50); //start the socket thread which will send the raw audio data startSocket(); }", "tokens": 46} {"id": 48438, "source": "method", "repo": "AugmentOS-Community/SmartGlassesManager", "text": "TranscriptionResultFormatterService() { impl = new TranscriptionResultFormatter(); }", "tokens": 17} {"id": 48440, "source": "method", "repo": "AugmentOS-Community/SmartGlassesManager", "text": "public void run() { Thread.currentThread().setName(\"SafeTranscriptionResultFormatterThread\"); try { while (true) { // Try and pull from the queue. If the queue is empty for more than 15 seconds, complete // the thread. The parent class will start a new thread to process this service again if // another task arrives. Request request = requestQueue.poll(15, TimeUnit.SECONDS); if (request == null) { // We are ready to terminate the thread. synchronized (threadRestartLock) { // logger.atInfo().log(\"Formatter request queue is exhausted. %s\", confinedThread); // Setting confinedThread to null is very important. This is how we signal in a // synchronizable way that this thread is no longer relevant. The parent object // can restart a new thread if more requests come in. confinedThread = null; } return; } switch (request.type) { case SET_OPTIONS: impl.setOptions(request.inOptions); break; case RESET: impl.reset(); break; case ADD_FINALIZED_RESULT: impl.addFinalizedResult(request.inTranscriptionResult); break; case CLEAR_CURRENT_HYPOTHESIS: impl.clearCurrentHypothesis(); break; case FINALIZE_CURRENT_HYPOTHESIS: request.outBoolean.set(impl.finalizeCurrentHypothesis()); break; case SET_CURRENT_HYPOTHESIS: impl.setCurrentHypothesis(request.inTranscriptionResult); break; case GET_FORMATTED_TRANSCRIPT: request.outSpanned.set(impl.getFormattedTranscript()); break; case GET_MOST_RECENT_TRANSCRIPT_SEGMENT: request.outSpanned.set(impl.getMostRecentTranscriptSegment()); break; case GET_TRANSCRIPT_DURATION: request.outDuration.set(impl.getTranscriptDuration()); break; } } } catch (InterruptedException interrupted) { // Interrupting causes the service to stop. logger.atSevere().withCause(interrupted).log(\"Formatter service has been interrupted\"); } }", "tokens": 455} {"id": 48555, "source": "method", "repo": "AugmentOS-Community/SmartGlassesManager", "text": "/** Closes the current recognition request on the client end. This does not immediately end the session. Only once the server acknowledges the closing of the session is communication complete. */ public synchronized void requestCloseSessionImpl() { if (stillSendingRequests) { stillSendingRequests = false; if (usingEncoder()) { // Get any remaining output from the codec and stop. byte[] data = encoder.flushAndStop(); streamToServer(data, 0, data.length); } closeServer(); } }", "tokens": 106} {"id": 48744, "source": "method", "repo": "AugmentOS-Community/SmartGlassesManager", "text": "public void asp_comms_starter() { //start the web socket to communicate with ASP, to replace TCP socket below if (!asp_client_socket.getWebSocketStarted()) { asp_client_socket.startWebSocket(); } //start comms to ASP if (!asp_client_socket.getSocketStarted()) { asp_client_socket.startSocket(); } }", "tokens": 86} {"id": 48809, "source": "method", "repo": "AugmentOS-Community/SmartGlassesManager", "text": "public WebSocketManager(String ip, String port){ //handler = new Handler(); //handler = new Handler(Looper.getMainLooper()); mHandlerThread = new HandlerThread(\"WebSocketHandler\"); mHandlerThread.start(); handler = new Handler(mHandlerThread.getLooper()); delay = 3500; // 1000 milliseconds == 1 second if (port == null){ port = \"8887\"; } //create new URI to connect with try{ this.serverURI = new URI(\"ws://\" + ip + \":\" + port); } catch (URISyntaxException e){ e.printStackTrace(); } //start a heartbeat, which will try to send a heartbeat every n seconds iff the connection appears to be open. This will reveal if the other end has closed the connection and we weren't notified handler.postDelayed(new Runnable() { public void run() { //if the ws doesn't exist or is not open, then the manager already knows we A) need to restart b) are starting, so don't send heart beat if (ws != null) { if (ws.getConnectionState() == 2 && !ws.isClosed()) { // Log.d(TAG, \"tryna send heart beat\"); ws.sendHeartBeat(); // Log.d(TAG, \"done did send heart beat\"); } else { // Log.d(TAG, \"not even gonna tryna send eart beat\"); } } handler.postDelayed(this, 3000); //run again in delay milliseconds } }, delay); }", "tokens": 336} {"id": 48911, "source": "method", "repo": "AugmentOS-Community/SmartGlassesManager", "text": "protected void onBroadcastReceive(Context context, Intent intent){ Log.d(\"hereee\", \"kjbnkjb\"); final String action = intent.getAction(); try { JSONObject data = new JSONObject(intent.getStringExtra(ASPClientSocket.RAW_MESSAGE_JSON_STRING)); String typeOf = data.getString(MessageTypes.MESSAGE_TYPE_LOCAL); //preview object translation result data if (typeOf.equals(MessageTypes.OBJECT_TRANSLATION_RESULT)) { showObjectTranslationResults((new JSONObject(data.getString(MessageTypes.OBJECT_TRANSLATION_RESULT_DATA)))); } } catch (JSONException e){ e.printStackTrace(); } }", "tokens": 136} {"id": 48996, "source": "method", "repo": "auth0/auth0-java", "text": "/** Request a password reset for the given client ID, email, database connection and organization ID. The response will always be successful even if there's no user associated to the given email for that database connection. i.e.:
 {@code try { authAPI.resetPassword(\"CLIENT-ID\", \"me@auth0.com\", \"db-connection\", \"ORGANIZATION-ID\").execute().getBody(); } catch (Auth0Exception e) { //Something happened } } 
@see Change Password API docs @param clientId the client ID of your client. @param email the email associated to the database user. @param connection the database connection where the user was created. @param organization the organization ID where the user was created. @return a Request to execute. */ public Request resetPassword(String clientId, String email, String connection, String organization) { Asserts.assertNotNull(email, \"email\"); Asserts.assertNotNull(connection, \"connection\"); String url = baseUrl.newBuilder() .addPathSegment(PATH_DBCONNECTIONS) .addPathSegment(\"change_password\") .build() .toString(); VoidRequest request = new VoidRequest(client, null, url, HttpMethod.POST); request.addParameter(KEY_CLIENT_ID, clientId); request.addParameter(KEY_EMAIL, email); request.addParameter(KEY_CONNECTION, connection); request.addParameter(KEY_ORGANIZATION, organization); return request; }", "tokens": 328} {"id": 49010, "source": "method", "repo": "auth0/auth0-java", "text": "/** Create a request to send an email containing a link or a code to begin authentication with Passwordless connections. Confidential clients (Regular Web Apps) must have a client secret configured on this {@code AuthAPI} instance.
 {@code try { PasswordlessEmailResponse result = authAPI.startPasswordlessEmailFlow(\"user@domain.com\", PasswordlessEmailType.CODE) .execute() .getBody(); } catch (Auth0Exception e) { // Something happened } } 
@param email the email address to send the code or link to. Must not be null. @param type the type of the passwordless email request. Must not be null. @return a Request to configure and execute. @see Passwordless Authentication with Email documentation @see Get code or link API reference documentation */ public BaseRequest startPasswordlessEmailFlow(String email, PasswordlessEmailType type) { Asserts.assertNotNull(email, \"email\"); Asserts.assertNotNull(type, \"type\"); String url = baseUrl.newBuilder() .addPathSegment(PATH_PASSWORDLESS) .addPathSegment(PATH_START) .build() .toString(); BaseRequest request = new BaseRequest<>( client, null, url, HttpMethod.POST, new TypeReference() {}); request.addParameter(KEY_CLIENT_ID, clientId); request.addParameter(KEY_CONNECTION, \"email\"); request.addParameter(KEY_EMAIL, email); request.addParameter(\"send\", type.getType()); addClientAuthentication(request, false); return request; }", "tokens": 396} {"id": 49049, "source": "method", "repo": "auth0/auth0-java", "text": "/** @return {@code true} when the MFA Token used on the login request is malformed or has expired, {@code false} otherwise. */ public boolean isMultifactorTokenInvalid() { return \"expired_token\".equals(error) && \"mfa_token is expired\".equals(description) || \"invalid_grant\".equals(error) && \"Malformed mfa_token\".equals(description); }", "tokens": 89} {"id": 49102, "source": "method", "repo": "auth0/auth0-java", "text": "public EmptyBodyRequest( Auth0HttpClient client, TokenProvider tokenProvider, String url, HttpMethod method, TypeReference tType) { super(client, tokenProvider, url, method, tType); }", "tokens": 45} {"id": 49175, "source": "method", "repo": "auth0/auth0-java", "text": "public void jsonResponse(String path, int statusCode) throws IOException { MockResponse response = new MockResponse() .setResponseCode(statusCode) .addHeader(\"Content-Type\", \"application/json\") .setBody(readTextFile(path)); server.enqueue(response); }", "tokens": 58} {"id": 49190, "source": "method", "repo": "auth0/auth0-java", "text": "private boolean matchesBaseUrl(HttpUrl url, Description mismatchDescription) { if (!url.scheme().equals(scheme)) { mismatchDescription.appendText(\"scheme was \").appendValue(url.scheme()); return false; } if (!url.host().equals(host)) { mismatchDescription.appendText(\"host was \").appendValue(url.host()); return false; } if (path == null) { return true; } if (path.startsWith(\"/\")) { path = path.substring(1); } if (path.endsWith(\"/\")) { path = path.substring(0, path.length() - 1); } if (!url.pathSegments().equals(Arrays.asList(path.split(\"/\")))) { StringBuilder sb = new StringBuilder(); for (String p : url.pathSegments()) { sb.append(p).append(\"/\"); } sb.deleteCharAt(sb.length() - 1); mismatchDescription.appendText(\"path was \").appendValue(sb.toString()); return false; } return true; }", "tokens": 214} {"id": 49213, "source": "method", "repo": "auth0/auth0-java", "text": "public void shouldThrowOnResetPasswordWithNullEmail() { verifyThrows( IllegalArgumentException.class, () -> api.resetPassword(null, \"my-connection\"), \"'email' cannot be null!\"); }", "tokens": 40} {"id": 49251, "source": "method", "repo": "auth0/auth0-java", "text": "public void startPasswordlessSmsFlowShouldThrowWhenPhoneIsNull() { verifyThrows( IllegalArgumentException.class, () -> api.startPasswordlessSmsFlow(null), \"'phoneNumber' cannot be null!\"); }", "tokens": 41} {"id": 49488, "source": "method", "repo": "auth0/auth0-java", "text": "public void testList() throws Exception { server.enqueue( new MockResponse() .setResponseCode(200) .setBody( \"{\\\"start\\\":1.1,\\\"limit\\\":1.1,\\\"total\\\":1.1,\\\"connections\\\":[{\\\"organization_connection_name\\\":\\\"organization_connection_name\\\",\\\"assign_membership_on_login\\\":true,\\\"show_as_button\\\":true,\\\"is_signup_enabled\\\":true,\\\"organization_access_level\\\":\\\"none\\\",\\\"organization_member_access_level\\\":\\\"none\\\",\\\"is_enabled\\\":true,\\\"connection_id\\\":\\\"connection_id\\\"}]}\")); SyncPagingIterable response = client.organizations() .connections() .list( \"id\", ListOrganizationAllConnectionsRequestParameters.builder() .page(1) .perPage(1) .includeTotals(true) .isEnabled(true) .build()); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); Assertions.assertEquals(\"GET\", request.getMethod()); // Validate response body Assertions.assertNotNull(response, \"Response should not be null\"); // Pagination response validated via MockWebServer // The SDK correctly parses the response into a SyncPagingIterable }", "tokens": 246} {"id": 49652, "source": "method", "repo": "auth0/java-jwt", "text": "private boolean isNullOrEmpty(String[] args) { if (args == null || args.length == 0) { return true; } boolean isAllNull = true; for (String arg : args) { if (arg != null) { isAllNull = false; break; } } return isAllNull; }", "tokens": 67} {"id": 50008, "source": "method", "repo": "auth0/java-jwt", "text": "public void shouldCheckForWrongStringArrayClaim() { IncorrectClaimException e = assertThrows(null, IncorrectClaimException.class, () -> { String token = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b20iOlsxXX0.R9ZSmgtJng062rcEc59u4VKCq89Yk5VlkN9BuMTMvr0\"; JWTVerifier.init(Algorithm.HMAC256(\"secret\")) .withArrayClaim(\"custom\", \"2L\") .build() .verify(token); }); assertThat(e.getClaimName(), is(\"custom\")); }", "tokens": 149} {"id": 50105, "source": "method", "repo": "auth0/java-jwt", "text": "public void shouldFailECDSA256VerificationWhenProvidedPublicKeyIsNull() { exception.expect(SignatureVerificationException.class); exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA256withECDSA\"); exception.expectCause(isA(IllegalStateException.class)); exception.expectCause(hasMessage(is(\"The given Public Key is null.\"))); ECDSAKeyProvider provider = mock(ECDSAKeyProvider.class); when(provider.getPublicKeyById(\"my-key-id\")).thenReturn(null); String jwt = \"eyJhbGciOiJFUzI1NiIsImtpZCI6Im15LWtleS1pZCJ9.eyJpc3MiOiJhdXRoMCJ9.D_oU4CB0ZEsxHOjcWnmS3ZJvlTzm6WcGFx-HASxnvcB2Xu2WjI-axqXH9xKq45aPBDs330JpRhJmqBSc2K8MXQ\"; Algorithm algorithm = Algorithm.ECDSA256(provider); algorithm.verify(JWT.decode(jwt)); }", "tokens": 248} {"id": 50116, "source": "method", "repo": "auth0/java-jwt", "text": "public void shouldFailECDSA384VerificationWithInvalidPublicKey() throws Exception { exception.expect(SignatureVerificationException.class); exception.expectMessage(\"The Token's Signature resulted invalid when verified using the Algorithm: SHA384withECDSA\"); String jwt = \"eyJhbGciOiJFUzM4NCJ9.eyJpc3MiOiJhdXRoMCJ9._k5h1KyO-NE0R2_HAw0-XEc0bGT5atv29SxHhOGC9JDqUHeUdptfCK_ljQ01nLVt2OQWT2SwGs-TuyHDFmhPmPGFZ9wboxvq_ieopmYqhQilNAu-WF-frioiRz9733fU\"; Algorithm algorithm = Algorithm.ECDSA384((ECKey) readPublicKeyFromFile(INVALID_PUBLIC_KEY_FILE_384, \"EC\")); algorithm.verify(JWT.decode(jwt)); }", "tokens": 223} {"id": 50196, "source": "method", "repo": "auth0/java-jwt", "text": "public void shouldDoHMAC512SigningWithBytes() { Algorithm algorithm = Algorithm.HMAC512(\"secret\".getBytes(StandardCharsets.UTF_8)); String jwt = asJWT(algorithm, HS512Header, auth0IssPayload); String expectedSignature = \"OXWyxmf-VcVo8viOiTFfLaEy6mrQqLEos5R82Xsx8mtFxQadJAQ1aVniIWN8qT2GNE_pMQPcdzk4x7Cqxsp1dw\"; assertSignaturePresent(jwt); assertSignatureValue(jwt, expectedSignature); algorithm.verify(JWT.decode(jwt)); }", "tokens": 161} {"id": 50231, "source": "method", "repo": "auth0/java-jwt", "text": "public void shouldDoRSA384SigningWithBothKeys() throws Exception { Algorithm algorithm = Algorithm.RSA384((RSAPublicKey) readPublicKeyFromFile(PUBLIC_KEY_FILE, \"RSA\"), (RSAPrivateKey) readPrivateKeyFromFile(PRIVATE_KEY_FILE, \"RSA\")); String jwt = asJWT(algorithm, RS384Header, auth0IssPayload); String expectedSignature = \"Jx1PaTBnjd_U56MNjifFcY7w9ImDbseg0y8Ijr2pSiA1_wzQb_wy9undaWfzR5YqdIAXvjS8AGuZUAzIoTG4KMgOgdVyYDz3l2jzj6wI-lgqfR5hTy1w1ruMUQ4_wobpdxAiJ4fEbg8Mi_GljOiCO-P1HilxKnpiOJZidR8MQGwTInsf71tOUkK4x5UsdmUueuZbaU-CL5kPnRfXmJj9CcdxZbD9oMlbo23dwkP5BNMrS2LwGGzc9C_-ypxrBIOVilG3WZxcSmuG86LjcZbnL6LBEfph5NmKBgQav147uipb_7umBEr1m2dYiB_9u606n3bcoo3rnsYYK_Xfi1GAEQ\"; assertSignaturePresent(jwt); assertSignatureValue(jwt, expectedSignature); algorithm.verify(JWT.decode(jwt)); }", "tokens": 389} {"id": 50351, "source": "method", "repo": "auth0/java-jwt", "text": "public void shouldGetNotBefore() { assertThat(payload, is(notNullValue())); assertThat(payload.getNotBefore(), is(Date.from(notBefore))); assertThat(payload.getNotBeforeAsInstant(), is(notBefore)); }", "tokens": 46} {"id": 50443, "source": "method", "repo": "auth0/jwks-rsa-java", "text": "public JwksHttpResponse fetch(URL url) throws IOException { final URLConnection c = (proxy == null) ? url.openConnection() : url.openConnection(proxy); if (connectTimeout != null) { c.setConnectTimeout(connectTimeout); } if (readTimeout != null) { c.setReadTimeout(readTimeout); } for (Map.Entry entry : headers.entrySet()) { c.setRequestProperty(entry.getKey(), entry.getValue()); } String body; try (InputStream in = c.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8))) { StringBuilder sb = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { sb.append(line); } body = sb.toString(); } Map> responseHeaders = c.getHeaderFields(); return new JwksHttpResponse(body, responseHeaders); }", "tokens": 191} {"id": 50477, "source": "method", "repo": "auth0/jwks-rsa-java", "text": "/** Sets a custom HTTP client for fetching JWKS.

When a custom client is provided, it takes precedence over configurations set via {@link #proxied(Proxy)}, {@link #timeouts(int, int)}, and {@link #headers(Map)} \u2014 those settings are only used by the default HTTP client.

Example using OkHttp:

{@code OkHttpClient ok = new OkHttpClient.Builder() .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(\"proxy.corp\", 8080))) .proxyAuthenticator((route, resp) -> resp.request().newBuilder() .header(\"Proxy-Authorization\", Credentials.basic(\"user\", \"pass\")).build()) .protocols(Arrays.asList(Protocol.HTTP_2, Protocol.HTTP_1_1)) .build(); JwksHttpClient client = url -> { Request req = new Request.Builder().url(url).build(); try (Response resp = ok.newCall(req).execute()) { return new JwksHttpResponse(resp.body().string(), resp.headers().toMultimap()); } }; JwkProvider provider = new JwkProviderBuilder(domain) .httpClient(client) .build(); }
@param httpClient the custom HTTP client to use for fetching JWKS @return the builder @see JwksHttpClient */ public JwkProviderBuilder httpClient(JwksHttpClient httpClient) { this.httpClient = httpClient; return this; }", "tokens": 312} {"id": 50536, "source": "method", "repo": "auth0/jwks-rsa-java", "text": "public void shouldCreateForNormalizedDomain() { assertThat(new JwkProviderBuilder(normalizedDomain).build(), notNullValue()); }", "tokens": 25} {"id": 50641, "source": "method", "repo": "auth0/lock.android", "text": "/** Creates a new Lock.Builder instance with the given account and callback. @param account details to use against the Auth0 Authentication API. @param callback that will receive the authentication results. */ public Builder(@Nullable Auth0 account, @NonNull LockCallback callback) { this.callback = callback; options = new Options(); options.setAccount(account); }", "tokens": 75} {"id": 50720, "source": "method", "repo": "auth0/lock.android", "text": "public void onOAuthAuthenticationRequest(@NonNull OAuthLoginEvent event) { lastPasswordlessIdentity = null; lastPasswordlessCountry = null; Log.v(TAG, \"Looking for a provider to use with the connection \" + event.getConnection()); currentProvider = AuthResolver.providerFor(event.getStrategy(), event.getConnection()); if (currentProvider != null) { Map authParameters = new HashMap<>(); for (Map.Entry e : options.getAuthenticationParameters().entrySet()) { authParameters.put(e.getKey(), e.getValue()); } final String connectionScope = options.getConnectionsScope().get(event.getConnection()); if (connectionScope != null) { authParameters.put(Constants.CONNECTION_SCOPE_KEY, connectionScope); } final String scope = options.getScope(); if (scope != null) { authParameters.put(ParameterBuilder.SCOPE_KEY, scope); } final String audience = options.getAudience(); if (audience != null) { authParameters.put(ParameterBuilder.AUDIENCE_KEY, audience); } currentProvider.setParameters(authParameters); currentProvider.start(this, authProviderCallback, PERMISSION_REQUEST_CODE, CUSTOM_AUTH_REQUEST_CODE); return; } Log.d(TAG, \"Couldn't find an specific provider, using the default: \" + WebAuthProvider.class.getSimpleName()); webProvider.start(this, event.getConnection(), null, new WebCallbackWrapper(authProviderCallback)); }", "tokens": 316} {"id": 50796, "source": "method", "repo": "auth0/lock.android", "text": "private List enableWebAuthentication(@NonNull List connections, @NonNull Set webAuthEnabledConnections) { for (OAuthConnection c : connections) { if (webAuthEnabledConnections.contains(c.getName())) { ((Connection) c).disableActiveFlow(); } } return connections; }", "tokens": 71} {"id": 50842, "source": "method", "repo": "auth0/lock.android", "text": "public void setAccount(@NonNull Auth0 account) { this.account = account; }", "tokens": 19} {"id": 50964, "source": "method", "repo": "auth0/lock.android", "text": "public void showMFACodeForm(@NonNull DatabaseLoginEvent event) { MFACodeFormView form = new MFACodeFormView(this, event.getUsernameOrEmail(), event.getPassword(), event.getMultifactorToken(), event.getMultifactorChallengeType(), event.getMultifactorOOBCode()); updateHeaderTitle(R.string.com_auth0_lock_title_mfa_input_code); addSubForm(form); }", "tokens": 93} {"id": 50973, "source": "method", "repo": "auth0/lock.android", "text": "private void prepareTask() { task = new LoadCountriesTask() { @Override protected void onPostExecute(List result) { task = null; String defaultCountry = Locale.getDefault().getCountry(); Country selectedCountry = new Country(getContext().getString(R.string.com_auth0_lock_default_country_name_fallback), getContext().getString(R.string.com_auth0_lock_default_country_code_fallback)); for (Country c : result) { if (c.getDisplayName().equalsIgnoreCase(defaultCountry)) { selectedCountry = c; break; } } if (CountryCodeSelectorView.this.selectedCountry == null) { setSelectedCountry(selectedCountry); } } }; task.execute(getContext()); }", "tokens": 158} {"id": 51017, "source": "method", "repo": "auth0/lock.android", "text": "private void setupSingleConnectionUI(final OAuthConnection connection) { final int strategyStyle = AuthConfig.styleForStrategy(connection.getStrategy()); final AuthConfig authConfig = new AuthConfig(connection, strategyStyle); enterpriseBtn.setStyle(authConfig, AuthMode.LOG_IN); enterpriseBtn.setVisibility(View.VISIBLE); enterpriseBtn.setOnClickListener(v -> lockWidget.onOAuthLoginRequest(new OAuthLoginEvent(connection))); topMessage.setText(R.string.com_auth0_lock_action_single_login_with_corporate); topMessage.setVisibility(View.VISIBLE); emailInput.setVisibility(GONE); }", "tokens": 138} {"id": 51212, "source": "method", "repo": "auth0/lock.android", "text": "public void shouldSetMFAChallengeType() { event.setMultifactorChallengeType(\"mfa-challenge\"); assertThat(event.getMultifactorChallengeType(), is(\"mfa-challenge\")); }", "tokens": 39} {"id": 51231, "source": "method", "repo": "auth0/lock.android", "text": "public void shouldHavePasswordOnActiveFlow() { OAuthLoginEvent roEvent = new OAuthLoginEvent(connection, \"username\", \"password\"); assertThat(roEvent.getPassword(), is(\"password\")); }", "tokens": 41} {"id": 51308, "source": "method", "repo": "auth0/lock.android", "text": "public void shouldReturnStrategy() throws Exception { final List connections = buildConnectionsFrom(json(STRATEGY)); assertThat(connections, is(notNullValue())); assertThat(connections, hasSize(1)); assertThat(connections.get(0).getName(), is(\"twitter\")); assertThat(connections.get(0).getStrategy(), is(\"twitter\")); }", "tokens": 72} {"id": 51482, "source": "method", "repo": "auth0/lock.android", "text": "public U getError() { return error; }", "tokens": 11} {"id": 51777, "source": "method", "repo": "authing/authing-java-sdk", "text": "public String getPage() { return page; }", "tokens": 10} {"id": 51863, "source": "method", "repo": "authing/authing-java-sdk", "text": "public void setProfile(SignUpProfileDto profile) { this.profile = profile; }", "tokens": 19} {"id": 52167, "source": "method", "repo": "auties00/cobalt", "text": "/** Resolves the Signal sender JID used to look up a per-device session.

Picks the participant JID for group and broadcast chats and the {@code from} JID otherwise, since the Signal cipher needs the device-level JID rather than the chat JID. @param stanza the parsed stanza @return the sender device JID for Signal session lookup @throws WhatsAppMessageException.Receive.InvalidMessage if a group or broadcast stanza is missing its participant */ private Jid resolveSignalSender(MessageReceiveStanza stanza) { var chatJid = stanza.chatJid(); if (chatJid.hasGroupOrCommunityServer() || chatJid.hasBroadcastServer()) { return stanza.participant().orElseThrow(() -> new WhatsAppMessageException.Receive.InvalidMessage( \"PKMSG/MSG without participant for group: \" + chatJid, null)); } return chatJid; }", "tokens": 175} {"id": 52171, "source": "method", "repo": "auties00/cobalt", "text": "/** Strips Signal-protocol PKCS#7 padding from a decrypted plaintext.

Applied by the per-device and group decryption branches before returning to the caller, and not applied to {@link MessageEncryptionType#MSMSG} ciphertexts. @implNote This implementation reads the last byte as the padding length, validates that it falls in the {@code [MIN_PADDING, MAX_PADDING]} range, and returns a fresh array containing only the unpadded prefix; mirrors WhatsApp Web's {@code WACryptoPkcs7.unpadPkcs7}. WhatsApp Web's {@code WAWebMsgProcessingDecryptApi.processDecryptedMessageProto} also skips unpadding for the {@code Msmsg} ciphertext type, which is why {@link #decryptBotMessage(byte[], byte[], String, Jid, Jid)} never calls this method. @param paddedPlaintext the padded plaintext bytes @return the plaintext with padding removed @throws IllegalArgumentException if the padding length is missing or invalid */ private static byte[] removePadding(byte[] paddedPlaintext) { Objects.requireNonNull(paddedPlaintext, \"paddedPlaintext cannot be null\"); if (paddedPlaintext.length == 0) { throw new IllegalArgumentException(\"Padded plaintext cannot be empty\"); } var paddingLength = paddedPlaintext[paddedPlaintext.length - 1] & 0xFF; if (paddingLength < MIN_PADDING || paddingLength > MAX_PADDING) { throw new IllegalArgumentException( \"Invalid padding length: \" + paddingLength + \" (expected \" + MIN_PADDING + \"-\" + MAX_PADDING + \")\" ); } if (paddingLength > paddedPlaintext.length) { throw new IllegalArgumentException( \"Padding length \" + paddingLength + \" exceeds message length \" + paddedPlaintext.length ); } var originalLength = paddedPlaintext.length - paddingLength; return Arrays.copyOf(paddedPlaintext, originalLength); }", "tokens": 402} {"id": 52174, "source": "method", "repo": "auties00/cobalt", "text": "/** Constructs a populated record from the values extracted by {@link MessageReceiveStanzaParser}. @param e2eType the decoded encryption type @param encMediaType the optional media-type tag, or {@code null} @param ciphertext the raw encrypted bytes @param retryCount the sender-reported retry count, or {@code 0} when absent @param hideFail whether {@code decrypt-fail=\"hide\"} was present @throws NullPointerException if {@code e2eType} or {@code ciphertext} is {@code null} */ public MessageReceiveEncryptedPayload( MessageEncryptionType e2eType, String encMediaType, byte[] ciphertext, int retryCount, boolean hideFail ) { this.e2eType = Objects.requireNonNull(e2eType, \"e2eType cannot be null\"); this.encMediaType = encMediaType; this.ciphertext = Objects.requireNonNull(ciphertext, \"ciphertext cannot be null\"); this.retryCount = retryCount; this.hideFail = hideFail; }", "tokens": 207} {"id": 52380, "source": "method", "repo": "auties00/cobalt", "text": "public BusinessCtwaContext queryCtwaContext(JidProvider businessJidProvider, String inviteCode, String expectedSourceUrl) { throw new UnsupportedOperationException(\"TestWhatsAppClient: queryCtwaContext(..) is not stubbed\"); }", "tokens": 50} {"id": 52469, "source": "method", "repo": "auties00/cobalt", "text": "public Optional connectTimeout() { return Optional.empty(); }", "tokens": 16} {"id": 52855, "source": "method", "repo": "auties00/cobalt", "text": "/** Returns a debug representation listing the {@code id} and the {@code type}. @return the string form */ public String toString() { return \"SmaxUploadAdMediaMediaEntry[id=\" + id + \", type=\" + type + ']'; }", "tokens": 54} {"id": 53214, "source": "method", "repo": "auties00/whatsapp4j", "text": "/** Setter for field: {@snippet lang=c : unsigned int nb_tiles } */ public static void nb_tiles(MemorySegment struct, int fieldValue) { struct.set(nb_tiles$LAYOUT, nb_tiles$OFFSET, fieldValue); }", "tokens": 57} {"id": 53233, "source": "method", "repo": "auties00/whatsapp4j", "text": "/** Mints a fresh session identifier in the canonical UUID string form.

Each call returns a distinct {@link UUID#randomUUID()} string, matching the per-interaction session, thread-session and unified-session ids WhatsApp Web mints as UUIDs; returning a fresh value per call keeps successive sessions from reusing one id and thereby fingerprinting the client. @return a newly generated random UUID string */ public static String newSessionId() { return UUID.randomUUID().toString(); }", "tokens": 103} {"id": 53274, "source": "method", "repo": "auties00/whatsapp4j", "text": "public void pinMessage(MessageKey msgKey) { throw new UnsupportedOperationException(\"TestWhatsAppClient: pinMessage(..) is not stubbed\"); }", "tokens": 32} {"id": 53345, "source": "method", "repo": "auties00/whatsapp4j", "text": "void removeReturnsUnsupported() { seedMessage(); var mutation = new DecryptedMutation.Trusted( JSON.toJSONString(List.of(\"star\", PEER.toString(), MESSAGE_ID, \"0\", \"0\")), new SyncActionValueBuilder() .timestamp(Instant.ofEpochSecond(1L)) .starAction(new StarActionBuilder().starred(true).build()) .build(), SyncdOperation.REMOVE, Instant.ofEpochSecond(1L), 2); var result = new StarMessageHandler().applyMutation(client, mutation); assertEquals(SyncActionState.UNSUPPORTED, result.actionState()); }", "tokens": 131} {"id": 53387, "source": "method", "repo": "auties00/whatsapp4j", "text": "/** Constructs a new migration result. @param migratedFlows the Flows that migrated successfully, or {@code null} for none @param failedFlows the Flows that failed to migrate, or {@code null} for none */ public CloudFlowMigrationResult(List migratedFlows, List failedFlows) { this.migratedFlows = migratedFlows == null ? List.of() : List.copyOf(migratedFlows); this.failedFlows = failedFlows == null ? List.of() : List.copyOf(failedFlows); }", "tokens": 125} {"id": 53527, "source": "method", "repo": "auties00/whatsapp4j", "text": "/** Wraps the given message inside a document-with-caption {@link FutureProofMessage} envelope. @param message the document message with caption @param the compile-time message type @return a non-null container */ public static LinkedMessageContainer ofDocumentWithCaption(T message) { return new LinkedMessageContainerBuilder() .documentWithCaptionMessage(wrapFutureProof(message)) .build(); }", "tokens": 93} {"id": 53528, "source": "method", "repo": "auties00/whatsapp4j", "text": "/** Returns the per-message transport metadata, if present.

This is a side-channel field that coexists with the message payload. It carries device list information, encryption secrets, bot metadata, and limit-sharing data. @return an {@code Optional} describing the {@link ChatMessageContextInfo} */ public Optional messageContextInfo() { return Optional.ofNullable(messageContextInfo); }", "tokens": 88} {"id": 53730, "source": "method", "repo": "auties00/whatsapp4j", "text": "/** Returns the group {@link Jid}. @return the group JID; never {@code null} */ public Jid from() { return from; }", "tokens": 32} {"id": 53747, "source": "method", "repo": "auties00/whatsapp4j", "text": "/** Adds the {@code contact} protocol to this query. @param addressingMode the addressing mode the contact protocol applies to @return this builder */ public UsyncQuery withContactProtocol(UsyncAddressingMode addressingMode) { protocols.add(new UsyncContactProtocol(addressingMode)); return this; }", "tokens": 64} {"id": 53769, "source": "method", "repo": "auties00/whatsappweb4j", "text": "/** Returns the numerically guarded logistic sigmoid. @param x the argument @return the logistic value in {@code [0, 1]} */ private static float sigmoid(float x) { if (x > 80.0f) { return 1.0f; } if (x < -80.0f) { return 0.0f; } return (float) (1.0 / (1.0 + Math.exp(-x))); }", "tokens": 107} {"id": 53839, "source": "method", "repo": "auties00/whatsappweb4j", "text": "/** {@inheritDoc} */ public int port() { return port; }", "tokens": 15} {"id": 53895, "source": "method", "repo": "auties00/whatsappweb4j", "text": "/** Removes a chat that {@link #resolveThread(Chat, Set)} classified as safe to delete.

This method is dispatched by {@link #executeResolutions(List)} for every {@link LidMigrationResolution.Delete}. A chat already absent from the store is a tolerated no-op. @param delete the delete action to apply */ private void executeDelete(LidMigrationResolution.Delete delete) { var originalJid = delete.originalJid(); var removed = store.chatStore().removeChat(originalJid); if (removed.isPresent()) { if (Log.DEBUG) LOGGER.log(Level.DEBUG, \"deleted chat {0}: {1}\", originalJid, delete.reason()); } }", "tokens": 152} {"id": 53967, "source": "method", "repo": "auties00/whatsappweb4j", "text": "/** Closes {@code stream} while swallowing any {@link IOException}.

The cleanup paths in {@link #openDownloadedApk(HttpClient, String, int, Map)} and {@link #openDownloadStream(HttpClient, String, Map)} use it; the swallowed exception would only obscure the original failure. @param stream the stream to close */ private static void closeQuietly(InputStream stream) { try { stream.close(); } catch (IOException _) { } }", "tokens": 98} {"id": 54118, "source": "method", "repo": "auties00/whatsappweb4j", "text": "void compositeAddPath() { var dedup = new MessageDedup(); var key = msgKey(true, CHAT, \"ID6\", SELF); var encs = List.of(payload(MessageEncryptionType.PKMSG, 0)); dedup.add(key, T, encs); assertTrue(dedup.isPending(key, T, encs), \"isPending(key, ts, encs) must hit the entry added via add(key, ts, encs)\"); }", "tokens": 109} {"id": 54135, "source": "method", "repo": "auties00/whatsappweb4j", "text": "void everySyncTypeAccepted() { for (var syncType : HistorySyncType.values()) { var notification = new HistorySyncNotificationBuilder() .syncType(syncType) .build(); assertDoesNotThrow(() -> service.process(notification), \"syncType=\" + syncType + \" must be a no-op when carrying no payload\"); } }", "tokens": 77} {"id": 54514, "source": "method", "repo": "auties00/whatsappweb4j", "text": "/** Builds the outbound {@code } stanza ready for dispatch.

The brand-new-post arm folds the optional msg-meta-origin and sender-content-type-media RCAT children alongside the client-id content stanza; the server-id arm stamps the {@code server_id} attribute and embeds the inner content directly. The returned builder is left unbuilt so the dispatch layer can stamp the message's outer id-correlation envelope. @implNote This implementation dispatches on the {@link SmaxMessagePublishNewsletterPayload} sealed-interface variants via a Java pattern-matching switch. @return a {@link StanzaBuilder} carrying the partially-built message envelope; never {@code null} */ public StanzaBuilder toStanza() { var builder = new StanzaBuilder() .description(\"message\") .attribute(\"to\", newsletterJid); switch (payload) { case SmaxMessagePublishNewsletterPayload.WithServerId withServerId -> { builder.attribute(\"id\", withServerId.stanzaId()); builder.attribute(\"server_id\", withServerId.messageServerId()); builder.content(withServerId.innerContent()); } case SmaxMessagePublishNewsletterPayload.WithClientIdOnly withClientId -> { builder.attribute(\"id\", withClientId.stanzaId()); var children = new ArrayList(3); withClientId.msgMetaOrigin().ifPresent(children::add); withClientId.senderContentTypeMediaRcat().ifPresent(children::add); children.add(withClientId.clientIdContent()); builder.content(children.toArray(Stanza[]::new)); } } return builder; }", "tokens": 335} {"id": 54741, "source": "method", "repo": "autohomecorp/frostmourne", "text": "public Long getExecuteId() { return executeId; }", "tokens": 13} {"id": 54793, "source": "method", "repo": "autohomecorp/frostmourne", "text": "public void setPropValue(String propValue) { this.propValue = propValue == null ? null : propValue.trim(); }", "tokens": 30} {"id": 54812, "source": "method", "repo": "autohomecorp/frostmourne", "text": "default int updateByPrimaryKey(Alarm record) { return update(c -> c.set(alarmName).equalTo(record::getAlarmName) .set(alarmType).equalTo(record::getAlarmType) .set(description).equalTo(record::getDescription) .set(ownerKey).equalTo(record::getOwnerKey) .set(status).equalTo(record::getStatus) .set(executeResult).equalTo(record::getExecuteResult) .set(executeAt).equalTo(record::getExecuteAt) .set(jobId).equalTo(record::getJobId) .set(cron).equalTo(record::getCron) .set(creator).equalTo(record::getCreator) .set(createAt).equalTo(record::getCreateAt) .set(modifier).equalTo(record::getModifier) .set(modifyAt).equalTo(record::getModifyAt) .set(teamName).equalTo(record::getTeamName) .set(riskLevel).equalTo(record::getRiskLevel) .set(serviceId).equalTo(record::getServiceId) .set(recoverNoticeStatus).equalTo(record::getRecoverNoticeStatus) .set(triggerLastTime).equalTo(record::getTriggerLastTime) .set(triggerNextTime).equalTo(record::getTriggerNextTime) .where(id, isEqualTo(record::getId)) ); }", "tokens": 321} {"id": 54838, "source": "method", "repo": "autohomecorp/frostmourne", "text": "default int insertSelective(AlertTemplate record) { return MyBatis3Utils.insert(this::insert, record, alertTemplate, c -> c.map(templateName).toPropertyWhenPresent(\"templateName\", record::getTemplateName) .map(templateType).toPropertyWhenPresent(\"templateType\", record::getTemplateType) .map(templateUnionCode).toPropertyWhenPresent(\"templateUnionCode\", record::getTemplateUnionCode) .map(content).toPropertyWhenPresent(\"content\", record::getContent) .map(creator).toPropertyWhenPresent(\"creator\", record::getCreator) .map(createAt).toPropertyWhenPresent(\"createAt\", record::getCreateAt) .map(modifier).toPropertyWhenPresent(\"modifier\", record::getModifier) .map(modifyAt).toPropertyWhenPresent(\"modifyAt\", record::getModifyAt) ); }", "tokens": 195} {"id": 54900, "source": "method", "repo": "autohomecorp/frostmourne", "text": "default int delete(DeleteDSLCompleter completer) { return MyBatis3Utils.deleteFrom(this::delete, teamInfo, completer); }", "tokens": 29} {"id": 54926, "source": "method", "repo": "autohomecorp/frostmourne", "text": "public Long insert(Alarm record) { alarmDynamicMapper.insert(record); return record.getId(); }", "tokens": 23} {"id": 54941, "source": "method", "repo": "autohomecorp/frostmourne", "text": "public Optional selectByPrimaryKey(Long id) { return alertDynamicMapper.selectByPrimaryKey(id); }", "tokens": 24} {"id": 55023, "source": "method", "repo": "autohomecorp/frostmourne", "text": "public Boolean getNeedTotal() { return needTotal; }", "tokens": 13} {"id": 55053, "source": "method", "repo": "autohomecorp/frostmourne", "text": "public TemplateType getTemplateType() { return templateType; }", "tokens": 14} {"id": 55075, "source": "method", "repo": "autohomecorp/frostmourne", "text": "public void setDataSourceContract(DataSourceContract dataSourceContract) { this.dataSourceContract = dataSourceContract; }", "tokens": 22} {"id": 55105, "source": "method", "repo": "autohomecorp/frostmourne", "text": "public DingAt getAt() { return at; }", "tokens": 13} {"id": 55335, "source": "method", "repo": "autoparams/autoparams", "text": "private String getBranchValueDescription(LogEntry entry) { Type queryType = entry.query.getType(); Class valueClass = entry.value.getClass(); if (queryType instanceof ParameterizedType) { ParameterizedType parameterizedQuery = (ParameterizedType) queryType; Type[] typeArguments = parameterizedQuery.getActualTypeArguments(); String valueClassName = valueClass.getSimpleName(); if (typeArguments.length > 0) { StringBuilder sb = new StringBuilder(valueClassName); sb.append(\"<\"); for (int i = 0; i < typeArguments.length; i++) { if (i > 0) { sb.append(\", \"); } sb.append(TypeFormatter.format(typeArguments[i], false)); } sb.append(\">\"); return sb.toString(); } } return TypeFormatter.format(valueClass, false); }", "tokens": 174} {"id": 55379, "source": "method", "repo": "autoparams/autoparams", "text": "private static E[] append(E[] source, E element) { E[] result = Arrays.copyOf(source, source.length + 1); result[source.length] = element; return result; }", "tokens": 48} {"id": 55441, "source": "method", "repo": "autoparams/autoparams", "text": "public CollectionGenerator() { super( new ArrayGenerator(), new SequenceGenerator(), new MapGenerator(), new SetGenerator(), new StreamGenerator() ); }", "tokens": 31} {"id": 55617, "source": "method", "repo": "autoparams/autoparams", "text": "private static void setProperty( Object instance, Method setter, Object propertyValue ) { try { setter.invoke(instance, propertyValue); } catch (IllegalAccessException | InvocationTargetException exception) { throw new RuntimeException(exception); } }", "tokens": 50} {"id": 55639, "source": "method", "repo": "autoparams/autoparams", "text": "void sut_resolves_arguments(String args1, UUID args2) { }", "tokens": 19} {"id": 55644, "source": "method", "repo": "autoparams/autoparams", "text": "public ObjectGenerator customize(ObjectGenerator generator) { return (query, context) -> query.getType() == String.class ? new ObjectContainer(\"Customized string value\") : generator.generate(query, context); }", "tokens": 46} {"id": 55758, "source": "method", "repo": "autoparams/autoparams", "text": "void sut_creates_arbitrary_period_values( Period value1, Period value2, Period value3, Period value4, Period value5 ) { final HashSet set = new HashSet<>(); set.add(value1); set.add(value2); set.add(value3); set.add(value4); set.add(value5); assertThat(set.size()).isGreaterThan(1); }", "tokens": 96} {"id": 55967, "source": "method", "repo": "autoparams/autoparams", "text": "void sut_resolves_multiple_bounded_type_parameters_for_method_arguments( ResolutionContext context ) { NullGuardValidator sut = new NullGuardValidator(context); assertThatCode( () -> sut.validate(GuardedMethodWithMultipleBoundedTypeParameters.class) ).doesNotThrowAnyException(); }", "tokens": 68} {"id": 56114, "source": "method", "repo": "autoparams/autoparams", "text": "void sut_prints_elapsed_time_in_ms_after_resolved_value_with_simple_object_query( ResolutionContext context ) { String[] output = captureOutput(() -> context.resolve(String.class)); assertThat(output[0]).matches(\".*\\\\((<\\\\s*\\\\d+|\\\\d+)\\\\s*ms\\\\)$\"); }", "tokens": 83} {"id": 56227, "source": "method", "repo": "autoparams/autoparams", "text": "void testMethodCollectionSize(@Size(min = 5) ArrayList arrayList) { assertThat(arrayList).hasSize(5); }", "tokens": 33} {"id": 56240, "source": "method", "repo": "aya-prover/aya-dev", "text": "public Doc describe(@NotNull PrettierOptions options) { var lines = MutableList.of(Doc.english(\"Unsolved meta \" + name)); for (var term : termStack) { var buf = MutableList.of(Doc.plain(\"in\"), Doc.par(1, Doc.code(term.toDoc(options)))); lines.append(Doc.cat(buf)); } return Doc.vcat(lines); }", "tokens": 92} {"id": 56672, "source": "method", "repo": "aya-prover/aya-dev", "text": "public IrVariable serializeTermUnderTele( @NotNull IrCodeBuilder builder, @NotNull Term term, @NotNull ImmutableSeq argTerms ) { return new TermSerializer(builder, this, null, argTerms) .serialize(term); }", "tokens": 57} {"id": 56689, "source": "method", "repo": "aya-prover/aya-dev", "text": "private static boolean classDecl_5(PsiBuilder b, int l) { if (!recursion_guard_(b, l, \"classDecl_5\")) return false; bindBlock(b, l + 1); return true; }", "tokens": 50} {"id": 56748, "source": "method", "repo": "aya-prover/aya-dev", "text": "protected void renderCodeBlock(@NotNull Cursor cursor, Doc.@NotNull CodeBlock block, EnumSet outer) { cursor.invisibleContent(\"

\"); renderDoc(cursor, block.code(), EnumSet.of(Outer.EnclosingTag)); // Even in code mode, we still need to escape cursor.invisibleContent(\"
\"); }", "tokens": 81} {"id": 56918, "source": "method", "repo": "aya-prover/aya-dev", "text": "public NamedArg(boolean explicit, @NotNull WithPos arg) { this(explicit, null, arg); }", "tokens": 28} {"id": 56935, "source": "method", "repo": "aya-prover/aya-dev", "text": "static WithPos buildLam(@NotNull SourcePos sourcePos, @NotNull SeqView params, @NotNull WithPos body) { return buildNested(sourcePos, params, body, Lambda::new); }", "tokens": 57} {"id": 56988, "source": "method", "repo": "aya-prover/aya-dev", "text": "public static TypeMissing of(@Closed Term wellTyped) { return new TypeMissing(wellTyped); }", "tokens": 24} {"id": 57094, "source": "method", "repo": "aya-prover/aya-dev", "text": "public String toString() { return QualifiedID.join(module); }", "tokens": 16} {"id": 57342, "source": "method", "repo": "aztechmc/modern-industrialization", "text": "/** Select first non-null id, and convert it to a sprite id. */ private static Material select(@Nullable ResourceLocation... candidates) { for (var id : candidates) { if (id != null) { return new Material(InventoryMenu.BLOCK_ATLAS, id); } } return null; }", "tokens": 66} {"id": 57441, "source": "method", "repo": "aztechmc/modern-industrialization", "text": "public static BlockDefinitionParams defaultStone() { return of(BlockBehaviour.Properties.of().mapColor(MapColor.METAL).destroyTime(4.0f).requiresCorrectToolForDrops()); }", "tokens": 48} {"id": 57602, "source": "method", "repo": "aztechmc/modern-industrialization", "text": "public Builder parent(AdvancementHolder pParent) { return (Builder) super.parent(pParent); }", "tokens": 23} {"id": 57645, "source": "method", "repo": "aztechmc/modern-industrialization", "text": "public String path() { return getResourceAsString(false); }", "tokens": 14} {"id": 57740, "source": "method", "repo": "aztechmc/modern-industrialization", "text": "private boolean tryFillWater(Player player, ItemStack barrelLike, ItemStack fillSource) { var otherStorage = fillSource.getCapability(Capabilities.FluidHandler.ITEM); if (otherStorage != null) { long totalWater = 0; for (int tank = 0; tank < otherStorage.getTanks(); ++tank) { if (otherStorage.getFluidInTank(tank).getFluid() == Fluids.WATER) { totalWater += otherStorage.getFluidInTank(tank).getAmount(); } } if (totalWater * fillSource.getCount() >= FluidType.BUCKET_VOLUME) { fillWater(player, barrelLike); return true; } } return false; }", "tokens": 146} {"id": 57777, "source": "method", "repo": "aztechmc/modern-industrialization", "text": "public BoilerMachineBlockEntity(BEP bep, boolean bronze) { super(bep, new MachineGuiParameters.Builder(bronze ? \"bronze_boiler\" : \"steel_boiler\", true).backgroundHeight(180).build(), new OrientationComponent.Params(true, false, true)); int capacity = FluidType.BUCKET_VOLUME * (bronze ? 8 : 16); List itemStacks = Collections.singletonList(ConfigurableItemStack.standardInputSlot()); SlotPositions itemPositions = new SlotPositions.Builder().addSlot(INPUT_SLOT_X, INPUT_SLOT_Y).build(); List fluidStacks = Arrays.asList(ConfigurableFluidStack.lockedInputSlot(capacity, Fluids.WATER), ConfigurableFluidStack.lockedOutputSlot(capacity, MIFluids.STEAM.asFluid())); SlotPositions fluidPositions = new SlotPositions.Builder().addSlot(WATER_SLOT_X, WATER_SLOT_Y).addSlot(OUTPUT_SLOT_X, OUTPUT_SLOT_Y).build(); inventory = new MIInventory(itemStacks, fluidStacks, itemPositions, fluidPositions); this.bronze = bronze; steamHeater = new SteamHeaterComponent(1500, bronze ? 8 : 16, 8, true, false, false); fuelBurning = new FuelBurningComponent(steamHeater, 1); this.isActiveComponent = new IsActiveComponent(); registerGuiComponent(new AutoExtract(orientation)); ProgressBar.Params progressParams = new ProgressBar.Params(133, 50, \"furnace\", 14, 14, true); TemperatureBar.Params temperatureParams = new TemperatureBar.Params(42, 75, 1500); registerGuiComponent(new ProgressBar(progressParams, () -> (float) fuelBurning.getBurningProgress())); registerGuiComponent(new TemperatureBar(temperatureParams, () -> (int) steamHeater.getTemperature())); this.registerComponents(inventory, isActiveComponent, steamHeater, fuelBurning); }", "tokens": 478} {"id": 57818, "source": "method", "repo": "aztechmc/modern-industrialization", "text": "public long getBaseRecipeEu() { return MachineTier.MULTIBLOCK.getBaseEu(); }", "tokens": 21} {"id": 57904, "source": "method", "repo": "aztechmc/modern-industrialization", "text": "public SlotPanel withRedstoneControl(RedstoneControlComponent redstoneControlComponent) { return addSlot(SlotType.REDSTONE_MODULE, () -> redstoneControlComponent.getDrop().copy(), redstoneControlComponent::setStackServer); }", "tokens": 47} {"id": 57936, "source": "method", "repo": "aztechmc/modern-industrialization", "text": "/** Convert a relative position in the shape template to the real position in the world. */ public static BlockPos toWorldPos(BlockPos controllerPos, Direction controllerDirection, BlockPos templatePos) { BlockPos rotatedPos; if (controllerDirection == NORTH) rotatedPos = new BlockPos(-templatePos.getX(), templatePos.getY(), templatePos.getZ()); else if (controllerDirection == SOUTH) rotatedPos = new BlockPos(templatePos.getX(), templatePos.getY(), -templatePos.getZ()); else if (controllerDirection == EAST) rotatedPos = new BlockPos(-templatePos.getZ(), templatePos.getY(), -templatePos.getX()); else rotatedPos = new BlockPos(templatePos.getZ(), templatePos.getY(), templatePos.getX()); return rotatedPos.offset(controllerPos); }", "tokens": 168} {"id": 58032, "source": "method", "repo": "aztechmc/modern-industrialization", "text": "public double getNeutronProductProbability() { return neutronProductProbability; }", "tokens": 21} {"id": 58097, "source": "method", "repo": "aztechmc/modern-industrialization", "text": "/** Rotate clockwise around the facing axis. */ protected void rotateCw() { right = up().scale(-1); }", "tokens": 28} {"id": 58154, "source": "method", "repo": "aztechmc/modern-industrialization", "text": "default SingleSlotStorage getSlot(int slot) { if (slot != 0) { throw new IndexOutOfBoundsException(\"Slot \" + slot + \" does not exist in a single-slot storage.\"); } return this; }", "tokens": 51} {"id": 58251, "source": "method", "repo": "Azure-Samples/azure-ai-vision-sdk", "text": "public String getRedisHostname() { return redisHostname; }", "tokens": 13} {"id": 58283, "source": "method", "repo": "Azure-Samples/azure-ai-vision-sdk", "text": "private static String encode(String value) { return UriUtils.encode(value, StandardCharsets.UTF_8); }", "tokens": 26} {"id": 58448, "source": "method", "repo": "Azure-Samples/azure-ai-vision-sdk", "text": "public Builder allowBasicIntegrity(boolean v) { this.allowBasicIntegrity = v; return this; }", "tokens": 23} {"id": 58508, "source": "method", "repo": "Azure-Samples/azure-ai-vision-sdk", "text": "protected static HandlerOutcome ok(Object body, int status, String code, Object data) { return Outcomes.ok(body, status, code, data); }", "tokens": 37} {"id": 58540, "source": "method", "repo": "Azure-Samples/azure-ai-vision-sdk", "text": "private static Map certInfo(X509Certificate c, String thumbprint) { Map info = new LinkedHashMap<>(); info.put(\"subject\", c.getSubjectX500Principal().getName()); info.put(\"issuer\", c.getIssuerX500Principal().getName()); info.put(\"serialNumber\", c.getSerialNumber().toString(16).toUpperCase()); info.put(\"validFrom\", IsoTime.from(c.getNotBefore().toInstant())); info.put(\"validTo\", IsoTime.from(c.getNotAfter().toInstant())); info.put(\"thumbprint\", thumbprint); return info; }", "tokens": 142} {"id": 58641, "source": "method", "repo": "Azure-Samples/azure-ai-vision-sdk", "text": "public synchronized boolean setSession(String sid, SessionRecord record) { if (sessions.containsKey(sid)) return false; sessions.put(sid, new Snapshot<>(JSON.fromJson(JSON.toJson(record), SessionRecord.class), UUID.randomUUID().toString())); return true; }", "tokens": 62} {"id": 58671, "source": "method", "repo": "Azure-Samples/azure-ai-vision-sdk", "text": "void decryptRejectsGarbage() { EcKeyPair kp = CryptoUtils.generateServerKeyPairEC(); assertEquals(null, CryptoUtils.decryptWithPrivateKeyEC(\"not-a-valid-blob\", kp.privateKey())); }", "tokens": 49} {"id": 58717, "source": "method", "repo": "Azure-Samples/azure-search-openai-demo-java", "text": "public Builder semanticCaptions(boolean semanticCaptions) { this.semanticCaptions = semanticCaptions; return this; }", "tokens": 27} {"id": 58758, "source": "method", "repo": "Azure-Samples/azure-search-openai-demo-java", "text": "public List getMessages() { return messages; }", "tokens": 16} {"id": 58996, "source": "method", "repo": "azure/azure-functions-java-worker", "text": "public void EventHubTriggerAndOutputBinaryCardinalityOne( @EventHubTrigger(name = \"message\", eventHubName = \"test-binary-input-cardinality-one-java\", connection = \"AzureWebJobsEventHubSender_2\", dataType = \"binary\", cardinality = Cardinality.ONE) byte[] message, @QueueOutput(name = \"output\", queueName = \"test-binary-output-cardinality-one-java\",connection = \"AzureWebJobsStorage\") OutputBinding output, final ExecutionContext context ) { context.getLogger().info(\"Java Event Hub trigger received message\" + message); output.setValue(message); }", "tokens": 137} {"id": 59017, "source": "method", "repo": "azure/azure-functions-java-worker", "text": "public Function(Communicator communicator) { this.communicator = communicator; }", "tokens": 24} {"id": 59038, "source": "method", "repo": "azure/azure-functions-java-worker", "text": "private int parsePort(String input) throws ParseException { try { int result = Integer.parseInt(input); if (result < 1 || result > 65535) { throw new IndexOutOfBoundsException(\"port number out of range\"); } return result; } catch (NumberFormatException | IndexOutOfBoundsException ex) { throw new ParseException(String.format( \"port number \\\"%s\\\" is not qualified. It must be an integer within range [1, 65535]\", input)); } }", "tokens": 107} {"id": 59043, "source": "method", "repo": "azure/azure-functions-java-worker", "text": "private String getRequestId() { return this.requestId; }", "tokens": 13} {"id": 59075, "source": "method", "repo": "azure/azure-functions-java-worker", "text": "private void deinitializImpl() { assert this.client != null; clearHandlers(this.hostLogger); this.logToConsole = false; this.client = null; }", "tokens": 39} {"id": 59131, "source": "method", "repo": "azure/azure-functions-java-worker", "text": "protected Optional> lookupName(String name) { return Optional.ofNullable(this.name != null && this.name.equals(name) ? this : null); }", "tokens": 38} {"id": 59237, "source": "method", "repo": "azure/azure-functions-java-worker", "text": "public FunctionMethodDescriptor getDescriptor() { return descriptor; }", "tokens": 13} {"id": 59271, "source": "method", "repo": "azure/azure-functions-java-worker", "text": "public List getParams() { return params; }", "tokens": 16} {"id": 59313, "source": "method", "repo": "azure/azure-functions-java-worker", "text": "public boolean isWarmup() { return isWarmup; }", "tokens": 12} {"id": 59564, "source": "method", "repo": "azure/azure-sdk-for-android", "text": "public void startRealTimeNotification(View view) { logAndToast( \"Starting realtime notification\"); try { chatAsyncClient.startRealtimeNotifications(getApplicationContext(), new Consumer() { @Override public void accept(Throwable throwable) { Log.e(TAG, \"Renew realtime notification registration failed!\", throwable); } }); } catch (Exception e) { Log.e(TAG, e.getMessage()); } }", "tokens": 90} {"id": 59580, "source": "method", "repo": "azure/azure-sdk-for-android", "text": "/** Remove handler from a chat event for realtime notifications. @param chatEventType the chat event type @param listener the listener callback function */ public void removeEventHandler(ChatEventType chatEventType, RealTimeNotificationCallback listener) { this.signalingClient.off(chatEventType, listener); }", "tokens": 60} {"id": 59623, "source": "method", "repo": "azure/azure-sdk-for-android", "text": "/** Maps from a {@link ChatParticipant} Iterable to {@link com.azure.android.communication.chat.implementation.models.AddChatParticipantsOptions}. */ public static com.azure.android.communication.chat.implementation.models.AddChatParticipantsOptions convert( Iterable participants, ClientLogger logger) { if (participants == null) { return null; } List innerParticipants = new ArrayList<>(); for (ChatParticipant participant : participants) { innerParticipants.add(ChatParticipantConverter.convert(participant, logger)); } com.azure.android.communication.chat.implementation.models.AddChatParticipantsOptions addChatThreadMembersOptions = new com.azure.android.communication.chat.implementation.models.AddChatParticipantsOptions() .setParticipants(innerParticipants); return addChatThreadMembersOptions; }", "tokens": 189} {"id": 59664, "source": "method", "repo": "azure/azure-sdk-for-android", "text": "RegistrarClient() { this.httpClient = HttpClient.createDefault(); this.jacksonSerder = JacksonSerder.createDefault(); }", "tokens": 27} {"id": 59930, "source": "method", "repo": "azure/azure-sdk-for-android", "text": "/** Initializes a new instance of the ResourceModifiedException class. @param message the exception message or the response content if a message is not available @param response the HTTP response */ public ResourceModifiedException(final String message, final HttpResponse response) { super(message, response); }", "tokens": 57} {"id": 59943, "source": "method", "repo": "azure/azure-sdk-for-android", "text": "/** Gets the whitelisted headers that should be logged. @return The list of whitelisted headers. */ public Set getAllowedHeaderNames() { return allowedHeaderNames; }", "tokens": 37} {"id": 59946, "source": "method", "repo": "azure/azure-sdk-for-android", "text": "/** Sets the given whitelisted query params to be displayed in the logging info. @param allowedQueryParamNames The list of whitelisted query params from the user. @return The updated HttpLogOptions object. */ public HttpLogOptions setAllowedQueryParamNames(final Set allowedQueryParamNames) { this.allowedQueryParamNames = allowedQueryParamNames == null ? new HashSet<>() : allowedQueryParamNames; return this; }", "tokens": 84} {"id": 59951, "source": "method", "repo": "azure/azure-sdk-for-android", "text": "/** Creates {@link RequestIdPolicy} with provided {@code requestIdHeaderName}. @param requestIdHeaderName to be used to set in {@link HttpRequest}. */ public RequestIdPolicy(String requestIdHeaderName) { this.requestIdHeaderName = Util.requireNonNull(requestIdHeaderName, \"'requestIdHeaderName' cannot be null.\"); }", "tokens": 63} {"id": 60115, "source": "method", "repo": "azure/azure-sdk-for-android", "text": "protected ThreeTenFormattedSerializerBase(ThreeTenFormattedSerializerBase base, Boolean useTimestamp, Boolean useNanoseconds, DateTimeFormatter dtf, Shape shape) { super(base.handledType()); _useTimestamp = useTimestamp; _useNanoseconds = useNanoseconds; _formatter = dtf; _shape = shape; }", "tokens": 71} {"id": 60280, "source": "method", "repo": "azure/azure-sdk-for-android", "text": "public InputStream getBody() { return new ByteArrayInputStream(this.body); }", "tokens": 17} {"id": 60355, "source": "method", "repo": "azure/azure-sdk-for-android", "text": "public void service19PutWithHeaderApplicationOctetStreamContentTypeAndByteArrayBodyWithNullBody() { CountDownLatch latch = new CountDownLatch(1); CallbackResult cbResult = new CallbackResult<>(); createService(Service19.class).putWithHeaderApplicationOctetStreamContentTypeAndByteArrayBody(null, new Callback>() { @Override public void onSuccess(Response response) { cbResult.response = response; latch.countDown(); } @Override public void onFailure(Throwable error) { cbResult.error = error; latch.countDown(); } }); awaitOnLatch(latch, \"service19PutWithHeaderApplicationOctetStreamContentTypeAndByteArrayBodyWithNullBody\"); if (cbResult.error != null) { Assertions.fail(cbResult.error); } else { final Response response = cbResult.response; HttpBinJSON json = response.getValue(); Assertions.assertNotNull(json); assertEquals(\"\", json.data()); } }", "tokens": 209} {"id": 60369, "source": "method", "repo": "azure/azure-sdk-for-android", "text": "public void pizzaSize(PizzaSize pizzaSize) { this.pizzaSize = pizzaSize; }", "tokens": 31} {"id": 60457, "source": "method", "repo": "azure/azure-sdk-for-java", "text": "/** Set the additionalProperties property: configuration Manager client enabled features. @param additionalProperties the additionalProperties value to set. @return the MicrosoftGraphConfigurationManagerClientEnabledFeatures object itself. */ public MicrosoftGraphConfigurationManagerClientEnabledFeatures withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; }", "tokens": 74} {"id": 60462, "source": "method", "repo": "azure/azure-sdk-for-java", "text": "/** {@inheritDoc} */ public MicrosoftGraphDomainInner withId(String id) { super.withId(id); return this; }", "tokens": 28} {"id": 60530, "source": "method", "repo": "azure/azure-sdk-for-java", "text": "public XmlSerializableExample fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { rootElementName = (rootElementName == null || rootElementName.isEmpty()) ? \"example\" : rootElementName; // readObject is a convenience method on XmlReader which prepares the XML for being read as an object. // If the current token isn't an XmlToken.START_ELEMENT the next token element will be iterated to, if it's // still not an XmlToken.START_ELEMENT after iterating to the next element an exception will be thrown. If // the next element is an XmlToken.START_ELEMENT it will validate that the XML element matches the name // expected, if the name doesn't match an exception will be thrown. If the element name matches the reader // function will be called. return xmlReader.readObject(rootElementName, reader -> { // Since this class has no constructor reading to fields can be done inline. // If the class had a constructor with arguments the recommendation is using local variables to track // all field values. XmlSerializableExample result = new XmlSerializableExample(); // Reading attributes must happen first so that the XmlReader is looking at the object start element. result.aBooleanAttribute = reader.getBooleanAttribute(null, \"aBooleanAttribute\"); result.aNullableDecimalAttribute = reader.getNullableAttribute(null, \"aNullableDecimalAttribute\", Double::parseDouble); while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); // Since this object doesn't use namespaces we can work with the local part directly. // If it had namespaces the full QName would need to be inspected. String localPart = elementName.getLocalPart(); if (\"anIntElement\".equals(localPart)) { result.anIntElement = reader.getIntElement(); } else if (\"aStringElement\".equals(localPart)) { // getStringElement coalesces XML text and XML CData into a single string without needing to // manage state. result.aStringElement = reader.getStringElement(); } else { // Skip element when the element is unknown. reader.skipElement(); } } return result; }); }", "tokens": 460} {"id": 60642, "source": "method", "repo": "azure/azure-sdk-for-java", "text": "/** Disposes the connection associated with this {@link StreamResponse}. */ public void close() { if (this.consumed) { return; } this.consumed = true; if (response == null) { final Flux value = getValue(); value.subscribe().dispose(); } else { response.close(); } }", "tokens": 70} {"id": 60718, "source": "method", "repo": "azure/azure-sdk-for-java", "text": "/** Gets user defined function. @param id the id @return the user defined function */ public CosmosUserDefinedFunction getUserDefinedFunction(String id) { return new CosmosUserDefinedFunction(id, this.container, asyncScripts.getUserDefinedFunction(id)); }", "tokens": 55} {"id": 60740, "source": "method", "repo": "azure/azure-sdk-for-java", "text": "public V setValue(final V value) { throw new UnsupportedOperationException(\"setValue() is not supported\"); }", "tokens": 22} {"id": 60759, "source": "method", "repo": "azure/azure-sdk-for-java", "text": "public String toString() { return \"CharMatcher.javaDigit()\"; }", "tokens": 16} {"id": 60874, "source": "method", "repo": "azure/azure-sdk-for-java", "text": "public void shouldFailVectorIndexSimilarPathDifferentVectorType() { PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); ArrayList paths = new ArrayList(); paths.add(\"/mypk\"); partitionKeyDef.setPaths(paths); CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); IndexingPolicy indexingPolicy = new IndexingPolicy(); indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); ExcludedPath excludedPath = new ExcludedPath(\"/*\"); indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); IncludedPath includedPath1 = new IncludedPath(\"/name/?\"); IncludedPath includedPath2 = new IncludedPath(\"/description/?\"); indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); List vectorIndexes = populateVectorIndexes(); vectorIndexes.get(2).setPath(\"/vector2\"); indexingPolicy.setVectorIndexes(vectorIndexes); List embeddings = populateEmbeddings(); CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(embeddings); collectionDefinition.setIndexingPolicy(indexingPolicy); collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); try { database.createContainer(collectionDefinition).block(); fail(\"Container creation will fail as duplicate path is provided in vector indexes\"); } catch (CosmosException ex) { assertThat(ex.getStatusCode()).isEqualTo(400); assertThat(ex.getMessage()).contains(\"Duplicate Path :/vector2 found in Vector Indexing Policy.\"); } }", "tokens": 352} {"id": 61021, "source": "method", "repo": "azure/azure-sdk-for-java", "text": "private static String getOriginalErrorMessage(TelemetryPipelineResponse response) { int statusCode = response.getStatusCode(); if (statusCode == 401 || statusCode == 403) { return DiagnosticTelemetryPipelineListener.getErrorMessageFromCredentialRelatedResponse(statusCode, response.getBody()); } else { return \"Received response code \" + statusCode; } }", "tokens": 70} {"id": 61042, "source": "method", "repo": "azure/azure-sdk-for-java", "text": "public LoadBalancerImpl withoutOutboundRule(String name) { this.outboundRules.remove(name); return this; }", "tokens": 28} {"id": 61104, "source": "method", "repo": "azure/azure-sdk-for-java", "text": "/** Method that gets called after a primary text segment (of type CHARACTERS or CDATA, not applicable to SPACE) has been read in text buffer. Method has to see if the following event would be textual as well, and if so, read it (and any other following textual segments). */ private void finishCoalescedText() throws XMLStreamException { while (true) { // no matter what, will need (and can get) one char if (_inputPtr >= _inputEnd) { if (!loadMore()) { // most likely an error, will be handled later on return; } } if (_inputBuffer[_inputPtr] == '<') { // markup of some kind /* In worst case, need 3 chars (\"= _inputEnd) { if (!loadAndRetain()) { // probably an error, but will be handled later return; } } if (_inputBuffer[_inputPtr + 1] != '!' || _inputBuffer[_inputPtr + 2] != '[') { // can't be CDATA, we are done here return; } // but let's verify it still: _inputPtr += 3; for (int i = 0; i < 6; ++i) { if (_inputPtr >= _inputEnd) { loadMoreGuaranteed(); } char c = _inputBuffer[_inputPtr++]; if (c != CDATA_STR.charAt(i)) { reportTreeUnexpChar(c, \" (expected '\" + CDATA_STR.charAt(i) + \"' for CDATA section)\"); } } finishCoalescedCData(); } else { // textual (or entity, error etc) finishCoalescedCharacters(); if (_entityPending) { break; } } } }", "tokens": 424} {"id": 61141, "source": "method", "repo": "azure/azure-sdk-for-java", "text": "public boolean isEntityPartitioned() { return true; }", "tokens": 13} {"id": 61168, "source": "method", "repo": "azure/azure-sdk-for-java", "text": "ConfigurationWithConnectionDetailsBean( Environment environment, AzureStorageBlobConnectionDetails connectionDetails) { this.environment = environment; this.connectionDetails = connectionDetails; }", "tokens": 34} {"id": 61438, "source": "method", "repo": "azuread/azure-activedirectory-library-for-android", "text": "private Object getTokenTask() throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { Class c = Class.forName(\"com.microsoft.aad.adal.AuthenticationActivity$TokenTask\"); Constructor constructorParams = c.getConstructor(mActivityRule.getActivity().getClass()); constructorParams.setAccessible(true); return constructorParams.newInstance(mActivityRule.getActivity()); }", "tokens": 82} {"id": 61442, "source": "method", "repo": "azuread/azure-activedirectory-library-for-android", "text": "public void testConstructorInternetPermission() throws NoSuchAlgorithmException, NoSuchPaddingException { String authority = \"https://github.com/MSOpenTech\"; FileMockContext mockContext = new FileMockContext(getInstrumentation().getContext()); mockContext.addPermission(\"android.permission.INTERNET\"); // no exception new AuthenticationContext(mockContext, authority, false); try { mockContext.removePermission(\"android.permission.INTERNET\"); new AuthenticationContext(mockContext, authority, false); Assert.fail(\"Supposed to fail\"); } catch (Exception e) { assertEquals(\"Permission related message\", ADALError.DEVELOPER_INTERNET_PERMISSION_MISSING, ((AuthenticationException) e.getCause()).getCode()); } }", "tokens": 141} {"id": 61720, "source": "method", "repo": "azuread/azure-activedirectory-library-for-android", "text": "private static JSONObject getCommonSuccessResponseData() throws JSONException { final JSONObject responseJsonObject = new JSONObject(); responseJsonObject.put(AuthenticationConstants.OAuth2.ID_TOKEN, TEST_IDTOKEN); responseJsonObject.put(AuthenticationConstants.OAuth2.CLIENT_INFO, TEST_CLIENT_INFO); responseJsonObject.put(AuthenticationConstants.OAuth2.ACCESS_TOKEN, \"I am a new access token\"); responseJsonObject.put(AuthenticationConstants.OAuth2.TOKEN_TYPE, \"Bearer\"); responseJsonObject.put(AuthenticationConstants.OAuth2.EXPIRES_IN, \"10\"); responseJsonObject.put(\"expires_on\", \"1368768616\"); responseJsonObject.put(AuthenticationConstants.OAuth2.SCOPE, \"*\"); return responseJsonObject; }", "tokens": 163} {"id": 61733, "source": "method", "repo": "azuread/azure-activedirectory-library-for-android", "text": "public String getUserName() { return mUserName; }", "tokens": 12} {"id": 61841, "source": "method", "repo": "azuread/azure-activedirectory-library-for-android", "text": "public void prepareForBrokerResumeRequest() { // Method intentionally left blank }", "tokens": 16} {"id": 61850, "source": "method", "repo": "azuread/azure-activedirectory-library-for-android", "text": "String getSpeRing() { return mSpeRing; }", "tokens": 15} {"id": 61884, "source": "method", "repo": "azuread/azure-activedirectory-library-for-android", "text": "public void setScope(String scope) { this.mScope = scope; }", "tokens": 18} {"id": 62067, "source": "method", "repo": "azuread/azure-activedirectory-library-for-android", "text": "public boolean contains(String key) { if (key == null) { throw new IllegalArgumentException(\"key\"); } Logger.i(TAG, \"contains Item from cache.\", \"Key: \" + key); synchronized (mCacheLock) { return mCache.get(key) != null; } }", "tokens": 64} {"id": 62077, "source": "method", "repo": "azuread/azure-activedirectory-library-for-android", "text": "public AuthenticationResult refreshToken(String refreshToken) throws IOException, AuthenticationException { final String requestMessage; if (mWebRequestHandler == null) { Logger.v(TAG, \"Web request is not set correctly.\"); throw new IllegalArgumentException(\"webRequestHandler is null.\"); } // Token request message try { requestMessage = buildRefreshTokenRequestMessage(refreshToken); } catch (UnsupportedEncodingException encoding) { Logger.e(TAG, ADALError.ENCODING_IS_NOT_SUPPORTED.getDescription(), encoding.getMessage(), ADALError.ENCODING_IS_NOT_SUPPORTED, encoding); return null; } final Map headers = getRequestHeaders(); // Refresh token endpoint needs to send header field for device // challenge headers.put(AuthenticationConstants.Broker.CHALLENGE_TLS_INCAPABLE, AuthenticationConstants.Broker.CHALLENGE_TLS_INCAPABLE_VERSION); Logger.v(TAG, \"Sending request to redeem token with refresh token.\"); return postMessage(requestMessage, headers); }", "tokens": 205} {"id": 62200, "source": "method", "repo": "azuread/azure-activedirectory-library-for-android", "text": "private EventStrings() { // Intentionally left blank }", "tokens": 13} {"id": 62287, "source": "method", "repo": "azuread/azure-activedirectory-library-for-android", "text": "private OutputStream getUrandomOutputStream() throws IOException { synchronized (SLOCK) { if (sUrandomOut == null) { sUrandomOut = new FileOutputStream(URANDOM_FILE); } return sUrandomOut; } }", "tokens": 52} {"id": 62297, "source": "method", "repo": "azuread/azure-activedirectory-library-for-android", "text": "Constants.DataProfile getDataProfile() { return mResource; }", "tokens": 14} {"id": 62472, "source": "method", "repo": "azuread/microsoft-authentication-library-for-android", "text": "/** Helper method to wait for MsalCustomTabsServiceConnection to establish. */ private boolean waitForServiceConnectionToEstablish(CountDownLatch latch) { final String methodTag = TAG + \":waitForServiceConnectionToEstablish\"; boolean connectionEstablished = true; try { // await returns true if count is 0, false if action times out // invert this boolean to indicate if we should skip warming up final boolean timedOut = !latch.await(CUSTOM_TABS_MAX_CONNECTION_TIMEOUT, TimeUnit.SECONDS); if (timedOut) { // if the request timed out, we don't actually know whether or not the service connected. // to be safe, we'll skip warmup and rely on mCustomTabsServiceIsBound // to unbind the Service when onStop() is called. connectionEstablished = false; Logger.warn(methodTag, \"Connection to CustomTabs timed out. Skipping warmup.\"); } } catch (final InterruptedException e) { Logger.error(methodTag, \"Failed to connect to CustomTabs. Skipping warmup.\", e); connectionEstablished = false; } return connectionEstablished; }", "tokens": 240} {"id": 62605, "source": "method", "repo": "azuread/microsoft-authentication-library-for-android", "text": "/** Gets the {@link Logger.LogLevel} to use. @return The LogLevel. */ public Logger.LogLevel getLogLevel() { return mLogLevel; }", "tokens": 33} {"id": 62660, "source": "method", "repo": "azuread/microsoft-authentication-library-for-android", "text": "public static ApplicationInfo getApplicationInfo(final Context context) { final ApplicationInfo applicationInfo; try { applicationInfo = context.getPackageManager().getApplicationInfo( context.getPackageName(), PackageManager.GET_META_DATA); } catch (PackageManager.NameNotFoundException e) { throw new IllegalStateException(\"Unable to find the package info, unable to proceed\"); } return applicationInfo; }", "tokens": 78} {"id": 62861, "source": "method", "repo": "azuread/microsoft-authentication-library-for-android", "text": "public static SilentAuthenticationCallback successfulSilentCallback() { SilentAuthenticationCallback callback = new SilentAuthenticationCallback() { @Override public void onSuccess(IAuthenticationResult authenticationResult) { Assert.assertTrue(\"Received a success result with an empty access token\", !StringUtil.isEmpty(authenticationResult.getAccessToken())); sAccount = authenticationResult.getAccount(); } @Override public void onError(MsalException exception) { throw new AssertionError(exception); } }; return callback; }", "tokens": 96} {"id": 62970, "source": "method", "repo": "azuread/microsoft-authentication-library-for-android", "text": "public void test_2572280_LTW_LTWHasHigherPriorityThanCP() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); brokerCompanyPortal.install(); final MsalTestApp msalTestApp = new MsalTestApp(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRunBasedOnUserType(mUserType); final MicrosoftStsPromptHandlerParameters promptHandlerParameters = MicrosoftStsPromptHandlerParameters.builder() .prompt(PromptParameter.SELECT_ACCOUNT) .loginHint(username) .sessionExpected(false) .broker(mBroker) .expectingBrokerAccountChooserActivity(false) .expectingProvidedAccountInBroker(false) .expectingLoginPageAccountPicker(false) .expectingProvidedAccountInCookie(false) .consentPageExpected(false) .passwordPageExpected(true) .speedBumpExpected(false) .registerPageExpected(false) .enrollPageExpected(false) .staySignedInPageExpected(false) .verifyYourIdentityPageExpected(false) .howWouldYouLikeToSignInExpected(false) .build(); String token = msalTestApp.acquireToken(username, password, promptHandlerParameters, true); Assert.assertNotNull(token); msalTestApp.handleBackButton(); final String activeBroker = msalTestApp.getActiveBrokerPackageName(); Assert.assertEquals(\"Active broker pkg name : \" + BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); }", "tokens": 363} {"id": 63157, "source": "method", "repo": "azuread/microsoft-authentication-library-for-java", "text": "private byte[] read(String attributeValue1, String attributeValue2) { byte[] data = null; Pointer[] error = new Pointer[1]; String secret = ISecurityLibrary.library.secret_password_lookup_sync( getLibSecretSchema(), null, error, attributeKey1, attributeValue1, attributeKey2, attributeValue2, null); if (error[0] != Pointer.NULL) { GError err = new GError(error[0]); throw new KeyRingAccessException(\"An error while reading secret from keyring, \" + \"domain:\" + err.domain + \" code:\" + err.code + \" message:\" + err.message); } else if (secret != null && !secret.isEmpty()) { data = Base64.getDecoder().decode(secret); } return data; }", "tokens": 172} {"id": 63346, "source": "method", "repo": "azuread/microsoft-authentication-library-for-java", "text": "public ApiEvent(Boolean logPii) { super(TelemetryConstants.API_EVENT_NAME_KEY); this.logPii = logPii; }", "tokens": 35} {"id": 63448, "source": "method", "repo": "azuread/microsoft-authentication-library-for-java", "text": "/** Returns true if this assertion uses a context-aware provider. */ boolean isContextAware() { return contextAwareAssertionProvider != null; }", "tokens": 30} {"id": 63478, "source": "method", "repo": "azuread/microsoft-authentication-library-for-java", "text": "public DefaultEvent(String clientId, Map eventCount) { super(TelemetryConstants.DEFAULT_EVENT_NAME_KEY); setClientId(clientId); setSdkPlatform(); setSdkVersion(); this.eventCount = eventCount; setHttpEventCount(); setCacheEventCount(); }", "tokens": 62} {"id": 63701, "source": "method", "repo": "azuread/microsoft-authentication-library-for-java", "text": "public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); if (essential) { jsonWriter.writeBooleanField(\"essential\", essential); } if (value != null) { jsonWriter.writeStringField(\"value\", value); } if (values != null && !values.isEmpty()) { jsonWriter.writeStartArray(\"values\"); for (String val : values) { jsonWriter.writeString(val); } jsonWriter.writeEndArray(); } jsonWriter.writeEndObject(); return jsonWriter; }", "tokens": 97} {"id": 63826, "source": "method", "repo": "azuread/microsoft-authentication-library-for-java", "text": "static boolean isAuthenticationSuccessful(AuthenticationResponse authResponse) { return authResponse instanceof AuthenticationSuccessResponse; }", "tokens": 22} {"id": 63888, "source": "method", "repo": "azuread/microsoft-authentication-library-for-java", "text": "public void tokenCacheEntitiesFormatTest(String folder) throws URISyntaxException, IOException, JSONException { String CLIENT_ID = \"b6c69a37-df96-4db0-9088-2ab96e1d8215\"; String AUTHORIZE_REQUEST_URL = \"https://login.microsoftonline.com/common/oauth2/v2.0/authorize\"; String tokenResponse = getTokenResponse(folder); PublicClientApplication app = PublicClientApplication.builder(CLIENT_ID).correlationId(\"correlation_id\").build(); AuthorizationCodeParameters parameters = AuthorizationCodeParameters.builder (\"code\", new URI(\"http://my.redirect.com\")) .build(); MsalRequest msalRequest = new AuthorizationCodeRequest( parameters, app, new RequestContext(app, PublicApi.ACQUIRE_TOKEN_BY_AUTHORIZATION_CODE, parameters)); ServiceBundle serviceBundle = new ServiceBundle( null, new TelemetryManager(null, false), null); TokenRequestExecutor request = spy(new TokenRequestExecutor( new AADAuthority(new URL(AUTHORIZE_REQUEST_URL)), msalRequest, serviceBundle)); OAuthHttpRequest msalOAuthHttpRequest = mock(OAuthHttpRequest.class); HttpResponse httpResponse = mock(HttpResponse.class); doReturn(msalOAuthHttpRequest).when(request).createOauthHttpRequest(); doReturn(httpResponse).when(msalOAuthHttpRequest).send(); doReturn(HttpStatus.HTTP_OK).when(httpResponse).statusCode(); doReturn(JsonHelper.convertJsonToMap(tokenResponse)).when(httpResponse).getBodyAsMap(); final AuthenticationResult result = request.executeTokenRequest(); TokenCache tokenCache = new TokenCache(); tokenCache.saveTokens(request, result, \"login.microsoftonline.com\"); validateAccessTokenCacheEntity(folder, tokenResponse, tokenCache); validateRefreshTokenCacheEntity(folder, tokenCache); validateIdTokenCacheEntity(folder, tokenCache); validateAccountCacheEntity(folder, tokenCache); validateAppMetadataCacheEntity(folder, tokenCache); }", "tokens": 427} {"id": 64012, "source": "method", "repo": "azuread/microsoft-authentication-library-for-java", "text": "private RefreshTokenParameters getAcquireTokenApiParameters(String scope) { return RefreshTokenParameters .builder(Collections.singleton(scope), \"refreshToken\") .build(); }", "tokens": 36} {"id": 64096, "source": "method", "repo": "AzzappApp/react-native-skia-video", "text": "public ReactModuleInfoProvider getReactModuleInfoProvider() { return () -> { final Map moduleInfos = new HashMap<>(); moduleInfos.put( ReactNativeSkiaVideoModule.NAME, new ReactModuleInfo( ReactNativeSkiaVideoModule.NAME, ReactNativeSkiaVideoModule.NAME, false, // canOverrideExistingModule false, // needsEagerInit false, // isCxxModule true // isTurboModule )); return moduleInfos; }; }", "tokens": 105} {"id": 64112, "source": "method", "repo": "AzzappApp/react-native-skia-video", "text": "public int getFrameRate() { return frameRate; }", "tokens": 12} {"id": 64395, "source": "method", "repo": "baeldung/spring-security-oauth", "text": "public void givenAccessTokenWithProfileScope_whenGetUserProfile_thenUsernameIsMatched(){ String accessToken = obtainTokens().accessToken; Response response = RestAssured .given() .header(\"Authorization\", String.format(\"Bearer %s\", accessToken)) .get(USER_INFO_URL); assertThat(response .jsonPath() .getString(\"preferred_username\")).isEqualTo(USERNAME); }", "tokens": 80} {"id": 64630, "source": "method", "repo": "baeldung/spring-security-oauth", "text": "public CustomUserStorageProvider create(KeycloakSession ksession, ComponentModel model) { log.info(\"[I63] creating new CustomUserStorageProvider\"); return new CustomUserStorageProvider(ksession,model); }", "tokens": 45} {"id": 64677, "source": "method", "repo": "baeldung/spring-security-oauth", "text": "public String secured() { return \"Hello, logged in user!\"; }", "tokens": 16} {"id": 65078, "source": "method", "repo": "baidu-security/openrasp-testcases", "text": "public InternalResourceViewResolver getInternalResourceViewResolver() { InternalResourceViewResolver resolver = new InternalResourceViewResolver(); resolver.setPrefix(\"/tmp/\"); resolver.setSuffix(\".jsp\"); return resolver; }", "tokens": 45} {"id": 65081, "source": "method", "repo": "baidu-security/openrasp-testcases", "text": "public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { registry.addHandler(new WebSocketHandler(), \"/ws\"); }", "tokens": 26} {"id": 65287, "source": "method", "repo": "bantanger/im-whale-shark", "text": "public int doAddGroupMember(Long groupId, String toId) { ImFriendShipGroupMemberEntity imFriendShipGroupMemberEntity = new ImFriendShipGroupMemberEntity(); imFriendShipGroupMemberEntity.setGroupId(groupId); imFriendShipGroupMemberEntity.setToId(toId); try { int insert = imFriendShipGroupMemberMapper.insert(imFriendShipGroupMemberEntity); return insert; } catch (Exception e) { e.printStackTrace(); return 0; } }", "tokens": 89} {"id": 65371, "source": "method", "repo": "bantanger/im-whale-shark", "text": "public void sendToUserExceptClient(String toId, Command command, Object data, ClientInfo clientInfo) { List userSession = userSessionService.getUserSession(clientInfo.getAppId(), toId); userSession.stream() .filter(session -> !isMatch(session, clientInfo)) .forEach(session -> sendMessage(toId, command, data, session)); }", "tokens": 86} {"id": 65401, "source": "method", "repo": "bantanger/im-whale-shark", "text": "public static boolean isBind(Channel channel) { UserClientDto userInfo = getUserInfo(channel); return !ObjectUtils.isEmpty(userInfo) && !ObjectUtils.isEmpty(USER_CHANNEL.get(userInfo)); }", "tokens": 44} {"id": 65697, "source": "method", "repo": "Bawnorton/MixinSquared", "text": "public AdjustableModifyVariableNode withOrder(UnaryOperator order) { return (AdjustableModifyVariableNode) super.withOrder(order); }", "tokens": 30} {"id": 65736, "source": "method", "repo": "Bawnorton/MixinSquared", "text": "public AdjustableWrapMethodNode withExpect(UnaryOperator expect) { return (AdjustableWrapMethodNode) MatchCountAnnotationNode.super.withExpect(expect); }", "tokens": 34} {"id": 65965, "source": "method", "repo": "bcgit/bc-java", "text": "public boolean isAlphabetic() { return obj instanceof ASN1PrintableString; }", "tokens": 16} {"id": 66005, "source": "method", "repo": "bcgit/bc-java", "text": "protected int decryptBlock(byte[] inBuf, int inOff, int length, byte[] outBuf, int outOff) { byte[] dec; if (fpeParameters.getRadix() > 256) { dec = toByteArray(SP80038G.decryptFF3_1w(baseCipher, fpeParameters.getRadixConverter(), fpeParameters.getTweak(), toShortArray(inBuf), inOff, length / 2)); } else { dec = SP80038G.decryptFF3_1(baseCipher, fpeParameters.getRadixConverter(), fpeParameters.getTweak(), inBuf, inOff, length); } System.arraycopy(dec, 0, outBuf, outOff, length); return length; }", "tokens": 168} {"id": 66181, "source": "method", "repo": "bcgit/bc-java", "text": "public int getMaxDecodedLength(int inputLength) { return inputLength / 8 * 5; }", "tokens": 23} {"id": 66253, "source": "method", "repo": "bcgit/bc-java", "text": "/** The same G1 point in the hybrid form 0x06 / 0x07 || x || y, whose prefix repeats y's parity - the general point decoder checks the two agree, so the prefix follows y. */ private static byte[] toHybrid(byte[] uncompressed) { byte[] hybrid = Arrays.clone(uncompressed); hybrid[0] = (byte)(((uncompressed[uncompressed.length - 1] & 1) == 0) ? 0x06 : 0x07); return hybrid; }", "tokens": 126} {"id": 66480, "source": "method", "repo": "bcgit/bc-java", "text": "private SampleCredentials(KeyPair keyPair, X509Certificate certificate) { this.keyPair = keyPair; this.certificate = certificate; }", "tokens": 29} {"id": 66646, "source": "method", "repo": "bcgit/bc-java", "text": "public boolean hasFriendlyName() { return attrCarrier.hasFriendlyName(); }", "tokens": 15} {"id": 66951, "source": "method", "repo": "beehive-lab/GPULlama3.java", "text": "/** Records which path this session took, and the exact combination [D-7].

Reported here, in the one factory every caller reaches, for the same reason the lowering opt-in is consulted here: it was branched at two sites once, and the CLI, the server and the benchmark script all silently ran the legacy path however the flag was set. A report emitted anywhere else would have the same hole. */ private static void reportPath( org.beehive.jitllm.runtime.backend.ExecutionPath path, org.beehive.jitllm.model.Model model, org.beehive.jitllm.inference.state.State state) { var combination = org.beehive.jitllm.backend.tornado.lowering.LoweredPlanSelection.combinationOf( model, state); boolean qualified = org.beehive.jitllm.backend.tornado.lowering.LoweringQualification.isQualified( combination.architecture(), combination.dtype(), combination.mode()); org.beehive.jitllm.auxiliary.RunMetrics.setExecutionPath( path.reportName(), combination.toString(), qualified, org.beehive.jitllm.backend.tornado.lowering.LoweredPlanSelection.mode() .name() .toLowerCase(java.util.Locale.ROOT)); }", "tokens": 272} {"id": 67076, "source": "method", "repo": "beehive-lab/GPULlama3.java", "text": "/** Slices the grouped decode attention is launched with for a layer: the whole window for a sliding layer, the whole context for a full one. Idle slices return at once. */ private int decodeSlices(boolean isSwa) { int span = isSwa ? Math.min(config.slidingWindowSize(), config.contextLength()) : config.contextLength(); return Gemma4AttentionKernels.decodeSlices(span); }", "tokens": 97} {"id": 67344, "source": "method", "repo": "beehive-lab/GPULlama3.java", "text": "public int hashCode() { return Objects.hash(backend, handle); }", "tokens": 16} {"id": 67472, "source": "method", "repo": "beehive-lab/GPULlama3.java", "text": "public void anExplicitBackendIsCarried() { ModelOptions options = ModelOptions.builder().backend(BackendId.CPU).build(); assertEquals(BackendId.CPU, options.backend()); }", "tokens": 41} {"id": 67489, "source": "method", "repo": "beehive-lab/GPULlama3.java", "text": "/** No tools supplied means no extraction is attempted, whatever the text looks like. */ public void withoutToolsThereAreNeverToolCalls() throws Exception { withModel( model -> { try (GenerationSession session = model.newSession()) { GenerationResult result = session.generate( GenerationRequest.builder() .messages( List.of( ChatMessage.of( ChatRole.USER, \"Reply with exactly this text: {\\\"name\\\": \\\"x\\\", \\\"arguments\\\": {}}\"))) .maxNewTokens(32) .temperature(0.0f) .seed(7L) .build()); assertTrue( \"tool-shaped text in a request with no tools is text\", result.toolCalls().isEmpty()); assertNotEquals(FinishReason.TOOL_CALL, result.finishReason()); } }); }", "tokens": 168} {"id": 67494, "source": "method", "repo": "beehive-lab/GPULlama3.java", "text": "static Map scenario(String name) throws IOException { Map scenario = (Map) ((Map) data().get(\"scenarios\")).get(name); return scenario; }", "tokens": 56} {"id": 67725, "source": "method", "repo": "beehive-lab/GPULlama3.java", "text": "private static Qwen2MoEStandardWeights syntheticWeights(Random random) { int kvDim = DIM * KV_HEADS / HEADS; int headSize = DIM / HEADS; return new Qwen2MoEStandardWeights( tensor(random, VOCAB * DIM), tensors(random, LAYERS, DIM), tensors(random, LAYERS, DIM * DIM), tensors(random, LAYERS, kvDim * DIM), tensors(random, LAYERS, kvDim * DIM), tensors(random, LAYERS, DIM), tensors(random, LAYERS, kvDim), tensors(random, LAYERS, kvDim), tensors(random, LAYERS, DIM * DIM), tensors(random, LAYERS, DIM), tensors(random, LAYERS, HIDDEN_DIM * DIM), tensors(random, LAYERS, DIM * HIDDEN_DIM), tensors(random, LAYERS, HIDDEN_DIM * DIM), tensors(random, LAYERS, EXPERTS * DIM), tensors(random, LAYERS, EXPERTS * MOE_HIDDEN * DIM), tensors(random, LAYERS, EXPERTS * MOE_HIDDEN * DIM), tensors(random, LAYERS, EXPERTS * DIM * MOE_HIDDEN), tensors(random, LAYERS, SHARED_HIDDEN * DIM), tensors(random, LAYERS, SHARED_HIDDEN * DIM), tensors(random, LAYERS, DIM * SHARED_HIDDEN), tensors(random, LAYERS, DIM), tensor(random, DIM), arrayTensor(random, CONTEXT * (headSize / 2)), arrayTensor(random, CONTEXT * (headSize / 2)), tensor(random, VOCAB * DIM), DataType.F32); }", "tokens": 438} {"id": 67864, "source": "method", "repo": "beehive-lab/jitllm", "text": "/** Materializes {@code out = weight * (rmsScale[0] * x)} -- i.e. RMSNorm with a learned scale, written to a separate buffer. */ public static void applyRmsNorm( KernelContext context, FloatArray out, FloatArray x, FloatArray weight, FloatArray rmsScale, int size) { int gid = context.globalIdx; if (gid < size) { float scale = rmsScale.get(0); out.set(gid, weight.get(gid) * (scale * x.get(gid))); } }", "tokens": 123} {"id": 67952, "source": "method", "repo": "beehive-lab/jitllm", "text": "/** Whether this backend can run the triple. */ public static boolean supports(ArchitectureId id, DataType weights, ExecutionMode mode) { return supports(Index.BY_ID, id, weights, mode); }", "tokens": 45} {"id": 68042, "source": "method", "repo": "beehive-lab/jitllm", "text": "private static ProgramComponent leaf( String name, org.beehive.jitllm.program.op.Operation operation) { return new ProgramComponent.Leaf(name, operation, BOTH); }", "tokens": 38} {"id": 68137, "source": "method", "repo": "beehive-lab/jitllm", "text": "public OperationKind kind() { return OperationKind.VOCAB_PROJECTION; }", "tokens": 18} {"id": 68163, "source": "method", "repo": "beehive-lab/jitllm", "text": "public static String str(Map m, String k, String def) { Object v = m.get(k); return v instanceof String s ? s : def; }", "tokens": 43} {"id": 68204, "source": "method", "repo": "beehive-lab/jitllm", "text": "public void toolIdentifiersAndPayloadsAreValidated() { assertThrows( IllegalArgumentException.class, () -> new ChatContent.ToolCall(\" \", \"clock\", \"{}\")); assertThrows( IllegalArgumentException.class, () -> new ChatContent.ToolCall(\"id\", \"\", \"{}\")); assertThrows( IllegalArgumentException.class, () -> new ChatContent.ToolCall(\"id\", \"clock\", null)); assertThrows( IllegalArgumentException.class, () -> new ChatContent.ToolResult(null, \"clock\", \"{}\")); assertThrows( IllegalArgumentException.class, () -> new ChatContent.ToolResult(\"id\", \"clock\", null)); assertThrows(IllegalArgumentException.class, () -> new ToolSpec(\" \", \"d\", \"{}\")); }", "tokens": 146} {"id": 68609, "source": "method", "repo": "bennidi/mbassador", "text": "public PublicationError(final Throwable cause, final String errorMsg, final SubscriptionContext context) { this.cause = cause; this.errorMsg = errorMsg; this.handler = context.getHandler().getMethod(); }", "tokens": 43} {"id": 68719, "source": "method", "repo": "bennidi/mbassador", "text": "public boolean addHandler(MessageHandler messageHandler) { return handlers.add(messageHandler); }", "tokens": 20} {"id": 68734, "source": "method", "repo": "bennidi/mbassador", "text": "private List> analyzeClasses(Set classNames) { List> matches = new ArrayList<>(); for (String className : classNames) { try { // Read bytes via ClassLoader - works for both file system and JARs byte[] classBytes = readClassBytes(className); if (classBytes == null) continue; ClassModel classModel = ClassFile.of().parse(classBytes); // Check if any method has the @Handler annotation boolean hasHandler = classModel.methods().stream() .anyMatch(method -> hasAnnotation(method, HANDLER_DESC)); if (hasHandler) { // Only load the class into the JVM if it actually has handlers matches.add(Class.forName(className)); } } catch (Throwable e) { // Ignore classes that cannot be loaded or parsed (e.g., missing dependencies) // System.err.println(\"Skipping \" + className + \": \" + e.getMessage()); } } return matches; }", "tokens": 203} {"id": 68833, "source": "method", "repo": "bennidi/mbassador", "text": "public void handle(PriorityTestMessage message) { message.executionOrder.add(\"High\"); }", "tokens": 21} {"id": 68882, "source": "method", "repo": "bennidi/mbassador", "text": "public void fromInterface(String message) { }", "tokens": 11} {"id": 68885, "source": "method", "repo": "bennidi/mbassador", "text": "public void handleTriple(String message) { }", "tokens": 11} {"id": 68922, "source": "method", "repo": "bennidi/mbassador", "text": "protected GenericMessagePublicationSupport getSyncMessageBus(boolean failOnException, IPublicationErrorHandler errorHandler) { IBusConfiguration asyncFIFOConfig = new BusConfiguration().addPublicationErrorHandler(new AssertionErrorHandler(failOnException)); asyncFIFOConfig.addFeature(Feature.SyncPubSub.Default()); asyncFIFOConfig.addFeature(Feature.AsynchronousHandlerInvocation.Default(1, 1)); asyncFIFOConfig.addFeature(Feature.AsynchronousMessageDispatch.Default().setNumberOfMessageDispatchers(1)); if (errorHandler != null) { asyncFIFOConfig.addPublicationErrorHandler(errorHandler); } return new MBassador(asyncFIFOConfig); }", "tokens": 134} {"id": 69108, "source": "method", "repo": "bergerhealer/traincarts", "text": "public void forAllViewers(Consumer action) { viewers.forEach(action); }", "tokens": 26} {"id": 69512, "source": "method", "repo": "bergerhealer/traincarts", "text": "/** Finds the segment of this rail path that is used at the relative position specified @param position (relative to rails block) @return segment, null if this rail path has no segments */ public Segment findSegment(Vector position) { if (this.segments.length == 0) { return null; } else if (this.segments.length == 1) { return this.segments[0]; } else { // Find the start segment closest to the position Segment s = null; { double closestDistance = Double.MAX_VALUE; for (int i = 0; i < this.segments.length; i++) { Segment tmpSegment = this.segments[i]; if (tmpSegment.isZeroLength()) continue; double tmpTheta = tmpSegment.calcTheta(position); double tmpDistSquared = tmpSegment.calcDistanceSquared(position, tmpTheta); if (tmpDistSquared < closestDistance) { closestDistance = tmpDistSquared; s = tmpSegment; } } } return s; } }", "tokens": 217} {"id": 69520, "source": "method", "repo": "bergerhealer/traincarts", "text": "/** Calculates the squared distance between an arbitrary point and this segment. @param position relative to the rails @return distance squared */ public final double calcDistanceSquared(Vector position) { return calcDistanceSquared(position, calcTheta(position)); }", "tokens": 53} {"id": 69619, "source": "method", "repo": "bergerhealer/traincarts", "text": "public double forwardSteerInput() { return forward; }", "tokens": 12} {"id": 69759, "source": "method", "repo": "bergerhealer/traincarts", "text": "/** Gets whether the slow down options are set to a default, where all slowdown modes are active. @return True if all modes are active (legacy slowdown = true set) */ public boolean isSlowingDownAll() { return get(StandardProperties.SLOWDOWN).equals(EnumSet.allOf(SlowdownMode.class)); }", "tokens": 71} {"id": 70054, "source": "method", "repo": "bernie-g/geckolib", "text": "public void stopTriggeredAnimation(@Nullable String animName) { for (AnimationController controller : getAnimationControllers().values()) { if ((animName == null || controller.isTriggeredAnimation(animName)) && controller.stopTriggeredAnimation()) return; } }", "tokens": 56} {"id": 70058, "source": "method", "repo": "bernie-g/geckolib", "text": "public ControllerRegistrar add(AnimationController controller) { controllers().add(controller); return this; }", "tokens": 24} {"id": 70086, "source": "method", "repo": "bernie-g/geckolib", "text": "public boolean isAnimatingBones() { return this.animationPoint != null && this.timeline != null && this.timelineTime >= 0; }", "tokens": 33} {"id": 70118, "source": "method", "repo": "bernie-g/geckolib", "text": "default double apply(EasingState easingState, ControllerState controllerState) { if (easingState.delta() >= 1) return easingState.toValue(); return Mth.lerp(buildTransformer(easingState.getFirstEasingArg(controllerState)).apply(easingState.delta()), easingState.fromValue(), easingState.toValue()); }", "tokens": 76} {"id": 70142, "source": "method", "repo": "bernie-g/geckolib", "text": "private static void findKeyframePoints(KeyframeStack keyframeStack, int[] axisPoints, double animTime, boolean reverse) { if (reverse) { axisPoints[Axis.X.index] = findKeyframePointReverse(keyframeStack.xKeyframes(), animTime, axisPoints[Axis.X.index]); axisPoints[Axis.Y.index] = findKeyframePointReverse(keyframeStack.yKeyframes(), animTime, axisPoints[Axis.Y.index]); axisPoints[Axis.Z.index] = findKeyframePointReverse(keyframeStack.zKeyframes(), animTime, axisPoints[Axis.Z.index]); } else { axisPoints[Axis.X.index] = findKeyframePointForward(keyframeStack.xKeyframes(), animTime, axisPoints[Axis.X.index]); axisPoints[Axis.Y.index] = findKeyframePointForward(keyframeStack.yKeyframes(), animTime, axisPoints[Axis.Y.index]); axisPoints[Axis.Z.index] = findKeyframePointForward(keyframeStack.zKeyframes(), animTime, axisPoints[Axis.Z.index]); } }", "tokens": 246} {"id": 70186, "source": "method", "repo": "bernie-g/geckolib", "text": "public int size() { return this.cache.size(); }", "tokens": 14} {"id": 70399, "source": "method", "repo": "bernie-g/geckolib", "text": "public double compute(@Nullable ControllerState controllerState) { return Math.exp((float)this.value.get(controllerState)); }", "tokens": 31} {"id": 70606, "source": "method", "repo": "bernie-g/geckolib", "text": "default @Nullable D getOrDefaultGeckolibData(DataTicket dataTicket, @Nullable D defaultValue) { D data = getGeckolibData(dataTicket); if (data != null) return data; if (dataTicket instanceof OverridingDataTicket overridingTicket && overridingTicket.canExtractFrom(this)) return (D)overridingTicket.extractFrom(overridingTicket.getOverriddenClass().cast(this)); return defaultValue; }", "tokens": 98} {"id": 70830, "source": "method", "repo": "bernie-g/geckolib", "text": "public void fireCompileItemRenderState(GeoItemRenderer renderer, R renderState, T animatable, O renderData) { NeoForge.EVENT_BUS.post(new CompileItemRenderStateEvent<>(renderer, renderState, animatable, renderData)); }", "tokens": 73} {"id": 70985, "source": "method", "repo": "binance/binance-connector-java", "text": "public MarketApi getMarketApi() { if (marketApi == null) { WebSocketClientConfiguration configuration = (WebSocketClientConfiguration) clientConfiguration.clone(); if (configuration.getUrl().endsWith(\"/stream\") && !configuration.getUrl().endsWith(\"/market/stream\")) { configuration.setUrl(configuration.getUrl().replace(\"/stream\", \"/market/stream\")); } marketApi = new MarketApi(configuration); } return marketApi; }", "tokens": 87} {"id": 71001, "source": "method", "repo": "binance/binance-connector-java", "text": "/** Get UM Futures Trade Download Link by Id (USER_DATA) Get UM futures trade download link by Id Weight(IP): 10 Security Type: USER_DATA Notes: - Download link expiration: 7 days @param downloadId get by download id api (required) @param recvWindow (optional) @return ApiResponse<GetUmFuturesTradeDownloadLinkByIdResponse> @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @http.response.details
Response Details
Status Code Description Response Headers
200 Get UM Futures Trade Download Link by Id -
@see Get UM Futures Trade Download Link by Id (USER_DATA) Documentation */ public ApiResponse getUmFuturesTradeDownloadLinkById( String downloadId, Long recvWindow) throws ApiException { return accountApi.getUmFuturesTradeDownloadLinkById(downloadId, recvWindow); }", "tokens": 319} {"id": 71070, "source": "method", "repo": "binance/binance-connector-java", "text": "/** Get All Cross Margin Pairs (MARKET_DATA) Get All Cross Margin Pairs Weight(IP): 1 Security Type: MARKET_DATA @param symbol (optional) @return ApiResponse<GetAllCrossMarginPairsResponse> @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @http.response.details
Response Details
Status Code Description Response Headers
200 Get All Cross Margin Pairs -
@see Get All Cross Margin Pairs (MARKET_DATA) Documentation */ public ApiResponse getAllCrossMarginPairs(String symbol) throws ApiException { return marketDataApi.getAllCrossMarginPairs(symbol); }", "tokens": 262} {"id": 71096, "source": "method", "repo": "binance/binance-connector-java", "text": "/** Get Locked Product Position (USER_DATA) Get Locked Product Position Weight(IP): 150 Security Type: USER_DATA @param asset (optional) @param positionId (optional) @param projectId (optional) @param current Currently querying page. Starts from 1. (optional) @param size Number of results per page. (optional) @param recvWindow The value cannot be greater than 60000 (ms) (optional) @return ApiResponse<GetLockedProductPositionResponse> @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @http.response.details
Response Details
Status Code Description Response Headers
200 Get Locked Product Position -
@see Get Locked Product Position (USER_DATA) Documentation */ public ApiResponse getLockedProductPosition( String asset, String positionId, String projectId, Long current, Long size, Long recvWindow) throws ApiException { return flexibleLockedApi.getLockedProductPosition( asset, positionId, projectId, current, size, recvWindow); }", "tokens": 339} {"id": 71424, "source": "method", "repo": "binance/binance-connector-java", "text": "/** Current average price

Get current average price for a symbol. Weight(IP): 2 Security Type: NONE Notes: **Data Source:** Memory */ public void avgPriceExampleAsync() { AvgPriceRequest avgPriceRequest = new AvgPriceRequest(); avgPriceRequest.symbol(\"BNBUSDT\"); CompletableFuture future = getApi().avgPrice(avgPriceRequest); future.handle( (response, error) -> { if (error != null) { System.err.println(error); } System.out.println(response); return response; }); }", "tokens": 126} {"id": 71446, "source": "method", "repo": "binance/binance-connector-java", "text": "/** ETH Staking account (USER_DATA)

ETH Staking account Weight(IP): 150 Security Type: USER_DATA @throws ApiException if the Api call fails */ public void ethStakingAccountExample() throws ApiException, IOException { Long recvWindow = 5000L; ApiResponse response = getApi().ethStakingAccount(recvWindow); System.out.println(response.getData()); }", "tokens": 98} {"id": 71491, "source": "method", "repo": "binance/binance-connector-java", "text": "/** List Prediction Markets

Get a paginated list of prediction market topics, with optional category and sort filters. Weight(IP): 1 @throws ApiException if the Api call fails */ public void listPredictionMarketsExample() throws ApiException, IOException { String l1Category = \"crypto\"; String l2Category = \"up-down\"; SortBy sortBy = SortBy.RECOMMENDED; OrderBy orderBy = OrderBy.ASC; Integer offset = 0; Integer limit = 20; ApiResponse response = getApi().listPredictionMarkets( l1Category, l2Category, sortBy, orderBy, offset, limit); System.out.println(response.getData()); }", "tokens": 153} {"id": 71592, "source": "method", "repo": "bindambc/whatsapp-business-java-api", "text": "/** Gets name. @return the name */ public Name getName() { return name; }", "tokens": 20} {"id": 71667, "source": "method", "repo": "bindambc/whatsapp-business-java-api", "text": "/** Build interactive action. @return the interactive action */ public static IInteractiveAction build() { return new InteractiveMessage(); }", "tokens": 27} {"id": 71722, "source": "method", "repo": "bindambc/whatsapp-business-java-api", "text": "/** Sets company. @param company Optional. Name of the contact's company. @return the company */ public Org setCompany(String company) { this.company = company; return this; }", "tokens": 44} {"id": 71757, "source": "method", "repo": "bindambc/whatsapp-business-java-api", "text": "/** Is preview url boolean. @return the boolean */ public boolean isPreviewUrl() { return previewUrl; }", "tokens": 24} {"id": 71803, "source": "method", "repo": "bindambc/whatsapp-business-java-api", "text": "/** Instantiates a new Quick reply button. @param text the text */ public QuickReplyButton(String text) { super(ButtonType.QUICK_REPLY, text); }", "tokens": 36} {"id": 71811, "source": "method", "repo": "bindambc/whatsapp-business-java-api", "text": "Category(String value) { this.value = value; }", "tokens": 14} {"id": 72013, "source": "method", "repo": "bindambc/whatsapp-business-java-api", "text": "/** Method under test: {@link Formatter#italic(String)} */ void testItalic() { assertEquals(\"_Text_\", Formatter.italic(\"Text\")); assertNull(Formatter.italic(null)); assertEquals(\" \", Formatter.italic(\" \")); assertEquals(\"\", Formatter.italic(\"\")); }", "tokens": 62} {"id": 72102, "source": "method", "repo": "bit4woo/knife", "text": "private static boolean isSameOrigin(String url, String referHost, String currentHost) { String host = UrlUtils.getHost(url); return host.equalsIgnoreCase(referHost) || host.equalsIgnoreCase(currentHost); }", "tokens": 49} {"id": 72129, "source": "method", "repo": "bit4woo/knife", "text": "public static boolean isInCheckBoxScope(int toolFlag, IHttpRequestResponse messageInfo) { if (toolFlag == (toolFlag & configManager.getEnableStatus())) { IExtensionHelpers helpers = getCallbacks().getHelpers(); URL url = new HelperPlus(helpers).getFullURL(messageInfo); if (!configManager.isOnlyForScope() || callbacks.isInScope(url)) { return true; } } return false; }", "tokens": 93} {"id": 72211, "source": "method", "repo": "bit4woo/knife", "text": "public boolean isAllBlank() { return StringUtils.isAllBlank(sameSiteCookie,sameRootDomainCookie,samePathCookie); }", "tokens": 29} {"id": 72323, "source": "method", "repo": "bit4woo/knife", "text": "public void removeInfoEntry(InfoEntry lineEntry) { synchronized (infoEntries) { int index = infoEntries.indexOf(lineEntry); if (index != -1) { infoEntries.remove(lineEntry); fireTableRowsDeleted(index, index); } } }", "tokens": 58} {"id": 72680, "source": "method", "repo": "bitwig/bitwig-extensions", "text": "public void bindParameterValue(final int index, final DoubleValue value, final ObjectProxy existSource, final String nonExistText, final DoubleValueConverter converter) { bindExists(index, existSource, nonExistText); value.addValueObserver(v -> { bottomRow.getCell(index).lastValue = converter.convert(v); if (isActive() && !bottomRow.isFullTextMode()) { display.sendToRow(this, 1, index, bottomRow.getCell(index).getDisplayValue()); } }); bottomRow.getCell(index).lastValue = converter.convert(value.get()); }", "tokens": 131} {"id": 72764, "source": "method", "repo": "bitwig/bitwig-extensions", "text": "private InternalHardwareLightState getRgbState(Track track, ClipLauncherSlot slot, int trackIndex, int sceneIndex) { if (slot.hasContent().get()) { int buttonIndex = sceneIndex * numberOfTracks + trackIndex; RgbColor color = slotColors[buttonIndex]; if (slot.isRecordingQueued().get()) { return RgbColor.RED.getBlink(); } else if (slot.isRecording().get()) { return RgbColor.RED.getBlink(); } else if (slot.isPlaybackQueued().get()) { return color.getBlink(); } else if (slot.isStopQueued().get()) { return color.getBlink(); //RgbState.flash(color, 1); } else if (slot.isPlaying().get() && track.isQueuedForStop().get()) { return RgbColor.GREEN.getBlink(); } else if (slot.isPlaying().get()) { if (track.arm().get() && overdubEnabled) { return RgbColor.RED.getBlink(); } return RgbColor.GREEN; } return color; } if (slot.isRecordingQueued().get()) { return RgbColor.RED.getBlink(); } else if (track.arm().get()) { return RgbColor.RED; } else if (slot.isStopQueued().get()) { return RgbColor.WHITE.getBlink(); } return RgbColor.OFF; }", "tokens": 305} {"id": 72930, "source": "method", "repo": "bitwig/bitwig-extensions", "text": "void bindShift(final PadButton button) { shiftLayer.bindPressed(button, () -> driver.handleShiftAction(button.getIndex())); }", "tokens": 34} {"id": 73028, "source": "method", "repo": "bitwig/bitwig-extensions", "text": "public RgbCcButton getModeRow2Button() { return modeRow2Button; }", "tokens": 21} {"id": 73155, "source": "method", "repo": "bitwig/bitwig-extensions", "text": "public void bindLightOnPressed(final Layer layer, final SlRgbState color) { final SlRgbState onColor = color; final SlRgbState offColor = color.reduced(25); layer.bindLightState(() -> hwButton.isPressed().get() ? onColor : offColor, light); }", "tokens": 74} {"id": 73241, "source": "method", "repo": "bitwig/bitwig-extensions", "text": "private void handleMeterLeft(final int value) { if (meteringActive && value != meterLeft) { meterLeft = value; control.sendMeterJson(trackId, meterLeft, meterRight); } }", "tokens": 50} {"id": 73359, "source": "method", "repo": "bkiers/liqp", "text": "protected TemplateContext(Map variables, TemplateContext parent) { this(parent); this.variables = variables; }", "tokens": 29} {"id": 73413, "source": "method", "repo": "bkiers/liqp", "text": "public CharStreamWithLocation(CharStream in) throws IOException { super(in); this.path = NameResolver.getLocationFromCharStream(in); }", "tokens": 35} {"id": 73626, "source": "method", "repo": "bkiers/liqp", "text": "public LNode visitOther_tag(Other_tagContext ctx) { String blockId = ctx.BlockId().getText(); List expressions = new ArrayList(); if (ctx.other_tag_parameters() != null) { expressions.add(new AtomNode(ctx.other_tag_parameters().getText())); } BlockNode node = new BlockNode(isRootBlock); for (AtomContext child : ctx.atom()) { node.add(visit(child)); } Insertion insertion = insertions.get(blockId); if (insertion == null) { throw new RuntimeException(\"The tag/block '\" + blockId + \"' is not registered.\"); } expressions.add(node); return new InsertionNode(insertion, expressions.toArray(new LNode[expressions.size()])); }", "tokens": 173} {"id": 73950, "source": "method", "repo": "bkiers/liqp", "text": "public void threeParamsThrowsException() { TemplateParser.DEFAULT.parse(\"{{ 'mu' | slice: 1, 2, 3 }}\").render(); }", "tokens": 34} {"id": 73967, "source": "method", "repo": "bkiers/liqp", "text": "public void applyOriginalTest() { assertThat(TemplateParser.DEFAULT.parse(\"{{ source | strip_newlines }}\").render(\"source\", \"a\\nb\\nc\"), is((Object)\"abc\")); }", "tokens": 47} {"id": 74079, "source": "method", "repo": "bkiers/liqp", "text": "public void raise_on_single_close_bracetTest() throws Exception { TemplateParser.DEFAULT.parse(\"text {{method} oh nos!\"); }", "tokens": 34} {"id": 74081, "source": "method", "repo": "bkiers/liqp", "text": "public void raise_on_label_and_no_close_bracets_percentTest() throws Exception { TemplateParser.DEFAULT.parse(\"TEST {% \"); }", "tokens": 37} {"id": 74245, "source": "method", "repo": "blackdread/canon-sdk-java", "text": "/** Check live view status only @return command @see org.blackdread.cameraframework.api.helper.logic.LiveViewLogic#isLiveViewEnabled(EdsCameraRef) */ public LiveViewCommand.IsLiveViewEnabled isLiveViewEnabledAsync() { return dispatchCommand(new LiveViewCommand.IsLiveViewEnabled()); }", "tokens": 64} {"id": 74333, "source": "method", "repo": "blackdread/canon-sdk-java", "text": "protected EdsWhiteBalance runInternal() { switch (getTargetRefType()) { case CAMERA: return propertyGetShortcutLogic().getEvfWhiteBalance((EdsdkLibrary.EdsCameraRef) getTargetRefInternal()); default: throw new UnsupportedTargetTypeException(getTargetRefType()); } }", "tokens": 52} {"id": 74361, "source": "method", "repo": "blackdread/canon-sdk-java", "text": "public ShutterSpeedDesc(final ShutterSpeedDesc toCopy) { super(toCopy); }", "tokens": 24} {"id": 74483, "source": "method", "repo": "blackdread/canon-sdk-java", "text": "/** Returned set may be empty @return supported target ref type for property */ public final Set getSupportedTargetRefType() { return supportedTargetRefTypes; }", "tokens": 39} {"id": 74520, "source": "method", "repo": "blackdread/canon-sdk-java", "text": "/** Shortcut for {@link CanonFactory#getPropertyDescLogic()}

 {@code CanonFactory.getCanonFactory().getPropertyDescLogic() } 
@return logic instance, never null */ public static PropertyDescLogic propertyDescLogic() { return CanonFactory.getCanonFactory().getPropertyDescLogic(); }", "tokens": 63} {"id": 74759, "source": "method", "repo": "blackdread/canon-sdk-java", "text": "public static void assertIsWindows() { Assertions.assertTrue(Platform.isWindows(), \"Platform is not windows\"); }", "tokens": 24} {"id": 75023, "source": "method", "repo": "blackdread/canon-sdk-java", "text": "void getPictureStyle1() { final EdsPictureStyle expectedResult = EdsPictureStyle.kEdsPictureStyle_Faithful; mockGetProperty(fakeImage, EdsPropertyID.kEdsPropID_PictureStyle, (long) expectedResult.value()); final EdsPictureStyle result = spyPropertyGetShortcutLogic.getPictureStyle(fakeImage); Assertions.assertNotNull(result); Assertions.assertEquals(expectedResult, result); }", "tokens": 82} {"id": 75034, "source": "method", "repo": "blackdread/canon-sdk-java", "text": "void getGPSTimeStampAsRational() { final EdsRational[] expectedResult = new EdsRational[0]; mockGetProperty(fakeImage, EdsPropertyID.kEdsPropID_GPSTimeStamp, expectedResult); final EdsRational[] result = spyPropertyGetShortcutLogic.getGPSTimeStampAsRational(fakeImage); Assertions.assertEquals(expectedResult, result); }", "tokens": 66} {"id": 75130, "source": "method", "repo": "blackdread/sql-to-jdl", "text": "public List getIgnoredTableNames() { return ignoredTableNames; }", "tokens": 18} {"id": 75175, "source": "method", "repo": "blackdread/sql-to-jdl", "text": "public boolean isInverseSideRequired() { return inverseSideRequired; }", "tokens": 15} {"id": 75327, "source": "method", "repo": "blackdread/sql-to-jdl", "text": "default String validationMin(final int min) { return \"min(\" + min + \")\"; }", "tokens": 20} {"id": 75335, "source": "method", "repo": "blackdread/sql-to-jdl", "text": "default String getInverseDocComment() { return getDocComment(getInverseSideComment().orElse(null)); }", "tokens": 24} {"id": 75664, "source": "method", "repo": "blakebr0/mysticalagriculture", "text": "public boolean render(BlockOutlineRenderState renderState, MultiBufferSource.BufferSource buffer, PoseStack poseStack, boolean translucentPass, LevelRenderState levelRenderState) { float red = player.isCrouching() ? 1.0F : 0.0F; float green = player.isCrouching() ? 0.5F : 1.0F; float blue = 0.0F; float alpha = 0.7F; var direction = player.isCrouching() ? Direction.UP : hitResult.getDirection(); var vertexConsumer = buffer.getBuffer(RenderTypes.lines()); var camPos = levelRenderState.cameraRenderState.pos; var width = Minecraft.getInstance().gameRenderer.getGameRenderState().windowRenderState.appropriateLineWidth; AOEAugment.getAOEBlocks(stack, range, hitResult.getBlockPos(), direction, player).forEach(aoePos -> { var state = player.level().getBlockState(aoePos); if (state.isAir()) return; ShapeRenderer.renderShape(poseStack, vertexConsumer, Shapes.block(), aoePos.getX() - camPos.x, aoePos.getY() - camPos.y, aoePos.getZ() - camPos.z, ARGB.colorFromFloat(alpha, red, green, blue), width); }); return true; }", "tokens": 275} {"id": 75751, "source": "method", "repo": "blakebr0/mysticalagriculture", "text": "public IRecipeType> getRecipeType() { return RECIPE_TYPE; }", "tokens": 24} {"id": 75900, "source": "method", "repo": "blakebr0/mysticalagriculture", "text": "private static DeferredHolder register(String name, Function block) { return register(name, block, b -> id -> new BaseBlockItem(id, b.get())); }", "tokens": 48} {"id": 75945, "source": "method", "repo": "blakebr0/mysticalagriculture", "text": "public void inventoryTick(ItemStack stack, ServerLevel level, Entity entity, EquipmentSlot slot) { var augments = AugmentUtils.getAugments(stack); if (slot == EquipmentSlot.FEET && entity instanceof Player player) { for (var augment : augments) { augment.onArmorTick(stack, level, player); } } for (var augment : augments) { augment.onInventoryTick(stack, level, entity, slot); } }", "tokens": 96} {"id": 75963, "source": "method", "repo": "blakebr0/mysticalagriculture", "text": "public float getDrawSpeedMulti(ItemStack stack) { return this.drawSpeedMulti; }", "tokens": 20} {"id": 76133, "source": "method", "repo": "blendi-remade/agentcraft", "text": "private boolean hasPortrait(Identifier id) { return PORTRAITS.computeIfAbsent(id.toString(), k -> Minecraft.getInstance().getResourceManager().getResource(id).isPresent()); }", "tokens": 38} {"id": 76389, "source": "method", "repo": "blendi-remade/agentcraft", "text": "private void drawEmpty(GuiGraphicsExtractor g) { Kit.Padding p = Kit.padding(\"panel_paper\"); boolean stale = Foreman.state() == null || Foreman.state().isStale(); boolean caughtUp = status != null && !statusError; String head = caughtUp ? status : stale ? \"Foreman offline\" : \"No decisions waiting\"; String sub; Sent l = last; if (caughtUp && l != null && !l.pending() && l.error() == null && !l.elsewhere()) { sub = \"last: \" + l.id() + \" \u2192 \" + l.label(); } else { sub = stale ? \"decisions show up again once it reconnects\" : \"your team will ask when they need you\"; } // sized to what it says int w = Math.min(width - 24, Math.max(180, Math.max(12 + font.width(head), font.width(sub)) + p.left() + p.right() + 4)); int h = 64; int x = (width - w) / 2; int y = (height - h) / 2; Panels.panel(g, x, y, w, h); Panels.dot(g, stale && !caughtUp ? \"idle\" : \"done\", x + p.left(), y + p.top() + 1, false); g.text(font, head, x + p.left() + 12, y + p.top(), UiBits.ink(), false); g.text(font, TextUtil.ellipsize(font, sub, w - p.left() - p.right()), x + p.left(), y + p.top() + 14, UiBits.muted(), false); UiBits.hints(g, font, x + p.left(), y + h - p.bottom() - 13, false, \"Esc\", \"close\"); }", "tokens": 435} {"id": 76441, "source": "method", "repo": "blendi-remade/agentcraft", "text": "/** A required finite number. */ public double num(String field) { return toDouble(field, required(field)); }", "tokens": 28} {"id": 76474, "source": "method", "repo": "blendi-remade/agentcraft", "text": "private static void end(Minecraft mc, Session s, String error) { session = null; if (mc.gui.hud.isHidden() != s.savedHudHidden) { mc.gui.hud.toggle(); } if (s.holdForeman && Foreman.state().isHeld()) { int held = Foreman.state().releaseHold(s.release.equals(\"replay\")); if (s.release.equals(\"reconnect\")) { Foreman.link().reconnectNow(); } s.warnings.add(\"Foreman hold released (\" + s.release + \"; \" + held + \" live messages were held)\"); } if (error != null) { AgentCraft.LOGGER.warn(\"dev.play '{}' stopped: {}\", s.name, error); s.result.completeExceptionally(new DevException(\"shot '\" + s.name + \"' stopped at t=\" + round(s.poseT, 3) + \": \" + error)); return; } JsonObject summary = summary(mc, s); if (s.writeLog) { try { Path dir = ClientEnv.shotsDir().resolve(\"play\"); Files.createDirectories(dir); Path file = dir.resolve(s.name + \".frames.json\"); Files.writeString(file, DevBridge.GSON.toJson(framesJson(s))); summary.addProperty(\"frameLog\", file.toString()); } catch (Exception e) { s.warnings.add(\"could not write the frame log: \" + e); } } s.result.complete(summary); }", "tokens": 336} {"id": 76512, "source": "method", "repo": "blendi-remade/agentcraft", "text": "/** Snap a scroll offset to whole physical pixels so text stays crisp while it glides. */ private float snap(float v) { int s = Math.max(1, minecraft.getWindow().getGuiScale()); return Math.round(v * s) / (float) s; }", "tokens": 67} {"id": 76516, "source": "method", "repo": "blendi-remade/agentcraft", "text": "private int sideListH() { int n = doc == null ? 0 : doc.files.size(); int full = n * SIDE_ROW_H; int max = bodyY + bodyH - sideListY(); List notes = notes(); if (!notes.isEmpty()) { max -= Math.min(90, 16 + notes.size() * 36); } return Math.max(SIDE_ROW_H * Math.min(n, 2), Math.min(full, max)); }", "tokens": 116} {"id": 76535, "source": "method", "repo": "blendi-remade/agentcraft", "text": "public boolean charTyped(CharacterEvent e) { if (swallowChar) { swallowChar = false; if (e.codepoint() == 'r' || e.codepoint() == 'R') { return true; } } return super.charTyped(e); }", "tokens": 59} {"id": 76557, "source": "method", "repo": "blendi-remade/agentcraft", "text": "public static ForemanState state() { return state; }", "tokens": 13} {"id": 76711, "source": "method", "repo": "blendi-remade/agentcraft", "text": "static MdLayout build(Font font, List blocks, int width, Set taskIds) { MdLayout l = new MdLayout(font, width, taskIds); l.layout(blocks); return l; }", "tokens": 54} {"id": 76803, "source": "method", "repo": "blendi-remade/agentcraft", "text": "/** Width of a slim empty lane: the widest header label with a \"0\" count. */ private static float emptyWidth(Font font) { int w = 0; for (Col c : Col.values()) { w = Math.max(w, font.width(c.label.toUpperCase(Locale.ROOT))); } return Math.max(48, w + font.width(\"0\") + 14); }", "tokens": 96} {"id": 76947, "source": "method", "repo": "blendi-remade/agentcraft", "text": "public ClientboundBlockEntityDataPacket getUpdatePacket() { return ClientboundBlockEntityDataPacket.create(this); }", "tokens": 19} {"id": 77515, "source": "method", "repo": "bloxbean/cardano-client-lib", "text": "private MethodSpec buildFromMetadataMethod(ClassName targetClass, long label) { return MethodSpec.methodBuilder(\"fromMetadata\") .addAnnotation(Override.class) .addModifiers(Modifier.PUBLIC) .returns(targetClass) .addParameter(Metadata.class, \"metadata\") .addStatement(\"$T raw = metadata.get($T.valueOf($LL))\", Object.class, BigInteger.class, label) .beginControlFlow(\"if (raw instanceof $T)\", MetadataMap.class) .addStatement(\"return fromMetadataMap(($T) raw)\", MetadataMap.class) .endControlFlow() .addStatement(\"throw new $T($S + $L)\", IllegalArgumentException.class, \"Expected MetadataMap at label \", label) .build(); }", "tokens": 176} {"id": 77539, "source": "method", "repo": "bloxbean/cardano-client-lib", "text": "/** Checks if a type implements {@code Data} \u2014 a constr-based shared type that is NOT a generated {@code @Constr} model class. */ private boolean isDataType(TypeMirror typeMirror) { if (typeMirror == null) return false; Types typeUtils = processingEnvironment.getTypeUtils(); Element element = typeUtils.asElement(typeMirror); if (!(element instanceof TypeElement typeElement)) return false; // @Constr-annotated classes are generated model classes, not shared types if (typeElement.getAnnotation(Constr.class) != null) return false; TypeElement dataInterface = elements.getTypeElement(DATA_INTERFACE_FQN); if (dataInterface == null) return false; return typeUtils.isAssignable(typeUtils.erasure(typeMirror), typeUtils.erasure(dataInterface.asType())); }", "tokens": 179} {"id": 77566, "source": "method", "repo": "bloxbean/cardano-client-lib", "text": "void toMetadataMap_primitive_noNullGuard() { String src = generate(List.of(field(\"weight\", \"float\"))); assertFalse(src.contains(\"if (order.getWeight() != null)\")); }", "tokens": 46} {"id": 77644, "source": "method", "repo": "bloxbean/cardano-client-lib", "text": "public void testGetTransactionByHash() throws ApiException { Result result = transactionService.getTransaction(\"6176b7f77a756005d5afb0724df1294f68ac473e30633101872162161a7342e4\"); TransactionContent txContent = result.getValue(); System.out.println(JsonUtil.getPrettyJson(txContent)); assertNotNull(txContent); assertEquals(txContent.getBlock(), \"36b3ff7e10dba3277befb1dda0175cb7ee9f28795ff06a69bbbb19e29347a142\"); assertEquals(txContent.getBlockHeight(), 2587084); assertEquals(txContent.getSlot(), 26805265); assertTrue(txContent.getOutputAmount().size() > 0 ); }", "tokens": 227} {"id": 77714, "source": "method", "repo": "bloxbean/cardano-client-lib", "text": "private static SecureRandom initRandomGenerator(){ try{ return SecureRandom.getInstance(\"SHA1PRNG\"); }catch(NoSuchAlgorithmException e){ throw new IllegalStateException(\"Invalid algorithm for secure random\", e); } }", "tokens": 42} {"id": 77744, "source": "method", "repo": "bloxbean/cardano-client-lib", "text": "void getNewBaseAddress_Mainnet() { Account account = new Account(0); String address = account.baseAddress(); String mnemonic = account.mnemonic(); assertNotNull(address); assertNotNull(mnemonic); assertTrue(address.startsWith(\"addr\") && !address.startsWith(\"addr_\")); assertEquals(24, mnemonic.split(\" \").length ); }", "tokens": 76} {"id": 77962, "source": "method", "repo": "bloxbean/cardano-client-lib", "text": "public T accept(FieldRefVisitor visitor) { return visitor.visit(this); }", "tokens": 25} {"id": 77972, "source": "method", "repo": "bloxbean/cardano-client-lib", "text": "/** Creates a pointer to one producer's named output. @param step producer step identifier @param output output binding name */ public Pointer(String step, String output) { this.step = step; this.output = output; }", "tokens": 50} {"id": 78094, "source": "method", "repo": "bloxbean/cardano-client-lib", "text": "/** Reports the fixed capabilities of this engine so callers can enforce their own invariants at construction time.

Read-only and constant for a given engine. In particular {@link EngineCapabilities#durableExecution()} is {@code true} exactly when a {@link FlowExecutionStore} is configured; a durable-mode caller (for example a stream whose crash recovery assumes \"no stored execution \u21d2 it never ran\") should require it before pairing itself with this engine.

@return this engine's capability probe */ public EngineCapabilities capabilities() { return new EngineCapabilities(store != null); }", "tokens": 124} {"id": 78173, "source": "method", "repo": "bloxbean/cardano-client-lib", "text": "void testConfirmationTimeoutVsNetworkTimeout() { RetryPolicy policy = RetryPolicy.defaults(); // Confirmation timeout - NOT retryable (would cause duplicate transactions) assertFalse(policy.isRetryable(new ConfirmationTimeoutException(\"txHash\"))); assertFalse(policy.isRetryable(new RuntimeException(\"Transaction confirmation timeout: xyz\"))); // Network timeout - retryable (transaction was never submitted) assertTrue(policy.isRetryable(new RuntimeException(\"Network timeout\"))); assertTrue(policy.isRetryable(new RuntimeException(\"HTTP timeout connecting to server\"))); }", "tokens": 116} {"id": 78277, "source": "method", "repo": "bloxbean/cardano-client-lib", "text": "private byte[] readPayload(ResultSet row, String column) throws SQLException { try (Reader reader = row.getCharacterStream(column)) { if (reader == null) throw corrupt(\"Durable payload is missing\"); StringBuilder payload = new StringBuilder(); char[] buffer = new char[8192]; int count; while ((count = reader.read(buffer)) != -1) { if (payload.length() + count > MAX_PAYLOAD_CHARACTERS) { throw new FlowStoreException(\"TXFLOW_STORE_CODEC_SIZE_LIMIT\", \"Relational store payload exceeds the configured limit\"); } payload.append(buffer, 0, count); } return payload.toString().getBytes(StandardCharsets.UTF_8); } catch (IOException failure) { throw new FlowStoreException(\"TXFLOW_STORE_CODEC_DECODE_FAILED\", \"Relational store payload could not be read\", failure); } }", "tokens": 189} {"id": 78287, "source": "method", "repo": "bloxbean/cardano-client-lib", "text": "public void bind(String itemId, TxStreamBinding binding) { Objects.requireNonNull(itemId, \"itemId\"); Objects.requireNonNull(binding, \"binding\"); inTransaction(\"bind stream item\", connection -> { RegistrationRow registration = readRegistration(connection, itemId); if (registration == null || !registration.registered()) { throw new TxStreamException(\"TXSTREAM_ITEM_UNKNOWN\", \"Cannot bind unregistered item: \" + itemId); } upsertBinding(connection, itemId, binding); return null; }); }", "tokens": 110} {"id": 78431, "source": "method", "repo": "bluemap-minecraft/bluemap", "text": "public Path getSettingsFile() { return webRoot.resolve(\"settings.json\"); }", "tokens": 19} {"id": 78504, "source": "method", "repo": "bluemap-minecraft/bluemap", "text": "public Component mapList() { Map maps = plugin.getBlueMap().getMaps(); List entries = maps.values().stream() .sorted(Comparator.comparing(map -> map.getMapSettings().getSorting())) .map(this::element) .toList(); return paragraph(\"Maps\", lines(entries)); }", "tokens": 77} {"id": 78641, "source": "method", "repo": "bluemap-minecraft/bluemap", "text": "public Vector2i read(NBTReader reader) throws IOException { reader.beginList(); int x = reader.nextInt(); int y = reader.nextInt(); reader.endList(); return new Vector2i(x, y); }", "tokens": 49} {"id": 78675, "source": "method", "repo": "bluemap-minecraft/bluemap", "text": "default void addHeader(String name, String... values) { getHeaders().computeIfAbsent(name.toLowerCase(Locale.ROOT), HttpHeader::new).add(values); }", "tokens": 40} {"id": 78893, "source": "method", "repo": "bluemap-minecraft/bluemap", "text": "public void load(Path root, ResourcePool textures, Predicate textureFilter) throws IOException { if (resource == null) return; Key sprite = getSprite(); if (textures.containsKey(sprite)) return; if (!textureFilter.test(sprite)) return; Path file = getFile(root, resource); if (!Files.exists(file)) return; Texture texture = loadTexture(sprite, file); if (texture != null) textures.put(sprite, texture); }", "tokens": 104} {"id": 79366, "source": "method", "repo": "blueseererp/blueseer", "text": "/** Creates new form AboutPanel */ public About() { initComponents(); currenttext = jTextArea2.getText(); }", "tokens": 26} {"id": 79427, "source": "method", "repo": "blueseererp/blueseer", "text": "/** Creates new form ScrapReportPanel */ public CustPriceRpt() { initComponents(); setLanguageTags(this); }", "tokens": 27} {"id": 79599, "source": "method", "repo": "blueseererp/blueseer", "text": "private void btnewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnewActionPerformed newAction(\"task\"); }", "tokens": 32} {"id": 79690, "source": "method", "repo": "blueseererp/blueseer", "text": "private void btviewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btviewActionPerformed String[] ac = null; double total = 0; ArrayList mylist = fglData.getGLBalByYearByPeriod(Integer.valueOf(ddfromyear.getSelectedItem().toString()), Integer.valueOf(ddtoyear.getSelectedItem().toString()), Integer.valueOf(ddfromper.getSelectedItem().toString()), Integer.valueOf(ddtoper.getSelectedItem().toString()), ddsite.getSelectedItem().toString(), cbzero.isSelected(), cbbs.isSelected()); mymodel.setNumRows(0); for (String rec : mylist) { ac = rec.split(\",\", -1); total = total + bsParseDouble(ac[4]); String desc = fglData.getGLAcctDesc(ac[0]); mymodel.addRow(new Object[]{ddsite.getSelectedItem().toString(), ac[0], desc, ac[1], ac[2], ac[3], ac[4] }); } tablereport.setModel(mymodel); lblendbal.setText(currformatDouble(total)); }", "tokens": 249} {"id": 79735, "source": "method", "repo": "blueseererp/blueseer", "text": "public cfo_mstr createRecord() { String derived = String.valueOf(BlueSeerUtils.boolToInt(cbderivedrate.isSelected())) + \",\" + String.valueOf(BlueSeerUtils.boolToInt(cbderivedmiles.isSelected())) + \",\" + String.valueOf(BlueSeerUtils.boolToInt(cbderivedweight.isSelected())); String logic = \"\"; cfo_mstr x = new cfo_mstr(null, tbkey.getText(), ddcust.getSelectedItem().toString(), tbnumber.getText(), ddrevision.getSelectedItem().toString(), ddservicetype.getSelectedItem().toString(), tbequiptype.getText(), tbvehicle.getText(), tbtrailer.getText(), ddorderstatus.getSelectedItem().toString(), \"\", // delivery status tbDriver.getText(), tbdrivercell.getText(), ddfotype.getSelectedItem().toString(), ddbroker.getSelectedItem().toString(), tbbrokercontact.getText(), tbbrokercell.getText(), ddratetype.getSelectedItem().toString(), tbforate.getText().isBlank() ? \"0\" : tbforate.getText(), tbmileage.getText().isBlank() ? \"0\" : tbmileage.getText(), tbdriverrate.getText().isBlank() ? \"0\" : tbdriverrate.getText(), String.valueOf(BlueSeerUtils.boolToInt(cbstandard.isSelected())), tbtotweight.getText().isBlank() ? \"0\" : tbtotweight.getText(), BlueSeerUtils.setDateFormatNull(dcorddate.getDate()), BlueSeerUtils.setDateFormatNull(dcconfdate.getDate()), String.valueOf(BlueSeerUtils.boolToInt(cbhazmat.isSelected())), \"0\", // expenses tbcharges.getText().isBlank() ? \"0\" : tbcharges.getText(), tbcost.getText().isBlank() ? \"0\" : tbcost.getText(), \"\", // bol tanotes.getText(), derived, logic, ddsite.getSelectedItem().toString(), String.valueOf(BlueSeerUtils.boolToInt(cbedi.isSelected())), \"\", // edi rejection reason..to be added String.valueOf(BlueSeerUtils.boolToInt(cbrev.isSelected())), rejectioncode, // rejectcode rejectionreason, // rejection \"\" // uniquekey ); return x; }", "tokens": 468} {"id": 79880, "source": "method", "repo": "blueseererp/blueseer", "text": "private void btprintorderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btprintorderActionPerformed OVData.printOrderRemote(tbkey.getText(), isMultiShip(), false); // OVData.printCustomerOrder(tbkey.getText(), isMultiShip); }", "tokens": 68} {"id": 79886, "source": "method", "repo": "blueseererp/blueseer", "text": "private void btexportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btexportActionPerformed if (tableorder != null && modeltable.getRowCount() > 0) { // still necessary to click run if only for the exportOrderDetail (local grab) if (bsmf.MainFrame.remoteDB) { disableAll(); executeTask(\"exportOrderDetail\", null); } else { exportOrderDetail(tableorder); } } }", "tokens": 95} {"id": 80285, "source": "method", "repo": "bluuewhale/hash-smith", "text": "public RobinHoodMap(int initialCapacity, double loadFactor) { if (initialCapacity < 0) { throw new IllegalArgumentException(\"initialCapacity must be >= 0: \" + initialCapacity); } Utils.validateLoadFactor(loadFactor); this.loadFactor = loadFactor; this.iterationSeed = ThreadLocalRandom.current().nextLong(); init(initialCapacity); }", "tokens": 78} {"id": 80327, "source": "method", "repo": "bluuewhale/hash-smith", "text": "/** Package-private \"secret\" fast path: {@code remove} with a precomputed smeared hash. */ V remove(Object key, int smearedHash) { int idx = findIndexHashed(key, smearedHash); if (idx < 0) return null; V old = castValue(vals[idx]); setCtrlAt(ctrl, idx, DELETED); setEntryAt(idx, null, null); size--; tombstones++; maybeRehash(); return old; }", "tokens": 108} {"id": 80337, "source": "method", "repo": "bluuewhale/hash-smith", "text": "/** Fast-path: {@code broadcastedByte} must equal {@code toUnsignedByte(b) * BITMASK_LSB}. Callers can hoist the broadcast out of hot loops (e.g., h2 is loop-invariant). */ private static int eqMask(long word, long broadcastedByte) { long x = word ^ broadcastedByte; long m = (((x >>> 1) | BITMASK_MSB) - x) & BITMASK_MSB; return (int) ((m * 0x0204_0810_2040_81L) >>> 56); }", "tokens": 148} {"id": 80452, "source": "method", "repo": "bluuewhale/hash-smith", "text": "void containsKey(MapSpec spec) { var m = newMap(spec); m.put(\"a\", 1); assertTrue(m.containsKey(\"a\")); assertFalse(m.containsKey(\"b\")); if (spec.containsKeyNullThrows()) { assertThrows(NullPointerException.class, () -> m.containsKey(null)); } else { assertFalse(m.containsKey(null)); } }", "tokens": 81} {"id": 80668, "source": "method", "repo": "bonniernews/react-native-3d-model-view", "text": "public String getAssetsDir() { return assetsDir; }", "tokens": 13} {"id": 80709, "source": "method", "repo": "bonniernews/react-native-3d-model-view", "text": "protected void setMvpMatrix(float[] mvpMatrix) { // get handle to shape's transformation matrix int mMVPMatrixHandle = GLES20.glGetUniformLocation(mProgram, \"u_MVPMatrix\"); GLUtil.checkGlError(\"glGetUniformLocation\"); // Apply the projection and view transformation GLES20.glUniformMatrix4fv(mMVPMatrixHandle, 1, false, mvpMatrix, 0); GLUtil.checkGlError(\"glUniformMatrix4fv\"); }", "tokens": 107} {"id": 80810, "source": "method", "repo": "bonniernews/react-native-3d-model-view", "text": "public Tuple3 getKs() { return ks; }", "tokens": 14} {"id": 80816, "source": "method", "repo": "bonniernews/react-native-3d-model-view", "text": "public int getSize(){ return totalFaces; }", "tokens": 11} {"id": 80864, "source": "method", "repo": "bonniernews/react-native-3d-model-view", "text": "public void addTangent(Vector3f tangent){ tangents.add(tangent); }", "tokens": 23} {"id": 80889, "source": "method", "repo": "bonniernews/react-native-3d-model-view", "text": "private String[] getChannel(XmlNode jointData){ XmlNode channelNode = jointData.getChild(\"channel\"); String data = channelNode.getAttribute(\"target\"); return data.split(\"/\"); }", "tokens": 39} {"id": 80891, "source": "method", "repo": "bonniernews/react-native-3d-model-view", "text": "private void processXYTransforms(String jointName, String[] rawTimes, String[] rawData, List keyTimes, KeyFrameData[] keyFrames, boolean root){ for(int i=0;i\" + event.name + \"\"); var text = (String) event.defaultValue; if (state.settings.containsParameter(event.name)) { text = state.settings.getParameter(event.name).getValue(String.class); } textField.setText(text); var settingsField = state.settingsConfig; settingsField.add(label, getConstraints(0, getNextRowForComponentInSettingPanel(state))); settingsField.add(textField, getConstraints(1, getNextRowForComponentInSettingPanel(state))); setNewSettingsValue(event.alias, state, event.name, event.fieldType, text, true); textField.getDocument().addDocumentListener(new DocumentListenerAdapter() { @Override public void onReplace(String newText) { setNewSettingsValue(event.alias, state, event.name, event.fieldType, newText, false); } }); }", "tokens": 217} {"id": 81615, "source": "method", "repo": "BookmapAPI/python-api", "text": "public T getSettings(Class aClass) { return null; }", "tokens": 22} {"id": 81635, "source": "method", "repo": "boxbeam/RedLib", "text": "public void onEnable() { ConfigManager.create(this).target(RedLibConfig.class).saveDefaults().load(); if (RedLibConfig.devMode) { ChainCommand chain = new ChainCommand(); new CommandParser(this.getResource(\"command.rdcml\")) .setArgTypes(ArgType.of(\"material\", Material.class), chain.getArgType()) .parse() .register(\"redlib\", new ProfilerCommands(), StructureTool.enable(), chain); } }", "tokens": 103} {"id": 81660, "source": "method", "repo": "boxbeam/RedLib", "text": "/** Unloads the data for a chunk synchronously @param world The world the data is in @param cx The chunk X of the chunk the data is in @param cz The chunk Z of the chunk the data is in */ public void unload(World world, int cx, int cz) { unwrap(unloadAsync(world, cx, cz)); }", "tokens": 73} {"id": 81669, "source": "method", "repo": "boxbeam/RedLib", "text": "public Location getLocation(World world) { return new Location(world, x, y, z); }", "tokens": 23} {"id": 81810, "source": "method", "repo": "boxbeam/RedLib", "text": "public void remove(String path) { map.remove(path); }", "tokens": 16} {"id": 82115, "source": "method", "repo": "boxbeam/RedLib", "text": "/** @return A JSON string representing this JSONMap */ public String toString() { StringJoiner joiner = new StringJoiner(\", \", \"{\", \"}\"); forEach((key, value) -> joiner.add(JSONParser.toJSONString(key) + \": \" + JSONParser.toJSONString(value))); return joiner.toString(); }", "tokens": 68} {"id": 82224, "source": "method", "repo": "boxbeam/RedLib", "text": "/** Gets an OfflinePlayer by name, initializing the cache synchronously if it has not been initialized yet @param name The name of the player, case insensitive @return The OfflinePlayer, or null */ public static OfflinePlayer getOfflinePlayer(String name) { if (nameCache == null) { init(); } return nameCache.get(name.toLowerCase(Locale.ROOT)); }", "tokens": 75} {"id": 82362, "source": "method", "repo": "boxbeam/RedLib", "text": "/** Adds a bypass policy, which allows certain players to bypass certain protection types @param bypassPolicy The {@link BypassPolicy} to determine bypasses by player and protection type */ public void addBypassPolicy(BypassPolicy bypassPolicy) { bypassPolicies.add(bypassPolicy); }", "tokens": 58} {"id": 82384, "source": "method", "repo": "boxbeam/RedLib", "text": "/** Move the region @param v The vector to be applied to both corners of the region @return Itself */ public CuboidRegion move(Vector v) { start = start.add(v); end = end.add(v); return this; }", "tokens": 55} {"id": 82723, "source": "method", "repo": "boykaframework/boyka-framework", "text": "public String selectedItem () { LOGGER.traceEntry (); LOGGER.info (\"Getting selected option from element located by: {}\", this.locator.getName ()); ofNullable (this.listener).ifPresent (l -> l.onSelectedItem (this.locator)); return getElementAttribute (element -> { final var select = new Select (element); try { return select.getFirstSelectedOption () .getText (); } catch (final NoSuchElementException e) { return EMPTY; } }, this.locator, EMPTY); }", "tokens": 109} {"id": 82841, "source": "method", "repo": "boykaframework/boyka-framework", "text": "/** Handle pause method. @param time Time till executions to be paused */ default void onPause (final Duration time) { // not implemented. }", "tokens": 32} {"id": 82899, "source": "method", "repo": "boykaframework/boyka-framework", "text": "/** Handle get style method. @param locator Locator of the element. @param styleName Style name */ default void onGetStyle (final Locator locator, final String styleName) { // not implemented. }", "tokens": 43} {"id": 83245, "source": "method", "repo": "boykaframework/boyka-framework", "text": "/** Gets the Home page instance @return Home page */ public static HomePage homePage () { return HOME_PAGE; }", "tokens": 28} {"id": 83288, "source": "method", "repo": "boykaframework/boyka-framework", "text": "/** Test checkout page step 1. */ public void testCheckoutStep1 () { this.sauceDemo.verifyCheckoutStep1 (); }", "tokens": 31} {"id": 83642, "source": "method", "repo": "braintree/android-card-form", "text": "public void vibrate_callsVibrateIfHasVibratePermissionIsTrue() { PackageManager packageManager = mock(PackageManager.class); when(packageManager.checkPermission(eq(Manifest.permission.VIBRATE), anyString())) .thenReturn(PackageManager.PERMISSION_GRANTED); Vibrator vibrator = mock(Vibrator.class); Context context = mock(Context.class); when(context.getPackageManager()).thenReturn(packageManager); when(context.getSystemService(Context.VIBRATOR_SERVICE)).thenReturn(vibrator); VibrationHelper.vibrate(context, 1000); verify(vibrator).vibrate(1000); }", "tokens": 148} {"id": 83645, "source": "method", "repo": "braintree/android-card-form", "text": "public void isDarkBackground_detectsBlackBackgroundAndReturnsTrue() { Activity activity = setupActivity(R.color.bt_black); assertTrue(ViewUtils.isDarkBackground(activity)); }", "tokens": 42} {"id": 83656, "source": "method", "repo": "braintree/android-card-form", "text": "public void testJcb() { helper(\"35\", \"30 1113 3330 0000\", R.drawable.bt_ic_jcb, 4, 8, 12); }", "tokens": 54} {"id": 83694, "source": "method", "repo": "braintree/android-card-form", "text": "public void visibilityIsVisibleAfterSetupIsCalled() { mCardForm.cardRequired(true) .expirationRequired(true) .cvvRequired(true) .cardholderName(CardForm.FIELD_REQUIRED) .postalCodeRequired(true) .mobileNumberRequired(true) .mobileNumberExplanation(\"Make sure SMS is supported\") .setup(mActivity); assertEquals(VISIBLE, mCardForm.getVisibility()); }", "tokens": 84} {"id": 83781, "source": "method", "repo": "braintree/android-card-form", "text": "public void validIfNotEmpty() { mView.setText(\"+86\"); assertTrue(mView.isValid()); }", "tokens": 23} {"id": 84065, "source": "method", "repo": "braintree/braintree-android-drop-in", "text": "public void writeToParcel(Parcel parcel, int i) { parcel.writeByte((byte) (isCvvChallengePresent ? 1 : 0)); parcel.writeByte((byte) (isPostalCodeChallengePresent ? 1 : 0)); }", "tokens": 53} {"id": 84129, "source": "method", "repo": "braintree/braintree-android-drop-in", "text": "DropInClientParams braintreeClient(BraintreeClient braintreeClient) { this.braintreeClient = braintreeClient; return this; }", "tokens": 22} {"id": 84239, "source": "method", "repo": "braintree/braintree-android-drop-in", "text": "/** @return The {@link ThreeDSecureRequest} for the transaction. */ public ThreeDSecureRequest getThreeDSecureRequest() { return threeDSecureRequest; }", "tokens": 31} {"id": 84418, "source": "method", "repo": "braintree/braintree-android-drop-in", "text": "public MockThreeDSecureClientBuilder continueVerificationSuccess(ThreeDSecureResult continueVerificationSuccess) { this.continueVerificationSuccess = continueVerificationSuccess; return this; }", "tokens": 30} {"id": 84550, "source": "method", "repo": "braintree/braintree-android-drop-in", "text": "public void tokenizePayPalAccount_withoutPayPalRequest_tokenizesPayPalWithVaultRequest() { Configuration configuration = mockConfiguration(true, false, false, false, false); DropInRequest dropInRequest = new DropInRequest(); BraintreeClient braintreeClient = new MockBraintreeClientBuilder() .authorizationSuccess(Authorization.fromString(Fixtures.BASE64_CLIENT_TOKEN)) .configuration(configuration) .build(); PayPalClient payPalClient = mock(PayPalClient.class); DropInInternalClientParams params = new DropInInternalClientParams() .dropInRequest(dropInRequest) .payPalClient(payPalClient) .braintreeClient(braintreeClient); DropInInternalClient sut = new DropInInternalClient(params); PayPalFlowStartedCallback callback = mock(PayPalFlowStartedCallback.class); sut.tokenizePayPalRequest(activity, callback); verify(payPalClient).tokenizePayPalAccount(same(activity), any(PayPalVaultRequest.class), same(callback)); }", "tokens": 196} {"id": 84554, "source": "method", "repo": "braintree/braintree-android-drop-in", "text": "public void requestGooglePayPayment_requestsGooglePay() { Configuration configuration = mockConfiguration(false, false, false, true, false); GooglePayRequest googlePayRequest = new GooglePayRequest(); DropInRequest dropInRequest = new DropInRequest(); dropInRequest.setGooglePayRequest(googlePayRequest); BraintreeClient braintreeClient = new MockBraintreeClientBuilder() .authorizationSuccess(Authorization.fromString(Fixtures.BASE64_CLIENT_TOKEN)) .configuration(configuration) .build(); GooglePayClient googlePayClient = new MockGooglePayClientBuilder() .isReadyToPaySuccess(true) .build(); DropInInternalClientParams params = new DropInInternalClientParams() .dropInRequest(dropInRequest) .googlePayClient(googlePayClient) .braintreeClient(braintreeClient); DropInInternalClient sut = new DropInInternalClient(params); GooglePayRequestPaymentCallback callback = mock(GooglePayRequestPaymentCallback.class); sut.requestGooglePayPayment(activity, callback); verify(googlePayClient).requestPayment(same(activity), same(googlePayRequest), same(callback)); }", "tokens": 207} {"id": 84601, "source": "method", "repo": "braintree/braintree-android-drop-in", "text": "public void beforeEach() { MockitoAnnotations.initMocks(this); cardNonce = mock(CardNonce.class); context = ApplicationProvider.getApplicationContext(); when(cardNonce.getString()).thenReturn(\"im-a-card-nonce\"); }", "tokens": 51} {"id": 84802, "source": "method", "repo": "braintree/braintree_java", "text": "public T between(Calendar min, Calendar max) { greaterThanOrEqualTo(min); lessThanOrEqualTo(max); return parent; }", "tokens": 26} {"id": 85222, "source": "method", "repo": "braintree/braintree_java", "text": "public void createWithOrderPaymentPayPalAccountNonceAndPayPalOptions() { String nonce = TestHelper.generateOrderPaymentPayPalNonce(gateway); CustomerRequest request = new CustomerRequest(). paymentMethodNonce(nonce). options(). paypal(). payeeEmail(\"payee@example.com\"). orderId(\"merchant-order-id\"). customField(\"custom merchant field\"). description(\"merchant description\"). amount(new BigDecimal(\"1.23\")). done(). done(); Result result = gateway.customer().create(request); assertTrue(result.isSuccess()); assertEquals(1, result.getTarget().getPayPalAccounts().size()); }", "tokens": 125} {"id": 85264, "source": "method", "repo": "braintree/braintree_java", "text": "public void updateWithThreeDSecurePassThru() { Result customerResult = gateway.customer().create(new CustomerRequest()); Customer customer = customerResult.getTarget(); CreditCardRequest creditCardRequest = new CreditCardRequest(). customerId(customer.getId()). cardholderName(\"John Doe\"). cvv(\"123\"). number(\"5105105105105100\"). expirationDate(\"05/12\"); Result creditCardResult = gateway.creditCard().create(creditCardRequest); assertTrue(creditCardResult.isSuccess()); PaymentMethodRequest updatePaymentMethodRequest = new PaymentMethodRequest(). customerId(customer.getId()). paymentMethodNonce(Nonce.Transactable). threeDSecurePassThruRequest(). eciFlag(\"05\"). cavv(\"some-cavv\"). xid(\"some-xid\"). threeDSecureVersion(\"2.2.0\"). dsTransactionId(\"some-ds-transaction-id\"). authenticationResponse(\"some-auth-response\"). directoryResponse(\"some-directory-response\"). cavvAlgorithm(\"algorithm\"). done(). options(). verifyCard(true). done(); String token = creditCardResult.getTarget().getToken(); Result result = gateway.paymentMethod().update(token, updatePaymentMethodRequest); assertTrue(result.isSuccess()); }", "tokens": 272} {"id": 85266, "source": "method", "repo": "braintree/braintree_java", "text": "public void updateDoesNotOverrideBillingAddressForVaultedCreditCards() { Result customerResult = gateway.customer().create(new CustomerRequest()); Customer customer = customerResult.getTarget(); CreditCardRequest creditCardRequest = new CreditCardRequest(). number(\"4111111111111111\"). expirationMonth(\"12\"). expirationYear(\"2020\"). billingAddress(). streetAddress(\"456 Xyz Way\"). done(); String nonce = TestHelper.generateNonceForCreditCard(gateway, creditCardRequest, customer.getId(), true); PaymentMethodRequest request = new PaymentMethodRequest(). paymentMethodNonce(nonce). customerId(customer.getId()). billingAddress(). streetAddress(\"123 Abc Way\"). done(); Result result = gateway.paymentMethod().create(request); assertTrue(result.isSuccess()); assertTrue(result.getTarget() instanceof CreditCard); String token = result.getTarget().getToken(); CreditCard foundCreditCard = gateway.creditCard().find(token); assertFalse(foundCreditCard == null); assertEquals(foundCreditCard.getBillingAddress().getStreetAddress(), \"456 Xyz Way\"); }", "tokens": 241} {"id": 85314, "source": "method", "repo": "braintree/braintree_java", "text": "public void saleWithLevel3SummaryData() { TransactionRequest request = new TransactionRequest(). amount(TransactionAmount.AUTHORIZE.amount). creditCard(). number(CreditCardNumber.VISA.number). expirationDate(\"05/2009\"). done(). shippingAmount(new BigDecimal(\"1.00\")). discountAmount(new BigDecimal(\"2.00\")). shipsFromPostalCode(\"12345\"); Result result = gateway.transaction().sale(request); assertTrue(result.isSuccess()); Transaction transaction = result.getTarget(); assertEquals(new BigDecimal(\"1.00\"), transaction.getShippingAmount()); assertEquals(new BigDecimal(\"2.00\"), transaction.getDiscountAmount()); assertEquals(\"12345\", transaction.getShipsFromPostalCode()); }", "tokens": 164} {"id": 85354, "source": "method", "repo": "braintree/braintree_java", "text": "public void findReturnsAchTypeAndRequestedAchTypeForSameDayAchWithSameDayRequested() { Transaction transaction = gateway.transaction().find(\"sameday_ach_sameday_requested\"); assertEquals(\"same_day\", transaction.getAchType()); assertEquals(\"same_day\", transaction.getRequestedAchType()); }", "tokens": 69} {"id": 85407, "source": "method", "repo": "braintree/braintree_java", "text": "public void dibursementTypeIsSetToUknown() { String xml = \"\\n\" + \"\\n\" + \" 12345\\n\" + \" \\n\" + \" active\\n\" + \" merchant_account_token\\n\" + \" USD\\n\" + \" false\\n\" + \" \\n\" + \" \\n\" + \" 100.00\\n\" + \" true\\n\" + \" true\\n\" + \" \\n\" + \" asdf\\n\" + \" qwer\\n\" + \" \\n\" + \"\\n\"; SimpleNodeWrapper disbursementNode = SimpleNodeWrapper.parse(xml); Disbursement disbursement = new Disbursement(disbursementNode); assertEquals(Disbursement.DisbursementType.UNKNOWN, disbursement.getDisbursementType()); }", "tokens": 326} {"id": 85506, "source": "method", "repo": "braintree/braintree_java", "text": "public void hmacHash() { String actual = new Sha1Hasher().hmacHash(\"secretKey\", \"hello world\"); assertEquals(\"d503d7a1a6adba1e6474e9ff2c4167f9dfdf4247\", actual); }", "tokens": 67} {"id": 85804, "source": "method", "repo": "Breus/json-masker", "text": "void isUnicodeEncodedCharacter(byte[] bytes, int fromIndex, int toIndex, boolean isEncodedCharacter) { assertThat(KeyMatcher.isUnicodeEncodedCharacter(bytes, fromIndex, toIndex)) .isEqualTo(isEncodedCharacter); }", "tokens": 52} {"id": 85839, "source": "method", "repo": "Breus/json-masker", "text": "void parseAndMaskArrayValue() { JsonNode jsonNode = ParseAndMaskUtil.mask( \"\"\" { \"maskMe\": [\"hello\", \"there\"], \"dontMaskMe\": [{\"alsoMaskMe\": \"no\"}] } \"\"\", JsonMaskingConfig.builder() .maskKeys(Set.of(\"maskMe\", \"alsoMaskMe\")) .build()); JsonNode maskedNode = jsonNode.get(\"maskMe\"); assertThat(maskedNode.get(0).asString()).isEqualTo(\"***\"); assertThat(maskedNode.get(1).asString()).isEqualTo(\"***\"); assertThat(jsonNode.get(\"dontMaskMe\").get(0).get(\"alsoMaskMe\").asString()) .isEqualTo(\"***\"); }", "tokens": 146} {"id": 85860, "source": "method", "repo": "Breus/json-masker", "text": "void eachDigitWithInteger() { var valueMasker = ValueMaskers.eachDigitWith(1); Assertions.assertThat(ByteValueMaskerContext.maskNumberWith(12345, valueMasker)) .isEqualTo(\"11111\"); Assertions.assertThatThrownBy(() -> ValueMaskers.eachDigitWith(0)).isInstanceOf(IllegalArgumentException.class); Assertions.assertThatThrownBy(() -> ValueMaskers.eachDigitWith(10)) .isInstanceOf(IllegalArgumentException.class); }", "tokens": 104} {"id": 85887, "source": "method", "repo": "Breus/json-masker", "text": "void ambiguousJsonPathKeys(Set jsonPathLiterals, String expectedExceptionMessage) { JsonPathParser parser = new JsonPathParser(); Set parsedJsonPaths = jsonPathLiterals.stream().map(parser::parse).collect(Collectors.toSet()); assertThatThrownBy(() -> parser.checkAmbiguity(parsedJsonPaths)) .isInstanceOf(IllegalArgumentException.class) .hasMessage(expectedExceptionMessage); }", "tokens": 91} {"id": 86543, "source": "method", "repo": "briandilley/jsonrpc4j", "text": "public void callVoidMethod() throws Exception { mockService.voidMethod(intParam1); EasyMock.replay(mockService); jsonRpcServer.handleRequest( messageWithListParamsStream(1, \"voidMethod\", intParam1), byteArrayOutputStream ); assertNull(decodeAnswer(byteArrayOutputStream).get(JsonRpcBasicServer.RESULT).textValue()); EasyMock.verify(mockService); }", "tokens": 80} {"id": 86640, "source": "method", "repo": "briandilley/jsonrpc4j", "text": "public void shouldCreateServiceExporter() { assertNotNull(temperature); assertTrue(AopUtils.isAopProxy(temperature)); }", "tokens": 25} {"id": 86788, "source": "method", "repo": "brikster/chatty", "text": "public Map getChats() { return chats; }", "tokens": 18} {"id": 86934, "source": "method", "repo": "brikster/chatty", "text": "private void clearForSender(CommandSender sender) { if (!(sender instanceof Player)) { ChattyMessages.send(audiences.sender(sender), messagesConfig.getCmdSenderTypeError()); return; } var audience = audiences.sender(sender); for (int i = 0; i < BLANK_LINES; i++) { audience.sendMessage(Component.empty()); } ChattyMessages.send(audience, messagesConfig.getClearchatCommandSuccess()); }", "tokens": 96} {"id": 87072, "source": "method", "repo": "brikster/chatty", "text": "public boolean isOnline() { return false; }", "tokens": 11} {"id": 87082, "source": "method", "repo": "brikster/chatty", "text": "public String getSuffix(OfflinePlayer player) { return vaultChatModule.getPlayerSuffix(player instanceof Player ? ((Player) player).getWorld().getName() : Bukkit.getWorlds().get(0).getName(), player); }", "tokens": 49} {"id": 87204, "source": "method", "repo": "brikster/chatty", "text": "void doesNotResolvePlaceholdersTypedByThePlayer() { String rendered = render(\"{original-message}\", \"look at %server_name%\"); assertEquals(\"look at %server_name%\", rendered.trim(), \"a placeholder inside a player's own message must stay literal\"); }", "tokens": 59} {"id": 87463, "source": "method", "repo": "broadinstitute/picard", "text": "protected HsMetricCollector makeCollector(final Set accumulationLevels, final List samRgRecords, final ReferenceSequenceFile refFile, final File perTargetCoverage, final File perBaseCoverage, final IntervalList targetIntervals, final IntervalList probeIntervals, final String probeSetName, final int nearProbeDistance) { return new HsMetricCollector(accumulationLevels, samRgRecords, refFile, perTargetCoverage, perBaseCoverage, targetIntervals, probeIntervals, probeSetName, nearProbeDistance, MINIMUM_MAPPING_QUALITY, MINIMUM_BASE_QUALITY, CLIP_OVERLAPPING_READS, true, INCLUDE_INDELS, COVERAGE_CAP, SAMPLE_SIZE); }", "tokens": 170} {"id": 87592, "source": "method", "repo": "broadinstitute/picard", "text": "/** Queries a HaplotypeBlock by Snp name. Returns NULL if none found. */ public HaplotypeBlock getHaplotype(final String snpName) { return this.haplotypesBySnpName.get(snpName); }", "tokens": 59} {"id": 87788, "source": "method", "repo": "broadinstitute/picard", "text": "void addAlignment(final SAMRecord rec) { final SAMFileWriter writer; if (outputByReadGroup) { writer = writerMap.get(rec.getReadGroup().getId()); } else { writer = singleWriter; } writer.addAlignment(rec); }", "tokens": 54} {"id": 87990, "source": "method", "repo": "broadinstitute/picard", "text": "VcfTuple(final VariantContext leftVariantContext, final VariantContext rightVariantContext) { this(Optional.of(leftVariantContext), Optional.of(rightVariantContext)); }", "tokens": 39} {"id": 87998, "source": "method", "repo": "broadinstitute/picard", "text": "public MultiException(final List childrenExceptions) { this.childrenExceptions = childrenExceptions; }", "tokens": 26} {"id": 88162, "source": "method", "repo": "broadinstitute/picard", "text": "public void testReadValidFile() { final Map filters = new HashMap<>(); filters.put(1101, TILE_1101_FILTER); final LocsFileReader locsFileReader = new LocsFileReader(new File(\"testdata/picard/illumina/readerTests/s_1_6.locs\")); final List locs = locsFileReader.toList(); final CbclReader reader = new CbclReader(Arrays.asList(PASSING_CBCL_C1_1, PASSING_CBCL_C2_1), filters, new int[]{2}, 1101, locs, new int[]{1, 2}); int i = 0; while (reader.hasNext()) { final BclData bv = reader.next(); for (int cluster = 0; cluster < bv.bases.length; cluster++) { for (int cycle = 0; cycle < bv.bases[cluster].length; cycle++) { final String actual = new String(new byte[]{bv.bases[cluster][cycle]}); final String expected = new String(new char[]{expectedBases[i]}); Assert.assertEquals(actual, expected, \"For cluster \" + cluster + \" cycle \" + cycle + \",\"); Assert.assertEquals(bv.qualities[cluster][cycle], expectedQuals[i], \"For cluster \" + cluster + \" cycle \" + cycle + \",\"); i++; } } } Assert.assertEquals(i, expectedBases.length); reader.close(); }", "tokens": 353} {"id": 88191, "source": "method", "repo": "broadinstitute/picard", "text": "public void testPairedOk(final String filename1, final String filename2, final FastqQualityFormat version) throws IOException { convertFile(filename1, filename2, version); }", "tokens": 40} {"id": 88456, "source": "method", "repo": "brunoborges/javaevolved", "text": "/** Download fonts to cache and register with Java's graphics environment. */ public static void ensureFonts() throws IOException { Files.createDirectories(FONT_CACHE); var ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); for (var entry : FONT_URLS.entrySet()) { var file = FONT_CACHE.resolve(entry.getKey()); if (!Files.exists(file)) { System.out.println(\"Downloading %s...\".formatted(entry.getKey())); try (var in = URI.create(entry.getValue()).toURL().openStream()) { Files.copy(in, file); } } try { var font = Font.createFont(Font.TRUETYPE_FONT, file.toFile()); ge.registerFont(font); } catch (FontFormatException e) { System.out.println(\"[WARN] Could not register font %s: %s\" .formatted(entry.getKey(), e.getMessage())); } } }", "tokens": 198} {"id": 88556, "source": "method", "repo": "brunoborges/javaevolved", "text": "public void generateReport() { buildDailyReport(); }", "tokens": 12} {"id": 88603, "source": "method", "repo": "brunoborges/javaevolved", "text": "State(long handle) { this.handle = handle; }", "tokens": 15} {"id": 88605, "source": "method", "repo": "brunoborges/javaevolved", "text": "NativeResource(long handle) { cleanable = CLEANER.register(this, new State(handle)); }", "tokens": 26} {"id": 88651, "source": "method", "repo": "brunoborges/javaevolved", "text": "void main() { var p = new Point(1, 2); }", "tokens": 17} {"id": 88707, "source": "method", "repo": "BryanJacobs/FIDO2Applet", "text": "private short encodeMemoryBufferOffset(short offset) { // Memory offsets are given in the range [-12288, -infinity) return (short)(-1 * offset - 12288); }", "tokens": 49} {"id": 88744, "source": "method", "repo": "BryanJacobs/FIDO2Applet", "text": "private boolean checkCredential(APDU apdu, short rkNum, byte[] rpIdBuf, short rpIdHashIdx, byte[] outputBuffer, short outputOffset, byte maximumCredProtectLevel) { return checkCredential(apdu, residentKeys[rkNum].getEncryptedCredentialID(), (short) 0, residentKeys[rkNum].getCredLen(), rpIdBuf, rpIdHashIdx, outputBuffer, outputOffset, rkNum, maximumCredProtectLevel); }", "tokens": 102} {"id": 89020, "source": "method", "repo": "bsommerfeld/pathetic", "text": "public int hashCode() { final int PRIME = 59; int result = 1; final Object $depth = this.getDepth(); result = result * PRIME + ($depth == null ? 43 : $depth.hashCode()); return result; }", "tokens": 57} {"id": 89059, "source": "method", "repo": "bsommerfeld/pathetic", "text": "public boolean isValid(EvaluationContext context) { return true; }", "tokens": 14} {"id": 89193, "source": "method", "repo": "bsommerfeld/pathetic", "text": "void classIsFinal() { assertEquals( true, Modifier.isFinal(Depth.class.getModifiers()), \"Depth must be final - it is a value type, not an extension point\"); }", "tokens": 39} {"id": 89207, "source": "method", "repo": "bsommerfeld/pathetic", "text": "void notCloneableAndNoCloneMethod() { assertFalse( Cloneable.class.isAssignableFrom(PathVector.class), \"PathVector must not implement Cloneable - the value type is immutable\"); for (Method method : PathVector.class.getDeclaredMethods()) { assertFalse( method.getName().equals(\"clone\"), \"PathVector.clone() must not exist - use the constructor or fluent operations\"); } }", "tokens": 84} {"id": 89230, "source": "method", "repo": "bsommerfeld/pathetic", "text": "protected AStarSearchState createSearchState(PathPosition start, int expectedNodes) { return new AStarSearchState(pathfinderConfiguration, start, expectedNodes); }", "tokens": 35} {"id": 89252, "source": "method", "repo": "bsommerfeld/pathetic", "text": "/** Returns the G-cost recorded at close time, or NaN. Requires reopening to be enabled. */ double closedGCost(int id) { return closedGCosts[id]; }", "tokens": 42} {"id": 89380, "source": "method", "repo": "bsommerfeld/pathetic", "text": "private static long runOnce(MinHeap heap, int ops, long[] ids, double[] costs) { long checksum = 0; for (int i = 0; i < ops; i++) { heap.insertOrUpdate(ids[i], costs[i]); if (i % 5 == 0 && !heap.isEmpty()) checksum += heap.extractMin(); } while (!heap.isEmpty()) checksum += heap.extractMin(); return checksum; }", "tokens": 98} {"id": 89389, "source": "method", "repo": "bsommerfeld/pathetic", "text": "public void benchBucketMinHeapCoarse(Blackhole bh) { BucketMinHeap heap = new BucketMinHeap(operations, 100.0, 1.0); for (int i = 0; i < operations; i++) { heap.insertOrUpdate(packedNodes[i], costs[i]); if (i % 5 == 0 && !heap.isEmpty()) { bh.consume(heap.extractMin()); } } }", "tokens": 99} {"id": 89896, "source": "method", "repo": "bttv-android/bttv", "text": "private ProgressListener getProgressListener(final ProgressBar bar) { return new ProgressListener() { boolean firstUpdate = true; @Override public void update(long bytesRead, long contentLength, boolean done) { if (done) { Log.d(\"LBTTVUpdaterActivity\", \"Download done\"); return; } if (firstUpdate) { firstUpdate = false; } if (contentLength != -1) { bar.setProgress((int) ((100 * bytesRead) / contentLength)); } } }; }", "tokens": 104} {"id": 89943, "source": "method", "repo": "bttv-android/bttv", "text": "public GenericEmoteCardModel(String emoteId, String emoteToken, EmoteModelAssetType assetType, EmoteCardType.GenericEmoteCardType emoteCardType) { super(emoteId, emoteToken, assetType, emoteCardType); }", "tokens": 49} {"id": 89945, "source": "method", "repo": "bttv-android/bttv", "text": "public final EmoteCardModel getEmoteCardModel() { return null; }", "tokens": 17} {"id": 89994, "source": "method", "repo": "bttv-android/bttv", "text": "private EmoteHeaderUiModel() { }", "tokens": 10} {"id": 90038, "source": "method", "repo": "bttv-android/bttv", "text": "public static String generateEmoteUrl(String emote, float f) { throw new IllegalStateException(\"EmoteUrlUtil.generateEmoteUrl() called\"); }", "tokens": 31} {"id": 90118, "source": "method", "repo": "BuildCLI/BuildCLI", "text": "private File getPluginDirectory(String pluginName) { File directory; do { String parentDir = outputDirectory == null ? question(\"Plugin directory\", true) : outputDirectory; directory = new File(parentDir, pluginName); if (directory.isFile()) { logger.warn(\"Cannot create plugin in '{}' as it's an existing file\", directory.getAbsolutePath()); outputDirectory = null; // Reset to prompt again } else { break; } } while (true); return directory; }", "tokens": 100} {"id": 90147, "source": "method", "repo": "BuildCLI/BuildCLI", "text": "public void run() { DockerComposeConfig config = new DockerComposeConfig(ports, volumes, cpu, memory, dockerFilePath); try { DockerManager.setupDockerCompose(config); logger.info(\"docker-compose.yml created successfully!\"); } catch (DockerException | CommandLine.ExecutionException e) { throw new CommandLine.ExecutionException(new CommandLine(this), \"Failed to setup docker-compose: \" + e.getMessage(), e); } }", "tokens": 94} {"id": 90163, "source": "method", "repo": "BuildCLI/BuildCLI", "text": "public static Set getManual() { return collectCommands(cmd, \"\").stream().sorted(Comparator.comparing(CommandMan::getLongCommand)).collect(Collectors.toCollection(LinkedHashSet::new)); }", "tokens": 44} {"id": 90463, "source": "method", "repo": "BuildCLI/BuildCLI", "text": "public static String brightBlueBg(Object content) { return BRIGHT_BLUE_BG + content + RESET; }", "tokens": 26} {"id": 90545, "source": "method", "repo": "BuildCLI/BuildCLI", "text": "protected static String buildContent(DockerComposeConfig config) { StringBuilder content = new StringBuilder(); content.append(\"services:\\n\"); content.append(\" app:\\n\"); content.append(\" build:\\n\"); content.append(\" context: .\\n\"); content.append(\" dockerfile: \").append(config.dockerFilePath()).append(\"\\n\"); appendPorts(content, config.ports()); appendVolumes(content, config.volumes()); appendResourceLimits(content, config.cpu(), config.memory()); if (config.volumes() == null || config.volumes().isEmpty()) { content.append(\"volumes:\\n\"); content.append(\" app_data_volume:\\n\"); } return content.toString(); }", "tokens": 153} {"id": 90547, "source": "method", "repo": "BuildCLI/BuildCLI", "text": "protected static void appendVolumes(StringBuilder content, List volumes) { if (volumes != null && !volumes.isEmpty()) { content.append(\" volumes:\\n\"); volumes.stream() .filter(volume -> volume.matches(\"^.+:.+$\")) // Filter volumes with valid format .forEach(volume -> content.append(\" - \") .append(volume.replace(\"\\\\\", \"/\")).append(\"\\n\")); } else { // Add the default named volume if no volume is specified content.append(\" volumes:\\n\"); content.append(\" - app_data_volume:/app/data\\n\"); } }", "tokens": 140} {"id": 90688, "source": "method", "repo": "BuildCLI/BuildCLI", "text": "public static File downloadMaven() throws IOException, InterruptedException { var isWindows = OS.isWindows(); var url = MAVEN_DOWNLOAD_URL + (isWindows ? \"zip\" : \"tar.gz\"); var request = HttpRequest.newBuilder().uri(URI.create(url)).GET().build(); SystemOutLogger.log(\"Downloading Maven artifact from: \" + url); var client = HttpClient.newHttpClient(); SystemOutLogger.log(\"Connecting to \" + url); var response = client.send(request, HttpResponse.BodyHandlers.ofInputStream()); SystemOutLogger.log(\"Connected to \" + url); if (response.statusCode() != 200) { throw new IOException(\"Failed to download maven artifact: \" + response.statusCode()); } long contentLength = response.headers().firstValue(\"Content-Length\").map(MavenInstaller::parseContentLengthToLong).orElse(0L); if (contentLength == 0L) { throw new IOException(\"Failed to download maven artifact: \" + response.statusCode()); } var mavenInstallDir = new File(MAVEN_NAME + (isWindows ? \".zip\" : \".tar.gz\")); if (mavenInstallDir.exists()) { SystemOutLogger.log(\"Cleaning up maven install directory: \" + mavenInstallDir); DirectoryCleanup.cleanup(mavenInstallDir.getAbsolutePath()); } try (var bodyStream = response.body()) { try (var fos = new FileOutputStream(mavenInstallDir)) { byte[] buffer = new byte[1024]; long totalRead = 0; int read; while ((read = bodyStream.read(buffer)) != -1) { fos.write(buffer, 0, read); totalRead += read; int progress = (int) ((totalRead * 100) / contentLength); int progressBarLength = 50; int filledLength = (int) ((progress / 100.0) * progressBarLength); String progressBar = \"=\".repeat(filledLength) + \" \".repeat(progressBarLength - filledLength); System.out.printf(\"\\r[%s] %d%%\", progressBar, progress); } System.out.println(); } } if (!mavenInstallDir.exists()) { throw new IOException(\"Failed to create maven download directory: \" + mavenInstallDir); } return mavenInstallDir; }", "tokens": 486} {"id": 90854, "source": "method", "repo": "BuildCLI/BuildCLI", "text": "void testVal_withRole() { assertEquals(\"role\",JsonProperty.ROLE.val()); }", "tokens": 20} {"id": 91012, "source": "method", "repo": "buildtheearth/terraplusplus", "text": "protected EntryTextField addEntryTextField(int x, int y, int width, int height) { EntryTextField textField = new EntryTextField(this.textFields.size(), this.fontRenderer, x, y, width, height); this.textFields.add(textField); return textField; }", "tokens": 64} {"id": 91035, "source": "method", "repo": "buildtheearth/terraplusplus", "text": "public void toJson(StringBuilder out) { out.insert(0, \"{\\\"\" + this.transformation.name() + \"\\\":{\\\"delegate\\\":\"); this.appendOptions(out); out.append(\"}}\"); }", "tokens": 44} {"id": 91113, "source": "method", "repo": "buildtheearth/terraplusplus", "text": "public String getPermission() { return TerraConstants.MODID + \".commands.terra\"; }", "tokens": 21} {"id": 91386, "source": "method", "repo": "buildtheearth/terraplusplus", "text": "public void generateColumn(Chunk column) { //legacy compat method CachedChunkData data = this.cache.getUnchecked(column.getPos()).join(); this.generateColumn(column, data); }", "tokens": 41} {"id": 91505, "source": "method", "repo": "buildtheearth/terraplusplus", "text": "public double[] fromGeo(double longitude, double latitude) throws OutOfProjectionBoundsException { OutOfProjectionBoundsException.checkLongitudeLatitudeInRange(longitude, latitude); double phi = toRadians(latitude - this.centerY); double lambda = -toRadians(longitude + this.centerX); double k = 2.0d / (1.0d + cos(phi) * cos(lambda)); double x = k * cos(phi) * sin(lambda); double y = k * sin(phi); return new double[]{ x, y }; }", "tokens": 115} {"id": 91654, "source": "method", "repo": "buildtheearth/terraplusplus", "text": "public String getKey() { return this.name; }", "tokens": 13} {"id": 91681, "source": "method", "repo": "buildtheearth/terraplusplus", "text": "public double minZ() { return 0.0d; }", "tokens": 14} {"id": 91706, "source": "method", "repo": "buildtheearth/terraplusplus", "text": "public double minX() { return this.value.minX(); }", "tokens": 14} {"id": 91779, "source": "method", "repo": "buildtheearth/terraplusplus", "text": "protected void split() { //store current values in temporary array and clear self Object[] oldValues = Arrays.copyOf(this.values, this.size); Arrays.fill(this.values, 0, this.size, null); this.size = 0; this.children = createNodeArray(4); //create children array, also marking this node as having been split for (Object value : oldValues) { //re-insert previous values into self //since the children array is now non-null, it will attempt to insert the values into one of the children first this.insert((V) value); } }", "tokens": 132} {"id": 91858, "source": "method", "repo": "burningwave/core", "text": "public void removeLoggingLevelFor(LoggingLevel logLevel, String... classNames) { for (String className : classNames) { getLoggerEntry(className).getValue().remove(logLevel.flags); } }", "tokens": 43} {"id": 91883, "source": "method", "repo": "burningwave/core", "text": "public String toNormalizedCleanedAbsolutePath(String path) { path = clean(path); if (path.chars().filter(ch -> ch == '/').count() == 0 || path.equals(\"/\")) { return path; } return clean(java.nio.file.Paths.get(path).normalize().toAbsolutePath().toString()); }", "tokens": 70} {"id": 91892, "source": "method", "repo": "burningwave/core", "text": "default Map getAllValues() { return Fields.getAll(this); }", "tokens": 20} {"id": 91908, "source": "method", "repo": "burningwave/core", "text": "public FunctionalInterfaceFactory getFunctionalInterfaceFactory() { return getOrCreate(FunctionalInterfaceFactory.class, () -> FunctionalInterfaceFactory.create( getClassFactory() ) ); }", "tokens": 39} {"id": 91932, "source": "method", "repo": "burningwave/core", "text": "String getDefaultPathScannerClassLoaderNameInConfigProperties() { return ByteCodeHunter.Configuration.Key.DEFAULT_PATH_SCANNER_CLASS_LOADER; }", "tokens": 34} {"id": 92161, "source": "method", "repo": "burningwave/core", "text": "Box(MethodHandles.Lookup consulter, E executable, MethodHandle handler) { super(); this.consulter = consulter; this.executable = executable; this.handler = handler; }", "tokens": 42} {"id": 92171, "source": "method", "repo": "burningwave/core", "text": "public boolean hasPackageBeenDefined(String packageName) { return Strings.isEmpty(packageName) || ClassLoaders.retrieveLoadedPackage(this, packageName) != null; }", "tokens": 37} {"id": 92207, "source": "method", "repo": "burningwave/core", "text": "void setFileFilter(FileSystemItem.Criteria scanFileCriteria) { this.fileFilterAndProcessor = scanFileCriteria.createCopy().and().allFileThat((child, pathFIS) -> { JavaClass javaClass = child.toJavaClass(); addByteCode0(javaClass.getName(), javaClass.getByteCode()); return true; }).setExceptionHandler(scanFileCriteria.getExceptionHandler() != null ? scanFileCriteria.getExceptionHandler() : exceptionHandler); }", "tokens": 99} {"id": 92313, "source": "method", "repo": "burningwave/core", "text": "public T waitForTerminatedThreadNotAlive(long pingTime, long tentative) { if (tentative > 0) { while(!isTerminatedThreadNotAlive(pingTime) && (tentative-- > 0)) {} } else { while(!isTerminatedThreadNotAlive(pingTime)) {} } return (T)this; }", "tokens": 75} {"id": 92340, "source": "method", "repo": "burningwave/core", "text": "public > Group waitFor(T task, int priority, boolean ignoreDeadLocked) { if (task.getPriority() != priority) { task.changePriority(priority); } task.waitForFinish(ignoreDeadLocked, false); return this; }", "tokens": 63} {"id": 92452, "source": "method", "repo": "burningwave/core", "text": "public boolean isCompressed() { return computeConventionedAbsolutePathAndExecute(isCompressed); }", "tokens": 19} {"id": 92485, "source": "method", "repo": "burningwave/core", "text": "public static IterableZipContainer create(String absolutePath, InputStream inputStream) { ByteBufferInputStream iS = null; try { if (inputStream instanceof ByteBufferInputStream) { iS = new ByteBufferInputStream(((ByteBufferInputStream)inputStream).toByteBuffer()); } else if (inputStream instanceof FileInputStream) { FileInputStream fileInputStream = (FileInputStream)inputStream; iS = new ByteBufferInputStream(fileInputStream.toByteBuffer()); } else { iS = new ByteBufferInputStream(Streams.toByteBuffer(inputStream)); } if (Streams.isJModArchive(iS.toByteBuffer())) { return createZipFile(absolutePath, iS.toByteBuffer()); } else if (Streams.isArchive(iS.toByteBuffer())) { return new ZipInputStream(absolutePath, new ByteBufferInputStream(iS.toByteBuffer())); } } finally { try { if (iS != null) { iS.close(); } } catch (Throwable exc) { ManagedLoggerRepository.logError(IterableZipContainer.class::getName, exc); } } return null; }", "tokens": 211} {"id": 92490, "source": "method", "repo": "burningwave/core", "text": "public default String getConventionedAbsolutePath() { return getParentContainer().getConventionedAbsolutePath() + getCleanedName(); }", "tokens": 25} {"id": 92560, "source": "method", "repo": "burningwave/core", "text": "public void deepClear(Map map, ThrowingBiConsumer itemDestroyer) throws E { java.util.Iterator> itr = map.entrySet().iterator(); while (itr.hasNext()) { Entry entry = itr.next(); try { itr.remove(); itemDestroyer.accept(entry.getKey(), entry.getValue()); } catch (Throwable exc) { ManagedLoggerRepository.logError(getClass()::getName,\"Exception occurred while removing and cleraring \" + entry.getValue(), exc); } } }", "tokens": 143} {"id": 92584, "source": "method", "repo": "burningwave/core", "text": "public CWO withPriority(Integer priority) { wrappedConfiguration.withPriority(priority); return (CWO)this; }", "tokens": 27} {"id": 92600, "source": "method", "repo": "burningwave/core", "text": "private void setDefaultByteBufferSize(Map config) { String defaultBufferSize = IterableObjectHelper.resolveStringValue( ResolveConfig.forNamedKey(Configuration.Key.BUFFER_SIZE) .on(config) .withDefaultValues(Configuration.DEFAULT_VALUES) ); try { this.defaultBufferSize = Integer.valueOf(defaultBufferSize); } catch (Throwable exc) { String unit = defaultBufferSize.substring(defaultBufferSize.length()-2); String value = defaultBufferSize.substring(0, defaultBufferSize.length()-2); if (unit.equalsIgnoreCase(\"KB\")) { this.defaultBufferSize = new BigDecimal(value).multiply(new BigDecimal(1024)).intValue(); } else if (unit.equalsIgnoreCase(\"MB\")) { this.defaultBufferSize = new BigDecimal(value).multiply(new BigDecimal(1024 * 1024)).intValue(); } else { this.defaultBufferSize = Integer.valueOf(value); } } ManagedLoggerRepository.logInfo(getClass()::getName, \"default buffer size: {} bytes\", this.defaultBufferSize); }", "tokens": 228} {"id": 92882, "source": "method", "repo": "byronka/minum", "text": "/** See {@link RuntimeException#RuntimeException(String)} */ public MinumSecurityException(String message) { super(message); }", "tokens": 28} {"id": 92888, "source": "method", "repo": "byronka/minum", "text": "public Constants() { this(null); }", "tokens": 10} {"id": 92940, "source": "method", "repo": "byronka/minum", "text": "private static char checkAgainstWhitelistChars(String path, int i) { char c = path.charAt(i); boolean isWhitelistedChar = c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c == '-' || c == '_' || c == '.' || c == '\\\\' || c == '/'; if (!isWhitelistedChar) { throw new ForbiddenUseException(\"filename (\" + path + \") contained invalid characters (\" + c + \"). Allowable characters are alpha-numeric ascii both cases, underscore, forward and backward-slash, period, and dash\"); } return c; }", "tokens": 148} {"id": 92954, "source": "method", "repo": "byronka/minum", "text": "public int getLimit() { return limit; }", "tokens": 11} {"id": 92974, "source": "method", "repo": "byronka/minum", "text": "/** Handles the parsing of the body data for either form-urlencoded or multipart/form-data @param contentType a mime value which must be either application/x-www-form-urlencoded or multipart/form-data. Anything else will cause a new Body to be created with the body bytes, unparsed. There are a number of cases where this makes sense - if the user is sending us plain text, html, json, or css, we want to simply accept the data and not try to parse it. */ Body extractBodyFromInputStream(long contentLength, String contentType, InputStream is) { // if the body is zero bytes long, just return if (contentLength == 0L) { logger.logDebug(() -> \"the length of the body was 0, returning an empty Body\"); return Body.EMPTY; } if (contentType.contains(\"application/x-www-form-urlencoded\")) { return parseUrlEncodedForm(is, contentLength); } else if (contentType.contains(\"multipart/form-data\")) { String boundaryValue = determineBoundaryValue(contentType); return parseMultipartForm(contentLength, boundaryValue, is); } else { logger.logDebug(() -> \"did not recognize a key-value pattern content-type, returning the raw bytes for the body. Content-Type was: \" + contentType); // we can return the whole byte array here because we never read from it try { return new Body(Map.of(), inputStreamUtils.read((int) contentLength, is), List.of(), BodyType.UNRECOGNIZED); } catch (IOException e) { throw new WebServerException(\"Error in BodyProcessor.extractBodyFromInputStream\", e); } } }", "tokens": 352} {"id": 93027, "source": "method", "repo": "byronka/minum", "text": "private PathDetails extractPathDetails(String path, String rawFullStartLine) { PathDetails pd; // the request line will have a forward slash at the beginning of // the path. Remove that here. if (path.charAt(0) != '/') { throw new BadRequestException(\"Minum only handles origin-form request targets. Our input: \" + path + \". Full line: \" + rawFullStartLine); } String adjustedPath = path.substring(1); int locationOfQueryBegin = adjustedPath.indexOf(\"?\"); if (locationOfQueryBegin >= 0) { // in this case, we found a question mark, suggesting that a query string exists String rawQueryString = adjustedPath.substring(locationOfQueryBegin + 1); String isolatedPath = adjustedPath.substring(0, locationOfQueryBegin); Map queryString = extractMapFromQueryString(rawQueryString); pd = new PathDetails(isolatedPath, rawQueryString, queryString); } else { // in this case, no question mark was found, thus no query string pd = new PathDetails(adjustedPath, null, null); } return pd; }", "tokens": 246} {"id": 93063, "source": "method", "repo": "byronka/minum", "text": "public byte[] readAllBytes() { var baos = new ByteArrayOutputStream(); while (true) { int result; result = read(); if (result == -1) { return baos.toByteArray(); } baos.write((byte)result); } }", "tokens": 52} {"id": 93076, "source": "method", "repo": "byronka/minum", "text": "/** Compress the data in this body using gzip.
This operates by getting the body field from this instance of {@link Response} and creating a new Response with the compressed data. @param out this is provided as a parameter for better control during testing */ static void compressBody(OutputStream out, byte[] body) { try (var gos = new GZIPOutputStream(out)) { gos.write(body); gos.finish(); } catch (IOException e) { throw new WebServerException(\"Error in Response.compressBody\", e); } }", "tokens": 118} {"id": 93256, "source": "method", "repo": "byronka/minum", "text": "public void happyPath() { TagInfo tagInfo = new TagInfo(TagName.P, Map.of(\"class\", \"foo\")); assertEquals(tagInfo.toString(), \"TagInfo{tagName=P, attributes={class=foo}}\"); }", "tokens": 52} {"id": 93490, "source": "method", "repo": "byronka/minum", "text": "/** If the system running file still exists when we start the application, it will fail. */ public void testFullSystem_SystemRunningFileExists() { var fileUtils = new FakeFileUtils(); fileUtils.existsValue = true; FullSystem.createSystemRunningFile(true, logger, fileUtils); assertTrue(logger.doesMessageExist(\"the SYSTEM_RUNNING file existed when we started Minum. This should not happen unless Minum was crash-closed before.\")); }", "tokens": 99} {"id": 93520, "source": "method", "repo": "byronka/minum", "text": "public void test_GetRawValue() { var startLine = new RequestLine( GET, new PathDetails(\"mypath\", \"\", Map.of()), ONE_DOT_ONE, \"testing test\", context.getLogger()); String rawValue = startLine.getRawValue(); assertEquals(rawValue, \"testing test\"); }", "tokens": 65} {"id": 93621, "source": "method", "repo": "cacheflowe/haxademic", "text": "public static AppWindow instance() { if(instance != null) return instance; instance = new AppWindow(); return instance; }", "tokens": 27} {"id": 93893, "source": "method", "repo": "cacheflowe/haxademic", "text": "public static void copy(Path source, Path dest) { try { Files.copy(source, dest, StandardCopyOption.REPLACE_EXISTING); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } }", "tokens": 50} {"id": 94237, "source": "method", "repo": "cacheflowe/haxademic", "text": "protected void config() { Config.setProperty( AppSettings.WIDTH, 1000 ); Config.setProperty( AppSettings.HEIGHT, 600 ); Config.setProperty( AppSettings.FULLSCREEN, true ); }", "tokens": 50} {"id": 94390, "source": "method", "repo": "cacheflowe/haxademic", "text": "public void update() { if(_updateComplete == true) { _updateComplete = false; if(_loader == null) _loader = new KinectUpdater(); _updateThread = new Thread( _loader ); _updateThread.start(); } }", "tokens": 62} {"id": 94402, "source": "method", "repo": "cacheflowe/haxademic", "text": "protected void firstFrame() { GamepadState.instance(); DebugView.autoHide(false); DebugView.active(true); }", "tokens": 29} {"id": 94427, "source": "method", "repo": "cacheflowe/haxademic", "text": "protected void firstFrame() { easings = new IEasingValue[] { new EasingFloat(0, 0.2f), new LinearFloat(0, 5), new ElasticFloat(0, .75f, .40f), }; }", "tokens": 61} {"id": 94445, "source": "method", "repo": "cacheflowe/haxademic", "text": "protected void triggerParticles(int index) { int partiColor = ColorsHax.colorFromGroupAt(8, index); if(index == 0) { launchParticleSize(80, 140, partiColor); } else if(index == 1) { launchParticleSize(80, 140, partiColor); } else if(index == 2) { launchParticleSize(80, 140, partiColor); } else if(index == 3) { launchParticleSize(80, 140, partiColor); } else if(index == 4) { launchParticleSize(80, 140, partiColor); } else if(index == 5) { launchParticleSize(80, 140, partiColor); } else if(index == 6) { launchParticleSize(80, 140, partiColor); } else if(index == 7) { launchParticleSize(80, 140, partiColor); } }", "tokens": 238} {"id": 94515, "source": "method", "repo": "cambridge-cares/theworldavatar", "text": "public void resetAPIMock() { aqMeshAPIMock.resetAll(); }", "tokens": 18} {"id": 94523, "source": "method", "repo": "cambridge-cares/theworldavatar", "text": "public JSONObject retrieve(String ID) { return assetRetriever.retrieve(ID); }", "tokens": 18} {"id": 94533, "source": "method", "repo": "cambridge-cares/theworldavatar", "text": "public String getPreserveWhiteSpace() { return preserveWhiteSpace; }", "tokens": 13} {"id": 94597, "source": "method", "repo": "cambridge-cares/theworldavatar", "text": "public JSONObject processRequestParameters(JSONObject requestParams) { JSONObject jsonMessage = new JSONObject(); if (validateInput(requestParams)) { LOGGER.info(\"Passing request to ESPHome Update Agent..\"); String agentProperties = System.getenv(requestParams.getString(KEY_AGENTPROPERTIES)); String clientProperties = System.getenv(requestParams.getString(KEY_CLIENTPROPERTIES)); String apiProperties = System.getenv(requestParams.getString(KEY_APIPROPERTIES)); String[] args = new String[] {agentProperties,clientProperties,apiProperties}; jsonMessage = initializeAgent(args); jsonMessage.accumulate(\"Result\", \"Timeseries Data has been updated.\"); requestParams = jsonMessage; } else { jsonMessage.put(\"Result\", \"Request parameters are not defined correctly.\"); requestParams = jsonMessage; } return requestParams; }", "tokens": 175} {"id": 94664, "source": "method", "repo": "cambridge-cares/theworldavatar", "text": "/** Initialise the instance that stores the content in the MoDS input file. */ public void init() { mods = new MoDS(); modsJsonNode = new ObjectMapper().createObjectNode(); }", "tokens": 40} {"id": 94690, "source": "method", "repo": "cambridge-cares/theworldavatar", "text": "/** Generate Cases node in MoDS input file. @param cases @throws IOException @throws MoDSDataDrivenAgentException */ public void collectCases(LinkedHashMap> cases) throws IOException, MoDSDataDrivenAgentException { for (String i : cases.keySet()) { String caseJson = new JSONObject().put(\"name\", i) .put(\"models\", collectSimplifiedModels(cases.get(i))).toString(); JsonNode locatedNode = modsJsonNode.path(\"cases\").path(\"case\"); ArrayNode addedNode = ((ArrayNode) locatedNode).add(new ObjectMapper().readTree(caseJson)); } }", "tokens": 136} {"id": 94692, "source": "method", "repo": "cambridge-cares/theworldavatar", "text": "/** Put the selected reactions from two responses into one list. @param rxnList1 @param rxnList2 @return @throws IOException @throws MoDSDataDrivenAgentException */ private List mergeTwoRxnLists(List rxnList1, List rxnList2) throws IOException, MoDSDataDrivenAgentException { for (String res : rxnList2) { if (!rxnList1.contains(res)) { rxnList1.add(res); } } return rxnList1; }", "tokens": 124} {"id": 94743, "source": "method", "repo": "cambridge-cares/theworldavatar", "text": "/** Checks whether a time series exists by checking whether any of the IRIs that should be attached to the time series is not initialised in the central RDB lookup table using the time series client. @param iris The IRIs that should be attached to the same time series provided as list of strings. @return True if all IRIs have a time series attached, false otherwise. */ private boolean timeSeriesExist(List iris) { // If any of the IRIs does not have a time series the time series does not exist for(String iri: iris) { try { if (!tsClient.checkDataHasTimeSeries(iri)) { return false; } // If central RDB lookup table (\"dbTable\") has not been initialised, the time series does not exist } catch (DataAccessException e) { if (e.getMessage().contains(\"ERROR: relation \\\"dbTable\\\" does not exist\")) { return false; } else { throw e; } } } return true; }", "tokens": 210} {"id": 95086, "source": "method", "repo": "cambridge-cares/theworldavatar", "text": "public void setMode(boolean mode) { this.mode = mode; }", "tokens": 17} {"id": 95113, "source": "method", "repo": "cambridge-cares/theworldavatar", "text": "public String getOntoChemKBSingleSpeciesMechPreamble() { return ontoChemKBSingleSpeciesMechPreamble; }", "tokens": 29} {"id": 95132, "source": "method", "repo": "cambridge-cares/theworldavatar", "text": "/** Detects the termination of a note attached to the current species. @param qName */ private void endNote(String qName){ if (qName.equalsIgnoreCase(appConfigCtml.getCtmlSpeciesDataSpeciesNote())) { String note = multiLineValue.toString(); iSpeciesWriter.writeNote(note); } }", "tokens": 69} {"id": 95469, "source": "method", "repo": "capacitor-community/admob", "text": "public void showInterstitial(final PluginCall call) { adInterstitialExecutor.showInterstitial(call, this::notifyListeners); }", "tokens": 28} {"id": 95498, "source": "method", "repo": "capacitor-community/admob", "text": "/** Gets a string error reason from an error code. */ public static String getRequestErrorReason(int errorCode) { switch (errorCode) { case AdRequest.ERROR_CODE_INTERNAL_ERROR: return \"Internal error\"; case AdRequest.ERROR_CODE_INVALID_REQUEST: return \"Invalid request\"; case AdRequest.ERROR_CODE_NETWORK_ERROR: return \"Network Error\"; case AdRequest.ERROR_CODE_NO_FILL: return \"No fill\"; case AdRequest.ERROR_CODE_APP_ID_MISSING: return \"App Id Missing\"; default: return \"Unknown error\"; } }", "tokens": 127} {"id": 95653, "source": "method", "repo": "capacitor-community/camera-preview", "text": "private void handleCameraPermissionResult(PluginCall call) { if (PermissionState.GRANTED.equals(getPermissionState(CAMERA_PERMISSION_ALIAS))) { startCamera(call); } else { Logger.debug(getLogTag(), \"User denied camera permission: \" + getPermissionState(CAMERA_PERMISSION_ALIAS).toString()); call.reject(\"Permission failed: user denied access to camera.\"); } }", "tokens": 84} {"id": 95719, "source": "method", "repo": "capacitor-community/camera-preview", "text": "public void surfaceCreated(SurfaceHolder holder) { mHolder = holder; if (mSurfaceView != null) { mSurfaceView.setWillNotDraw(false); } // surfaceCreated carries no size; surfaceChanged always follows with the real one. Only // declare the output usable once a size is known, otherwise no preview size can be chosen. handleOutputAvailable(mSurfaceView != null ? mSurfaceView.getWidth() : 0, mSurfaceView != null ? mSurfaceView.getHeight() : 0); }", "tokens": 104} {"id": 95770, "source": "method", "repo": "capacitor-community/camera-preview", "text": "public void captureWhileNotResumed_rejects() { assertEquals(CaptureCoordinator.NO_CAPTURE, coordinator.beginCapture(true, true, false, reporter)); assertEquals(1, errors.size()); assertEquals(CaptureCoordinator.ERROR_NOT_RESUMED, errors.get(0)); }", "tokens": 62} {"id": 95882, "source": "method", "repo": "cardillan/mindcode", "text": "public SetI(LStatement statement) { super(statement); result = assembler.var(statement.arg0()); source = assembler.var(statement.arg1()); }", "tokens": 39} {"id": 95885, "source": "method", "repo": "cardillan/mindcode", "text": "public LGlobalVars60(MindustryMetadata metadata) { super(metadata); varTime = put(\"@time\", startTime); varTick = put(\"@tick\", 0); }", "tokens": 38} {"id": 95942, "source": "method", "repo": "cardillan/mindcode", "text": "public TerminalNode REQUIRE() { return getToken(MindcodeParser.REQUIRE, 0); }", "tokens": 19} {"id": 96135, "source": "method", "repo": "cardillan/mindcode", "text": "default boolean isInputOnly() { return hasInModifier() && !hasOutModifier(); }", "tokens": 20} {"id": 96144, "source": "method", "repo": "cardillan/mindcode", "text": "public boolean hasInModifier() { return argument.hasInModifier(); }", "tokens": 16} {"id": 96157, "source": "method", "repo": "cardillan/mindcode", "text": "protected boolean isVolatile(LogicInstruction instruction) { return instruction.inputArgumentsStream().anyMatch(variable -> isVolatile(instruction, variable)); }", "tokens": 30} {"id": 96200, "source": "method", "repo": "cardillan/mindcode", "text": "private boolean hasNoReferences(LogicLabel label) { List references = labelReferences.get(label); return references == null || references.isEmpty(); }", "tokens": 36} {"id": 96272, "source": "method", "repo": "cardillan/mindcode", "text": "public void setValue(ContextfulInstructionCreator creator, LogicValue value) { throw new MindcodeInternalError(\"Unsupported for \" + getClass().getSimpleName()); }", "tokens": 34} {"id": 96317, "source": "method", "repo": "cardillan/mindcode", "text": "default boolean isInvertible(GlobalCompilerProfile profile) { return getCondition().hasInverse(profile); }", "tokens": 23} {"id": 96336, "source": "method", "repo": "cardillan/mindcode", "text": "default boolean isTargetGuard() { return (boolean) getInfo(InstructionInfo.TARGET_GUARD); }", "tokens": 23} {"id": 96388, "source": "method", "repo": "cardillan/mindcode", "text": "public String encode() { BigInteger multiple = BigInteger.ONE; BigInteger encoded = BigInteger.ZERO; for (CompilerOption option : options.values()) { int size = option.encodeSize(); if (size > 1 && !option.getMultiplicity().matchesMultiple() && !skippedOptions.contains(option.getOption())) { BigInteger next = multiple.multiply(BigInteger.valueOf(option.encode())); encoded = encoded.add(next); multiple = multiple.multiply(BigInteger.valueOf(size)); } } return encoded.toString(Character.MAX_RADIX); }", "tokens": 117} {"id": 96436, "source": "method", "repo": "cardillan/mindcode", "text": "public TestOptimizerContext(MessageConsumer messageConsumer) { super(messageConsumer); }", "tokens": 18} {"id": 96444, "source": "method", "repo": "cardillan/mindcode", "text": "void parsesFunctionsInExpressions() { assertParses(\"\"\" x.a(z) + y.b(z); a(b(c())); \"\"\"); }", "tokens": 34} {"id": 96456, "source": "method", "repo": "cardillan/mindcode", "text": "void buildsCompoundAssignmentsWithArrays() { assertBuildsTo(\"\"\" a[b] += c[d]; \"\"\", List.of( new AstAssignment(EMPTY, ADD, new AstArrayAccess(EMPTY, a, b), new AstArrayAccess(EMPTY, c, d) ) ) ); }", "tokens": 66} {"id": 96476, "source": "method", "repo": "cardillan/mindcode", "text": "public VariablesContextImpl(MessageConsumer messageConsumer, CompilerProfile compilerProfile, InstructionProcessor instructionProcessor) { super(messageConsumer); this.compilerProfile = compilerProfile; this.instructionProcessor = instructionProcessor; this.nameCreator = new StandardNameCreator(false); }", "tokens": 59} {"id": 96570, "source": "method", "repo": "cardillan/mindcode", "text": "void eliminatesUnusedReturnValues() { assertCompilesTo(\"\"\" def foo(n) print(n); n * 2; end; foo(2); foo(4); \"\"\", createInstruction(SET, \":foo:n\", \"2\"), createInstruction(SETADDR, \":foo*retaddr\", label(1)), createInstruction(CALL, label(0), \"*invalid\", \":foo*retval\"), createInstruction(LABEL, label(1)), createInstruction(SET, \":foo:n\", \"4\"), createInstruction(SETADDR, \":foo*retaddr\", label(2)), createInstruction(CALL, label(0), \"*invalid\", \":foo*retval\"), createInstruction(LABEL, label(2)), createInstruction(END), createInstruction(LABEL, label(0)), createInstruction(PRINT, \":foo:n\"), createInstruction(RETURN, \":foo*retaddr\") ); }", "tokens": 197} {"id": 96698, "source": "method", "repo": "cardillan/mindcode", "text": "/** {@inheritDoc}

The default implementation returns the result of calling {@link #visitChildren} on {@code ctx}.

*/ public T visitBlock(SchemacodeParser.BlockContext ctx) { return visitChildren(ctx); }", "tokens": 51} {"id": 96716, "source": "method", "repo": "cardillan/mindcode", "text": "private void invalidate(T block) { Position min = lowerLeft.apply(block); Position max = upperRight.apply(block); for (int x = min.x(); x <= max.x(); x++) { for (int y = min.y(); y <= max.y(); y++) { int key = Position.pack(x, y); if (blockMap.get(key) == block) { blockMap.remove(key); positionMap.remove(key); } } } block.invalidate(); }", "tokens": 111} {"id": 96753, "source": "method", "repo": "cardillan/mindcode", "text": "public LocalWebSocketClient(URI serverUri) { super(serverUri); }", "tokens": 15} {"id": 97133, "source": "method", "repo": "carlanton/m3u8-parser", "text": "public void parse5() throws Exception { parser.readPlaylist(Paths.get(\"src/test/resources/media/variant.m3u8\")); }", "tokens": 34} {"id": 97214, "source": "method", "repo": "carml/carml", "text": "public static Model reverseDescribeResource(@NonNull Model model, @NonNull Resource resource) { return model.filter(null, null, resource) .stream() .flatMap(statement -> { Resource subject = statement.getSubject(); return subject instanceof BNode ? Stream.concat(Stream.of(statement), reverseDescribeResource(model, subject).stream()) : Stream.of(statement); }) .collect(ModelCollector.toModel()); }", "tokens": 94} {"id": 97241, "source": "method", "repo": "carml/carml", "text": "void givenShallowModel_whenSymmetricDescribeResource_thenReturnShallowSymmetricDescription() { // Given Model model = Models.parse(Objects.requireNonNull(ModelsTest.class.getResourceAsStream(\"toDescribeShallow.ttl\")), RDFFormat.TURTLE); IRI resource = VALUE_FACTORY.createIRI(\"http://example.com/Fourth\"); // When Model described = Models.symmetricDescribeResource(model, resource); // Then assertThat(described, isIsomorphicWith( Models.parse(Objects.requireNonNull(ModelsTest.class.getResourceAsStream(\"symmetricDescribedShallow.ttl\")), RDFFormat.TURTLE))); }", "tokens": 134} {"id": 97289, "source": "method", "repo": "carml/carml", "text": "public MappingContext build() { var actionableTriplesMaps = Mappings.filterMappable(triplesMappers.stream() .map(TriplesMapper::getTriplesMap) .filter(triplesMap -> triplesMapFilter.isEmpty() || triplesMapFilter.contains(triplesMap)) .collect(toSet())); var filteredTriplesMappersPerLogicalSource = triplesMappers.stream() .filter(triplesMapper -> actionableTriplesMaps.contains(triplesMapper.getTriplesMap())) .collect(groupingBy(triplesMapper -> triplesMapper.getTriplesMap() .getLogicalSource(), toSet())); var filteredLogicalSourcesPerSource = filteredTriplesMappersPerLogicalSource.keySet() .stream() .collect(groupingBy(LogicalSource::getSource, toSet())); Map, TriplesMapper> filteredRefObjectMapperToParentTriplesMapper = refObjectMapperToParentTriplesMapper.entrySet() .stream() .filter(entry -> actionableTriplesMaps.contains(entry.getKey() .getTriplesMap())) .collect(Collectors.toUnmodifiableMap(Map.Entry::getKey, Map.Entry::getValue)); return new MappingContext<>(actionableTriplesMaps, filteredTriplesMappersPerLogicalSource, filteredLogicalSourcesPerSource, filteredRefObjectMapperToParentTriplesMapper); }", "tokens": 249} {"id": 97354, "source": "method", "repo": "carml/carml", "text": "public Model mapToModel(@NonNull InputStream inputStream, Set triplesMapFilter) { return toModel(map(inputStream, triplesMapFilter)); }", "tokens": 33} {"id": 97415, "source": "method", "repo": "carml/carml", "text": "default Optional unpackFileSource(Object source) { if (source instanceof String) { // Standard rml:source return Optional.of((String) source); } else if (source instanceof FileSource) { // Extended Carml source return Optional.of(((FileSource) source).getUrl()); } else { return Optional.empty(); } }", "tokens": 77} {"id": 97437, "source": "method", "repo": "carml/carml", "text": "public Set getExpressions() { return expressions; }", "tokens": 14} {"id": 97455, "source": "method", "repo": "carml/carml", "text": "void testEqualLogicalSourceException() { RuntimeException exception = assertThrows(RuntimeException.class, () -> testMapping(\"RmlMapper\", \"/RmlMapper/exceptionTests/exceptionEqualLogicalSourceMapping.rml.ttl\", null)); assertThat(exception.getMessage(), startsWith(\"Logical sources are not equal.\")); }", "tokens": 60} {"id": 97468, "source": "method", "repo": "carml/carml", "text": "void testMapping(String contextPath, String rmlPath, String outputPath) { testMapping(contextPath, rmlPath, outputPath, m -> { }, Map.of()); }", "tokens": 40} {"id": 97520, "source": "method", "repo": "carml/carml", "text": "void testCsvPipeDelimeterMapping() { testMapping(\"RmlMapper\", \"/RmlMapper/csv/cars-pipe.rml.ttl\", \"/RmlMapper/csv/cars.output.ttl\"); }", "tokens": 43} {"id": 97619, "source": "method", "repo": "carml/carml", "text": "public String getRelativeFileLocation() { String urlString = downloadUrl.stringValue(); return urlString.substring(urlString.lastIndexOf(\"master/\") + 7); }", "tokens": 37} {"id": 97640, "source": "method", "repo": "carml/carml", "text": "static CarmlParentSideJoinConditionStore of(String name, ConcurrentMap> parentSideJoinConditionStore) { return new CarmlParentSideJoinConditionStore<>(name, parentSideJoinConditionStore); }", "tokens": 60} {"id": 97780, "source": "method", "repo": "carml/carml", "text": "public Set getClasses() { return classes; }", "tokens": 14} {"id": 97853, "source": "method", "repo": "carml/carml", "text": "void givenIriResourceCollection_whenLog_thenLogIris() { // Given var resources = List.of(triplesMap, subjectMap); // When var logMsg = LogUtil.log(resources); // Then assertThat(logMsg, equalToCompressingWhiteSpace(\"resource ,\" // + \" resource \")); }", "tokens": 81} {"id": 98044, "source": "method", "repo": "catcoderr/protocolsidebar", "text": "/** Add a line to the sidebar with dynamic text. @param updater - the function that updates the text @return SidebarLine instance */ public SidebarLine addUpdatableLine(@NonNull ThrowingFunction updater) { return addLine(updater, false, SidebarLine.ALWAYS_VISIBLE); }", "tokens": 70} {"id": 98053, "source": "method", "repo": "catcoderr/protocolsidebar", "text": "/** Update the single line. @param line target line. */ public void updateLine(@NonNull SidebarLine line) { synchronized (lines) { Preconditions.checkArgument(lines.contains(line), \"Line %s is not a part of this sidebar\", line); broadcast(p -> line.updateTeam(p, objective.getName())); } }", "tokens": 74} {"id": 98162, "source": "method", "repo": "catcoderr/protocolsidebar", "text": "private static FieldAccessor getField(Class target, String name, Class fieldType, int index) { for (final Field field : target.getDeclaredFields()) { if ((name == null || field.getName().equals(name)) && fieldType.isAssignableFrom(field.getType()) && index-- <= 0) { field.setAccessible(true); // A function for retrieving a specific field value return new FieldAccessor() { @Override public Field handle() { return field; } @Override @SuppressWarnings(\"unchecked\") public T get(Object target) { try { return (T) field.get(target); } catch (IllegalAccessException e) { throw new RuntimeException(\"Cannot access reflection.\", e); } } @Override public void set(Object target, Object value) { try { field.set(target, value); } catch (IllegalAccessException e) { throw new RuntimeException(\"Cannot access reflection.\", e); } } @Override public boolean hasField(Object target) { // target instanceof DeclaringClass return field.getDeclaringClass().isAssignableFrom(target.getClass()); } }; } } // Search in parent classes if (target.getSuperclass() != null) return getField(target.getSuperclass(), name, fieldType, index); throw new IllegalArgumentException(\"Cannot find field with type \" + fieldType); }", "tokens": 279} {"id": 98221, "source": "method", "repo": "catcoderr/protocolsidebar", "text": "public String toString() { // Convert to a String that we can parse back again return String.format(\"(MC: %s)\", this.getVersion()); }", "tokens": 34} {"id": 98296, "source": "method", "repo": "chargetimeeu/java-oca-ocpp", "text": "public void setAsyncRequestHandler(boolean async) { this.handleRequestAsync = async; }", "tokens": 20} {"id": 98456, "source": "method", "repo": "chargetimeeu/java-oca-ocpp", "text": "public Class getConfirmationType() { return InstallCertificateResponse.class; }", "tokens": 21} {"id": 98469, "source": "method", "repo": "chargetimeeu/java-oca-ocpp", "text": "public ServerAvailabilityFunction(ServerAvailabilityEventHandler eventHandler) { this.eventHandler = eventHandler; features = new ArrayList<>(); features.add(new ChangeAvailabilityFeature(null)); features.add(new NotifyEventFeature(this)); features.add(new StatusNotificationFeature(this)); }", "tokens": 61} {"id": 98521, "source": "method", "repo": "chargetimeeu/java-oca-ocpp", "text": "/** Sets charging schedule structure defines a list of charging periods, as used in: GetCompositeSchedule.conf and ChargingProfile. @param chargingSchedule Charging schedule structure defines a list of charging periods, as used in: GetCompositeSchedule.conf and ChargingProfile */ public void setChargingSchedule(@Nullable ChargingSchedule[] chargingSchedule) { if (!isValidChargingSchedule(chargingSchedule)) { throw new PropertyConstraintException(chargingSchedule, \"chargingSchedule is invalid\"); } this.chargingSchedule = chargingSchedule; }", "tokens": 108} {"id": 98585, "source": "method", "repo": "chargetimeeu/java-oca-ocpp", "text": "public int hashCode() { return Objects.hash( customData, acChargingParameters, dcChargingParameters, requestedEnergyTransfer, departureTime); }", "tokens": 33} {"id": 98663, "source": "method", "repo": "chargetimeeu/java-oca-ocpp", "text": "public NotifyPeriodicEventStreamFeature(Function ownerFunction) { super(ownerFunction); }", "tokens": 20} {"id": 98984, "source": "method", "repo": "chargetimeeu/java-oca-ocpp", "text": "/** Sets name of instance in case the variable exists as multiple instances. Case Insensitive. strongly advised to use Camel Case. @param instance Name of instance in case the variable exists as multiple instances */ public void setInstance(@Nullable String instance) { if (!isValidInstance(instance)) { throw new PropertyConstraintException(instance, \"instance is invalid\"); } this.instance = instance; }", "tokens": 83} {"id": 99065, "source": "method", "repo": "chat21/chat21-android-sdk", "text": "public void setEmail(String email) { Log.d(DEBUG_LOGIN, \"setEmail: email == \" + email); this.email = email; }", "tokens": 34} {"id": 99237, "source": "method", "repo": "chat21/chat21-android-sdk", "text": "public void removePresenceListener(MyPresenceListener myPresenceListener) { if (isListenerAdded(myPresenceListener)) myPresenceListeners.remove(myPresenceListener); }", "tokens": 36} {"id": 99510, "source": "method", "repo": "chat21/chat21-android-sdk", "text": "/** Creates a divider {@link RecyclerView.ItemDecoration} that can be used with a {@link android.support.v7.widget.LinearLayoutManager}. @param context Current context, it will be used to access resources. @param orientation Divider orientation. Should be {@link #HORIZONTAL} or {@link #VERTICAL}. */ public ItemDecoration(Context context, int orientation, Drawable divider) { super(context, orientation); mContext = context; mDivider = divider; }", "tokens": 96} {"id": 99702, "source": "method", "repo": "chat21/chat21-android-sdk", "text": "/** Set zoom to the specified scale. Image will be centered around the point (focusX, focusY). These floats range from 0 to 1 and denote the focus point as a fraction from the left and top of the view. For example, the top left corner of the image would be (0, 0). And the bottom right corner would be (1, 1). @param scale @param focusX @param focusY @param scaleType */ public void setZoom(float scale, float focusX, float focusY, ScaleType scaleType) { // // setZoom can be called before the image is on the screen, but at this point, // image and view sizes have not yet been calculated in onMeasure. Thus, we should // delay calling setZoom until the view has been measured. // if (!onDrawReady) { delayedZoomVariables = new ZoomVariables(scale, focusX, focusY, scaleType); return; } if (scaleType != mScaleType) { setScaleType(scaleType); } resetZoom(); scaleImage(scale, viewWidth / 2, viewHeight / 2, true); matrix.getValues(m); m[Matrix.MTRANS_X] = -((focusX * getImageWidth()) - (viewWidth * 0.5f)); m[Matrix.MTRANS_Y] = -((focusY * getImageHeight()) - (viewHeight * 0.5f)); matrix.setValues(m); fixTrans(); setImageMatrix(matrix); }", "tokens": 327} {"id": 99757, "source": "method", "repo": "Chipppppppppp/LIME", "text": "public void hook(LimeOptions limeOptions, XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable { if (!limeOptions.archived.checked) return; XposedBridge.hookAllMethods(Application.class, \"onCreate\", new XC_MethodHook() { @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { Application appContext = (Application) param.thisObject; if (appContext == null) return; File dbFile = appContext.getDatabasePath(\"naver_line\"); if (!dbFile.exists()) return; SQLiteDatabase.OpenParams dbParams = new SQLiteDatabase.OpenParams.Builder() .addOpenFlags(SQLiteDatabase.OPEN_READWRITE) .build(); SQLiteDatabase db = SQLiteDatabase.openDatabase(dbFile, dbParams); hookSAMethod(loadPackageParam, db, appContext); hookMessageDeletion(loadPackageParam, appContext, db, appContext); } }); }", "tokens": 205} {"id": 100142, "source": "method", "repo": "chiselsandbits/chisels-and-bits", "text": "private void includeNorthAxis(final IChiselingContext context, final boolean airOnly, final Vec3 hitBlockPosVector, final Vec3 inBlockBitVector) { if (bitsPerSide == 1) { for (int zOff = 0; zOff < inBlockBitVector.z(); zOff++) { final Vec3 targetBit = inBlockBitVector.subtract(0, 0, zOff); final Vec3 inWorldOffset = clampVectorToBlockAlongAxis(targetBit.multiply(StateEntrySize.current().getSizePerBit(), StateEntrySize.current().getSizePerBit(), StateEntrySize.current().getSizePerBit()), Direction.Axis.Y); final Vec3 inWorldTarget = hitBlockPosVector.add(inWorldOffset); if (context.getInAreaTarget(inWorldTarget).map(state -> !state.getBlockInformation().isAir() ^ airOnly).orElse(airOnly)) { context.include(inWorldTarget); } else { return; } } return; } for (int xOff = -bitsPerSide / 2; xOff < bitsPerSide / 2; xOff++) { for (int yOff = -bitsPerSide / 2; yOff < bitsPerSide / 2; yOff++) { for (int zOff = 0; zOff < inBlockBitVector.z(); zOff++) { final Vec3 targetBit = inBlockBitVector.subtract(xOff, yOff, zOff); final Vec3 inWorldOffset = clampVectorToBlockAlongAxis(targetBit.multiply(StateEntrySize.current().getSizePerBit(), StateEntrySize.current().getSizePerBit(), StateEntrySize.current().getSizePerBit()), Direction.Axis.Y); final Vec3 inWorldTarget = hitBlockPosVector.add(inWorldOffset); if (context.getInAreaTarget(inWorldTarget).map(state -> !state.getBlockInformation().isAir() ^ airOnly).orElse(airOnly)) { context.include(inWorldTarget); } else { break; } } } } }", "tokens": 438} {"id": 100185, "source": "method", "repo": "chiselsandbits/chisels-and-bits", "text": "public Consumer newQuadProcessor(GreedyMeshFace region, @Nullable Direction cullDirection) { return quad -> { final ChiseledBlockModelPartKey key = new ChiseledBlockModelPartKey( region.faceValue(), region.faceValue().blockState(), quad.source().part().ambientOcclusion(), quad.source().part().particleMaterial(), quad.quad().materialInfo().flags() ); final QuadCollection.Builder builder = partBuilders.computeIfAbsent( key, $ -> new QuadCollection.Builder() ); var materialIndex = material(region.faceValue(), quad.quad().materialInfo().tintIndex()); var quadBuilder = new BakedQuadBuilder(quad.quad().materialInfo()); quadBuilder.from(quad.quad()); quadBuilder.tintIndex(materialIndex); var bakedQuad = quadBuilder.build(); if (region.isOnOuterFace() && cullDirection != null) { builder.addCulledFace(cullDirection, bakedQuad); } else { builder.addUnculledFace(bakedQuad); } }; }", "tokens": 232} {"id": 100284, "source": "method", "repo": "chiselsandbits/chisels-and-bits", "text": "private void bakeProviders() { if (!providers.isEmpty()) return; preBakeProviders.forEach((block, provider) -> providers.put(block.get(), provider)); preBakeProviders.clear(); }", "tokens": 44} {"id": 100370, "source": "method", "repo": "chiselsandbits/chisels-and-bits", "text": "public void appendHoverText( @NotNull ItemStack stack, Item.@NotNull TooltipContext context, @NotNull TooltipDisplay tooltipDisplay, @NotNull Consumer tooltipAdder, @NotNull TooltipFlag flag) { super.appendHoverText(stack, context, tooltipDisplay, tooltipAdder, flag); HelpTextUtils.build(LocalStrings.ChiselStationHelp, tooltipAdder); }", "tokens": 74} {"id": 100389, "source": "method", "repo": "chiselsandbits/chisels-and-bits", "text": "protected InteractionResult determineSuccessResult(final BlockPlaceContext context, final ItemStack stack) { if (context.getPlayer() != null && context.getPlayer().isCreative()) { return InteractionResult.SUCCESS; } stack.shrink(1); return InteractionResult.CONSUME; }", "tokens": 55} {"id": 100495, "source": "method", "repo": "chiselsandbits/chisels-and-bits", "text": "public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof final Identifier that)) { return false; } return inners.equals(that.inners) && startPoint.equals(that.startPoint) && endPoint.equals(that.endPoint); }", "tokens": 68} {"id": 100585, "source": "method", "repo": "chiselsandbits/chisels-and-bits", "text": "public MeasurementsUpdatedPacket(final Table> measurements) { this.measurements = measurements; }", "tokens": 36} {"id": 100731, "source": "method", "repo": "chiselsandbits/chisels-and-bits", "text": "public CompletableFuture run(@NotNull final CachedOutput cache) { final List langKeys = Arrays.stream(LocalStrings.values()).map(LocalStrings::toString).collect(Collectors.toList()); Collections.sort(langKeys); final JsonObject returnValue = new JsonObject(); for (String langKey : langKeys) { returnValue.addProperty(langKey, \"\"); } final Path configLangFolder = this.generator.getOutputFolder().resolve(Constants.DataGenerator.CONFIG_LANG_DIR); final Path langPath = configLangFolder.resolve(\"localstrings.json\"); return DataProvider.saveStable(cache, returnValue, langPath); }", "tokens": 140} {"id": 100754, "source": "method", "repo": "chiselsandbits/chisels-and-bits", "text": "public static ForgePluginDiscoverer getInstance() { return INSTANCE; }", "tokens": 13} {"id": 100807, "source": "method", "repo": "citerus/dddsample-core", "text": "/** Updates all aspects of the cargo aggregate status based on the current route specification, itinerary and handling of the cargo. When either of those three changes, i.e. when a new route is specified for the cargo, the cargo is assigned to a route or when the cargo is handled, the status must be re-calculated. {@link RouteSpecification} and {@link Itinerary} are both inside the Cargo aggregate, so changes to them cause the status to be updated synchronously, but changes to the delivery history (when a cargo is handled) cause the status update to happen asynchronously since {@link se.citerus.dddsample.domain.model.handling.HandlingEvent} is in a different aggregate. @param handlingHistory handling history */ public void deriveDeliveryProgress(final HandlingHistory handlingHistory) { // Delivery is a value object, so we can simply discard the old one // and replace it with a new this.delivery = Delivery.derivedFrom(routeSpecification(), itinerary(), handlingHistory.filterOnCargo(new TrackingId(this.trackingId))); }", "tokens": 242} {"id": 100864, "source": "method", "repo": "citerus/dddsample-core", "text": "public Instant unloadTime() { return unloadTime; }", "tokens": 12} {"id": 100865, "source": "method", "repo": "citerus/dddsample-core", "text": "public boolean sameValueAs(final Leg other) { return other != null && new EqualsBuilder(). append(this.voyage, other.voyage). append(this.loadLocation, other.loadLocation). append(this.unloadLocation, other.unloadLocation). append(this.loadTime, other.loadTime). append(this.unloadTime, other.unloadTime). isEquals(); }", "tokens": 88} {"id": 100933, "source": "method", "repo": "citerus/dddsample-core", "text": "public boolean sameValueAs(UnLocode other) { return other != null && this.unlocode.equals(other.unlocode); }", "tokens": 31} {"id": 101055, "source": "method", "repo": "citerus/dddsample-core", "text": "public String bookNewCargo(String origin, String destination, Instant arrivalDeadline) { TrackingId trackingId = bookingService.bookNewCargo( new UnLocode(origin), new UnLocode(destination), arrivalDeadline ); return trackingId.idString(); }", "tokens": 58} {"id": 101068, "source": "method", "repo": "citerus/dddsample-core", "text": "private void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { binder.registerCustomEditor(Instant.class, new CustomDateEditor(new SimpleDateFormat(\"yyyy-MM-dd HH:mm\"), false)); }", "tokens": 50} {"id": 101085, "source": "method", "repo": "citerus/dddsample-core", "text": "public void setLegs(List legs) { this.legs = legs; }", "tokens": 25} {"id": 101142, "source": "method", "repo": "citerus/dddsample-core", "text": "/** Constructor. @param handlingEvent handling event */ public HandlingEventViewAdapter(HandlingEvent handlingEvent) { this.handlingEvent = handlingEvent; }", "tokens": 30} {"id": 101227, "source": "method", "repo": "citerus/dddsample-core", "text": "/** Parse an ISO 8601 (YYYY-MM-DD) String to Date @param isoFormat String to parse. @return Created date instance. @throws DateTimeParseException Thrown if parsing fails. */ private Instant getDate(String isoFormat) throws DateTimeParseException { return LocalDate.parse(isoFormat) .atStartOfDay() .toInstant(ZoneOffset.UTC); }", "tokens": 80} {"id": 101359, "source": "method", "repo": "citerus/dddsample-core", "text": "private static Voyage exampleVoyage() { Location origin = new Location(new UnLocode(\"SESTO\"), \"Stockholm\"); Location dest = new Location(new UnLocode(\"FIHEL\"), \"Helsinki\"); return new Voyage(new VoyageNumber(\"0101\"), new Schedule(Collections.singletonList( new CarrierMovement(origin, dest, Instant.now(), Instant.now())))); }", "tokens": 88} {"id": 101373, "source": "method", "repo": "cjbi/admin3", "text": "public BusinessException(ResultStatus status, String message) { super(message); this.status = status; }", "tokens": 25} {"id": 101494, "source": "method", "repo": "cjbi/admin3", "text": "private static LocalDateTime getLatestExpireTime() { return LocalDateTime.now().plus(EXPIRE_DAYS, ChronoUnit.DAYS); }", "tokens": 26} {"id": 101537, "source": "method", "repo": "cjbi/admin3", "text": "public Organization getParent() { return parent; }", "tokens": 10} {"id": 101611, "source": "method", "repo": "cjbi/admin3", "text": "public void setCredential(String credential) { this.credential = credential; }", "tokens": 17} {"id": 101674, "source": "method", "repo": "cjbi/admin3", "text": "void testCreateUser() throws Exception { mvc.perform(post(\"/users\") .contentType(MediaType.APPLICATION_JSON) .header(TOKEN_HEADER_NAME, TOKEN) .content(\"\"\" { \"username\": \"admin3_so_good\", \"gender\": \"MALE\", \"avatar\": \"https://picsum.photos/id/237/100\", \"organizationId\": 1 } \"\"\")) .andExpect(status().isCreated()) .andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON)) .andExpect(jsonPath(\"username\", is(\"admin3_so_good\"))); }", "tokens": 136} {"id": 101685, "source": "method", "repo": "classgraph/classgraph", "text": "public boolean isRejected(final String str) { return startsWithAny(str, rejectPrefixes) || matchesRejectGlob(str); }", "tokens": 29} {"id": 101689, "source": "method", "repo": "classgraph/classgraph", "text": "/** Check whether a directory may still lead to an accepted file. A leafname criterion matches a file in any directory, so any directory may hold an accepted file when there is at least one accept criterion, and none does when there is none. @param str The string to test, ending in the separator character, or the empty string for the root. @return true if there is at least one accept criterion. */ public boolean acceptHasPrefix(final String str) { return !acceptIsEmpty(); }", "tokens": 105} {"id": 101754, "source": "method", "repo": "classgraph/classgraph", "text": "/** Use class name for equals(). @param obj the other object @return Whether the objects were equal. */ public boolean equals(final @Nullable Object obj) { if (obj == this) { return true; } if (!(obj instanceof final ClassInfo other)) { return false; } return name.equals(other.name); }", "tokens": 68} {"id": 101839, "source": "method", "repo": "classgraph/classgraph", "text": "/** Whether {@link ClassGraph#enableExternalClasses()} was called before scanning. @return true if external classes were enabled, so that classes outside the accepted packages can appear in the returned {@link ClassInfoList} instances. @throws IllegalStateException if this {@link ScanResult} has been closed. */ public boolean isExternalClassesEnabled() { checkNotClosed(); return scanSpec.enableExternalClasses; }", "tokens": 81} {"id": 101944, "source": "method", "repo": "classgraph/classgraph", "text": "/** Scan the generated classes. @param tempDir the directory to write the classfiles to @return the scan result @throws IOException if a classfile could not be written */ private static ScanResult scan(final File tempDir) throws IOException { final var packageDir = new File(tempDir, \"dup\"); Files.createDirectories(packageDir.toPath()); Files.write(new File(packageDir, \"Super.class\").toPath(), superclassBytes()); Files.write(new File(packageDir, \"X.class\").toPath(), classBytes()); return new ClassGraph().enableClassInfo().enableFieldInfo().enableClasspathEntries(tempDir).scan(); }", "tokens": 130} {"id": 102012, "source": "method", "repo": "classgraph/classgraph", "text": "/** The generic type signature of a class is reported. */ public void theTypeSignatureOfAClassIsReported() { assertThat(log).contains(\"Class type signature: \"); }", "tokens": 46} {"id": 102086, "source": "method", "repo": "classgraph/classgraph", "text": "/** Object is the superclass of a standard class that extends no other class, and is the last entry in the superclass chain of any standard class. Interfaces have no superclass.

External classes are enabled, since Object is not accepted here, and so is an external class. */ public void objectIsTheUniversalSuperclass() { try (var scanResult = new ClassGraph().enableClassInfo().enableClasspath() .acceptPackages(Issue703Test.class.getPackage().getName()).enableExternalClasses().scan()) { assertThat(scanResult.getClassInfo(ExtendsNothing.class.getName()).getSuperclass().getName()) .isEqualTo(\"java.lang.Object\"); assertThat(scanResult.getClassInfo(ExtendsSomething.class.getName()).getAllSuperclasses().getNames()) .containsExactly(ExtendsNothing.class.getName(), \"java.lang.Object\"); // An interface's classfile names Object as its superclass, but interfaces do not extend Object assertThat(scanResult.getClassInfo(Iface.class.getName()).getSuperclass()).isNull(); assertThat(scanResult.getAllSubclasses(\"java.lang.Object\").getNames()) .doesNotContain(Iface.class.getName()); // Only classes that name Object as their superclass in their own classfile are direct subclasses of // Object assertThat(scanResult.getDirectSubclasses(\"java.lang.Object\").getNames()) .contains(ExtendsNothing.class.getName()).doesNotContain(ExtendsSomething.class.getName()); } }", "tokens": 292} {"id": 102142, "source": "method", "repo": "classgraph/classgraph", "text": "/** Generate ScanResult before running tests. */ public static void beforeClass() { scanResult = new ClassGraph().enableClasspath() .acceptPackages(RetentionPolicyForFunctionParameterAnnotationsTest.class.getPackage().getName()) .enableClassInfo().enableFieldInfo().enableMethodInfo().enableAnnotationInfo() .enableStaticFinalFieldConstantInitializerValues().ignoreClassVisibility().ignoreFieldVisibility() .ignoreMethodVisibility().scan(); classInfo = scanResult.getClassInfo(RetentionPolicyForFunctionParameterAnnotationsTest.class.getName()); }", "tokens": 100} {"id": 102182, "source": "method", "repo": "classgraph/classgraph", "text": "/** When realtime logging is turned on, each entry is written out as it is added, as well as being added to the tree, so that entries are not lost if the scan never reaches the point where the log is flushed. That includes the entries that a toplevel log node starts with. */ public void realtimeLoggingWritesEachEntryAsItIsAdded() { final var logged = recordLogOutput(() -> new LogNode(true).log(\"logged in realtime\")); assertThat(logged).hasSize(5); assertThat(logged.getFirst()).contains(\"ClassGraph version\"); assertThat(logged.getLast()).contains(\"logged in realtime\"); }", "tokens": 136} {"id": 102186, "source": "method", "repo": "classgraph/classgraph", "text": "/** An exception thrown by the factory is wrapped in a {@link NewInstanceException} that names the key. */ public void thrownExceptionIsWrappedInNewInstanceException() { final var cause = new IllegalArgumentException(\"could not open\"); final var map = new TestMap(_ -> { throw cause; }); assertThatThrownBy(() -> map.get(\"theKey\")).isInstanceOf(NewInstanceException.class) .hasMessageStartingWith(\"Creating the value for key theKey failed: \").hasCause(cause); }", "tokens": 104} {"id": 102264, "source": "method", "repo": "classgraph/classgraph", "text": "/** Add all the classpath entries of a {@code URLClassPath} to the classpath order. @param ucp the {@code URLClassPath}, as returned by {@link #getUcp(ClassLoader)}. @param classLoader the classloader the {@code URLClassPath} was obtained from. @param classpathOrder the classpath order to add to. @param log the log node, or null to skip logging. */ static void addAllClasspathEntries(final Object ucp, final ClassLoader classLoader, final ClasspathOrder classpathOrder, final @Nullable ClassGraphLog log) { classpathOrder.addClasspathEntry(ReflectionUtils.invokeMethod(false, ucp, \"getURLs\"), classLoader, log); addUnlistedClasspathEntries(ucp, classLoader, classpathOrder, log); }", "tokens": 155} {"id": 102504, "source": "method", "repo": "classgraph/classgraph", "text": "/** Interrupting a thread that is opening a nested jarfile whose outer jarfile is already cached reports the interruption as the cause of the {@link IOException}, and trips the interruption checker that the other threads working on the same virtual filesystem poll. @param tempDir the temporary directory to write the jarfile into. @throws IOException if the jarfile could not be written. */ public void interruptedOpenNamesItsCauseAndStopsTheOtherThreads(@TempDir final Path tempDir) throws IOException { final var outerJar = tempDir.resolve(\"outer.jar\"); writeJarContainingTwoJars(outerJar); final var outerJarPath = outerJar.toAbsolutePath().toString(); try (var vfs = new Vfs()) { // Opening the first nested jarfile caches the outer jarfile that holds it assertThat(vfs.open(outerJarPath + \"!/lib/first.jar\")).isNotNull(); // Opening the second nested jarfile has to wait on the cached outer jarfile, and waiting is where an // already-interrupted thread finds out that it has been interrupted Thread.currentThread().interrupt(); assertThatThrownBy(() -> vfs.open(outerJarPath + \"!/lib/second.jar\")).isInstanceOf(IOException.class) .hasMessageContaining(\"Interrupted while opening\") .hasCauseInstanceOf(InterruptedException.class); // The thread that was interrupted still knows it was interrupted (and reading the status clears it, so // that the shared interruption checker can be tested on its own below) assertThat(Thread.interrupted()).isTrue(); // ... and so does any thread that checks the shared interruption checker, as a scan's workers do assertThat(vfs.interruptionChecker().checkAndReturn()).isTrue(); // checkAndReturn() interrupts the calling thread when the shared flag is set, so clear it again before // closing the Vfs Thread.interrupted(); } }", "tokens": 376} {"id": 102727, "source": "method", "repo": "clickcrystals-development/ClickCrystals", "text": "public Map scriptedModules() { return new HashMap<>(scriptedModules); }", "tokens": 24} {"id": 102809, "source": "method", "repo": "clickcrystals-development/ClickCrystals", "text": "public void forEachChild(Consumer action) { children.forEach(action); }", "tokens": 21} {"id": 102960, "source": "method", "repo": "clickcrystals-development/ClickCrystals", "text": "public void reset() { this.start = System.currentTimeMillis(); }", "tokens": 16} {"id": 103104, "source": "method", "repo": "clickcrystals-development/ClickCrystals", "text": "public void setChangeAction(SettingChangeCallback> changeAction) { this.changeAction = changeAction; }", "tokens": 29} {"id": 103246, "source": "method", "repo": "clickcrystals-development/ClickCrystals", "text": "public void render(PoseStack matrices, SubmitNodeCollector submitNodeCollector, int color, float tickDelta, int age) { float x = (float) MathUtils.lerp(prevX, this.x, tickDelta); float y = (float) MathUtils.lerp(prevY, this.y, tickDelta); float z = (float) MathUtils.lerp(prevZ, this.z, tickDelta); float cx = minX + x + (maxX - minX) / 2; float cy = minY + y + (maxY - minY) / 2; float cz = minZ + z + (maxZ - minZ) / 2; matrices.pushPose(); matrices.rotateAround(getRotation(tickDelta), cx, cy, cz); matrices.translate(x, y, z); RenderUtils3d.fillRectPrism(matrices, submitNodeCollector, minX, minY, minZ, maxX, maxY, maxZ, color, true); int alpha = Math.min((color >> 24 & 0xFF) * 5, 0xFF); color = (alpha << 24) | (color & 0x00FFFFFF); RenderUtils3d.drawRectPrism(matrices, submitNodeCollector, minX, minY, minZ, maxX, maxY, maxZ, color, true); matrices.popPose(); }", "tokens": 265} {"id": 103249, "source": "method", "repo": "clickcrystals-development/ClickCrystals", "text": "public Quaternionf getRotation(float tickDelta) { float pitch = (float) MathUtils.lerp(prevPitch, this.pitch, tickDelta); float yaw = (float) MathUtils.lerp(prevYaw, this.yaw, tickDelta); Quaternionf qPitch = new Quaternionf().rotationX((float) Math.toRadians(pitch)); Quaternionf qYaw = new Quaternionf().rotationY((float) Math.toRadians(yaw)); return qYaw.mul(qPitch); }", "tokens": 96} {"id": 103305, "source": "method", "repo": "clickcrystals-development/ClickCrystals", "text": "public WaitingState getWaitingState() { boolean regexMatches = line.matches(\"^wait(_random)?( [0-9.-]+){1,2}$\"); double[] wait = {}; if (regexMatches) { String[] args = line.split(\" \"); wait = new double[args.length]; for (int i = 1; i < args.length; i++) wait[i - 1] = Double.parseDouble(args[i]); } return new WaitingState(regexMatches, wait); }", "tokens": 115} {"id": 103330, "source": "method", "repo": "clickcrystals-development/ClickCrystals", "text": "public ExpressionEvaluator(ExpressionScope scope) { this.scope = scope; this.pos = -1; }", "tokens": 24} {"id": 103345, "source": "method", "repo": "clickcrystals-development/ClickCrystals", "text": "private static ExpressionVariableSupplier mapField(Field field) { return () -> { try { return field.getDouble(null); } catch (Exception ex) { throw new RuntimeException(ex); } }; }", "tokens": 45} {"id": 103382, "source": "method", "repo": "clickcrystals-development/ClickCrystals", "text": "public InputCmd() { super(\"input\"); }", "tokens": 11} {"id": 103443, "source": "method", "repo": "clickcrystals-development/ClickCrystals", "text": "public static void inputBackward(long ms) { TickEventListener.backward(ms); }", "tokens": 20} {"id": 103676, "source": "method", "repo": "cloudinary/cloudinary_java", "text": "public boolean isCreateDerived() { return optBoolean(\"create_derived\"); }", "tokens": 17} {"id": 103866, "source": "method", "repo": "cloudinary/cloudinary_java", "text": "/** Cehcks whether the field is mandatory. @return Boolean indicating whether the field is mandatory. */ public boolean isMandatory() { return optBoolean(MANDATORY); }", "tokens": 39} {"id": 103953, "source": "method", "repo": "cloudinary/cloudinary_java", "text": "protected Expression newInstance() { return new Expression(); }", "tokens": 11} {"id": 104426, "source": "method", "repo": "cloudinary/cloudinary_java", "text": "public void testRestoreDatasourceEntries() throws Exception { SetMetadataField setField = createSetField(\"testRestoreDatasourceEntries\"); ApiResponse fieldResult = addFieldToAccount(setField); String fieldExternalId = fieldResult.get(\"external_id\").toString(); api.deleteDatasourceEntries(fieldExternalId, Collections.singletonList(\"id1\")); ApiResponse result = api.restoreDatasourceEntries(fieldExternalId, Collections.singletonList(\"id1\")); assertNotNull(result); }", "tokens": 96} {"id": 104534, "source": "method", "repo": "code-disaster/steamworks4j", "text": "public boolean setDlcContext(int appID) { return SteamAppsNative.setDlcContext(appID); }", "tokens": 27} {"id": 104538, "source": "method", "repo": "code-disaster/steamworks4j", "text": "SteamAuthTicket(long handle) { super(handle); }", "tokens": 14} {"id": 104578, "source": "method", "repo": "code-disaster/steamworks4j", "text": "public float getRotQuatY() { return data[1]; }", "tokens": 15} {"id": 104708, "source": "method", "repo": "code-disaster/steamworks4j", "text": "public String getLobbyData(SteamID steamIDLobby, String key) { return SteamMatchmakingNative.getLobbyData(steamIDLobby.handle, key); }", "tokens": 31} {"id": 104848, "source": "method", "repo": "code-disaster/steamworks4j", "text": "public boolean fileReadAsyncComplete(SteamAPICall readCall, ByteBuffer buffer, int toRead) { return SteamRemoteStorageNative.fileReadAsyncComplete(readCall.handle, buffer, buffer.position(), toRead); }", "tokens": 48} {"id": 104869, "source": "method", "repo": "code-disaster/steamworks4j", "text": "public boolean getUGCDownloadProgress(SteamUGCHandle fileHandle, int[] bytesDownloaded, int[] bytesExpected) { return SteamRemoteStorageNative.getUGCDownloadProgress(fileHandle.handle, bytesDownloaded, bytesExpected); }", "tokens": 49} {"id": 104966, "source": "method", "repo": "code-disaster/steamworks4j", "text": "public boolean setItemDescription(SteamUGCUpdateHandle update, String description) { return SteamUGCNative.setItemDescription(update.handle, description); }", "tokens": 31} {"id": 105275, "source": "method", "repo": "code-disaster/steamworks4j", "text": "public void onStartPlaytimeTracking(SteamResult result) { }", "tokens": 14} {"id": 105313, "source": "method", "repo": "code-disaster/steamworks4j", "text": "public static void main(String[] arguments) { new SteamMatchmakingServerTest().clientMain(arguments); }", "tokens": 23} {"id": 105412, "source": "method", "repo": "code4craft/xsoup", "text": "public static String HtmlToPlainText(Element element) { FormattingVisitor formatter = new FormattingVisitor(); NodeTraversor.traverse(formatter, element); return formatter.toString(); }", "tokens": 37} {"id": 105472, "source": "method", "repo": "code4craft/xsoup", "text": "public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException { throw new UnsupportedOperationException(); }", "tokens": 26} {"id": 105492, "source": "method", "repo": "code4craft/xsoup", "text": "public Node getNextSibling() { return NodeAdaptors.getNode(element.nextSibling()); }", "tokens": 20} {"id": 105546, "source": "method", "repo": "code4craft/xsoup", "text": "public String getBaseURI() { return null; }", "tokens": 11} {"id": 105613, "source": "method", "repo": "code4craft/xsoup", "text": "public String operate(Element element) { int index = 0; StringBuilder accum = new StringBuilder(); for (Node node : element.childNodes()) { if (node instanceof TextNode) { TextNode textNode = (TextNode) node; if (group == 0) { accum.append(textNode.text()); } else if (++index == group) { return textNode.text(); } } } return accum.toString(); }", "tokens": 94} {"id": 105614, "source": "method", "repo": "code4craft/xsoup", "text": "public String toString() { return String.format(\"text(%d)\", group); }", "tokens": 20} {"id": 105653, "source": "method", "repo": "code4craft/xsoup", "text": "public Evaluator call(String... param) { Validate.isTrue(param.length == 2, String.format(\"Error argument of %s\", \"starts-with\")); return new Evaluator.AttributeWithValueStarting(param[0], param[1]); }", "tokens": 61} {"id": 105685, "source": "method", "repo": "code4craft/xsoup", "text": "public void testFuzzyValueMatch() { Document document = Jsoup.parse(html); String result = Xsoup.select(document, \"//*[@id~=te]/text()\").get(); assertThat(result).isEqualTo(\"aaa\"); result = Xsoup.select(document, \"//*[@id$=st]/text()\").get(); assertThat(result).isEqualTo(\"aaa\"); result = Xsoup.select(document, \"//*[@id*=es]/text()\").get(); assertThat(result).isEqualTo(\"aaa\"); result = Xsoup.select(document, \"//*[@id~='tes[t]+']/text()\").get(); assertThat(result).isEqualTo(\"aaa\"); result = Xsoup.select(document, \"//*[@id~=te]/allText()\").get(); assertThat(result).isEqualTo(\"aaa github.com\"); }", "tokens": 188} {"id": 105754, "source": "method", "repo": "codedabble-dev/java-snapshot-testing", "text": "public SnapshotContext expectCondition(Method testMethod, Object object) { SnapshotContext snapshotContext = new SnapshotContext(config, snapshotFile, testClass, testMethod, object); calledSnapshots.add(snapshotContext); return snapshotContext; }", "tokens": 50} {"id": 105950, "source": "method", "repo": "codedabble-dev/java-snapshot-testing", "text": "public void test() { expect.scenario(input).toMatchSnapshot(input); }", "tokens": 18} {"id": 105994, "source": "method", "repo": "codedabble-dev/java-snapshot-testing", "text": "/** Override to control the registration of all available jackson modules within the classpath which are locatable via JDK ServiceLoader facility, along with module-provided SPI. */ protected boolean shouldFindAndRegisterModules() { return true; }", "tokens": 49} {"id": 106040, "source": "method", "repo": "codetoexpress/dailycodebase", "text": "public static void main(String[] args) { Scanner input = new Scanner (System.in); System.out.print(\"Enter the number of rows: \"); int row = input.nextInt(); System.out.print(\"Enter the number of columns: \"); int col = input.nextInt(); // Input the array int[][] arr = new int[row][col]; System.out.println(\"Enter the elements: \"); for (int i=0; i The type of attribute to search for. @param type The type of attribute to search for. @return The attribute, or null if not found. */ public T getAttribute(Class type) { for (Attribute attribute : attributes) { if (type.isInstance(attribute)) { return type.cast(attribute); } } return null; }", "tokens": 90} {"id": 106441, "source": "method", "repo": "col-e/cafed00d", "text": "/** @param version New constant pool entry holding the module version utf8, or {@code null} if no version info. */ public void setVersion(@Nonnull CpUtf8 version) { this.version = version; }", "tokens": 46} {"id": 106573, "source": "method", "repo": "col-e/cafed00d", "text": "/** @param value Constant value. */ public CpLong(long value) { super(LONG); this.value = value; }", "tokens": 28} {"id": 106781, "source": "method", "repo": "col-e/cafed00d", "text": "/** Writes long to a buffer. @param value Long to write. @return This buffer. */ public GrowingByteBuffer putLong(long value) { ensureWriteable(8).buffer.putLong(value); return this; }", "tokens": 48} {"id": 106857, "source": "method", "repo": "col-e/cafed00d", "text": "/** @param opcode Instruction opcode. */ public ArithmeticInsn(int opcode) { super(InsnKind.ARITHMETIC, opcode); }", "tokens": 33} {"id": 106911, "source": "method", "repo": "col-e/cafed00d", "text": "/** Visit the end of the annotation. */ default void visitAnnotationEnd() { AnnotationVisitor delegate = annotationDelegate(); if (delegate != null) delegate.visitAnnotationEnd(); }", "tokens": 37} {"id": 107043, "source": "method", "repo": "col-e/cafed00d", "text": "CpEntry newConstant(@Nonnull Constant value) { switch (value.getType()) { case STRING: return newSym(new CpString(newUtf8((String) value.getValue()))); case BOOLEAN: case BYTE: case CHAR: case SHORT: case INT: return newSym(new CpInt((int) value.getValue())); case LONG: return newSym(new CpLong((long) value.getValue())); case FLOAT: return newSym(new CpFloat((float) value.getValue())); case DOUBLE: return newSym(new CpDouble((double) value.getValue())); case DESCRIPTOR: { Descriptor descriptor = (Descriptor) value.getValue(); switch (descriptor.getKind()) { case METHOD: { CpUtf8 descriptorIndex = newUtf8(descriptor.getDescriptor()); return newSym(new CpMethodType(descriptorIndex)); } case OBJECT: case ARRAY: { CpUtf8 descriptorIndex = newUtf8(descriptor.getDescriptor()); return newSym(new CpClass(descriptorIndex)); } case PRIMITIVE: throw new IllegalStateException(\"Cannot create constant for primitive descriptor\"); case ILLEGAL: throw new IllegalStateException(\"Cannot create constant for illegal descriptor\"); default: break; } } case HANDLE: { Handle handle = (Handle) value.getValue(); return newHandle(handle); } default: throw new IllegalStateException(\"Unknown constant type: \" + value.getType()); } }", "tokens": 300} {"id": 107509, "source": "method", "repo": "col-e/recaf", "text": "public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ArrayValueMutableImpl that)) return false; if (!type.equals(that.type)) return false; if (nullness != that.nullness) return false; if (!length.equals(that.length)) return false; return Objects.equals(contents, that.contents); }", "tokens": 82} {"id": 107845, "source": "method", "repo": "col-e/recaf", "text": "public void apply(@Nonnull TypeIndex index) { if (add) index.addResource(resource); else index.removeResource(resource); }", "tokens": 31} {"id": 107892, "source": "method", "repo": "col-e/recaf", "text": "/** Hide the overlay. */ public void hide() { transition.stop(); detail.setText(\"\"); setVisible(false); setManaged(false); }", "tokens": 31} {"id": 107909, "source": "method", "repo": "col-e/recaf", "text": "public boolean readBeforeWrite() { List elements = references() .sorted(Comparator.comparing(ASTElement::location)) .toList(); return !elements.isEmpty() && !isParameter() && readers().contains(elements.getFirst()); }", "tokens": 55} {"id": 108115, "source": "method", "repo": "CommandAPI/CommandAPI", "text": "/** Returns an argument by its index @param index The position of this argument @param defaultValue The Object returned if the argument is not existent @return An argument which is placed at the given index, or the provided default value */ public Object getOrDefault(int index, Supplier defaultValue) { if (args.length <= index) { return defaultValue.get(); } else { return args[index]; } }", "tokens": 84} {"id": 108146, "source": "method", "repo": "CommandAPI/CommandAPI", "text": "/** Adds an executor to the current command builder @param info A lambda of type (ExecutionInfo) -> int that will be executed when the command is run @return this command builder */ default Impl executesCommandBlock(CommandBlockResultingExecutionInfo info) { getExecutor().addResultingExecutor(info); return instance(); }", "tokens": 72} {"id": 108255, "source": "method", "repo": "CommandAPI/CommandAPI", "text": "/** Returns the type of the sender of the current executor. @return the type of the sender of the current executor */ default ExecutorType getType() { return ExecutorType.REMOTE; }", "tokens": 38} {"id": 108449, "source": "method", "repo": "CommandAPI/CommandAPI", "text": "public Map getHelpMap() { return helpMapTopics.get((HelpMapMock) Bukkit.getHelpMap()); }", "tokens": 33} {"id": 108508, "source": "method", "repo": "CommandAPI/CommandAPI", "text": "/** ***************** Dispatcher tests * ****************** */ void dispatcherTestWithLiteralArgument() { new CommandAPICommand(\"test\") .withArguments(new LiteralArgument(\"literal\")) .executesPlayer(P_EXEC) .register(\"minecraft\"); assertEquals(\"\"\" { \"type\": \"root\", \"children\": { \"test\": { \"type\": \"literal\", \"children\": { \"literal\": { \"type\": \"literal\", \"executable\": true } } } } }\"\"\", getDispatcherString()); }", "tokens": 100} {"id": 108531, "source": "method", "repo": "CommandAPI/CommandAPI", "text": "void exceptionTestWithLongArgumentInvalid() { // Test with max value less than min value assertThrows(InvalidRangeException.class, () -> new LongArgument(\"value\", 20l, 10l)); }", "tokens": 47} {"id": 108715, "source": "method", "repo": "CommandAPI/CommandAPI", "text": "public BaseComponent[] getChatComponent(CommandContext cmdCtx, String key) throws CommandSyntaxException { return ComponentSerializer.parse(bukkitNMS.toJson(ComponentArgument.getResolvedComponent(cmdCtx, key))); }", "tokens": 46} {"id": 108781, "source": "method", "repo": "CommandAPI/CommandAPI", "text": "public Class getPrimitiveType() { return long.class; }", "tokens": 16} {"id": 109130, "source": "method", "repo": "compactmods/compactmachines", "text": "private static int resetRoomSpawn(CommandContext ctx) { final var src = ctx.getSource(); final var roomCode = StringArgumentType.getString(ctx, \"room\"); // FIXME roomProvider.setDefaultSpawn(); src.sendSuccess(() -> Component.translatable(CommandTranslations.IDs.SPAWN_CHANGED_SUCCESSFULLY, roomCode), true); return 0; }", "tokens": 79} {"id": 109136, "source": "method", "repo": "compactmods/compactmachines", "text": "public static LiteralArgumentBuilder make() { // /cm rooms final LiteralArgumentBuilder subRoot = LiteralArgumentBuilder.literal(\"rooms\"); // TODO: /cm rooms create [size] // /cm rooms summary final var summary = Commands.literal(\"summary\") .executes(CMRoomsSubcommand::execRoomSummary); subRoot.then(summary); subRoot.then(CMFindRoomSubcommand.create()); return subRoot; }", "tokens": 100} {"id": 109301, "source": "method", "repo": "compactmods/compactmachines", "text": "/** Helper to determine if an event should be canceled, by determining if a target is outside a machine's bounds. @param entity Entity trying to teleport. @param target Teleportation target location. @return True if position is inside a room; false otherwise. */ private static boolean positionInsideRoom(Entity entity, Vec3 target) { if (!CompactDimension.isLevelCompact(entity.level())) return false; return CompactMachines.chunkManager() .findRoomByChunk(entity.chunkPosition()) .flatMap((String roomCode) -> CompactMachines.room(entity.getServer(), roomCode)) .map(ib -> ib.boundaries().innerBounds().contains(target)) .orElse(false); }", "tokens": 153} {"id": 109473, "source": "method", "repo": "compactmods/compactmachines", "text": "public static List insertMultipleStacks(IItemHandler itemHandler, List drops) { Deque remainingDrops = new ArrayDeque<>(drops); final var failedToPush = ImmutableList.builder(); while (!remainingDrops.isEmpty()) { var workingStack = remainingDrops.pop(); var scan = ItemHandlerScan.scanInventory(itemHandler, workingStack); if (!scan.hasSpaceAvailable()) { failedToPush.add(workingStack); continue; } // Try stackable slots first, then empty var stackableSlots = new ArrayDeque(scan.stacking()); stackableSlots.addAll(scan.empty()); boolean doneWithStack = false; while(!doneWithStack) { // No more space if(stackableSlots.isEmpty()) { failedToPush.addAll(remainingDrops); remainingDrops.clear(); break; } var working = stackableSlots.peek(); workingStack = itemHandler.insertItem(working, workingStack, false); if (workingStack.isEmpty()) { doneWithStack = true; break; } stackableSlots.pop(); if(stackableSlots.isEmpty()) { failedToPush.add(workingStack.copy()); doneWithStack = true; } } } return failedToPush.build(); }", "tokens": 267} {"id": 109570, "source": "method", "repo": "compasssecurity/samlraider", "text": "public String getEditorContents() { return this.textArea.getContents().toString(); }", "tokens": 18} {"id": 109573, "source": "method", "repo": "compasssecurity/samlraider", "text": "public ExtensionProvidedHttpRequestEditor provideHttpRequestEditor(EditorCreationContext creationContext) { return new SamlTabController(creationContext.editorMode() == EditorMode.DEFAULT, certificateTabController); }", "tokens": 41} {"id": 109728, "source": "method", "repo": "compasssecurity/samlraider", "text": "/** Take a list of patches and return a textual representation. @param patches List of Patch objects. @return Text representation of patches. */ public String patchToText(List patches) { StringBuilder text = new StringBuilder(); for (Patch aPatch : patches) { text.append(aPatch); } return text.toString(); }", "tokens": 72} {"id": 109998, "source": "method", "repo": "compasssecurity/samlraider", "text": "public void testRemoveSignature() throws SAXException, IOException { Document document = xmlHelpers.getXMLDocumentOfSAMLMessage(message); assertEquals(1, xmlHelpers.removeAllSignatures(document)); assertEquals(messageWithoutSig, xmlHelpers.getStringOfDocument(document)); }", "tokens": 51} {"id": 110295, "source": "method", "repo": "concurnas/concurnas", "text": "public ReturnStatement visitReturn_stmt(ConcurnasParser.Return_stmtContext ctx) { int line = ctx.start.getLine(); int col = ctx.start.getCharPositionInLine(); Expression expr = ctx.expr_stmt_tuple() == null ? null : (Expression) ctx.expr_stmt_tuple().accept(this); return expr != null ? new ReturnStatement(line, col, expr) : new ReturnStatement(line, col); }", "tokens": 99} {"id": 110351, "source": "method", "repo": "concurnas/concurnas", "text": "public void setPreceedingExpression(Expression expr) { this.preceedingExpression = expr; }", "tokens": 25} {"id": 110414, "source": "method", "repo": "concurnas/concurnas", "text": "public void setShouldBePresevedOnStack(boolean should) { if(this.astRedirectforOnChangeNesting != null) { astRedirectforOnChangeNesting.setShouldBePresevedOnStack(should); } if(this.astRedirect != null) { ((Node)astRedirect).setShouldBePresevedOnStack(should); } if(this.primaryASTOverride != null) { primaryASTOverride.setShouldBePresevedOnStack(should); } super.setShouldBePresevedOnStack(should); }", "tokens": 123} {"id": 110446, "source": "method", "repo": "concurnas/concurnas", "text": "public Type copyIgnoreReturnType() { return copyTypeSpecific(); }", "tokens": 14} {"id": 110504, "source": "method", "repo": "concurnas/concurnas", "text": "private void addModuleGPUKernelFunctions() {//for those for which we cannot attach to the main function definition since there isnt one for stub functions with no source List gpukfuncs = this.currentScopeFrame.getAllGPUFuncOrKernels(); if(!gpukfuncs.isEmpty()){ if(gpukfuncs.stream().anyMatch(a -> a.source == null)) { AnnotationVisitor functions = cw.visitAnnotation(\"Lcom/concurnas/lang/GPUKernelFunctions;\", true); { AnnotationVisitor funcs = functions.visitArray(\"gpuFuncs\"); for(GPUKernelFuncDetails inst : gpukfuncs) { if(inst.source != null) { continue; } visitGPUKernelFunctionAnnotation(funcs.visitAnnotation(null, \"Lcom/concurnas/lang/GPUKernelFunction;\"), inst); } funcs.visitEnd(); } } } }", "tokens": 188} {"id": 110547, "source": "method", "repo": "concurnas/concurnas", "text": "public Object visit(AssignNew assignNew) { AssignNew toPut = null; if(assignNew.eq!=null || TypeCheckUtils.hasRefLevels(assignNew.getTaggedType())) {//dont gennerate for the likes of://private y int; as a field def toPut = assignNew; } return nameToAssign.putIfAbsent(assignNew.name, new Pair(toPut==null?null:toPut.expr, assignNew.isTransient)); }", "tokens": 108} {"id": 110592, "source": "method", "repo": "concurnas/concurnas", "text": "public Object visit(CastExpression castExpression) { super.visit(castExpression); Object value = castExpression.o.accept(this); if(null != value){ Type type = castExpression.t; if(type.hasArrayLevels()){ return null; } if(type instanceof PrimativeType && value instanceof Number){ PrimativeType asPrim = (PrimativeType)type; Number asNumber = (Number)value; switch(asPrim.type){ case BOOLEAN: /*value = (boolean)value;*/ break;//nop case INT: value = asNumber.intValue(); break; case LONG: value = asNumber.longValue(); break; case FLOAT: value = asNumber.floatValue(); break; case DOUBLE: value = asNumber.doubleValue(); break; case SHORT: value = asNumber.shortValue(); break; case BYTE: value = asNumber.byteValue(); break; case CHAR: value = (char)asNumber.intValue(); break; default: return null; } } else if(type instanceof NamedType && type.equals(ScopeAndTypeChecker.const_string)){ value = \"\"+value; } else{ return null; } return castExpression.setFoldedConstant(value); } return null; }", "tokens": 268} {"id": 110610, "source": "method", "repo": "concurnas/concurnas", "text": "public Object visit(FuncType funcType) { //visitList.add(\"FuncType\"); return null; }", "tokens": 24} {"id": 110684, "source": "method", "repo": "concurnas/concurnas", "text": "public Object visit(VectorizedArrayRef vectArrayRef) { return false; }", "tokens": 19} {"id": 110705, "source": "method", "repo": "concurnas/concurnas", "text": "public static boolean isLocalArray(Type exprType) { if(exprType instanceof NamedType){ NamedType asNamed = (NamedType)exprType; return asNamed.getIsRef() && asNamed.hasArrayLevels(); } return false; }", "tokens": 52} {"id": 110823, "source": "method", "repo": "concurnas/concurnas", "text": "protected int readMethod(final ClassVisitor classVisitor, final Context context, int u) { int newU = super.readMethod(classVisitor, context, u); if (myInit != null) { if (assumeNoPrimordials || true) {// TODO: restrict this to only primordials? // only for primordials, keep the inits // visit a primordial therefore add normal init method myInit.preserveInit = true; super.readMethod(classVisitor, context, u); myInit.preserveInit = false; } } return newU; }", "tokens": 128} {"id": 111142, "source": "method", "repo": "congcoi123/tenio", "text": "public ZeroArray addDouble(double data) { return addElement(ZeroType.DOUBLE, data); }", "tokens": 24} {"id": 111147, "source": "method", "repo": "congcoi123/tenio", "text": "/** Creates a new instance. */ public ZeroMapImpl() { map = new HashMap<>(); }", "tokens": 21} {"id": 111302, "source": "method", "repo": "congcoi123/tenio", "text": "public void activate() { httpService.activate(); webSocketService.activate(); socketService.activate(); }", "tokens": 22} {"id": 111519, "source": "method", "repo": "congcoi123/tenio", "text": "public void roomStateIsIdleShouldReturnFalseByDefault() { RoomState defaultState = new RoomState() {}; assertEquals(false, defaultState.isIdle()); }", "tokens": 34} {"id": 111526, "source": "method", "repo": "congcoi123/tenio", "text": "void testSetAndGetLastReadTime() { Player player = DefaultPlayer.newInstance(\"Test\"); long timestamp = System.currentTimeMillis(); player.setLastReadTime(timestamp); assertEquals(timestamp, player.getLastReadTime()); assertEquals(timestamp, player.getLastActivityTime()); }", "tokens": 56} {"id": 111682, "source": "method", "repo": "congcoi123/tenio", "text": "void testGetNumberOfExtraWorkersReturnsZero() { assertEquals(0, ((AbstractZeroEngine) acceptor).getNumberOfExtraWorkers()); }", "tokens": 31} {"id": 111695, "source": "method", "repo": "congcoi123/tenio", "text": "void testGetCacheSizeReturnsConfiguredValue() { assertEquals(4, manager.getCacheSize()); }", "tokens": 20} {"id": 112009, "source": "method", "repo": "conveyal/r5", "text": "public void completeSuccessfully () { completed(Status.DONE); }", "tokens": 15} {"id": 112025, "source": "method", "repo": "conveyal/r5", "text": "/** Used primarily for shapefiles where we can't be sure whether all sidecar files have been synced locally. */ private static void prefetchDataSource (String baseName, String extension, FileStorage fileStorage) { FileStorageKey key = new FileStorageKey(FileCategory.DATASOURCES, baseName, extension); // We need to clarify the FileStorage API on which calls cause the file to be synced locally, and whether these // getFile tolerates getting files that do not exist. This may all become irrelevant if we use NFS. if (fileStorage.exists(key)) { fileStorage.getFile(key); } }", "tokens": 130} {"id": 112031, "source": "method", "repo": "conveyal/r5", "text": "public GtfsErrorSummary () { /* For deserialization. */ }", "tokens": 15} {"id": 112181, "source": "method", "repo": "conveyal/r5", "text": "public Ref getRef(String columnLabel) throws SQLException { throw new UnsupportedOperationException(); }", "tokens": 19} {"id": 112191, "source": "method", "repo": "conveyal/r5", "text": "public Reader getNCharacterStream(int columnIndex) throws SQLException { throw new UnsupportedOperationException(); }", "tokens": 20} {"id": 112225, "source": "method", "repo": "conveyal/r5", "text": "public void writeTable (ZipOutputStream zip) throws IOException { LOG.info(\"Writing GTFS table {}\", tableName); ZipEntry zipEntry = new ZipEntry(tableName + \".txt\"); zip.putNextEntry(zipEntry); // don't let CSVWriter close the stream when it is garbage-collected OutputStream protectedOut = new UncloseableOutputStream(zip); this.writer = new CsvWriter(protectedOut, ',', Charset.forName(\"UTF8\")); this.writeHeaders(); // write rows until there are none left. row = 0; Iterator iter = this.iterator(); while (iter.hasNext()) { if (++row % 500000 == 0) { LOG.info(\"Record number {}\", human(row)); } writeOneRow(iter.next()); } // closing the writer closes the underlying output stream, so we don't do that. writer.flush(); zip.closeEntry(); LOG.info(\"Wrote {} rows\", human(row)); }", "tokens": 205} {"id": 112417, "source": "method", "repo": "conveyal/r5", "text": "public synchronized void increment (int n) { throw new UnsupportedOperationException(); // TODO combined progress updating with case where n == 1 }", "tokens": 28} {"id": 112420, "source": "method", "repo": "conveyal/r5", "text": "public void addSubtask (Task subtask) { }", "tokens": 13} {"id": 112838, "source": "method", "repo": "conveyal/r5", "text": "double directWalkSeconds () { return walkSecondsFrom(ORIGIN_X, ORIGIN_Y); }", "tokens": 23} {"id": 112914, "source": "method", "repo": "conveyal/r5", "text": "public void testProvideMyOwnTravelTime() { // Not time dependent yet StreetLayer streetLayer = new StreetLayer(); int one = streetLayer.vertexStore.addVertex(0, 1); int two = streetLayer.vertexStore.addVertex(0, 2); int three = streetLayer.vertexStore.addVertex(0, 3); streetLayer.edgeStore.addStreetPair(one, two, 15000, 1); streetLayer.edgeStore.addStreetPair(two, three, 15000, 2); EdgeStore.Edge e = streetLayer.edgeStore.getCursor(0); do { e.setFlag(EdgeStore.EdgeFlag.ALLOWS_PEDESTRIAN); e.setFlag(EdgeStore.EdgeFlag.ALLOWS_CAR); } while (e.advance()); streetLayer.indexStreets(); streetLayer.buildEdgeLists(); StreetRouter streetRouter = new StreetRouter(streetLayer); streetRouter.setOrigin(one); streetRouter.route(); StreetRouter.State stateAtVertex = streetRouter.getStateAtVertex(three); assertEquals(24, stateAtVertex.durationSeconds); StreetRouter anotherStreetRouter = new StreetRouter(streetLayer); anotherStreetRouter.timeCalculator = new TraversalTimeCalculator() { @Override public int traversalTimeSeconds (EdgeStore.Edge currentEdge, StreetMode streetMode, ProfileRequest req) { return 30; } @Override public int turnTimeSeconds (int fromEdge, int toEdge, StreetMode streetMode) { return 0; } }; anotherStreetRouter.setOrigin(one); anotherStreetRouter.route(); StreetRouter.State anotherStateAtVertex = anotherStreetRouter.getStateAtVertex(three); assertEquals(60, anotherStateAtVertex.durationSeconds); }", "tokens": 392} {"id": 112947, "source": "method", "repo": "cool-team-official/cool-admin-java", "text": "public void setEntity(Class entity) { this.entity = entity.getSimpleName().replace(\"Entity\", \"\"); }", "tokens": 24} {"id": 113039, "source": "method", "repo": "cool-team-official/cool-admin-java", "text": "public T getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { final String json = cs.getString(columnIndex); return StringUtil.noText(json) ? null : parseJson(json); }", "tokens": 45} {"id": 113060, "source": "method", "repo": "cool-team-official/cool-admin-java", "text": "static public PageResult of(Page page ){ PageResult result = new PageResult(); result.setList(page.getRecords()); result.pagination.setPage( page.getPageNumber() ); result.pagination.setSize( page.getPageSize() ); result.pagination.setTotal( page.getTotalRow() ); return result; }", "tokens": 82} {"id": 113338, "source": "method", "repo": "cooperlyt/keycloak-phone-provider", "text": "public void setRequiredActions(KeycloakSession keycloakSession, RealmModel realmModel, UserModel userModel) { // Not used }", "tokens": 26} {"id": 113343, "source": "method", "repo": "cooperlyt/keycloak-phone-provider", "text": "public void init(Config.Scope scope) { }", "tokens": 12} {"id": 113370, "source": "method", "repo": "cooperlyt/keycloak-phone-provider", "text": "public String getDisplayType() { return \"Provide phone number\"; }", "tokens": 14} {"id": 113486, "source": "method", "repo": "cooperlyt/keycloak-phone-provider", "text": "public Class getProviderFactoryClass() { return PhoneProviderFactory.class; }", "tokens": 21} {"id": 113562, "source": "method", "repo": "cordova-plugin-camera-preview/cordova-plugin-camera-preview", "text": "public void onPause() { super.onPause(); // Because the Camera object is a shared resource, it's very important to release it when the activity is paused. if (mCamera != null) { setDefaultCameraId(); mPreview.setCamera(null, -1); mCamera.setPreviewCallback(null); mCamera.release(); mCamera = null; } Activity activity = getActivity(); muteStream(false, activity); }", "tokens": 91} {"id": 113750, "source": "method", "repo": "cornutum/tcases", "text": "public void deleteServersOp_IdType_Is_NotInteger() { Response response = given() .baseUri( forTestServer( \"http://api.cornutum.org/prod/root\")) .queryParam( \"id\", \"\") .when() .request( \"DELETE\", \"/servers/op\") .then() // id.Type=Not integer .statusCode( isBadRequest()) .extract() .response() ; responseValidator.assertBodyValid( \"DELETE\", \"/servers/op\", response.statusCode(), response.getContentType(), response.asString()); responseValidator.assertHeadersValid( \"DELETE\", \"/servers/op\", response.statusCode(), responseHeaders( response)); }", "tokens": 144} {"id": 113901, "source": "method", "repo": "cornutum/tcases", "text": "/** Returns the element at this location. */ public T getElement() { return element_; }", "tokens": 20} {"id": 114016, "source": "method", "repo": "cornutum/tcases", "text": "/** Creates a new EmailEnum instance. */ public EmailEnum( Iterable enums) { this( enums, Characters.ASCII); }", "tokens": 31} {"id": 114063, "source": "method", "repo": "cornutum/tcases", "text": "/** If present, appends a new element to the list for this builder. */ public ListBuilder add( Optional element) { element.ifPresent( e -> list_.add( e)); return this; }", "tokens": 50} {"id": 114409, "source": "method", "repo": "cornutum/tcases", "text": "public void patchPost_PostMarksItemsSize_Is_3() { Response response = given() .baseUri( forTestServer( \"http://localhost:12306\")) .queryParam( \"Post Marks\", \" #Z {X}\") .when() .request( \"PATCH\", \"/post\") .then() .statusCode( isSuccess()) .extract() .response() ; responseValidator.assertBodyValid( \"PATCH\", \"/post\", response.statusCode(), response.getContentType(), response.asString()); responseValidator.assertHeadersValid( \"PATCH\", \"/post\", response.statusCode(), responseHeaders( response)); }", "tokens": 136} {"id": 114457, "source": "method", "repo": "cornutum/tcases", "text": "public void getHeaderString_EmptyDefined_Is_No() { Response response = given() .baseUri( forTestServer()) .header( \"nullable\", \"\\\\FRR`~6E'JU(8+l\\\"o! G-M3VX_UxHz~rHo&3mshX&U{Bu9J_GI'ekwfY})Fo{JuFa}]]Sd8$&x9_%Bh,Bu3p}9%{Q,2e>=R/-)D`0Q;\") .header( \"nullableNonEmpty\", \"\") .header( \"nonEmpty\", \"f_~3+2Dys=ohR+{T8*hW$:%2Z7Udz)VMKq)8$Zc\\\\DOqfvFSDLh@^8BwBC)q*6(H](E4iEMT205M.w2pMI;$BwM\\\"4-/cp^f1W(ZTh_wt'k_.uo}b#<`j^P@xz&}?\\\"e,XS$plN ~[0E(:bVT}nN+D8~L7Ni'\\\\|_}g7N@:04p}o)\\\"&0 V|_3bYGA\\\"vho1:\\\"%13?BvplkOt4ublrE>JSCa+m&{#pK5{JxIb?+TH#eN7PJo\\\"Y[b-YBNt\") .when() .request( \"GET\", \"/header/string\") .then() // empty.Defined=No .statusCode( isBadRequest()) .extract() .response() ; responseValidator.assertBodyValid( \"GET\", \"/header/string\", response.statusCode(), response.getContentType(), response.asString()); responseValidator.assertHeadersValid( \"GET\", \"/header/string\", response.statusCode(), responseHeaders( response)); }", "tokens": 462} {"id": 114754, "source": "method", "repo": "cosium/spring-data-jpa-entity-graph", "text": "public void setEntityManager(EntityManager entityManager) { /* Make sure to use the EntityManager able to inject captured EntityGraphs */ super.setEntityManager(RepositoryEntityManagerEntityGraphInjector.proxy(entityManager)); }", "tokens": 46} {"id": 114841, "source": "method", "repo": "cosium/spring-data-jpa-entity-graph", "text": "void test1() { MyEntity entity = repository.findById(1L).orElseThrow(); assertThat(Hibernate.isInitialized(entity.getMaker())).isTrue(); }", "tokens": 34} {"id": 114864, "source": "method", "repo": "cosium/spring-data-jpa-entity-graph", "text": "void test12() { Page productPage = productRepository.findAll( PageRequest.of(0, 10), NamedEntityGraph.loading(Product.BRAND_EG)); assertThat(productPage.getContent()).isNotEmpty(); for (Product product : productPage.getContent()) { assertThat(Hibernate.isInitialized(product.getBrand())).isTrue(); } }", "tokens": 77} {"id": 114933, "source": "method", "repo": "cosium/spring-data-jpa-entity-graph", "text": "public MetamodelClass(Elements elements, Types types, TypeElement typeElement) { this.elements = requireNonNull(elements); this.types = requireNonNull(types); this.typeElement = requireNonNull(typeElement); }", "tokens": 47} {"id": 115065, "source": "method", "repo": "cottonmc/libgui", "text": "/** Repositions the root panel. @param screenWidth the width of the screen @param screenHeight the height of the screen */ protected void reposition(int screenWidth, int screenHeight) { WPanel basePanel = description.getRootPanel(); clearPeers(); basePanel.validate(description); ((AbstractContainerScreenAccessor) this).setImageWidth(basePanel.getWidth()); ((AbstractContainerScreenAccessor) this).setImageHeight(basePanel.getHeight()); titleLabelX = description.getTitlePos().x(); titleLabelY = description.getTitlePos().y(); if (!description.isFullscreen()) { leftPos = (screenWidth / 2) - (imageWidth / 2); topPos = (screenHeight / 2) - (imageHeight / 2); } else { leftPos = 0; topPos = 0; basePanel.setSize(screenWidth, screenHeight); } }", "tokens": 188} {"id": 115126, "source": "method", "repo": "cottonmc/libgui", "text": "/** Creates a new positioner that centers widgets on the X axis and offsets them on the Y axis.

If the Y offset is negative, the offset is subtracted from the HUD height. @param y the y offset @return a centering positioner */ static Positioner horizontallyCentered(int y) { return (widget, hudWidth, hudHeight) -> { widget.setLocation((hudWidth - widget.getWidth()) / 2, (hudHeight + y) % hudHeight); }; }", "tokens": 110} {"id": 115129, "source": "method", "repo": "cottonmc/libgui", "text": "public void checkAndSendUpdate() { if (dirty) { owner.getNetworking(networkDirection.from()).send(key, value.get()); dirty = false; } }", "tokens": 37} {"id": 115192, "source": "method", "repo": "cottonmc/libgui", "text": "static WidgetSprites libgui$getTextures() { throw new AssertionError(); }", "tokens": 17} {"id": 115219, "source": "method", "repo": "cottonmc/libgui", "text": "protected WAbstractSlider(int min, int max, Axis axis) { if (max <= min) throw new IllegalArgumentException(\"Minimum value must be smaller than the maximum!\"); this.min = min; this.max = max; this.axis = axis; this.value = min; this.direction = (axis == Axis.HORIZONTAL) ? Direction.RIGHT : Direction.UP; }", "tokens": 83} {"id": 115360, "source": "method", "repo": "cottonmc/libgui", "text": "public void validate(GuiDescription host) { super.validate(host); peers.clear(); int index = startIndex; for (int y = 0; y < slotsHigh; y++) { for (int x = 0; x < slotsWide; x++) { // The Slot object is offset +1 because it's the inner area of the slot. ValidatedSlot slot = createSlotPeer(inventory, index, this.getAbsoluteX() + (x * 18) + 1, this.getAbsoluteY() + (y * 18) + 1); slot.setInsertingAllowed(insertingAllowed); slot.setTakingAllowed(takingAllowed); slot.setInputFilter(inputFilter); slot.setOutputFilter(outputFilter); for (ChangeListener listener : listeners) { slot.addChangeListener(this, listener); } peers.add(slot); host.addSlotPeer(slot); index++; } } }", "tokens": 201} {"id": 115458, "source": "method", "repo": "cottonmc/libgui", "text": "public void paint(GuiGraphicsExtractor context, int x, int y, int mouseX, int mouseY) { var matrices = context.pose(); boolean darkMode = shouldRenderInDarkMode(); var textures = WidgetTextures.getScrollBarTextures(darkMode); context.blitSprite(RenderPipelines.GUI_TEXTURED, textures.background(), x, y, getWidth(), getHeight()); Identifier thumbTexture = textures.thumb(); if (maxValue <= 0) return; if (sliding) { thumbTexture = textures.thumbPressed(); } else if (isWithinBounds(mouseX, mouseY)) { thumbTexture = textures.thumbHovered(); } matrices.pushMatrix(); if (axis == Axis.HORIZONTAL) { matrices.translate(x + 1 + getHandlePosition(), y + 1); context.blitSprite(RenderPipelines.GUI_TEXTURED, thumbTexture, 0, 0, getHandleSize(), getHeight() - 2); if (isFocused()) { context.blitSprite(RenderPipelines.GUI_TEXTURED, FOCUS_TEXTURE, 0, 0, getHandleSize(), getHeight() - 2); } } else { matrices.translate(x + 1, y + 1 + getHandlePosition()); context.blitSprite(RenderPipelines.GUI_TEXTURED, thumbTexture, 0, 0, getWidth() - 2, getHandleSize()); if (isFocused()) { context.blitSprite(RenderPipelines.GUI_TEXTURED, FOCUS_TEXTURE, 0, 0, getWidth() - 2, getHandleSize()); } } matrices.popMatrix(); }", "tokens": 323} {"id": 115481, "source": "method", "repo": "cottonmc/libgui", "text": "public WScrollPanel setScrollingHorizontally(TriState scrollingHorizontally) { if (scrollingHorizontally != this.scrollingHorizontally) { this.scrollingHorizontally = scrollingHorizontally; layout(); } return this; }", "tokens": 50} {"id": 115538, "source": "method", "repo": "cottonmc/libgui", "text": "public void addNarrations(NarrationElementOutput builder) { Component label = data.getTitle(); if (label != null) { builder.add(NarratedElementType.TITLE, Component.translatable(NarrationMessages.TAB_TITLE_KEY, label)); } builder.add(NarratedElementType.POSITION, Component.translatable(NarrationMessages.TAB_POSITION_KEY, tabWidgets.indexOf(this) + 1, tabWidgets.size())); }", "tokens": 95} {"id": 115652, "source": "method", "repo": "cottonmc/libgui", "text": "/** If this widget has a host, releases this widget's focus. @see GuiDescription#releaseFocus(WWidget) */ public void releaseFocus() { if (host!=null) host.releaseFocus(this); }", "tokens": 47} {"id": 115655, "source": "method", "repo": "cottonmc/libgui", "text": "/** Paints this widget. @param context the draw context @param x this widget's X coordinate on the screen @param y this widget's Y coordinate on the screen @param mouseX the X coordinate of the cursor @param mouseY the X coordinate of the cursor @since 2.0.0 */ public void paint(GuiGraphicsExtractor context, int x, int y, int mouseX, int mouseY) { }", "tokens": 86} {"id": 115671, "source": "method", "repo": "cottonmc/libgui", "text": "/** {@return whether this widget can be narrated} @see #addNarrations(NarrationElementOutput) @since 4.2.0 */ public boolean isNarratable() { return true; }", "tokens": 46} {"id": 115903, "source": "method", "repo": "countly/countly-sdk-android", "text": "public void testRun_storeHasSingleConnection() throws IOException { final String eventData = \"blahblahblah\"; connectionProcessor = spy(connectionProcessor); when(mockStore.getRequests()).thenReturn(new String[] { eventData }, new String[0]); when(mockDeviceId.getDeviceId()).thenReturn(testDeviceId); final HttpURLConnection mockURLConnection = mock(HttpURLConnection.class); final CountlyResponseStream testInputStream = new CountlyResponseStream(\"Success\"); when(mockURLConnection.getInputStream()).thenReturn(testInputStream); when(mockURLConnection.getResponseCode()).thenReturn(200); doReturn(mockURLConnection).when(connectionProcessor).urlConnectionForServerRequest(eventData + \"&rr=0\", null); connectionProcessor.run(); verify(mockStore, times(2)).getRequests(); verify(connectionProcessor).urlConnectionForServerRequest(eventData + \"&rr=0\", null); verify(mockURLConnection).connect(); verify(mockURLConnection).getInputStream(); verify(mockURLConnection).getResponseCode(); assertTrue(testInputStream.fullyRead()); verify(mockStore).removeRequest(eventData); assertTrue(testInputStream.closed); verify(mockURLConnection).disconnect(); }", "tokens": 248} {"id": 116030, "source": "method", "repo": "countly/countly-sdk-android", "text": "public void testMetricProviderOverride_timezoneAndRamOverride() { MetricProvider override = new MetricProvider() { @Override public String getTimezoneOffset() { return \"120\"; } @Override public String getTotalRAM() { return \"8192\"; } @Override public String getRamTotal() { return \"8192\"; } @Override public String getRamCurrent(Context context) { return \"4096\"; } }; DeviceInfo deviceInfo = new DeviceInfo(override); assertEquals(\"120\", deviceInfo.mp.getTimezoneOffset()); assertEquals(\"8192\", deviceInfo.mp.getTotalRAM()); assertEquals(\"8192\", deviceInfo.mp.getRamTotal()); assertEquals(\"4096\", deviceInfo.mp.getRamCurrent(TestUtils.getContext())); }", "tokens": 169} {"id": 116100, "source": "method", "repo": "countly/countly-sdk-android", "text": "/** Test that networking is properly disabled when configured When networking is disabled, request queue operations are skipped */ public void scenario_networkingDisabled() throws JSONException, InterruptedException { // Initial setup with all features enabled ServerConfigBuilder serverConfigBuilder = new ServerConfigBuilder() .defaults(); Countly.sharedInstance().init(TestUtils.createIRGeneratorConfig(createIRGForSpecificResponse(serverConfigBuilder.build()))); Countly.sharedInstance().onStartInternal(null); ModuleLog mockLog = Mockito.mock(ModuleLog.class); Countly.sharedInstance().L = mockLog; // Verify initial state Assert.assertTrue(Countly.sharedInstance().moduleConfiguration.getNetworkingEnabled()); Thread.sleep(1000); Assert.assertEquals(1, TestUtils.getCurrentRQ().length); // begin session request serverConfigBuilder.networking(false); Countly.sharedInstance().onStopInternal(); Countly.sharedInstance().sdkIsInitialised = false; Mockito.verify(mockLog, Mockito.never()).w(\"[ConnectionProcessor] run, Networking config is disabled, request queue skipped\"); Assert.assertEquals(3, TestUtils.getCurrentRQ().length); //first begin + orientation + first end session Countly.sharedInstance().init(TestUtils.createIRGeneratorConfig(createIRGForSpecificResponse(serverConfigBuilder.build()))); Countly.sharedInstance().onStartInternal(null); Thread.sleep(1000); Assert.assertFalse(Countly.sharedInstance().moduleConfiguration.getNetworkingEnabled()); Assert.assertEquals(4, TestUtils.getCurrentRQ().length); //first begin + orientation + first end session + second begin Countly.sharedInstance().requestQueue().attemptToSendStoredRequests(); Thread.sleep(1000); Mockito.verify(mockLog, Mockito.atLeastOnce()).w(\"[ConnectionProcessor] run, Networking config is disabled, request queue skipped\"); }", "tokens": 365} {"id": 116169, "source": "method", "repo": "countly/countly-sdk-android", "text": "public void recordEvent_4() { eventWithSegmentation(null, null, null, null); }", "tokens": 22} {"id": 116206, "source": "method", "repo": "countly/countly-sdk-android", "text": "public void loadRatingPreferencesBadJson() { StorageProvider cs = mCountly.connectionQueue_.getStorageProvider(); cs.setStarRatingPreferences(\"./{}23[]d\"); Assert.assertEquals(\"./{}23[]d\", cs.getStarRatingPreferences()); ModuleRatings.StarRatingPreferences srp = ModuleRatings.loadStarRatingPreferences(cs); Assert.assertEquals(\"\", srp.appVersion); Assert.assertEquals(5, srp.sessionLimit); Assert.assertEquals(0, srp.sessionAmount); Assert.assertFalse(srp.isShownForCurrentVersion); Assert.assertFalse(srp.automaticRatingShouldBeShown); Assert.assertFalse(srp.disabledAutomaticForNewVersions); Assert.assertFalse(srp.automaticHasBeenShown); Assert.assertTrue(srp.isDialogCancellable); Assert.assertEquals(\"App rating\", srp.dialogTextTitle); Assert.assertEquals(\"Please rate this app\", srp.dialogTextMessage); Assert.assertEquals(\"Cancel\", srp.dialogTextDismiss); }", "tokens": 213} {"id": 116287, "source": "method", "repo": "countly/countly-sdk-android", "text": "ServerConfigBuilder journeyTriggerEvents(Set journeyTriggerEvents) { config.put(keyRJourneyTriggerEvents, journeyTriggerEvents); return this; }", "tokens": 37} {"id": 116663, "source": "method", "repo": "countly/countly-sdk-android", "text": "/** Returns the session limit set for automatic star rating */ public int getAutomaticStarRatingSessionLimit() { synchronized (_cly) { int sessionLimit = ModuleRatings.getAutomaticStarRatingSessionLimitInternal(_cly.countlyStore); L.i(\"[Ratings] Getting automatic star rating session limit: [\" + sessionLimit + \"]\"); return sessionLimit; } }", "tokens": 80} {"id": 116796, "source": "method", "repo": "cqfn/aibolit", "text": "public static void main(String[] args) throws IOException { String DirName=null; DirName = args[0]; // retrieve all .java files in the directory and subdirectories. //List JavaFiles=retrieveFiles(DirName); List JavaFiles=Arrays.asList(DirName); // parse files in a directory to list of char array List FilesRead=ParseFilesInDir(JavaFiles); ASTVisitorMod ASTVisitorFile; int DistinctOperators=0; int DistinctOperands=0; int TotalOperators=0; int TotalOperands=0; int OperatorCount=0; int OperandCount=0; // Construct the AST of each java file. visit different nodes to get the number of operors and operands // Retrieve the number of distinct operators, distinct operands, // total operators, and total operands for each .java file in the directory. // Sum each parameter from different files together to be used in Halstead Complexity metrics. for(int i=0; i= index.getAutoGeneratedIdTimestamp(); } else { // in this case we force mayHaveBeenIndexBefore = maxUnsafeAutoIdTimestamp.get() >= index.getAutoGeneratedIdTimestamp(); updateAutoIdTimestamp(index.getAutoGeneratedIdTimestamp(), false); } return mayHaveBeenIndexBefore; }", "tokens": 189} {"id": 117128, "source": "method", "repo": "cqfn/aibolit", "text": "public void rootsAdded(final RootsEvent event) { }", "tokens": 14} {"id": 117374, "source": "method", "repo": "cqfn/aibolit", "text": "/** Iterate over the records in ascending sorted order. Sorting occurs on the primary key value starting at the specified startKey. @param minKey the minimum primary key, may be null. @param maxKey the maximum primary key, may be null. @param startKey the initial iterator position, if null minKey is also start. @return record iterator @throws IOException if an I/O error occurs. */ public RecordIterator iterator(Field minKey, Field maxKey, Field startKey) throws IOException { synchronized (db) { if (useLongKeyNodes) { long min = minKey != null ? minKey.getLongValue() : Long.MIN_VALUE; long max = maxKey != null ? maxKey.getLongValue() : Long.MAX_VALUE; long start = startKey != null ? startKey.getLongValue() : min; return new LongKeyRecordIterator(min, max, start); } return new VarKeyRecordIterator(minKey, maxKey, startKey); } }", "tokens": 212} {"id": 117410, "source": "method", "repo": "cqfn/aibolit", "text": "/** Returns buffer count for original buffer file. */ public int getOriginalBufferCount() { return originalBufCount; }", "tokens": 25} {"id": 117447, "source": "method", "repo": "cqfn/aibolit", "text": "public void secondPublicMethod() { // +1 for public method println(); // +1 for invocation (local method) }", "tokens": 27} {"id": 117668, "source": "method", "repo": "cqfn/aibolit", "text": "/** Get the comma delimited values of the name property as a collection of Strings. If no such property is specified then empty collection is returned.

This is an optimized version of {@link #getStrings(String)} @param name property name. @return property value as a collection of Strings. */ public Collection getStringCollection(String name) { String valueString = get(name); return StringUtils.getStringCollection(valueString); }", "tokens": 105} {"id": 117750, "source": "method", "repo": "cqfn/jpeek", "text": "/** Ctor. @param target Target dir @param overwrite Overwrite if exists */ public FileTarget(final File target, final Boolean overwrite) { this.target = target; this.overwrite = overwrite; }", "tokens": 43} {"id": 117784, "source": "method", "repo": "cqfn/jpeek", "text": "public Node node() { return this.output.value().node(); }", "tokens": 16} {"id": 117841, "source": "method", "repo": "cqfn/jpeek", "text": "/** Make an update. @return The update */ AttributeValueUpdate update() { return this.update(AttributeAction.PUT); }", "tokens": 28} {"id": 117885, "source": "method", "repo": "cqfn/jpeek", "text": "public Response act(final Request req) { return new RsPage( req, \"all\", () -> new IterableOf<>( new XeAppend( \"recent\", new XeDirectives( new Joined<>( new Results().all() ) ) ) ) ); }", "tokens": 58} {"id": 117970, "source": "method", "repo": "cqfn/jpeek", "text": "void findsMethodsAndArgs() { new Assertion<>( \"Must find methods with diff param types\", XhtmlMatchers.xhtml( new Skeleton( new FakeBase(\"MethodsWithDiffParamTypes\") ).xml().toString() ), XhtmlMatchers.hasXPaths( \"//class/methods[count(method)=7]\", \"//method[@name='methodSix']/args[count(arg)=1]\", \"//method[@name='methodSix']/args/arg[@type='Ljava/sql/Timestamp']\", \"//method[@name='methodSix' and child::return='Ljava/util/Date']\", \"//method[@name='methodTwo' and child::return='V']\", \"//method[@name='methodOne']/args/arg[@type='Ljava/lang/Object']\" ) ).affirm(); }", "tokens": 178} {"id": 118038, "source": "method", "repo": "cqfn/jpeek", "text": "public int methodOne() { return num++; }", "tokens": 11} {"id": 118204, "source": "method", "repo": "crafttweaker/crafttweaker", "text": "public IData or(IData other) { return of(asInt() | other.asInt()); }", "tokens": 22} {"id": 118301, "source": "method", "repo": "crafttweaker/crafttweaker", "text": "public StreamCodec> streamCodec() { return STREAM_CODEC; }", "tokens": 21} {"id": 118317, "source": "method", "repo": "crafttweaker/crafttweaker", "text": "public void setData(MapData data) { this.data = data; }", "tokens": 18} {"id": 118418, "source": "method", "repo": "crafttweaker/crafttweaker", "text": "public void error(final CharSequence message) { for(final Logger logger : this.loggers) { logger.error(message); } }", "tokens": 30} {"id": 118529, "source": "method", "repo": "crafttweaker/crafttweaker", "text": "private Collection>>> computeInheritanceData(final IScriptLoader loader, final Map snapshot) { return Stream.concat(loader.allInheritedLoaders().stream(), Stream.of(loader)) .map(snapshot::get) .filter(Objects::nonNull) .map(EnumData::enums) .toList(); }", "tokens": 88} {"id": 118690, "source": "method", "repo": "crafttweaker/crafttweaker", "text": "/** Gets the fade colors of the FireworkExplosion. @return The fade colors of the FireworkExplosion. */ public static List fadeColors(FireworkExplosion internal) { return internal.fadeColors(); }", "tokens": 45} {"id": 118841, "source": "method", "repo": "crafttweaker/crafttweaker", "text": "public static boolean consumesAction(InteractionResult internal) { return internal.consumesAction(); }", "tokens": 20} {"id": 118855, "source": "method", "repo": "crafttweaker/crafttweaker", "text": "public static DamageSource onFire(DamageSources internal) { return internal.onFire(); }", "tokens": 20} {"id": 119156, "source": "method", "repo": "crazy-crew/crazyauctions", "text": "public ItemStack getItemStack() { return this.itemStack; }", "tokens": 13} {"id": 119188, "source": "method", "repo": "crazy-crew/crazyauctions", "text": "/** Adds a single enchantment to an item. @param enchantment the type of enchantment. @param level the level of the enchantment. @param unsafeEnchantments if the enchantment is higher than the vanilla defaults. @return the ItemBuilder with updated enchantments. */ public ItemBuilder addEnchantment(Enchantment enchantment, int level, boolean unsafeEnchantments) { getItemStack().editMeta(itemMeta -> { itemMeta.addEnchant(enchantment, level, unsafeEnchantments); }); return this; }", "tokens": 95} {"id": 119236, "source": "method", "repo": "crazy-crew/crazyauctions", "text": "public final PermissionDefault getDefault() { return this.isDefault; }", "tokens": 14} {"id": 119326, "source": "method", "repo": "crazy-crew/crazyauctions", "text": "public final List getPermissions() { return List.of(Permissions.bid.getContext()); }", "tokens": 25} {"id": 119331, "source": "method", "repo": "crazy-crew/crazyauctions", "text": "public int getPageNumber() { return this.pageNumber; }", "tokens": 14} {"id": 119348, "source": "method", "repo": "crazy-crew/crazyauctions", "text": "public boolean setupEconomy() { RegisteredServiceProvider serviceProvider = this.plugin.getServer().getServicesManager().getRegistration(Economy.class); if (serviceProvider != null) this.vault = serviceProvider.getProvider(); return this.vault != null; }", "tokens": 59} {"id": 119414, "source": "method", "repo": "crazy-crew/crazycrates", "text": "public void setComment(final CommentedConfigurationNode configuration, final String value, final Object... path) { configuration.node(path).commentIfAbsent(value); this.fileManager.saveFile(this.propertyDataBuilder.getPath()); }", "tokens": 52} {"id": 119520, "source": "method", "repo": "crazy-crew/crazycrates", "text": "public boolean hasWorld(final Key worldKey) { return CompletableFuture.supplyAsync(() -> { boolean hasWorld = false; try (final Connection connection = this.source.getConnection(); final PreparedStatement statement = connection.prepareStatement(\"select 1 from crate_worlds where world_id=?\")) { statement.setString(1, worldKey.asString()); return statement.executeQuery().next(); } catch (final SQLException exception) { exception.printStackTrace(); } return hasWorld; }).join(); }", "tokens": 104} {"id": 119523, "source": "method", "repo": "crazy-crew/crazycrates", "text": "public Map> getCrateLocations() { final Map> locations = new ConcurrentHashMap<>(); locations.putIfAbsent(CrateStatus.failed, new CopyOnWriteArrayList<>()); locations.putIfAbsent(CrateStatus.success, new CopyOnWriteArrayList<>()); locations.putIfAbsent(CrateStatus.unavailable, new CopyOnWriteArrayList<>()); CompletableFuture.runAsync(() -> { try (final Connection connection = this.source.getConnection(); final PreparedStatement statement = connection.prepareStatement(\"select * from crate_locations\") ) { final ResultSet resultSet = statement.executeQuery(); while (resultSet.next()) { final Key key = this.plugin.asWorld(resultSet.getString(\"world_id\")); final String crateId = resultSet.getString(\"crate_id\"); final String id = resultSet.getString(\"id\"); final int x = resultSet.getInt(\"x\"); final int y = resultSet.getInt(\"y\"); final int z = resultSet.getInt(\"z\"); if (key == null) { locations.get(CrateStatus.unavailable).add(new CrazyLocation( crateId, Key.key(\"minecraft:unknown\"), id, x, y, z )); continue; } final CrazyLocation location = new CrazyLocation( crateId, key, id, x, y, z ); if (!this.plugin.isCrateAvailable(crateId)) { locations.get(CrateStatus.unavailable).add(location); continue; } locations.get(CrateStatus.success).add(location); } } catch (final Exception exception) { exception.printStackTrace(); } }).join(); return locations; }", "tokens": 342} {"id": 119698, "source": "method", "repo": "crazy-crew/crazycrates", "text": "public final List getPrizeMessage() { return this.prizeMessage; }", "tokens": 19} {"id": 119761, "source": "method", "repo": "crazy-crew/crazycrates", "text": "/** Gets the weight @return the weight */ public final double getWeight() { if (this.weight <= 0.0) { this.fusion.log(Level.WARNING, \"Cannot fetch the weight as the option is not present for this prize or is less than or equal to 0.0: %s in the crate: %s\", this.sectionName, this.crateName); } return this.weight; }", "tokens": 91} {"id": 120104, "source": "method", "repo": "crazy-crew/crazycrates", "text": "/** Sets a tier to the item-builder's persistent data container. @param itemBuilder the ItemBuilder @param name the name of the tier */ public void setTier(@NotNull final ItemBuilder itemBuilder, @Nullable final String name) { if (name == null || name.isEmpty()) return; itemBuilder.setPersistentString(ItemKeys.crate_tier.getNamespacedKey(), name); }", "tokens": 78} {"id": 120158, "source": "method", "repo": "crazy-crew/crazycrates", "text": "public void open(@NotNull final KeyType type, final boolean checkHand, final boolean isSilent, final int amount, @Nullable final EventType eventType) { final String fileName = this.crate.getFileName(); // Crate event failed, so we return. if (isCrateEventValid(type, checkHand, isSilent, amount, eventType, event -> { if (!this.userManager.takeKeys(this.uuid, fileName, type, amount, checkHand)) { this.crateManager.endCrate(this.crate, this.player); event.setCancelled(true); } })) { return; } this.crateManager.addPicker(this.player, false); this.crateManager.addCloser(this.player, false); setRandomPrizes(); this.player.openInventory(this.inventory); addCrateTask(new FoliaScheduler(this.plugin, null, this.player) { int full = 0; int open = 0; @Override public void run() { if (this.full < 25) { setRandomPrizes(); playSound(\"cycle-sound\", Sound.Source.MASTER, \"block.lava.pop\"); } this.open++; if (this.open >= 3) { player.updateInventory(); this.open = 0; } this.full++; if (this.full == 26) { playSound(\"stop-sound\", Sound.Source.MASTER, \"block.lava.pop\"); setRandomGlass(); crateManager.addPicker(player, true); } } }.runAtFixedRate(1, 3)); }", "tokens": 330} {"id": 120324, "source": "method", "repo": "crazy-crew/crazyenchantments", "text": "public double getRageIncrement() { return this.rageIncrement; }", "tokens": 16} {"id": 120351, "source": "method", "repo": "crazy-crew/crazyenchantments", "text": "public void title(String title) { this.title = title; }", "tokens": 16} {"id": 120468, "source": "method", "repo": "crazy-crew/crazyenchantments", "text": "/** Checks if the player has enough of a currency. @param player The player you are checking. @param option The ShopOption you wish to check. @return True if they have enough to buy it or false if they don't. */ public boolean canBuy(Player player, ShopOption option) { return canBuy(player, option.getCurrency(), option.getCost()); }", "tokens": 83} {"id": 120518, "source": "method", "repo": "crazy-crew/crazyenchantments", "text": "/** @return Set of enchantments that are on the item. */ public Set getEnchantments() { return this.enchants.keySet(); }", "tokens": 32} {"id": 120549, "source": "method", "repo": "crazy-crew/crazyenchantments", "text": "public int getSuccessChance() { return this.successChance; }", "tokens": 15} {"id": 120556, "source": "method", "repo": "crazy-crew/crazyenchantments", "text": "public UnregisterCEnchantmentEvent(CEnchantment enchantment) { this.enchantment = enchantment; }", "tokens": 18} {"id": 120568, "source": "method", "repo": "crazy-crew/crazyenchantments", "text": "public void load() { this.armorEnchantments.clear(); if (CEnchantments.FORTIFY.isActivated()) this.armorEnchantments.add(new ArmorEnchantment(CEnchantments.FORTIFY, new PotionEffects(PotionEffectType.WEAKNESS, 5 * 20, 0), true)); if (CEnchantments.FREEZE.isActivated()) this.armorEnchantments.add(new ArmorEnchantment(CEnchantments.FREEZE, new PotionEffects(PotionEffectType.SLOWNESS, 3 * 20, 1), true)); if (CEnchantments.PAINGIVER.isActivated()) this.armorEnchantments.add(new ArmorEnchantment(CEnchantments.PAINGIVER, new PotionEffects(PotionEffectType.POISON, 3 * 20, 0), true)); if (CEnchantments.SMOKEBOMB.isActivated()) this.armorEnchantments.add(new ArmorEnchantment(CEnchantments.SMOKEBOMB, Arrays.asList(new PotionEffects(PotionEffectType.SLOWNESS, 3 * 20, 1), new PotionEffects(PotionEffectType.BLINDNESS, 3 * 20, 0)), false)); if (CEnchantments.VOODOO.isActivated()) this.armorEnchantments.add(new ArmorEnchantment(CEnchantments.VOODOO, new PotionEffects(PotionEffectType.WEAKNESS, 5 * 20, 0), true)); }", "tokens": 294} {"id": 120643, "source": "method", "repo": "crazy-crew/crazyenchantments", "text": "public void removeCEnchantment(CEnchantment enchantment) { this.cEnchantmentRemove.add(enchantment); }", "tokens": 21} {"id": 120766, "source": "method", "repo": "crazy-crew/crazyenchantments", "text": "public static boolean isIgnoredEvent(Event event) { return ignoredEvents.contains(event); }", "tokens": 21} {"id": 121032, "source": "method", "repo": "crazy-crew/crazyenchantments", "text": "public boolean canExplodeBlock(final Location location) { if (!isPluginReady()) { return true; } return this.container .createQuery() .testState(BukkitAdapter.adapt(location), Associables.constant(Association.NON_MEMBER), Flags.TNT); }", "tokens": 63} {"id": 121038, "source": "method", "repo": "crazy-crew/crazyenchantments", "text": "public SuperiorSkyBlockImpl() { super(Support.superiorskyblock); }", "tokens": 21} {"id": 121217, "source": "method", "repo": "crazzyghost/alphavantage-java", "text": "/** Exposes the plus directional movement ({@code PLUS_DM}). See {@link com.crazzyghost.alphavantage.indicator.request.PeriodicRequest} for the parameter contract. @return a request proxy for {@code PLUS_DM} @deprecated Replaced by {@link com.crazzyghost.alphavantage.technicalindicator.TechnicalIndicator#plusdm()} */ public PeriodicRequestProxy plusdm(){ return new PeriodicRequestProxy<>(Function.PLUS_DM); }", "tokens": 107} {"id": 121467, "source": "method", "repo": "crazzyghost/alphavantage-java", "text": "public ADResponse get(String error) { return new ADResponse(error); }", "tokens": 20} {"id": 121468, "source": "method", "repo": "crazzyghost/alphavantage-java", "text": "public String getTechnicalIndicatorKey() { return \"Chaikin A/D\"; }", "tokens": 19} {"id": 121550, "source": "method", "repo": "crazzyghost/alphavantage-java", "text": "/** Parses a raw API response into a {@link ULTOSCResponse}. @param stringObjectMap the raw parsed JSON response @return the parsed response */ public static ULTOSCResponse of(Map stringObjectMap) { Parser parser = new ULTOSCParser(); return parser.parse(stringObjectMap); }", "tokens": 72} {"id": 121669, "source": "method", "repo": "crazzyghost/alphavantage-java", "text": "public void testAROONOSC() throws InterruptedException { AROONOSCResponse response = AlphaVantage.api() .indicator() .aroonosc() .forSymbol(\"IBM\") .interval(Interval.DAILY) .timePeriod(60) .dataType(DataType.JSON) .fetchSync(); assertEquals(response.getIndicatorUnits().size(), 2); }", "tokens": 84} {"id": 122151, "source": "method", "repo": "Creators-of-Create/Ponder", "text": "public Holder getUncachedNoiseBiome(int p_225604_1_, int p_225604_2_, int p_225604_3_) { return level.getUncachedNoiseBiome(p_225604_1_, p_225604_2_, p_225604_3_); }", "tokens": 97} {"id": 122275, "source": "method", "repo": "Creators-of-Create/Ponder", "text": "public boolean isCurrent() { return this == CatnipServices.PLATFORM.getLoader(); }", "tokens": 20} {"id": 122285, "source": "method", "repo": "Creators-of-Create/Ponder", "text": "public static ResourceLocation getKeyOrThrow(ItemLike itemLike) { if (itemLike instanceof Item item) { return getKeyOrThrow(item); } else if (itemLike instanceof Block block) { return getKeyOrThrow(block); } throw new IllegalArgumentException(\"Could not get key for itemLike \" + itemLike + \"!\"); }", "tokens": 69} {"id": 122341, "source": "method", "repo": "Creators-of-Create/Ponder", "text": "public SuperByteBuffer useLevelLight(BlockAndTintGetter level) { useLevelLight = true; levelWithLight = level; return this; }", "tokens": 30} {"id": 122497, "source": "method", "repo": "Creators-of-Create/Ponder", "text": "private static Color getSmoothColorForProgress(float progress) { if (progress < 0.5) return borderA.mixWith(borderB, progress * 2); return borderB.mixWith(borderC, (progress - .5f) * 2); }", "tokens": 61} {"id": 122612, "source": "method", "repo": "Creators-of-Create/Ponder", "text": "public MultiTagBuilder.Tag addToTag(ResourceLocation... tags) { return new GenericMultiTagBuilder().new Tag(this, List.of(tags)); }", "tokens": 42} {"id": 122620, "source": "method", "repo": "Creators-of-Create/Ponder", "text": "public String getTagName(ResourceLocation key) { if (PonderIndex.editingModeActive()) return tag.containsKey(key) ? tag.get(key) .getFirst() : (\"unregistered tag entry: \" + key); return I18n.get(langKeyForTag(key)); }", "tokens": 65} {"id": 122673, "source": "method", "repo": "Creators-of-Create/Ponder", "text": "public static PonderUI of(ItemStack item) { return new PonderUI( PonderIndex.getSceneAccess().compile(RegisteredObjectsHelper.getKeyOrThrow(item.getItem()))); }", "tokens": 39} {"id": 122817, "source": "method", "repo": "crocs-muni/jcalgtest", "text": "public void UploadApplet() throws Exception { m_SystemOutLogger.println(\"Uploading applet to card on terminal \" + getTerminalName() + \"...\"); String cardAtr = getATR().replace(\" \", \"_\"); //Check if folder !card_uploaders is correctly set File fileCardUploadersFolder = new File(CardMngr.cardUploadersFolder); if(!fileCardUploadersFolder.exists()) { throw new Exception(\"Cannot find !card_uploaders folder. Folder \" + CardMngr.cardUploadersFolder + \" does not exist.\"); } //Set path to run bat file String batFileName; if(CardMngr.cardUploadersFolder.endsWith(File.separator)) batFileName = CardMngr.cardUploadersFolder + \"upload.bat\"; else batFileName = CardMngr.cardUploadersFolder + File.separator + \"upload.bat\"; //Run bat file with arguments cardAtr and readerName String[] commands = new String[]{batFileName, cardAtr, getTerminalName()}; ProcessBuilder pb = new ProcessBuilder(commands); pb.directory(fileCardUploadersFolder); pb.redirectErrorStream(true); pb.redirectOutput(Redirect.appendTo(new File(\"upload_log_\" + getTerminalName() + \".txt\"))); Process p = pb.start(); p.waitFor(); //Check if process ended successful if(p.exitValue()!=0) { m_SystemOutLogger.println(\"Uploading applet: Error\"); throw new Exception(\"Cannot upload applet. Process of file \" + batFileName + \" ended with \" + p.exitValue()); } else { m_SystemOutLogger.println(\"Uploading applet: Done\"); } }", "tokens": 367} {"id": 122916, "source": "method", "repo": "crocs-muni/jcalgtest", "text": "public void testAllRSAPrivateCrtKeys (int numRepeatWholeOperation, int numRepeatWholeMeasurement) throws IOException, Exception{ testAllRSAPrivateCrtKeys((short)numRepeatWholeOperation, (short)numRepeatWholeMeasurement); }", "tokens": 43} {"id": 123075, "source": "method", "repo": "crocs-muni/jcalgtest", "text": "public Dword getValue() { long v; if (Dword.SIZE == 4) v = 0xffffffffl & getPointer().getInt(0); else v = getPointer().getLong(0); return new Dword(v); }", "tokens": 52} {"id": 123095, "source": "method", "repo": "crocs-muni/jcalgtest", "text": "public SCardReaderState(){ super(null, ALIGN); dwCurrentState = dwEventState = cbAtr = new Dword(0); }", "tokens": 37} {"id": 123101, "source": "method", "repo": "crocs-muni/jcalgtest", "text": "public static WinscardLibInfo openLib() { String libraryName = Platform.isWindows() ? WINDOWS_PATH : Platform.isMac() ? MAC_PATH : PCSC_PATH; HashMap options = new HashMap(); if (Platform.isWindows()) { options.put(Library.OPTION_FUNCTION_MAPPER, new WindowsFunctionMapper()); } else if (Platform.isMac()) { options.put(Library.OPTION_FUNCTION_MAPPER, new MacFunctionMapper()); } WinscardLibrary lib = (WinscardLibrary) Native.loadLibrary(libraryName, WinscardLibrary.class, options); NativeLibrary nativeLibrary = NativeLibrary.getInstance(libraryName); // SCARD_PCI_* is #defined to the following symbols (both pcsclite and winscard) ScardIoRequest SCARD_PCI_T0 = new ScardIoRequest(nativeLibrary.getGlobalVariableAddress(\"g_rgSCardT0Pci\")); ScardIoRequest SCARD_PCI_T1 = new ScardIoRequest(nativeLibrary.getGlobalVariableAddress(\"g_rgSCardT1Pci\")); ScardIoRequest SCARD_PCI_RAW = new ScardIoRequest(nativeLibrary.getGlobalVariableAddress(\"g_rgSCardRawPci\")); SCARD_PCI_T0.read(); SCARD_PCI_T1.read(); SCARD_PCI_RAW.read(); SCARD_PCI_T0.setAutoSynch(false); SCARD_PCI_T1.setAutoSynch(false); SCARD_PCI_RAW.setAutoSynch(false); return new WinscardLibInfo(lib, SCARD_PCI_T0, SCARD_PCI_T1, SCARD_PCI_RAW); }", "tokens": 396} {"id": 123155, "source": "method", "repo": "crocs-muni/jcalgtest", "text": "void GetVersion(APDU apdu) { byte[] apdubuf = apdu.getBuffer(); apdu.setIncomingAndReceive(); short offset = Util.arrayCopyNonAtomic(ALGTEST_JAVACARD_VERSION_CURRENT, (short) 0, apdubuf, (short) 0, (short) ALGTEST_JAVACARD_VERSION_CURRENT.length); if (!m_bLargeAuxArraysAvailable) { offset = Util.arrayCopyNonAtomic(AUX_SMALL, (short) 0, apdubuf, offset, (short) AUX_SMALL.length); } apdu.setOutgoingAndSend((byte) 0, offset); }", "tokens": 132} {"id": 123329, "source": "method", "repo": "crossbario/autobahn-java", "text": "private void send(IMessage message) { if (!isConnected()) { throw new IllegalStateException(\"no transport\"); } LOGGER.d(\" >>> TX : \" + message); mTransport.send(mSerializer.serialize(message.marshal()), mSerializer.isBinary()); }", "tokens": 57} {"id": 123508, "source": "method", "repo": "crossbario/autobahn-java", "text": "public Subscribe(long request, SubscribeOptions options, String topic) { this.request = request; this.topic = topic; if (options != null) { String match = options.getMatch(); if (match != null) { if (!match.equals(MATCH_EXACT) && !match.equals(MATCH_PREFIX) && !match.equals(MATCH_WILDCARD)) { throw new IllegalArgumentException(\"match must be one of exact, prefix or wildcard.\"); } } this.options = options; } else { this.options = new SubscribeOptions(MATCH_EXACT, false); } }", "tokens": 127} {"id": 123664, "source": "method", "repo": "crossbario/autobahn-java", "text": "public Connection(WebSocketOptions options) { mOptions = options; mProtocol = new FrameProtocol(); }", "tokens": 22} {"id": 123784, "source": "method", "repo": "crossbario/autobahn-java", "text": "public static IThreadMessenger selectThreadMessenger() throws RuntimeException { Class messengerClass; try { if (io.crossbar.autobahn.utils.Platform.isAndroid()) { messengerClass = Class.forName(\"io.crossbar.autobahn.websocket.utils.AndroidThreadMessenger\"); } else { messengerClass = Class.forName(\"io.crossbar.autobahn.websocket.utils.ThreadMessenger\"); } return (IThreadMessenger) messengerClass.getConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } }", "tokens": 131} {"id": 123949, "source": "method", "repo": "crossoverjie/cim", "text": "public MsgCallBackListener(MsgLogger msgLogger, Event event) { this.msgLogger = msgLogger; this.event = event; }", "tokens": 30} {"id": 124079, "source": "method", "repo": "crossoverjie/cim", "text": "private void put(int key, Set tasks) { int index = mod(key, bufferSize); ringBuffer[index] = tasks; }", "tokens": 33} {"id": 124286, "source": "method", "repo": "crossoverjie/cim", "text": "public Set onlineUser() { Set set = null; Set members = redisTemplate.opsForSet().members(LOGIN_STATUS_PREFIX); for (String member : members) { if (set == null) { set = new HashSet<>(64); } try { Optional cimUserInfo = loadUserInfoByUserId(Long.valueOf(member)); cimUserInfo.ifPresent(set::add); } catch (NumberFormatException e) { log.warn(\"Skipping invalid user ID format in Redis set: {}\", member); } } return set; }", "tokens": 127} {"id": 124292, "source": "method", "repo": "crossoverjie/cim", "text": "public void onlineUser() { Set cimUserInfos = userInfoCacheService.onlineUser(); log.info(\"cimUserInfos={}\", JSON.toJSONString(cimUserInfos)); }", "tokens": 41} {"id": 124356, "source": "method", "repo": "crossoverjie/cim", "text": "public static void removeSession(Long userId) { SESSION_MAP.remove(userId); }", "tokens": 21} {"id": 124556, "source": "method", "repo": "cryptomorin/kingdomsx", "text": "public CommandResult execute(CommandContext context) { boolean defaultsOnly = false; if (context.hasArgs(1)) { if (context.arg(0).equalsIgnoreCase(\"defaults\")) defaultsOnly = true; } Path path = TempKingdomsFolder.getOrCreateFile(\"command-permissions.txt\"); try (BufferedWriter writer = Files.newBufferedWriter(path, StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING)) { for (KingdomsCommand cmd : KingdomsCommandHandler.getCommands(Language.getDefault()).values()) { if (defaultsOnly && cmd.getPermission().getDefault() != PermissionDefault.TRUE) continue; writer.write(cmd.getName() + \" (\" + Strings.join(cmd.getAliases().get(Language.getDefault()).toArray(), \", \") + \") \" + cmd.getPermission().getName()); writer.newLine(); } } catch (IOException e) { e.printStackTrace(); } context.sendMessage(AdminToolsLang.COMMAND_ADMIN_COMMANDS_DONE, \"output\", path.toAbsolutePath()); return CommandResult.SUCCESS; }", "tokens": 225} {"id": 124712, "source": "method", "repo": "cryptomorin/kingdomsx", "text": "/** An immutable collection of all the unique chunks in the cluster. */ public Collection getChunks() { return Collections.unmodifiableCollection(chunks); }", "tokens": 35} {"id": 124740, "source": "method", "repo": "cryptomorin/kingdomsx", "text": "public Object updateOrRegisterIcon(String id, Path path) { id = id.replace('/', '-'); MarkerIcon icon = api.getMarkerAPI().getMarkerIcon(id); if (icon != null) return icon; InputStream is = null; try { is = new BufferedInputStream(Files.newInputStream(path, StandardOpenOption.READ)); } catch (IOException e) { e.printStackTrace(); } // For some reason, Dynmap doesn't print the stacktrace if it fails to register an icon. // It just logs a message: Error copying marker - {$path} // Note: The second parameter is the \"label\" and I have no idea how it's used. // Note: Dynmap uses the \"id\" as the file name. // https://github.com/webbukkit/dynmap/blob/003cad5dc280b68eb675dc7683a87b0ee7b48b58/DynmapCore/src/main/java/org/dynmap/markers/impl/MarkerAPIImpl.java#L755-L756 MarkerIcon created = api.getMarkerAPI().createMarkerIcon(id, \"Kingdoms\", is); return Objects.requireNonNull(created, \"Failed to create Dynmap icon with id ' \" + id + \"' and path: \" + path); }", "tokens": 298} {"id": 124871, "source": "method", "repo": "cryptomorin/kingdomsx", "text": "public InteractiveGUI openOutpostRewardsCommandGUIEditor() { InteractiveGUI gui = GUIAccessor.prepare(player, OutpostGUI.REWARDS_COMMANDS, getEdits()); ReusableOptionHandler cmdsOption = gui.getReusableOption(\"commands\"); List commands = outpost.getRewards().getCommands(); for (int i = 0; i < commands.size(); i++) { String cmd = commands.get(i); final int finalI = i; cmdsOption.getMessageContext().raw(\"command\", cmd); cmdsOption.on(ClickType.LEFT, (ctx) -> { ctx.sendMessage(OutpostsLang.COMMAND_OUTPOST_EDIT_REWARDS_COMMAND_ENTER); ctx.startConversation(); }).setConversation((ctx, input) -> { commands.add(input); ctx.endConversation(); openOutpostRewardsCommandGUIEditor(); }); cmdsOption.on(ClickType.RIGHT, () -> { commands.remove(finalI); openOutpostRewardsCommandGUIEditor(); }); cmdsOption.done(); if (!cmdsOption.hasNext()) break; } gui.option(\"add\").onNormalClicks(ctx -> { ctx.sendMessage(OutpostsLang.COMMAND_OUTPOST_EDIT_REWARDS_COMMAND_ENTER); ctx.startConversation(); }).setConversation((ctx, input) -> { commands.add(input); ctx.endConversation(); openOutpostRewardsCommandGUIEditor(); }).done(); gui.push(\"back\", this::openOutpostRewardsGUIEditor); gui.open(); return gui; }", "tokens": 337} {"id": 125074, "source": "method", "repo": "cryptomorin/kingdomsx", "text": "/** Sets the NBT tag of an item @param tag The new tag @param item The ItemStack @return The modified itemStack */ public static ItemStack setTag(ItemStack item, org.kingdoms.nbt.tag.NBTTagCompound tag) { Object nbtTag = BukkitAdapter.adapt(tag); Object nmsItem = Objects.requireNonNull(asNMSCopy(item), () -> \"NMS copy is null for \" + item); try { if (SUPPORTS_COMPONENTS) { Object customData = CUSTOM_DATA_CTOR.invoke(nbtTag); SET_TAG.invoke(nmsItem, CUSTOM_DATA_TYPE, customData); } else { SET_TAG.invoke(nmsItem, nbtTag); } } catch (Throwable throwable) { throwable.printStackTrace(); } return asBukkitCopy(nmsItem); }", "tokens": 169} {"id": 125078, "source": "method", "repo": "cryptomorin/kingdomsx", "text": "public TaskScheduler getGlobalTaskScheduler() { return taskScheduler; }", "tokens": 14} {"id": 125159, "source": "method", "repo": "cryptomorin/kingdomsx", "text": "public static void assertAwaitingInit() { assertLoader(); if (!isStrict()) return; // Called from static so it must be the second one. String className = new Throwable().getStackTrace()[1].getClassName(); Class service; ServiceState state; try { service = Class.forName(className, false, LOADER); state = SERVICES.get(service); } catch (ClassNotFoundException e) { throw new IllegalStateException(e); } if (state != ServiceState.AWAITING_INIT) { throw new IllegalStateException(\"Invalid state for service \" + service + \" is in state: \" + (state == null ? ServiceState.GUARDED : state).name()); } }", "tokens": 151} {"id": 125386, "source": "method", "repo": "cryptomorin/kingdomsx", "text": "public void add(Runnable runnable) { ensureOpen(); Objects.requireNonNull(runnable, \"Cannot add null task\"); tasks.add(runnable); }", "tokens": 31} {"id": 125540, "source": "method", "repo": "cryptomorin/xseries", "text": "/** @deprecated Use {@link #isSimilar(Block, XMaterial)} instead. */ public static boolean isBeetroot(@Nullable Material material) { if (!IS_FLAT) { // Avoid false positive in 1.8, where BEETROOT_BLOCK doesn't exist. return material != null && material == LegacyBlockMaterial.BEETROOT_BLOCK.material; } return material == Material.BEETROOTS; }", "tokens": 92} {"id": 125594, "source": "method", "repo": "cryptomorin/xseries", "text": "private static void recursiveMetaHandle(T serialObject, Class metaClass, ItemMeta meta, Map, Optional>>> map, List>> collectedHandlers) { Optional>> handler = map.get(metaClass); if (handler != null) { if (handler.isPresent()) { if (collectedHandlers != null) collectedHandlers.add(handler.get()); handler.get().apply(serialObject).handle(meta); } return; } // This rarely happens for the interface classes themselves For example: // ColorableArmorMeta extends ArmorMeta, LeatherArmorMeta // But practically, this will always happen for every metadata, since this // will be the Craft class that implements the metadata. List>> subCollectedHandlers = new ArrayList<>(); Class superclass = metaClass.getSuperclass(); if (superclass != null) recursiveMetaHandle(serialObject, superclass, meta, map, subCollectedHandlers); for (Class anInterface : metaClass.getInterfaces()) { recursiveMetaHandle(serialObject, anInterface, meta, map, subCollectedHandlers); } if (subCollectedHandlers.isEmpty()) { map.put((Class) metaClass, Optional.empty()); } else { map.put((Class) metaClass, Optional.of(inst -> subMeta -> { // Cool syntax! T castedInst = cast(inst); for (Function> subCollectedHandler : subCollectedHandlers) { subCollectedHandler.apply(castedInst).handle(subMeta); } })); if (collectedHandlers != null) collectedHandlers.addAll(subCollectedHandlers); } }", "tokens": 407} {"id": 125753, "source": "method", "repo": "cryptomorin/xseries", "text": "public static XWorldBorder create() { if (SUPPORTS_NATIVE_WORLDBORDERS) return new BukkitWorldBorder(Bukkit.createWorldBorder()); else return new NMSWorldBorder(); }", "tokens": 36} {"id": 126098, "source": "method", "repo": "cryptomorin/xseries", "text": "/** Action performed on all the handles before being checked. */ public AggregateReflectiveSupplier modify(@Nullable Consumer handleModifier) { this.handleModifier = handleModifier; return this; }", "tokens": 46} {"id": 126106, "source": "method", "repo": "cryptomorin/xseries", "text": "protected static void verify( final ClassReader classReader, final ClassLoader loader, final boolean printResults, final PrintWriter printWriter) { ClassNode classNode = new ClassNode(); classReader.accept( new CheckClassAdapter(ASMVersion.LATEST_ASM_OPCODE_VERSION, classNode, false) {}, ClassReader.SKIP_DEBUG); Type syperType = classNode.superName == null ? null : Type.getObjectType(classNode.superName); List methods = classNode.methods; List interfaces = new ArrayList<>(); for (String interfaceName : classNode.interfaces) { interfaces.add(Type.getObjectType(interfaceName)); } for (MethodNode method : methods) { SimpleVerifier verifier = new SimpleVerifier( Type.getObjectType(classNode.name), syperType, interfaces, (classNode.access & Opcodes.ACC_INTERFACE) != 0); Analyzer analyzer = new Analyzer<>(verifier); if (loader != null) { verifier.setClassLoader(loader); } boolean hasError; try { analyzer.analyze(classNode.name, method); hasError = false; } catch (AnalyzerException e) { ClassNotFoundException cls = (ClassNotFoundException) findCause(e, cause -> cause instanceof ClassNotFoundException); if (cls == null || cls.getMessage() == null || !cls.getMessage().contains(\"XSeriesGen\")) { hasError = true; e.printStackTrace(printWriter); } else { hasError = false; } } if (printResults || hasError) { try { CheckClassAdapter_printAnalyzerResult.invokeExact(method, analyzer, printWriter); } catch (Throwable e) { throw new IllegalStateException(\"Cannot write bytecode instructions: \", e); } } } printWriter.flush(); }", "tokens": 362} {"id": 126342, "source": "method", "repo": "cryptomorin/xseries", "text": "private static Map> getLocks(KeyedLockMap lockMap) { try { return (Map>) KeyedLockMap_locks.invoke(lockMap); } catch (Throwable e) { throw new RuntimeException(e); } }", "tokens": 75} {"id": 126517, "source": "method", "repo": "Crystaelix/Create-Simurail", "text": "public int applyStep(StepContext context) { return stepFunction.applyAsInt(context); }", "tokens": 20} {"id": 126550, "source": "method", "repo": "Crystaelix/Create-Simurail", "text": "public Basis3d set(Vector3dc direction, Vector3dc vertical, Vector3dc lateral) { this.direction.set(direction); this.vertical.set(vertical); this.lateral.set(lateral); return this; }", "tokens": 53} {"id": 126620, "source": "method", "repo": "Crystaelix/Create-Simurail", "text": "public Vector3f lerp() { return lerp(1); }", "tokens": 16} {"id": 126634, "source": "method", "repo": "Crystaelix/Create-Simurail", "text": "public Vector3d v2() { return v2; }", "tokens": 14} {"id": 126742, "source": "method", "repo": "Crystaelix/Create-Simurail", "text": "public TrackSwitchPeripheral(TrackSwitchBlockEntity blockEntity) { super(blockEntity); }", "tokens": 17} {"id": 126973, "source": "method", "repo": "Crystaelix/Create-Simurail", "text": "public double getMovementSpeed() { return (axleFront.speed + axleBack.speed) * 0.5; }", "tokens": 28} {"id": 127359, "source": "method", "repo": "Crystaelix/Create-Simurail", "text": "private static Selection vaultSelection(SelectionUtil select) { return select.fromTo(5, 3, 6, 5, 5, 8); }", "tokens": 37} {"id": 127414, "source": "method", "repo": "cucumber/cucumber-eclipse", "text": "public void setWhiskers(String whiskers) { this.whiskers = whiskers; }", "tokens": 29} {"id": 127528, "source": "method", "repo": "cucumber/cucumber-eclipse", "text": "public String getDisplayString() { return getTemplate().getPattern(); }", "tokens": 14} {"id": 127545, "source": "method", "repo": "cucumber/cucumber-eclipse", "text": "protected void createContent(Composite parent) { Browser browser = new Browser(parent, SWT.NONE); browser.setBackground(parent.getBackground()); browser.setForeground(parent.getForeground()); browser.setText(html, true); }", "tokens": 48} {"id": 127596, "source": "method", "repo": "cucumber/cucumber-eclipse", "text": "public void terminate() throws DebugException { thread.terminate(); }", "tokens": 14} {"id": 127639, "source": "method", "repo": "cucumber/cucumber-eclipse", "text": "public IBreakpoint[] getBreakpoints() { return context().map(SuspendContext::getBreakPoints).orElseGet(() -> new IBreakpoint[0]); }", "tokens": 34} {"id": 127653, "source": "method", "repo": "cucumber/cucumber-eclipse", "text": "public String getReferenceTypeName() throws DebugException { return typeName; }", "tokens": 15} {"id": 127675, "source": "method", "repo": "cucumber/cucumber-eclipse", "text": "public void stateChangeFailed(IFileBuffer buffer) { }", "tokens": 14} {"id": 127730, "source": "method", "repo": "cucumber/cucumber-eclipse", "text": "/** Returns a stream of feature children for the given feature. @param feature the feature to get children from @return a stream of feature children */ public static Stream featureChilds(Feature feature) { return feature.getChildren().stream(); }", "tokens": 53} {"id": 127756, "source": "method", "repo": "cucumber/cucumber-eclipse", "text": "public String getHyperlinkText() { return \"Open step definition\"; }", "tokens": 15} {"id": 127803, "source": "method", "repo": "cucumber/cucumber-eclipse", "text": "/** Enables or disables project-specific settings.

When enabled, project properties override workspace preferences. This method automatically calls {@link #flush()} to persist the change.

@param enabled true to enable project-specific settings, false to use workspace defaults */ public void setEnabled(boolean enabled) { if (node == null) { return; } node.putBoolean(KEY_ENABLE_PROJECT_SPECIFIC_SETTINGS, enabled); flush(); }", "tokens": 96} {"id": 127841, "source": "method", "repo": "cucumber/cucumber-eclipse", "text": "public void reset() { stepDefinitionsByResourceName.clear(); }", "tokens": 15} {"id": 127981, "source": "method", "repo": "cucumber/cucumber-eclipse", "text": "private List computeCodeMinings(IDocument document, IJavaProject javaProject, Collection> steps) { List list = new ArrayList<>(); Map> stepByLine = steps.stream().filter(MatchedHookStep.class::isInstance) .map(MatchedHookStep.class::cast).collect(Collectors.groupingBy(step -> step.getLocation().getLine())); for (Entry> entry : stepByLine.entrySet()) { int lineNumber = entry.getKey() - 1; Map> hooksByType = entry.getValue().stream() .collect(Collectors.groupingBy(hookStep -> hookStep.getTestStep().getHookType())); hooksByType.entrySet().stream().sorted((e1, e2) -> e1.getKey().ordinal() - e2.getKey().ordinal()).map(e -> { try { return new HooksCodeMining(lineNumber, document, JavaReferencesCodeMiningProvider.this, e.getKey(), e.getValue(), javaProject); } catch (BadLocationException ble) { return null; } }).filter(Objects::nonNull).forEach(list::add); } return list; }", "tokens": 271} {"id": 128177, "source": "method", "repo": "cucumber/cucumber-eclipse", "text": "public JavaStepDefinitionOpener(@Reference JavaGlueStore glueValidatorService, @Reference JavaGlueModelCache modelCache) { this.glueStore = glueValidatorService; this.modelCache = modelCache; }", "tokens": 43} {"id": 128240, "source": "method", "repo": "cucumber/cucumber-eclipse", "text": "/** Enables dry-run mode */ public BehaveProcessLauncher withDryRun(boolean dryRun) { if (dryRun) { this.additionalArgs.add(\"--dry-run\"); } return this; }", "tokens": 45} {"id": 128602, "source": "method", "repo": "cucumber/cucumber-expressions", "text": "void can_parse_leading_plus_sign() { assertEquals(new BigDecimal(\"1.5\"), fallback.parseBigDecimal(\"+1.5\")); assertEquals(1042.2f, fallback.parseFloat(\"+1042.2\"), 0); // A leading plus sign combined with an exponent assertEquals(new BigDecimal(\"1.5E+3\"), fallback.parseBigDecimal(\"+1.5E+3\")); assertEquals(1500.0, fallback.parseDouble(\"+1.5E+3\"), 0); }", "tokens": 112} {"id": 128835, "source": "method", "repo": "cucumber/cucumber-jvm", "text": "private static Collector>> groupByUriAndThenCollectLines() { return groupingBy( UriAndLine::getUri, // Sort URIs TreeMap::new, mapping( UriAndLine::getLine, // Sort lines toCollection(TreeSet::new))); }", "tokens": 67} {"id": 128977, "source": "method", "repo": "cucumber/cucumber-jvm", "text": "void or_tag_predicate_does_not_match_pickle_none_of_the_tags() { Pickle pickle = createPickleWithTags(); TagPredicate predicate = createPredicate(\"@FOO or @BAR\"); assertFalse(predicate.test(pickle)); }", "tokens": 58} {"id": 129234, "source": "method", "repo": "cucumber/cucumber-jvm", "text": "public Object invalid_first_type(Map fromValue, Type toValueType) { return null; }", "tokens": 27} {"id": 129324, "source": "method", "repo": "cucumber/cucumber-jvm", "text": "private void methodWithAnArgument(Integer cuckes) { assertEquals(42, cuckes.intValue()); }", "tokens": 26} {"id": 129595, "source": "method", "repo": "cucumber/cucumber-jvm", "text": "void convert_to_list_of_map() { DataTable table = parse(\"\", \"| firstName | lastName | birthDate |\", \"| Annie M. G. | Schmidt | 1911-03-20 |\", \"| Roald | Dahl | 1916-09-13 |\", \"| Astrid | Lindgren | 1907-11-14 |\"); List> expected = asList( Map.of( \"firstName\", \"Annie M. G.\", \"lastName\", \"Schmidt\", \"birthDate\", \"1911-03-20\"), Map.of( \"firstName\", \"Roald\", \"lastName\", \"Dahl\", \"birthDate\", \"1916-09-13\"), Map.of( \"firstName\", \"Astrid\", \"lastName\", \"Lindgren\", \"birthDate\", \"1907-11-14\")); assertEquals(expected, converter.convert(table, LIST_OF_MAP)); }", "tokens": 254} {"id": 129640, "source": "method", "repo": "cucumber/cucumber-jvm", "text": "void should_print_docstring_without_content_type() { DocString docString = DocString.create(\"\"\" { \"key1\": \"value1\", \"key2\": \"value2\", \"another1\": \"another2\" } \"\"\"); DocStringFormatter formatter = DocStringFormatter.builder().build(); String format = formatter.format(docString); assertThat(format).isEqualTo( \"\"\" \"\"\\\" { \"key1\": \"value1\", \"key2\": \"value2\", \"another1\": \"another2\" } \"\"\\\" \"\"\"); }", "tokens": 116} {"id": 129674, "source": "method", "repo": "cwtsleiden/networkanalysis", "text": "/** Merges the clusters based on a clustering of the clusters. @param clustering Clustering of the clusters */ public void mergeClusters(Clustering clustering) { int i; for (i = 0; i < nNodes; i++) clusters[i] = clustering.clusters[clusters[i]]; nClusters = clustering.nClusters; }", "tokens": 74} {"id": 129809, "source": "method", "repo": "cwtsleiden/networkanalysis", "text": "/** Returns the edge weight increment parameter. @return Edge weight increment parameter */ public double getEdgeWeightIncrement() { return edgeWeightIncrement; }", "tokens": 30} {"id": 129948, "source": "method", "repo": "cwtsleiden/networkanalysis", "text": "/** Calculates the sum of all elements. @return Sum */ public long calcSum() { return calcSum(0, size); }", "tokens": 29} {"id": 129973, "source": "method", "repo": "cwtsleiden/networkanalysis", "text": "void resize() { long s = a.size(); a.resize(a.size() - 1); assertEquals(a.size(), s - 1); }", "tokens": 38} {"id": 130001, "source": "method", "repo": "cwtsleiden/networkanalysis", "text": "void updateFrom() { Random r = new Random(0); LargeDoubleArray a2 = new LargeDoubleArray(a.size() / 2); for (long i = 0; i < a2.size(); i++) a2.set(i, r.nextDouble()); long insertionPoint = a.size() / 4; a.updateFrom(a2, 0, a2.size(), insertionPoint); for (long i = 0; i < a2.size(); i++) assertEquals(a.get(insertionPoint + i), a2.get(i)); }", "tokens": 128} {"id": 130010, "source": "method", "repo": "cwtsleiden/networkanalysis", "text": "void quickSort() { Random r = new Random(0); for (long k = 0; k < a.size(); k++) a.set(k, r.nextInt()); // Make sure there is one identical element a.set(0, a.get(1)); a.quickSort(); for (long i = 1; i < a.size(); i++) assertTrue(a.get(i) >= a.get(i - 1)); }", "tokens": 100} {"id": 130030, "source": "method", "repo": "cyberbuddy-io/open-source-contribution-for-beginners", "text": "public static void main(String args[]) throws IOException { // Printing Neon Numbers upto 10000 for (int i = 1; i <= 10000; i++) if (checkNeon(i)) System.out.print(i + \" \"); }", "tokens": 68} {"id": 130041, "source": "method", "repo": "cyberbuddy-io/open-source-contribution-for-beginners", "text": "protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = ActivityMainBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); // onClick Listeners binding.btnNext.setOnClickListener(view -> { loadMeme(); }); binding.btnShare.setOnClickListener(view -> { Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra(Intent.EXTRA_TEXT,\"Hey, Checkout this Meme from Reddit\"+url); }); }", "tokens": 107} {"id": 130079, "source": "method", "repo": "cyberbuddy-io/open-source-contribution-for-beginners", "text": "public void setCourseImage(int courseImage) { this.courseImage = courseImage; }", "tokens": 21} {"id": 130141, "source": "method", "repo": "cyberbuddy-io/open-source-contribution-for-beginners", "text": "public int legs(int n){ return n; }", "tokens": 13} {"id": 130262, "source": "method", "repo": "cyberbuddy-io/open-source-contribution-for-beginners", "text": "public static void main(String[] args) { MySampleClass s=new MySampleClass(); s.meth1(); s.meth2(); s.meth3(); s.meth4(); }", "tokens": 47} {"id": 130431, "source": "method", "repo": "cyborgscode/personal-voice-assistent", "text": "private int packFooter(byte[] bytes, int offset) { try { BufferTools.stringIntoByteBuffer(FOOTER_TAG, 0, FOOTER_TAG.length(), bytes, offset); } catch (UnsupportedEncodingException e) { } String s[] = version.split(\"\\\\.\"); if (s.length > 0) { byte majorVersion = Byte.parseByte(s[0]); bytes[offset + MAJOR_VERSION_OFFSET] = majorVersion; } if (s.length > 1) { byte minorVersion = Byte.parseByte(s[1]); bytes[offset + MINOR_VERSION_OFFSET] = minorVersion; } packFlags(bytes, offset); BufferTools.packSynchsafeInteger(getDataLength(), bytes, offset + DATA_LENGTH_OFFSET); return offset + FOOTER_LENGTH; }", "tokens": 174} {"id": 130446, "source": "method", "repo": "cyborgscode/personal-voice-assistent", "text": "public void setTrack(String track) { if (track != null && track.length() > 0) { invalidateDataLength(); ID3v2TextFrameData frameData = new ID3v2TextFrameData(useFrameUnsynchronisation(), new EncodedText(track)); addFrame(createFrame(ID_TRACK, frameData.toBytes()), true); } }", "tokens": 71} {"id": 130560, "source": "method", "repo": "cyborgscode/personal-voice-assistent", "text": "public static int indexOfTerminatorForEncoding(byte[] bytes, int fromIndex, int encoding) { int terminatorLength = (encoding == EncodedText.TEXT_ENCODING_UTF_16 || encoding == EncodedText.TEXT_ENCODING_UTF_16BE) ? 2 : 1; return indexOfTerminator(bytes, fromIndex, terminatorLength); }", "tokens": 73} {"id": 130670, "source": "method", "repo": "cyborgscode/personal-voice-assistent", "text": "protected ID3v2Frame createFrame(String id, byte[] data) { return new ID3v24Frame(id, data); }", "tokens": 32} {"id": 130795, "source": "method", "repo": "cyborgscode/personal-voice-assistent", "text": "protected int getLength() { int length = 1; if (description != null) length += description.toBytes(true, true).length; else length++; if (url != null) length += url.length(); return length; }", "tokens": 51} {"id": 131025, "source": "method", "repo": "cyborgscode/personal-voice-assistent", "text": "/** Parent ClassLoader passed to this constructor will be used if this ClassLoader can not resolve a particular class. @param parent Parent ClassLoader (may be from getClass().getClassLoader()) */ public NewClassLoader(ClassLoader parent) { super(parent); }", "tokens": 50} {"id": 131030, "source": "method", "repo": "cyborgscode/personal-voice-assistent", "text": "protected void say(String text,String returnIntent,String extra) { String sender = getPluginInfo().get(\"name\"); if ( sender.isEmpty() ) sender=\"UNKOWN\"; log(sender+\":say():\"+ returnIntent+\":\"+extra); pva.AsyncSendIntent(new Command( sender , \"ASYNCSPEAK\", returnIntent, extra), text ); }", "tokens": 82} {"id": 131041, "source": "method", "repo": "cyborgscode/personal-voice-assistent", "text": "public void init(PVA pva) { this.pva = pva; info.put(\"hasThread\", \"yes\"); info.put(\"hasCodes\", \"yes\"); info.put(\"name\", \"AIStreamer\"); vars.put(\"status\", \"idle\"); aimsgs.addMessage(new AIMessage(\"system\", pva.config.get(\"ai\",\"model\"), pva.config.get(\"ai\",\"systemprompt\") )); }", "tokens": 95} {"id": 131359, "source": "method", "repo": "cyclopsmc/integrateddynamics", "text": "protected ICable getCable() { return cable; }", "tokens": 13} {"id": 131464, "source": "method", "repo": "cyclopsmc/integrateddynamics", "text": "public MutableComponent getLocalizedNameFull() { return Component.translatable(L10NValues.OPERATOR_APPLIED_OPERATORNAME, baseOperator.getLocalizedNameFull(), getAppliedSymbol()); }", "tokens": 40} {"id": 131597, "source": "method", "repo": "cyclopsmc/integrateddynamics", "text": "/** Called for the actual wrenching action. @param player The player. @param pos The position that is being wrenched. @param parameter An extra parameter that is used to call this action. */ public void onWrench(Player player, BlockPos pos, Void parameter) { onWrench(player, pos); }", "tokens": 67} {"id": 131729, "source": "method", "repo": "cyclopsmc/integrateddynamics", "text": "public S getPartState(@Nullable BlockState blockState, @Nullable BlockEntity blockEntity) throws PartStateException { IPartContainer partContainer = getPartContainer(blockState, blockEntity); if(partContainer != null) { return (S) partContainer.getPartState(this.center.getSide()); } else { throw new PartStateException(this.center.getPos(), this.center.getSide()); } }", "tokens": 82} {"id": 131771, "source": "method", "repo": "cyclopsmc/integrateddynamics", "text": "public void invalidateDerivedProperties() { this.derivedProperties = null; this.derivedPropertiesBase = null; }", "tokens": 24} {"id": 131821, "source": "method", "repo": "cyclopsmc/integrateddynamics", "text": "public RecipeBookCategoryMechanicalDryingBasinConfig() { super( IntegratedDynamics._instance, \"mechanical_drying_basin\", createDefault() ); }", "tokens": 42} {"id": 132112, "source": "method", "repo": "cyclopsmc/integrateddynamics", "text": "public void testListCountPredicateInfinite() throws EvaluationException { Assertions.assertThrows(EvaluationException.class, () -> Operators.LIST_COUNT_PREDICATE.evaluate(new IVariable[]{lintegers_inf, i0})); }", "tokens": 49} {"id": 132119, "source": "method", "repo": "cyclopsmc/integrateddynamics", "text": "public void testInvalidInputSizeUniqSmall() throws EvaluationException { Assertions.assertThrows(EvaluationException.class, () -> Operators.LIST_UNIQ.evaluate(new IVariable[]{})); }", "tokens": 42} {"id": 132286, "source": "method", "repo": "dan2097/opsin", "text": "void setAtomRefs4(Atom[] atomRefs4) { this.atomRefs4 = atomRefs4; }", "tokens": 24} {"id": 132461, "source": "method", "repo": "dan2097/opsin", "text": "public int compare(Atom a, Atom b){ int bondOrderA = a.getProperty(Atom.VISITED); int bondOrderB = b.getProperty(Atom.VISITED); if (bondOrderA > bondOrderB) {//lower order bond is preferred return 1; } if (bondOrderA < bondOrderB) { return -1; } if (a.getOutValency() > b.getOutValency()) {//prefer atoms with outValency return -1; } if (a.getOutValency() < b.getOutValency()) { return 1; } int expectedHydrogenA = StructureBuildingMethods.calculateSubstitutableHydrogenAtoms(a); int expectedHydrogenB = StructureBuildingMethods.calculateSubstitutableHydrogenAtoms(b); if (expectedHydrogenA > expectedHydrogenB) {//prefer atoms with more hydrogen return -1; } if (expectedHydrogenA < expectedHydrogenB) { return 1; } return 0; }", "tokens": 202} {"id": 132646, "source": "method", "repo": "dan2097/opsin", "text": "RunAutomaton[] getSymbolRegexAutomataDict() { return symbolRegexAutomataDict; }", "tokens": 24} {"id": 132663, "source": "method", "repo": "dan2097/opsin", "text": "/** Process ring openings and closings e.g. the two 1s in c1ccccc1 @param ch @throws StructureBuildingException */ private void processRingOpeningOrClosure(char ch) throws StructureBuildingException { String closure = String.valueOf(ch); if(ch == '%') { if (i + 2 < endOfSmiles && is_0_to_9(smiles.charAt(i + 1)) && is_0_to_9(smiles.charAt(i + 2))) { closure = smiles.substring(i + 1, i + 3); i +=2; } else{ throw new StructureBuildingException(\"A ring opening indice after a % must be two digits long\"); } } if(ringClosures.containsKey(closure)) { processRingClosure(closure); } else { if (getInscopeAtom() == null){ throw new StructureBuildingException(\"A ring opening has appeared before any atom!\"); } processRingOpening(closure); } }", "tokens": 210} {"id": 132687, "source": "method", "repo": "dan2097/opsin", "text": "private static void expand(Atom atom, Atom parentAtom, Set usedAtoms, Map atomToParentMap, Set linkBondSet){ usedAtoms.add(atom); atomToParentMap.put(atom, parentAtom); List ligandAtomList = atom.getAtomNeighbours(); for (Atom ligandAtom : ligandAtomList) { if (ligandAtom.equals(parentAtom)) { // skip existing bond } else if (usedAtoms.contains(ligandAtom)) { Bond linkBond = atom.getBondToAtom(ligandAtom); linkBondSet.add(linkBond); // already treated } else { expand(ligandAtom, atom, usedAtoms, atomToParentMap, linkBondSet); } } }", "tokens": 171} {"id": 132786, "source": "method", "repo": "dan2097/opsin", "text": "Element copy() { TokenEl copy = new TokenEl(this.name, this.value); for (int i = 0, len = this.attributes.size(); i < len; i++) { Attribute atr = this.attributes.get(i); copy.addAttribute(new Attribute(atr)); } return copy; }", "tokens": 71} {"id": 132788, "source": "method", "repo": "dan2097/opsin", "text": "List getChildElements(String name) { return Collections.emptyList(); }", "tokens": 19} {"id": 132845, "source": "method", "repo": "dan2097/opsin", "text": "public void cas9() throws ParsingException{ String name = CASTools.uninvertCASName(\"Phosphoric acid, ethyl dimethyl ester\", parseRules); assertEquals(\"ethyl dimethyl Phosphorate\", name); }", "tokens": 54} {"id": 132846, "source": "method", "repo": "dan2097/opsin", "text": "public void cas10() throws ParsingException{ String name = CASTools.uninvertCASName(\"2-Propanone, oxime\", parseRules); assertEquals(\"2-Propanone oxime\", name); }", "tokens": 50} {"id": 132927, "source": "method", "repo": "dan2097/opsin", "text": "public void testLabelCarboximidohydrazide() throws StructureBuildingException { frag = fm.buildSMILES(\"c1ccccc1\"); Fragment suffix = fm.buildSMILES(\"[R]C(=N)NN\", SUFFIX_TYPE_VAL, \"/X//1'/2'\"); List suffixes = new ArrayList(); suffixes.add(suffix); FragmentTools.assignElementLocants(frag, suffixes); fm.incorporateFragment(suffix, frag); assertEquals(10, frag.getIDFromLocant(\"N\"), \"Can find locant N in frag: ID = 10\"); assertEquals(11, frag.getIDFromLocant(\"N'\"), \"Can find locant N' in frag: ID = 11\"); assertEquals(9, frag.getIDFromLocant(\"N''\"), \"Can find locant N'' in frag: ID = 9\"); }", "tokens": 189} {"id": 132928, "source": "method", "repo": "dan2097/opsin", "text": "public void testIndicatedHydrogen() throws StructureBuildingException { Fragment pyrrole = fm.buildSMILES(\"[nH]1cccc1\"); assertEquals(1, pyrrole.getIndicatedHydrogen().size(), \"Pyrrole has 1 indicated hydrogen\"); assertEquals(pyrrole.getFirstAtom(), pyrrole.getIndicatedHydrogen().get(0), \"..and the indicated hydrogen is on the nitrogen\"); }", "tokens": 102} {"id": 133005, "source": "method", "repo": "dan2097/opsin", "text": "public void doublePositiveCharge1() throws StructureBuildingException { Fragment fragment = sBuilder.build(\"[C++]\"); List atomList = fragment.getAtomList(); assertEquals(1, atomList.size()); assertEquals(2, atomList.get(0).getCharge()); }", "tokens": 59} {"id": 133081, "source": "method", "repo": "dan2097/opsin", "text": "public void remoteRacSpecification() throws StructureBuildingException { assertEnhancedStereo(\"rac-tert-butyl 7-[8-(tert-butoxycarbonylamino)-7-fluoro-3-[[(1S,2S,3R)-3-hydroxy-2,3-dimethyl-cyclobutoxy]carbonylamino]-6-isoquinolyl]-8-methyl-2,3-dihydropyrido[2,3-b][1,4]oxazine-1-carboxylate\", 3, 0, 0); assertEnhancedStereo(\"(+-)-tert-butyl 7-[8-(tert-butoxycarbonylamino)-7-fluoro-3-[[(1S,2S,3R)-3-hydroxy-2,3-dimethyl-cyclobutoxy]carbonylamino]-6-isoquinolyl]-8-methyl-2,3-dihydropyrido[2,3-b][1,4]oxazine-1-carboxylate\", 3, 0, 0); }", "tokens": 275} {"id": 133157, "source": "method", "repo": "daniel-frak/keycloak-user-migration", "text": "public static UserMigrationDetails from(User user) { return UserMigrationDetails.builder() .username(user.getUsername()) .email(user.getEmail()) .firstName(user.getFirstName()) .lastName(user.getLastName()) .enabled(true) .emailVerified(true) .attributes(Map.of(\"attribute 1\", List.of(\"value1\", \"value 2\"))) .roles(List.of(\"role 1\", \"role 2\")) .groups(List.of(\"group 1\", \"group2\")) .requiredActions(List.of(\"UPDATE_PROFILE\")) .build(); }", "tokens": 141} {"id": 133281, "source": "method", "repo": "daniel-frak/keycloak-user-migration", "text": "private Optional getMappedRoleName(String roleName) { if (newRolesByLegacyRole.containsKey(roleName)) { return Optional.ofNullable(newRolesByLegacyRole.get(roleName)); } else if (shouldNotMigrateUnmappedRoles()) { return Optional.empty(); } return Optional.ofNullable(roleName); }", "tokens": 67} {"id": 133388, "source": "method", "repo": "daniel-frak/keycloak-user-migration", "text": "public boolean isConfiguredFor(String type) { throw new RuntimeException(\"Not implemented\"); }", "tokens": 20} {"id": 133448, "source": "method", "repo": "daniel-frak/keycloak-user-migration", "text": "void setUp() { config = new MultivaluedHashMap<>(); lenient().when(model.getConfig()) .thenReturn(config); lenient().when(model.getId()) .thenReturn(MODEL_ID); lenient().when(session.users()) .thenReturn(userProvider); lenient().when(session.getProvider(OrganizationProvider.class)) .thenReturn(organizationProvider); wildcardPatternFactory = new WildcardPatternFactory(); legacyMappingParser = new LegacyMappingParser(); }", "tokens": 99} {"id": 133668, "source": "method", "repo": "danielflower/multi-module-maven-release-plugin", "text": "private List alterModel(MavenProject project, String newVersion) { Model originalModel = project.getOriginalModel(); originalModel.setVersion(newVersion); List errors = new ArrayList(); String searchingFrom = project.getArtifactId(); MavenProject parent = project.getParent(); if (parent != null && MavenVersionResolver.isSnapshot(parent.getVersion())) { try { ReleasableModule parentBeingReleased = reactor.find(parent.getGroupId(), parent.getArtifactId(), parent.getVersion()); originalModel.getParent().setVersion(parentBeingReleased.getVersionToDependOn()); log.debug(\" Parent \" + parentBeingReleased.getArtifactId() + \" rewritten to version \" + parentBeingReleased.getVersionToDependOn()); } catch (UnresolvedSnapshotDependencyException e) { errors.add(\"The parent of \" + searchingFrom + \" is \" + e.artifactId + \" \" + e.version); } } Properties projectProperties = project.getProperties(); for (Dependency dependency : originalModel.getDependencies()) { alterSingleDependency(errors, searchingFrom, projectProperties, dependency); } //Support for dependency management if (originalModel.getDependencyManagement() != null) { for (Dependency dependency : originalModel.getDependencyManagement().getDependencies()) { alterSingleDependency(errors, searchingFrom, projectProperties, dependency); } } //Support for plugin if (originalModel.getBuild() != null && originalModel.getBuild().getPlugins() != null) { for (Plugin plugin : originalModel.getBuild().getPlugins()) { alterSinglePlugin(errors, searchingFrom, projectProperties, plugin); } } //Support for pluginManagement if (originalModel.getBuild() != null && originalModel.getBuild().getPluginManagement() != null && originalModel.getBuild().getPluginManagement().getPlugins() != null) { for (Plugin plugin : originalModel.getBuild().getPluginManagement().getPlugins()) { alterSinglePlugin(errors, searchingFrom, projectProperties, plugin); } } for (Plugin plugin : project.getModel().getBuild().getPlugins()) { String version = plugin.getVersion(); if (MavenVersionResolver.isSnapshot(MavenVersionResolver.resolveVersion(version, projectProperties))) { if (!isMultiModuleReleasePlugin(plugin) && !isReleasablePlugin(plugin)) { errors.add(searchingFrom + \" references plugin \" + plugin.getArtifactId() + \" \" + version); } } } return errors; }", "tokens": 494} {"id": 133749, "source": "method", "repo": "danielflower/multi-module-maven-release-plugin", "text": "public VersionName(String developmentVersion, String version, long buildNumber) { this(developmentVersion, version, buildNumber, \".\"); }", "tokens": 31} {"id": 133761, "source": "method", "repo": "danielflower/multi-module-maven-release-plugin", "text": "public void findsTheLatestCommitWhereThereHaveBeenNoBranches() throws Exception { TestProject project = TestProject.independentVersionsProject(); saveFileInModuleAndTag(project, \"console-app\", \"1.2\", 3); AnnotatedTag tag1 = saveFileInModuleAndTag(project, \"core-utils\", \"2\", 0); AnnotatedTag tag2 = saveFileInModuleAndTag(project, \"console-app\", \"1.2\", 4); assertThat(annotatedTagFinder.tagsForVersion(project.local, \"my-group\", \"console-app\", \"1.3\", null, null), hasSize(0)); assertThat(annotatedTagFinder.tagsForVersion(project.local, \"my-group\", \"console-app\", \"1.2\", null, null), contains(tag2)); assertThat(annotatedTagFinder.tagsForVersion(project.local, \"my-group\", \"core-utils\", \"2\", null, null), contains(tag1)); }", "tokens": 215} {"id": 133822, "source": "method", "repo": "danielflower/multi-module-maven-release-plugin", "text": "public void skipTests() throws Exception { releaseInvoker.setSkipTests(true); releaseInvoker.runMavenBuild(reactor); verify(request).setGoals(Mockito.argThat(goals -> goals.size() == 2 && goals.contains(DEPLOY) && goals.contains(SKIP_TESTS))); }", "tokens": 71} {"id": 133830, "source": "method", "repo": "danielflower/multi-module-maven-release-plugin", "text": "public void throwsIfTheVersionWouldNotBeAValidGitTag() { assertThat(errorMessageOf(\"1.0-A : yeah /-SNAPSHOT\", 0), hasItems( \"Sorry, '1.0-A : yeah /.0' is not a valid version.\", \"Please see https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html for tag naming rules.\" ) ); }", "tokens": 103} {"id": 134225, "source": "method", "repo": "dantsu/escpos-thermalprinter-android", "text": "public String getAttribute(String key) { return this.attributes.get(key); }", "tokens": 20} {"id": 134462, "source": "method", "repo": "datadog/java-dogstatsd-client", "text": "synchronized void onEnqueue(int len) { current.enqueuedPayloads++; current.enqueuedBytes += len; }", "tokens": 26} {"id": 134655, "source": "method", "repo": "datadog/java-dogstatsd-client", "text": "public void recordDistributionValue( String aspect, long value, double sampleRate, String... tags) {}", "tokens": 23} {"id": 134731, "source": "method", "repo": "datadog/java-dogstatsd-client", "text": "/** {@inheritDoc} */ public void time( final String aspect, final long value, final double sampleRate, final TagsCardinality cardinality, final String... tags) { recordExecutionTime(aspect, value, sampleRate, cardinality, tags); }", "tokens": 51} {"id": 134852, "source": "method", "repo": "datadog/java-dogstatsd-client", "text": "public void run() { telemetry.flush(); }", "tokens": 11} {"id": 135053, "source": "method", "repo": "datadog/java-dogstatsd-client", "text": "NonsamplingClient(NonBlockingStatsDClientBuilder builder) { super(builder); }", "tokens": 16} {"id": 135133, "source": "method", "repo": "datatheorem/trustkit-android", "text": "public void testHttpsUrlConnectionWithTrustKitApiLevelUnder17() throws IOException { if (Build.VERSION.SDK_INT >= 17) { // This test is only useful for API level < 17 return; } // Initialize TrustKit TestableTrustKit.initializeWithNetworkSecurityConfiguration( InstrumentationRegistry.getInstrumentation().getContext(), reporter); // Test a connection // Although the pins are invalid, the connection should succeed because TrustKit's pinning // functionality is not enabled on API level < 17 HttpsURLConnection connection = null; try { connection = (HttpsURLConnection) testUrl.openConnection(); connection.setSSLSocketFactory( TestableTrustKit.getInstance().getSSLSocketFactory(testUrl.getHost())); InputStream inputStream = connection.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader(inputStream); int data = inputStreamReader.read(); while (data != -1) { data = inputStreamReader.read(); } } finally { if (connection != null) { connection.disconnect(); } } }", "tokens": 205} {"id": 135433, "source": "method", "repo": "dbos-inc/dbos-transact-java", "text": "static CompletableFuture handleGetWorkflow( Conductor conductor, GetWorkflowRequest request) { return CompletableFuture.supplyAsync( () -> { try { var status = conductor.systemDatabase.listWorkflows(request.toInput()); WorkflowsOutput output = status == null || status.size() < 1 ? null : new WorkflowsOutput(status.get(0)); return new GetWorkflowResponse(request, output); } catch (Exception e) { logger.error(\"Exception encountered when getting workflow {}\", request.workflow_id, e); return new GetWorkflowResponse(request, e); } }); }", "tokens": 131} {"id": 135560, "source": "method", "repo": "dbos-inc/dbos-transact-java", "text": "static List listWorkflowStreams(Connection conn, String schema, String workflowId) throws SQLException { var sql = \"\"\" SELECT key, value, \"offset\", function_id, serialization FROM \"%s\".streams WHERE workflow_uuid = ? \"\"\" .formatted(schema); var streams = new ArrayList(); try (var stmt = conn.prepareStatement(sql)) { stmt.setString(1, workflowId); try (var rs = stmt.executeQuery()) { while (rs.next()) { var key = rs.getString(\"key\"); var value = rs.getString(\"value\"); var offset = rs.getInt(\"offset\"); var stepId = rs.getInt(\"function_id\"); var serialization = rs.getString(\"serialization\"); streams.add(new WorkflowStream(key, value, offset, stepId, serialization)); } } } return streams; }", "tokens": 180} {"id": 135679, "source": "method", "repo": "dbos-inc/dbos-transact-java", "text": "/** Produces a new Queue with the assigned polling interval. @deprecated Configure a queue with {@link QueueOptions} at registration. */ public Queue withPollingInterval(@NonNull Duration pollingInterval) { return copyWith( name, concurrency, workerConcurrency, priorityEnabled, partitioningEnabled, rateLimit, pollingInterval); }", "tokens": 65} {"id": 135681, "source": "method", "repo": "dbos-inc/dbos-transact-java", "text": "/** Creates options that set only {@code partitionWorkerConcurrency}; all other fields are absent. Setting it is what partitions the queue. @param value the per-partition, per-worker concurrency limit, or {@code null} to clear @deprecated Use {@code new QueueOptions().withPartitionWorkerConcurrency(value)}. */ public static QueueOptions setPartitionWorkerConcurrency(@Nullable Integer value) { return new QueueOptions().withPartitionWorkerConcurrency(value); }", "tokens": 89} {"id": 135789, "source": "method", "repo": "dbos-inc/dbos-transact-java", "text": "public void cloudEnvEmptyAppNameThrows() throws Exception { new EnvironmentVariables(\"DBOS__CLOUD\", \"true\") .and(\"DBOS_APP_NAME\", \"\") .execute( () -> { var config = pgContainer.dbosConfig(\"local-app-name\"); try (var dbos = new DBOS(config)) { assertThrows(IllegalArgumentException.class, dbos::launch); } }); }", "tokens": 85} {"id": 135932, "source": "method", "repo": "dbos-inc/dbos-transact-java", "text": "public void testInteropNamedArgs() throws Exception { String testQueue = \"interopq\"; dbos.registerProxy(NamedArgsService.class, new NamedArgsServiceImpl()); dbos.launch(); dbos.registerQueue(testQueue, new QueueOptions()); try (DBOSClient client = new DBOSClient(dataSource)) { String workflowId = UUID.randomUUID().toString(); // Enqueue with namedArgs (this is what Python kwargs produce) Map namedArgs = new LinkedHashMap<>(); namedArgs.put(\"name\", \"test\"); namedArgs.put(\"count\", 42); namedArgs.put(\"tags\", Arrays.asList(\"a\", \"b\")); var options = new EnqueueOptions(\"namedArgsWorkflow\", \"interop\", QueueName.of(\"interopq\")) .withWorkflowId(workflowId) .withSerialization(SerializationStrategy.PORTABLE); client.enqueueWorkflow(options, new Object[] {}, namedArgs); // Java doesn't use named args but can pass them to Python. // For this test, let's verify the stored format matches what Python produces. // Verify the stored inputs JSON var wsRow = DBUtils.getWorkflowRow(dataSource, workflowId); assertNotNull(wsRow); assertEquals(\"portable_json\", wsRow.serialization()); @SuppressWarnings(\"unchecked\") Map storedInputs = mapper.readValue(wsRow.inputs(), Map.class); assertNotNull(storedInputs.get(\"positionalArgs\")); assertNotNull(storedInputs.get(\"namedArgs\")); @SuppressWarnings(\"unchecked\") List positionalArgs = (List) storedInputs.get(\"positionalArgs\"); assertEquals(0, positionalArgs.size()); @SuppressWarnings(\"unchecked\") Map storedNamedArgs = (Map) storedInputs.get(\"namedArgs\"); assertEquals(\"test\", storedNamedArgs.get(\"name\")); assertEquals(42, ((Number) storedNamedArgs.get(\"count\")).intValue()); assertEquals(Arrays.asList(\"a\", \"b\"), storedNamedArgs.get(\"tags\")); } }", "tokens": 436} {"id": 135948, "source": "method", "repo": "dbos-inc/dbos-transact-java", "text": "/** Tests that a custom serializer configured via DBOSConfig is used for all serialization. */ public void testCustomSerializer() throws Exception { dbos.shutdown(); // Reinitialize with custom serializer var customConfig = dbosConfig.withSerializer(new TestBase64Serializer()); try (var localDbos = new DBOS(customConfig)) { String testQueue = \"testq\"; localDbos.registerProxy(CustomSerService.class, new CustomSerServiceImpl(localDbos)); localDbos.launch(); localDbos.registerQueue(testQueue, new QueueOptions()); String workflowId = UUID.randomUUID().toString(); // Start the workflow via queue try (DBOSClient client = new DBOSClient(dataSource, null, new TestBase64Serializer())) { var options = new EnqueueOptions(\"customSerWorkflow\", \"CustomSerService\", QueueName.of(\"testq\")) .withWorkflowId(workflowId); WorkflowHandle handle = client.enqueueWorkflow(options, new Object[] {\"hello\"}); // Send a message client.send(workflowId, \"worldMsg\", \"testTopic\", null); // Wait for result String result = handle.getResult(); assertEquals(\"result:hello:worldMsg\", result); // Verify DB rows have custom serialization format var row = DBUtils.getWorkflowRow(dataSource, workflowId); assertNotNull(row); assertEquals(\"custom_base64\", row.serialization()); // Verify the event was stored with custom serialization var events = DBUtils.getWorkflowEvents(dataSource, workflowId); var testEvent = events.stream().filter(e -> e.key().equals(\"testKey\")).findFirst(); assertTrue(testEvent.isPresent()); assertEquals(\"custom_base64\", testEvent.get().serialization()); // Verify getEvent works through custom serializer Object eventVal = client.getEvent(workflowId, \"testKey\", Duration.ofSeconds(5)).orElseThrow(); assertEquals(\"eventValue-hello\", eventVal); } } }", "tokens": 399} {"id": 135972, "source": "method", "repo": "dbos-inc/dbos-transact-java", "text": "public void setMultipleEvents() { dbos.setEvent(\"key1\", \"value1\"); dbos.setEvent(\"key2\", 241.5); dbos.setEvent(\"key3\", null); }", "tokens": 46} {"id": 136029, "source": "method", "repo": "dbos-inc/dbos-transact-java", "text": "public void applySchedulesCreatesAndReplaces() { registerAndLaunch(); dbos.createSchedule( new WorkflowSchedule(\"apply-1\", workflowName(), className(), \"0/5 * * * * *\")); var originalId = dbos.getSchedule(\"apply-1\").orElseThrow().id(); assertEquals(1, dbos.listSchedules(null, null, null).size()); // apply-1 is replaced (new cron) and apply-2 is created \u2014 applySchedules upserts, it does // not delete schedules absent from the list. dbos.applySchedules( List.of( new WorkflowSchedule(\"apply-1\", workflowName(), className(), \"0/10 * * * * *\"), new WorkflowSchedule(\"apply-2\", workflowName(), className(), \"0/5 * * * * *\"))); assertEquals(2, dbos.listSchedules(null, null, null).size()); var replaced = dbos.getSchedule(\"apply-1\").orElseThrow(); assertEquals(\"0/10 * * * * *\", replaced.cron()); assertNotNull(replaced.id()); assertEquals(originalId, replaced.id()); // schedule_id preserved across upsert assertNull(replaced.lastFiredAt()); var created = dbos.getSchedule(\"apply-2\").orElseThrow(); assertNotNull(created.id()); assertNull(created.lastFiredAt()); }", "tokens": 285} {"id": 136091, "source": "method", "repo": "dbos-inc/dbos-transact-java", "text": "public WorkflowStatusBuilder completedAt(Instant completedAt) { this.completedAt = completedAt; return this; }", "tokens": 25} {"id": 136108, "source": "method", "repo": "dbos-inc/dbos-transact-java", "text": "void aTimeoutFiresOnTime(int skewHours) throws Exception { launchSkewed(skewHours); var id = UUID.randomUUID().toString(); long start = System.nanoTime(); var handle = dbos.startWorkflow( () -> proxy.sleeper(30_000), new StartWorkflowOptions(id).withTimeout(Duration.ofSeconds(1))); assertThrows(DBOSAwaitedWorkflowCancelledException.class, handle::getResult); long elapsedMs = Duration.ofNanos(System.nanoTime() - start).toMillis(); // Neither at once nor an hour late. assertBetween(900, 10_000, elapsedMs, \"timeout after ms\"); assertEquals(WorkflowState.CANCELLED, handle.getStatus().status()); }", "tokens": 165} {"id": 136235, "source": "method", "repo": "dbos-inc/dbos-transact-java", "text": "public static List getTxStepRows(DataSource ds, String workflowId) throws SQLException { var sql = \"SELECT * FROM \\\"%s\\\".tx_step_outputs WHERE workflow_id = ? ORDER BY step_id\" .formatted(SystemDatabase.sanitizeSchema(null)); try (var conn = ds.getConnection(); var stmt = conn.prepareStatement(sql)) { stmt.setString(1, Objects.requireNonNull(workflowId)); try (var rs = stmt.executeQuery()) { List rows = new ArrayList<>(); while (rs.next()) { rows.add(new TxStepOutputRow(rs)); } return rows; } } }", "tokens": 143} {"id": 136244, "source": "method", "repo": "dbos-inc/dbos-transact-java", "text": "public DBOSWorkflowRegistrar(DBOS dbos, ApplicationContext applicationContext) { this.dbos = dbos; this.applicationContext = applicationContext; }", "tokens": 30} {"id": 136343, "source": "method", "repo": "dc37/super-mario-paint", "text": "public static void trySaveSong(File f, Song song) throws IOException { try ( FileOutputStream fos = new FileOutputStream(f); PrintStream pr = new PrintStream(fos); ) { TimeSignature t = Optional .ofNullable(song.getTimeSignature()) .orElse(TimeSignature.FOUR_FOUR); pr.printf(\"TEMPO: %f, \", song.getTempo()); pr.printf(\"EXT: %d, \", DataTypeUtils.packBits(song.getNoteExtensions())); pr.printf(\"TIME: %s, \", t); pr.printf(\"SOUNDSET: %s%s\", song.getSoundset(), LINE_BREAK); for (int i = 0; i < song.getLength(); i++) { if (song.getLine(i).getNotes().isEmpty()) { continue; } pr.print(\"\" + (i / t.top() + 1) + \":\" + (i % t.top()) + \",\"); List line = song.getLine(i).getNotes(); for (int j = 0; j < line.size(); j++) { pr.print(noteToString(line.get(j)) + \",\"); } pr.printf(\"VOL: %d%s\", song.getLine(i).getVolume(), LINE_BREAK); } } catch (IOException ioe) { throw ioe; } catch (Exception e) { throw new IOException(\"Error while trying to save the song!\", ExceptionUtils.maskIfNeeded(e)); } }", "tokens": 324} {"id": 136734, "source": "method", "repo": "dc37/super-mario-paint", "text": "/** Got this off of https://community.oracle.com/thread/2247058?tstart=0 This appears quite useful as a 'really exit?' type thing. This dialog currently needs some work, so we're not going to include it in the alpha release. */ private void handleCloseRequest() { String mssg; if (StateMachine.isSongModified() && StateMachine.isArrModified()) { mssg = \"The song and arrangement have\\n\" + \"both not been saved! Really exit?\"; } else if (StateMachine.isSongModified()) { mssg = \"The song has not been saved! \" + \"Really exit?\"; } else if (StateMachine.isArrModified()) { mssg = \"The arrangement has not been saved! \" + \"Really exit?\"; } else { stop(); return; } if (DialogUtils.showQuestion(\"HOLD IT!\", mssg)) stop(); }", "tokens": 207} {"id": 136971, "source": "method", "repo": "dc37/super-mario-paint", "text": "public static void showWarning(String body) { showWarning(Values.PROGRAM_NAME, body); }", "tokens": 23} {"id": 137209, "source": "method", "repo": "ddd-by-examples/library", "text": "public Option findBookOnHold(BookId bookId, PatronId patronId) { return Match(findBy(bookId)).of( Case($Some($(instanceOf(BookOnHold.class))), Option::of), Case($(), Option::none) ); }", "tokens": 65} {"id": 137350, "source": "method", "repo": "ddd-by-examples/library", "text": "private Hold toHold(Map map) { return new Hold(new BookId((UUID) map.get(\"BOOK_ID\")), ((Timestamp) map.get(\"HOLD_TILL\")).toInstant()); }", "tokens": 52} {"id": 137372, "source": "method", "repo": "ddd-by-examples/library", "text": "public Option findBy(BookId bookId) { return Option.of(books.get(bookId)); }", "tokens": 27} {"id": 137533, "source": "method", "repo": "ddf8196/fakeplayer", "text": "public final void sendCommandRequest(String command) { CommandRequestPacket packet = new CommandRequestPacket(); CommandOriginData commandOrigin = new CommandOriginData(CommandOriginType.PLAYER, UUID.randomUUID(), \"\", -1); packet.setCommandOriginData(commandOrigin); packet.setCommand(command); this.sendNetworkPacket(packet); }", "tokens": 73} {"id": 137542, "source": "method", "repo": "ddf8196/fakeplayer", "text": "public boolean isLocalPlayer() { return true; }", "tokens": 11} {"id": 137757, "source": "method", "repo": "ddf8196/fakeplayer", "text": "public final void setAuxValue(short auxValue) { this.mAuxValue = (short) MathUtil.clamp(auxValue, 0, Short.MAX_VALUE); }", "tokens": 39} {"id": 137959, "source": "method", "repo": "ddf8196/fakeplayer", "text": "public String getIdentity() { return identity; }", "tokens": 11} {"id": 137976, "source": "method", "repo": "ddf8196/fakeplayer", "text": "public void setAnimatedImageData(AnimatedImageData[] animatedImageData) { AnimatedImageData = animatedImageData; }", "tokens": 27} {"id": 138066, "source": "method", "repo": "ddf8196/fakeplayer", "text": "public WorldLimitChunkSource(ChunkSource storage, final BlockPos center) { super(storage); ChunkPos centerChunkPos = new ChunkPos(center); ChunkPos min = centerChunkPos.subtract(8); ChunkPos max = centerChunkPos.add(7); //+8-1 this.mLimitArea = new Bounds(min, max); this.mInvisibleWallChunk = LevelChunk.createNew(this.mDimension, ChunkPos.INVALID, true); Block[] blocks = new Block[this.getDimension().getHeight() << 8]; Arrays.fill(blocks, VanillaBlocks.mInvisibleBedrock); this.mInvisibleWallChunk.setAllBlocks(blocks, this.getDimension().getHeight()); this.mInvisibleWallChunk.changeState(ChunkState.Unloaded, ChunkState.Loaded); this.mInvisibleWallChunk.onTickingStarted(); }", "tokens": 172} {"id": 138283, "source": "method", "repo": "ddf8196/fakeplayer", "text": "public void setPixelB(int x, int y, int b) { data[y * width + x] = b(data[y * width + x], b); }", "tokens": 39} {"id": 138376, "source": "method", "repo": "ddssingsong/webrtc_android", "text": "public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { roomViewModel = new ViewModelProvider(requireActivity()).get(RoomViewModel.class); View root = inflater.inflate(R.layout.fragment_room, container, false); initView(root); initData(); return root; }", "tokens": 65} {"id": 138558, "source": "method", "repo": "ddssingsong/webrtc_android", "text": "public boolean isFrontFacing(String deviceName) { CameraCharacteristics characteristics = getCameraCharacteristics(deviceName); return characteristics != null && characteristics.get(CameraCharacteristics.LENS_FACING) == CameraMetadata.LENS_FACING_FRONT; }", "tokens": 52} {"id": 138693, "source": "method", "repo": "ddssingsong/webrtc_android", "text": "private ConnectionType getConnectionType() { return type; }", "tokens": 12} {"id": 138963, "source": "method", "repo": "ddssingsong/webrtc_android", "text": "public void setPlaneY() { coeffs = yCoeffs; stepSize = 1.0f; }", "tokens": 26} {"id": 139033, "source": "method", "repo": "ddssingsong/webrtc_android", "text": "public static boolean isSameH264Profile( Map params1, Map params2) { return nativeIsSameH264Profile(params1, params2); }", "tokens": 48} {"id": 139051, "source": "method", "repo": "ddssingsong/webrtc_android", "text": "private MediaCodecUtils() { // This class should not be instantiated. }", "tokens": 16} {"id": 139437, "source": "method", "repo": "DeepL/deepl-java", "text": "/** Initializes a new Language object. @param name The name of the language in English. @param code The language code. @param supportsFormality true for a target language that supports the {@link TextTranslationOptions#setFormality} option for translations, false for other target languages, or null for source languages. */ public Language(String name, String code, @Nullable Boolean supportsFormality) { this.name = name; this.code = LanguageCode.standardize(code); this.supportsFormality = supportsFormality; }", "tokens": 121} {"id": 139558, "source": "method", "repo": "DeepL/deepl-java", "text": "/** Functions the same as {@link Translator#translateDocument(File, File, String, String, DocumentTranslationOptions)} but uses default options. @see Translator#translateDocument(File, File, String, String, DocumentTranslationOptions) */ public DocumentStatus translateDocument( File inputFile, File outputFile, @Nullable String sourceLang, String targetLang) throws DocumentTranslationException, IOException { return translateDocument(inputFile, outputFile, sourceLang, targetLang, null); }", "tokens": 95} {"id": 139821, "source": "method", "repo": "DeepL/deepl-java", "text": "void testGetTranslationMemory() throws Exception { Assumptions.assumeTrue(isMockServer); DeepLClient client = createDeepLClient(); TranslationMemoryInfo translationMemory = client.getTranslationMemory(DEFAULT_TM_ID); Assertions.assertEquals(DEFAULT_TM_ID, translationMemory.getTranslationMemoryId()); Assertions.assertNotNull(translationMemory.getName()); Assertions.assertEquals(\"de\", translationMemory.getSourceLanguage()); Assertions.assertFalse(translationMemory.getTargetLanguages().isEmpty()); Assertions.assertTrue(translationMemory.getSegmentCount() > 0); Assertions.assertNotNull(translationMemory.getCreationTime()); Assertions.assertNotNull(translationMemory.getUpdatedTime()); }", "tokens": 127} {"id": 139950, "source": "method", "repo": "defano/wyldcard", "text": "public Object visitLnFunc(HyperTalkParser.LnFuncContext ctx) { return BuiltInFunction.LN; }", "tokens": 26} {"id": 139987, "source": "method", "repo": "defano/wyldcard", "text": "public SelectedButtonFunc(ParserRuleContext context, ButtonFamilySpecifier familySpecifier) { super(context); this.familySpecifier = familySpecifier; }", "tokens": 31} {"id": 140045, "source": "method", "repo": "defano/wyldcard", "text": "/** Returns this value as a List of line-delimited chunks. @param context The execution context @return A List of Values containing each line in the value. Every value has at least one line. */ public List getLines(ExecutionContext context) { return getChunks(context, ChunkType.LINE); }", "tokens": 67} {"id": 140129, "source": "method", "repo": "defano/wyldcard", "text": "public CreateMenuCmd(ParserRuleContext context, Expression menuName) { super(context, \"create\"); this.menuName = menuName; }", "tokens": 31} {"id": 140241, "source": "method", "repo": "defano/wyldcard", "text": "HyperCardCursor(String hyperTalkName, Cursor cursor) { this.hyperTalkName = hyperTalkName; this.cursor = cursor; }", "tokens": 34} {"id": 140322, "source": "method", "repo": "defano/wyldcard", "text": "public String getLongName(ExecutionContext context) { return getAbbrevName(context) + \" of \" + getStackModel().getLongName(context); }", "tokens": 33} {"id": 140353, "source": "method", "repo": "defano/wyldcard", "text": "public JComponent getWrappedComponent() { return this; }", "tokens": 12} {"id": 140536, "source": "method", "repo": "defano/wyldcard", "text": "/** Attempts to compile the given script text on a background thread and invoke the CompileCompletionObserver (on the background thread) when complete.

This method cancels any previously requested compilation tasks except those that may already be executing. Thus, invocation of the completion observer is not guaranteed; some jobs will be canceled before they run and thus never complete.

This method is primarily useful for parse-as-you-type syntax checking. @param compilationUnit The type of script/scriptlet to compile @param scriptText The script to parse. @param observer A non-null callback to fire when compilation is complete. */ public static void asyncBestEffortCompile(CompilationUnit compilationUnit, String scriptText, CompileCompletionObserver observer) { // Preempt any previously enqueued parse jobs ScriptCompiler.bestEffortCompileExecutor.getQueue().clear(); ScriptCompiler.bestEffortCompileExecutor.submit(ScriptCompiler.createCompileTask(compilationUnit, scriptText, observer)); }", "tokens": 199} {"id": 140572, "source": "method", "repo": "defano/wyldcard", "text": "private void fireObservers(String id, Value oldValue, Value newValue) { if (!observers.isEmpty()) { SwingUtilities.invokeLater(() -> { for (SymbolObserver thisObserver : observers) { thisObserver.onSymbolChanged(BasicSymbolTable.this, id, oldValue, newValue); } }); } }", "tokens": 66} {"id": 140634, "source": "method", "repo": "defano/wyldcard", "text": "public String getModifyVersionString() { return getVersionString(modifyVersion); }", "tokens": 17} {"id": 140662, "source": "method", "repo": "defano/wyldcard", "text": "public static ReportRecord deserialize(Block block, int recordSize, byte[] recordData) throws ImportException { ReportRecord reportRecord = new ReportRecord(); reportRecord.recordSize = recordSize; try (StackInputStream sis = new StackInputStream(recordData)) { reportRecord.top = sis.readShort(); reportRecord.left = sis.readShort(); reportRecord.bottom = sis.readShort(); reportRecord.right = sis.readShort(); reportRecord.columnCount = sis.readShort(); reportRecord.flags = ReportRecordFlag.fromBitmask(sis.readShort()); reportRecord.textSize = sis.readShort(); reportRecord.textHeight = sis.readShort(); reportRecord.textStyles = FontStyle.fromBitmask((byte) sis.readShort()); reportRecord.textAlignment = TextAlignment.fromAlignmentId(sis.readShort()); reportRecord.contents = sis.readString(); reportRecord.textFont = sis.readString(); } catch (IOException e) { throw new ImportException(block, \"Malformed report record.\"); } return reportRecord; }", "tokens": 244} {"id": 140775, "source": "method", "repo": "defano/wyldcard", "text": "public void testGetListItems() { assertIterableEquals(Lists.newArrayList(), new Value().getListItems()); assertIterableEquals(Lists.newArrayList(new Value(\"1\")), new Value(\"1\").getListItems()); assertIterableEquals(Lists.newArrayList(new Value(\"1\"), new Value(\"2\")), new Value(\"1,2\").getListItems()); }", "tokens": 72} {"id": 140799, "source": "method", "repo": "defano/wyldcard", "text": "void testThatClickCmdClicksAtLocation() throws HtException { // Setup initialize(new ClickCmd(mockParserRuleContext, clickLocExpr, null)); Mockito.when(clickLocExpr.evaluate(mockExecutionContext)).thenReturn(new Value(\"10, 100\")); // Execute uut.onExecute(mockExecutionContext); // Verify Mockito.verify(mockMouseManager).clickAt(new Point(10, 100), false, false, false); }", "tokens": 101} {"id": 140846, "source": "method", "repo": "DemchaAV/GraphCompose", "text": "/** Resolves every declared {@code anchor(...)} to its final page in a single, backend-neutral pass over the laid-out document \u2014 the foundation for cross-references (\"see page N\") and clickable tables of contents.

Computed from the resolved layout graph (not from rendered output) and cached per layout revision alongside {@link #layoutSnapshot()}. A duplicate anchor resolves to its last registration, matching where a {@code linkTo(anchor)} jumps.

@return the resolved anchor-to-page index @throws IllegalStateException if this session has already been closed @since 1.9.0 */ public PageIndex pageIndex() { ensureOpen(); long revision = layoutCache.revision(); if (layoutCache.isPageIndexCached()) { PageIndex cached = layoutCache.pageIndex(() -> { throw new IllegalStateException(\"PageIndex cache miss after isPageIndexCached() returned true.\"); }); LIFECYCLE_LOG.debug(\"document.pageIndex.cache.hit sessionId={} revision={} roots={}\", sessionId, revision, roots.size()); return cached; } long startNanos = System.nanoTime(); PageIndex computed = layoutCache.pageIndex(() -> PageIndexExtractor.from(layoutGraph())); LIFECYCLE_LOG.debug(\"document.pageIndex.end sessionId={} revision={} roots={} anchors={} durationMs={}\", sessionId, revision, roots.size(), computed.all().size(), elapsedMillis(startNanos)); return computed; }", "tokens": 309} {"id": 140894, "source": "method", "repo": "DemchaAV/GraphCompose", "text": "/** Sets spacing between wrapped lines. @param lineSpacing line spacing in points @return this builder */ public ParagraphBuilder lineSpacing(double lineSpacing) { this.lineSpacing = lineSpacing; return this; }", "tokens": 45} {"id": 140916, "source": "method", "repo": "DemchaAV/GraphCompose", "text": "/** Configures alternating row fill colours. The {@code odd} style is applied to rows at index 0, 2, 4 (visually first, third, fifth); the {@code even} style to rows at index 1, 3, 5 (second, fourth, sixth). Either style may be {@code null} to skip painting that parity.

Zebra styling is applied lazily at {@link #build()} time and only to rows that do not already have an explicit {@link #rowStyle(int, DocumentTableStyle)} override, so calls to {@link #headerStyle(DocumentTableStyle)} or {@link #totalRow(String...)} take precedence.

@param odd style for odd-indexed rows (index 0, 2, 4 \u2014 first, third, fifth visually) @param even style for even-indexed rows (index 1, 3, 5) @return this builder */ public TableBuilder zebra(DocumentTableStyle odd, DocumentTableStyle even) { this.zebraOddStyle = odd; this.zebraEvenStyle = even; return this; }", "tokens": 240} {"id": 141170, "source": "method", "repo": "DemchaAV/GraphCompose", "text": "private static InvoicePaymentBlock payment() { List fields = new ArrayList<>(); fields.add(new InvoicePaymentBlock.Field(\"Bank Name:\", \"Bay Union Bank, N.A.\")); fields.add(new InvoicePaymentBlock.Field(\"Account Name:\", \"Kestrel Collaboration, Inc.\")); fields.add(new InvoicePaymentBlock.Field(\"Account Number:\", \"000000123456789\")); fields.add(new InvoicePaymentBlock.Field(\"Routing (ABA):\", \"021000021\")); fields.add(new InvoicePaymentBlock.Field(\"SWIFT / BIC:\", \"BAYUUS33\")); fields.add(new InvoicePaymentBlock.Field(\"Currency:\", \"USD\")); fields.add(new InvoicePaymentBlock.Field(\"Reference:\", \"INV-2024-0003521\")); fields.add(new InvoicePaymentBlock.Field(\"Bank Address:\", \"1 Market Plaza, San Francisco\")); return new InvoicePaymentBlock(\"PAYMENT DETAILS\", fields, \"Please include the invoice number in your payment reference.\", \"PAYMENT DUE BY\", \"26 June 2024\", \"\", \"\"); }", "tokens": 296} {"id": 141246, "source": "method", "repo": "DemchaAV/GraphCompose", "text": "private static int wSpacingOf(byte[] docx) throws Exception { try (XWPFDocument document = new XWPFDocument(new ByteArrayInputStream(docx))) { for (XWPFParagraph paragraph : document.getParagraphs()) { for (XWPFRun run : paragraph.getRuns()) { Matcher matcher = W_SPACING.matcher(run.getCTR().xmlText()); if (matcher.find()) { return Integer.parseInt(matcher.group(1)); } } } } throw new AssertionError(\"no w:spacing written\"); }", "tokens": 107} {"id": 141287, "source": "method", "repo": "DemchaAV/GraphCompose", "text": "void boundingBoxGradientInterpolatesTheShapeBbox() { // Default gradientUnits=objectBoundingBox, default axis 0%,0% \u2192 100%,0%. SvgIcon icon = SvgIcon.parse(\"\"\" \"\"\"); DocumentPaint.LinearAxis axis = (DocumentPaint.LinearAxis) icon.layers().get(0).fillPaint(); // Bbox: x \u2208 [0.2, 0.8]; SVG bbox-top y=2 \u2192 normalized 0.8. assertThat(axis.x0()).isCloseTo(0.2, within(1e-9)); assertThat(axis.y0()).isCloseTo(0.8, within(1e-9)); assertThat(axis.x1()).isCloseTo(0.8, within(1e-9)); assertThat(axis.y1()).isCloseTo(0.8, within(1e-9)); }", "tokens": 284} {"id": 141436, "source": "method", "repo": "DemchaAV/GraphCompose", "text": "/** Returns the text measurement service backed by the PDF font metrics. @return text measurement service */ public TextMeasurementSystem textMeasurementSystem() { return textMeasurementSystem; }", "tokens": 36} {"id": 141451, "source": "method", "repo": "DemchaAV/GraphCompose", "text": "private String textSanitizer(String text) { // v1.6.3: preserve author-supplied whitespace verbatim. The // previous implementation collapsed any run of resulting spaces // (original + converted) into one, but downstream geometry // (`PdfFont.getTextWidth`, paragraph layout, link-rect emission) // measures against the input as written. The collapse therefore // shrank the rendered string under measurement, drifting // link annotations away from their glyphs and visually merging // any text whose author put more than one space in it on purpose. // (The case that first showed this was the templates' old // spaced-caps transform, which padded a name out to // \"A R T E M D E M C H Y S H Y N\". That is gone \u2014 tracking is a // style now \u2014 but the rule it exposed is not about that transform: // a run of author spaces is content, and measurement and drawing // have to agree on how wide it is.) // Newlines / NBSP / non-tab control chars still resolve to a // single space each \\u2014 they no longer collapse adjacent author // spaces. StringBuilder sanitized = new StringBuilder(text.length()); for (int offset = 0; offset < text.length(); ) { int codePoint = text.codePointAt(offset); offset += Character.charCount(codePoint); int resolved = switch (codePoint) { case '\\r', '\\n', '\\u00A0' -> ' '; default -> Character.isISOControl(codePoint) && codePoint != '\\t' ? ' ' : codePoint; }; sanitized.appendCodePoint(resolved); } return sanitized.toString(); }", "tokens": 356} {"id": 141580, "source": "method", "repo": "DemchaAV/GraphCompose", "text": "/** The largest prefix of {@code lines} that fits {@code available} points once the heading is paid for. @return how many lines fit; {@code 0} when not even one does */ int linesThatFit(List lines, double available) { double used = headingHeight + blockGap; int fitted = 0; for (String line : lines) { double next = used + wrappedLines(line) * lineHeight; if (next > available) { break; } used = next; fitted++; } return fitted; }", "tokens": 120} {"id": 141602, "source": "method", "repo": "DemchaAV/GraphCompose", "text": "private void addWorkEntry(SectionBuilder host, CvEntry entry) { EntryCompactRenderer.titleDateBody(host, entry, theme.entryTitleStyle(), TextStyles.of(theme.typography().bodyFont(), theme.typography().sizeEntryDate(), DocumentTextDecoration.BOLD, options.accentColor()), theme.entrySubtitleStyle(), theme.bodyStyle(), \" / \", 1.0, DocumentInsets.zero(), DocumentInsets.zero(), DocumentInsets.bottom(5), theme.typography().bodyLineSpacing(), false); }", "tokens": 118} {"id": 141686, "source": "method", "repo": "DemchaAV/GraphCompose", "text": "private ConsultingIcons() { }", "tokens": 10} {"id": 141824, "source": "method", "repo": "denizenscript/denizen", "text": "public void onBlockEquipsItemOntoEntity(BlockDispenseArmorEvent event) { entity = new EntityTag(event.getTargetEntity()); location = new LocationTag(event.getBlock().getLocation()); this.event = event; fire(event); }", "tokens": 52} {"id": 141855, "source": "method", "repo": "denizenscript/denizen", "text": "public ObjectTag getContext(String name) { return switch (name) { case \"entity\" -> entity; case \"input\" -> new ItemTag(event.getInput()); case \"outcome\" -> { ListTag result = new ListTag(event.getOutcome().size()); for (ItemStack item : event.getOutcome()) { result.addObject(new ItemTag(item)); } yield result; } default -> super.getContext(name); }; }", "tokens": 93} {"id": 142132, "source": "method", "repo": "denizenscript/denizen", "text": "public void adjust(Mechanism mechanism) { // <--[mechanism] // @object ItemTag // @name knowledge_book_recipes // @input ListTag // @description // Sets the item's knowledge book recipe list, in the Namespace:Key format. // @tags // // --> if (mechanism.matches(\"knowledge_book_recipes\")) { KnowledgeBookMeta meta = (KnowledgeBookMeta) item.getItemMeta(); List recipes = new ArrayList<>(); ListTag newRecipes = mechanism.valueAsType(ListTag.class); for (String str : newRecipes) { recipes.add(Utilities.parseNamespacedKey(str)); } meta.setRecipes(recipes); item.setItemMeta(meta); } }", "tokens": 161} {"id": 142442, "source": "method", "repo": "denizenscript/denizen", "text": "public boolean renderEntireMap(int mapId, int xMin, int zMin, int xMax, int zMax) { MapItemSavedData worldmap = ((CraftServer) Bukkit.getServer()).getServer().getLevel(net.minecraft.world.level.Level.OVERWORLD).getMapData(new MapId(mapId)); if (worldmap == null) { return false; } renderFullMap(worldmap, xMin, zMin, xMax, zMax); return true; }", "tokens": 106} {"id": 142477, "source": "method", "repo": "denizenscript/denizen", "text": "public UUID getBossbarUUID(BossBar bar) { return ((CraftBossBar) bar).getHandle().getId(); }", "tokens": 26} {"id": 142487, "source": "method", "repo": "denizenscript/denizen", "text": "public FishHook getHookFrom(Player player) { FishingHook nmsHook = ((CraftPlayer) player).getHandle().fishing; if (nmsHook == null) { return null; } return (FishHook) nmsHook.getBukkitEntity(); }", "tokens": 54} {"id": 142493, "source": "method", "repo": "denizenscript/denizen", "text": "public void clearDebugTestMarker(Player player) { }", "tokens": 13} {"id": 142554, "source": "method", "repo": "denizenscript/denizen", "text": "public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) { if (handlePacketIn(packet)) { return; } oldListener.handleChangeDifficulty(packet); }", "tokens": 36} {"id": 142740, "source": "method", "repo": "depsypher/pngtastic", "text": "public File export(String fileName, byte[] bytes) throws IOException { File out = new File(fileName); writeFileOutputStream(out, bytes); return out; }", "tokens": 34} {"id": 142959, "source": "method", "repo": "depsypher/pngtastic", "text": "public void write(byte[] b) throws IOException { write(b, 0, b.length); }", "tokens": 24} {"id": 143454, "source": "method", "repo": "devnatan/inventory-framework", "text": "public Void install(ViewFrame framework, UnaryOperator configure) { config = configure.apply(defaultConfig()); framework.getPipeline().intercept(FRAME_REGISTERED, (frameInterceptor = createFrameworkInterceptor())); return null; }", "tokens": 52} {"id": 143570, "source": "method", "repo": "devnatan/inventory-framework", "text": "public String getContextId() { return contextId; }", "tokens": 12} {"id": 143777, "source": "method", "repo": "devnatan/inventory-framework", "text": "public int increment(@NotNull StateValueHost host) { return update(host, 1); }", "tokens": 22} {"id": 143914, "source": "method", "repo": "devnatan/inventory-framework", "text": "public void updateTitleForEveryone(@NotNull Object title) { for (final Viewer viewer : getViewers()) getContainerOrThrow().changeTitle(title, viewer); }", "tokens": 36} {"id": 144182, "source": "method", "repo": "devnatan/inventory-framework", "text": "public void cancel() { if (!isStarted()) return; task.cancel(); task = null; }", "tokens": 22} {"id": 144197, "source": "method", "repo": "devnatan/inventory-framework", "text": "public static Object createTitleComponent(Object text) throws Throwable { if (McVersion.supports(19)) { return literal.invoke(text); } else { return chatMessage.invoke(text, DUMMY_COLOR_MODIFIERS); } }", "tokens": 52} {"id": 144343, "source": "method", "repo": "devoxx/DevoxxGenieIDEAPlugin", "text": "public HttpClientBuilder readTimeout(Duration timeout) { delegate.readTimeout(timeout); return this; }", "tokens": 21} {"id": 144528, "source": "method", "repo": "devoxx/DevoxxGenieIDEAPlugin", "text": "public ExecutionException(String message, Throwable cause) { super(message, cause, ErrorSeverity.ERROR, false); }", "tokens": 26} {"id": 144658, "source": "method", "repo": "devoxx/DevoxxGenieIDEAPlugin", "text": "/** Clear the conversation content. */ public void clear() { messageRenderer.clear(); showWelcome(); }", "tokens": 22} {"id": 144719, "source": "method", "repo": "devoxx/DevoxxGenieIDEAPlugin", "text": "ColumnName(String displayName) { this.displayName = displayName; }", "tokens": 15} {"id": 144762, "source": "method", "repo": "devoxx/DevoxxGenieIDEAPlugin", "text": "public String getDisplayName() { return \"Spec Driven Development\"; }", "tokens": 15} {"id": 144854, "source": "method", "repo": "devoxx/DevoxxGenieIDEAPlugin", "text": "void unconsumedSteeringMessages_areResubmittedAsNewPromptWhenRunEnds() { startRunningPrompt(); ArgumentCaptor completion = ArgumentCaptor.forClass(Runnable.class); verify(promptExecutionService).executePrompt(any(), eq(promptOutputPanel), completion.capture()); controller.handlePromptSubmission(steeringContext(\"late correction\")); // Run finishes before the loop consumed the steering message completion.getValue().run(); verify(promptSubmissionListener).onPromptSubmitted(project, \"late correction\", TAB_ID); assertThat(SteeringMessageQueue.getInstance().hasPending(MEMORY_KEY)).isFalse(); assertThat(SteeringMessageQueue.getInstance().isActive(MEMORY_KEY)).isFalse(); }", "tokens": 150} {"id": 145048, "source": "method", "repo": "devoxx/DevoxxGenieIDEAPlugin", "text": "void onRequest_activityMessagePublisherThrows_doesNotPropagate() { listener = new MCPListenerService( () -> true, () -> true, msg -> { throw new RuntimeException(\"bus error\"); } ); AiMessage aiMessage = AiMessage.from(\"Some reasoning\"); ChatModelRequestContext ctx = createContext(List.of( SystemMessage.from(\"system\"), aiMessage, TOOL_RESULT )); // Should not throw listener.onRequest(ctx); }", "tokens": 99} {"id": 145153, "source": "method", "repo": "devoxx/DevoxxGenieIDEAPlugin", "text": "void buildSkillsReturnsNullWhenAllSkillsDisabled() throws IOException { writeSkill(userDevoxxgenie, \"alpha\", \"first\"); writeSkill(userAgents, \"beta\", \"second\"); state.setDisabledSkillNames(new HashSet<>(Set.of(\"alpha\", \"beta\"))); SkillRegistry registry = newRegistry(); assertThat(registry.buildSkills()).isNull(); assertThat(registry.getSystemPromptFragment()).isEmpty(); }", "tokens": 88} {"id": 145178, "source": "method", "repo": "devoxx/DevoxxGenieIDEAPlugin", "text": "void buildContext_omitsImplementationNotes_whenEmpty() { TaskSpec spec = TaskSpec.builder() .id(\"T-1\") .implementationNotes(\"\") .build(); String context = SpecContextBuilder.buildContext(spec); assertThat(context).doesNotContain(\"## Implementation Notes\"); }", "tokens": 65} {"id": 145314, "source": "method", "repo": "devoxx/DevoxxGenieIDEAPlugin", "text": "void getImageMimeType_bmpFile_returnsBmpMime() { when(virtualFile.getName()).thenReturn(\"bitmap.bmp\"); assertThat(ImageUtil.getImageMimeType(virtualFile)).isEqualTo(\"image/bmp\"); }", "tokens": 46} {"id": 145451, "source": "method", "repo": "devs-immortal/paradise-lost", "text": "public int getAnalogOutputSignal(BlockState state, Level world, BlockPos pos) { return getComparatorOutput(state.getValue(BITES)); }", "tokens": 31} {"id": 145493, "source": "method", "repo": "devs-immortal/paradise-lost", "text": "public AmadrysCropBlock(Properties settings) { super(settings); }", "tokens": 19} {"id": 145667, "source": "method", "repo": "devs-immortal/paradise-lost", "text": "public boolean canUse() { var valid = this.mob.findValidEnlightenTarget(ENLIGHTEN_FOLLOW_RANGE); if (valid != null) { target = valid; return mob.random.nextInt(10) == 0; } else { return false; } }", "tokens": 62} {"id": 145739, "source": "method", "repo": "devs-immortal/paradise-lost", "text": "public ResourceLocation boatTexture() { return ResourceLocation.fromNamespaceAndPath(\"paradise_lost\", \"textures/entity/boat/\" + name + \".png\"); }", "tokens": 35} {"id": 145764, "source": "method", "repo": "devs-immortal/paradise-lost", "text": "public LevitaArrowItem(Item.Properties properties) { super(properties); }", "tokens": 18} {"id": 145918, "source": "method", "repo": "devs-immortal/paradise-lost", "text": "private static TagKey register(String id) { return TagKey.create(Registries.BLOCK, ModConstants.id(id)); }", "tokens": 30} {"id": 145975, "source": "method", "repo": "devs-immortal/paradise-lost", "text": "public CloudCarverConfig(float probability, HeightProvider y, FloatProvider yScale, VerticalAnchor lavaLevel, CarverDebugSettings debugConfig, HolderSet replaceable, FloatProvider horizontalRadiusMultiplier, FloatProvider verticalRadiusMultiplier, BlockStateProvider cloudState, FloatProvider yawMultiplier, FloatProvider yawPitchRatio, IntProvider sizeMultiplier, FloatProvider maxYaw, IntProvider engorgementChance, FloatProvider widthMultiplier) { super(probability, y, yScale, lavaLevel, debugConfig, replaceable); this.horizontalRadiusMultiplier = horizontalRadiusMultiplier; this.verticalRadiusMultiplier = verticalRadiusMultiplier; this.yawMultiplier = yawMultiplier; this.yawPitchRatio = yawPitchRatio; this.widthMultiplier = widthMultiplier; this.sizeMultiplier = sizeMultiplier; this.maxYaw = maxYaw; this.engorgementChance = engorgementChance; this.cloudState = cloudState; }", "tokens": 195} {"id": 146012, "source": "method", "repo": "devs-immortal/paradise-lost", "text": "public static Minecraft client() { return Minecraft.getInstance(); }", "tokens": 13} {"id": 146184, "source": "method", "repo": "devs-immortal/paradise-lost", "text": "private void doublePlant(Block block, String bottomPath, String topPath) { getVariantBuilder(block).partialState().with(BlockStateProperties.DOUBLE_BLOCK_HALF, DoubleBlockHalf.LOWER) .modelForState().modelFile(existingModel(bottomPath)).addModel(); getVariantBuilder(block).partialState().with(BlockStateProperties.DOUBLE_BLOCK_HALF, DoubleBlockHalf.UPPER) .modelForState().modelFile(existingModel(topPath)).addModel(); itemFromTexture(block, modLoc(\"block/\" + topPath)); }", "tokens": 120} {"id": 146210, "source": "method", "repo": "devs-immortal/paradise-lost", "text": "private void addReplaceableTags() { Block[] replaceable = { AUREL_LEAF_PILE.get(), ROSE_WISTERIA_LEAF_PILE.get(), ROSE_WISTERIA_HANGER.get(), FROST_WISTERIA_LEAF_PILE.get(), FROST_WISTERIA_HANGER.get(), LAVENDER_WISTERIA_LEAF_PILE.get(), LAVENDER_WISTERIA_HANGER.get(), GRASS.get(), GRASS_FLOWERING.get(), SHORT_GRASS.get(), TALL_GRASS.get(), FERN.get(), BUSH.get(), SHAMROCK.get(), MALT_SPRIG.get() }; for (Block block : replaceable) { tag(BlockTags.REPLACEABLE).add(block); tag(BlockTags.REPLACEABLE_BY_TREES).add(block); } }", "tokens": 209} {"id": 146256, "source": "method", "repo": "devs-immortal/paradise-lost", "text": "public void registerDataAttachment(CommonDataAttachment attachment) { AttachmentType.Builder builder = AttachmentType.builder((Function) (Object) attachment.getDefaultValueSupplier()); if (attachment.getCodec() != null) { builder.serialize(attachment.getCodec()); } if (attachment.isCopyOnDeath()) { builder.copyOnDeath(); } if (attachment.canSync()) { builder.sync(attachment.getStreamCodec()); } AttachmentType type = builder.build(); Registry.register(NeoForgeRegistries.ATTACHMENT_TYPES, attachment.getName(), type); attachment.setAttachment(type); }", "tokens": 147} {"id": 146295, "source": "method", "repo": "devSquad-study/2023-CS-Study", "text": "public WoodenDuck() { quackBehavior = new MuteQuack(); flyBehavior = new FlyNoWay(); eatBehavior = new CannotEat(); }", "tokens": 37} {"id": 146312, "source": "method", "repo": "devSquad-study/2023-CS-Study", "text": "public MP3(){ musicList = new MusicList(); isCheckedInfinit = false; }", "tokens": 21} {"id": 146387, "source": "method", "repo": "devSquad-study/2023-CS-Study", "text": "public OrganizationChartComponent getPeople(int i) { throw new UnsupportedOperationException(); }", "tokens": 18} {"id": 146549, "source": "method", "repo": "devSquad-study/2023-CS-Study", "text": "public double cost() { return car.cost() + 100.0; }", "tokens": 20} {"id": 146618, "source": "method", "repo": "devSquad-study/2023-CS-Study", "text": "public static int asInt(int bound) { return new Random().nextInt(bound); }", "tokens": 20} {"id": 146635, "source": "method", "repo": "devSquad-study/2023-CS-Study", "text": "public static LegPress getLegPress() { if (legPress == null) { synchronized (LegPress.class) { if (legPress == null) { legPress = new LegPress(); } } } return legPress; }", "tokens": 51} {"id": 146739, "source": "method", "repo": "devSquad-study/2023-CS-Study", "text": "public Car(CarState state) { if (state == CarState.ON) { this.carAirConditionerTemperature = 28; } setState(state); }", "tokens": 37} {"id": 146770, "source": "method", "repo": "devSquad-study/2023-CS-Study", "text": "public void play() { controlProtocol.control(); outputSignal(); System.out.println(); }", "tokens": 21} {"id": 147022, "source": "method", "repo": "deweyjose/graphqlcodegen", "text": "public boolean isGenerateIsGetterForPrimitiveBooleanFields() { return generateIsGetterForPrimitiveBooleanFields; }", "tokens": 23} {"id": 147151, "source": "method", "repo": "dimensionaldevelopment/vanillafix", "text": "public boolean isFullBlock() { return block.isFullBlock(this); }", "tokens": 17} {"id": 147270, "source": "method", "repo": "dimensionaldevelopment/vanillafix", "text": "public MixinEntityPlayerMP(World worldIn, GameProfile gameProfileIn) {super(worldIn, gameProfileIn);}", "tokens": 23} {"id": 147316, "source": "method", "repo": "dimensionaldevelopment/vanillafix", "text": "protected void actionPerformed(GuiButton button) { super.actionPerformed(button); if (button.id == 0) { mc.displayGuiScreen(null); } }", "tokens": 36} {"id": 147325, "source": "method", "repo": "dimensionaldevelopment/vanillafix", "text": "default void register() { resettableRefs.add(new WeakReference<>(this)); }", "tokens": 18} {"id": 147436, "source": "method", "repo": "dimensionaldevelopment/vanillafix", "text": "private MultipartModel(ResourceLocation location, Multipart multipart, ImmutableMap partModels) { this.location = location; this.multipart = multipart; this.partModels = partModels; }", "tokens": 43} {"id": 147579, "source": "method", "repo": "dipjyotimetia/hybridtestframework", "text": "/** Capture screens in log @param screenShotName screenshotName @return destinationPath @throws IOException exception */ private String capture(String screenShotName) throws IOException { TakesScreenshot ts = (TakesScreenshot) driverThread; File source = ts.getScreenshotAs(OutputType.FILE); String dest = System.getProperty(\"user.dir\") + \"\\\\Reports\\\\Screens\\\\\" + screenShotName + \".png\"; File destination = new File(dest); FileUtils.copyFile(source, destination); return dest; }", "tokens": 110} {"id": 147788, "source": "method", "repo": "dipjyotimetia/hybridtestframework", "text": "public void afterGetTitle(WebDriver driver, String result) { logEvent(\"Page title is [\" + result + \"]\"); }", "tokens": 26} {"id": 147845, "source": "method", "repo": "dipjyotimetia/hybridtestframework", "text": "/** Get Device serial number @return serial number */ public String getDeviceSerialNumber() throws Exception { log.info(\"Get device serial number\"); return command(\"adb -s \" + ID + \" shell getprop ro.serialno\"); }", "tokens": 50} {"id": 147914, "source": "method", "repo": "direwolf20-mc/buildinggadgets", "text": "public void forceUpdate() { forceUpdate = true; }", "tokens": 13} {"id": 147922, "source": "method", "repo": "direwolf20-mc/buildinggadgets", "text": "public int getHeight() { return Screen.hasShiftDown() && tooltipData.data != null ? 20 + (tooltipData.data.sortedEntries.size() / STACKS_PER_LINE * 20) : 0; }", "tokens": 52} {"id": 147936, "source": "method", "repo": "direwolf20-mc/buildinggadgets", "text": "public VertexConsumer color(int red, int green, int blue, int alpha) { if (this.defaultColorSet) { throw new IllegalStateException(); } else { return BufferVertexConsumer.super.color(red, green, blue, alpha); } }", "tokens": 53} {"id": 147937, "source": "method", "repo": "direwolf20-mc/buildinggadgets", "text": "public void vertex(float x, float y, float z, float red, float green, float blue, float alpha, float texU, float texV, int overlayUV, int lightmapUV, float normalX, float normalY, float normalZ) { if (this.defaultColorSet) { throw new IllegalStateException(); } else if (this.fastFormat) { this.putFloat(0, x); this.putFloat(4, y); this.putFloat(8, z); this.putByte(12, (byte) ((int) (red * 255.0F))); this.putByte(13, (byte) ((int) (green * 255.0F))); this.putByte(14, (byte) ((int) (blue * 255.0F))); this.putByte(15, (byte) ((int) (alpha * 255.0F))); this.putFloat(16, texU); this.putFloat(20, texV); int i; if (this.fullFormat) { this.putShort(24, (short) (overlayUV & '\\uffff')); this.putShort(26, (short) (overlayUV >> 16 & '\\uffff')); i = 28; } else { i = 24; } this.putShort(i + 0, (short) (lightmapUV & '\\uffff')); this.putShort(i + 2, (short) (lightmapUV >> 16 & '\\uffff')); this.putByte(i + 4, BufferVertexConsumer.normalIntValue(normalX)); // @mcp: normalIntValue = normalInt this.putByte(i + 5, BufferVertexConsumer.normalIntValue(normalY)); this.putByte(i + 6, BufferVertexConsumer.normalIntValue(normalZ)); this.nextElementBytes += i + 8; this.endVertex(); } else { super.vertex(x, y, z, red, green, blue, alpha, texU, texV, overlayUV, lightmapUV, normalX, normalY, normalZ); } }", "tokens": 470} {"id": 147985, "source": "method", "repo": "direwolf20-mc/buildinggadgets", "text": "private void updateSizeString() { this.sizeString = getSizeString(); }", "tokens": 18} {"id": 148256, "source": "method", "repo": "direwolf20-mc/buildinggadgets", "text": "public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { return new TemplateKeyProvider(stack); }", "tokens": 26} {"id": 148305, "source": "method", "repo": "direwolf20-mc/buildinggadgets", "text": "public PacketRequestTemplate(UUID id) { super(id); }", "tokens": 15} {"id": 148419, "source": "method", "repo": "direwolf20-mc/buildinggadgets", "text": "/** Creates a new {@link BuildContext} using the world previously set on this {@code Builder}. @return A new {@link BuildContext} with the values specified in this {@code Builder}. @see #build(IWorld) */ public BuildContext build() { return build(null); }", "tokens": 61} {"id": 148533, "source": "method", "repo": "direwolf20-mc/buildinggadgets", "text": "public SubMaterialListEntry(ImmutableList> subEntries, ImmutableList simpleEntries, boolean simplified) { this.subEntries = Objects.requireNonNull(subEntries, \"Cannot construct a SubMaterialListEntry without a list of Sub-MaterialEntries!\"); this.constantEntries = Objects.requireNonNull(simpleEntries, \"Cannot construct a SubMaterialListEntry without a list of constant Entries!\"); this.simplified = simplified; }", "tokens": 91} {"id": 148822, "source": "method", "repo": "direwolf20-mc/buildinggadgets", "text": "public BlockEntity getOverriddenTile(BlockPos pos) { BlockInfo info = getOverriddenBlock(pos); return info != null ? info.getEntity(this) : null; }", "tokens": 36} {"id": 148853, "source": "method", "repo": "DJ-Raven/swing-modal-dialog", "text": "private void installSearchField() { textSearch.setDocument(new PlainDocument() { @Override public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { if (getLength() + str.length() <= SEARCH_MAX_LENGTH) { super.insertString(offs, str, a); } } }); textSearch.getDocument().addDocumentListener(new DocumentListener() { private String text; @Override public void insertUpdate(DocumentEvent e) { search(); } @Override public void removeUpdate(DocumentEvent e) { search(); } @Override public void changedUpdate(DocumentEvent e) { search(); } private void search() { String st = textSearch.getText().trim().toLowerCase(); // Convert search term to lowercase if (!st.equals(text)) { text = st; panelResult.removeAll(); listItems.clear(); if (st.isEmpty()) { showRecentResult(); } else { for (Map.Entry> entry : formsMap.entrySet()) { SystemForm s = entry.getKey(); // Compare both name and description with lower cased search term if (s.name().toLowerCase().contains(st) || s.description().toLowerCase().contains(st) || checkTags(s.tags(), st)) { if (MyMenuValidation.validation(entry.getValue())) { Item item = new Item(s, entry.getValue(), false, false); checkComponentOrientation(item); panelResult.add(item); listItems.add(item); } } } if (!listItems.isEmpty()) { setSelected(0); } else { panelResult.add(createNoResult(st)); } panelResult.repaint(); updateLayout(); } } } private boolean checkTags(String[] tags, String st) { if (tags.length == 0) return false; return Arrays.stream(tags).anyMatch(s -> s.contains(st)); } }); textSearch.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { switch (e.getKeyCode()) { case KeyEvent.VK_UP: move(true); break; case KeyEvent.VK_DOWN: move(false); break; case KeyEvent.VK_ENTER: showForm(); break; } } }); }", "tokens": 483} {"id": 148892, "source": "method", "repo": "DJ-Raven/swing-modal-dialog", "text": "public ChartDeviationStepRenderer() { initStyle(); }", "tokens": 12} {"id": 148945, "source": "method", "repo": "DJ-Raven/swing-modal-dialog", "text": "protected void drawSeries(Graphics2D g2, float x, float y, float height, Paint paint) { double size = Math.min(height - (getSeriesPadding().getTop() + getSeriesPadding().getBottom()), getSeriesSize()); double lx = x + (getSeriesSize() - size) / 2f; double ly = y + ((height - size) / 2); g2.setPaint(paint); g2.fill(new Ellipse2D.Double(lx, ly, size, size)); }", "tokens": 116} {"id": 149015, "source": "method", "repo": "DJ-Raven/swing-modal-dialog", "text": "private void applyAccentColor() { Class lafClass = UIManager.getLookAndFeel().getClass(); try { DemoPreferences.updateAccentColor(DemoPreferences.accentColor); FlatLaf.setup(lafClass.getDeclaredConstructor().newInstance()); FlatLaf.updateUI(); } catch (Exception ex) { LoggingFacade.INSTANCE.logSevere(null, ex); } }", "tokens": 79} {"id": 149065, "source": "method", "repo": "DJ-Raven/swing-modal-dialog", "text": "public double getSalary() { return salary; }", "tokens": 12} {"id": 149610, "source": "method", "repo": "DJ-Raven/swing-modal-dialog", "text": "private String getLayoutInsets() { Insets padding = toastData.getOption().getStyle().getBorderStyle().getPadding(); final int add = ModalUtils.getToastExtraBorderPadding(toastData.getOption()); return String.format(Locale.ROOT, \"insets %d %d %d %d\", padding.top + add, padding.left + add, padding.bottom + add, padding.right + add); }", "tokens": 88} {"id": 149734, "source": "method", "repo": "DJ-Raven/swing-modal-dialog", "text": "private Border createDropShadowBorder(ModalWindowBorder border) { return new DropShadowBorder( border.getShadowSize(), border.getShadowOpacity(), border.getShadowColor(), border.getBorderWidth(), border.getBorderColor(), border.getRound()); }", "tokens": 55} {"id": 149747, "source": "method", "repo": "docling-project/docling-java", "text": "void shouldDeserializeCurrentFieldTextVariants() throws Exception { String json = \"\"\" { \"name\": \"field-text-document\", \"texts\": [ { \"self_ref\": \"#/texts/0\", \"content_layer\": \"body\", \"label\": \"field_heading\", \"orig\": \"Account\", \"text\": \"Account\", \"level\": 2, \"source\": [ { \"kind\": \"track\", \"start_time\": 0.0, \"end_time\": 1.0 } ], \"comments\": [ { \"$ref\": \"#/texts/2\", \"range\": [0, 4] } ] }, { \"self_ref\": \"#/texts/1\", \"content_layer\": \"body\", \"label\": \"field_value\", \"orig\": \"12345\", \"text\": \"12345\", \"kind\": \"fillable\" } ] } \"\"\"; DoclingDocument document = MAPPER.readValue(json, DoclingDocument.class); assertThat(document.getTexts()).hasSize(2); assertThat(document.getTexts().get(0)) .isInstanceOfSatisfying( DoclingDocument.FieldHeadingItem.class, heading -> { assertThat(heading.getLevel()).isEqualTo(2); assertThat(heading.getSource().get(0)).isInstanceOf(DoclingDocument.TrackSource.class); assertThat(heading.getComments().get(0).getRange()).containsExactly(0, 4); }); assertThat(document.getTexts().get(1)) .isInstanceOfSatisfying( DoclingDocument.FieldValueItem.class, value -> { assertThat(value.getKind()).isEqualTo(\"fillable\"); assertThat(value.getLabel()).isEqualTo(DocItemLabel.FIELD_VALUE); }); }", "tokens": 370} {"id": 149787, "source": "method", "repo": "docling-project/docling-java", "text": "/** Creates a new builder initialized with the options explicitly set on this configuration. Options left at their default here are still considered not explicitly set on the returned builder. @return a new builder initialized from this configuration */ public DoclingServeApiBuilder toBuilder() { return new DoclingServeApiBuilder(this.values); }", "tokens": 61} {"id": 149828, "source": "method", "repo": "docling-project/docling-java", "text": "public DoclingServeApi create(DoclingServeApiConfig config) { return create(this.factory, config); }", "tokens": 21} {"id": 149904, "source": "method", "repo": "docling-project/docling-java", "text": "/** Constructs a new ValidationException with the specified ValidationError and message. This constructor allows the exception to encapsulate a {@link ValidationError} object for providing detailed information about the validation error that occurred, along with an optional custom message describing the error context. @param validationError the {@link ValidationError} containing validation error details, or null if no specific validation error details are provided. @param message the custom message for the exception, or null if no custom message is to be associated with this exception. */ public ValidationException(@Nullable ValidationError validationError, @Nullable String message) { this(validationError, null, message); }", "tokens": 123} {"id": 150053, "source": "method", "repo": "docling-project/docling-java", "text": "void bucketRequired() { assertThatThrownBy(() -> FULL_SOURCE.toBuilder().bucket(null).build()) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining(\"bucket is marked non-null but is null\"); }", "tokens": 50} {"id": 150105, "source": "method", "repo": "docling-project/docling-java", "text": "void allConcreteSubtypesAreDistinguishableViaInstanceOf() { List responses = List.of( InBodyConvertDocumentResponse.builder().build(), PreSignedUrlConvertDocumentResponse.builder().build(), PreSignedUrlConvertResponse.builder() .build(), ZipArchiveConvertDocumentResponse.builder().build(), ChunkDocumentResponse.builder().build()); var results = responses.stream() .map(ProcessedDocumentResponseTests::classifyResponse) .toList(); assertThat(results).containsExactly( \"in-body\", \"pre-signed-url\", \"pre-signed-url-response\", \"zip-archive\", \"chunk\"); }", "tokens": 136} {"id": 150215, "source": "method", "repo": "docling-project/docling-java", "text": "/** {@inheritDoc} @throws IllegalStateException if neither Jackson 2 nor Jackson 3 is on the classpath */ public DoclingServeApi create(DoclingServeApiConfig config) { return DoclingServeClient.builder() .config(config) .build(); }", "tokens": 51} {"id": 150390, "source": "method", "repo": "docling-project/docling-java", "text": "void newBuilderUsesTheGivenClassLoader() { var classLoader = new ClassHidingClassLoader(\"tools.jackson.databind.json.JsonMapper\"); assertThat(DoclingServeClientBuilderFactory.newBuilder(classLoader)) .isExactlyInstanceOf(DoclingServeJackson2Client.Builder.class); }", "tokens": 65} {"id": 150629, "source": "method", "repo": "docling-project/docling-java", "text": "void handlesResults(@TempDir Path tempDir) throws IOException { var results = getAndAssertSampleResults(); this.handler.handleResults(results, tempDir); var outputFile = tempDir.resolve(\"results.md\"); assertThat(EXPECTED_RESUTLS).exists(); assertThat(outputFile) .exists() .hasContent(Files.readString(EXPECTED_RESUTLS)); }", "tokens": 77} {"id": 150785, "source": "method", "repo": "docusign/docusign-esign-java-client", "text": "/** setSignatureProviders. */ public void setSignatureProviders(java.util.List signatureProviders) { this.signatureProviders = signatureProviders; }", "tokens": 36} {"id": 150944, "source": "method", "repo": "docusign/docusign-esign-java-client", "text": "/** Metadata that indicates whether the `anchorMatchWholeWord` property is editable.. @return anchorMatchWholeWordMetadata */ public PropertyMetadata getAnchorMatchWholeWordMetadata() { return anchorMatchWholeWordMetadata; }", "tokens": 45} {"id": 150999, "source": "method", "repo": "docusign/docusign-esign-java-client", "text": "/** disableAutoSize. @return Email */ public Email disableAutoSize(String disableAutoSize) { this.disableAutoSize = disableAutoSize; return this; }", "tokens": 36} {"id": 151477, "source": "method", "repo": "dodie/scott", "text": "/** Perform the given instrumentation actions on a class. @param classfileBuffer class to be transformed @param instrumentationActions instrumentation actions to be applied @return instrumented class */ private byte[] transform(byte[] classfileBuffer, InstrumentationActions instrumentationActions) { ClassReader classReader = new ClassReader(classfileBuffer); ClassWriter classWriter = new ClassWriter(classReader, ClassWriter.COMPUTE_FRAMES); ClassVisitor localVariableStateEmitterTestClassVisitor = new StateTrackingClassVisitor(classWriter, instrumentationActions); classReader.accept(localVariableStateEmitterTestClassVisitor, 0); return classWriter.toByteArray(); }", "tokens": 121} {"id": 151631, "source": "method", "repo": "dodie/scott", "text": "public SortedMap getSourceLines() { return sourceForLineNumbers; }", "tokens": 19} {"id": 151695, "source": "method", "repo": "dodie/scott", "text": "public void a_calculator() { calculator = new Calculator(); }", "tokens": 15} {"id": 151723, "source": "method", "repo": "dodie/scott", "text": "public void testWithMessageSupplier() { String first = \"Hello\"; String last = \"World\"; String concatenated = first + \" \" + last; assertEquals(\"Goodbye World\", concatenated, () -> \"Incorrect message.\"); }", "tokens": 49} {"id": 151986, "source": "method", "repo": "doist/recyclerviewextensions", "text": "public void onItemRangeRemoved(int positionStart, int itemCount) { adapter.notifyItemRangeRemoved(positionStart, itemCount); }", "tokens": 26} {"id": 152041, "source": "method", "repo": "doist/recyclerviewextensions", "text": "public boolean animateAdd(final ViewHolder holder) { resetAnimation(holder); holder.itemView.setAlpha(0); mPendingAdditions.add(holder); return true; }", "tokens": 38} {"id": 152495, "source": "method", "repo": "dounine/japi", "text": "public File getPackageFold() { return packageFold; }", "tokens": 13} {"id": 152543, "source": "method", "repo": "dounine/japi", "text": "public String getRequestParamName() { return \"org.hibernate.validator.constraints.Email\"; }", "tokens": 21} {"id": 152650, "source": "method", "repo": "DragonKingpin/Hydra", "text": "public void updateLinkTag( GUID tagGuid, String tagName ) { this.mImperialTree.updateLinkTagName( tagGuid, tagName ); }", "tokens": 35} {"id": 153058, "source": "method", "repo": "DragonKingpin/Hydra", "text": "public static RemoteImageResolutionMode parse( String szMode ) { if ( szMode == null || szMode.isEmpty() ) { return REQUIRE_SERVER_IMAGE; } try { return RemoteImageResolutionMode.valueOf( szMode ); } catch ( IllegalArgumentException e ) { return REQUIRE_SERVER_IMAGE; } }", "tokens": 72} {"id": 153073, "source": "method", "repo": "DragonKingpin/Hydra", "text": "default int queryCompiledIfaceCount() { return 0; }", "tokens": 14} {"id": 153248, "source": "method", "repo": "DragonKingpin/Hydra", "text": "/** @throws ClassCastException {@inheritDoc} @throws NullPointerException if {@code fromKey} is null and this map uses natural ordering, or its comparator does not permit null keys @throws IllegalArgumentException {@inheritDoc} */ public SortedMap tailMap(K fromKey) { return tailMap(fromKey, true); }", "tokens": 69} {"id": 153275, "source": "method", "repo": "DragonKingpin/Hydra", "text": "public Set > bottomEntrySet(){ return this.getMap().treeEntrySet(); }", "tokens": 25} {"id": 153389, "source": "method", "repo": "DragonKingpin/Hydra", "text": "default int compareTo( MinMaxRange o ) { if ( this == o ) { return 0; } if ( o == null ) { return 1; } Number min = this.getMin(); if( min instanceof Double || min instanceof Float ) { int minCompare = Double.compare( this.getMin().doubleValue(), o.getMin().doubleValue() ); if ( minCompare != 0 ) { return minCompare; } return Double.compare( this.getMax().doubleValue(), o.getMax().doubleValue() ); } else if( min instanceof Integer || min instanceof Long || min instanceof Short || min instanceof Byte ) { int minCompare = Long.compare( this.getMin().longValue(), o.getMin().longValue() ); if ( minCompare != 0 ) { return minCompare; } return Long.compare( this.getMax().longValue(), o.getMax().longValue() ); } else if( min instanceof BigInteger ) { int minCompare = ( (BigInteger)this.getMin() ).compareTo( (BigInteger)o.getMin() ); if ( minCompare != 0 ) { return minCompare; } return ( (BigInteger)this.getMax() ).compareTo( (BigInteger)o.getMax() ); } else if( min instanceof BigDecimal ) { int minCompare = ( (BigDecimal)this.getMin() ).compareTo( (BigDecimal)o.getMin() ); if ( minCompare != 0 ) { return minCompare; } return ( (BigDecimal)this.getMax() ).compareTo( (BigDecimal)o.getMax() ); } throw new IllegalArgumentException( \"Unknown number to compare.\" ); }", "tokens": 355} {"id": 153485, "source": "method", "repo": "DragonKingpin/Hydra", "text": "protected void tryConsumeById( long id ) throws LootRecoveredException, LootAbortException, IllegalStateException {}", "tokens": 26} {"id": 153633, "source": "method", "repo": "draquet/polyglot", "text": "private void setupListeners() { final JTextField textField = (JTextField) this.getEditor().getEditorComponent(); final PComboBox self = this; this.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent e) { if (self.isEnabled()) { self.setEditable(true); if (lastSetValue != null) { textField.setText(lastSetValue.toString()); } } } @Override public void focusLost(FocusEvent e) { // do nothing } }); textField.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent e) { if (self.isEnabled()) { self.showPopup(); } } @Override public void focusLost(FocusEvent e) { if (self.isEnabled()) { self.setEditable(false); var text = textField.getText(); var priorSelection = self.getSelectedItem(); for (var i = 0; i < self.getItemCount(); i++) { var item = self.getItemAt(i); if (text.equals(item.toString())) { self.setSelectedItem(item); return; } } if (priorSelection != null) { textField.setText(priorSelection.toString()); } else { textField.setText(\"\"); comboFilter(\"\", defaultText); hidePopup(); } self.setSelectedItem(priorSelection); } } }); textField.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent ke) { // no arrow keys are only selection events var keyCode = ke.getKeyCode(); if ((keyCode & KeyEvent.VK_DOWN) == KeyEvent.VK_DOWN || (keyCode & KeyEvent.VK_UP) == KeyEvent.VK_UP || (keyCode & KeyEvent.VK_RIGHT) == KeyEvent.VK_RIGHT || (keyCode & KeyEvent.VK_LEFT) == KeyEvent.VK_LEFT) { return; } final var priorSelection = self.getSelectedItem(); SwingUtilities.invokeLater(() -> { var priorString = priorSelection == null ? \"\" : priorSelection.toString(); comboFilter(textField.getText(), priorString); }); } }); }", "tokens": 439} {"id": 153678, "source": "method", "repo": "draquet/polyglot", "text": "/** Adds column width from parents. Recursive. @param curNode */ private void calcColumnWidthParents(EtymologyPrintingNode curNode) { Integer curDepth = curNode.depth; Integer mySize; if (curNode.isExternal ) { int wordSize = charisFontMetrics.stringWidth(curNode.word.getValue()); int originSize = charisFontMetrics.stringWidth(((EtyExternalParent)curNode.word).getExternalLanguage()); mySize = (Math.max(wordSize, originSize)) + X_WORD_SPACE_BUFFER; } else { mySize = conFontMetrics.stringWidth(curNode.word.getValue()) + X_WORD_SPACE_BUFFER; } if (columnWidth.containsKey(curDepth)) { // the maximum width of each depth is saved, as each is one \"column\" in the visual display Integer depthSize = columnWidth.get(curDepth); if (mySize > depthSize) { columnWidth.replace(curDepth, mySize); } } else { columnWidth.put(curDepth, mySize); } curNode.parents.forEach((parentNode) -> { calcColumnWidthParents(parentNode); }); }", "tokens": 263} {"id": 153708, "source": "method", "repo": "draquet/polyglot", "text": "void fireCheckChangeEvent(CheckChangeEvent evt) { Object[] listeners = listenerList.getListenerList(); for (int i = 0; i < listeners.length; i++) { if (listeners[i] == CheckChangeEventListener.class) { ((CheckChangeEventListener) listeners[i + 1]).checkStateChanged(evt); } } }", "tokens": 74} {"id": 153806, "source": "method", "repo": "draquet/polyglot", "text": "/** Returns true if language has changed state since last load @return */ public boolean hasChanged() { return loadState != null && !this.equals(loadState); }", "tokens": 36} {"id": 153878, "source": "method", "repo": "draquet/polyglot", "text": "protected String[] getFontStyleNames() { if (fontStyleNames == null) { int i = 0; fontStyleNames = new String[4]; fontStyleNames[i++] = (\"Plain\"); fontStyleNames[i++] = (\"Bold\"); fontStyleNames[i++] = (\"Italic\"); fontStyleNames[i++] = (\"BoldItalic\"); } return fontStyleNames; }", "tokens": 85} {"id": 153958, "source": "method", "repo": "draquet/polyglot", "text": "/** Returns all stored compositional syllable values. Order not guaranteed. @return */ public String[] getSyllables() { return syllables.toArray(String[]::new); }", "tokens": 42} {"id": 153990, "source": "method", "repo": "draquet/polyglot", "text": "public void popBuffer() { bufferNode = bufferNode.getParent(); }", "tokens": 16} {"id": 154030, "source": "method", "repo": "draquet/polyglot", "text": "public boolean isDimensionless() { return dimensionless; }", "tokens": 13} {"id": 154043, "source": "method", "repo": "draquet/polyglot", "text": "public void addNode(FamNode _node) { subNodes.add(_node); }", "tokens": 23} {"id": 154046, "source": "method", "repo": "draquet/polyglot", "text": "public String toString() { return shortDescription; }", "tokens": 11} {"id": 154293, "source": "method", "repo": "draquet/polyglot", "text": "private void btnDownRomActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDownRomActionPerformed saveAllValues(); moveRomDown(); }", "tokens": 37} {"id": 154340, "source": "method", "repo": "draquet/polyglot", "text": "private void setupMenu() { lblBaseWord.setText(word.getValue()); lblBaseWord.setFont(txtWordForm.getFont()); txtWordForm.setText(word.getValue()); setupDropdowns(); setupSize(); composeWord(); }", "tokens": 50} {"id": 154375, "source": "method", "repo": "draquet/polyglot", "text": "/** Cheap iterative implementation of a power law: our chances of staying at a bin are pct %. @param max @param pct if this is over 100, this will run forever @return */ private int powerLaw(int max, int pct) { for (int r = 0; true; r = (r + 1) % max) { int randomPercent = (int) Math.floor(Math.random() * 101); if (randomPercent < pct) { return r; } } }", "tokens": 122} {"id": 154458, "source": "method", "repo": "draquet/polyglot", "text": "public void testHashCode() { // just make sure it doesn't explode. testNode.hashCode(); }", "tokens": 24} {"id": 154459, "source": "method", "repo": "draquet/polyglot", "text": "public void testNotEquals() { System.out.println(\"EtyExternalParentTest.testEquals\"); EtyExternalParent copy = new EtyExternalParent(); copy.setDefinition(\"DEFINITION\"); copy.setExternalLanguage(\"ZOTTOPIA\"); copy.setValue(\"BADVALUEZZZZ\"); assertNotEquals(copy, testParent); }", "tokens": 69} {"id": 154460, "source": "method", "repo": "draquet/polyglot", "text": "public void testNotContainsReading() { System.out.println(\"LogoNodeTest.testContainsReading\"); assertFalse(logoTest.containsReading(\"I say good sir, are you literate?\", true)); }", "tokens": 47} {"id": 154507, "source": "method", "repo": "dreamhead/moco", "text": "public static HttpsServer httpsServer(final int port, final HttpsCertificate certificate, final MocoConfig... configs) { checkArgument(port > 0, \"Port must be greater than zero\"); return ActualHttpServer.createHttpsQuietServer(port, requireNonNull(certificate, \"Certificate should not be null\"), requireNonNull(configs, \"Configuration should not be null\")); }", "tokens": 78} {"id": 154621, "source": "method", "repo": "dreamhead/moco", "text": "private QueryStringEncoder getQueryStringEncoder(final com.github.dreamhead.moco.HttpRequest request, final String actual) { QueryStringEncoder encoder = new QueryStringEncoder(actual); for (Map.Entry entry : request.getQueries().entrySet()) { for (String value : entry.getValue()) { encoder.addParam(entry.getKey(), value); } } return encoder; }", "tokens": 88} {"id": 154632, "source": "method", "repo": "dreamhead/moco", "text": "private void writeCorsResponse(final HttpRequest httpRequest, final MutableHttpResponse httpResponse, final Predicate requestPredicate, final boolean isQualified) { List filteredConfigs = Arrays.stream(configs) .filter(requestPredicate) .toList(); if (isQualified && !filteredConfigs.stream().allMatch(config -> config.isQualified(httpRequest))) { return; } for (CorsConfig config : filteredConfigs) { config.configure(httpResponse); } }", "tokens": 101} {"id": 154659, "source": "method", "repo": "dreamhead/moco", "text": "public final T response(final String content) { return this.response(text(checkNotNullOrEmpty(content, \"Content should not be null\"))); }", "tokens": 31} {"id": 154787, "source": "method", "repo": "dreamhead/moco", "text": "private boolean doMatchHeaders(final Map thisField, final Map thatField) { if (thisField == null || thisField.isEmpty()) { return true; } Map thisEnhanced = new HashMap<>(); for (String key : thisField.keySet()) { thisEnhanced.put(key.toLowerCase(), thisField.get(key)); } Map thatEnhanced = new HashMap<>(); for (String key : thatField.keySet()) { thatEnhanced.put(key.toLowerCase(), thatField.get(key)); } return thisEnhanced.entrySet().stream() .noneMatch(entry -> notMatchHeaderMapValue(entry.getValue(), thatEnhanced.get(entry.getKey()))); }", "tokens": 157} {"id": 154835, "source": "method", "repo": "dreamhead/moco", "text": "public final String id() { return identifiable.id(); }", "tokens": 14} {"id": 154861, "source": "method", "repo": "dreamhead/moco", "text": "private double random() { final Long startValue = start.orElse(0L); final Long endValue = end.orElse(1L); final long range = endValue - startValue; return startValue + new Random().nextDouble() * range; }", "tokens": 53} {"id": 154884, "source": "method", "repo": "dreamhead/moco", "text": "private void doStop() { if (future != null) { future.channel().close().syncUninterruptibly(); future = null; } if (group != null) { Future groupFuture = group.shutdownGracefully(0, 0, TimeUnit.SECONDS); try { groupFuture.get(); } catch (Exception e) { throw new IllegalStateException(e); } group = null; } }", "tokens": 82} {"id": 154973, "source": "method", "repo": "dreamhead/moco", "text": "public void should_support_cors_with_methods() throws Exception { server.response(cors(allowOrigin(\"https://www.github.com\"), allowMethods(\"PUT\"))); running(server, () -> { ClassicHttpResponse response = helper.putForResponseWithHeaders(root(), \"\", of(\"Origin\", \"https://www.github.com\")); assertThat(response.getHeader(\"Access-Control-Allow-Methods\").getValue(), is(\"PUT\")); }); }", "tokens": 98} {"id": 155091, "source": "method", "repo": "dreamhead/moco", "text": "public void should_return_default_content_type() throws Exception { server.response(with(\"foo\")); running(server, () -> { Header header = helper.getResponse(root()).getFirstHeader(HttpHeaders.CONTENT_TYPE); assertThat(header.getValue(), is(\"text/plain; charset=utf-8\")); }); }", "tokens": 71} {"id": 155138, "source": "method", "repo": "dreamhead/moco", "text": "public CloseableHttpClient getClient() { return client; }", "tokens": 11} {"id": 155216, "source": "method", "repo": "dreamhead/moco", "text": "private static InputStream toStream(final Resource resource) { return requireNonNull(resource, \"resource should not be null\").readFor((Request) null).toInputStream(); }", "tokens": 37} {"id": 155308, "source": "method", "repo": "dreamhead/moco", "text": "public final ResponseElement getResponseHandler() { if (text != null) { return with(template(text)); } return this.setting.getResponseHandler(); }", "tokens": 33} {"id": 155356, "source": "method", "repo": "dreamhead/moco", "text": "public final void run() { this.runner.run(); this.watcher.start(); }", "tokens": 20} {"id": 155381, "source": "method", "repo": "dreamhead/moco", "text": "public void should_fire_event_with_post_json(@TempDir final Path folder) throws IOException { runWithConfiguration(\"event.json\"); File file = folder.resolve(\"tempfile\").toFile(); System.setOut(new PrintStream(file)); assertThat(helper.get(remoteUrl(\"/event-with-json-post\")), is(\"post_json_foo\")); idle(IDLE, TimeUnit.MILLISECONDS); assertThat(Files.readString(file.toPath(), Charset.defaultCharset()), containsString(\"0XMOCOJSON\")); }", "tokens": 107} {"id": 155442, "source": "method", "repo": "dreamhead/moco", "text": "public void should_return_expected_response_based_on_specified_xml_file_request() throws IOException { runWithConfiguration(\"xml.json\"); assertThat(helper.postFile(remoteUrl(\"/xmlfile\"), \"foo.xml\"), is(\"response_for_xml_file_request\")); }", "tokens": 64} {"id": 155730, "source": "method", "repo": "dreamlike-ocean/panamauring", "text": "public static CancelableFuture> asyncMadive(IoUringEventLoop ioUringEventLoop, MemorySegment base, int advise) { if (!base.isMapped()) { throw new IllegalArgumentException(\"base pointer must be mapped!\"); } if (base.byteSize() == 0) { throw new IllegalArgumentException(\"size must greater than zero\"); } return asyncMadiveDirect(ioUringEventLoop, base, advise); }", "tokens": 90} {"id": 155795, "source": "method", "repo": "dreamlike-ocean/panamauring", "text": "public void drop() { freeHandle.close(); }", "tokens": 12} {"id": 155982, "source": "method", "repo": "dreamlike-ocean/panamauring", "text": "public int getHead() { return head; }", "tokens": 11} {"id": 156072, "source": "method", "repo": "dreamlike-ocean/panamauring", "text": "public long getOffset() { VarHandle varHandle = IoUringConstant.AccessShortcuts.IOURING_SQE_OFFSET_VARHANDLE; MemorySegment memory = ((NativeStructEnhanceMark) this).realMemory(); return (long) varHandle.get(memory, 0L); }", "tokens": 64} {"id": 156077, "source": "method", "repo": "dreamlike-ocean/panamauring", "text": "public void setFlagsInFlagsUnion(int rwFlags) { VarHandle varHandle = IoUringConstant.AccessShortcuts.IO_URING_SQE_RW_FLAGS_VARHANDLE; MemorySegment memory = ((NativeStructEnhanceMark) this).realMemory(); varHandle.set(memory, 0L, rwFlags); }", "tokens": 76} {"id": 156084, "source": "method", "repo": "dreamlike-ocean/panamauring", "text": "public long getSpliceOffIn() { VarHandle varHandle = IoUringConstant.AccessShortcuts.IO_URING_SPLICE_OFF_IN_VARHANDLE; MemorySegment memory = ((NativeStructEnhanceMark) this).realMemory(); return (long) varHandle.get(memory, 0L); }", "tokens": 70} {"id": 156149, "source": "method", "repo": "dreamlike-ocean/panamauring", "text": "public void setAddr3(long addr3) { this.addr3 = addr3; }", "tokens": 21} {"id": 156248, "source": "method", "repo": "dreamlike-ocean/panamauring", "text": "private static T toExternal(T value) { assert value != null : \"null is not a legitimate internal value. Concurrent Modification?\"; return value == NULL_VALUE ? null : value; }", "tokens": 45} {"id": 156508, "source": "method", "repo": "Drive-for-Java/MyCMD", "text": "public String description() { return \"Renames a file or directory.\"; }", "tokens": 17} {"id": 156944, "source": "method", "repo": "dromara/forest", "text": "public void testRequest_async_retryWhen_success() throws InterruptedException { server.enqueue(new MockResponse().setBody(EXPECTED).setResponseCode(203)); server.enqueue(new MockResponse().setBody(EXPECTED).setResponseCode(203)); server.enqueue(new MockResponse().setBody(EXPECTED).setResponseCode(203)); server.enqueue(new MockResponse().setBody(EXPECTED).setResponseCode(203)); CountDownLatch latch = new CountDownLatch(1); AtomicBoolean isSuccess = new AtomicBoolean(false); AtomicInteger atomicRetryCount = new AtomicInteger(0); ForestRequest request = Forest.get(\"http://localhost\") .port(server.getPort()) .async() .maxRetryCount(3) .retryWhen(((req, res) -> res.statusIs(203))) .onRetry(((req, res) -> { atomicRetryCount.incrementAndGet(); })) .onSuccess(((data, req, res) -> { isSuccess.set(true); latch.countDown(); })); request.execute(); latch.await(); assertThat(atomicRetryCount.get()).isEqualTo(3); assertThat(request.getCurrentRetryCount()).isEqualTo(3); assertThat(isSuccess.get()).isTrue(); }", "tokens": 258} {"id": 156957, "source": "method", "repo": "dromara/forest", "text": "public void testDefault() { ForestConfiguration configuration = ForestConfiguration.createConfiguration(); assertEquals(\"forestConfiguration\" + configuration.hashCode(), configuration.getId()); assertEquals(Integer.valueOf(3000), configuration.getTimeout()); assertEquals(null, configuration.getConnectTimeout()); assertEquals(null, configuration.getReadTimeout()); assertEquals(Integer.valueOf(500), configuration.getMaxConnections()); assertEquals(Integer.valueOf(500), configuration.getMaxRouteConnections()); assertNotNull(configuration.getJsonConverter()); }", "tokens": 105} {"id": 156973, "source": "method", "repo": "dromara/forest", "text": "public long getSint64Val() { return sint64Val; }", "tokens": 19} {"id": 156976, "source": "method", "repo": "dromara/forest", "text": "public void testVariableUndefinedException() { ForestVariableUndefinedException exception = new ForestVariableUndefinedException(\"foo\", MappingTemplate.create(\"{foo}\")); // assertThat(exception.getMessage()).isEqualTo(\"Cannot resolve variable 'foo'\"); assertThat(exception.getVariableName()).isEqualTo(\"foo\"); assertThat(exception.getSource()).isNotNull(); exception = new ForestVariableUndefinedException(\"bar\", MappingTemplate.create(\"foo=${bar}\")); exception.printStackTrace(); assertThat(exception.getMessage().replaceAll(\"\u001b\\\\[\\\\d(\\\\d)?m\", \"\")) .isEqualTo(\"Cannot resolve variable 'bar'\\n\" + \"\\n\" + \"\\t[From Template]\\n\" + \"\\n\" + \"\\tsource: foo=${bar}\\n\"); assertThat(exception.getVariableName()).isEqualTo(\"bar\"); assertThat(exception.getSource()).isEqualTo(\"foo=${bar}\"); }", "tokens": 178} {"id": 157129, "source": "method", "repo": "dromara/forest", "text": "public T convertToJavaObject(byte[] source, Type targetType, Charset charset) { Class clazz = ReflectUtils.toClass(targetType); return (T) convertToJavaObject(source, clazz, charset); }", "tokens": 48} {"id": 157138, "source": "method", "repo": "dromara/forest", "text": "public MockHttpServletRequest(InputStream inputStream, long length, String contentType) { this.inputStream = inputStream; this.length = length; this.contentType = contentType; this.headers.put(FileUploadBase.CONTENT_TYPE, contentType); }", "tokens": 49} {"id": 157347, "source": "method", "repo": "dromara/neutrino-proxy", "text": "public void register(AppContext context, RuntimeNativeMetadata metadata) { Set> channelInboundClasses = ClassUtil.scanPackageBySuper(\"org.dromara.neutrinoproxy\", SimpleChannelInboundHandler.class); for (Class clazz : channelInboundClasses) { metadata.registerReflection(clazz, MemberCategory.INVOKE_DECLARED_METHODS); } Set> byteBufferClasses = ClassUtil.scanPackageBySuper(\"java\", ByteBuffer.class); for (Class clazz : byteBufferClasses) { metadata.registerReflection(clazz, MemberCategory.INVOKE_DECLARED_METHODS); } metadata.registerReflection(ProxyMessage.class, MemberCategory.DECLARED_FIELDS, MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS); metadata.registerReflection(ProxyMessage.UdpBaseInfo.class, MemberCategory.DECLARED_FIELDS, MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS); metadata.registerArg(\"-J--add-opens=java.base/java.lang.invoke=ALL-UNNAMED\"); metadata.registerArg(\"-J--add-opens=java.base/java.nio=ALL-UNNAMED\"); metadata.registerArg(\"-J--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED\"); metadata.registerArg(\"-march=compatibility\"); }", "tokens": 317} {"id": 157550, "source": "method", "repo": "dromara/neutrino-proxy", "text": "default LicenseDO checkRepeat(Integer userId, String name) { return this.selectOne(new LambdaQueryWrapper() .eq(LicenseDO::getUserId, userId) .eq(LicenseDO::getName, name) .last(\"limit 1\") ); }", "tokens": 60} {"id": 157603, "source": "method", "repo": "dromara/neutrino-proxy", "text": "public Metrics getMetrics() { Metrics metrics = new Metrics(); metrics.setChannels(channels.get()); metrics.setPort(port); metrics.setReadBytes(readBytes.get()); metrics.setWroteBytes(writeBytes.get()); metrics.setTimestamp(System.currentTimeMillis()); metrics.setReadMsgs(readMsgs.get()); metrics.setWroteMsgs(wroteMsgs.get()); return metrics; }", "tokens": 91} {"id": 157820, "source": "method", "repo": "dromara/skyeye", "text": "private long estimateTokens(String text) { if (StrUtil.isBlank(text)) { return 0L; } return Math.max(1L, (text.length() + 1L) / 2L); }", "tokens": 49} {"id": 157821, "source": "method", "repo": "dromara/skyeye", "text": "public void queryAiApiKeyList(InputObject inputObject, OutputObject outputObject) { aiApiKeyService.queryList(inputObject, outputObject); }", "tokens": 27} {"id": 157905, "source": "method", "repo": "dromara/skyeye", "text": "public List> queryPageDataList(InputObject inputObject) { CommonPageInfo commonPageInfo = getPageObject(inputObject); commonPageInfo.setState(String.valueOf(EmailState.NORMAL.getKey())); List> beans = skyeyeBaseMapper.queryEmailListByEmailId(commonPageInfo); return beans; }", "tokens": 73} {"id": 158014, "source": "method", "repo": "dromara/skyeye", "text": "public void publishBomVersionById(InputObject inputObject, OutputObject outputObject) { bomService.publishVersionById(inputObject, outputObject); }", "tokens": 27} {"id": 158068, "source": "method", "repo": "dromara/skyeye", "text": "public void writeRequisitionOutLet(InputObject inputObject, OutputObject outputObject) { requisitionOutLetService.saveOrUpdateEntity(inputObject, outputObject); }", "tokens": 34} {"id": 158210, "source": "method", "repo": "dromara/skyeye", "text": "private static byte[] hmac256(byte[] key, String msg) throws Exception { Mac mac = Mac.getInstance(\"HmacSHA256\"); SecretKeySpec secretKeySpec = new SecretKeySpec(key, mac.getAlgorithm()); mac.init(secretKeySpec); return mac.doFinal(msg.getBytes(StandardCharsets.UTF_8)); }", "tokens": 69} {"id": 158326, "source": "method", "repo": "dromara/skyeye", "text": "public void writePostpose(CouponUse couponUse, String userId) { if (ObjectUtil.isNotEmpty(couponUse.getCouponUseMaterialList())) { couponUse.getCouponUseMaterialList().forEach(couponMaterial -> couponMaterial.setCouponId(couponUse.getId())); couponUseMaterialService.createEntity(couponUse.getCouponUseMaterialList(), userId); } }", "tokens": 84} {"id": 158353, "source": "method", "repo": "dromara/skyeye", "text": "public void updatePostShareNum(String postId, int num) { Post post = selectById(postId); int shareNum = Integer.parseInt(post.getShareNum()) + num; post.setShareNum(String.valueOf(shareNum)); updateById(post); refreshCache(postId); }", "tokens": 67} {"id": 158486, "source": "method", "repo": "dromara/tlog", "text": "private static void trimToMaxSize(final StringBuilder stringBuilder) { StringBuilders.trimToMaxSize(stringBuilder, Constants.MAX_REUSABLE_MESSAGE_SIZE); }", "tokens": 36} {"id": 158572, "source": "method", "repo": "dromara/tlog", "text": "/** Constructs a request object wrapping the given request. @param request The request to wrap @throws IllegalArgumentException if the request is null */ public RequestWrapper(HttpServletRequest request) { super(request); String bodyStr = getBodyString(request); body = bodyStr.getBytes(Charset.defaultCharset()); }", "tokens": 63} {"id": 158658, "source": "method", "repo": "dropbox/dropbox-sdk-java", "text": "private static String encodeUrlParams(/*@Nullable*/String userLocale, /*@Nullable*/String/*@Nullable*/[] params) { StringBuilder buf = new StringBuilder(); String sep = \"\"; if (userLocale != null) { buf.append(\"locale=\").append(encodeUrlParam(userLocale)); sep = \"&\"; } if (params != null) { if (params.length % 2 != 0) { throw new IllegalArgumentException(\"'params.length' is \" + params.length + \"; expecting a multiple of two\"); } for (int i = 0; i < params.length; ) { String key = params[i]; String value = params[i+1]; if (key == null) throw new IllegalArgumentException(\"params[\" + i + \"] is null\"); if (value != null) { buf.append(sep); sep = \"&\"; buf.append(encodeUrlParam(key)); buf.append(\"=\"); buf.append(encodeUrlParam(value)); } i += 2; } } return buf.toString(); }", "tokens": 221} {"id": 158678, "source": "method", "repo": "dropbox/dropbox-sdk-java", "text": "public static T doPostNoAuth(final DbxRequestConfig requestConfig, final String sdkUserAgentIdentifier, final String host, final String path, final /*@Nullable*/String/*@Nullable*/[] params, final /*@Nullable*/List headers, final ResponseHandler handler) throws DbxException { return runAndRetry(requestConfig.getMaxRetries(), new RequestMaker() { @Override public T run() throws DbxException { HttpRequestor.Response response = startPostNoAuth(requestConfig, sdkUserAgentIdentifier, host, path, params, headers); return finishResponse(response, handler); } }); }", "tokens": 135} {"id": 158851, "source": "method", "repo": "dropbox/dropbox-sdk-java", "text": "public T readFromTags(String[] tags, JsonParser parser) throws IOException, JsonReadException { return null; // Must override for struct }", "tokens": 29} {"id": 159071, "source": "method", "repo": "dropbox/dropbox-sdk-java", "text": "protected void dumpFields(DumpWriter out) { out.f(\"familiarName\").v(familiarName); out.f(\"givenName\").v(givenName); out.f(\"surname\").v(surname); }", "tokens": 52} {"id": 159286, "source": "method", "repo": "dropbox/dropbox-sdk-java", "text": "public void testStateWithNoRedirect() { DbxWebAuth.newRequestBuilder() .withNoRedirect() .withState(\"foo-state\") .build(); }", "tokens": 34} {"id": 159287, "source": "method", "repo": "dropbox/dropbox-sdk-java", "text": "public void testTokenAccessType() throws Exception { DbxWebAuth dbxWebAuth = new DbxWebAuth(CONFIG, APP); DbxWebAuth.Request request = DbxWebAuth.newRequestBuilder() .withNoRedirect() .withTokenAccessType(TokenAccessType.ONLINE) .build(); String urlString = dbxWebAuth.authorize(request); Map> params = toParamsMap(new URL(urlString)); assertThat(params.get(\"token_access_type\")).isEqualTo(Collections.singletonList(\"online\")); request = DbxWebAuth.newRequestBuilder() .withNoRedirect() .withTokenAccessType(TokenAccessType.OFFLINE) .build(); urlString = dbxWebAuth.authorize(request); params = toParamsMap(new URL(urlString)); assertThat(params.get(\"token_access_type\")).isEqualTo(Collections.singletonList(\"offline\")); }", "tokens": 186} {"id": 159461, "source": "method", "repo": "dropbox/dropbox-sdk-java", "text": "private DbxWebAuth getWebAuth(final HttpServletRequest request) { return new DbxWebAuth(common.getRequestConfig(request), common.dbxAppInfo); }", "tokens": 32} {"id": 159555, "source": "method", "repo": "ds58/panilla", "text": "public NbtCheckResult check(INbtTagCompound tag, String itemName, IPanilla panilla) { return NbtCheckResult.FAIL; }", "tokens": 25} {"id": 159614, "source": "method", "repo": "ds58/panilla", "text": "public NbtCheckResult check(INbtTagCompound tag, String itemName, IPanilla panilla) { if (panilla.getPConfig().preventFaweBrushNbt) { return NbtCheckResult.FAIL; } else { return NbtCheckResult.PASS; } }", "tokens": 51} {"id": 159630, "source": "method", "repo": "ds58/panilla", "text": "public NbtCheck_CustomName() { super(\"minecraft:custom_name\", PStrictness.LENIENT); }", "tokens": 25} {"id": 159715, "source": "method", "repo": "ds58/panilla", "text": "public Set getKeys() { return handle.c(); }", "tokens": 16} {"id": 159767, "source": "method", "repo": "ds58/panilla", "text": "public INbtTagCompound getCompound(String key) { return new NbtTagCompound(handle.p(key)); }", "tokens": 23} {"id": 159770, "source": "method", "repo": "ds58/panilla", "text": "public INbtTagCompound getCompound(int index) { return new NbtTagCompound(handle.a(index)); }", "tokens": 23} {"id": 160054, "source": "method", "repo": "DSH-APP/DSHA", "text": "void drain(Process process, Events events) { WebAuthLineBuffer scan = new WebAuthLineBuffer(); DshAuthLog log = new DshAuthLog(); try (Reader in = new InputStreamReader(process.getInputStream(), StandardCharsets.UTF_8)) { char[] buffer = new char[8192]; int count; while ((count = in.read(buffer)) != -1) { String chunk = new String(buffer, 0, count); if (!events.current()) continue; String complete = scan.append(chunk); events.output(log.append(chunk)); if (events.current() && !events.authenticated()) { String url = WebPortPolicy.authentication(complete, listenPort); if (url != null) events.authentication(url); } } if (events.current() && !events.authenticated()) { String url = WebPortPolicy.authentication(scan.finish(), listenPort); if (url != null) events.authentication(url); } } catch (IOException | RuntimeException failure) { if (events.current()) reportReadFailure(events, failure); } finally { if (events.current()) try { events.output(log.finish()); } catch (RuntimeException failure) { reportReadFailure(events, failure); } } // EOF and read errors do not prove exit. Await this exact Process before emitting exit. try { int code = process.waitFor(); events.exited(code); } catch (InterruptedException interrupted) { Thread.currentThread().interrupt(); } }", "tokens": 322} {"id": 160092, "source": "method", "repo": "DSH-APP/DSHA", "text": "public ContainerRuntime runtime() { return execution.runtime(); }", "tokens": 13} {"id": 160107, "source": "method", "repo": "DSH-APP/DSHA", "text": "private static void removeLegacyPluginReviewPatches(Context context, File rootfs) throws IOException { String[][] modules = { {\"@deepseek-ai/dsh-plugin-manager/lib/index.js\", \"DSHA_NATIVE_PLUGIN_POLICY_V1\"}, {\"@deepseek-ai/dsh-client-ui-plugin-manager/lib/client.js\", \"dshaNativeReviewRoute\"} }; for (String[] entry : modules) { File file = new File(rootfs, \"usr/local/lib/node_modules/@deepseek-ai/dsh/node_modules/\" + entry[0]); if (!file.isFile() || !Compat.readAll(file).contains(entry[1])) continue; String canonical = restoreBundledClientModule(context, rootfs, entry[0]); if (canonical == null) throw new IOException(\"Cannot remove legacy review patch: \" + entry[0]); writeIfChanged( context, file, canonical.getBytes(java.nio.charset.StandardCharsets.UTF_8), false); } }", "tokens": 227} {"id": 160139, "source": "method", "repo": "DSH-APP/DSHA", "text": "static Intent intent(Context context, boolean alternative) { Intent picker = new Intent(alternative ? Intent.ACTION_GET_CONTENT : Intent.ACTION_OPEN_DOCUMENT) .addCategory(Intent.CATEGORY_OPENABLE) .setType(\"*/*\") .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); if (!alternative) { for (ResolveInfo candidate : context.getPackageManager().queryIntentActivities(picker, 0)) { if (candidate.activityInfo == null || !candidate.activityInfo.exported || !candidate.activityInfo.enabled) continue; String pkg = candidate.activityInfo.packageName; if (pkg.equals(\"com.android.documentsui\") || pkg.equals(\"com.google.android.documentsui\")) { picker.setComponent(new android.content.ComponentName(pkg, candidate.activityInfo.name)); break; } } } return picker; }", "tokens": 194} {"id": 160197, "source": "method", "repo": "DSH-APP/DSHA", "text": "/** At most three probes and one package installation; no retry after package writes. */ public static Mode run(List modes, Runner runner, Recorder recorder) throws IOException, InterruptedException { if (modes.isEmpty() || modes.size() > 3 || modes.contains(Mode.PROROOT_DYNAMIC) || modes.stream().distinct().count() != modes.size()) throw new IllegalArgumentException(\"COLD_RUNTIME_PLAN\"); for (Mode mode : modes) { Observation probe = runner.run(mode, true); recorder.record(mode, true, probe); if (!probe.exited) throw new IOException(\"COLD_INSTALL_PROCESS_EXIT_UNCONFIRMED\"); if (!probe.ready(PROBE_READY)) continue; Observation installed = runner.run(mode, false); recorder.record(mode, false, installed); if (!installed.exited) throw new IOException(\"COLD_INSTALL_PROCESS_EXIT_UNCONFIRMED\"); if (!installed.ready(INSTALL_READY)) throw new IOException( \"COLD_INSTALL_POSTCHECK_FAILED: \" + mode + \"\\n\" + installed.diagnostic); return mode; } throw new IOException(\"COLD_RUNTIME_PROBE_FAILED\"); }", "tokens": 262} {"id": 160426, "source": "method", "repo": "DSH-APP/DSHA", "text": "void anchored(File file) throws IOException { if (absolute(file).startsWith(absolute(alias) + File.separator)) throw new IOException(\"PARENT_LINK\"); for (File at = file.getParentFile(); at != null; at = at.getParentFile()) if (stat(at).type.equals(\"LINK\")) throw new IOException(\"PARENT_LINK\"); }", "tokens": 80} {"id": 160531, "source": "method", "repo": "DSH-APP/DSHA", "text": "public void portHexIsFourDigitUpperHex() { assertEquals(\"0C08\", WebProcSel.portHex(3080)); assertEquals(\"0C12\", WebProcSel.portHex(3090)); assertEquals(\"15B3\", WebProcSel.portHex(5555)); }", "tokens": 70} {"id": 160572, "source": "method", "repo": "DuanYan007/markitdown", "text": "public MarkdownBuilder append(String text) { content.append(text); return this; }", "tokens": 20} {"id": 160808, "source": "method", "repo": "DuanYan007/markitdown", "text": "private static void printShowConfigNextSteps() { System.out.println(); System.out.println(CLI_PREFIX + \" Next steps:\"); System.out.println(\" - Run --validate-config to verify the configuration file before converting.\"); System.out.println(\" - Run a conversion command, for example: markitdown document.pdf -o output.md\"); }", "tokens": 82} {"id": 160890, "source": "method", "repo": "DuanYan007/markitdown", "text": "private void setTrackedProperty(Map resolvedValues, Map tracked, String key, String value, ConfigSource source) { resolvedValues.put(key, value); tracked.put(key, new TrackedValue(value, source)); }", "tokens": 62} {"id": 160958, "source": "method", "repo": "DuanYan007/markitdown", "text": "public T value() { return value; }", "tokens": 10} {"id": 160990, "source": "method", "repo": "DuanYan007/markitdown", "text": "public Setting language() { return language; }", "tokens": 13} {"id": 161018, "source": "method", "repo": "DuanYan007/markitdown", "text": "/** Sets whether tables should be included in the output. @param includeTables true to include tables @return this instance */ public ConversionOptions setIncludeTables(boolean includeTables) { this.includeTables = includeTables; return this; }", "tokens": 49} {"id": 161144, "source": "method", "repo": "DuanYan007/markitdown", "text": "private ExtractedImage findExtractedImage(XWPFPicture picture, List extractedImages) { try { XWPFPictureData pictureData = picture.getPictureData(); String filename = pictureData.getFileName(); for (ExtractedImage image : extractedImages) { if (filename.equals(image.getOriginalFilename())) { return image; } } } catch (Exception e) { logger.debug(\"Failed to match extracted image: {}\", e.getMessage()); } return null; }", "tokens": 99} {"id": 161156, "source": "method", "repo": "DuanYan007/markitdown", "text": "/** Processes the contents of a list item, including nested lists. @param li list item @param options conversion options @param depth nesting depth */ private void processListItemContent(Element li, ConversionOptions options, int depth) { for (Node child : li.childNodes()) { if (child instanceof Element) { Element childElement = (Element) child; if (childElement.tagName().equals(\"ul\") || childElement.tagName().equals(\"ol\")) { processList(childElement, options, depth + 1); } else { processNode(child, options, depth); } } else { processNode(child, options, depth); } } }", "tokens": 141} {"id": 161328, "source": "method", "repo": "DuanYan007/markitdown", "text": "public Path getImagePath() { return imagePath; }", "tokens": 11} {"id": 161331, "source": "method", "repo": "DuanYan007/markitdown", "text": "/** Builds a Markdown image reference for the extracted asset. @param altText alt text to use when available @return Markdown image syntax */ public String toMarkdown(String altText) { String alt = (altText != null && !altText.isEmpty()) ? altText : \"Image \" + index; return \"![\" + alt + \"](\" + relativePath + \")\"; }", "tokens": 78} {"id": 161350, "source": "method", "repo": "DuanYan007/markitdown", "text": "private static void alias(String alias, String existingProviderName) { OcrProvider provider = PROVIDERS.get(existingProviderName.toLowerCase()); if (provider != null) { PROVIDERS.put(alias.toLowerCase(), provider); } }", "tokens": 53} {"id": 161429, "source": "method", "repo": "DuanYan007/markitdown", "text": "void convertsNestedTextAndJsonEntries() throws Exception { Path zipFile = tempDir.resolve(\"nested.zip\"); writeZip(zipFile); MarkItDownEngine engine = new MarkItDownEngine(); ZipConverter zipConverter = new ZipConverter(); zipConverter.setDelegate(new ZipConverter.DocumentConverterDelegate() { @Override public ConversionResult convert(java.io.InputStream inputStream, String mimeType, ConversionOptions options) throws ConversionException { return engine.convert(inputStream, mimeType, options); } @Override public boolean isSupported(String mimeType) { return engine.isSupported(mimeType); } }); ConversionResult result = zipConverter.convert(zipFile, ConversionOptions.builder().includeMetadata(true).build()); assertTrue(result.isSuccessful()); assertTrue(result.getMarkdown().contains(\"root file\")); assertTrue(result.getMarkdown().contains(\"\\\"env\\\":\\\"test\\\"\")); assertTrue(result.getMarkdown().contains(\"**File Name:** root.txt\")); assertTrue(result.getMarkdown().contains(\"**File Name:** level1/note.txt\")); assertTrue(result.getMarkdown().contains(\"**File Name:** level1/level2/data.json\")); assertFalse(result.getMarkdown().contains(\"unsupported format\")); }", "tokens": 250} {"id": 161501, "source": "method", "repo": "dubesar/ultimate-java-resources", "text": "static ArrayList sieve() { boolean isp[]=new boolean[MAX]; Arrays.fill(isp,true); ArrayList primes=new ArrayList<>(); for(int i=2;i*i= 6 && n <= 20) { ans = \"Weird\"; } else { ans = \"Not Weird\"; } } System.out.println(ans); sc.close(); }", "tokens": 104} {"id": 162223, "source": "method", "repo": "dubesar/ultimate-java-resources", "text": "public Customer updateCustomer(int customerID, Customer customer) { customer.setCustomerID(customerID); return customerDAO.save(customer); }", "tokens": 32} {"id": 162310, "source": "method", "repo": "dustinkredmond/fxtrayicon", "text": "/** This is used to tell the show method to not add the event listener which normally shows the stage when the icon is clicked. On MacOS, this is normally activated with a right click. In order to be able to add a right click mouse event to the trayIcon object on MacOS, noDefaultAction needs to be executed. @return this Builder object */ public Builder noDefaultAction() { noDefaultAction = true; return this; }", "tokens": 92} {"id": 162507, "source": "method", "repo": "dylancope/evolving-protozoa", "text": "public void killCell() { dead = true; health = 0; }", "tokens": 17} {"id": 162518, "source": "method", "repo": "dylancope/evolving-protozoa", "text": "public void setFoodToDigest(Food.Type foodType, Food food) { foodToDigest.put(foodType, food); }", "tokens": 31} {"id": 162569, "source": "method", "repo": "dylancope/evolving-protozoa", "text": "public float complexMoleculesToMakeProgress(float delta, Food.ComplexMolecule molecule) { float amount = getRequiredComplexMoleculeAmount(molecule); return delta * amount / timeToComplete; }", "tokens": 40} {"id": 162793, "source": "method", "repo": "dylancope/evolving-protozoa", "text": "private Optional findNetworkGene(Gene[] genes) { for (int i = 0; i < genes.length; i++) { Gene gene = genes[i]; if (gene instanceof NetworkGene) return Optional.of(i); } return Optional.empty(); }", "tokens": 65} {"id": 162818, "source": "method", "repo": "dylancope/evolving-protozoa", "text": "public ChunkManager(float xMin, float xMax, float yMin, float yMax, float chunkSize) { this.xMin = xMin; this.xMax = xMax; this.yMin = yMin; this.yMax = yMax; this.chunkSize = chunkSize; this.nXChunks = 2 + (int) ((xMax - xMin) / chunkSize); this.nYChunks = 2 + (int) ((yMax - yMin) / chunkSize); this.chunks = new Chunk[nXChunks * nYChunks]; for (int i = 0; i < nXChunks; i++) for (int j = 0; j < nYChunks; j++) this.chunks[toChunkID(i, j)] = new Chunk(i, j, this); }", "tokens": 181} {"id": 162904, "source": "method", "repo": "dylancope/evolving-protozoa", "text": "public void update() { float delta = timeDilation * Settings.simulationUpdateDelta; synchronized (tank) { tank.update(delta); } timeSinceSave += delta; if (timeSinceSave > Settings.timeBetweenSaves) { timeSinceSave = 0; saveTank(); } timeSinceSnapshot += delta; if (timeSinceSnapshot > Settings.historySnapshotTime) { timeSinceSnapshot = 0; makeHistorySnapshot(); } }", "tokens": 93} {"id": 163182, "source": "method", "repo": "dylancope/evolving-protozoa", "text": "public SimulationController(Window window, Simulation simulation, SimulationRenderer renderer) { this.simulation = simulation; this.renderer = renderer; this.input = window.getInput(); input.registerOnPressHandler(KeyEvent.VK_F1, simulation::togglePause); input.registerOnPressHandler(KeyEvent.VK_F2, renderer.getUI()::toggleShowFPS); input.registerOnPressHandler(KeyEvent.VK_F3, simulation::toggleDebug); input.registerOnPressHandler(KeyEvent.VK_F4, renderer::toggleAdvancedDebugInfo); input.registerOnPressHandler(KeyEvent.VK_F9, this::resetCamera); input.registerOnPressHandler(KeyEvent.VK_F10, renderer::toggleChemicalGrid); input.registerOnPressHandler(KeyEvent.VK_F11, renderer::toggleAA); input.registerOnPressHandler(KeyEvent.VK_F12, renderer::toggleUI); }", "tokens": 199} {"id": 163244, "source": "method", "repo": "dylancope/evolving-protozoa", "text": "private void precomputeGraphicsPositions(NeuralNetwork nn, int boxXStart, int boxYStart, int boxWidth, int boxHeight) { Neuron[] neurons = nn.getNeurons(); int networkDepth = nn.calculateDepth(); int[] depthWidthValues = new int[networkDepth + 1]; Arrays.fill(depthWidthValues, 0); for (Neuron n : neurons) if (n.isConnectedToOutput()) depthWidthValues[n.getDepth()]++; int maxWidth = 0; for (int width : depthWidthValues) maxWidth = Math.max(maxWidth, width); int nodeSpacing = boxHeight / maxWidth; nn.setGraphicsNodeSpacing(nodeSpacing); for (int depth = 0; depth <= networkDepth; depth++) { int x = boxXStart + depth * boxWidth / networkDepth; int nNodes = depthWidthValues[depth]; int i = 0; for (Neuron n : neurons) { if (n.getDepth() == depth && n.isConnectedToOutput()) { int y = (int) (boxYStart + nodeSpacing / 2f + boxHeight / 2f - (nNodes / 2f - i) * nodeSpacing); n.setGraphicsPosition(x, y); i++; } } } nn.setComputedGraphicsPositions(true); }", "tokens": 294} {"id": 163509, "source": "method", "repo": "dynamictreesteam/dynamictrees", "text": "/** @return {@code true} if the given {@code itemStack} matches this Pod's item */ public boolean isItem(ItemStack itemStack) { return ItemStack.matches(this.itemStack, itemStack); }", "tokens": 44} {"id": 163572, "source": "method", "repo": "dynamictreesteam/dynamictrees", "text": "public String toString() { return getRegistryName().toString(); }", "tokens": 14} {"id": 163603, "source": "method", "repo": "dynamictreesteam/dynamictrees", "text": "protected static int executesSuccess(final ThrowableRunnable executeRunnable) throws CommandSyntaxException { executeRunnable.run(); return 1; }", "tokens": 31} {"id": 163925, "source": "method", "repo": "dynamictreesteam/dynamictrees", "text": "public Species setLeavesProperties(LeavesProperties leavesProperties) { this.leavesProperties = leavesProperties; leavesProperties.setFamily(getFamily()); addValidLeafBlocks(leavesProperties); return this; }", "tokens": 43} {"id": 163927, "source": "method", "repo": "dynamictreesteam/dynamictrees", "text": "public void setSeedName(String name) { seedName = name; }", "tokens": 17} {"id": 163971, "source": "method", "repo": "dynamictreesteam/dynamictrees", "text": "/** Checks whether {@link #seed} is the same instance as the {@link Seed} of the common {@link Species} of the owning {@link Family}. @return {@code true} if {@link #seed} {@code ==} the {@link Seed} of the common {@link Species} of {@link #family}; {@code false} otherwise. */ public boolean isSeedCommon() { return this.getCommonSpecies().getSeed().orElse(null) == this.seed.get(); }", "tokens": 107} {"id": 164096, "source": "method", "repo": "dynamictreesteam/dynamictrees", "text": "private void initThickModels() { for (int i = 0; i < ThickBranchBlock.MAX_RADIUS_THICK - ThickBranchBlock.MAX_RADIUS; i++) { int radius = i + ThickBranchBlock.MAX_RADIUS + 1; trunksBarkQuads[i] = bakeTrunkBark(radius, this.barkTexture, true); trunksTopBarkQuads[i] = bakeTrunkBark(radius, this.barkTexture, false); trunksTopRingsQuads[i] = bakeTrunkRings(radius, thickRingsTexture, Direction.UP); trunksBotRingsQuads[i] = bakeTrunkRings(radius, thickRingsTexture, Direction.DOWN); } }", "tokens": 171} {"id": 164187, "source": "method", "repo": "dynamictreesteam/dynamictrees", "text": "public static void registerCommands(final RegisterCommandsEvent event) { new DTCommand().registerDTCommand(event.getDispatcher()); }", "tokens": 29} {"id": 164372, "source": "method", "repo": "earlygrey/shapedrawer", "text": "float y4() {return batchManager.y4();}", "tokens": 14} {"id": 164457, "source": "method", "repo": "earlygrey/shapedrawer", "text": "void path (float[] userPath, int start, int end, LineWidthFunction lineWidth, JoinType joinType, boolean open) { path(userPath, start, end, lineWidth, joinType, open, 0, 0, 1, 1); }", "tokens": 57} {"id": 164498, "source": "method", "repo": "earlygrey/shapedrawer", "text": "/**

Calls {@link #path(Iterable, float, boolean)} with open set to true.

@param path an ordered Iterable of Vector2s representing path points @param lineWidth the width of each line in world units */ public void path(Iterable path, float lineWidth) { path(path, lineWidth, true); }", "tokens": 79} {"id": 164773, "source": "method", "repo": "earthcomputer/enchantmentcracker", "text": "public static Versions getIntroducedVersion(String enchantment) { switch (enchantment) { case FROST_WALKER: case MENDING: return Versions.V1_9; case BINDING_CURSE: case VANISHING_CURSE: return Versions.V1_11; case SWEEPING: return Versions.V1_11_1; case LOYALTY: case IMPALING: case RIPTIDE: case CHANNELING: return Versions.V1_13; case MULTISHOT: case QUICK_CHARGE: case PIERCING: return Versions.V1_14; case SOUL_SPEED: return Versions.V1_16; case DENSITY: case BREACH: case WIND_BURST: return Versions.V1_21; case LUNGE: return Versions.V1_21_11; default: return Versions.V1_8; } }", "tokens": 221} {"id": 164782, "source": "method", "repo": "earthcomputer/enchantmentcracker", "text": "public boolean equals(Object other) { return other instanceof EnchantmentInstance && equals((EnchantmentInstance) other); }", "tokens": 24} {"id": 164838, "source": "method", "repo": "earthcomputer/enchantmentcracker", "text": "public boolean isAbortRequested() { return abortRequested.get(); }", "tokens": 15} {"id": 164886, "source": "method", "repo": "eclipse-repairnator/repairnator", "text": "private RepairInfo createRepairInfoFromJson(JSONObject json) { RepairInfo result = new RepairInfo(); result.setGithubProject((String)json.get(\"repo\")); JSONObject metrics = (JSONObject) json.get(\"metrics\"); result.setBugCommit((String)metrics.get(\"BugCommit\")); result.setPatchCommit((String)metrics.get(\"PatchCommit\")); if (json.containsKey(\"pr-id\")) { result.setPrId(json.get(\"pr-id\").toString()); } return result; }", "tokens": 115} {"id": 164924, "source": "method", "repo": "eclipse-repairnator/repairnator", "text": "public String getExceptionType() { return exceptionType; }", "tokens": 13} {"id": 164925, "source": "method", "repo": "eclipse-repairnator/repairnator", "text": "public boolean isValid() { if (!(exceptionType != null && elements != null)) { return false; } for (final StackTraceElement element : elements) { if (element.getMethod() == null) { return false; } } return true; }", "tokens": 51} {"id": 165085, "source": "method", "repo": "eclipse-repairnator/repairnator", "text": "public void setGitCommitHash(String gitCommitHash) { this.gitCommitHash = gitCommitHash; }", "tokens": 21} {"id": 165153, "source": "method", "repo": "eclipse-repairnator/repairnator", "text": "public void stack2Test() { String resourceContent = getResourceContent(\"/stack2.txt\"); StackTraceParser stackTraceParser = new StackTraceParser(resourceContent); List stackTraces = stackTraceParser.getStackTraces(); Assert.assertEquals(1, stackTraces.size()); Assert.assertEquals(\"java.net.ConnectException\", stackTraces.get(0).getExceptionType()); }", "tokens": 81} {"id": 165247, "source": "method", "repo": "eclipse-repairnator/repairnator", "text": "public ProjectInspector getInspector() { return this.inspector; }", "tokens": 14} {"id": 165325, "source": "method", "repo": "eclipse-repairnator/repairnator", "text": "public boolean isBug() { return bug; }", "tokens": 11} {"id": 165360, "source": "method", "repo": "eclipse-repairnator/repairnator", "text": "public void setNumberDeleted(int numberDeleted) { this.numberDeleted = numberDeleted; }", "tokens": 21} {"id": 165421, "source": "method", "repo": "eclipse-repairnator/repairnator", "text": "public void setStatus(NopolStatus status) { this.status = status; }", "tokens": 18} {"id": 165448, "source": "method", "repo": "eclipse-repairnator/repairnator", "text": "public StepStatus(AbstractStep step, StatusKind status, String diagnostic) { this.step = step; this.status = status; this.diagnostic = diagnostic; }", "tokens": 35} {"id": 165464, "source": "method", "repo": "eclipse-repairnator/repairnator", "text": "protected StepStatus businessExecute() { FlacocoConfig config = setupFlacocoConfig(); Flacoco flacoco = new Flacoco(config); FlacocoResult result = flacoco.run(); this.getLogger().debug(\"Results from flacoco: \" + result.getDefaultSuspiciousnessMap().toString()); this.getInspector().getJobStatus().setFlacocoResult(result); return StepStatus.buildSuccess(this); }", "tokens": 99} {"id": 165546, "source": "method", "repo": "eclipse-repairnator/repairnator", "text": "public ModificationPoint(Path filepath, int suspiciousLine){ this.filePath = filepath; this.suspiciousLine = suspiciousLine; }", "tokens": 32} {"id": 165606, "source": "method", "repo": "eclipse-repairnator/repairnator", "text": "//FIXME: We can't rely on repairnator/failing project to get builds //TODO: Add a test with a failing build from GitHub Actions public void testFailingProjectNotBuildable() throws IOException { long buildId = 220945185; // repairnator/failingProject only-one-failing tmpDir = Files.createTempDirectory(\"test_complete2\").toFile(); Build failingBuild = this.checkBuildAndReturn(buildId, false); BuildToBeInspected buildToBeInspected = new BuildToBeInspected(failingBuild, null, ScannedBuildStatus.ONLY_FAIL, \"test\"); List notifiers = new ArrayList<>(); List serializerEngines = new ArrayList<>(); SerializerEngine serializerEngine = mock(SerializerEngine.class); serializerEngines.add(serializerEngine); ProjectInspector inspector = InspectorFactory.getTravisInspector(buildToBeInspected, tmpDir.getAbsolutePath(), notifiers); inspector.getSerializers().add(new InspectorSerializer(serializerEngines, inspector)); inspector.run(); JobStatus jobStatus = inspector.getJobStatus(); assertThat(jobStatus.getLastPushState(), is(PushState.REPO_NOT_PUSHED)); List stepStatusList = inspector.getJobStatus().getStepStatuses(); Map, StepStatus.StatusKind> expectedStatuses = new HashMap<>(); expectedStatuses.put(BuildProject.class, StepStatus.StatusKind.FAILURE); // step supposed to fail by this test case this.checkStepStatus(stepStatusList, expectedStatuses); String finalStatus = AbstractDataSerializer.getPrettyPrintState(inspector); assertThat(finalStatus, is(PipelineState.NOTBUILDABLE.name())); verify(serializerEngine, times(1)).serialize(anyListOf(SerializedData.class), eq(SerializerType.INSPECTOR)); }", "tokens": 377} {"id": 165647, "source": "method", "repo": "eclipse-repairnator/repairnator", "text": "public void testComputeTestDirWithMultiModuleProject() throws IOException { long buggyBuildCandidateId = 225920529; // https://travis-ci.com/github/repairnator/test-repairnator-bears/builds/225920529 Build buggyBuildCandidate = this.checkBuildAndReturn(buggyBuildCandidateId, false); BuildToBeInspected buildToBeInspected = new BuildToBeInspected(buggyBuildCandidate, null, ScannedBuildStatus.ONLY_FAIL, \"test\"); tmpDir = Files.createTempDirectory(\"computetestdir\").toFile(); File repoDir = new File(tmpDir, \"repo\"); JobStatus jobStatus = new JobStatus(tmpDir.getAbsolutePath()+\"/repo\"); ProjectInspector inspector = ProjectInspectorMocker.mockProjectInspector(jobStatus, tmpDir, buildToBeInspected, CheckoutType.CHECKOUT_BUGGY_BUILD); CloneRepository cloneStep = new CloneRepository(inspector); ComputeTestDir computeTestDir = new ComputeTestDir(inspector, true); cloneStep.addNextStep(new CheckoutBuggyBuild(inspector, true)).addNextStep(computeTestDir); cloneStep.execute(); assertThat(computeTestDir.isShouldStop(), is(false)); List stepStatusList = jobStatus.getStepStatuses(); assertThat(stepStatusList.size(), is(3)); StepStatus computeTestDirStatus = stepStatusList.get(2); assertThat(computeTestDirStatus.getStep(), is(computeTestDir)); for (StepStatus stepStatus : stepStatusList) { assertThat(stepStatus.isSuccess(), is(true)); } assertThat(jobStatus.getTestDir(), is(new File[] { new File(repoDir.getAbsolutePath()+\"/test-repairnator-bears-core/src/test/java\").getCanonicalFile(), new File(repoDir.getAbsolutePath()+\"/test-repairnator-bears-patchstats/src/test/java\").getCanonicalFile() })); assertThat(jobStatus.getProperties().getProjectMetrics().getNumberTestFiles(), is(3)); }", "tokens": 413} {"id": 165884, "source": "method", "repo": "eclipse/repairnator", "text": "public void run() { String containerId = null; DockerClient docker = CheckBranchLauncher.docker; try { LOGGER.info(\"Start to run check container for branch \"+branchName); String containerName = \"checkbranch_\"+ branchName; List envValues = new ArrayList<>(); envValues.add(\"BRANCH_NAME=\"+this.branchName); envValues.add(\"REPOSITORY=\"+this.repairnatorConfig.getRepository()); if (this.repairnatorConfig.getLauncherMode() == LauncherMode.REPAIR) { String humanPatchStr = this.repairnatorConfig.isHumanPatch() ? \"--human-patch\" : \"\"; envValues.add(\"HUMAN_PATCH=\"+humanPatchStr); } Map labels = new HashMap<>(); labels.put(\"name\",containerName); HostConfig hostConfig = HostConfig.builder().appendBinds(this.repairnatorConfig.getOutputPath()+\":/tmp/result.txt\").build(); ContainerConfig containerConfig = ContainerConfig.builder() .image(imageId) .env(envValues) .hostname(Utils.getHostname()) .hostConfig(hostConfig) .labels(labels) .build(); LOGGER.info(\"Create the container: \"+containerName); ContainerCreation container = docker.createContainer(containerConfig); containerId = container.id(); LOGGER.info(\"Start the container: \"+containerName+\" (id: \"+containerId+\")\"); docker.startContainer(container.id()); ContainerExit exitStatus = docker.waitContainer(containerId); LOGGER.info(\"The container has finished with status code: \"+exitStatus.statusCode()); if (!this.repairnatorConfig.isSkipDelete() && exitStatus.statusCode() == 0) { LOGGER.info(\"Container will be removed.\"); docker.removeContainer(containerId); } LOGGER.info(\"TREATED Docker container : \"+containerId); } catch (InterruptedException e) { LOGGER.error(\"Error while running the container for branch name \"+branchName, e); killDockerContainer(docker, containerId); } catch (DockerException e) { LOGGER.error(\"Error while creating or running the container for branch name \"+branchName, e); } CheckBranchLauncher.submittedRunnablePipelineContainers.remove(this); }", "tokens": 459} {"id": 165942, "source": "method", "repo": "eclipse/repairnator", "text": "private BufferedWriter openFile(String filename) { File outputFile = new File(this.repoOutputPath); if (!outputFile.isDirectory()) { outputFile = outputFile.getParentFile(); } outputFile = new File(outputFile.getPath() + File.separator + filename); BufferedWriter stream; try { stream = new BufferedWriter(new FileWriter(outputFile, true)); } catch (IOException e) { logger.error(\"Error while creating file writer for: \" + outputFile.getPath(), e); stream = null; } return stream; }", "tokens": 105} {"id": 165950, "source": "method", "repo": "eclipse/repairnator", "text": "public static String getBranchUrl(String branchName, String repoSlug) { return \"http://github.com/\"+repoSlug+\"/tree/\"+branchName; }", "tokens": 35} {"id": 166019, "source": "method", "repo": "eclipse/repairnator", "text": "public GithubMainProcess setNotifiers(List notifiers) { this.notifiers = notifiers; return this; }", "tokens": 30} {"id": 166182, "source": "method", "repo": "eclipse/repairnator", "text": "public PipelineErrorSerializer(List engines, ProjectInspector inspector) { super(engines, SerializerType.PIPELINE_ERRORS, inspector); }", "tokens": 35} {"id": 166257, "source": "method", "repo": "eclipse/repairnator", "text": "public void onMessage( WebSocket conn, ByteBuffer message ) { System.out.println(\"received ByteBuffer from \" + conn.getRemoteSocketAddress()); }", "tokens": 30} {"id": 166259, "source": "method", "repo": "eclipse/repairnator", "text": "public void TestAttemptJob () { SelectedCommit commit = new SelectedCommit(true, \"javierron/failingProject\", \"65eb0ee8cc221bd4fe6d6414feb6ee368131288d\"); scanner.attemptJob(commit); //failing job verify(runner, times(1)).submitBuild(any(InputBuild.class)); }", "tokens": 94} {"id": 166340, "source": "method", "repo": "eidottermihi/rpicheck", "text": "private LoadAveragePeriod getLoadAveragePreference() { final String loadAvgPrefString = sharedPrefs.getString(\"pref_load_avg\", \"FIVE_MINUTES\"); LoadAveragePeriod period; switch (loadAvgPrefString) { case \"ONE_MINUTE\": period = LoadAveragePeriod.ONE_MINUTE; break; case \"FIVE_MINUTES\": period = LoadAveragePeriod.FIVE_MINUTES; break; case \"FIFTEEN_MINUTES\": period = LoadAveragePeriod.FIFTEEN_MINUTES; break; default: period = LoadAveragePeriod.FIVE_MINUTES; break; } LOGGER.debug(\"Load average preference: {}\", period); return period; }", "tokens": 141} {"id": 166379, "source": "method", "repo": "eidottermihi/rpicheck", "text": "protected void onPause() { super.onPause(); getPreferenceScreen().getSharedPreferences() .unregisterOnSharedPreferenceChangeListener(this); }", "tokens": 29} {"id": 166424, "source": "method", "repo": "eidottermihi/rpicheck", "text": "public void setProcesses(List processes) { this.processes = processes; }", "tokens": 22} {"id": 166777, "source": "method", "repo": "elbukkit/magicplugin", "text": "public String getEnchantmentKey(Enchantment enchantment) { // We don't use toString here since we'll be parsing this ourselves return enchantment.getKey().getNamespace() + \":\" + enchantment.getKey().getKey(); }", "tokens": 44} {"id": 166821, "source": "method", "repo": "elbukkit/magicplugin", "text": "public short getItemDamage(ItemStack itemStack) { return itemStack.getDurability(); }", "tokens": 17} {"id": 166889, "source": "method", "repo": "elbukkit/magicplugin", "text": "public void sendBreaking(Player player, long id, Location location, int breakAmount) { try { BlockPos blockPosition = new BlockPos(location.getX(), location.getY(), location.getZ()); Packet packet = new ClientboundBlockDestructionPacket((int)id, blockPosition, breakAmount); sendPacket(player, packet); } catch (Exception ex) { ex.printStackTrace(); } }", "tokens": 82} {"id": 167049, "source": "method", "repo": "elbukkit/magicplugin", "text": "public void setTNTSource(TNTPrimed tnt, LivingEntity source) { tnt.setSource(source); }", "tokens": 25} {"id": 167070, "source": "method", "repo": "elbukkit/magicplugin", "text": "public ItemUtils(Platform platform) { super(platform); }", "tokens": 13} {"id": 167105, "source": "method", "repo": "elbukkit/magicplugin", "text": "public void start() { this.mob.setTarget(this.target, EntityTargetEvent.TargetReason.OWNER_ATTACKED_TARGET, true); LivingEntity owner = this.tamed.getOwner(); if (owner != null) { this.lastTargetUpdate = owner.getLastHurtMobTimestamp(); } super.start(); }", "tokens": 68} {"id": 167274, "source": "method", "repo": "elbukkit/magicplugin", "text": "public String getMobKey(Entity entity) { if (entity == null) { return null; } Optional mob = api.getMobManager().getActiveMob(entity.getUniqueId()); if (!mob.isPresent()) { return null; } return mob.get().getMobType(); }", "tokens": 63} {"id": 167277, "source": "method", "repo": "elbukkit/magicplugin", "text": "public String getIdentifier() { return \"magic\"; }", "tokens": 12} {"id": 167540, "source": "method", "repo": "elbukkit/magicplugin", "text": "public void finalizeLoad(String worldName) { entityData = new EntityData(controller, parameters); logSpawnRule(\"Modifying \" + getTargetEntityTypeName() + \" in \" + worldName); }", "tokens": 43} {"id": 167633, "source": "method", "repo": "elennick/retry4j", "text": "public RetryConfigBuilder failOnAnyException() { validateExceptionStrategyAddition(); retryOnAnyException = false; retryOnSpecificExceptions = new HashSet<>(); builtInExceptionStrategySpecified = true; return this; }", "tokens": 43} {"id": 167767, "source": "method", "repo": "ellpeck/actuallyadditions", "text": "public static final void init() { // lol Items.touch(); Blocks.touch(); BannerPatterns.touch(); }", "tokens": 24} {"id": 167811, "source": "method", "repo": "ellpeck/actuallyadditions", "text": "private void generateBucket(FluidAA fluidSupplier) { withExistingParent(BuiltInRegistries.ITEM.getKey(fluidSupplier.getBucket()).getPath(), \"neoforge:item/bucket\") .customLoader((builder, template) -> DynamicFluidContainerModelBuilder.begin(builder, template).fluid(fluidSupplier.get())); }", "tokens": 69} {"id": 167817, "source": "method", "repo": "ellpeck/actuallyadditions", "text": "public static ItemRecipeGenerator.Recipe.Shapeless shapeless(ItemLike result) { return new ItemRecipeGenerator.Recipe.Shapeless(result); }", "tokens": 32} {"id": 167819, "source": "method", "repo": "ellpeck/actuallyadditions", "text": "public Shapeless(ItemLike result) { this(result, 1); }", "tokens": 17} {"id": 167960, "source": "method", "repo": "ellpeck/actuallyadditions", "text": "public int getValue() { return this.currentValue; }", "tokens": 12} {"id": 167979, "source": "method", "repo": "ellpeck/actuallyadditions", "text": "public Ingredient getStandTwo() { return this.modifiers.get(1); }", "tokens": 18} {"id": 168224, "source": "method", "repo": "ellpeck/actuallyadditions", "text": "public static void clearStorage(ItemStack stack, DataComponentType... componentTypes) { for (DataComponentType key : componentTypes) { stack.remove(key); } }", "tokens": 36} {"id": 168263, "source": "method", "repo": "ellpeck/actuallyadditions", "text": "TheFoods(String name, int healAmount, float saturation, boolean getsDrunken, int useDuration, Rarity rarity) { this.name = name; this.getsDrunken = getsDrunken; this.healAmount = healAmount; this.saturation = saturation; this.useDuration = useDuration; this.rarity = rarity; }", "tokens": 82} {"id": 168394, "source": "method", "repo": "ellpeck/actuallyadditions", "text": "public int getComparatorStrength() { float calc = (float) this.storage.getEnergyStored() / (float) this.storage.getMaxEnergyStored() * 15F; return (int) calc; }", "tokens": 45} {"id": 168542, "source": "method", "repo": "ellpeck/actuallyadditions", "text": "public void setBoundPosition(BlockPos pos) { this.boundPosition = pos; }", "tokens": 19} {"id": 168550, "source": "method", "repo": "ellpeck/actuallyadditions", "text": "public TileEntityPlayerInterface(BlockPos pos, BlockState state) { super(ActuallyBlocks.PLAYER_INTERFACE.getTileEntityType(), pos, state); }", "tokens": 29} {"id": 168559, "source": "method", "repo": "ellpeck/actuallyadditions", "text": "public int getFirstTimeToScale(int i) { return this.firstSmeltTime * i / SMELT_TIME; }", "tokens": 30} {"id": 168676, "source": "method", "repo": "emilyploszaj/emi", "text": "public static void focus(TextFieldWidget widget, boolean focused) { // Also ensure a current focus-element in the screen is cleared if it changes MinecraftClient client = MinecraftClient.getInstance(); if (client != null && client.currentScreen != null) { var currentFocus = client.currentScreen.getFocused(); if (!focused && currentFocus == widget || focused && currentFocus != widget) { client.currentScreen.setFocused(null); } } widget.setFocused(focused); }", "tokens": 93} {"id": 168690, "source": "method", "repo": "emilyploszaj/emi", "text": "public static CraftingInventory getCraftingInventory() { return new CraftingInventory(new ScreenHandler(null, -1) { @Override public boolean canUse(PlayerEntity player) { return false; } @Override public ItemStack quickMove(PlayerEntity player, int index) { return ItemStack.EMPTY; } @Override public void onContentChanged(Inventory inventory) { } }, 3, 3); }", "tokens": 82} {"id": 168833, "source": "method", "repo": "emilyploszaj/emi", "text": "public int left() { return x; }", "tokens": 10} {"id": 169079, "source": "method", "repo": "emilyploszaj/emi", "text": "private boolean drop(Screen screen, Optional> optional, int x, int y) { if (optional.isPresent()) { for (IGhostIngredientHandler.Target target : getTargets(screen, optional.get())) { if (target.getArea().contains(x, y)) { target.accept(optional.get().getIngredient()); return true; } } } return false; }", "tokens": 91} {"id": 169131, "source": "method", "repo": "emilyploszaj/emi", "text": "private static int grabMatching(PlayerEntity player, List slots, List rubble, List crafting, ItemStack stack) { int amount = stack.getCount(); int grabbed = 0; for (int i = 0; i < rubble.size(); i++) { if (grabbed >= amount) { return grabbed; } ItemStack r = rubble.get(i); if (ItemStack.areItemsAndComponentsEqual(stack, r)) { int wanted = amount - grabbed; if (r.getCount() <= wanted) { grabbed += r.getCount(); rubble.remove(i); i--; } else { grabbed = amount; r.setCount(r.getCount() - wanted); } } } for (Slot s : slots) { if (grabbed >= amount) { return grabbed; } if (crafting.contains(s) || !s.canTakeItems(player)) { continue; } ItemStack st = s.getStack(); if (ItemStack.areItemsAndComponentsEqual(stack, st)) { int wanted = amount - grabbed; ItemStack taken = st.copy(); if (st.getCount() <= wanted) { grabbed += st.getCount(); s.setStack(ItemStack.EMPTY); } else { grabbed = amount; st.setCount(st.getCount() - wanted); } s.onTakeItem(player, taken); } } return grabbed; }", "tokens": 310} {"id": 169310, "source": "method", "repo": "emilyploszaj/emi", "text": "public BoMScreen(HandledScreen old) { super(EmiPort.translatable(\"screen.emi.recipe_tree\")); this.old = old; }", "tokens": 34} {"id": 169316, "source": "method", "repo": "emilyploszaj/emi", "text": "public boolean keyPressed(int keyCode, int scanCode, int modifiers) { if (keyCode == GLFW.GLFW_KEY_ESCAPE) { this.close(); return true; } else if (this.client.options.inventoryKey.matchesKey(keyCode, scanCode)) { this.close(); return true; } Function function = bind -> bind.matchesKey(keyCode, scanCode); if (function.apply(EmiConfig.back)) { EmiHistory.pop(); return true; } Hover hover = getHoveredStack(lastMouseX, lastMouseY); if (hover != null && hover.stack != null && !hover.stack.isEmpty()) { if (function.apply(EmiConfig.favorite)) { EmiFavorites.addFavorite(hover.stack, hover.node == null ? null : hover.node.recipe); } } if (EmiInput.isControlDown() && keyCode == GLFW.GLFW_KEY_R) { List recipes = EmiApi.getRecipeManager().getRecipes(); if (recipes.size() > 0) { for (int i = 0; i < 100_000; i++) { EmiRecipe recipe = recipes.get(EmiUtil.RANDOM.nextInt(recipes.size())); if (recipe.supportsRecipeTree()) { BoM.setGoal(recipe); init(); return true; } } } } else if (EmiInput.isControlDown() && keyCode == GLFW.GLFW_KEY_C) { BoM.tree = null; init(); } return super.keyPressed(keyCode, scanCode, modifiers); }", "tokens": 339} {"id": 169361, "source": "method", "repo": "emilyploszaj/emi", "text": "private static void renderDraggedStack(EmiDrawContext context, int mouseX, int mouseY, float delta, EmiScreenBase base) { if (!draggedStack.isEmpty()) { SidebarPanel panel = getHoveredPanel(mouseX, mouseY); if (panel != null) { ScreenSpace space = panel.getHoveredSpace(mouseX, mouseY); if (space != null && space.getType() == SidebarType.FAVORITES) { int pageSize = space.pageSize; int page = panel.page; int index = space.getClosestEdge(mouseX, mouseY); if (index + pageSize * page > EmiFavorites.favorites.size()) { index = EmiFavorites.favorites.size() - pageSize * page; } if (index + pageSize * page > space.getStacks().size()) { index = space.getStacks().size() - pageSize * page; } if (index >= 0) { context.push(); context.matrices().translate(0, 0, 200); int dx = space.getEdgeX(index); int dy = space.getEdgeY(index); context.fill(dx - 1, dy, 2, 18, 0xFF00FFFF); context.pop(); } } } context.push(); context.matrices().translate(0, 0, 400); EmiDragDropHandlers.render(base.screen(), draggedStack, context.raw(), mouseX, mouseY, delta); draggedStack.render(context.raw(), mouseX - 8, mouseY - 8, delta, EmiIngredient.RENDER_ICON); context.pop(); } }", "tokens": 343} {"id": 169393, "source": "method", "repo": "emilyploszaj/emi", "text": "public SidebarType getType() { return space.getType(); }", "tokens": 13} {"id": 169396, "source": "method", "repo": "emilyploszaj/emi", "text": "private static int measure(String string) { int total = 0; int refund = 0; for (int i = 0; i < string.length(); i++) { MicroChar c = MICRO_CHARS.get(string.charAt(i)); int amount = 1; if (c != null) { amount = c.width; } total += amount - refund; refund = 1; } return total; }", "tokens": 93} {"id": 169562, "source": "method", "repo": "emilyploszaj/trinkets", "text": "public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, T state, float limbAngle, float limbDistance) { ((TrinketEntityRenderState) state).trinkets$getState().forEach(pair -> { TrinketRendererRegistry.getRenderer(pair.getLeft().getItem()).ifPresent(renderer -> { matrices.push(); renderer.render(pair.getLeft(), pair.getRight(), this.getContextModel(), matrices, vertexConsumers, light, state, limbAngle, limbDistance); matrices.pop(); }); }); }", "tokens": 114} {"id": 169659, "source": "method", "repo": "emilyploszaj/trinkets", "text": "public void removeCachedModifier(EntityAttributeModifier attributeModifier) { this.cachedModifiers.remove(attributeModifier); }", "tokens": 24} {"id": 169794, "source": "method", "repo": "emilyploszaj/trinkets", "text": "private void isClickOutsideBounds(double mouseX, double mouseY, int left, int top, int button, CallbackInfoReturnable info) { if (TrinketScreenManager.isClickInsideTrinketBounds(mouseX, mouseY)) { info.setReturnValue(false); } }", "tokens": 56} {"id": 169885, "source": "method", "repo": "emir/AIKON", "text": "private synchronized int readingUid() { return reading ? readUid : 0; }", "tokens": 18} {"id": 169944, "source": "method", "repo": "emir/AIKON", "text": "private void paintHeader(Graphics g, int w) { int bh = barH(); boolean test = midlet.settings.testMode; g.setColor(Theme.chrome); g.fillRect(0, 0, w, bh); g.setColor(Theme.border); g.drawLine(0, bh - 1, w, bh - 1); int right = w - PAD; String rem = session.remaining(); if (test || rem.length() > 0) { g.setFont(Theme.small); String pill = test ? \"TEST\" : rem + L.t(\" left\"); int pw = Theme.small.stringWidth(pill) + 10; int ph = Theme.small.getHeight() + 2; g.setColor(test ? Theme.testBar : Theme.selection); g.fillRoundRect(w - PAD - pw, (bh - ph) / 2, pw, ph, ph, ph); g.setColor(test ? 0xFFFFFF : Theme.accent); g.drawString(pill, w - PAD - pw / 2, (bh - ph) / 2 + 1, Graphics.TOP | Graphics.HCENTER); right -= pw + 4; } // the chat's model, with a chevron: Options > Model changes it g.setFont(Theme.bold); g.setColor(Theme.ink); int tx = PAD + 4; int cw = 9; String name = Text.fit(session.ai(), Theme.bold, right - tx - cw - 4); g.drawString(name, tx, 4, Graphics.TOP | Graphics.LEFT); int cx = tx + Theme.bold.stringWidth(name) + 4; int cy = bh / 2; g.setColor(Theme.muted); g.fillTriangle(cx, cy - 2, cx + cw - 1, cy - 2, cx + cw / 2, cy + 3); }", "tokens": 433} {"id": 170051, "source": "method", "repo": "emir/AIKON", "text": "protected void destroyApp(boolean unconditional) { // Settings are saved explicitly; here only where the app was left (Resume) if (session != null) { remember(Resume.inChat); } }", "tokens": 43} {"id": 170275, "source": "method", "repo": "emir/AIKON", "text": "static synchronized String trial() { load(); return trial; }", "tokens": 15} {"id": 170363, "source": "method", "repo": "emir/AIKON", "text": "/** Drops the recording. */ void cancel() { try { if (control != null) { control.stopRecord(); } } catch (RuntimeException e) { // closing anyway } close(); }", "tokens": 41} {"id": 170650, "source": "method", "repo": "Engine-Room/Flywheel", "text": "protected void collectLightData(long ptr, long section) { var blockLayerListener = this.blockLayerListener; var skyLayerListener = this.skyLayerListener; var blockPos = new BlockPos.MutableBlockPos(); int xMin = SectionPos.sectionToBlockCoord(SectionPos.x(section)); int yMin = SectionPos.sectionToBlockCoord(SectionPos.y(section)); int zMin = SectionPos.sectionToBlockCoord(SectionPos.z(section)); for (int y = -1; y < 17; y++) { for (int z = -1; z < 17; z++) { for (int x = -1; x < 17; x++) { blockPos.set(xMin + x, yMin + y, zMin + z); write(ptr, x, y, z, blockLayerListener.getLightValue(blockPos), skyLayerListener.getLightValue(blockPos)); } } } }", "tokens": 203} {"id": 171374, "source": "method", "repo": "Engine-Room/Flywheel", "text": "public void testExtraDone() { WaitGroup wg = new WaitGroup(); wg.add(); wg.done(); assertThrows(IllegalStateException.class, wg::done); }", "tokens": 40} {"id": 171427, "source": "method", "repo": "Engine-Room/Flywheel", "text": "public ConfiguredElementImpl(VisualElement element, @Nullable C config, VisualizationPredicate predicate) { this.element = element; this.config = config; this.predicate = predicate; }", "tokens": 49} {"id": 171575, "source": "method", "repo": "enofex/taikai", "text": "/** Matches classes under {@code org.testcontainers}. @return the class predicate */ public static DescribedPredicate testcontainers() { return ClassCriteria.inPackage(\"org.testcontainers..\"); }", "tokens": 44} {"id": 171626, "source": "method", "repo": "enofex/taikai", "text": "/** Adds a rule enforcing that classes matching the given criteria must be annotated with a specific annotation by name. @param classes the classes to check, selected with {@link com.enofex.taikai.ClassCriteria} or an ArchUnit predicate @param annotationType the required annotation type name @return this configurer for fluent chaining @see com.enofex.taikai.ClassCriteria @see com.tngtech.archunit.base.DescribedPredicate */ public JavaConfigurer classesShouldBeAnnotatedWith(DescribedPredicate classes, String annotationType) { return classesShouldBeAnnotatedWith(classes, annotationType, defaultConfiguration()); }", "tokens": 119} {"id": 171679, "source": "method", "repo": "enofex/taikai", "text": "/** Enforces that methods returning {@code boolean} or {@code Boolean} start with one of the default prefixes {@code is}, {@code has}, {@code can}, or {@code should}.

Synthetic methods, {@code equals(Object)} overrides, and record component accessors are excluded from this check.

@return this configurer for fluent chaining */ public NamingConfigurer booleanMethodsShouldStartWith() { return booleanMethodsShouldStartWith(DEFAULT_BOOLEAN_METHOD_PREFIXES, defaultConfiguration()); }", "tokens": 106} {"id": 171705, "source": "method", "repo": "enofex/taikai", "text": "/** See {@link #shouldNotUseToolsAttributeInAiService()}, but with {@link TaikaiRule.Configuration} for customization. @param configuration the rule configuration @return this configurer for fluent chaining */ public AiConfigurer shouldNotUseToolsAttributeInAiService(TaikaiRule.Configuration configuration) { return addRule(TaikaiRule.of(classes() .that(are(annotatedWithRegisterAiService(true))) .should(notUseToolsAttribute()) .as(\"AI Services should not use the tools attribute to register tools, use @Toolbox\"), configuration)); }", "tokens": 114} {"id": 171734, "source": "method", "repo": "enofex/taikai", "text": "/** See {@link #shouldBeAnnotatedWithValidated(DescribedPredicate)}, but with {@link Configuration} for customization. @param classes the controller classes @param configuration the rule configuration @return this configurer for fluent chaining @see com.enofex.taikai.ClassCriteria @see com.tngtech.archunit.base.DescribedPredicate */ public ControllersConfigurer shouldBeAnnotatedWithValidated( DescribedPredicate classes, Configuration configuration) { return addRule(TaikaiRule.of(classes() .that(classes) .should(beAnnotatedWithValidated()) .as(\"Controllers %s that have validation annotations on @RequestParam or @PathVariable parameters should be annotated with %s\" .formatted(classes.getDescription(), ANNOTATION_VALIDATED)), configuration)); }", "tokens": 155} {"id": 171775, "source": "method", "repo": "enofex/taikai", "text": "/** Adds a rule enforcing that methods annotated with {@code @Transactional} are public.

Spring's default proxy-based transaction management only applies to public methods. A {@code @Transactional} annotation on a non-public method is silently ignored and no transaction is created at runtime.

@return this configurer for fluent chaining */ public TransactionalConfigurer methodsShouldBePublic() { return methodsShouldBePublic(defaultConfiguration()); }", "tokens": 88} {"id": 171874, "source": "method", "repo": "enofex/taikai", "text": "void shouldReportOnlyPresentForbiddenClassModifiers() { when(this.mockClass.getModifiers()).thenReturn( EnumSet.of(JavaModifier.PUBLIC, JavaModifier.ABSTRACT)); when(this.mockClass.getFullName()).thenReturn(\"com.example.MyClass\"); ArchConditions.notHasClassModifiers(EnumSet.of(JavaModifier.ABSTRACT, JavaModifier.FINAL)) .check(this.mockClass, this.events); assertEquals(\"Class com.example.MyClass has forbidden modifier(s): ABSTRACT\", capturedDescription()); }", "tokens": 111} {"id": 171999, "source": "method", "repo": "enofex/taikai", "text": "void shouldNotThrowWhenSelectedClassesCarryAllAnnotations() { Taikai taikai = Taikai.builder() .classes(AnnotatedApi.class) .java(java -> java.classesShouldBeAnnotatedWithAll(ClassCriteria.nameMatching(\".*Api\"), List.of(Marker.class.getName(), Required.class.getName()))) .build(); assertDoesNotThrow(taikai::check); }", "tokens": 76} {"id": 172089, "source": "method", "repo": "enofex/taikai", "text": "private UserEntity result() { return null; }", "tokens": 11} {"id": 172208, "source": "method", "repo": "enofex/taikai", "text": "void shouldThrowWhenResourceNameDoesNotEndWithResource() { Taikai taikai = Taikai.builder() .classes(BadController.class) .quarkus(quarkus -> quarkus.resources(ResourcesConfigurer::namesShouldEndWithResource)) .build(); assertThrows(AssertionError.class, taikai::check); }", "tokens": 62} {"id": 172472, "source": "method", "repo": "eobermuhlner/big-math", "text": "/** Returns the number pi.

See Wikipedia: Pi

@param mathContext the {@link MathContext} used for the result @return the number pi with the precision specified in the mathContext @throws UnsupportedOperationException if the {@link MathContext} has unlimited precision */ public static BigDecimal pi(MathContext mathContext) { checkMathContext(mathContext); BigDecimal result = null; synchronized (piCacheLock) { if (piCache != null && mathContext.getPrecision() <= piCache.precision()) { result = piCache; } else { piCache = piChudnovski(mathContext); return piCache; } } return round(result, mathContext); }", "tokens": 157} {"id": 172515, "source": "method", "repo": "eobermuhlner/big-math", "text": "/** Returns the {@link BigFloat} that is this / x. @param x the value to divide with @return the resulting {@link BigFloat} @see BigDecimal#divide(BigDecimal, MathContext) */ public BigFloat divide(long x) { return divide(context.valueOf(x)); }", "tokens": 62} {"id": 172585, "source": "method", "repo": "eobermuhlner/big-math", "text": "/** Returns the {@link RoundingMode} of this context.

This is equivalent to calling getMathContext().getRoundingMode(). @return the {@link RoundingMode} */ public RoundingMode getRoundingMode() { return mathContext.getRoundingMode(); }", "tokens": 49} {"id": 172728, "source": "method", "repo": "eobermuhlner/big-math", "text": "/** Calculates the hyperbolic sine of {@link BigDecimal} x using the current {@link MathContext}. @param x the {@link BigDecimal} to calculate the hyperbolic sine for @return the calculated hyperbolic sine {@link BigDecimal} with the precision specified in the current {@link MathContext} @see #currentMathContext() @see BigDecimalMath#sinh(BigDecimal, MathContext) */ public static BigDecimal sinh(BigDecimal x) { return BigDecimalMath.sinh(x, currentMathContext()); }", "tokens": 100} {"id": 172729, "source": "method", "repo": "eobermuhlner/big-math", "text": "/** Calculates the hyperbolic cosine of {@link BigDecimal} x using the current {@link MathContext}. @param x the {@link BigDecimal} to calculate the hyperbolic cosine for @return the calculated hyperbolic cosine {@link BigDecimal} with the precision specified in the current {@link MathContext} @see #currentMathContext() @see BigDecimalMath#cosh(BigDecimal, MathContext) */ public static BigDecimal cosh(BigDecimal x) { return BigDecimalMath.cosh(x, currentMathContext()); }", "tokens": 97} {"id": 172760, "source": "method", "repo": "eobermuhlner/big-math", "text": "public PowerTwoNPlusOneIterator(BigDecimal x, MathContext mathContext) { this.mathContext = mathContext; xPowerTwo = x.multiply(x, mathContext); powerOfX = x; }", "tokens": 41} {"id": 172794, "source": "method", "repo": "eobermuhlner/big-math", "text": "public void forEachRemaining(Consumer action) { while (count > 0) { action.accept(value); value = value.add(step); count--; } }", "tokens": 41} {"id": 173353, "source": "method", "repo": "eobermuhlner/big-math", "text": "public static void performanceReportOverLambda(String name, int count, int repeats, Function convert, List functionNames, Function... functions) { performanceReportOverLambda(name, count, 1, repeats, convert, functionNames, functions); }", "tokens": 74} {"id": 173543, "source": "method", "repo": "epam/ngb", "text": "public void save(final ProjectDescription projectDescription, final byte[] content) { projectDescription.setId(daoHelper.createId(projectDescriptionSequenceName)); getNamedParameterJdbcTemplate().update(saveProjectDescriptionQuery, ProjectDescriptionParameters.getParameters(projectDescription, content)); }", "tokens": 57} {"id": 173739, "source": "method", "repo": "epam/ngb", "text": "public String getDescription() { return null; }", "tokens": 10} {"id": 173792, "source": "method", "repo": "epam/ngb", "text": "/** Gets the value of the protLoc property. @return possible object is {@link Integer } */ public Integer getProtLoc() { return protLoc; }", "tokens": 35} {"id": 173806, "source": "method", "repo": "epam/ngb", "text": "public void importHomologData(final String databaseName, final String databasePath) throws IOException { Assert.isTrue(!TextUtils.isBlank(databaseName), \"Database name is required\"); getFile(databasePath); deleteData(databaseName); HomologDatabase database = HomologDatabase.builder() .name(databaseName.trim().toUpperCase()) .path(databasePath) .build(); database = homologDatabaseDao.save(database); final long databaseId = database.getDatabaseId(); readAndSaveData(databasePath, databaseId); }", "tokens": 118} {"id": 173884, "source": "method", "repo": "epam/ngb", "text": "public Heatmap createHeatmap(final HeatmapRegistrationRequest request) throws IOException { final String path = request.getPath(); getFile(path); final Heatmap heatmap = getHeatmap(request, path); final List> contentAsList = new LinkedList<>(); readHeatmap(heatmap, contentAsList, request.getSkipRows(), request.getSkipColumns()); final Map labelAnnotation = readLabelAnnotation(heatmap.getLabelAnnotationPath()); updateHeatmapLabels(heatmap, labelAnnotation); final byte[] cellAnnotation = !TextUtils.isBlank(path) ? null : getCellAnnotation(heatmap); final byte[] rowTree = readFileContent(heatmap.getRowTreePath(), heatmap, h -> checkTree(getLabelSet(h.getRowLabels()), h.getRowTreePath())); final byte[] columnTree = readFileContent(heatmap.getColumnTreePath(), heatmap, h -> checkTree(getLabelSet(h.getColumnLabels()), h.getColumnTreePath())); biologicalDataItemManager.createBiologicalDataItem(heatmap); heatmap.setBioDataItemId(heatmap.getId()); return heatmapDao.saveHeatmap(heatmap, listToData(contentAsList), cellAnnotation, rowTree, columnTree); }", "tokens": 251} {"id": 173886, "source": "method", "repo": "epam/ngb", "text": "public static byte[] listToData(List> data) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bos); oos.writeObject(data); oos.flush(); return bos.toByteArray(); }", "tokens": 53} {"id": 173897, "source": "method", "repo": "epam/ngb", "text": "private LLMHandler getHandler(final LLMProvider provider) { final LLMHandler handler = handlers.get(provider); Assert.notNull(handler, provider + \" is not supported.\"); return handler; }", "tokens": 42} {"id": 174027, "source": "method", "repo": "epam/ngb", "text": "protected Track getWigFromFile(final WigFile wigFile, final Track track, final Chromosome chromosome, EhCacheBasedIndexCache indexCache) throws IOException { Assert.notNull(wigFile, getMessage(MessagesConstants.ERROR_FILE_NOT_FOUND)); TrackHelper.fillBlocks(track, indexes -> new Wig(indexes.getLeft(), indexes.getRight())); String downsamplePath = fileManager.getWigFilePath(wigFile, chromosome); if (dontNeedToUseDownsampling(track, chromosome)) { fillBlocksFromFile(wigFile.getPath(), track, chromosome.getName()); } else { if (downsamplePath == null) { LOGGER.debug(\"Downsampled WIG for file {}:{} not found, using original\", wigFile.getId(), wigFile.getPath()); fillBlocksFromFile(wigFile.getPath(), track, chromosome.getName()); } else { fillBlocksFromFile(downsamplePath, track, chromosome.getName()); } } return track; }", "tokens": 214} {"id": 174058, "source": "method", "repo": "epam/ngb", "text": "/** Logger for SAML events, cannot be null, must be set. @param samlLogger logger */ public void setSamlLogger(SAMLLogger samlLogger) { Assert.notNull(samlLogger, \"SAML Logger can't be null\"); this.samlLogger = samlLogger; }", "tokens": 61} {"id": 174105, "source": "method", "repo": "epam/ngb", "text": "public T next() { return null; }", "tokens": 10} {"id": 174139, "source": "method", "repo": "epam/ngb", "text": "public void createBamFileIdTest() { final Long testId = bamFileDao.createBamFileId(); assertNotNull(testId); assertTrue(testId > 0); }", "tokens": 39} {"id": 174223, "source": "method", "repo": "epam/ngb", "text": "private ApplicationOptions getOptions() { ApplicationOptions options = new ApplicationOptions(); if (name != null) { options.setName(name); } options.setParent(parent); options.setPrintTable(printTable); options.setPrintJson(printJson); options.setStrictSearch(!nonStrictSearch); options.setGeneFile(genes); options.setLocation(location); options.setNoGCContent(noGCContent); options.setForceDeletion(forceDeletion); options.setPrettyName(prettyName); options.setSpeciesVersion(speciesVersion); options.setUsers(users); options.setGroups(groups); options.setFiles(files); options.setTargets(targets); options.setDatasets(datasets); if (doNotCreateTabixIndex) { options.setCreateTabixIndex(false); } if (doNotIndex) { options.setDoIndex(false); } options.setMaxMemory(maxMemory); options.setShowPermissions(showPermissions); options.setDatabaseType(databaseType); options.setDatabasePath(databasePath); options.setHeatmapCellAnnotationPath(heatmapCellAnnotationPath); options.setHeatmapLabelAnnotationPath(heatmapLabelAnnotationPath); options.setHeatmapSkipRows(heatmapSkipRows); options.setHeatmapSkipColumns(heatmapSkipColumns); options.setPath(path); options.setHeatmapCellAnnotationType(HeatmapAnnotationType.from(heatmapCellAnnotationType)); options.setHeatmapRowAnnotationType(HeatmapAnnotationType.from(heatmapRowAnnotationType)); options.setHeatmapColumnAnnotationType(HeatmapAnnotationType.from(heatmapColumnAnnotationType)); options.setReference(reference); options.setTaxId(taxId); options.setTaxIds(taxIds); options.setSendContent(sendContent); options.setAlias(alias); options.setStep(step); options.setDescription(description); options.setMetadata(metadata); return options; }", "tokens": 389} {"id": 174290, "source": "method", "repo": "epam/ngb", "text": "private void testChangeParent(String dataset, String parent) { addDatasets(); server.addDatasetMovingWithParent(DATASET_ID, DATASET_PARENT_ID); DatasetMovingHandler handler = getDatasetMoveHandler(); ApplicationOptions options = new ApplicationOptions(); options.setParent(parent); handler.parseAndVerifyArguments(Collections.singletonList(dataset), options); Assert.assertEquals(RUN_STATUS_OK, handler.runCommand()); }", "tokens": 91} {"id": 174372, "source": "method", "repo": "erikzimmermann/tradesystem", "text": "public static void log(String message) { Bukkit.getLogger().info(message); }", "tokens": 19} {"id": 174551, "source": "method", "repo": "erikzimmermann/tradesystem", "text": "public Class getTargetClass() { return ShowGriefDefenderIcon.class; }", "tokens": 24} {"id": 174666, "source": "method", "repo": "erikzimmermann/tradesystem", "text": "public ItemStack getCurrentOfferedItem(@NotNull Perspective perspective, int slotId) { if (perspective.isSecondary()) return getReceived(slotId); else return guis[0].getItem(slots.get(slotId)); }", "tokens": 49} {"id": 174722, "source": "method", "repo": "erikzimmermann/tradesystem", "text": "/** @param player The player that should pick up the provided item @param item The item that should be added. @return True if this item was dropped. False if this item was added to the inventory. */ private boolean addOrDropItem(@NotNull Player player, @NotNull ItemStack item) { int fit = checkItemFit(player, item); if (item.getAmount() > fit) { //move remaining items into inventory item.setAmount(item.getAmount() - fit); player.getInventory().addItem(item); } if (fit > 0) { //drop not fitting items item.setAmount(fit); return dropItem(player, item); } else return false; }", "tokens": 143} {"id": 175084, "source": "method", "repo": "erikzimmermann/tradesystem", "text": "public void onPluginMessageReceived(@NotNull String tag, @NotNull Player player, byte[] bytes) { if (tag.equals(getChannelBackend())) receive(bytes, player); }", "tokens": 38} {"id": 175247, "source": "method", "repo": "esotericsoftware/yamlbeans", "text": "public YamlReaderException (String message, Throwable cause) { super(\"Line \" + parser.getLineNumber() + \", column \" + parser.getColumn() + \": \" + message, cause); }", "tokens": 41} {"id": 175842, "source": "method", "repo": "esoxjem/movieguide", "text": "public List getMovieList() { return movies; }", "tokens": 16} {"id": 176121, "source": "method", "repo": "eugenp/tutorials", "text": "public void givenThreeArrayLists_whenJoiningIntoOneArrayList_shouldSucceed() { ArrayList> toppings = new ArrayList<>(); toppings.add(sauces); toppings.add(cheeses); toppings.add(vegetables); Assert.assertTrue(toppings.size() == 3); Assert.assertTrue(toppings.contains(sauces)); Assert.assertTrue(toppings.contains(cheeses)); Assert.assertTrue(toppings.contains(vegetables)); }", "tokens": 119} {"id": 176143, "source": "method", "repo": "eugenp/tutorials", "text": "public long iterateUsingStreamAPIAndKeySet(Map map) { return map.keySet() .stream() .mapToLong(map::get) .sum(); }", "tokens": 42} {"id": 176285, "source": "method", "repo": "eugenp/tutorials", "text": "public void givenCharArray_whenJoinBySeparator_thenReturnsString_through_CommonsLang() { assertThat(StringUtils.join(charArray, separatorChar)).isEqualTo(expectedCharString); assertThat(StringUtils.join(ArrayUtils.toObject(charArray), separator)).isEqualTo(expectedCharString); }", "tokens": 64} {"id": 176294, "source": "method", "repo": "eugenp/tutorials", "text": "public static String usingSubstringMethod(String text, int length) { if (length < 0) { throw new IllegalArgumentException(\"length cannot be negative\"); } if (text == null) { return EMPTY; } if (text.length() <= length) { return text; } else { return text.substring(0, length); } }", "tokens": 72} {"id": 176405, "source": "method", "repo": "eugenp/tutorials", "text": "public void givenNum_validateNum_expectStatus() { Result result = PipeDemo.validate(80); assertEquals(result, Result.SUCCESS); }", "tokens": 33} {"id": 176421, "source": "method", "repo": "eugenp/tutorials", "text": "public void whenModifyValue_thenCorrect() { this.cache.invoke(\"key\", new SimpleEntryProcessor()); assertEquals(\"value - modified\", cache.get(\"key\")); }", "tokens": 37} {"id": 176503, "source": "method", "repo": "eugenp/tutorials", "text": "private void printDocuments(List docs) { for(JsonDocument doc : docs) { String key = doc.id(); logger.info(key + \" = \" + doc.content().toString()); } }", "tokens": 48} {"id": 176558, "source": "method", "repo": "eugenp/tutorials", "text": "public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((date == null) ? 0 : date.hashCode()); result = prime * result + ((venue == null) ? 0 : venue.hashCode()); return result; }", "tokens": 67} {"id": 176634, "source": "method", "repo": "eugenp/tutorials", "text": "public ChatResponse chat(ChatRequest chatRequest) { UUID chatId = Optional .ofNullable(chatRequest.chatId()) .orElse(UUID.randomUUID()); String answer = chatClient .prompt() .user(chatRequest.question()) .advisors(advisorSpec -> advisorSpec .param(\"chat_memory_conversation_id\", chatId)) .call() .content(); return new ChatResponse(chatId, answer); }", "tokens": 94} {"id": 177742, "source": "method", "repo": "EvenMoreFish/EvenMoreFish", "text": "private StubFishCaughtOutOfTotalPlaceholder(List allFish, Map caughtFish) { this.allFish = allFish; this.caughtFish = caughtFish; }", "tokens": 44} {"id": 177744, "source": "method", "repo": "EvenMoreFish/EvenMoreFish", "text": "void placeholdersReturnDefaultsWhenUserReportIsMissing() { UUID uuid = UUID.randomUUID(); OfflinePlayer player = offlinePlayer(uuid); assertEquals(\"0\", new StubTotalCompetitionsJoinedPlaceholder(null).parsePAPI(player, \"total_competitions_joined_player\")); assertEquals(\"0\", new StubTotalCompetitionsWonPlaceholder(null).parsePAPI(player, \"total_competitions_won_player\")); assertEquals(\"0\", new StubTotalFishCaughtPlaceholder(null).parsePAPI(player, \"total_fish_caught_player\")); assertEquals(\"0\", new StubTotalFishSoldPlaceholder(null).parsePAPI(player, \"total_fish_sold_player\")); assertEquals(\"0.00\", new StubTotalMoneyEarnedPlaceholder(null).parsePAPI(player, \"total_money_earned_player\")); }", "tokens": 187} {"id": 177836, "source": "method", "repo": "exacaster/lighter", "text": "public List getPyFiles() { return pyFiles; }", "tokens": 16} {"id": 178090, "source": "method", "repo": "exacaster/lighter", "text": "public LockProvider lockProvider(DataSource dataSource) { DataSource unwrappedDataSource = ((DelegatingDataSource) dataSource).getTargetDataSource(); return new JdbcTemplateLockProvider( JdbcTemplateLockProvider.Configuration.builder() .withJdbcTemplate(new JdbcTemplate(unwrappedDataSource)) .usingDbTime() .build() ); }", "tokens": 69} {"id": 178135, "source": "method", "repo": "exceptionflug/protocolize", "text": "static ChatElement ofJson(String json) { return ChatElementImpl.ofJson(json); }", "tokens": 28} {"id": 178162, "source": "method", "repo": "exceptionflug/protocolize", "text": "public void dragging(boolean dragging) { if (!dragging) draggingSlots.clear(); this.dragging = dragging; }", "tokens": 25} {"id": 178495, "source": "method", "repo": "exceptionflug/protocolize", "text": "public ProtocolizeEncoderChannelHandler(Direction streamDirection) { this.streamDirection = streamDirection; }", "tokens": 21} {"id": 178559, "source": "method", "repo": "exceptionflug/protocolize", "text": "public static void sendLegacyMessage(CommandSource commandSource, String message) { commandSource.sendMessage(COMPONENT_SERIALIZER.deserialize(message)); }", "tokens": 30} {"id": 178571, "source": "method", "repo": "exercism/java", "text": "public void incrementTodaysCount() { birdsPerDay[birdsPerDay.length - 1]++; }", "tokens": 24} {"id": 178696, "source": "method", "repo": "exercism/java", "text": "public void implementedDescribeTravelMethod() { assertThat(new GameMasterProxy().hasMethod(\"describe\", TravelMethod.class)) .withFailMessage(\"Please implement the 'describe(TravelMethod travelMethod)' \" + \"method\") .isTrue(); assertThat(new GameMasterProxy().isMethodPublic(\"describe\", TravelMethod.class)) .withFailMessage(\"Method 'describe(TravelMethod travelMethod)' must be public\") .isTrue(); assertThat(new GameMasterProxy().isMethodReturnType(String.class, \"describe\", TravelMethod.class)) .withFailMessage(\"Method 'describe(TravelMethod travelMethod)' must return a String\") .isTrue(); }", "tokens": 147} {"id": 178878, "source": "method", "repo": "exercism/java", "text": "CustomSet getDifference(CustomSet anotherSet) { final Predicate predicate = anotherSet::contains; return new CustomSet<>( set.stream() .filter(predicate.negate()) .collect(Collectors.toList()) ); }", "tokens": 58} {"id": 179509, "source": "method", "repo": "exercism/java", "text": "public void testPostfixNotation() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> solver.solve(\"What is 1 2 plus?\")) .withMessage(\"I'm sorry, I don't understand the question!\"); }", "tokens": 54} {"id": 179923, "source": "method", "repo": "exlll/configlib", "text": "public byte getA1_primByte() { return a1_primByte; }", "tokens": 18} {"id": 179983, "source": "method", "repo": "exlll/configlib", "text": "public void setA1_arrayPrimShort(short[] a1_arrayPrimShort) { this.a1_arrayPrimShort = a1_arrayPrimShort; }", "tokens": 37} {"id": 180095, "source": "method", "repo": "exlll/configlib", "text": "public Map> getA1_mapEnmListPoint() { return a1_mapEnmListPoint; }", "tokens": 30} {"id": 180179, "source": "method", "repo": "exlll/configlib", "text": "public List getA2_listEnm() { return a2_listEnm; }", "tokens": 22} {"id": 180236, "source": "method", "repo": "exlll/configlib", "text": "public Map getA2_mapIntegerInteger() { return a2_mapIntegerInteger; }", "tokens": 25} {"id": 180245, "source": "method", "repo": "exlll/configlib", "text": "public void setA2_mapLocalTimeLocalTime(Map a2_mapLocalTimeLocalTime) { this.a2_mapLocalTimeLocalTime = a2_mapLocalTimeLocalTime; }", "tokens": 41} {"id": 180293, "source": "method", "repo": "exlll/configlib", "text": "public ExampleConfigurationB1[][] getA2_arrayArrayB1() { return a2_arrayArrayB1; }", "tokens": 24} {"id": 180314, "source": "method", "repo": "exlll/configlib", "text": "public List getA2_listFile() { return a2_listFile; }", "tokens": 21} {"id": 180435, "source": "method", "repo": "exlll/configlib", "text": "/** Loads a configuration of the given type from the specified YAML file using the given {@code YamlConfigurationProperties} object. @param configurationFile the file the configuration is loaded from @param configurationType the type of configuration @param properties the configuration properties @param the configuration type @return a newly created configuration initialized with values taken from the configuration file @throws ConfigurationException if the configuration cannot be deserialized @throws IllegalArgumentException if the file does not exist or is not a regular file @throws NullPointerException if any parameter is null @throws RuntimeException if reading the configuration throws an exception @see YamlConfigurationStore#load(Path) */ public static T load( Path configurationFile, Class configurationType, YamlConfigurationProperties properties ) { final var store = new YamlConfigurationStore<>(configurationType, properties); return store.load(configurationFile); }", "tokens": 178} {"id": 180584, "source": "method", "repo": "exopandora/shouldersurfing", "text": "private static Vec3 entityViewVector(Entity entity, float partialTick) { var xRot = partialTick == 1.0F ? entity.getXRot() : Mth.rotLerp(partialTick, entity.xRotO, entity.getXRot()); var yRot = partialTick == 1.0F ? entity.getYRot() : Mth.rotLerp(partialTick, entity.yRotO, entity.getYRot()); var xRotDeg = xRot * Mth.DEG_TO_RAD; var yRotDegNegated = -yRot * Mth.DEG_TO_RAD; var a = Mth.cos(yRotDegNegated); var b = Mth.sin(yRotDegNegated); var c = Mth.cos(xRotDeg); var d = Mth.sin(xRotDeg); return new Vec3(b * c, -d, a * c); }", "tokens": 188} {"id": 180753, "source": "method", "repo": "exopandora/shouldersurfing", "text": "public boolean shouldApply(ComputeTargetCameraOffsetEvent event) { return event.getCameraEntity().isSprinting(); }", "tokens": 24} {"id": 180994, "source": "method", "repo": "exopandora/shouldersurfing", "text": "public boolean isTemporaryFirstPersonInConstrainedSpacesEnabled() { return this.isTemporaryFirstPersonInConstrainedSpacesEnabled.get(); }", "tokens": 26} {"id": 181066, "source": "method", "repo": "exopandora/shouldersurfing", "text": "private void playSeededSound( @Nullable Entity entity, double x, double y, double z, Holder soundEvent, SoundSource soundSource, float volume, float pitch, long seed, CallbackInfo ci ) { if (entity == null || entity != Minecraft.getInstance().player) { return; } if (!IShoulderSurfing.getInstance().isShoulderSurfing() || !Config.CLIENT.getAudioConfig().isPlayerSoundCentered()) { return; } if (MathHelper.roundDouble(entity.xo) == x && MathHelper.roundDouble(entity.yo) == y && MathHelper.roundDouble(entity.zo) == z) { var pos = SoundHelper.calcCameraCentricSoundPosition(entity); this.playSound(pos.x(), pos.y(), pos.z(), soundEvent.value(), soundSource, volume, pitch, false, seed); ci.cancel(); } }", "tokens": 191} {"id": 181078, "source": "method", "repo": "exopandora/shouldersurfing", "text": "private void preRender( S renderState, CameraRenderState camera, double x, double y, double z, PoseStack poseStack, SubmitNodeCollector submitNodeCollector, CallbackInfo ci ) { var cameraEntityRenderer = ShoulderSurfing.getInstance().getCameraEntityRenderer(); if (renderState == cameraEntityRenderer.getCameraEntityRenderState()) { var minecraft = Minecraft.getInstance(); var entity = minecraft.getCameraEntity(); var tickRateManager = minecraft.level.tickRateManager(); var deltaTracker = minecraft.getDeltaTracker(); var partialTick = deltaTracker.getGameTimeDeltaPartialTick(!tickRateManager.isEntityFrozen(entity)); if (cameraEntityRenderer.preRenderCameraEntity(entity, partialTick)) { ci.cancel(); } } }", "tokens": 143} {"id": 181282, "source": "method", "repo": "f4b6a3/tsid-creator", "text": "private static int availableProcessors() { int processors = Runtime.getRuntime().availableProcessors(); if (processors < 4) { processors = 4; } return processors; }", "tokens": 37} {"id": 181291, "source": "method", "repo": "f4b6a3/tsid-creator", "text": "public void after() { // clear properties System.clearProperty(NODE); System.clearProperty(NODE_COUNT); }", "tokens": 24} {"id": 181438, "source": "method", "repo": "f4b6a3/uuid-creator", "text": "private static GUID v1(LongSupplier msec, LongSupplier random) { final long time = gregorian(msec.getAsLong()); final long msb = (time << 32) | ((time >>> 16) & (MASK_16 << 16)) | ((time >>> 48) & MASK_12); final long lsb = random.getAsLong() | MULTICAST; return version(msb, lsb, 1); }", "tokens": 105} {"id": 181456, "source": "method", "repo": "f4b6a3/uuid-creator", "text": "/** Converts the GUID into a canonical string. */ public String toString() { return toUUID().toString(); }", "tokens": 23} {"id": 181739, "source": "method", "repo": "f4b6a3/uuid-creator", "text": "/** Returns a time-ordered unique identifier (UUIDv7). @return a UUIDv7 */ public UUID create() { UUID uuid = this.uuidFunction.apply(null); return toUuid(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits()); }", "tokens": 54} {"id": 181893, "source": "method", "repo": "f4b6a3/uuid-creator", "text": "/** Set a property. @param key the key @param value the value */ public static void setProperty(String key, String value) { System.setProperty(getPropertyName(key), value); }", "tokens": 42} {"id": 181916, "source": "method", "repo": "f4b6a3/uuid-creator", "text": "public void testEquals() { SplittableRandom seeder = new SplittableRandom(1); byte[] bytes = new byte[GUID.GUID_BYTES]; for (int i = 0; i < DEFAULT_LOOP_MAX; i++) { (new Random(seeder.nextLong())).nextBytes(bytes); GUID guid1 = new GUID(bytes); GUID guid2 = new GUID(bytes); assertEquals(guid1, guid2); assertEquals(guid1.toString(), guid2.toString()); assertEquals(Arrays.toString(guid1.toBytes()), Arrays.toString(guid2.toBytes())); // change all bytes for (int j = 0; j < bytes.length; j++) { bytes[j]++; } GUID guid3 = new GUID(bytes); assertNotEquals(guid1, guid3); assertNotEquals(guid1.toString(), guid3.toString()); assertNotEquals(Arrays.toString(guid1.toBytes()), Arrays.toString(guid3.toBytes())); } }", "tokens": 197} {"id": 181952, "source": "method", "repo": "f4b6a3/uuid-creator", "text": "public void testDecodeBase64() { final UuidCodec codec = new Base64Codec(); Encoder encoder = Base64.getEncoder(); for (int i = 0; i < DEFAULT_LOOP_LIMIT; i++) { UUID uuid = UUID.randomUUID(); byte[] bytes = CODEC_BYTES.encode(uuid); String string = encoder.encodeToString(bytes).substring(0, 22); UUID actual = codec.decode(string); assertEquals(uuid.toString(), actual.toString()); } }", "tokens": 113} {"id": 182101, "source": "method", "repo": "f4b6a3/uuid-creator", "text": "public void testGetRandomBasedWithRandomFunction() { SplittableRandom random = new SplittableRandom(1); UUID[] list = new UUID[DEFAULT_LOOP_MAX]; LongSupplier randomFunction = () -> random.nextLong(); RandomBasedFactory factory = new RandomBasedFactory(randomFunction); for (int i = 0; i < DEFAULT_LOOP_MAX; i++) { list[i] = factory.create(); } checkNotNull(list); checkUniqueness(list); checkVersion(list, UuidVersion.VERSION_RANDOM_BASED.getValue()); }", "tokens": 116} {"id": 182128, "source": "method", "repo": "f4b6a3/uuid-creator", "text": "private Clock clock(Instant instant) { return Clock.fixed(instant, ZoneId.of(\"UTC\")); }", "tokens": 23} {"id": 182158, "source": "method", "repo": "f4b6a3/uuid-creator", "text": "public static void execute(UuidFactory factory, int threadCount, int requestCount, boolean verbose) { UniquenessTest3 test = new UniquenessTest3(factory, threadCount, requestCount, verbose); test.start(); }", "tokens": 49} {"id": 182229, "source": "method", "repo": "fabienrenaud/java-json-benchmark", "text": "public JsonBench() { JSONVmOptions.disableIntrinsicCandidate(); JSONVmOptions.disableIncubatorVector(); }", "tokens": 26} {"id": 182238, "source": "method", "repo": "fabienrenaud/java-json-benchmark", "text": "public Object flexjson() throws Exception { return null; }", "tokens": 14} {"id": 182244, "source": "method", "repo": "fabienrenaud/java-json-benchmark", "text": "public Object johnzon() throws Exception { return null; }", "tokens": 15} {"id": 182280, "source": "method", "repo": "fabienrenaud/java-json-benchmark", "text": "public static int nextInt(int bound) { return RANDOM.nextInt(bound); }", "tokens": 20} {"id": 182370, "source": "method", "repo": "fabienrenaud/java-json-benchmark", "text": "public void setGuid(UUID guid) { this.guid = guid; }", "tokens": 17} {"id": 182396, "source": "method", "repo": "fabienrenaud/java-json-benchmark", "text": "public String convertToString(LocalDate object) { return object.toString(); }", "tokens": 16} {"id": 182634, "source": "method", "repo": "fabioz/startexplorer", "text": "public static LogFacility getLogFacility() { if (defaultInstance != null && defaultInstance.getContext() != null) { return defaultInstance.getContext().getLogFacility(); } else { return new LogFacility(); } }", "tokens": 44} {"id": 182898, "source": "method", "repo": "fabioz/startexplorer", "text": "/** Sets the handler activation token for the editor. @param handlerActivation the handler activation token or {@code null} (to remove an existing reference) */ void setHandlerActivationForEditor(IHandlerActivation handlerActivation) { this.handlerActivationForEditor = handlerActivation; }", "tokens": 57} {"id": 182943, "source": "method", "repo": "fabioz/startexplorer", "text": "/** Exports {@code commandConfig} to a file in the workpace. The workspace automatically recongnizes the new file. @param commandConfig the {@link CommandConfig} to export @param file the {@link IFile} to write to @throws CoreException if something goes wrong while exporting */ public void exportCommandConfigToFile(CommandConfig commandConfig, IFile file) throws CoreException { String jsonString = JSONValue .toJSONString(commandConfigToJsonObject(commandConfig)); ByteArrayInputStream inputStream = new ByteArrayInputStream( jsonString.getBytes()); if (file.exists()) { file.setContents(inputStream, true, false, null); } else { file.create(inputStream, true, null); } }", "tokens": 145} {"id": 182961, "source": "method", "repo": "fabioz/startexplorer", "text": "CustomCommandForResourceHandlerDelegate getDelegate() { return new CustomCommandForResourceHandlerDelegate(this.commandConfig); }", "tokens": 26} {"id": 183096, "source": "method", "repo": "fabioz/startexplorer", "text": "private boolean loadAutoDetectDesktopEnvironment(IPreferenceStore store) { return store.getBoolean(KEY_AUTO_DETECT_DESKTOP_ENVIRONMENT); }", "tokens": 29} {"id": 183099, "source": "method", "repo": "fabioz/startexplorer", "text": "private CustomDesktopEnvironmentContainer loadCustomDesktopEnvironmentContainer( IPreferenceStore store) { return new CustomDesktopEnvironmentContainer( store .getString(KEY_CUSTOM_DESKTOP_ENVIRONMENT_COMMAND_START_FILE_MANAGER), store .getString(KEY_CUSTOM_DESKTOP_ENVIRONMENT_COMMAND_START_FILE_MANAGER_AND_SELECT_FILE), WorkingDirectoryMode.valueOf(store .getString(KEY_CUSTOM_DESKTOP_ENVIRONMENT_WORKING_DIRECTORY_MODE_FOR_START_FILE_MANAGER)), store.getString(KEY_CUSTOM_DESKTOP_ENVIRONMENT_COMMAND_START_SHELL), WorkingDirectoryMode.valueOf(store .getString(KEY_CUSTOM_DESKTOP_ENVIRONMENT_WORKING_DIRECTORY_MODE_FOR_START_SHELL)), store .getString(KEY_CUSTOM_DESKTOP_ENVIRONMENT_COMMAND_START_SYSTEM_APPLICATION), WorkingDirectoryMode.valueOf(store .getString(KEY_CUSTOM_DESKTOP_ENVIRONMENT_WORKING_DIRECTORY_MODE_FOR_START_SYSTEM_APPLICATION)), WorkingDirectoryMode.valueOf(store .getString(KEY_CUSTOM_DESKTOP_ENVIRONMENT_WORKING_DIRECTORY_MODE_FOR_CUSTOM_COMMANDS)), store .getBoolean(KEY_CUSTOM_DESKTOP_ENVIRONMENT_FILE_SELECTION_SUPPORTED), store .getBoolean(KEY_CUSTOM_DESKTOP_ENVIRONMENT_FILE_PARTS_WANT_WRAPPING)); }", "tokens": 282} {"id": 183536, "source": "method", "repo": "fabricmc/fabric-loom", "text": "public void processJar(Path jar, Spec spec, ProcessorContext context) throws IOException { TinyRemapper tinyRemapper = TinyRemapper.newRemapper(TinyRemapperLoggerAdapter.INSTANCE) .withMappings(spec.getMappings()) .build(); try (OutputConsumerPath outputConsumer = new OutputConsumerPath.Builder(jar).build()) { tinyRemapper.readInputs(jar); tinyRemapper.apply(outputConsumer); } catch (Exception e) { throw new RuntimeException(\"Failed to remap JAR \" + jar + \" with mapping \" + spec.annotationMapping(), e); } finally { tinyRemapper.finish(); } }", "tokens": 134} {"id": 183595, "source": "method", "repo": "fabricmc/fabric-loom", "text": "public static NoRemapMappingConfiguration create(Project project, DependencyInfo dependency, MinecraftProvider minecraftProvider) { final String version = dependency.getResolvedVersion(); final Path inputJar = resolveInputJar(dependency, \"annotations\"); final String[] dependencyParts = dependency.getDepString().split(\":\"); final String mappingsName = \"annotations.%s.%s.%s\".formatted(dependencyParts[0], dependencyParts[1], Checksum.of(inputJar).sha256().hex(12)); final TinyJarInfo jarInfo = readJarInfo(inputJar, dependency, minecraftProvider, \"annotations\"); final String mappingsIdentifier = createMappingsIdentifier(mappingsName, version, getMappingsClassifier(dependency, jarInfo.v2()), minecraftProvider.minecraftVersion()); var mappingConfiguration = new NoRemapMappingConfiguration(mappingsIdentifier, inputJar); mappingConfiguration.setup(project, minecraftProvider, dependency, \"annotations\"); return mappingConfiguration; }", "tokens": 199} {"id": 183697, "source": "method", "repo": "fabricmc/fabric-loom", "text": "public Common(Path path) { super(path, false, false, true, Type.COMMON); }", "tokens": 23} {"id": 184316, "source": "method", "repo": "facebook/stetho", "text": "public static void d(String tag, String message, Throwable t) { d(tag, message + \"\\n\" + formatThrowable(t)); }", "tokens": 34} {"id": 184324, "source": "method", "repo": "facebook/stetho", "text": "public static void w(Throwable t, String message) { if (isLoggable(Log.WARN)) { LogRedirector.w(TAG, message, t); } }", "tokens": 36} {"id": 184340, "source": "method", "repo": "facebook/stetho", "text": "public static Object getFieldValue(Field field, Object target) { try { return field.get(target); } catch (IllegalAccessException e) { throw new RuntimeException(e); } }", "tokens": 40} {"id": 184479, "source": "method", "repo": "facebook/stetho", "text": "public void onAccepted(SocketLike socket) throws IOException { mServer.serve(socket); }", "tokens": 21} {"id": 184737, "source": "method", "repo": "facebook/stetho", "text": "private static Object getOuter(Object innerWM) { try { Field parentField = innerWM.getClass().getDeclaredField(\"mWindowManager\"); parentField.setAccessible(true); Object outerWM = parentField.get(innerWM); parentField.setAccessible(false); return outerWM; } catch (NoSuchFieldException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } }", "tokens": 95} {"id": 184808, "source": "method", "repo": "facebook/stetho", "text": "public InputStream interpretResponseStream( String requestId, @Nullable String contentType, @Nullable String contentEncoding, @Nullable InputStream availableInputStream, ResponseHandler responseHandler) { NetworkPeerManager peerManager = getPeerManagerIfEnabled(); if (peerManager != null) { if (availableInputStream == null) { responseHandler.onEOF(); return null; } Page.ResourceType resourceType = contentType != null ? getResourceTypeHelper().determineResourceType(contentType) : null; // There's this weird logic at play that only knows how to base64 decode certain kinds of // resources. boolean base64Encode = false; if (resourceType != null && resourceType == Page.ResourceType.IMAGE) { base64Encode = true; } try { OutputStream fileOutputStream = peerManager.getResponseBodyFileManager().openResponseBodyFile( requestId, base64Encode); return DecompressionHelper.teeInputWithDecompression( peerManager, requestId, availableInputStream, fileOutputStream, contentEncoding, responseHandler); } catch (IOException e) { CLog.writeToConsole( peerManager, Console.MessageLevel.ERROR, Console.MessageSource.NETWORK, \"Error writing response body data for request #\" + requestId); } } return availableInputStream; }", "tokens": 254} {"id": 184939, "source": "method", "repo": "facebook/stetho", "text": "private EvaluateResponse buildExceptionResponse(Object retval) { EvaluateResponse response = new EvaluateResponse(); response.wasThrown = true; response.result = objectForRemote(retval); response.exceptionDetails = new ExceptionDetails(); response.exceptionDetails.text = retval.toString(); return response; }", "tokens": 67} {"id": 185012, "source": "method", "repo": "facebook/stetho", "text": "private static Frame createSimpleFrame(byte opcode, byte[] payload) { return createSimpleFrame(opcode, payload, payload.length); }", "tokens": 30} {"id": 185056, "source": "method", "repo": "facebook/stetho", "text": "public void setup() { mTestOutputStream = new ByteArrayOutputStream(); // The only place this is used is when trying to write to the console. Since we are going to // mock ResponseHandlingInputStream#writeToConsole passing null is fine. mNetworkPeerManager = null; mNetworkEventReporter = mock(NetworkEventReporterImpl.class); mResponseHandlingInputStream = new ResponseHandlingInputStream( new ByteArrayInputStream(TEST_RESPONSE_BODY), TEST_REQUEST_ID, mTestOutputStream, null /* decompressedCounter */, mNetworkPeerManager, new DefaultResponseHandler(mNetworkEventReporter, TEST_REQUEST_ID)); }", "tokens": 126} {"id": 185072, "source": "method", "repo": "facebook/stetho", "text": "/**

The zero-parameter constructor.

When Context.defineClass is called with this class, it will construct JsConsole.prototype using this constructor.

*/ public JsConsole() { // Empty }", "tokens": 48} {"id": 185151, "source": "method", "repo": "facebook/stetho", "text": "public List decorateRssItemsWithLinkImages(List rssItems) { ArrayList apodItems = new ArrayList<>(rssItems.size()); final CountDownLatch fetchLinkLatch = new CountDownLatch(rssItems.size()); for (RssItem rssItem : rssItems) { final ApodItem apodItem = new ApodItem(); apodItem.rssItem = rssItem; fetchLinkPage(rssItem.link, new PageScrapedCallback() { @Override public void onPageScraped(@Nullable List imageUrls) { apodItem.largeImageUrl = imageUrls != null && !imageUrls.isEmpty() ? imageUrls.get(0) : null; fetchLinkLatch.countDown(); } }); apodItems.add(apodItem); } // Wait for all link fetches to complete, despite running them in parallel... Util.awaitUninterruptibly(fetchLinkLatch); return apodItems; }", "tokens": 222} {"id": 185157, "source": "method", "repo": "facebook/stetho", "text": "public List parse() throws IOException, XmlPullParserException { ArrayList items = new ArrayList(); mParser.nextTag(); mParser.require(XmlPullParser.START_TAG, null, \"rss\"); mParser.nextTag(); mParser.require(XmlPullParser.START_TAG, null, \"channel\"); while (mParser.next() != XmlPullParser.END_TAG) { if (mParser.getEventType() != XmlPullParser.START_TAG) { continue; } String name = mParser.getName(); if (name.equals(\"item\")) { items.add(readItem()); } else { skip(); } } return items; }", "tokens": 150} {"id": 185204, "source": "method", "repo": "facebook/stetho", "text": "protected void log(int priority, String tag, String message, Throwable t) { ConsolePeerManager peerManager = ConsolePeerManager.getInstanceOrNull(); if (peerManager == null) { return; } Console.MessageLevel logLevel; switch (priority) { case Log.VERBOSE: case Log.DEBUG: logLevel = Console.MessageLevel.DEBUG; break; case Log.INFO: logLevel = Console.MessageLevel.LOG; break; case Log.WARN: logLevel = Console.MessageLevel.WARNING; break; case Log.ERROR: case Log.ASSERT: logLevel = Console.MessageLevel.ERROR; break; default: logLevel = Console.MessageLevel.LOG; } CLog.writeToConsole( logLevel, Console.MessageSource.OTHER, message ); }", "tokens": 160} {"id": 185217, "source": "method", "repo": "facebook/stetho", "text": "public URLConnectionInspectorHeaders(ArrayList> headers) { mHeaders = headers; }", "tokens": 24} {"id": 185228, "source": "method", "repo": "facebookincubator/battery-metrics", "text": "public AppWakeupMetrics sum(@Nullable AppWakeupMetrics b, @Nullable AppWakeupMetrics output) { if (output == null) { output = new AppWakeupMetrics(); } if (b == null) { output.set(this); } else { output.appWakeups.clear(); for (int i = 0; i < appWakeups.size(); i++) { String tag = appWakeups.keyAt(i); output.appWakeups.put( tag, new WakeupDetails(Preconditions.checkNotNull(appWakeups.valueAt(i)).reason)); // NULLSAFE_FIXME[Parameter Not Nullable] appWakeups.valueAt(i).sum(b.appWakeups.get(tag), output.appWakeups.get(tag)); } for (int i = 0; i < b.appWakeups.size(); i++) { String tag = b.appWakeups.keyAt(i); if (!output.appWakeups.containsKey(tag)) { // NULLSAFE_FIXME[Parameter Not Nullable] output.appWakeups.put(tag, b.appWakeups.valueAt(i)); } } } return output; }", "tokens": 228} {"id": 185254, "source": "method", "repo": "facebookincubator/battery-metrics", "text": "public void setIsValid(Class c, boolean isValid) { mMetricsValid.put(c, isValid ? Boolean.TRUE : Boolean.FALSE); }", "tokens": 32} {"id": 185319, "source": "method", "repo": "facebookincubator/battery-metrics", "text": "static SparseArray op(int op, SparseArray a, SparseArray b, SparseArray output) { output.clear(); for (int i = 0; i < a.size(); i++) { int aKey = a.keyAt(i); output.put(aKey, (K) opValues(op, a.valueAt(i), b.get(aKey))); } if (op == OP_SUM) { for (int i = 0; i < b.size(); i++) { int bKey = b.keyAt(i); if (a.get(bKey) == null) { output.put(bKey, b.valueAt(i)); } } } return output; }", "tokens": 174} {"id": 185354, "source": "method", "repo": "facebookincubator/battery-metrics", "text": "private static long makeIdleValue(long nextIdleS, long totalTransferS, long totalTailS) { // Saturate both 16-bit totals. Without clamping, a total exceeding 0xFFFF is not truncated -- // its high bits carry into the neighbouring field, so a tail overflow (reachable after roughly // 65535s of accumulated tail) silently corrupts totalTransferS, and a transfer overflow // corrupts nextIdleS. Saturating caps very long-lived processes instead of reporting one // field's overflow as another field's value. return (nextIdleS << 32) | (Math.min(totalTransferS, PACKED_FIELD_MAX_S) << 16) | Math.min(totalTailS, PACKED_FIELD_MAX_S); }", "tokens": 183} {"id": 185479, "source": "method", "repo": "facebookincubator/battery-metrics", "text": "public void testDiff() throws Exception { CompositeMetrics metricsA = createInitializedInstance(); CompositeMetrics metricsB = createInitializedInstance(); CompositeMetrics diff = createInstance(); metricsA.diff(metricsB, diff); assertThat(diff.getMetrics().size()).isEqualTo(1); assertThat(diff.getMetric(TimeMetrics.class).realtimeMs).isEqualTo(0); assertThat(diff.getMetric(TimeMetrics.class).uptimeMs).isEqualTo(0); }", "tokens": 101} {"id": 185648, "source": "method", "repo": "facebookincubator/battery-metrics", "text": "public void testUidChecks() throws Exception { StringBuilder contents = new StringBuilder(); contents.append(HEADERS).append(\"\\n\"); contents.append( createEntry( new HashMap() { { put(\"uid_tag_int\", \"1\"); put(\"iface\", \"rmnet0\"); put(\"rx_bytes\", \"100\"); put(\"tx_bytes\", \"200\"); } })); contents.append(\"\\n\"); QTagUidNetworkBytesCollector collector = new TestableCollector().setQTagUidStatsFile(createFile(contents.toString())); assertThat(collector.getTotalBytes(mBytes)).isTrue(); assertThat(mBytes).isEqualTo(new long[8]); }", "tokens": 149} {"id": 185675, "source": "method", "repo": "facebookincubator/battery-metrics", "text": "public void setUp() { PowerManager powerManager = (PowerManager) RuntimeEnvironment.application.getSystemService(Context.POWER_SERVICE); mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, \"batterytest:test\"); }", "tokens": 53} {"id": 185690, "source": "method", "repo": "facebookincubator/battery-metrics", "text": "public void testDefaultValues() { WakeLockMetrics metrics = new WakeLockMetrics(); assertThat(metrics.isAttributionEnabled).isFalse(); assertThat(metrics.tagTimeMs.isEmpty()).isTrue(); assertThat(metrics.heldTimeMs).isEqualTo(0); assertThat(metrics.acquiredCount).isEqualTo(0); }", "tokens": 62} {"id": 185726, "source": "method", "repo": "facebookincubator/battery-metrics", "text": "public boolean deserializeContents(CompositeMetrics metrics, DataInput input) throws IOException { // First, reset the metrics object to expect all invalid metrics SimpleArrayMap, SystemMetrics> all = metrics.getMetrics(); for (int i = 0, size = metrics.getMetrics().size(); i < size; i++) { metrics.setIsValid(all.keyAt(i), false); } int size = input.readInt(); for (int i = 0; i < size; i++) { long tag = input.readLong(); SystemMetricsSerializer deserializer = mDeserializers.get(tag); Class metricsClass = mDeserializerClasses.get(tag); if (deserializer == null || metricsClass == null) { return false; } SystemMetrics metric = metrics.getMetric(metricsClass); if (!deserializer.deserializeContents(metric, input)) { return false; } metrics.setIsValid(metricsClass, true); } return true; }", "tokens": 208} {"id": 185799, "source": "method", "repo": "faforever/downlords-faf-client", "text": "private void bindProperties() { categoryLabel.styleProperty() .bind(chatPrefs.groupToColorProperty() .flatMap(groupToColor -> chatUserCategory.map(groupToColor::get)) .map(JavaFxUtil::toRgbCode) .map(color -> String.format(\"-fx-text-fill: %s\", color)) .orElse(\"\") .when(showing)); categoryLabel.textProperty().bind(chatUserCategory.map(ChatUserCategory::getI18nKey).map(i18n::get).when(showing)); channelHiddenCategories.bind(Bindings.valueAt(chatPrefs.getChannelNameToHiddenCategories(), channelName) .orElse(FXCollections.observableSet()) .when(showing)); arrowLabel.textProperty() .bind(channelHiddenCategories.flatMap(hiddenCategories -> Bindings.createBooleanBinding(() -> hiddenCategories.contains(chatUserCategory.get()), hiddenCategories, chatUserCategory)) .map(hidden -> hidden ? \"\u02c3\" : \"\u02c5\").when(showing)); userCounterLabel.textProperty().bind(numCategoryItems.map(String::valueOf).when(showing)); }", "tokens": 259} {"id": 186047, "source": "method", "repo": "faforever/downlords-faf-client", "text": "private TableRow entriesRowFactory() { TableRow row = new TableRow<>(); row.setOnContextMenuRequested(event -> { LeagueEntry leagueEntry = row.getItem(); if (leagueEntry == null) { return; } PlayerInfo player = leagueEntry.player(); contextMenuBuilder.newBuilder() .addItem(ShowPlayerInfoMenuItem.class, player) .addItem(CopyUsernameMenuItem.class, player.getUsername()) .addSeparator() .addItem(AddFriendMenuItem.class, player) .addItem(RemoveFriendMenuItem.class, player) .addItem(AddFoeMenuItem.class, player) .addItem(RemoveFoeMenuItem.class, player) .addSeparator() .addItem(ViewReplaysMenuItem.class, player) .build() .show(getRoot().getScene().getWindow(), event.getScreenX(), event.getScreenY()); }); return row; }", "tokens": 201} {"id": 186115, "source": "method", "repo": "faforever/downlords-faf-client", "text": "public void navigateTo(NavigateEvent navigationEvent) { this.navigationEvent.set(navigationEvent); }", "tokens": 23} {"id": 186236, "source": "method", "repo": "faforever/downlords-faf-client", "text": "public void setSavedReplayQueries(ObservableMap savedReplayQueries) { this.savedReplayQueries.set(savedReplayQueries); }", "tokens": 33} {"id": 186286, "source": "method", "repo": "faforever/downlords-faf-client", "text": "public void sendIceMessage(int remotePlayerId, Object message) { sendGpgMessage(GpgGameOutboundMessage.Companion.iceMessage(remotePlayerId, message)); }", "tokens": 39} {"id": 186319, "source": "method", "repo": "faforever/downlords-faf-client", "text": "public Mono getMono() { return Mono.fromFuture(future); }", "tokens": 19} {"id": 186340, "source": "method", "repo": "faforever/downlords-faf-client", "text": "public boolean isInQueue() { return inQueue.get(); }", "tokens": 15} {"id": 186472, "source": "method", "repo": "faforever/downlords-faf-client", "text": "public void testDoubleClickInitiatesPrivateChat() { instance.setChatUser(defaultUser); runOnFxThreadAndWait(() -> instance.onItemClicked(MouseEvents.generateClick(MouseButton.PRIMARY, 2))); ArgumentCaptor captor = ArgumentCaptor.forClass(String.class); verify(chatService, times(1)).joinPrivateChat(captor.capture()); assertEquals(USER_NAME, captor.getValue()); }", "tokens": 88} {"id": 186574, "source": "method", "repo": "faforever/downlords-faf-client", "text": "public void testSetLastTerrainStyle() { generatorPrefs.getTerrainStyles().setAll(\"TEST\"); runOnFxThreadAndWait(() -> reinitialize(instance)); instance.setTerrainStyles(new ArrayList<>(List.of(\"TEST\"))); assertEquals(List.of(\"TEST\"), instance.terrainCheckComboBox.getCheckModel().getCheckedItems()); }", "tokens": 70} {"id": 186850, "source": "method", "repo": "FallingColors/HexMod", "text": "/** Convenience function to throw if the entity is out of the caster's range or the world */ public final void assertEntityInRange(Entity e) throws MishapEntityTooFarAway { if (e instanceof ServerPlayer && HexConfig.server().trueNameHasAmbit()) { return; } if (!this.isVecInWorld(e.position())) { throw new MishapEntityTooFarAway(e); } if (!this.isVecInRange(e.position())) { throw new MishapEntityTooFarAway(e); } }", "tokens": 116} {"id": 186994, "source": "method", "repo": "FallingColors/HexMod", "text": "public TreeList appended(A elem) { final int len1 = this.prefix1.length; if(len1 < WIDTH) return new TreeList1<>(copyAppend1(this.prefix1, elem)); else return new TreeList2<>(this.prefix1, WIDTH, empty2, wrap1(elem), WIDTH + 1); }", "tokens": 80} {"id": 187191, "source": "method", "repo": "FallingColors/HexMod", "text": "public Consumer getBrainsweepBehavior(EntityType mobType) { var behavior = SPECIAL_BRAINSWEEPS.getOrDefault(mobType, this.defaultBrainsweepingBehavior()); return (Consumer) behavior; }", "tokens": 59} {"id": 187331, "source": "method", "repo": "FallingColors/HexMod", "text": "public String toString() { return \"StateIngredientBlock{\" + block + \"}\"; }", "tokens": 17} {"id": 187394, "source": "method", "repo": "FallingColors/HexMod", "text": "public CrushingRecipe(ResourceLocation id) { this.id = id; }", "tokens": 18} {"id": 187450, "source": "method", "repo": "FallingColors/HexMod", "text": "public void onVariablesAvailable(UnaryOperator lookup) { this.patterns = this.getPatterns(lookup); }", "tokens": 27} {"id": 187589, "source": "method", "repo": "FallingColors/HexMod", "text": "public long dustMediaAmount() { return dustMediaAmount.get(); }", "tokens": 18} {"id": 187829, "source": "method", "repo": "falsehoodmc/fabrication", "text": "public String transformLine(String path, String line) { return second.transformLine(path, first.transformLine(path, line)); }", "tokens": 31} {"id": 187969, "source": "method", "repo": "falsehoodmc/fabrication", "text": "public String getConfigKey() { return \"*.crawling\"; }", "tokens": 15} {"id": 188068, "source": "method", "repo": "falsehoodmc/fabrication", "text": "private void runFabricationCommand(String message, CallbackInfo info) { if (FabricationClientCommands.runCommand(message)) { info.cancel(); } }", "tokens": 31} {"id": 188437, "source": "method", "repo": "falsehoodmc/fabrication", "text": "private static T getPrev(Collection values, T value) { T prev = null; Iterator iterator = values.iterator(); while (iterator.hasNext()) { T next = iterator.next(); if (next.equals(value)) { if (prev != null) { return prev; } } prev = next; } return prev; }", "tokens": 79} {"id": 188571, "source": "method", "repo": "falsehoodmc/fabrication", "text": "public NestedResult visitSubNbtType(NbtType type) { if (type == NbtList.TYPE || type == NbtString.TYPE || type == NbtCompound.TYPE) return NestedResult.ENTER; return NestedResult.SKIP; }", "tokens": 54} {"id": 188647, "source": "method", "repo": "fancymcplugins/fancyholograms", "text": "public HologramData copy(String name) { return new HologramData(name, type, this.getLocation()) .setVisibilityDistance(this.getVisibilityDistance()) .setVisibility(this.getVisibility()) .setPersistent(this.isPersistent()) .setLinkedNpcName(this.getLinkedNpcName()); }", "tokens": 66} {"id": 188963, "source": "method", "repo": "fancymcplugins/fancynpcs", "text": "/** Resets the current action index to its initial state. This is useful for re-running the sequence of actions from the beginning. */ public void reset() { actionIndex = 0; }", "tokens": 41} {"id": 189038, "source": "method", "repo": "fancymcplugins/fancynpcs", "text": "private static void setPose(Npc npc, String value) { Camel camel = ReflectionHelper.getEntity(npc); switch (value.toLowerCase()) { case \"standing\" -> { camel.setDashing(false); camel.standUp(); } case \"sitting\" -> { camel.setDashing(false); camel.sitDown(); } case \"dashing\" -> { camel.standUp(); camel.setDashing(true); } } }", "tokens": 104} {"id": 189074, "source": "method", "repo": "fancymcplugins/fancynpcs", "text": "public static List getAllAttributes() { List attributes = new ArrayList<>(); attributes.add(new NpcAttribute( \"casting\", Arrays.stream(SpellcasterIllager.IllagerSpell.values()).map(Enum::toString).toList(), Arrays.stream(EntityType.values()) .filter(type -> type.getEntityClass() != null && Spellcaster.class.isAssignableFrom(type.getEntityClass())) .toList(), SpellCasterAttributes::setPose )); return attributes; }", "tokens": 113} {"id": 189084, "source": "method", "repo": "fancymcplugins/fancynpcs", "text": "public Entity getNpc() { return npc; }", "tokens": 11} {"id": 189107, "source": "method", "repo": "fancymcplugins/fancynpcs", "text": "public static List getAllAttributes() { List attributes = new ArrayList<>(); attributes.add(new NpcAttribute( \"charging\", List.of(\"true\", \"false\"), List.of(EntityType.VEX), VexAttributes::setCharging )); return attributes; }", "tokens": 61} {"id": 189338, "source": "method", "repo": "fancymcplugins/fancynpcs", "text": "public void run() { Collection npcs = FancyNpcs.getInstance().getNpcManagerImpl().getAllNpcs(); int defaultTurnToPlayerDistance = FancyNpcs.getInstance().getFancyNpcConfig().getTurnToPlayerDistance(); for (Player player : Bukkit.getOnlinePlayers()) { Location playerLocation = player.getLocation(); for (Npc npc : npcs) { NpcData npcData = npc.getData(); Location npcLocation = npcData.getLocation(); if (npcLocation == null || !npcLocation.getWorld().getName().equalsIgnoreCase(playerLocation.getWorld().getName())) { continue; } double distance = playerLocation.distance(npcLocation); if (Double.isNaN(distance)) { continue; } // Get NPC-specific turn distance or fall back to default int npcTurnDistance = npcData.getTurnToPlayerDistance(); int effectiveTurnDistance = (npcTurnDistance == -1) ? defaultTurnToPlayerDistance : npcTurnDistance; if (npcData.isTurnToPlayer() && distance < effectiveTurnDistance) { Location newLoc = playerLocation.clone(); newLoc.setDirection(newLoc.subtract(npcLocation).toVector()); npc.lookAt(player, newLoc); // Setting NPC to be looking at the player and getting the value previously stored (or not) inside a map. Boolean wasPreviouslyLooking = npc.getIsLookingAtPlayer().put(player.getUniqueId(), true); // Comparing the previous state with current state to prevent event from being called continuously. if (wasPreviouslyLooking == null || !wasPreviouslyLooking) { // Calling NpcStartLookingEvent from the main thread. FancyNpcs.getInstance().getScheduler().runTask(null, () -> { Bukkit.getPluginManager().callEvent(new NpcStartLookingEvent(npc, player)); }); } // Updating state if changed. } else if (npcData.isTurnToPlayer() && npc.getIsLookingAtPlayer().getOrDefault(player.getUniqueId(), false)) { npc.getIsLookingAtPlayer().put(player.getUniqueId(), false); // Resetting to initial direction, if configured. if (FancyNpcs.getInstance().getFancyNpcConfig().isTurnToPlayerResetToInitialDirection()) { npc.move(player, false); } // Calling NpcStopLookingEvent from the main thread. FancyNpcs.getInstance().getScheduler().runTask(null, () -> { Bukkit.getPluginManager().callEvent(new NpcStopLookingEvent(npc, player)); }); } } } }", "tokens": 500} {"id": 189460, "source": "method", "repo": "fandreuz/TUI-ConsoleLauncher", "text": "public String exec(ExecutePack pack) { XMLPrefsSave save = pack.getPrefsSave(); return \"Type:\" + Tuils.SPACE + save.type() + Tuils.NEWLINE + \"Default:\" + Tuils.SPACE + save.defaultValue() + Tuils.NEWLINE + save.info(); }", "tokens": 65} {"id": 189937, "source": "method", "repo": "fandreuz/TUI-ConsoleLauncher", "text": "public String info() { return \"The max number of lines of notes (-1 to disable)\"; }", "tokens": 23} {"id": 190018, "source": "method", "repo": "fandreuz/TUI-ConsoleLauncher", "text": "/**

Utility method for obtaining an enum value from its corresponding int level value.

@param level the level @return the escape level enum constant, or IllegalArgumentException if level does not exist. */ public static HtmlEscapeLevel forLevel(final int level) { switch (level) { case 0: return LEVEL_0_ONLY_MARKUP_SIGNIFICANT_EXCEPT_APOS; case 1: return LEVEL_1_ONLY_MARKUP_SIGNIFICANT; case 2: return LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT; case 3: return LEVEL_3_ALL_NON_ALPHANUMERIC; case 4: return LEVEL_4_ALL_CHARACTERS; default: throw new IllegalArgumentException(\"No escape level enum constant defined for level: \" + level); } }", "tokens": 203} {"id": 190055, "source": "method", "repo": "fandreuz/TUI-ConsoleLauncher", "text": "/**

StreamGobbler constructor

We use this class because shell STDOUT and STDERR should be read as quickly as possible to prevent a deadlock from occurring, or Process.waitFor() never returning (as the buffer is full, pausing the native process)

@param shell Name of the shell @param inputStream InputStream to read from @param outputList {@literal List} to write to, or null */ public StreamGobbler(String shell, InputStream inputStream, List outputList) { this.shell = shell; reader = new BufferedReader(new InputStreamReader(inputStream)); writer = outputList; }", "tokens": 144} {"id": 190365, "source": "method", "repo": "farin/jcloisterzone", "text": "public Field(List places, Set adjoiningCities, boolean adjoiningCityOfCarcassonne, Map, Object> modifiers) { super(places); this.adjoiningCities = adjoiningCities; this.adjoiningCityOfCarcassonne = adjoiningCityOfCarcassonne; this.modifiers = modifiers; }", "tokens": 88} {"id": 190530, "source": "method", "repo": "farin/jcloisterzone", "text": "public SnapshotCorruptedException() { super(); }", "tokens": 11} {"id": 190718, "source": "method", "repo": "farin/jcloisterzone", "text": "protected GameState clearActions(GameState state) { return state.setPlayerActions(null); }", "tokens": 21} {"id": 190789, "source": "method", "repo": "farin/jcloisterzone", "text": "private void createTilePack() { TilePackBuilder tilePackBuilder = new TilePackBuilder(); tilePackBuilder.setGameState(state); tilePackBuilder.setTileSets(setup.getTileSets()); try { TilePack tilePack = tilePackBuilder.createTilePack(definitions); state = state.setTilePack(tilePack); } catch (IOException e) { throw new RuntimeException(\"Can't parse tile definitions\", e); } }", "tokens": 93} {"id": 190894, "source": "method", "repo": "farin/jcloisterzone", "text": "public PlaceTileMessage(String tileId, Rotation rotation, Position position) { this.tileId = tileId; this.rotation = rotation; this.position = position; }", "tokens": 39} {"id": 190959, "source": "method", "repo": "farin/jcloisterzone", "text": "public ImmutablePoint mirrorY() { return new ImmutablePoint(x,100-y); }", "tokens": 22} {"id": 191083, "source": "method", "repo": "feiniaojin/graceful-response", "text": "public Response process(HttpServletRequest request, HttpServletResponse response, @Nullable Object handler, Exception exception) { ResponseStatus statusLine = fromExceptionInstance(exception); return responseFactory.newInstance(statusLine); }", "tokens": 43} {"id": 191167, "source": "method", "repo": "felhr85/usbserial", "text": "public void onDestroy() { super.onDestroy(); serialPort.close(); unregisterReceiver(usbReceiver); UsbService.SERVICE_CONNECTED = false; }", "tokens": 31} {"id": 191211, "source": "method", "repo": "felhr85/usbserial", "text": "public void testSimpleWriteBufferAsync1(){ try { new Random().nextBytes(bigBuffer2); serialBuffer = new SerialBuffer(true); WriterThread writerThread = new WriterThread(serialBuffer, bigBuffer2); writerThread.start(); while(writerThread.getState() != Thread.State.TERMINATED){/*Busy waiting*/} ByteArrayOutputStream outputStream = new ByteArrayOutputStream( ); while(outputStream.size() < bigBuffer2.length){ byte[] srcData = serialBuffer.getWriteBuffer(); outputStream.write(srcData); } byte[] dataReceived = outputStream.toByteArray(); Assert.assertArrayEquals(bigBuffer2, dataReceived); } catch (IOException e) { e.printStackTrace(); } }", "tokens": 148} {"id": 191227, "source": "method", "repo": "felhr85/usbserial", "text": "private CH34xIds() { }", "tokens": 11} {"id": 191233, "source": "method", "repo": "felhr85/usbserial", "text": "public static boolean isDeviceSupported(UsbDevice dev) { return Helpers.exists(ftdiDevices, dev.getVendorId(), dev.getProductId()) || isMicrochipFtdi(dev); }", "tokens": 44} {"id": 191302, "source": "method", "repo": "felhr85/usbserial", "text": "private int checkState(String msg, int request, int value, int[] expected) { byte[] buffer = new byte[expected.length]; int ret = setControlCommandIn(request, value, 0, buffer); if (ret != expected.length) { Log.i(CLASS_ID, (\"Expected \" + expected.length + \" bytes, but get \" + ret + \" [\" + msg + \"]\")); return -1; }else { return 0; } }", "tokens": 102} {"id": 191414, "source": "method", "repo": "felhr85/usbserial", "text": "public boolean disconnectDevice(UsbDevice usbDevice){ List devices = Stream.of(serialDevices) .filter(p -> usbDevice.getDeviceId() == p.getDeviceId()) .toList(); int removedDevices = 0; for(UsbSerialDevice device : devices){ device.syncClose(); serialDevices = Utils.removeIf(serialDevices, p -> usbDevice.getDeviceId() == p.getDeviceId()); removedDevices ++; } return removedDevices == devices.size(); }", "tokens": 104} {"id": 191560, "source": "method", "repo": "FixedDev/command-flow", "text": "/** {@inheritDoc} */ public InputTokenizer getInputTokenizer() { return tokenizer; }", "tokens": 17} {"id": 191754, "source": "method", "repo": "FixedDev/command-flow", "text": "public CommandException(String message) { super(message); if (message == null) { this.message = null; return; } if (message.startsWith(\"%translatable:\") && message.endsWith(\"%\")) { this.message = Component.translatable(message.substring(14, message.length() - 1)); } else { this.message = Component.text(message); } }", "tokens": 83} {"id": 191866, "source": "method", "repo": "FixedDev/command-flow", "text": "public CommandPart getPart() { return part; }", "tokens": 11} {"id": 191966, "source": "method", "repo": "FixedDev/command-flow", "text": "public DefaultTranslator(TranslationProvider provider, Function stringTextComponentFunction) { this.provider = provider; stringToComponent = stringTextComponentFunction; }", "tokens": 35} {"id": 192001, "source": "method", "repo": "FixedDev/command-flow", "text": "public boolean execute(Namespace accessor, List arguments) throws CommandException { return delegate.execute(accessor, arguments); }", "tokens": 28} {"id": 192090, "source": "method", "repo": "FixedDev/command-flow", "text": "public BukkitMapCommandManager(String fallbackPrefix) { this(new SimpleCommandManager(), fallbackPrefix); setAuthorizer(new BukkitAuthorizer()); getTranslator().setProvider(new BukkitDefaultTranslationProvider()); getTranslator().setConverterFunction(LegacyComponentSerializer.legacyAmpersand()::deserialize); }", "tokens": 61} {"id": 192169, "source": "method", "repo": "FixedDev/command-flow", "text": "default boolean onCommand(CommandSender sender, Command command, String label, String[] args) { List argumentLine = new ArrayList<>(); argumentLine.add(label); argumentLine.addAll(Arrays.asList(args)); Namespace namespace = Namespace.create(); namespace.setObject(CommandSender.class, BukkitCommonConstants.SENDER_NAMESPACE, sender); namespace.setObject(String.class, \"label\", label); try { return commandManager().execute(namespace, argumentLine); } catch (CommandException e) { Throwable exceptionToSend = e; Throwable cause = e.getCause(); if (cause instanceof org.bukkit.command.CommandException) { throw (org.bukkit.command.CommandException) cause; } if (cause != null) { exceptionToSend = cause; } throw new org.bukkit.command.CommandException(\"An unexpected exception occurred while executing the command \" + label, exceptionToSend); } }", "tokens": 186} {"id": 192194, "source": "method", "repo": "FixedDev/command-flow", "text": "public UsageBuilder getUsageBuilder() { return commandManager.getUsageBuilder(); }", "tokens": 17} {"id": 192234, "source": "method", "repo": "FixedDev/command-flow", "text": "public List parseValue(CommandContext context, ArgumentStack stack, CommandPart parent) throws ArgumentParseException { Message message = context.getObject(Message.class, DiscordCommandManager.MESSAGE_NAMESPACE); Guild guild = message.getGuild(); String target = stack.next(); Member member = null; if (ArgumentsUtils.isValidSnowflake(target)) { member = guild.getMemberById(target); } if (member == null && ArgumentsUtils.isValidTag(target)) { member = guild.getMemberByTag(target); } if (member == null && ArgumentsUtils.isUserMention(target)) { String id = target.substring(3, target.length() - 1); member = guild.getMemberById(id); } if (member == null) { throw new ArgumentParseException(Component.translatable(\"unknown.member\")) .setArgument(this); } return Collections.singletonList(member); }", "tokens": 188} {"id": 192509, "source": "method", "repo": "flameish/novel-grabber", "text": "public List getBlacklistedTags() { List blacklistedTags = new ArrayList(); blacklistedTags.add(\".adsbox\"); blacklistedTags.add(\".trinity-player-iframe-wrapper\"); blacklistedTags.add(\"p[class]\"); return blacklistedTags; }", "tokens": 54} {"id": 192546, "source": "method", "repo": "flameish/novel-grabber", "text": "public n9kqw_com() { }", "tokens": 11} {"id": 192640, "source": "method", "repo": "flameish/novel-grabber", "text": "public NovelMetadata getMetadata() { NovelMetadata metadata = new NovelMetadata(); if (toc != null) { Element title = toc.selectFirst(\"meta[property=og:title]\"); Element author = toc.selectFirst(\"dl.author dd\"); Element desc = toc.selectFirst(\".book-synopsis\"); Element cover = toc.selectFirst(\"meta[property=og:image]\"); metadata.setTitle(title != null ? title.attr(\"content\") : \"\"); metadata.setAuthor(author != null ? author.text() : \"\"); metadata.setDescription(desc != null ? desc.text().replace(\"Synopsis\", \"\") : \"\"); metadata.setBufferedCover(cover != null ? cover.attr(\"abs:content\") : \"\"); Elements tags = toc.select(\".book-generes span\"); List subjects = new ArrayList<>(); for (Element tag : tags) { subjects.add(tag.text()); } metadata.setSubjects(subjects); } return metadata; }", "tokens": 209} {"id": 192652, "source": "method", "repo": "flameish/novel-grabber", "text": "public wuxiaworldsite_co() { }", "tokens": 13} {"id": 192699, "source": "method", "repo": "flameish/novel-grabber", "text": "private Library() { if (!config.getHost().isEmpty()) { try { emailClient = new EmailNotification(); } catch (Exception e) { GrabberUtils.err(\"Could not establish connection to SMTP Server. Check email settings and restart.\"); } } }", "tokens": 55} {"id": 192877, "source": "method", "repo": "FlashyReese/nuit", "text": "public Conditions(Condition biomes, Condition skyboxes, Condition dimensions, Condition effects, Condition weathers, Condition xRanges, Condition yRanges, Condition zRanges) { this.biomes = biomes; this.skyboxes = skyboxes; this.dimensions = dimensions; this.effects = effects; this.weathers = weathers; this.xRanges = xRanges; this.yRanges = yRanges; this.zRanges = zRanges; }", "tokens": 121} {"id": 192978, "source": "method", "repo": "FlashyReese/nuit", "text": "private void nuit$captureTickDelta(GraphicsResourceAllocator graphicsResourceAllocator, boolean renderBlockOutline, CameraRenderState cameraRenderState, GpuBufferSlice fogParameters, Vector4f shaderFogColor, boolean renderSky, boolean consistentDepthRequired, CallbackInfo ci) { nuit$tickDelta = Minecraft.getInstance().getDeltaTracker().getGameTimeDeltaPartialTick(false); }", "tokens": 73} {"id": 193298, "source": "method", "repo": "flashyreese/reeses-sodium-options", "text": "private void setDonationButtonVisibility(boolean value) { this.donateButton.setVisible(value); this.hideDonateButton.setVisible(value); }", "tokens": 36} {"id": 193328, "source": "method", "repo": "flashyreese/reeses-sodium-options", "text": "private static GuiEventListener focusedLeaf(@Nullable GuiEventListener listener) { if (listener instanceof ContainerEventHandler container) { GuiEventListener focused = container.getFocused(); if (focused != null) { return focusedLeaf(focused); } } return listener; }", "tokens": 50} {"id": 193520, "source": "method", "repo": "flashyreese/reeses-sodium-options", "text": "private int valueForThumbPosition() { SteppedValidator validator = this.option.getSteppedValidator(); int step = validator.step(); int min = validator.min(); int max = validator.max(); return Mth.clamp(min + step * (int) Math.round(this.thumbPosition * (max - min) / (double) step), min, max); }", "tokens": 80} {"id": 193531, "source": "method", "repo": "flashyreese/reeses-sodium-options", "text": "private OptionRow findTargetOptionRow(List optionRows, int mouseX, int mouseY) { OptionRow hoveredElement = this.findHoveredOptionRow(optionRows, mouseX, mouseY); if (hoveredElement != null) { return hoveredElement; } OptionRow focusedElement = this.findFocusedOptionRow(optionRows); if (focusedElement != null) { return focusedElement; } return this.findSelectedSearchResultRow(optionRows); }", "tokens": 92} {"id": 193813, "source": "method", "repo": "flashyreese/reeses-sodium-options", "text": "public LayoutBounds bounds() { return this.bounds; }", "tokens": 13} {"id": 194576, "source": "method", "repo": "flightstats/hub", "text": "public ReplicationManager(ChannelService channelService, WatchManager watchManager, HubUtils hubUtils, AppProperties appProperties, SpokeProperties spokeProperties) { this.channelService = channelService; this.watchManager = watchManager; this.hubUtils = hubUtils; this.appProperties = appProperties; if (spokeProperties.isReplicationEnabled()) { register(new ReplicationService(), TYPE.AFTER_HEALTHY_START, TYPE.PRE_STOP); } }", "tokens": 104} {"id": 194675, "source": "method", "repo": "flightstats/hub", "text": "public String format(DateTime dateTime) { return dateTime.toString(formatter); }", "tokens": 17} {"id": 194858, "source": "method", "repo": "flightstats/hub", "text": "void testCreateIfMissing() { String name = \"testCreateIfMissing\"; ContentKey key = new ContentKey(); assertEquals(key, clusterCacheDao.get(name, key, BASE_PATH)); assertEquals(key, clusterCacheDao.get(name, new ContentKey(), BASE_PATH)); }", "tokens": 61} {"id": 195184, "source": "method", "repo": "floci-io/floci", "text": "public Boolean getDisableScaleIn() { return disableScaleIn; }", "tokens": 15} {"id": 195199, "source": "method", "repo": "floci-io/floci", "text": "public String getWafWebAclArn() { return wafWebAclArn; }", "tokens": 19} {"id": 195379, "source": "method", "repo": "floci-io/floci", "text": "public void setArn(String arn) { this.arn = arn; }", "tokens": 19} {"id": 195491, "source": "method", "repo": "floci-io/floci", "text": "public void setVpcConnectivity(VpcConnectivity vpcConnectivity) { this.vpcConnectivity = vpcConnectivity; }", "tokens": 26} {"id": 195499, "source": "method", "repo": "floci-io/floci", "text": "public void setInternalUserDatabaseEnabled(boolean internalUserDatabaseEnabled) { this.internalUserDatabaseEnabled = internalUserDatabaseEnabled; }", "tokens": 29} {"id": 196123, "source": "method", "repo": "floci-io/floci-az", "text": "void checkNameUnavailable() throws Exception { String body = \"{\\\"name\\\":\\\"\" + SERVER + \"\\\",\\\"type\\\":\\\"Microsoft.DBforMySQL/flexibleServers\\\"}\"; HttpResponse resp = send(\"POST\", BASE + \"/subscriptions/\" + SUB + \"/providers/Microsoft.DBforMySQL/locations/eastus/checkNameAvailability\" + API, body); assertEquals(200, resp.statusCode()); assertTrue(resp.body().contains(\"\\\"nameAvailable\\\":false\"), \"name should be unavailable: \" + resp.body()); }", "tokens": 111} {"id": 196207, "source": "method", "repo": "floci-io/floci-az", "text": "private boolean signatureMatches(AzureRequest request, String container, String path, StorageSasToken token) { String canonicalName = canonicalName(request.accountName(), container, signedPath(token, path)); String key = token.isUserDelegation() ? keyMaterial.signingKeyForAccount(request.accountName()) : storageAccountKeys.getOrDefault(request.accountName(), DEFAULT_STORAGE_ACCOUNT_KEY); String signedFields = token.isUserDelegation() ? stringToSign(request, token, canonicalName) : serviceStringToSign(token, canonicalName); String expected = hmac(key, signedFields); return MessageDigest.isEqual( expected.getBytes(StandardCharsets.UTF_8), token.signature().getBytes(StandardCharsets.UTF_8) ); }", "tokens": 160} {"id": 196442, "source": "method", "repo": "floci-io/floci-az", "text": "public Response handle(AzureRequest request) { String path = request.resourcePath(); String method = request.method().toUpperCase(); String account = request.accountName(); LOG.debugf(\"Table API [%s] %s account=%s\", method, path, account); // --- Tables resource --- if (\"Tables\".equals(path) || path.startsWith(\"Tables(\")) { return handleTables(request, method, account, path); } // --- Entity resource: tableName(...) or tableName --- Matcher entityMatcher = ENTITY_PATH_PATTERN.matcher(path); if (entityMatcher.matches()) { String tableName = entityMatcher.group(1); String partitionKey = entityMatcher.group(2); // null = query all String rowKey = entityMatcher.group(3); // null = query all if (partitionKey != null) { // Specific entity return handleEntity(request, method, account, tableName, partitionKey, rowKey); } else { // tableName() \u2014 query return queryEntities(request, account, tableName); } } // Bare tableName (no parentheses) \u2014 INSERT if (\"POST\".equals(method)) { return insertEntity(request, account, path); } return notImplemented(\"Unknown Table path: \" + path); }", "tokens": 265} {"id": 196640, "source": "method", "repo": "floci-io/floci-az", "text": "private String ruleFeedXml(String namespace, String topicName, String subName, List rules) { String now = ISO8601.format(Instant.now()); StringBuilder sb = new StringBuilder(); sb.append(XML_PROLOG) .append(\"\") .append(\"Rules\") .append(\"https://localhost/\").append(xmlEsc(namespace)).append(\"/topics/\") .append(xmlEsc(topicName)).append(\"/subscriptions/\").append(xmlEsc(subName)) .append(\"/rules\") .append(\"\").append(now).append(\"\"); for (ServiceBusModels.RuleEntity rule : rules) { sb.append(ruleEntryXml(namespace, rule)); } sb.append(\"\"); return sb.toString(); }", "tokens": 204} {"id": 196722, "source": "method", "repo": "floci-io/floci-az", "text": "void firstUseFollowsTheTokenTenantTheDirectoryHolds() { AzureDirectory directory = directory(); SubscriptionRule rule = new SubscriptionRule(directory, false); rule.enter(call(\"GET\", \"subscriptions/token-sub\", \"other\")); assertEquals(\"other\", directory.subscription(\"token-sub\").orElseThrow().tenantId()); }", "tokens": 67} {"id": 196859, "source": "method", "repo": "floci-io/floci-az", "text": "void deletingEnvironmentInUseReturnsConflict() { createEnvironment(); createApp(\"using-app\", \"Single\", \"v1\", 1); given().delete(ENVIRONMENT_URL).then().statusCode(409) .body(\"error.code\", equalTo(\"ManagedEnvironmentInUse\")); given().delete(appUrl(\"using-app\")).then().statusCode(204); given().delete(ENVIRONMENT_URL).then().statusCode(204); }", "tokens": 97} {"id": 197139, "source": "method", "repo": "floci-io/floci-gcp", "text": "private static Map decimal(int precision, int scale) { Map decimal = new LinkedHashMap<>(); decimal.put(\"type\", \"bytes\"); decimal.put(\"logicalType\", \"decimal\"); decimal.put(\"precision\", precision); decimal.put(\"scale\", scale); return decimal; }", "tokens": 68} {"id": 197239, "source": "method", "repo": "floci-io/floci-gcp", "text": "public StoredKeyRing createKeyRing(String parent, String keyRingId) { requireKmsLocation(parent); String name = parent + \"/keyRings/\" + keyRingId; LOG.infof(\"createKeyRing name=%s\", name); if (keyRingStore.get(name).isPresent()) { throw GcpException.alreadyExists(\"KeyRing already exists: \" + name); } StoredKeyRing keyRing = new StoredKeyRing(name, Instant.now().toString()); keyRingStore.put(name, keyRing); return keyRing; }", "tokens": 120} {"id": 197576, "source": "method", "repo": "floci-io/floci-gcp", "text": "public String getCreationId() { return creationId; }", "tokens": 13} {"id": 197637, "source": "method", "repo": "floci-io/floci-gcp", "text": "/** Replies to the first datagram received with a fixed payload, on a daemon thread. */ private void startResponder(DatagramSocket responder, byte[] responsePayload) { Thread t = new Thread(() -> { try { DatagramPacket req = new DatagramPacket(new byte[4096], 4096); responder.receive(req); responder.send(new DatagramPacket( responsePayload, responsePayload.length, req.getAddress(), req.getPort())); } catch (Exception ignored) { // socket closed when the test completes } }); t.setDaemon(true); t.start(); }", "tokens": 126} {"id": 197851, "source": "method", "repo": "floci-io/floci-gcp", "text": "void deleteBucketWithOnlySoftDeletedObjectsPurgesTheirArchivedState() { service.createBucket(\"bucket\", \"p1\", BASE_URL, Map.of(\"softDeletePolicy\", Map.of(\"retentionDurationSeconds\", \"604800\"))); service.putObject(\"bucket\", \"obj.txt\", \"text/plain\", new byte[]{1}, GcsCustomerEncryption.none(), BASE_URL); service.deleteObject(\"bucket\", \"obj.txt\"); assertEquals(1, service.listSoftDeletedObjects(\"bucket\", null).size()); service.deleteBucket(\"bucket\"); service.createBucket(\"bucket\", \"p1\", BASE_URL, Map.of()); assertTrue(service.listSoftDeletedObjects(\"bucket\", null).isEmpty()); }", "tokens": 157} {"id": 197955, "source": "method", "repo": "floci-io/floci-gcp", "text": "public void onError(Throwable t) { error = t; }", "tokens": 14} {"id": 198154, "source": "method", "repo": "floci-io/floci-oci", "text": "void onHttpStart(@ObservesAsync HttpServerStart event) { int expectedPort = config.tls().enabled() ? TLS_HTTP_BACKEND_PORT : HTTP_PORT; if (event.options().getPort() != expectedPort) { return; } boolean hasStart = initializationHooksRunner.hasHooks(InitializationHook.START); boolean hasReady = initializationHooksRunner.hasHooks(InitializationHook.READY); if (!hasStart && !hasReady) { return; } try { if (hasStart) { initializationHooksRunner.run(InitializationHook.START); } initLifecycleState.markStartCompleted(); if (hasReady) { initializationHooksRunner.run(InitializationHook.READY); } initLifecycleState.markReadyCompleted(); logReady(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); LOG.error(\"Startup hook execution interrupted \u2014 shutting down\", e); } catch (Exception e) { LOG.error(\"Startup hook execution failed \u2014 shutting down\", e); Quarkus.asyncExit(); } }", "tokens": 216} {"id": 198248, "source": "method", "repo": "floci-io/floci-oci", "text": "public Response encrypt(Map body) { KmsService.EncryptResult result = service.encrypt(null, str(body, \"keyId\"), str(body, \"plaintext\"), str(body, \"keyVersionId\")); Map json = new LinkedHashMap<>(); json.put(\"ciphertext\", result.ciphertext()); json.put(\"keyId\", result.keyId()); json.put(\"keyVersionId\", result.keyVersionId()); return Response.ok(json).build(); }", "tokens": 110} {"id": 198560, "source": "method", "repo": "floci-io/floci-oci", "text": "String currentContainerId() { return containerId; }", "tokens": 11} {"id": 198579, "source": "method", "repo": "floci-io/floci-oci", "text": "void loadFromEmptyFileDoesNotThrow() { assertDoesNotThrow(() -> storage.load()); }", "tokens": 19} {"id": 198598, "source": "method", "repo": "floci-io/floci-oci", "text": "void shouldNotForceKillWhenProcessTerminatesDuringGracePeriod() throws InterruptedException { Process process = Mockito.mock(Process.class); Mockito.when(emulatorConfigMock.initHooks().timeoutSeconds()).thenReturn(30L); Mockito.when(emulatorConfigMock.initHooks().shutdownGracePeriodSeconds()).thenReturn(2L); Mockito.when(process.waitFor(30L, TimeUnit.SECONDS)).thenReturn(false); Mockito.when(process.isAlive()).thenReturn(true, false); Mockito.when(process.waitFor(2L, TimeUnit.SECONDS)).thenReturn(true); IllegalStateException exception = Assertions.assertThrows(IllegalStateException.class, () -> hookScriptExecutor.run(process, \"script.sh\")); Mockito.verify(process).destroy(); Mockito.verify(process, Mockito.never()).destroyForcibly(); Assertions.assertAll( () -> Assertions.assertEquals(\"Hook script timed out after 30 seconds: script.sh\", exception.getMessage()), () -> Assertions.assertNull(exception.getCause()) ); }", "tokens": 214} {"id": 198673, "source": "method", "repo": "floci-io/floci-oci", "text": "void clearStopsActiveContainersAndReleasesPorts() { when(portAllocator.allocate(6443, 6543)).thenReturn(6443).thenReturn(6444); when(lifecycleManager.createAndStart(any())).thenReturn(new ContainerLifecycleManager.ContainerInfo(\"c-1\", Map.of())); StoredOkeCluster cluster1 = new StoredOkeCluster(); cluster1.setId(\"ocid1.cluster.oc1.iad.cluster001\"); cluster1.setApiToken(\"token-cluster001\"); cluster1.setName(\"cluster-1\"); StoredOkeCluster cluster2 = new StoredOkeCluster(); cluster2.setId(\"ocid1.cluster.oc1.iad.cluster002\"); cluster2.setApiToken(\"token-cluster002\"); cluster2.setName(\"cluster-2\"); manager.startCluster(cluster1); manager.startCluster(cluster2); manager.clear(); verify(portAllocator).release(6443); verify(portAllocator).release(6444); verify(lifecycleManager, times(2)).removeIfExists(ContainerStorageHelper.dockerName(config, \"oke-\" + cluster1.getId())); verify(lifecycleManager, times(2)).removeIfExists(ContainerStorageHelper.dockerName(config, \"oke-\" + cluster2.getId())); }", "tokens": 290} {"id": 198682, "source": "method", "repo": "floci-io/floci-oci", "text": "void startClusterLabelsContainerWithTheClusterRegion() { OkeClusterManager labelledManager = new OkeClusterManager( new ContainerBuilder(config, mock(DockerHostResolver.class), null), lifecycleManager, portAllocator, dockerHostResolver, containerDetector, networkResolver, config); when(portAllocator.allocate(6443, 6543)).thenReturn(6443); when(lifecycleManager.createAndStart(any())).thenReturn(new ContainerLifecycleManager.ContainerInfo(\"c-1\", Map.of())); StoredOkeCluster cluster = new StoredOkeCluster(); cluster.setId(\"ocid1.cluster.oc1.phx.labelled002\"); cluster.setCompartmentId(\"ocid1.compartment.oc1..labelled\"); cluster.setName(\"phoenix-cluster\"); cluster.setApiToken(\"token-labelled002\"); cluster.setRegion(\"us-phoenix-1\"); labelledManager.startCluster(cluster); ArgumentCaptor spec = ArgumentCaptor.forClass(ContainerSpec.class); verify(lifecycleManager).createAndStart(spec.capture()); assertEquals(\"us-phoenix-1\", spec.getValue().labels().get(\"io.floci.region\")); }", "tokens": 268} {"id": 198733, "source": "method", "repo": "floci-io/floci-oci", "text": "void streamCrudRoundtrip() { String streamId = createStream(\"it-stream-\" + System.nanoTime(), 2); given() .when().get(\"/20180418/streams/\" + streamId) .then().statusCode(200) .body(\"partitions\", equalTo(2)) .body(\"retentionInHours\", equalTo(24)); // Bare-array list; StreamSummary must NOT carry retentionInHours. given() .queryParam(\"compartmentId\", COMPARTMENT) .when().get(\"/20180418/streams\") .then().statusCode(200) .body(\"size()\", greaterThanOrEqualTo(1)) .body(\"find { it.id == '\" + streamId + \"' }.retentionInHours\", nullValue()) .body(\"find { it.id == '\" + streamId + \"' }.messagesEndpoint\", notNullValue()); given() .when().delete(\"/20180418/streams/\" + streamId) .then().statusCode(202) .header(\"opc-work-request-id\", notNullValue()); given() .when().get(\"/20180418/streams/\" + streamId) .then().statusCode(404).body(\"code\", equalTo(\"NotAuthorizedOrNotFound\")); }", "tokens": 291} {"id": 199175, "source": "method", "repo": "fnuecke/sedna", "text": "private void setPrivilege(final int level) { // Always update, MPRV may have changed. updateTLBTags(); if (priv == level) { return; } switch (level) { case R5.PRIVILEGE_S -> xlen = R5.xlen((mstatus & R5.STATUS_SXL_MASK) >>> R5.STATUS_SXL_SHIFT); case R5.PRIVILEGE_U -> xlen = R5.xlen((mstatus & R5.STATUS_UXL_MASK) >>> R5.STATUS_UXL_SHIFT); default -> xlen = R5.xlen(mxl); } priv = level; // No TLB flush: entries carry the privilege they were made under, so the ones belonging to // the level being left simply stop matching, and are still there when it is returned to. updateTLBTags(); }", "tokens": 205} {"id": 199231, "source": "method", "repo": "fnuecke/sedna", "text": "protected void fcvt_s_w(@Field(\"rd\") final int rd, @Field(\"rs1\") final int rs1, @Field(\"rm\") int rm) throws R5IllegalInstructionException { checkFPUEnabled(); rm = resolveRoundingMode(rm); f[rd] = fpu32.intToFloat((int) x[rs1], rm) | R5.NAN_BOXING_MASK; fs = R5.FS_DIRTY; }", "tokens": 106} {"id": 199243, "source": "method", "repo": "fnuecke/sedna", "text": "public void addBreakpoint(final long address) { breakpoints.add(address); final int index = tlbIndex(address); if ((fetchTLBHash[index] & ~TLB_DIRECT) == ((address & ~R5.PAGE_ADDRESS_MASK) | fetchTLBTag)) { if (fetchTLBBreakpoints[index] == null) { fetchTLBBreakpoints[index] = new LongOpenHashSet(); } fetchTLBBreakpoints[index].add(address); } }", "tokens": 115} {"id": 199324, "source": "method", "repo": "fnuecke/sedna", "text": "public DeviceBus getPortBus() { return portBus; }", "tokens": 14} {"id": 199406, "source": "method", "repo": "fnuecke/sedna", "text": "public void step() { if (nmiRequested) { acceptNMI(); } else if (irqRequested && iff1 && !eiDelay) { acceptIRQ(); } if (halted) { return; } eiDelay = false; interpretTrace(true, null); pc &= 0xFFFF; }", "tokens": 69} {"id": 199450, "source": "method", "repo": "fnuecke/sedna", "text": "public void serializationRetainsOverwrittenBlocks() throws IOException { final byte[] overwriteData = \"something something not random out\".getBytes(StandardCharsets.UTF_8); sparse.getOutputStream().write(overwriteData); final ByteBuffer serialized = BinarySerialization.serialize(sparse); final SparseBlockDevice deserialized = BinarySerialization.deserialize(serialized, new SparseBlockDevice( lower)); final byte[] deserializedData = new byte[overwriteData.length]; deserialized.getInputStream().read(deserializedData); assertArrayEquals(overwriteData, deserializedData); }", "tokens": 111} {"id": 199506, "source": "method", "repo": "fnuecke/sedna", "text": "public void batchReadYieldsEveryByteInOrderAcrossChunkSizes() throws Exception { bringUp(); final byte[] expected = new byte[512]; for (int i = 0; i < expected.length; i++) { expected[i] = (byte) (i * 37 + 11); // deterministic, and covers 0x80..0xFF } for (int offset = 0; offset < expected.length; offset += BUFFER_SIZE) { publishGuestData(transmitQueue(0), java.util.Arrays.copyOfRange( expected, offset, Math.min(offset + BUFFER_SIZE, expected.length))); } final ByteBuffer actual = ByteBuffer.allocate(expected.length); int chunk = 1; while (actual.hasRemaining()) { final int limit = actual.limit(); actual.limit(Math.min(actual.position() + chunk, limit)); final int count = device.read(actual); actual.limit(limit); if (count == 0) { break; } chunk = chunk * 2 + 1; // 1, 3, 7, ... to cross chain boundaries at odd places } assertEquals(expected.length, actual.position(), \"batch reads must yield every byte\"); assertArrayEquals(expected, actual.array()); }", "tokens": 276} {"id": 199539, "source": "method", "repo": "fnuecke/sedna", "text": "public void pcmInfoReportsSupportedFormatsAndRates() throws Exception { bringUp(); final ByteBuffer info = queryPcmInfo(); assertEquals(VIRTIO_SND_S_OK, info.getInt()); info.getInt(); // hda_fn_nid assertEquals(0, info.getInt(), \"no optional stream features are supported\"); final long formats = info.getLong(); assertNotEquals(0, formats & (1L << FMT_U8), \"U8 is what /dev/dsp defaults to\"); assertNotEquals(0, formats & (1L << FMT_S16), \"S16 is what alsa-lib apps use\"); assertNotEquals(0, formats & (1L << FMT_MU_LAW), \"mu-law lets the guest hand us the wire format\"); final long rates = info.getLong(); assertNotEquals(0, rates & (1L << RATE_11025), \"11025 is DOOM's native rate\"); assertNotEquals(0, rates & (1L << RATE_22050)); assertEquals(0, rates & (1L << RATE_48000), \"advertising a rate we do not want to be sent\"); assertEquals(0, info.get(), \"direction must be output\"); assertEquals(1, info.get(), \"channels_min\"); assertEquals(1, info.get(), \"channels_max: a positional speaker is mono\"); }", "tokens": 322} {"id": 199626, "source": "method", "repo": "fnuecke/sedna", "text": "public int getLength() { return DEVICE_LENGTH; }", "tokens": 14} {"id": 199708, "source": "method", "repo": "forax/loom-fiber", "text": "public static void main(String[] args) { var queue = new ArrayBlockingQueue(8192); // try (var scheduler = Executors.newFixedThreadPool(1)) { // var factory = //Thread.builder().virtual(scheduler).factory(); // try (var executor = //Executors.newUnboundedExecutor(factory)) { // executor.submit(() -> produce(queue)); // executor.submit(() -> consume(queue)); // } // } var scheduler = Executors.newFixedThreadPool(1); Thread.builder().name(\"producer\").virtual(scheduler).task(() -> produce(queue)).build().start(); Thread.builder().name(\"consumer\").virtual(scheduler).task(() -> consume(queue)).build().start(); }", "tokens": 160} {"id": 199756, "source": "method", "repo": "forax/loom-fiber", "text": "public static void main(String[] args) { var scope = new ContinuationScope(\"example4\"); var continuation = new Continuation(scope, () -> { for(int i = 0; i < 2; i++) { System.out.println(i); Continuation.yield(scope); } }); while(!continuation.isDone()) { System.out.println(\"run\"); continuation.run(); } }", "tokens": 90} {"id": 199772, "source": "method", "repo": "forax/loom-fiber", "text": "private void put(long executionTime, Continuation continuation) { var oldContinuation = schedulable.put(executionTime, continuation); if (oldContinuation == null) { return; } long time = executionTime; while (schedulable.containsKey(time)) { // avoid collision time++; } schedulable.put(time, oldContinuation); }", "tokens": 77} {"id": 199798, "source": "method", "repo": "forax/loom-fiber", "text": "public T take() { while (queue.isEmpty()) { isEmpty.await(); } isFull.signalAll(); return queue.pop(); }", "tokens": 31} {"id": 200028, "source": "method", "repo": "fordfrog/apgdiff", "text": "/** Getter for {@link #addTransaction}. @return {@link #addTransaction} */ public boolean isAddTransaction() { return addTransaction; }", "tokens": 31} {"id": 200670, "source": "method", "repo": "fornwall/jelf", "text": "void testNegativeDescsz() throws Exception { assertParsingFailsContainingMessage(\"descsz\", new NotePatch(DESCSZ_OFFSET, Integer.MIN_VALUE)); }", "tokens": 38} {"id": 200740, "source": "method", "repo": "freeacs/freeacs", "text": "public void isNotPublic2() { // Given: String ip = \"172.16.0.11\"; // When: boolean isPublic = IPAddress.isPublic(ip); // Then assertFalse(isPublic); }", "tokens": 49} {"id": 200983, "source": "method", "repo": "freeacs/freeacs", "text": "private static void processSyntaxChild(Node syntaxChildNode, TR069DMParameter parameter) { switch (syntaxChildNode.getNodeName()) { case \"dataType\": String dataType = ((Element) syntaxChildNode).getAttribute(\"ref\"); parameter.setDatatype(TR069DMType.valueOf(dataType.toUpperCase())); break; case \"list\": parameter.setList(true); break; default: parameter.setDatatype(TR069DMType.valueOf(syntaxChildNode.getNodeName().toUpperCase())); processDatatypeChildren(syntaxChildNode, parameter); break; } }", "tokens": 119} {"id": 200985, "source": "method", "repo": "freeacs/freeacs", "text": "public Long getMax() { if (max != null) { return max; } return datatype.getMax(); }", "tokens": 24} {"id": 201092, "source": "method", "repo": "freeacs/freeacs", "text": "public HelpArguments getArguments() { return arguments; }", "tokens": 12} {"id": 201198, "source": "method", "repo": "freeacs/freeacs", "text": "private DatagramPacket receiveAndKick() throws IOException { DatagramPacket receive = new DatagramPacket(new byte[200], 200); receiverSocket.setSoTimeout(1000); if (primaryPortIP) { try { receiverSocket.receive(receive); if (System.currentTimeMillis() - tms > 1000) { tms = System.currentTimeMillis(); DatagramPacket packet; while ((packet = MessageStack.pop()) != null) { receiverSocket.send(packet); } } } catch (SocketTimeoutException ste) { DatagramPacket packet; while ((packet = MessageStack.pop()) != null) { receiverSocket.send(packet); } receive = null; } } else { try { receiverSocket.receive(receive); } catch (SocketTimeoutException ste) { receive = null; } } return receive; }", "tokens": 176} {"id": 201312, "source": "method", "repo": "freeacs/freeacs", "text": "static DecisionStrategy getParameterValuesStrategy(Properties properties, DBI dbi) { return new GetParameterValuesDecisionStrategy(properties, dbi); }", "tokens": 33} {"id": 201393, "source": "method", "repo": "freeacs/freeacs", "text": "public void writeImageBytesToResponse(byte[] image) throws IOException { servletResponseChannel.setContentType(\"image/png\"); appendNoCache(servletResponseChannel); writeBytesToResponse(image); }", "tokens": 40} {"id": 201477, "source": "method", "repo": "freeacs/freeacs", "text": "public static ReportProvisioningGenerator getReportProvGenerator(String sessionId, ACS acs) throws SQLException { return new ReportProvisioningGenerator( acs.getDataSource(), acs, null, ACSLoader.getIdentity(sessionId, acs.getDataSource())); }", "tokens": 49} {"id": 201496, "source": "method", "repo": "freeacs/freeacs", "text": "public boolean isMemoryRelevant() { return limits.isMemoryRelevant(this); }", "tokens": 18} {"id": 201659, "source": "method", "repo": "freefair/gradle-plugins", "text": "public void options(Action action) { action.execute(getOptions()); }", "tokens": 20} {"id": 201721, "source": "method", "repo": "freefair/gradle-plugins", "text": "public String getDisplayName() { return file.getPath(); }", "tokens": 12} {"id": 201848, "source": "method", "repo": "freefair/gradle-plugins", "text": "public void dummyTest() { System.out.println(\"Hallo Welt\"); }", "tokens": 19} {"id": 201859, "source": "method", "repo": "freefair/gradle-plugins", "text": "public void generate(ProjectContext context) throws Exception { context.writeOutputFile(\"io.freefair.gradle.codegen.test\",\"TestClass.java\", \"package io.freefair.gradle.codegen.test;\\nclass TestClass {\\n}\"); }", "tokens": 55} {"id": 201970, "source": "method", "repo": "freefair/gradle-plugins", "text": "public void postCompile() { getExecOperations().javaexec(postCompile -> { if (getLauncher().isPresent()) { postCompile.setExecutable(getLauncher().get().getExecutablePath().getAsFile().getAbsolutePath()); } postCompile.setClasspath(getLombokClasspath()); postCompile.getMainClass().set(\"lombok.launch.Main\"); postCompile.args(\"post-compile\"); if (getVerbose().get()) { postCompile.args(\"--verbose\"); } getClassFiles().forEach(file -> postCompile.args(file.getAbsolutePath())); }); }", "tokens": 114} {"id": 202064, "source": "method", "repo": "freefair/gradle-plugins", "text": "private void configureOverlay(WarOverlay overlay, Project otherProject) { project.evaluationDependsOn(otherProject.getPath()); War otherWar = (War) otherProject.getTasks().getByName(WAR_TASK_NAME); configureOverlay(overlay, otherWar); if (overlay.isEnableCompilation()) { project.getDependencies().add(getClasspathConfigurationName(overlay), otherProject); otherProject.getPlugins().withType(WarOverlayPlugin.class, otherWarOverlayPlugin -> { Map map = new HashMap<>(); map.put(\"path\", otherProject.getPath()); map.put(\"configuration\", otherWarOverlayPlugin.getClasspathConfigurationName(otherWar)); project.getDependencies().add( getClasspathConfigurationName(overlay), project.getDependencies().project(map) ); }); } }", "tokens": 166} {"id": 202119, "source": "method", "repo": "freefair/gradle-plugins", "text": "public void fatalError(String message, Throwable throwable) { gradleLogger.error(message, throwable); }", "tokens": 23} {"id": 202299, "source": "method", "repo": "frohoff/ysoserial", "text": "public static InetSocketAddress getCliPort ( String jenkinsUrl ) throws MalformedURLException, IOException { URL u = new URL(jenkinsUrl); URLConnection conn = u.openConnection(); if ( ! ( conn instanceof HttpURLConnection ) ) { System.err.println(\"Not a HTTP URL\"); throw new MalformedURLException(); } HttpURLConnection hc = (HttpURLConnection) conn; if ( hc.getResponseCode() >= 400 ) { System.err.println(\"* Error connection to jenkins HTTP \" + u); } int clip = Integer.parseInt(hc.getHeaderField(\"X-Jenkins-CLI-Port\")); return new InetSocketAddress(u.getHost(), clip); }", "tokens": 144} {"id": 202421, "source": "method", "repo": "frohoff/ysoserial", "text": "public static T createWithConstructor ( Class classToInstantiate, Class constructorClass, Class[] consArgTypes, Object[] consArgs ) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException { Constructor objCons = constructorClass.getDeclaredConstructor(consArgTypes); setAccessible(objCons); Constructor sc = ReflectionFactory.getReflectionFactory().newConstructorForSerialization(classToInstantiate, objCons); setAccessible(sc); return (T)sc.newInstance(consArgs); }", "tokens": 122} {"id": 202434, "source": "method", "repo": "frohoff/ysoserial", "text": "public void checkAccess(ThreadGroup g) { getSecurityManager().checkAccess(g); }", "tokens": 20} {"id": 202626, "source": "method", "repo": "fxmorin/carpet-fixes", "text": "private void cf$setProgress(NbtCompound nbt, CallbackInfo ci) { if (CFSettings.pistonReloadInconsistencyFix) { nbt.putFloat(\"progress\", this.progress); } }", "tokens": 37} {"id": 202843, "source": "method", "repo": "fxmorin/carpet-fixes", "text": "protected EnderDragonEntity_blockDropsMixin(EntityType entityType, World world) { super(entityType, world); }", "tokens": 30} {"id": 203080, "source": "method", "repo": "g3g4x5x6/ultimate-cube", "text": "private void initClosableTabs(JTabbedPane tabbedPane) { tabbedPane.putClientProperty(TABBED_PANE_TAB_CLOSABLE, true); tabbedPane.putClientProperty(TABBED_PANE_TAB_CLOSE_TOOLTIPTEXT, \"Close\"); tabbedPane.putClientProperty(TABBED_PANE_TAB_CLOSE_CALLBACK, (BiConsumer) (tabPane, tabIndex) -> { if (tabIndex != 0) { if (mainTabbedPane.getComponentAt(tabIndex) instanceof SshTabbedPane) { SshTabbedPane sshTabbedPane = (SshTabbedPane) mainTabbedPane.getComponentAt(tabIndex); sshTabbedPane.getSessionInfo().close(); App.sessionInfos.remove(sshTabbedPane.getSessionInfo().getSessionId()); log.debug(\"Close: \" + App.sessionInfos.size()); } mainTabbedPane.removeTabAt(tabIndex); } }); }", "tokens": 181} {"id": 203107, "source": "method", "repo": "g3g4x5x6/ultimate-cube", "text": "public int maxRefreshRate() { return 50; }", "tokens": 14} {"id": 203232, "source": "method", "repo": "g3g4x5x6/ultimate-cube", "text": "public SessionInfo copy() { SessionInfo sessionInfo = new SessionInfo(); sessionInfo.setSessionName(sessionName); sessionInfo.setSessionProtocol(sessionProtocol); sessionInfo.setSessionAddress(sessionAddress); sessionInfo.setSessionPort(sessionPort); sessionInfo.setSessionUser(sessionUser); sessionInfo.setSessionPass(sessionPass); sessionInfo.setSessionPukKey(sessionPukKey); sessionInfo.setSessionLoginType(sessionLoginType); sessionInfo.setSessionComment(sessionComment); return sessionInfo; }", "tokens": 117} {"id": 203275, "source": "method", "repo": "g3g4x5x6/ultimate-cube", "text": "public void updateFs(SftpFileSystem fileSystem) { this.fs = fileSystem; }", "tokens": 20} {"id": 203444, "source": "method", "repo": "g3g4x5x6/ultimate-cube", "text": "private void initKeyWord() { // Add completions for all Bash keywords. A BasicCompletion is just // a straightforward word completion. this.addCompletion(new BasicCompletion(this, \"alias \")); this.addCompletion(new BasicCompletion(this, \"continue \")); this.addCompletion(new BasicCompletion(this, \"echo \")); this.addCompletion(new BasicCompletion(this, \"exit \")); // ... etc ... this.addCompletion(new BasicCompletion(this, \"fg\")); this.addCompletion(new BasicCompletion(this, \"test \")); this.addCompletion(new BasicCompletion(this, \"umask \")); this.addCompletion(new BasicCompletion(this, \"return \")); this.addCompletion(new BasicCompletion(this, \"read \")); }", "tokens": 168} {"id": 203642, "source": "method", "repo": "gaigresearch/tabletopgames", "text": "/** Calculates the current best shooters depending on the number of bullets left per player @return - list of player IDs tied for lowest number of bullets left */ public List getBestShooters() { ColtExpressParameters cep = (ColtExpressParameters) gameParameters; List playersWithMostSuccessfulShots = new LinkedList<>(); int bestValue = cep.nBulletsPerPlayer; for (int i = 0; i < getNPlayers(); i++) { if (bulletsLeft[i] < bestValue) { bestValue = bulletsLeft[i]; playersWithMostSuccessfulShots.clear(); playersWithMostSuccessfulShots.add(i); } else if (bulletsLeft[i] == bestValue) { playersWithMostSuccessfulShots.add(i); } } return playersWithMostSuccessfulShots; }", "tokens": 184} {"id": 204027, "source": "method", "repo": "gaigresearch/tabletopgames", "text": "public VagabondStrike copy() { VagabondStrike copy = new VagabondStrike(playerID); copy.stage = stage; copy.targetPlayerID = targetPlayerID; copy.done = done; copy.defenderDamage = defenderDamage; copy.locationID = locationID; return copy; }", "tokens": 67} {"id": 204180, "source": "method", "repo": "gaigresearch/tabletopgames", "text": "public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; ReplaceCards that = (ReplaceCards) o; return deckDraw == that.deckDraw; }", "tokens": 66} {"id": 204237, "source": "method", "repo": "gaigresearch/tabletopgames", "text": "public WinPlusHeuristic(double scale) { this.scale = scale; }", "tokens": 17} {"id": 204381, "source": "method", "repo": "gaigresearch/tabletopgames", "text": "public void checkRollOutPolicyIsCalledLessWithMultiTreeRNDOpponentModel() { params.oppModelType = MCTSEnums.Strategies.RANDOM; MASTPlayer mockRollout = getMockRollout(); params.setRolloutPolicy(mockRollout); fm = new LoveLetterForwardModel(); Game game = createLoveLetter(params); LoveLetterGameState state = (LoveLetterGameState) game.getGameState(); assertEquals(0, state.getCurrentPlayer()); game.getPlayers().get(state.getCurrentPlayer()) .getAction(state, fm.computeAvailableActions(state)); assertEquals(500, mctsPlayer.root.getVisits()); assertEquals(501, mctsPlayer.root.copyCount); assertTrue(mctsPlayer.root.fmCallsCount > 5000); // rollout of 10 x 1000 as minimum // we should use the rollout policy for most of these verify(mockRollout, atLeast(4000 / 3)).getAction(any(), any()); verify(mockRollout, atMost(6000 / 3)).getAction(any(), any()); }", "tokens": 255} {"id": 204436, "source": "method", "repo": "games647/changeskin", "text": "public void onPluginMessageReceived(String channel, Player player, byte[] data) { ByteArrayDataInput dataInput = ByteStreams.newDataInput(data); SkinUpdateMessage updateMessage = new SkinUpdateMessage(); updateMessage.readFrom(dataInput); String playerName = updateMessage.getPlayerName(); Player receiver = Bukkit.getPlayerExact(playerName); if (receiver != null) { Bukkit.getScheduler().runTask(plugin, new SkinApplier(plugin, player, receiver, null, false)); } }", "tokens": 104} {"id": 204600, "source": "method", "repo": "games647/changeskin", "text": "private Optional parseSkinTexture(Reader reader) { TexturesModel texturesModel = gson.fromJson(reader, TexturesModel.class); SkinProperty[] properties = texturesModel.getProperties(); try { if (properties != null && properties.length > 0) { SkinProperty propertiesModel = properties[0]; //base64 encoded skin data String encodedSkin = propertiesModel.getValue(); String signature = propertiesModel.getSignature(); return Optional.of(SkinModel.createSkinFromEncoded(encodedSkin, signature)); } } catch (Exception ex) { logger.error(\"Failed to parse skin model\", ex); logger.error(texturesModel.toString()); } return Optional.empty(); }", "tokens": 144} {"id": 204633, "source": "method", "repo": "games647/changeskin", "text": "public String getChannelName() { return FORWARD_COMMAND_CHANNEL; }", "tokens": 17} {"id": 204786, "source": "method", "repo": "games647/changeskin", "text": "protected void scheduleApplyTask(SkinModel skinData) { Runnable skinUpdater = new SkinApplier(plugin, invoker, invoker, skinData, false); Task.builder().execute(skinUpdater).submit(plugin); }", "tokens": 46} {"id": 204848, "source": "method", "repo": "games647/fastlogin", "text": "public CrackedCommand(FastLoginBukkit plugin) { super(plugin); }", "tokens": 17} {"id": 204924, "source": "method", "repo": "games647/fastlogin", "text": "public static boolean verifySignedNonce(byte[] nonce, PublicKey clientKey, long signatureSalt, byte[] signature) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException { Signature verifier = Signature.getInstance(\"SHA256withRSA\"); // key of the signer verifier.initVerify(clientKey); verifier.update(nonce); verifier.update(Longs.toByteArray(signatureSalt)); return verifier.verify(signature); }", "tokens": 88} {"id": 205098, "source": "method", "repo": "games647/fastlogin", "text": "public boolean forceLogin(ProxiedPlayer player) { if (session.isAlreadyLogged()) { return true; } session.setAlreadyLogged(true); return super.forceLogin(player); }", "tokens": 41} {"id": 205114, "source": "method", "repo": "games647/fastlogin", "text": "public Action onIncomingConnection(InetSocketAddress clientAddress, String username) { if (!rateLimiter.tryAcquire()) { logger.warn(\"Anti-Bot join limit - Ignoring {}\", clientAddress); return limitReachedAction; } return Action.Continue; }", "tokens": 51} {"id": 205188, "source": "method", "repo": "games647/fastlogin", "text": "/** Decides whether checks for conflicting Java names should be made @return ture if an API call to Mojang is needed */ private boolean isNameCheckRequired() { //linked players have the same name as their Java profile //OR //if allowNameConflict is 'false' or 'linked' and the player had a conflicting //name, then they would have been kicked in FloodgateHook#checkNameConflict if (isLinked || !\"true\".equals(allowNameConflict)) { return false; } //autoRegisterFloodgate should only be checked if then player is not yet registered if (!isRegistered && \"no-conflict\".equals(autoRegisterFloodgate)) { return true; } return \"no-conflict\".equals(autoLoginFloodgate); }", "tokens": 155} {"id": 205280, "source": "method", "repo": "games647/fastlogin", "text": "private void loadOrGenerateProxyId() { Path idFile = dataDirectory.resolve(PROXY_ID_FILE); boolean shouldGenerate = false; if (Files.exists(idFile)) { try { List lines = Files.readAllLines(idFile, StandardCharsets.UTF_8); if (lines.isEmpty()) { shouldGenerate = true; } else { proxyId = UUID.fromString(lines.get(0)); } } catch (IOException e) { logger.error(\"Unable to load proxy id from '{}'\", idFile.toAbsolutePath()); logger.error(\"Detailed exception:\", e); } catch (IllegalArgumentException e) { Path filePath = idFile.toAbsolutePath(); logger.error(\"'{}' contains an invalid uuid! FastLogin will not work without a valid id.\", filePath); } } else { shouldGenerate = true; } if (shouldGenerate) { proxyId = UUID.randomUUID(); try { Files.write(idFile, Collections.singletonList(proxyId.toString()), StandardOpenOption.CREATE); } catch (IOException e) { logger.error(\"Unable to save proxy id to '{}'\", idFile.toAbsolutePath()); logger.error(\"Detailed exception:\", e); } } }", "tokens": 248} {"id": 205345, "source": "method", "repo": "games647/lagmonitor", "text": "public int compareTo(MethodMeasurement other) { return Long.compare(this.totalTime, other.totalTime); }", "tokens": 26} {"id": 205480, "source": "method", "repo": "games647/lagmonitor", "text": "public SpigotTimingsCommand(LagMonitor plugin) { super(plugin); }", "tokens": 17} {"id": 205601, "source": "method", "repo": "games647/lagmonitor", "text": "public void run() { //According to this post the thread is still in Runnable although it's waiting for //file/http resources //https://stackoverflow.com/questions/20795295/why-jstack-out-says-thread-state-is-runnable-while-socketread if (mainThread.getState() == State.RUNNABLE) { //Based on this post we have to check the top element of the stack //https://stackoverflow.com/questions/20891386/how-to-detect-thread-being-blocked-by-io StackTraceElement[] stackTrace = mainThread.getStackTrace(); StackTraceElement topElement = stackTrace[stackTrace.length - 1]; if (topElement.isNativeMethod()) { //Socket/SQL (connect) - java.net.DualStackPlainSocketImpl.connect0 //Socket/SQL (read) - java.net.SocketInputStream.socketRead0 //Socket/SQL (write) - java.net.SocketOutputStream.socketWrite0 if (isElementEqual(topElement, \"java.net.DualStackPlainSocketImpl\", \"connect0\") || isElementEqual(topElement, \"java.net.SocketInputStream\", \"socketRead0\") || isElementEqual(topElement, \"java.net.SocketOutputStream\", \"socketWrite0\")) { actionManager.logCurrentStack(\"Server is performing {1} on the main thread. \" + \"Properly caused by {0}\", \"java.net.SocketStream\"); } //File (in) - java.io.FileInputStream.readBytes //File (out) - java.io.FileOutputStream.writeBytes else if (isElementEqual(topElement, \"java.io.FileInputStream\", \"readBytes\") || isElementEqual(topElement, \"java.io.FileOutputStream\", \"writeBytes\")) { actionManager.logCurrentStack(\"Server is performing {1} on the main thread. \" + \"Properly caused by {0}\", \"java.io.FileStream\"); } } } }", "tokens": 433} {"id": 205676, "source": "method", "repo": "games647/lagmonitor", "text": "public static long getFolderSize(Logger logger, Path folder) { try (Stream walk = Files.walk(folder, 3)) { return walk .parallel() .filter(Files::isRegularFile) .mapToLong(path -> { try { return Files.size(path); } catch (IOException ioEx) { return 0; } }).sum(); } catch (IOException ioEx) { logger.log(Level.INFO, \"Cannot walk file tree to calculate folder size\", ioEx); } return -1; }", "tokens": 116} {"id": 205734, "source": "method", "repo": "gaming32/arrayv", "text": "private void jButton7ActionPerformed() {//GEN-FIRST:event_jButton4ActionPerformed arrayVisualizer.setCanceled(true); }", "tokens": 27} {"id": 205739, "source": "method", "repo": "gaming32/arrayv", "text": "public int hashCode() { return 31 * eventType.hashCode() + callback.hashCode(); }", "tokens": 21} {"id": 205803, "source": "method", "repo": "gaming32/arrayv", "text": "public String getExtraHeading() { return this.extraHeading; }", "tokens": 15} {"id": 205841, "source": "method", "repo": "gaming32/arrayv", "text": "public void keyTyped(KeyEvent e) { }", "tokens": 12} {"id": 205957, "source": "method", "repo": "gaming32/arrayv", "text": "private void smartBogoBogo(int[] array, int length) { if (length == 1) return; smartBogoBogo(array, length-1); while (Reads.compareIndices(array, length-2, length-1, this.delay, true) > 0) { this.bogoSwap(array, 0, length, false); smartBogoBogo(array, length-1); } }", "tokens": 95} {"id": 206012, "source": "method", "repo": "gaming32/arrayv", "text": "private void recursiveComb(int pos, int gap, int end) { if(pos+gap > end) return; RecursiveComb a = new RecursiveComb(pos, gap*2, end); RecursiveComb b = new RecursiveComb(pos+gap, gap*2, end); a.start(); b.start(); try { a.join(); b.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } this.powerOfThree(pos, gap, end); }", "tokens": 110} {"id": 206030, "source": "method", "repo": "gaming32/arrayv", "text": "private void smartInPlaceMerge(int[] array, int a, int m, int b) { if(this.checkSorted(array, a, m, b)) this.inPlaceMergeBW(array, a, m, b); }", "tokens": 53} {"id": 206067, "source": "method", "repo": "gaming32/arrayv", "text": "private int medianOfThreeNinthers(int[] array, int a, int b) { int s = (b-a)/3; int a1 = this.ninther(array, a, a+s); int m1 = this.ninther(array, a+s, a+2*s); int b1 = this.ninther(array, a+2*s, b); return this.medianOfThree(array, a1, m1, b1); }", "tokens": 114} {"id": 206078, "source": "method", "repo": "gaming32/arrayv", "text": "public void rotateLength(int[] array, int leftLength, int rightLength) { this.grailRotate(array, 0, leftLength, rightLength); }", "tokens": 37} {"id": 206188, "source": "method", "repo": "gaming32/arrayv", "text": "public AndreySort(ArrayVisualizer arrayVisualizer) { super(arrayVisualizer); this.setSortListName(\"Andrey's Merge\"); this.setRunAllSortsName(\"Andrey Astrelin's In-Place Merge Sort\"); this.setRunSortName(\"Andreysort\"); this.setCategory(\"Merge Sorts\"); this.setBucketSort(false); this.setRadixSort(false); this.setUnreasonablySlow(false); this.setUnreasonableLimit(0); this.setBogoSort(false); }", "tokens": 114} {"id": 206229, "source": "method", "repo": "gaming32/arrayv", "text": "public void runSort(int[] arr, int length, int base) { for (int i = length - 1; i > -1; i--) this.siftDown(arr, base, i, length, 1); for (int i = length - 1; i > 0; i--) { Writes.swap(arr, 0, i, 1, true, false); this.siftDown(arr, base, 0, i, 1); } }", "tokens": 109} {"id": 206562, "source": "method", "repo": "gaming32/arrayv", "text": "public String getVisualTime() { return this.visualTime; }", "tokens": 15} {"id": 206649, "source": "method", "repo": "gaucho-matrero/altoclef", "text": "/** Run a user task */ public void runUserTask(Task task, Runnable onFinish) { _userTaskChain.runTask(this, task, onFinish); }", "tokens": 37} {"id": 206780, "source": "method", "repo": "gaucho-matrero/altoclef", "text": "public Arg(Class type, String name) throws CommandException { _name = name; // I really hate java _tType = type; _showDefault = true; _hasDefault = false; // If enum, we're good if (!_tType.isEnum()) { // Make sure as an extra precaution that we only use (non enum) types we can handle if (!isInstancesOf(_tType, String.class, Float.class, Integer.class, Double.class, Long.class, ItemList.class, GotoTarget.class)) { throw new CommandException(\"Arguments are not programmed to parse the following type: \" + _tType +\". This is either not implemented intentionally or by accident somehow.\"); } } }", "tokens": 172} {"id": 206901, "source": "method", "repo": "gaucho-matrero/altoclef", "text": "protected void onStart(AltoClef mod) { mod.getBehaviour().push(); // Avoid breaking portal frame if we're obsidian. mod.getBehaviour().avoidBlockBreaking(block -> { if (_origin != null) { // Don't break frame for (Vec3i framePosRelative : PORTAL_FRAME) { BlockPos framePos = _origin.add(framePosRelative); if (block.equals(framePos)) { return mod.getWorld().getBlockState(framePos).getBlock() == Blocks.OBSIDIAN; } } } return false; }); mod.getBehaviour().addProtectedItems(Items.FLINT_AND_STEEL); }", "tokens": 138} {"id": 206988, "source": "method", "repo": "gaucho-matrero/altoclef", "text": "protected boolean isEqual(Task other) { return other instanceof PlaceBedAndSetSpawnTask; }", "tokens": 21} {"id": 207077, "source": "method", "repo": "gaucho-matrero/altoclef", "text": "public boolean isFinished(AltoClef mod) { return mod.getPlayer().isSwimming() || mod.getPlayer().isTouchingWater() || mod.getPlayer().isOnGround() || mod.getPlayer().isClimbing(); }", "tokens": 47} {"id": 207349, "source": "method", "repo": "gaucho-matrero/altoclef", "text": "public void clear() { Debug.logInternal(\"CLEARED BLOCK CACHE\"); _cachedBlocks.clear(); _cachedByPosition.clear(); _blacklist.clear(); }", "tokens": 40} {"id": 207385, "source": "method", "repo": "gaucho-matrero/altoclef", "text": "public Optional getContainerAtPosition(BlockPos pos) { return getContainerAtPosition(WorldHelper.getCurrentDimension(), pos); }", "tokens": 31} {"id": 207429, "source": "method", "repo": "gaucho-matrero/altoclef", "text": "public int getHeight() { return _height; }", "tokens": 12} {"id": 207599, "source": "method", "repo": "gazbert/bxbot", "text": "public String getBaseCurrency() { return baseCurrency; }", "tokens": 12} {"id": 207609, "source": "method", "repo": "gazbert/bxbot", "text": "/** Creates the Trading Strategy instance. @param strategyConfig the strategy config. @return the trading strategy. */ TradingStrategy createTradingStrategy(StrategyConfig strategyConfig) { final String tradingStrategyClassname = strategyConfig.getClassName(); final String tradingStrategyBeanName = strategyConfig.getBeanName(); TradingStrategy strategyImpl = null; if (tradingStrategyBeanName != null) { // if beanName is configured, try and get the bean first try { strategyImpl = (TradingStrategy) springContext.getBean(tradingStrategyBeanName); } catch (NullPointerException e) { final String errorMsg = \"Failed to obtain bean [\" + tradingStrategyBeanName + \"] from spring context\"; log.error(errorMsg); throw new IllegalArgumentException(errorMsg); } } if (strategyImpl == null) { // if beanName not configured use className strategyImpl = configurableComponentFactory.createComponent(tradingStrategyClassname); } return strategyImpl; }", "tokens": 189} {"id": 207649, "source": "method", "repo": "gazbert/bxbot", "text": "void testToStringWorksAsExpected() { final Map items = new HashMap<>(); items.put(BUY_FEE_CONFIG_ITEM_KEY, BUY_FEE_CONFIG_ITEM_VALUE); items.put(SELL_FEE_CONFIG_ITEM_KEY, SELL_FEE_CONFIG_ITEM_VALUE); final OtherConfigImpl otherConfig = new OtherConfigImpl(); otherConfig.setItems(items); assertTrue(otherConfig.toString().contains(items.toString())); }", "tokens": 103} {"id": 207848, "source": "method", "repo": "gazbert/bxbot", "text": "public String toString() { return MoreObjects.toStringHelper(this).add(\"open\", open).toString(); }", "tokens": 26} {"id": 207957, "source": "method", "repo": "gazbert/bxbot", "text": "public void testExchangeAdapterThrowsExceptionIfSecretConfigIsMissing() { PowerMock.reset(authenticationConfig); expect(authenticationConfig.getItem(\"client-id\")).andReturn(\"your-client-id\"); expect(authenticationConfig.getItem(\"key\")).andReturn(\"your-client-key\"); expect(authenticationConfig.getItem(\"secret\")).andReturn(null); PowerMock.replayAll(); final ExchangeAdapter exchangeAdapter = new BitstampExchangeAdapter(); exchangeAdapter.init(exchangeConfig); PowerMock.verifyAll(); }", "tokens": 94} {"id": 207998, "source": "method", "repo": "gazbert/bxbot", "text": "public void testGettingMarketOrdersHandlesUnexpectedException() throws Exception { final KrakenExchangeAdapter exchangeAdapter = PowerMock.createPartialMockAndInvokeDefaultConstructor( KrakenExchangeAdapter.class, MOCKED_SEND_PUBLIC_REQUEST_TO_EXCHANGE_METHOD); mockAssetPairsPublicRequest(exchangeAdapter); PowerMock.expectPrivate( exchangeAdapter, MOCKED_SEND_PUBLIC_REQUEST_TO_EXCHANGE_METHOD, eq(DEPTH), anyObject(Map.class)) .andThrow( new IllegalArgumentException( \"Down time is the worst, isn\u2019t it? \" + \"Adrenaline leaves and the mind starts to wander...\")); PowerMock.replayAll(); exchangeAdapter.init(exchangeConfig); exchangeAdapter.getMarketOrders(MARKET_ID); PowerMock.verifyAll(); }", "tokens": 155} {"id": 208182, "source": "method", "repo": "gazbert/bxbot", "text": "private ResponseEntity buildResponseEntity(MarketConfig entity, HttpStatus status) { log.info(\"Response: {}\", entity); return new ResponseEntity<>(entity, null, status); }", "tokens": 37} {"id": 208296, "source": "method", "repo": "gazbert/bxbot", "text": "void testCreateMarketConfigWhenStrategyIdMissing() throws Exception { given(marketConfigService.createMarketConfig(someMarketConfig())).willReturn(null); mockMvc .perform( post(MARKETS_CONFIG_ENDPOINT_URI) .header(\"Authorization\", \"Bearer \" + getJwt(VALID_ADMIN_NAME, VALID_ADMIN_PASSWORD)) .accept(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON) .content(jsonify(someMarketConfigWithMissingStrategyId()))) .andExpect(status().isBadRequest()); }", "tokens": 113} {"id": 208334, "source": "method", "repo": "gazbert/bxbot", "text": "void testBotRestartWithAdminTokenAuthorized() throws Exception { given(botRestartService.restart()).willReturn(BOT_STATUS); mockMvc .perform( post(RESTART_ENDPOINT_URI) .header( \"Authorization\", \"Bearer \" + getJwt(VALID_ADMIN_NAME, VALID_ADMIN_PASSWORD))) .andDo(print()) .andExpect(status().isOk()) .andExpect(jsonPath(\"$\").value(BOT_STATUS)); verify(botRestartService, times(1)).restart(); }", "tokens": 109} {"id": 208499, "source": "method", "repo": "gdgahmedabad/awesome-learning-resources", "text": "public static void logCaptureEvent() { Bundle bundle = new Bundle(); bundle.putInt(FirebaseAnalytics.Param.ITEM_ID, 1); bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, \"Click Picture\"); bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, \"image\"); mFirebaseAnalytics.logEvent(\"Click_Picture\", bundle); Answers.getInstance().logCustom(new CustomEvent(\"Click_Picture\") .putCustomAttribute(\"CONTENT_TYPE\", \"image\") ); Answers.getInstance().logContentView(new ContentViewEvent() .putContentName(\"Click_Picture\") .putContentType(\"image\") .putContentId(\"1\")); }", "tokens": 154} {"id": 208505, "source": "method", "repo": "gdgahmedabad/awesome-learning-resources", "text": "private void clearAll() { Collection anchors = arFragment.getArSceneView().getSession().getAllAnchors(); Log.w(TAG, \"clearAll: \" + anchors.size()); if (anchors.size() > 0) { for (Anchor anchor : anchors) { anchor.detach(); } } }", "tokens": 72} {"id": 208590, "source": "method", "repo": "gdgahmedabad/awesome-learning-resources", "text": "/** @return The creationDate */ public Integer getCreationDate() { return creationDate; }", "tokens": 20} {"id": 208716, "source": "method", "repo": "gdgahmedabad/awesome-learning-resources", "text": "public void onDestroy() { if (mEventBus.isRegistered(this)) { mEventBus.unregister(this); } dismissProgress(); super.onDestroy(); }", "tokens": 33} {"id": 208769, "source": "method", "repo": "gdgahmedabad/awesome-learning-resources", "text": "/** Call this method if No internet connection or other use. @param resultMsgUser User defined messages. */ public void postUnexpectedError(String resultMsgUser) { EventBus.getDefault().post(new ApiErrorWithMessageEvent(requestTag, resultMsgUser)); finishRequest(); }", "tokens": 59} {"id": 208780, "source": "method", "repo": "gdgahmedabad/awesome-learning-resources", "text": "/** Returns true if the request with the passed tag is in the list of running requests, false otherwise. */ public boolean isRequestRunning(String requestTag) { return requests.containsKey(requestTag); }", "tokens": 43} {"id": 208986, "source": "method", "repo": "geekidea/spring-boot-plus", "text": "public Integer getPageIndex() { if (pageIndex == null || pageIndex <= 0) { pageIndex = CommonConstant.DEFAULT_PAGE_INDEX; } return pageIndex; }", "tokens": 39} {"id": 209165, "source": "method", "repo": "geforce132/securitycraft", "text": "public static Owner fromCompound(CompoundTag tag) { Owner owner = new Owner(); if (tag != null) { owner.ownerName = tag.getStringOr(\"owner\", owner.ownerName); owner.ownerUUID = tag.getStringOr(\"ownerUUID\", owner.ownerUUID); owner.validated = tag.getBooleanOr(\"ownerValidated\", owner.validated); } return owner; }", "tokens": 83} {"id": 209291, "source": "method", "repo": "geforce132/securitycraft", "text": "protected Component getDefaultName() { return Component.translatable(SCContent.REINFORCED_HOPPER.get().getDescriptionId()); }", "tokens": 23} {"id": 209482, "source": "method", "repo": "geforce132/securitycraft", "text": "public boolean isConduitFrame(BlockState state, LevelReader level, BlockPos pos, BlockPos conduit) { return this == SCContent.REINFORCED_PRISMARINE.get() || this == SCContent.REINFORCED_PRISMARINE_BRICKS.get() || this == SCContent.REINFORCED_SEA_LANTERN.get() || this == SCContent.REINFORCED_DARK_PRISMARINE.get(); }", "tokens": 89} {"id": 209800, "source": "method", "repo": "geforce132/securitycraft", "text": "public Provider(SpriteSet sprites) { this.sprites = sprites; }", "tokens": 19} {"id": 209812, "source": "method", "repo": "geforce132/securitycraft", "text": "public void submit(TntRenderState state, PoseStack pose, SubmitNodeCollector collector, CameraRenderState camera) { pose.pushPose(); pose.translate(0.0F, 0.5F, 0.0F); if (state.fuseRemainingInTicks < 10.0F) { float scale = 1.0F - state.fuseRemainingInTicks / 10.0F; scale = Mth.clamp(scale, 0.0F, 1.0F); scale *= scale; scale *= scale; scale = 1.0F + scale * 0.3F; pose.scale(scale, scale, scale); } pose.mulPose(Axis.YP.rotationDegrees(-90.0F)); pose.translate(-0.5F, -0.5F, 0.5F); pose.mulPose(Axis.YP.rotationDegrees(90.0F)); if (!state.blockState.isEmpty()) TntMinecartRenderer.submitWhiteSolidBlock(state.blockState, pose, collector, state.lightCoords, (int) state.fuseRemainingInTicks / 5 % 2 == 0, state.outlineColor); pose.popPose(); super.submit(state, pose, collector, camera); }", "tokens": 274} {"id": 210267, "source": "method", "repo": "george8188625/Create-Electro-Energetics", "text": "protected void read(CompoundTag tag, HolderLookup.Provider registries, boolean clientPacket) { super.read(tag, registries, clientPacket); ResourceLocation firstID = ResourceLocation.tryParse(tag.getString(\"FirstID\")); if (firstID != null) { FuseHoldable type = FuseHoldable.ALL.get(firstID); if (type != null) { firstFuse = Pair.of(type, tag.getCompound(\"FirstData\")); } else firstFuse = null; } else firstFuse = null; ResourceLocation secondID = ResourceLocation.tryParse(tag.getString(\"SecondID\")); if (secondID != null) { FuseHoldable type = FuseHoldable.ALL.get(secondID); if (type != null) { secondFuse = Pair.of(type, tag.getCompound(\"SecondData\")); } else secondFuse = null; } else secondFuse = null; }", "tokens": 190} {"id": 210335, "source": "method", "repo": "george8188625/Create-Electro-Energetics", "text": "public void tick() { if (attachedTo == null || attachedTo.getCenter().length() > 7 || !countsAsPole(attachedTo.offset(worldPosition))) { BlockPos polePos = null; float shortestDistance = 999; for (BlockPos.MutableBlockPos offset : offsets) { BlockPos pos = offset.immutable(); float distance = (float) pos.getCenter().length(); if (distance < shortestDistance && countsAsPole(pos.offset(worldPosition))) { polePos = pos; shortestDistance = distance; } } if (polePos != null) { if (!polePos.equals(attachedTo)) invalidateRenderBoundingBox(); attachedTo = polePos; } else attachedTo = null; } }", "tokens": 157} {"id": 210596, "source": "method", "repo": "george8188625/Create-Electro-Energetics", "text": "public double getMaxZ() { return maxZ; }", "tokens": 11} {"id": 210719, "source": "method", "repo": "george8188625/Create-Electro-Energetics", "text": "public boolean isSimpleResistor() { return true; }", "tokens": 14} {"id": 210870, "source": "method", "repo": "georgewfraser/java-language-server", "text": "private Path bazelWorkspaceRoot() { for (var current = workspaceRoot; current != null; current = current.getParent()) { if (Files.exists(current.resolve(\"WORKSPACE\"))) { return current; } } return workspaceRoot; }", "tokens": 51} {"id": 210905, "source": "method", "repo": "georgewfraser/java-language-server", "text": "private static Path execJavaHome() { try { var process = new ProcessBuilder().command(\"/usr/libexec/java_home\").start(); var out = new BufferedReader(new InputStreamReader(process.getInputStream())); var line = out.readLine(); process.waitFor(5, TimeUnit.SECONDS); return Paths.get(line); } catch (IOException | InterruptedException e) { throw new RuntimeException(e); } }", "tokens": 87} {"id": 211046, "source": "method", "repo": "georgewfraser/java-language-server", "text": "private CompletionList completeDeclaredTypeMemberSelect( CompileTask task, Scope scope, DeclaredType type, boolean isStatic, String partial, boolean endsWithParen) { var trees = Trees.instance(task.task); var typeElement = (TypeElement) type.asElement(); var list = new ArrayList(); var methods = new HashMap>(); for (var member : task.task.getElements().getAllMembers(typeElement)) { if (member.getKind() == ElementKind.CONSTRUCTOR) continue; if (!StringSearch.matchesPartialName(member.getSimpleName(), partial)) continue; if (!trees.isAccessible(scope, member, type)) continue; if (isStatic != member.getModifiers().contains(Modifier.STATIC)) continue; if (member.getKind() == ElementKind.METHOD) { putMethod((ExecutableElement) member, methods); } else { list.add(item(task, member)); } } for (var overloads : methods.values()) { list.add(method(task, overloads, !endsWithParen)); } if (isStatic) { list.add(keyword(\"class\")); } if (isStatic && isEnclosingClass(type, scope)) { list.add(keyword(\"this\")); list.add(keyword(\"super\")); } return new CompletionList(false, list); }", "tokens": 282} {"id": 211152, "source": "method", "repo": "georgewfraser/java-language-server", "text": "/** Returns the simple name of the underlying class as given in the source code.

Behaves identically to {@link Class#getSimpleName()} but does not require the class to be loaded. */ public String getSimpleName() { int lastDollarSign = className.lastIndexOf('$'); if (lastDollarSign != -1) { String innerClassName = className.substring(lastDollarSign + 1); // local and anonymous classes are prefixed with number (1,2,3...), anonymous classes are // entirely numeric whereas local classes have the user supplied name as a suffix var prefix = 0; while (prefix < innerClassName.length() && Character.isDigit(innerClassName.charAt(prefix))) { prefix++; } return innerClassName.substring(prefix); } String packageName = getPackageName(); if (packageName.isEmpty()) { return className; } // Since this is a top level class, its simple name is always the part after package name. return className.substring(packageName.length() + 1); }", "tokens": 212} {"id": 211217, "source": "method", "repo": "georgewfraser/java-language-server", "text": "public int getIncrement() { return increment; }", "tokens": 11} {"id": 211297, "source": "method", "repo": "georgewfraser/java-language-server", "text": "FindReferences(JavacTask task, Element find) { this.task = task; this.find = find; }", "tokens": 26} {"id": 211420, "source": "method", "repo": "georgewfraser/java-language-server", "text": "/** First sentence. Second paragraph with {@code code}. @param value the input value @return the same value */ String documentMe(String value) { return value; }", "tokens": 36} {"id": 211440, "source": "method", "repo": "georgewfraser/java-language-server", "text": "void testGotoPackagePrivate() { var x = GotoPackagePrivate.PUBLIC_FIELD; }", "tokens": 21} {"id": 211509, "source": "method", "repo": "georgewfraser/java-language-server", "text": "/** A constructor */ SignatureHelp(String name) { // Nothing to do }", "tokens": 17} {"id": 211553, "source": "method", "repo": "georgewfraser/java-language-server", "text": "public void parsePlain(CompilerState state, Blackhole blackhole) { var parse = Parser.parseJavaFileObject(state.plainSource()); blackhole.consume(parse.root); }", "tokens": 38} {"id": 211575, "source": "method", "repo": "georgewfraser/java-language-server", "text": "static String itemInsertText(CompletionItem i) { var text = i.insertText; if (text == null) text = i.label; assert text != null : \"Either insertText or label must be defined\"; return text; }", "tokens": 51} {"id": 211630, "source": "method", "repo": "georgewfraser/java-language-server", "text": "public void referenceIndirectImport() { assertThat( items(\"/org/javacs/other/ImportIndirectly.java\", 4, 25), contains(\"ReferenceIndirectImport.java(9)\")); }", "tokens": 43} {"id": 211643, "source": "method", "repo": "georgewfraser/java-language-server", "text": "public void otherCompiledFile() { var suggestions = doGoto(file, 29, 25); assertThat(suggestions, hasItem(startsWith(\"GotoOther.java:\"))); }", "tokens": 40} {"id": 211697, "source": "method", "repo": "georgewfraser/java-language-server", "text": "public void symbolsInFile() { var path = \"/org/javacs/example/AutocompleteMemberFixed.java\"; var all = searchFile(FindResource.uri(path)); assertThat( all, hasItems( \"methodStatic\", \"method\", \"methodStaticPrivate\", \"methodPrivate\")); assertThat( all, hasItems( \"fieldStatic\", \"field\", \"fieldStaticPrivate\", \"fieldPrivate\")); }", "tokens": 84} {"id": 211713, "source": "method", "repo": "georgewfraser/java-language-server", "text": "public void testNext() { testNext(\"\", \"\", 0); testNext(\"\", \"abc\", 0); testNext(\"abc\", \"\", -1); testNext(\"abc\", \"abc\", 0); testNext(\"d\", \"abcdefg\", 3); testNext(\"nan\", \"banana\", 2); testNext(\"pan\", \"anpanman\", 2); testNext(\"nnaaman\", \"anpanmanam\", -1); testNext(\"abcd\", \"abc\", -1); testNext(\"abcd\", \"bcd\", -1); testNext(\"bcd\", \"abcd\", 1); testNext(\"abc\", \"acca\", -1); testNext(\"aa\", \"aaa\", 0); testNext(\"baa\", \"aaaaa\", -1); testNext(\"at that\", \"which finally halts. at that point\", 22); }", "tokens": 187} {"id": 211791, "source": "method", "repo": "geysermc/floodgate", "text": "public boolean channelRead(Object msg) { if (msg instanceof PacketWrapper) { DefinedPacket packet = ((PacketWrapper) msg).packet; // we're only interested in the Handshake packet if (packet instanceof Handshake) { handle(msg, ((Handshake) packet).getHost()); // otherwise, it'll get read twice. once by the packet queue and once by this method return false; } } return true; }", "tokens": 94} {"id": 211798, "source": "method", "repo": "geysermc/floodgate", "text": "public void onLogin(LoginEvent event) { // if there was another player with the same uuid / name online, // he has been disconnected by now UUID uniqueId = event.getConnection().getUniqueId(); FloodgatePlayer player = api.getPlayer(uniqueId); if (player != null) { //todo we should probably move this log message earlier in the process, so that we know // that Floodgate has done its job logger.translatedInfo( \"floodgate.ingame.login_name\", player.getCorrectUsername(), uniqueId ); languageManager.loadLocale(player.getLanguageCode()); } }", "tokens": 120} {"id": 211862, "source": "method", "repo": "geysermc/floodgate", "text": "public void channelRead(ChannelHandlerContext ctx, Object packet) { // prevent other packets from being handled while we handle the handshake packet if (!packetQueue.isEmpty()) { packetQueue.add(packet); return; } try { if (channelRead(packet)) { ctx.fireChannelRead(packet); } } catch (Exception exception) { exception.printStackTrace(); ctx.close(); } }", "tokens": 81} {"id": 211873, "source": "method", "repo": "geysermc/floodgate", "text": "public boolean enabled() { return blockPackets; }", "tokens": 11} {"id": 212019, "source": "method", "repo": "geysermc/floodgate", "text": "public PlayerLink playerLink(PlayerLinkHolder linkLoader) { return linkLoader.load(); }", "tokens": 21} {"id": 212044, "source": "method", "repo": "geysermc/floodgate", "text": "public Class floodgateConfigClass() { return FloodgateConfig.class; }", "tokens": 21} {"id": 212123, "source": "method", "repo": "geysermc/floodgate", "text": "public PluginMessageChannel getChannel(String identifier) { return identifierInstanceMap.get(identifier); }", "tokens": 22} {"id": 212191, "source": "method", "repo": "geysermc/floodgate", "text": "private void appendPlatformData(JsonObjectBuilder builder) { builder.appendField(\"osName\", System.getProperty(\"os.name\")); builder.appendField(\"osArch\", System.getProperty(\"os.arch\")); builder.appendField(\"osVersion\", System.getProperty(\"os.version\")); builder.appendField(\"coreCount\", Runtime.getRuntime().availableProcessors()); }", "tokens": 75} {"id": 212321, "source": "method", "repo": "geysermc/floodgate", "text": "public synchronized List subList(int fromIndex, int toIndex) { return originalList.subList(fromIndex, toIndex); }", "tokens": 29} {"id": 212339, "source": "method", "repo": "geysermc/floodgate", "text": "public String packetHandler() { return \"packet_handler\"; }", "tokens": 14} {"id": 212529, "source": "method", "repo": "geysermc/geyser", "text": "public void onPistonExtend(BlockPistonExtendEvent event) { onPistonAction(event); }", "tokens": 21} {"id": 212587, "source": "method", "repo": "geysermc/geyser", "text": "private String formatAuthors(List authors) { return authors.isEmpty() ? \"\" : \" by: \" + String.join(\", \", authors); }", "tokens": 36} {"id": 212742, "source": "method", "repo": "geysermc/geyser", "text": "public boolean useArmSwingAttack() { return true; }", "tokens": 13} {"id": 212852, "source": "method", "repo": "geysermc/geyser", "text": "private void setItem(int slot, GeyserItemStack item) { simulatedItems.put(slot, item); onSlotItemChange(slot, item); }", "tokens": 33} {"id": 212860, "source": "method", "repo": "geysermc/geyser", "text": "public float range() { return instrument.range(); }", "tokens": 12} {"id": 212917, "source": "method", "repo": "geysermc/geyser", "text": "/** Creates a hasher that always encodes into an empty map. */ static MinecraftHasher unit() { return (value, encoder) -> encoder.emptyMap(); }", "tokens": 40} {"id": 212959, "source": "method", "repo": "geysermc/geyser", "text": "public CustomBlockState build() { for (String propertyName : blockData.properties().keySet()) { if (!properties.containsKey(propertyName)) { throw new IllegalArgumentException(\"Missing property: \" + propertyName); } } for (Map.Entry entry : properties.entrySet()) { String propertyName = entry.getKey(); Object propertyValue = entry.getValue(); CustomBlockProperty property = blockData.properties().get(propertyName); if (property == null) { throw new IllegalArgumentException(\"Unknown property: \" + propertyName); } else if (!property.values().contains(propertyValue)) { throw new IllegalArgumentException(\"Invalid value: \" + propertyValue + \" for property: \" + propertyName); } } return new GeyserCustomBlockState(blockData, Object2ObjectMaps.unmodifiable(properties)); }", "tokens": 165} {"id": 213019, "source": "method", "repo": "geysermc/geyser", "text": "public IllegalPacketException(String message) { super(message); }", "tokens": 16} {"id": 213053, "source": "method", "repo": "geysermc/geyser", "text": "public ChannelFuture writeAndFlush(Object o, ChannelPromise channelPromise) { return source.writeAndFlush(o, channelPromise); }", "tokens": 27} {"id": 213078, "source": "method", "repo": "geysermc/geyser", "text": "protected DeferredRegistry(I input, RegistryInitializer registryInitializer, Supplier> deferredLoader) { this.backingRegistry = registryInitializer.initialize(input, RegistryLoaders.uninitialized()); this.loader = () -> deferredLoader.get().load(input); }", "tokens": 72} {"id": 213251, "source": "method", "repo": "geysermc/geyser", "text": "private static byte[] requestImageData(String imageUrl, boolean isCape) throws Exception { BufferedImage image = requestImage(imageUrl, isCape); byte[] data = bufferedImageToImageData(image); image.flush(); return data; }", "tokens": 53} {"id": 213363, "source": "method", "repo": "geysermc/geyser", "text": "public static int mixDyes(@Nullable Integer current, List dyes) { int totalRed = 0; int totalGreen = 0; int totalBlue = 0; int totalIntensity = 0; int colorCount = 0; if (current != null) { int red = argbRed(current); int green = argbGreen(current); int blue = argbBlue(current); totalIntensity += Math.max(red, Math.max(green, blue)); totalRed += red; totalGreen += green; totalBlue += blue; colorCount++; } for (DyeColor dye : dyes) { int color = dye.getTextureDiffuseColor(); int red = argbRed(color); int green = argbGreen(color); int blue = argbBlue(color); totalIntensity += Math.max(red, Math.max(green, blue)); totalRed += red; totalGreen += green; totalBlue += blue; colorCount++; } int red = totalRed / colorCount; int green = totalGreen / colorCount; int blue = totalBlue / colorCount; float averageIntensity = (float) totalIntensity / colorCount; float resultIntensity = Math.max(red, Math.max(green, blue)); red = (int) (red * averageIntensity / resultIntensity); green = (int) (green * averageIntensity / resultIntensity); blue = (int) (blue * averageIntensity / resultIntensity); return argbColor(0, red, green, blue); }", "tokens": 314} {"id": 213488, "source": "method", "repo": "geysermc/hydraulic", "text": "public static void setup(Item item, CustomItemBedrockOptions.Builder customItemOptions) { CreativeMapping mapping = getMapping(item); if (mapping == null) { return; } customItemOptions.creativeGroup(mapping.creativeGroup().group()).creativeCategory(mapping.creativeCategory()); }", "tokens": 63} {"id": 213580, "source": "method", "repo": "geysermc/hydraulic", "text": "public static HydraulicKey of(@Nullable org.geysermc.geyser.api.util.Identifier id) { if (id == null) return null; return new HydraulicKey(id); }", "tokens": 42} {"id": 213602, "source": "method", "repo": "geysermc/hydraulic", "text": "public int getMinY() { return 0; }", "tokens": 12} {"id": 213754, "source": "method", "repo": "geysermc/mcprotocollib", "text": "protected void setOptions(ServerBootstrap bootstrap) { bootstrap.childOption(ChannelOption.TCP_NODELAY, true); bootstrap.childOption(ChannelOption.IP_TOS, 0x18); if (getGlobalFlag(BuiltinFlags.TCP_FAST_OPEN, false) && TransportHelper.TRANSPORT_TYPE.supportsTcpFastOpenServer()) { bootstrap.option(ChannelOption.TCP_FASTOPEN, 3); } bootstrap.option(ChannelOption.ALLOCATOR, getGlobalFlag(BuiltinFlags.ALLOCATOR, ByteBufAllocator.DEFAULT)); }", "tokens": 119} {"id": 213773, "source": "method", "repo": "geysermc/mcprotocollib", "text": "public void setEncryption(@Nullable EncryptionConfig encryptionConfig) { if (channel == null) { throw new IllegalStateException(\"You need to connect to set the encryption!\"); } log.debug(\"Setting encryption for session {}\", this); channel.attr(NetworkConstants.ENCRYPTION_ATTRIBUTE_KEY).set(encryptionConfig); }", "tokens": 67} {"id": 213868, "source": "method", "repo": "geysermc/mcprotocollib", "text": "public static void writePositionSource(ByteBuf buf, PositionSource positionSource) { MinecraftTypes.writeVarInt(buf, positionSource.getType().ordinal()); if (positionSource instanceof BlockPositionSource blockPositionSource) { MinecraftTypes.writePosition(buf, blockPositionSource.getPosition()); } else if (positionSource instanceof EntityPositionSource entityPositionSource) { MinecraftTypes.writeVarInt(buf, entityPositionSource.getEntityId()); buf.writeFloat(entityPositionSource.getYOffset()); } else { throw new IllegalStateException(\"Unknown position source type!\"); } }", "tokens": 109} {"id": 213917, "source": "method", "repo": "geysermc/mcprotocollib", "text": "public DisplayData(Component title, Component description, ItemStack icon, AdvancementType advancementType, boolean showToast, boolean hidden) { this(title, description, icon, advancementType, showToast, hidden, null); }", "tokens": 46} {"id": 213984, "source": "method", "repo": "geysermc/mcprotocollib", "text": "public int getY() { return position.getY(); }", "tokens": 13} {"id": 214161, "source": "method", "repo": "geysermc/mcprotocollib", "text": "public RecipeDisplayType getType() { return RecipeDisplayType.CRAFTING_SHAPELESS; }", "tokens": 19} {"id": 214286, "source": "method", "repo": "geysermc/mcprotocollib", "text": "public ClientboundPlayerLookAtPacket(ByteBuf in) { this.origin = RotationOrigin.from(MinecraftTypes.readVarInt(in)); this.x = in.readDouble(); this.y = in.readDouble(); this.z = in.readDouble(); if (in.readBoolean()) { this.targetEntityId = MinecraftTypes.readVarInt(in); this.targetEntityOrigin = RotationOrigin.from(MinecraftTypes.readVarInt(in)); } else { this.targetEntityId = 0; this.targetEntityOrigin = null; } }", "tokens": 111} {"id": 214300, "source": "method", "repo": "geysermc/mcprotocollib", "text": "public void serialize(ByteBuf out) { MinecraftTypes.writeVarInt(out, this.containerId); out.writeShort(this.rawProperty); out.writeShort(this.value); }", "tokens": 37} {"id": 214339, "source": "method", "repo": "geysermc/mcprotocollib", "text": "public ClientboundSetDisplayObjectivePacket(ByteBuf in) { this.position = ScoreboardPosition.from(MinecraftTypes.readVarInt(in)); this.name = MinecraftTypes.readString(in); }", "tokens": 39} {"id": 214398, "source": "method", "repo": "geysermc/mcprotocollib", "text": "public void serialize(ByteBuf out) { out.writeFloat(this.yaw); out.writeFloat(this.pitch); int flags = 0; if (this.onGround) { flags |= 0x1; } if (this.horizontalCollision) { flags |= 0x2; } out.writeByte(flags); }", "tokens": 69} {"id": 214498, "source": "method", "repo": "geysermc/packconverter", "text": "public ConverterPipeline(AssetExtractor extractor, AssetConverter converter, AssetCombiner combiner, boolean experimental, Optional> listener) { this.extractor = extractor; this.converter = converter; this.combiner = combiner; this.experimental = experimental; this.listener = listener; }", "tokens": 82} {"id": 214567, "source": "method", "repo": "geysermc/packconverter", "text": "default void info(@NotNull String message) { logListener().info(message); }", "tokens": 18} {"id": 214581, "source": "method", "repo": "geysermc/packconverter", "text": "public ZipUtils(PackConverter packConverter, File sourceFolder) { this.packConverter = packConverter; this.sourceFolder = sourceFolder; }", "tokens": 30} {"id": 214596, "source": "method", "repo": "geysermc/packconverter", "text": "public void addFlipbookTexture(@NotNull String id, @NotNull String textureLocation, @NotNull int ticksPerFrame) { if (this.flipbookTextures == null) { this.flipbookTextures = new HashMap<>(); } FlipbookTexture texture = new FlipbookTexture(); texture.atlasTile(id); texture.flipbookTexture(textureLocation); texture.ticksPerFrame(ticksPerFrame); this.flipbookTextures.put(id, texture); }", "tokens": 93} {"id": 214738, "source": "method", "repo": "geysermc/packconverter", "text": "/** The specification of colors in a given biome. @param sunflowerPlains Biome */ public void sunflowerPlains(SunflowerPlains sunflowerPlains) { this.sunflowerPlains = sunflowerPlains; }", "tokens": 49} {"id": 214997, "source": "method", "repo": "geysermc/packconverter", "text": "/** The color that will be overlayed when the object is on fire. @return On Fire Color */ public OnFireColor onFireColor() { return this.onFireColor; }", "tokens": 40} {"id": 215423, "source": "method", "repo": "giraud/reasonml-idea-plugin", "text": "public String getPath() { PsiOpenStub stub = getGreenStub(); if (stub != null) { String openPath = stub.getOpenPath(); return openPath == null ? \"\" : openPath; } PsiElement firstModule = ORUtil.findImmediateFirstChildOfType(this, myTypes.A_MODULE_NAME); RPsiFunctorCall functorCall = ORUtil.findImmediateFirstChildOfClass(this, RPsiFunctorCall.class); if (functorCall != null) { String path = \"\"; if (firstModule != null) { path = ORUtil.getTextUntilTokenType(firstModule, (IElementType) myTypes.C_FUNCTOR_CALL); } return path + functorCall.getName(); } // Skip `let` and `open` PsiElement firstChild = getFirstChild(); if (firstChild != null && firstChild.getNode().getElementType() == myTypes.LET) { // `let open` in OCaml firstChild = ORUtil.nextSibling(firstChild); } // Skip force open PsiElement child = PsiTreeUtil.skipWhitespacesForward(firstChild); if (child != null && child.getNode().getElementType() == myTypes.EXCLAMATION_MARK) { child = PsiTreeUtil.skipWhitespacesForward(child); } return child == null ? \"\" : ORUtil.getTextUntilTokenType(child, null); }", "tokens": 279} {"id": 215528, "source": "method", "repo": "giraud/reasonml-idea-plugin", "text": "public static PsiElement createElement(@NotNull ASTNode node) { IElementType type = node.getElementType(); if (type == OclLexTypes.INSTANCE.C_LET) { return new RPsiLexLet(node); } if (type == OclLexTypes.INSTANCE.C_RULE) { return new RPsiLexRule(node); } if (type == OclLexTypes.INSTANCE.C_PATTERN) { return new RPsiLexPattern(node); } if (type == OclLexTypes.INSTANCE.C_INJECTION) { return new RPsiOCamlInjection(node); } return new ASTWrapperPsiElement(node); }", "tokens": 132} {"id": 215845, "source": "method", "repo": "giraud/reasonml-idea-plugin", "text": "public void test_module_alias_body() { PsiFile file = parseCode(\"module M = struct module O = B.Option let _ = O.m end\"); assertEquals(1, expressions(file).size()); RPsiInnerModule e = first(moduleExpressions(file)); assertEquals(\"M\", e.getName()); Collection expressions = PsiTreeUtil.findChildrenOfType(e.getBody(), RPsiQualifiedPathElement.class); assertSize(2, expressions); }", "tokens": 101} {"id": 215854, "source": "method", "repo": "giraud/reasonml-idea-plugin", "text": "public void test_trimming() { RPsiLet let = firstOfType( parseCode(\"let statelessComponent:\\n string ->\\n componentSpec(\\n stateless,\\n stateless,\\n noRetainedProps,\\n noRetainedProps,\\n actionless,\\n )\\n\"), RPsiLet.class); RPsiSignature signature = let.getSignature(); assertEquals(\"string -> componentSpec(stateless, stateless, noRetainedProps, noRetainedProps, actionless)\", signature.asText(getLangProps())); }", "tokens": 110} {"id": 215889, "source": "method", "repo": "giraud/reasonml-idea-plugin", "text": "public void test_if_else_noBrace() { PsiFile psiFile = parseCode(\"let test = x => if (x) 1 else 2;\"); RPsiIfStatement e = firstOfType(psiFile, RPsiIfStatement.class); assertNotNull(e); assertNotNull(e.getCondition()); assertEquals(\"1\", e.getThenExpression().getText()); assertEquals(\"2\", e.getElseExpression().getText()); }", "tokens": 88} {"id": 215948, "source": "method", "repo": "giraud/reasonml-idea-plugin", "text": "public void test_parameters_named_symbols3() { RPsiLet e = firstOfType(parseCode(\"let fn = (~a:t, ~b=2, ~c) => ();\"), RPsiLet.class); assertNoParserError(e); RPsiFunction function = (RPsiFunction) e.getBinding().getFirstChild(); assertSize(3, function.getParameters()); }", "tokens": 77} {"id": 215971, "source": "method", "repo": "giraud/reasonml-idea-plugin", "text": "public void test_GH_436() { RPsiMacro e = firstOfType(parseCode(\"\"\" module GetOperatorBasesQuery = %graphql(` query SchedGetOperatorBases { operatorBases { baseNid name utcOffset } } `) let x = 1 \"\"\"), RPsiMacro.class); assertEquals(\"%graphql\", e.getName()); assertEquals(\"`\\n query SchedGetOperatorBases {\\n operatorBases {\\n baseNid\\n name\\n utcOffset\\n }\\n }\\n`\", e.getContent().getText()); assertEquals(new TextRange(1, e.getContent().getTextLength() - 1), e.getContent().getMacroTextRange()); // exclude ` }", "tokens": 154} {"id": 216022, "source": "method", "repo": "gitflow-incremental-builder/gitflow-incremental-builder", "text": "public List getDownstreamProjects( MavenProject project, boolean transitive ) { Objects.requireNonNull( project, \"project cannot be null\" ); Set projectIds = new HashSet<>(); getDownstreamProjects( ProjectSorter.getId( project ), projectIds, transitive ); return getSortedProjects( projectIds ); }", "tokens": 70} {"id": 216201, "source": "method", "repo": "gitflow-incremental-builder/gitflow-incremental-builder", "text": "public void firstBeforeSecond() { MavenProject first = projWithAid(\"first\"); MavenProject second = projWithAid(\"second\"); when(mavenSessionMock.getProjects()).thenReturn(Arrays.asList(first, second)); assertThat(underTest.compare(first, second)).isEqualTo(-1); }", "tokens": 62} {"id": 216211, "source": "method", "repo": "gitflow-incremental-builder/gitflow-incremental-builder", "text": "public void defaultlyNoHelp() throws MavenExecutionException { underTest.afterProjectsRead(mavenSessionMock); verifyHelpLogged(false); }", "tokens": 28} {"id": 216235, "source": "method", "repo": "gitflow-incremental-builder/gitflow-incremental-builder", "text": "void collectModulesOf_outOfTree() { MavenProject parent = mockModule(\"parent\", \"../other\"); MavenProject other = mockModule(\"other\", \"nested\"); MavenProject nested = mockModule(\"other/nested\"); assertThat(Modules.collectModulesOf(parent, Arrays.asList(parent, other, nested))) .containsExactlyInAnyOrder(other, nested); }", "tokens": 76} {"id": 216258, "source": "method", "repo": "gitflow-incremental-builder/gitflow-incremental-builder", "text": "private Dependency buildBOMDependency(MavenProject bomModuleMock) { return buildBOMDependency(bomModuleMock, bomModuleMock.getVersion()); }", "tokens": 26} {"id": 216352, "source": "method", "repo": "gitflow-incremental-builder/gitflow-incremental-builder", "text": "public void singleChanged_forceBuildModules_twoWildcards() { MavenProject changedModuleMock = addModuleMock(AID_MODULE_B, true); MavenProject unchangedModuleMock = addModuleMock(\"module-C\", false); addGibProperty(Property.forceBuildModules, AID_MODULE_A + \".*,.*-C\"); underTest.act(config()); verify(mavenSessionMock).setProjects( Arrays.asList(moduleA, changedModuleMock, unchangedModuleMock)); }", "tokens": 96} {"id": 216357, "source": "method", "repo": "gitflow-incremental-builder/gitflow-incremental-builder", "text": "public void singleChanged_excludeDownstreamModulesPackagedAs_oneTransitive_buildAll() { MavenProject changedProjectMock = addModuleMock(AID_MODULE_B, true); MavenProject dependentWar = addModuleMock(AID_MODULE_B_DEP_WAR, false, \"war\"); setDownstreamProjectsNonTransitive(changedProjectMock, dependentWar); addGibProperty(Property.excludeDownstreamModulesPackagedAs, \"war\"); addGibProperty(Property.buildAll, \"true\"); underTest.act(config()); verify(mavenSessionMock, never()) .setProjects(anyList()); }", "tokens": 121} {"id": 216459, "source": "method", "repo": "gitflow-incremental-builder/gitflow-incremental-builder", "text": "public void buildNoChanged() throws Exception { checkout(Branch.DEVELOP); final String output = executeBuild(prop(Property.baseBranch, \"refs/heads/develop\")); assertThat(output).contains(\"Executing validate goal on current project only\") .contains(\"Building parent\") .doesNotContain(\"Building child1\") .doesNotContain(\"Building child2\") .doesNotContain(\"Building subchild1\") .doesNotContain(\"Building subchild42\") .doesNotContain(\"Building subchild2\") .doesNotContain(\"Building child3\") .doesNotContain(\"Building child4\") .doesNotContain(\"Building subchild41\") .doesNotContain(\"Building child6\"); }", "tokens": 140} {"id": 216477, "source": "method", "repo": "gitflow-incremental-builder/gitflow-incremental-builder", "text": "protected static String prop(Property property, String value) { String propString = \"-D\" + property.prefixedName(); if (value != null && !value.isEmpty()) { propString += \"=\" + value; } return propString; }", "tokens": 52} {"id": 216518, "source": "method", "repo": "gitflow-incremental-builder/gitflow-incremental-builder", "text": "public void listWithUncommitted_excluded() throws Exception { Path modifiedFilePath = modifyTrackedFile(repoPath); projectProperties.setProperty(Property.uncommitted.prefixedName(), \"true\"); projectProperties.setProperty(Property.excludePathsMatching.prefixedName(), Pattern.quote(repoPath.relativize(modifiedFilePath).toString())); assertThat(invokeUnderTest().contains(modifiedFilePath)).isFalse(); }", "tokens": 77} {"id": 216928, "source": "method", "repo": "GitHubSecurityLab/CodeQL-Community-Packs", "text": "public final String checksumCRC32(){ return null; }", "tokens": 13} {"id": 217347, "source": "method", "repo": "gitlab4j/gitlab4j-api", "text": "/** Used to set the host URL to be used by OAUTH2 login in GitLabApi. */ void setHostUrlToBaseUrl() { this.hostUrl = this.baseUrl; }", "tokens": 38} {"id": 217413, "source": "method", "repo": "gitlab4j/gitlab4j-api", "text": "/** Take ownership of a pipeline trigger for project.

PUT /projects/:id/triggers/:trigger_id/take_ownership
@param projectIdOrPath projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required @param triggerId the trigger ID to take opwnership of @return the updated Trigger instance @throws GitLabApiException if any exception occurs */ public Trigger takeOwnewrshipOfPipelineTrigger(Object projectIdOrPath, Long triggerId) throws GitLabApiException { Response response = put( Response.Status.OK, null, \"projects\", getProjectIdOrPath(projectIdOrPath), \"triggers\", triggerId, \"take_ownership\"); return (response.readEntity(Trigger.class)); }", "tokens": 159} {"id": 217444, "source": "method", "repo": "gitlab4j/gitlab4j-api", "text": "/** Rotates the given project access token. The token is revoked and a new one which will expire in one week is created to replace it. Only working with GitLab 16.0 and above. @param projectIdOrPath the project in the form of a Long(ID), String(path), or Project instance @param tokenId the id @return the newly created ProjectAccessToken. @throws GitLabApiException if any exception occurs */ public ProjectAccessToken rotateProjectAccessToken(Object projectIdOrPath, Long tokenId) throws GitLabApiException { return rotateProjectAccessToken(projectIdOrPath, tokenId, null); }", "tokens": 117} {"id": 217539, "source": "method", "repo": "gitlab4j/gitlab4j-api", "text": "public void testOwnedProjects() throws GitLabApiException { List projects = gitLabApi.getProjectApi().getOwnedProjects(); assertTrue(projects != null); }", "tokens": 33} {"id": 217690, "source": "method", "repo": "gitlab4j/gitlab4j-api", "text": "public void setState(IterationState state) { this.state = state; }", "tokens": 17} {"id": 217718, "source": "method", "repo": "gitlab4j/gitlab4j-api", "text": "public String getChangesCount() { return changesCount; }", "tokens": 13} {"id": 217832, "source": "method", "repo": "gitlab4j/gitlab4j-api", "text": "public void setShortRevision(String shortRevision) { this.shortRevision = shortRevision; }", "tokens": 21} {"id": 218002, "source": "method", "repo": "gitlab4j/gitlab4j-api", "text": "/** Get a ISO8601 formatted string for the current date and time. @return a ISO8601 formatted string for the current date and time */ public static String getTimestamp() { return (SafeDateFormatter.getDateFormat(PATTERN).format(new Date())); }", "tokens": 60} {"id": 218042, "source": "method", "repo": "gliscowo/isometric-renders", "text": "public static void endRenderableDraw(){ inRenderableDraw = false; }", "tokens": 15} {"id": 218054, "source": "method", "repo": "gliscowo/isometric-renders", "text": "private static int renderNamespace(CommandContext context) { final var namespace = NamespaceArgumentType.getNamespace(\"namespace\", context); RenderTaskArgumentType.getTask(\"task\", context).action.accept(\"namespace_\" + namespace.name(), namespace.getContent()); return 0; }", "tokens": 61} {"id": 218365, "source": "method", "repo": "gluufederation/oxauth", "text": "/** Returns a list of the Authentication Context Class References that this server supports. @return A list of the Authentication Context Class References */ public List getAcrValuesSupported() { return acrValuesSupported; }", "tokens": 47} {"id": 218427, "source": "method", "repo": "gluufederation/oxauth", "text": "public List getPreferredLocales() { return preferredLocales; }", "tokens": 18} {"id": 218544, "source": "method", "repo": "gluufederation/oxauth", "text": "private void validateTokenSuccessfulResponse(TokenResponse tokenResponse) { assertEquals(tokenResponse.getStatus(), 200, \"Unexpected response code: \" + tokenResponse.getStatus()); assertNotNull(tokenResponse.getEntity(), \"The entity is null\"); assertNotNull(tokenResponse.getAccessToken(), \"The access token is null\"); assertNotNull(tokenResponse.getExpiresIn(), \"The expires in value is null\"); assertNotNull(tokenResponse.getTokenType(), \"The token type is null\"); assertNotNull(tokenResponse.getRefreshToken(), \"The refresh token is null\"); }", "tokens": 106} {"id": 218603, "source": "method", "repo": "gluufederation/oxauth", "text": "public void setEndSessionWithAccessToken(Boolean endSessionWithAccessToken) { this.endSessionWithAccessToken = endSessionWithAccessToken; }", "tokens": 29} {"id": 218657, "source": "method", "repo": "gluufederation/oxauth", "text": "public void setHref(String href) { this.href = href; }", "tokens": 17} {"id": 218728, "source": "method", "repo": "gluufederation/oxauth", "text": "/** @param jsonString [{\"CustomHeader1\":\"custom_header_value_1\"},.....,{\"CustomHeaderN\":\"custom_header_value_N\"}] @return */ public static Map jsonObjectArrayStringAsMap(String jsonString) throws JSONException { Map result = new HashMap(); if (!isNullOrEmpty(jsonString)) { JSONArray jsonArray = new JSONArray(jsonString); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); Iterator keysIter = jsonObject.keys(); while (keysIter.hasNext()) { String key = keysIter.next(); String value = jsonObject.getString(key); result.put(key, value); } } } return result; }", "tokens": 171} {"id": 218810, "source": "method", "repo": "gluufederation/oxauth", "text": "public void setIdToken(IdToken idToken) { this.idToken = idToken; }", "tokens": 18} {"id": 218926, "source": "method", "repo": "gluufederation/oxauth", "text": "public SessionId getSessionId(String sessionId, boolean silently) { if (StringHelper.isEmpty(sessionId)) { return null; } try { final SessionId entity = getSessionById(sessionId, silently); log.trace(\"Try to get session by id: {} ...\", sessionId); if (entity != null) { log.trace(\"Session dn: {}\", entity.getDn()); if (isSessionValid(entity)) { return entity; } } } catch (Exception ex) { if (!silently) { log.trace(ex.getMessage()); } } log.trace(\"Failed to get session by id: {}\", sessionId); return null; }", "tokens": 133} {"id": 218943, "source": "method", "repo": "gluufederation/oxauth", "text": "private CustomScriptConfiguration getInternalCustomScriptConfiguration() { CustomScript customScript = new AuthenticationCustomScript() { @Override public AuthenticationScriptUsageType getUsageType() { return AuthenticationScriptUsageType.INTERACTIVE; } }; customScript.setName(OxConstants.SCRIPT_TYPE_INTERNAL_RESERVED_NAME); customScript.setLevel(-1); customScript.setInternal(true); CustomScriptConfiguration customScriptConfiguration = new CustomScriptConfiguration(customScript, internalDefaultPersonAuthenticationType, new HashMap(0)); return customScriptConfiguration; }", "tokens": 118} {"id": 219145, "source": "method", "repo": "gluufederation/oxauth", "text": "public void setOutsideSid(String outsideSid) { this.outsideSid = outsideSid; }", "tokens": 21} {"id": 219300, "source": "method", "repo": "gluufederation/oxtrust", "text": "public void setOrgSupportEmail(String orgSupportEmail) { this.orgSupportEmail = orgSupportEmail; }", "tokens": 25} {"id": 219312, "source": "method", "repo": "gluufederation/oxtrust", "text": "public void setOrgName(String orgName) { this.orgName = orgName; }", "tokens": 21} {"id": 219356, "source": "method", "repo": "gluufederation/oxtrust", "text": "public String getUptime() { return uptime; }", "tokens": 12} {"id": 219380, "source": "method", "repo": "gluufederation/oxtrust", "text": "public int getMaxLogSize() { return maxLogSize; }", "tokens": 14} {"id": 219589, "source": "method", "repo": "gluufederation/oxtrust", "text": "public Map> getCustomScriptsByTypes() { return this.customScriptsByTypes; }", "tokens": 26} {"id": 219674, "source": "method", "repo": "gluufederation/oxtrust", "text": "public void acceptselectedAdditionalAudiences() { if (StringHelper.isEmpty(this.availableAdditionalAudience)) { return; } if (!this.additionalAudienceList.contains(this.availableAdditionalAudience)) { this.additionalAudienceList.add(this.availableAdditionalAudience); } this.availableAdditionalAudience = \"\"; }", "tokens": 67} {"id": 219695, "source": "method", "repo": "gluufederation/oxtrust", "text": "public void generatePassword() throws EncryptionException { String characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"; String pwd = RandomStringUtils.random(40, characters); this.client.setOxAuthClientSecret(pwd); this.client.setEncodedClientSecret(encryptionService.encrypt(pwd)); }", "tokens": 83} {"id": 219801, "source": "method", "repo": "gluufederation/oxtrust", "text": "public void setKeepExternalPerson(boolean keepExternalPerson) { this.keepExternalPerson = keepExternalPerson; }", "tokens": 25} {"id": 219875, "source": "method", "repo": "gluufederation/oxtrust", "text": "private String getLocalComponents() { String command = \"python /opt/gluu/bin/show_version.py --json\"; Process p; StringBuilder builder = new StringBuilder(); try { p = Runtime.getRuntime().exec(command); BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream())); String line = \"\"; while ((line = reader.readLine()) != null) { builder.append(line + \"\\n\"); } } catch (IOException e) { log.error(\"Error running python command \", e); } return builder.toString(); }", "tokens": 116} {"id": 219912, "source": "method", "repo": "gluufederation/oxtrust", "text": "public String getAsString(FacesContext arg0, UIComponent arg1, Object federation) { if (federation == null) { return null; } return ((GluuSAMLFederationProposal) federation).getDisplayName(); }", "tokens": 46} {"id": 219938, "source": "method", "repo": "gluufederation/oxtrust", "text": "public String getUserUid() { return userUid; }", "tokens": 12} {"id": 220049, "source": "method", "repo": "gmu-swe/phosphor", "text": "PhosphorOptionBuilder group(PhosphorOptionGroup group) { this.group = group; return this; }", "tokens": 25} {"id": 220109, "source": "method", "repo": "gmu-swe/phosphor", "text": "public int hashCode() { return branchID; }", "tokens": 11} {"id": 220169, "source": "method", "repo": "gmu-swe/phosphor", "text": "protected void getTaintFieldOfBoxedType(String owner) { super.visitFieldInsn(GETFIELD, owner, \"taint\", Configuration.TAINT_TAG_DESC); }", "tokens": 38} {"id": 220220, "source": "method", "repo": "gmu-swe/phosphor", "text": "public static Object get(Object obj, int idx, PhosphorStackFrame stackFrame) { if (obj instanceof TaggedBooleanArray) { fillInTaint(stackFrame, (TaggedArray) obj, idx); return ((TaggedBooleanArray) obj).val[idx]; } else if (obj instanceof TaggedByteArray) { fillInTaint(stackFrame, (TaggedArray) obj, idx); return ((TaggedBooleanArray) obj).val[idx]; } else if (obj instanceof TaggedCharArray) { fillInTaint(stackFrame, (TaggedArray) obj, idx); return ((TaggedCharArray) obj).val[idx]; } else if (obj instanceof TaggedDoubleArray) { fillInTaint(stackFrame, (TaggedArray) obj, idx); return ((TaggedDoubleArray) obj).val[idx]; } else if (obj instanceof TaggedFloatArray) { fillInTaint(stackFrame, (TaggedArray) obj, idx); return ((TaggedFloatArray) obj).val[idx]; } else if (obj instanceof TaggedIntArray) { fillInTaint(stackFrame, (TaggedArray) obj, idx); return ((TaggedIntArray) obj).val[idx]; } else if (obj instanceof TaggedLongArray) { fillInTaint(stackFrame, (TaggedArray) obj, idx); return ((TaggedLongArray) obj).val[idx]; } else if (obj instanceof TaggedShortArray) { fillInTaint(stackFrame, (TaggedArray) obj, idx); return ((TaggedShortArray) obj).val[idx]; } else if (obj instanceof TaggedReferenceArray) { fillInTaint(stackFrame, (TaggedArray) obj, idx); return ((TaggedReferenceArray) obj).val[idx]; } stackFrame.returnTaint = Taint.emptyTaint(); return Array.get(obj, idx); }", "tokens": 388} {"id": 220244, "source": "method", "repo": "gmu-swe/phosphor", "text": "public static TaggedReferenceArray MULTIANEWARRAY_REFERENCE_2DIMS(int dim1, int dim2, Class component, PhosphorStackFrame phosphorStackFrame) { Taint t1 = phosphorStackFrame.getArgTaint(0); Taint t2 = phosphorStackFrame.getArgTaint(1); TaggedReferenceArray ret = new TaggedReferenceArray(t1, new TaggedReferenceArray[dim1]); for (int i = 0; i < dim1; i++) { ret.val[i] = new TaggedReferenceArray(t2, (Object[]) InstrumentedJREMethodHelper.java_lang_reflect_Array_newArray(component, dim2)); } return ret; }", "tokens": 147} {"id": 220428, "source": "method", "repo": "gmu-swe/phosphor", "text": "public Node getFirst() { return first.next; }", "tokens": 16} {"id": 220467, "source": "method", "repo": "gmu-swe/phosphor", "text": "public int size() { expungeStaleEntries(); return map.size(); }", "tokens": 18} {"id": 220529, "source": "method", "repo": "gmu-swe/phosphor", "text": "public boolean contains(Object object) { return element == null ? object == null : element.equals(object); }", "tokens": 25} {"id": 220728, "source": "method", "repo": "gmu-swe/phosphor", "text": "/** Appends the string representation of the specified {@code char[]}. The {@code char[]} is converted to a string according to the rule defined by {@link String#valueOf(char[])}. @param ch the {@code char[]} to append.. @return this builder. @see String#valueOf(char[]) */ public StringBuilder append(char[] ch) { append0(ch); return this; }", "tokens": 86} {"id": 220788, "source": "method", "repo": "gmu-swe/phosphor", "text": "public void checkForError() { if (Phosphor.INSTRUMENTATION_EXCEPTION_OCCURRED) { Assert.fail(\"Instrumentation error occurred\"); } }", "tokens": 35} {"id": 220823, "source": "method", "repo": "gmu-swe/phosphor", "text": "public void testArrayLengthTainted2DPrimArray() throws Exception { int i = MultiTainter.taintedInt(5, \"foo\"); Taint t = MultiTainter.getTaint(i); int[][] ar = new int[i][i]; Taint r = MultiTainter.getTaint(ar.length); assertEquals(t, r); r = MultiTainter.getTaint(ar[0].length); assertEquals(t, r); }", "tokens": 94} {"id": 220992, "source": "method", "repo": "gnembon/fabric-carpet", "text": "private Component makeSetRuleButton(CarpetRule rule, String option, boolean brackets) { String style = RuleHelper.isInDefaultValue(rule)?\"g\":(option.equalsIgnoreCase(RuleHelper.toRuleString(rule.defaultValue()))?\"e\":\"y\"); if (option.equalsIgnoreCase(RuleHelper.toRuleString(rule.value()))) { style = style + \"u\"; if (option.equalsIgnoreCase(RuleHelper.toRuleString(rule.defaultValue()))) style = style + \"b\"; } String component = style + (brackets ? \" [\" : \" \") + option + (brackets ? \"]\" : \"\"); if (option.equalsIgnoreCase(RuleHelper.toRuleString(rule.value()))) return Messenger.c(component); return Messenger.c(component, \"^g \"+ tr(TranslationKeys.SWITCH_TO).formatted(option + (option.equals(RuleHelper.toRuleString(rule.defaultValue()))?\" (default)\":\"\")), \"?/\"+identifier+\" \" + rule.name() + \" \" + option); }", "tokens": 226} {"id": 221369, "source": "method", "repo": "gnembon/fabric-carpet", "text": "protected Value getConstantFor(String surface) { return constants.get(surface); }", "tokens": 19} {"id": 221390, "source": "method", "repo": "gnembon/fabric-carpet", "text": "/** @return required argument eval type in case its evaluated statically without context but with a given context type */ default Context.Type staticType(Context.Type outerType) { return transitive() ? outerType : Context.NONE; }", "tokens": 49} {"id": 221497, "source": "method", "repo": "gnembon/fabric-carpet", "text": "public boolean appendToTextFile(Module module, List message) { try { synchronized (writeIOSync) { Path dataFile = toPath(module); if (dataFile == null) { return false; } createPaths(dataFile); OutputStream out = Files.newOutputStream(dataFile, StandardOpenOption.APPEND, StandardOpenOption.CREATE); try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8))) { for (String line : message) { writer.append(line); if (type == Type.TEXT) { writer.newLine(); } } } } } catch (IOException e) { CarpetScriptServer.LOG.warn(\"IOException when appending to text file\", e); throw new ThrowStatement(\"Error when writing to the file: \" + e, Throwables.IO_EXCEPTION); } finally { close(); } return true; }", "tokens": 187} {"id": 221539, "source": "method", "repo": "gnembon/fabric-carpet", "text": "protected Supplier factory(MinecraftServer server) { return argumentTypeSupplier != null ? () -> new VanillaUnconfigurableArgument(getTypeSuffix(), argumentTypeSupplier, valueExtractor, providesExamples) : () -> new VanillaUnconfigurableArgument(getTypeSuffix(), argumentTypeSupplierEx, valueExtractor, providesExamples, server); }", "tokens": 69} {"id": 221546, "source": "method", "repo": "gnembon/fabric-carpet", "text": "public ContinueStatement(@Nullable Value value) { super(value); }", "tokens": 16} {"id": 221573, "source": "method", "repo": "gnembon/fabric-carpet", "text": "public static void Mob_setPersistence(Mob mob, boolean what) { ((MobEntityInterface) mob).setPersistence(what); }", "tokens": 31} {"id": 221602, "source": "method", "repo": "gnembon/fabric-carpet", "text": "public static void resetCache() { particleCache.clear(); }", "tokens": 14} {"id": 221608, "source": "method", "repo": "gnembon/fabric-carpet", "text": "public int getGradient(int hash) { return this.permutations[hash & 255] & 255; }", "tokens": 30} {"id": 221622, "source": "method", "repo": "gnembon/fabric-carpet", "text": "protected Set requiredParams() { return Sets.union(Sets.union(super.requiredParams(), required), Set.of(isitem ? \"item\" : \"block\")); }", "tokens": 41} {"id": 221657, "source": "method", "repo": "gnembon/fabric-carpet", "text": "private static boolean isStraight(Vec3 from, Vec3 to, double density) { if ((from.x == to.x && from.y == to.y) || (from.x == to.x && from.z == to.z) || (from.y == to.y && from.z == to.z)) { return from.distanceTo(to) / density > 20; } return false; }", "tokens": 94} {"id": 221931, "source": "method", "repo": "gnmyt/MCDash", "text": "/** Check if the controller has been initialized. */ public static boolean isInitialized() { return instance != null; }", "tokens": 24} {"id": 222136, "source": "method", "repo": "gnmyt/MCDash", "text": "private String getGameVersion() { ServerInfoPipe infoPipe = getPipe(ServerInfoPipe.class); if (infoPipe == null) return null; String fullVersion = infoPipe.getServerVersion(); if (fullVersion == null) return null; return normalizeGameVersion(fullVersion); }", "tokens": 62} {"id": 222519, "source": "method", "repo": "gnmyt/MCDash", "text": "public ArrayList getBannedPlayers() { return new ArrayList<>(BanCompat.listBans()); }", "tokens": 24} {"id": 222635, "source": "method", "repo": "gnmyt/MCDash", "text": "/** Gets the max players from server.properties */ public int getMaxPlayers() { String maxPlayers = PropertyHelper.getProperty(\"max-players\"); if (maxPlayers != null) { try { return Integer.parseInt(maxPlayers); } catch (NumberFormatException ignored) { } } return 20; }", "tokens": 64} {"id": 222707, "source": "method", "repo": "gnmyt/VoxelDash", "text": "private static float floatOf(CompoundTag tag, String key, float fallback) { Tag t = tag.get(key); if (t instanceof NumberTag) { return ((NumberTag) t).asFloat(); } return fallback; }", "tokens": 52} {"id": 222854, "source": "method", "repo": "gnmyt/VoxelDash", "text": "public ProfilingPipeImpl() { captureServerThread(); }", "tokens": 13} {"id": 222873, "source": "method", "repo": "gnmyt/VoxelDash", "text": "public void setTime(String worldId, long ticks) { runOnMainThread(() -> { WorldServer level = findLevel(worldId); if (level != null) level.setWorldTime(ticks); }); }", "tokens": 47} {"id": 223087, "source": "method", "repo": "godot-sdk-integrations/godot-admob", "text": "void load() { activity.runOnUiThread(() -> { InterstitialAd.load(activity, loadRequest.getAdUnitId(), loadRequest.createAdRequest(), new InterstitialAdLoadCallback() { @Override public void onAdLoaded(@NonNull InterstitialAd interstitialAd) { super.onAdLoaded(interstitialAd); setAd(interstitialAd); if (firstLoad) { Log.i(LOG_TAG, \"interstitial ad loaded\"); firstLoad = false; listener.onInterstitialLoaded(Interstitial.this.adInfo, interstitialAd.getResponseInfo()); } else { Log.i(LOG_TAG, \"interstitial ad refreshed\"); listener.onInterstitialReloaded(Interstitial.this.adInfo, interstitialAd.getResponseInfo()); } } @Override public void onAdFailedToLoad(@NonNull LoadAdError loadAdError) { super.onAdFailedToLoad(loadAdError); setAd(null); // safety Log.e(LOG_TAG, \"interstitial ad failed to load - error code: \" + loadAdError.getCode()); listener.onInterstitialFailedToLoad(Interstitial.this.adInfo, loadAdError); } }); }); }", "tokens": 247} {"id": 223197, "source": "method", "repo": "godot-sdk-integrations/godot-admob", "text": "public Dictionary buildRawData() { Dictionary dict = super.buildRawData(); ResponseInfo responseInfo = loadAdError.getResponseInfo(); dict.put(RESPONSE_INFO_PROPERTY, responseInfo == null ? new Dictionary() : new AdmobResponse(responseInfo).buildRawData()); return dict; }", "tokens": 61} {"id": 223369, "source": "method", "repo": "godot-sdk-integrations/godot-admob", "text": "void createRequestConfiguration_nonReal_limitAdTrackingEnabled_excludesAdId() { try ( MockedStatic mobileAdsMock = openMobileAdsMock(); MockedStatic secureMock = mockStatic(Settings.Secure.class); MockedStatic adIdMock = mockStatic(AdvertisingIdClient.class) ) { secureMock.when(() -> Settings.Secure.getString(any(), any())) .thenReturn(\"mock_id\"); AdvertisingIdClient.Info adInfo = mock(AdvertisingIdClient.Info.class); when(adInfo.isLimitAdTrackingEnabled()).thenReturn(true); // opted out adIdMock.when(() -> AdvertisingIdClient.getAdvertisingIdInfo(any())) .thenReturn(adInfo); new AdmobConfiguration(ConfigFixtures.minimalConfig(false)) .createRequestConfiguration(activity); @SuppressWarnings(\"unchecked\") ArgumentCaptor> captor = ArgumentCaptor.forClass((Class) List.class); verify(configBuilder).setTestDeviceIds(captor.capture()); // advertising-id is NOT in the list when tracking is limited assert !captor.getValue().contains(null); // emulator and hashed device ID still present assert captor.getValue().contains(AdRequest.DEVICE_ID_EMULATOR); } }", "tokens": 281} {"id": 223423, "source": "method", "repo": "godot-sdk-integrations/godot-admob", "text": "void createAdRequest_collapsibleTop_putsTopValueInBundle() { try ( MockedConstruction builderMock = openBuilderMock(); MockedConstruction bundleMock = mockConstruction(Bundle.class) ) { new LoadAdRequest(AdRequestFixtures.collapsibleBannerRequest(\"TOP\")) .createAdRequest(); verify(bundleMock.constructed().get(0)).putString(\"collapsible\", \"TOP\"); } }", "tokens": 90} {"id": 223505, "source": "method", "repo": "godot-sdk-integrations/godot-admob", "text": "public void isNativeValidatorDisabled_whenAbsent_returnsFalse() { LoadAdRequest request = new LoadAdRequest(AdRequestFixtures.minimalNativeRequest()); assertFalse(request.isNativeValidatorDisabled()); }", "tokens": 37} {"id": 223519, "source": "method", "repo": "gosimplellc/nbvcxz", "text": "/** Calculates the minimum entropy for a given password and returns that as a Result.

This method attempts to find the minimum entropy at each position of the password, and then does a backwards pass to remove overlapping matches. The end result is a list of matches that when their tokens are added up, should equal the original password.

The result object is guaranteed to match the original password, or throw an exception if it doesn't. @param configuration the configuration file used to estimate entropy. @param password the password you are guessing entropy for. @return the {@code Result} of this estimate. */ private Result guessEntropy(final Configuration configuration, final String password) { final String truncated_password = getTruncatedPassword(configuration, password); return new Result(configuration, truncated_password, password, getBestCombination(configuration, truncated_password)); }", "tokens": 191} {"id": 223577, "source": "method", "repo": "gosimplellc/nbvcxz", "text": "public String getDetails() { ResourceBundle mainResource = configuration.getMainResource(); StringBuilder detailBuilder = new StringBuilder(); detailBuilder.append(super.getDetails()); detailBuilder.append(\"\\n\"); detailBuilder.append(mainResource.getString(\"main.match.dictionary\")).append(\" \").append(getDictionaryName()); detailBuilder.append(\"\\n\"); detailBuilder.append(mainResource.getString(\"main.match.dictionaryValue\")).append(\" \").append(getDictionaryValue()); detailBuilder.append(\"\\n\"); detailBuilder.append(mainResource.getString(\"main.match.rank\")).append(\" \").append(getRank()); detailBuilder.append(\"\\n\"); detailBuilder.append(mainResource.getString(\"main.match.length\")).append(\" \").append(getLength()); detailBuilder.append(\"\\n\"); detailBuilder.append(mainResource.getString(\"main.match.leetSub\")).append(\" \").append(isLeet()); detailBuilder.append(\"\\n\"); detailBuilder.append(mainResource.getString(\"main.match.reversed\")).append(\" \").append(isReversed()); detailBuilder.append(\"\\n\"); detailBuilder.append(mainResource.getString(\"main.match.distance\")).append(\" \").append(getDistance()); return detailBuilder.toString(); }", "tokens": 269} {"id": 223710, "source": "method", "repo": "gosimplellc/nbvcxz", "text": "private int calcHash(List matches) { int calculatedHash = 0; for (Match match_i : matches) { DictionaryMatch match = DictionaryMatch.class.cast(match_i); calculatedHash += match.getToken().hashCode(); calculatedHash += match.getDictionaryName().hashCode(); calculatedHash += match.getDictionaryValue().hashCode(); calculatedHash += match.getRank(); calculatedHash += match.getStartIndex(); calculatedHash += match.getEndIndex(); for (Character[] chars : match.getLeetSubstitution()) { for (Character leet : chars) { calculatedHash += leet.hashCode(); } } } return calculatedHash; }", "tokens": 140} {"id": 223943, "source": "method", "repo": "gradusnikov/eclipse-chatgpt-plugin", "text": "/** Coverage was asked for and the tooling to produce it is missing. */ public static CoverageResult unavailable() { return new CoverageResult( true, false, null, null ); }", "tokens": 39} {"id": 223956, "source": "method", "repo": "gradusnikov/eclipse-chatgpt-plugin", "text": "public EditResult applyPatch( @ToolParam(name=\"projectName\", description=\"The name of the project containing the file\", required=true) String projectName, @ToolParam(name=\"filePath\", description=\"The path to the file relative to the project root. Do not include project name!\", required=true) String filePath, @ToolParam(name=\"patch\", description=\"The unified diff content to apply. Should contain @@ hunk headers and lines prefixed with ' ' (context), '-' (remove), or '+' (add). File headers (--- and +++) are optional.\", required=true) String patch, @ToolParam(name=\"showDialog\", description=\"If 'true', shows Eclipse's Apply Patch wizard dialog for user review instead of applying directly, and the result is a PREVIEW. Default is 'false'.\", required=false) String showDialog, @ToolParam(name=\"expectedModificationStamp\", description=\"The modificationStamp reported by an earlier read or edit of this file. \" + \"When supplied, the patch is rejected with VERSION_CONFLICT if the file has changed since.\", required=false) String expectedModificationStamp, @ToolParam(name=\"preview\", description=\"If 'true', report what the patch would change without modifying the file. Default: false\", required=false) String preview) { return codeEditingService.applyPatch(projectName, filePath, patch, parseBoolean(showDialog), parseModificationStamp(expectedModificationStamp), parseBoolean(preview)); }", "tokens": 306} {"id": 224083, "source": "method", "repo": "gradusnikov/eclipse-chatgpt-plugin", "text": "/** Launches a Java application in run mode. @param projectName The name of the project containing the main class @param mainClass The fully qualified name of the main class @param programArgs Optional program arguments @param vmArgs Optional VM arguments @param timeout Timeout in seconds to wait for the process to finish (0 = don't wait) */ public LaunchResponse runJavaApplication(String projectName, String mainClass, String programArgs, String vmArgs, int timeout) { return launchJavaApplication(projectName, mainClass, programArgs, vmArgs, ILaunchManager.RUN_MODE, timeout); }", "tokens": 125} {"id": 224093, "source": "method", "repo": "gradusnikov/eclipse-chatgpt-plugin", "text": "/** Issues the request. Called with the suspend listener already registered. */ private void perform( ILaunch launch, IThread thread, StepResponse.Kind kind, boolean wholeSession ) throws DebugException { switch ( kind ) { case STEP_OVER -> thread.stepOver(); case STEP_INTO -> thread.stepInto(); case STEP_RETURN -> thread.stepReturn(); case RESUME -> { if ( wholeSession ) { for ( IDebugTarget target : launch.getDebugTargets() ) { target.resume(); } } else { thread.resume(); } } } }", "tokens": 128} {"id": 224118, "source": "method", "repo": "gradusnikov/eclipse-chatgpt-plugin", "text": "/** Runs selected JUnit Plug-in Test classes in a single PDE launch. */ public TestRunResponse runJUnitPluginTestClasses( String projectName, List classNames, Integer timeout ) { return runJUnitPluginTestClasses( projectName, classNames, timeout, false, List.of() ); }", "tokens": 67} {"id": 224137, "source": "method", "repo": "gradusnikov/eclipse-chatgpt-plugin", "text": "private ASTNode nodeOf( IMember member ) throws JavaModelException { IType declaring = member instanceof IType t ? t : member.getDeclaringType(); if ( declaring == null ) { return null; } List names = new ArrayList<>(); for ( IType t = declaring; t != null; t = t.getDeclaringType() ) { if ( t.getElementName().isEmpty() ) { return null; // anonymous: nothing to match a name against } names.add( 0, t.getElementName() ); } @SuppressWarnings( \"unchecked\" ) AbstractTypeDeclaration typeNode = findType( ast().types(), names, 0 ); if ( member instanceof IType || typeNode == null ) { return typeNode; } if ( member instanceof IMethod method ) { return findMethod( typeNode, method ); } if ( member instanceof IField field ) { return findField( typeNode, field ); } return null; }", "tokens": 208} {"id": 224234, "source": "method", "repo": "gradusnikov/eclipse-chatgpt-plugin", "text": "public String resetToDefault( int selectedIndex ) { var propertyName = getPreferenceName( selectedIndex ); var defaultValue = getPreferenceStore().getDefaultString( propertyName ); getPreferenceStore().setValue( propertyName, defaultValue ); return defaultValue; }", "tokens": 49} {"id": 224441, "source": "method", "repo": "gradusnikov/eclipse-chatgpt-plugin", "text": "public void activeLaunchesAdvertiseWhatIdentifiesARunningProgram() { Map launch = propertiesOf( itemsOf( properties( ActiveLaunchesResponse.class ), \"launches\" ) ); assertTrue( launch.containsKey( \"name\" ), launch.keySet().toString() ); assertTrue( launch.containsKey( \"mode\" ) ); assertTrue( launch.containsKey( \"mainType\" ) ); assertTrue( launch.containsKey( \"projectName\" ) ); assertEquals( \"boolean\", jsonType( launch, \"terminated\" ) ); assertEquals( \"integer\", jsonType( launch, \"pid\" ), \"the pid is what a caller reaches for and must not arrive as text\" ); }", "tokens": 158} {"id": 224750, "source": "method", "repo": "granny/Pl3xMap", "text": "public Command.Builder getRoot() { return this.root; }", "tokens": 17} {"id": 224782, "source": "method", "repo": "granny/Pl3xMap", "text": "public void enable() { // load up configs Logger.debug(\"Loading configs\"); Config.reload(); Lang.reload(); ColorsConfig.reload(); PlayersLayerConfig.reload(); SpawnLayerConfig.reload(); WorldBorderLayerConfig.reload(); // initialize block registry getBlockRegistry().init(); // initialize icons getIconRegistry().init(); // load blocks _after_ we loaded colors Logger.debug(\"Registering blocks\"); Blocks.registerDefaults(); loadBlocks(); // create the executor service Logger.debug(\"Creating services\"); this.renderExecutor = ThreadFactory.createService(\"Pl3xMap-Renderer\", Config.RENDER_THREADS); // register built in tile image types Logger.debug(\"Registering tile image types\"); IO.register(); // register built-in heightmaps Logger.debug(\"Registering heightmaps\"); getHeightmapRegistry().register(); // register built-in renderers Logger.debug(\"Registering renderers\"); getRendererRegistry().register(); this.enabled = true; new Pl3xMapEnabledEvent().callEvent(); // load up already loaded worlds Logger.debug(\"Registering worlds\"); loadWorlds(); // load up players already connected to the server Logger.debug(\"Registering players\"); loadPlayers(); // start integrated server Logger.debug(\"Starting internal server\"); getHttpdServer().startServer(); // start tasks Logger.debug(\"Starting region processor\"); getRegionProcessor().start(10000L); getRegionDoubleChecker().start(250000L); Logger.debug(\"Starting update settings data task\"); getScheduler().addTask(new UpdateSettingsData()); Logger.info(\"Platform: \" + getPlatform()); Logger.info(\"Version: \" + getVersion()); try { this.metrics = new Metrics(this); } catch (IOException e) { Logger.severe(\"Failed to generate or load default bStats config\", e); } Pl3xMap.api().getRegionProcessor().setPaused(false); }", "tokens": 401} {"id": 224809, "source": "method", "repo": "granny/Pl3xMap", "text": "private void execute(CommandContext context) { Sender sender = context.sender(); RegionProcessor processor = Pl3xMap.api().getRegionProcessor(); if (!processor.isPaused()) { sender.sendMessage(Lang.COMMAND_RESUME_ALREADY_RESUMED); } else { processor.setPaused(false); sender.sendMessage(Lang.COMMAND_RESUME_RESUMED); } }", "tokens": 81} {"id": 224826, "source": "method", "repo": "granny/Pl3xMap", "text": "public ArgumentParseResult parse(CommandContext commandContext, CommandInput commandInput) { String input = commandInput.peekString(); if (input.startsWith(\"\\\"\")) { commandInput.moveCursor(1); input = commandInput.readUntilAndSkip('\"'); } else { input = commandInput.readString(); } if (input == null) { return ArgumentParseResult.failure(new WorldParseException(null, WorldParseException.MUST_SPECIFY_WORLD)); } World world = null; try { world = Pl3xMap.api().getWorldRegistry().get(input); } catch (Throwable ignore) { } if (world == null) { return ArgumentParseResult.failure(new WorldParseException(input, WorldParseException.NO_SUCH_WORLD)); } if (!world.isEnabled()) { return ArgumentParseResult.failure(new WorldParseException(input, WorldParseException.MAP_NOT_ENABLED)); } return ArgumentParseResult.success(world); }", "tokens": 191} {"id": 224871, "source": "method", "repo": "granny/Pl3xMap", "text": "public void setPixel(int x, int z, int color) { this.pixels[getIndex(x, z)] = color; this.written = true; }", "tokens": 38} {"id": 224912, "source": "method", "repo": "granny/Pl3xMap", "text": "public boolean containsBlock(int blockX, int blockZ) { return blockX >= getMinX() && blockX <= getMaxX() && blockZ >= getMinZ() && blockZ <= getMaxZ(); }", "tokens": 41} {"id": 224955, "source": "method", "repo": "granny/Pl3xMap", "text": "/** Create a new spawn layer. @param world world */ public SpawnLayer(World world) { super(KEY, world, () -> Lang.UI_LAYER_SPAWN); this.icon = SpawnLayerConfig.ICON; Path icon = FileUtil.getWebDir().resolve(\"images/icon/\" + this.icon + \".png\"); try { IconImage image = new IconImage(this.icon, ImageIO.read(icon.toFile()), \"png\"); Pl3xMap.api().getIconRegistry().register(image); } catch (IOException e) { throw new RuntimeException(e); } setUpdateInterval(SpawnLayerConfig.UPDATE_INTERVAL); setLiveUpdate(SpawnLayerConfig.LIVE_UPDATE); setShowControls(SpawnLayerConfig.SHOW_CONTROLS); setDefaultHidden(SpawnLayerConfig.DEFAULT_HIDDEN); setPriority(SpawnLayerConfig.PRIORITY); setZIndex(SpawnLayerConfig.Z_INDEX); String tooltip = getLabel(); if (!tooltip.isBlank()) { setOptions(Options.builder() .tooltipContent(tooltip) .tooltipDirection(Tooltip.Direction.TOP) .build() ); } }", "tokens": 241} {"id": 224960, "source": "method", "repo": "granny/Pl3xMap", "text": "/** Create a new circle. @param key identifying key @param centerX center x location @param centerZ center z location @param radius circle radius @return a new circle */ public static Circle of(String key, double centerX, double centerZ, double radius) { return new Circle(key, centerX, centerZ, radius); }", "tokens": 68} {"id": 225133, "source": "method", "repo": "granny/Pl3xMap", "text": "/** Get the map pane where the popup will be added.

Defaults to 'popupPane' if null. @return map pane */ public String getPane() { return this.pane; }", "tokens": 45} {"id": 225313, "source": "method", "repo": "granny/Pl3xMap", "text": "public void parse() { List layers = new ArrayList<>(); this.world.getLayerRegistry().entrySet().forEach(entry -> { String key = entry.getKey(); Layer layer = entry.getValue(); try { layers.add(layer.toJson()); long now = System.currentTimeMillis(); long lastUpdated = this.lastUpdated.getOrDefault(key, 0L); if (now - lastUpdated > Math.max(TickUtil.toMilliseconds(layer.getUpdateInterval()), 1000)) { List> list = new ArrayList<>(layer.getMarkers()); FileUtil.writeJson(this.gson.toJson(list), this.world.getMarkersDirectory().resolve(key.replace(\":\", \"-\") + \".json\")); this.lastUpdated.put(key, now); } } catch (Throwable t) { Logger.severe(\"Failed to process layer \" + key + \" for world \" + world.getName(), t); } }); FileUtil.writeJson(this.gson.toJson(layers), this.world.getTilesDirectory().resolve(\"markers.json\")); }", "tokens": 227} {"id": 225334, "source": "method", "repo": "granny/Pl3xMap", "text": "/** Blends one color over another. @param color0 color to blend over with @param color1 color to be blended over @return resulting blended color @see Alpha Blending */ public static int blend(int color0, int color1) { double a0 = (double) alpha(color0) / 0xFF; double a1 = (double) alpha(color1) / 0xFF; double a = a0 + a1 * (1 - a0); double r = (red(color0) * a0 + red(color1) * a1 * (1 - a0)) / a; double g = (green(color0) * a0 + green(color1) * a1 * (1 - a0)) / a; double b = (blue(color0) * a0 + blue(color1) * a1 * (1 - a0)) / a; return argb((int) a * 0xFF, (int) r, (int) g, (int) b); }", "tokens": 255} {"id": 225435, "source": "method", "repo": "granny/Pl3xMap", "text": "public int getLight(int x, int y, int z) { return getWorld().getSkylight(); }", "tokens": 25} {"id": 225547, "source": "method", "repo": "granny/Pl3xMap", "text": "private Set> instances() { return INSTANCES.computeIfAbsent(this.commandManager, $ -> Collections.newSetFromMap(new WeakHashMap<>())); }", "tokens": 37} {"id": 225551, "source": "method", "repo": "granny/Pl3xMap", "text": "/** Get a permission predicate which passes when the integrated server is running. @param sender type @return a predicate permission */ public static @NonNull PredicatePermission integratedServerRunning() { return sender -> Minecraft.getInstance().hasSingleplayerServer(); }", "tokens": 58} {"id": 225669, "source": "method", "repo": "grapheneos/attestationserver", "text": "static JsonWriter createWriter(final OutputStream out) { return writerFactory.createWriter(out); }", "tokens": 21} {"id": 225678, "source": "method", "repo": "grapheneos/attestationserver", "text": "private AttestationApplicationId(byte[] attestationApplicationId) { ASN1Sequence attestationApplicationIdSequence = ASN1Sequence.getInstance(attestationApplicationId); ASN1Set attestationPackageInfos = (ASN1Set) attestationApplicationIdSequence.getObjectAt( ATTESTATION_APPLICATION_ID_PACKAGE_INFOS_INDEX); packageInfos = new ArrayList<>(); for (ASN1Encodable packageInfo : attestationPackageInfos) { packageInfos.add(new AttestationPackageInfo((ASN1Sequence) packageInfo)); } ASN1Set digests = (ASN1Set) attestationApplicationIdSequence.getObjectAt( ATTESTATION_APPLICATION_ID_SIGNATURE_DIGESTS_INDEX); signatureDigests = new ArrayList<>(); for (ASN1Encodable digest : digests) { signatureDigests.add(((ASN1OctetString) digest).getOctets()); } }", "tokens": 187} {"id": 225725, "source": "method", "repo": "grapheneos/attestationserver", "text": "public Builder setUsageExpireDateTime(Instant usageExpireDateTime) { this.usageExpireDateTime = usageExpireDateTime; return this; }", "tokens": 28} {"id": 225747, "source": "method", "repo": "grapheneos/attestationserver", "text": "public Builder setAttestationIdImei(byte[] attestationIdImei) { this.attestationIdImei = attestationIdImei; return this; }", "tokens": 33} {"id": 225758, "source": "method", "repo": "grapheneos/attestationserver", "text": "private ParsedAttestationRecord( int attestationVersion, SecurityLevel attestationSecurityLevel, int keymasterVersion, SecurityLevel keymasterSecurityLevel, byte[] attestationChallenge, byte[] uniqueId, AuthorizationList softwareEnforced, AuthorizationList teeEnforced, PublicKey attestedKey) { this.attestationVersion = attestationVersion; this.attestationSecurityLevel = attestationSecurityLevel; this.keymasterVersion = keymasterVersion; this.keymasterSecurityLevel = keymasterSecurityLevel; this.attestationChallenge = attestationChallenge; this.uniqueId = uniqueId; this.softwareEnforced = softwareEnforced; this.teeEnforced = teeEnforced; this.attestedKey = attestedKey; }", "tokens": 140} {"id": 225789, "source": "method", "repo": "grapheneos/auditor", "text": "public boolean onCreateOptionsMenu(final Menu menu) { getMenuInflater().inflate(R.menu.menu_attestation, menu); menu.findItem(R.id.action_clear_auditee).setEnabled(isSupportedAuditee); menu.findItem(R.id.action_submit_sample).setEnabled(!BuildConfig.DEBUG); return true; }", "tokens": 75} {"id": 225839, "source": "method", "repo": "graphql-java-kickstart/samples", "text": "/** By returning the non-blocking CompletableFuture the system can cancel this GraphQL execution when a timeout occurs. @return non-blocking CompletableFuture that will return the String value */ CompletableFuture getHello() { log.info(\"Executing query\"); return CompletableFuture.supplyAsync( () -> { try { log.info(\"Start Hello query execution\"); Thread.sleep(3000); log.info(\"Execute Hello query after the sleep\"); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } log.info(\"End Hello query execution\"); return \"world\"; }); }", "tokens": 145} {"id": 226132, "source": "method", "repo": "graphql-java/graphql-java", "text": "public GraphQLArgument getGraphQLArgument() { return graphQLArgument; }", "tokens": 15} {"id": 226150, "source": "method", "repo": "graphql-java/graphql-java", "text": "protected BiConsumer, Throwable> handleResults(ExecutionContext executionContext, List fieldNames, CompletableFuture overallResult) { return (List results, Throwable exception) -> { exception = executionContext.possibleCancellation(exception); if (exception != null) { // A cancellation that fired after some fields already completed arrives here as a // synthesised AbortExecutionException with a non-null results list (a real field // failure always has null results). When partial capture is enabled we keep those // results and attach the cancellation error; otherwise we report the error as usual. if (results != null && capturePartialResults(executionContext)) { executionContext.addError((AbortExecutionException) exception); completeResultFuture(overallResult, executionContext, fieldNames, results); return; } handleNonNullException(executionContext, overallResult, exception); return; } completeResultFuture(overallResult, executionContext, fieldNames, results); }; }", "tokens": 206} {"id": 226360, "source": "method", "repo": "graphql-java/graphql-java", "text": "public TraversalControl accept(TraverserContext context, NodeVisitor visitor) { return visitor.visitInputObjectTypeDefinition(this, context); }", "tokens": 29} {"id": 226512, "source": "method", "repo": "graphql-java/graphql-java", "text": "/** This is used to clear all the arguments in the builder so far. @return the builder */ public Builder clearArguments() { arguments.clear(); return this; }", "tokens": 35} {"id": 226771, "source": "method", "repo": "graphql-java/graphql-java", "text": "private void assertNonNullType(GraphQLType type, SchemaValidationErrorCollector errorCollector) { if (type instanceof GraphQLNonNull && ((GraphQLNonNull) type).getWrappedType() instanceof GraphQLNonNull) { SchemaValidationError schemaValidationError = new SchemaValidationError(SchemaValidationErrorType.NonNullWrapNonNullError, String.format(\"Non\u2010Null type must not wrap another Non\u2010Null type: \\\"%s\\\" is invalid.\", GraphQLTypeUtil.simplePrint(type))); errorCollector.addError(schemaValidationError); } }", "tokens": 104} {"id": 227071, "source": "method", "repo": "graphql-java/graphql-java-extended-validation", "text": "/** Returns the length of a String, ID, size of a list or size of a Map @param inputType the input type @param value the value @return the length of a String or Map or List */ protected int getStringOrIDOrObjectOrMapLength(GraphQLInputType inputType, Object value) { int valLen; if (value == null) { valLen = 0; } else if (isStringOrID(inputType)) { valLen = String.valueOf(value).length(); } else if (isList(inputType)) { valLen = getListLength(value); } else { valLen = getObjectLen(value); } return valLen; }", "tokens": 142} {"id": 227213, "source": "method", "repo": "graphql-java/graphql-java-extended-validation", "text": "public TargetedValidationRules(Builder builder) { this.rulesMap = new HashMap<>(builder.rulesMap); }", "tokens": 25} {"id": 227254, "source": "method", "repo": "graphql-java/graphql-java-extended-validation", "text": "public Builder validatedElement(ValidatedElement validatedElement) { this.validatedElement = validatedElement; return this; }", "tokens": 24} {"id": 227268, "source": "method", "repo": "graphql-java/graphql-java-extended-validation", "text": "public List getRulesFor(GraphQLArgument fieldArg, GraphQLFieldDefinition fieldDefinition, GraphQLFieldsContainer fieldsContainer) { return rules.stream() .filter(rule -> rule.appliesTo(fieldArg, fieldDefinition, fieldsContainer)) .collect(Collectors.toList()); }", "tokens": 62} {"id": 227278, "source": "method", "repo": "graphql-java/graphql-java-extended-validation", "text": "public ValidationRules build() { return new ValidationRules(this); }", "tokens": 15} {"id": 227309, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "private void setLogLevel(Options options) { // OFF, ERROR, WARN, INFO, DEBUG, TRACE, ALL if (options.debug.equalsIgnoreCase(\"OFF\")) { LoggerUtil.setLogLevel(LoggerUtil.Level.OFF); } else if (options.debug.equalsIgnoreCase(\"ERROR\")) { LoggerUtil.setLogLevel(LoggerUtil.Level.ERROR); } else if (options.debug.equalsIgnoreCase(\"WARN\")) { LoggerUtil.setLogLevel(LoggerUtil.Level.WARN); } else if (options.debug.equalsIgnoreCase(\"INFO\")) { LoggerUtil.setLogLevel(LoggerUtil.Level.INFO); } else if (options.debug.equalsIgnoreCase(\"DEBUG\")) { LoggerUtil.setLogLevel(LoggerUtil.Level.DEBUG); } else if (options.debug.equalsIgnoreCase(\"TRACE\")) { LoggerUtil.setLogLevel(LoggerUtil.Level.TRACE); } else if (options.debug.equalsIgnoreCase(\"ALL\")) { LoggerUtil.setLogLevel(LoggerUtil.Level.ALL); } else { throw new ParameterException(\"Incorrect argument to --debug\"); } }", "tokens": 225} {"id": 227322, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "/** Simplest model */ public void simplestModel() { String args[] = {\"offline\", \"-m\", \"graphml/CorrectModels/simplestModel.graphml\", \"random(vertex_coverage(100))\"}; Result result = runCommand(args); assertThat(result.getStatus(), is(0)); assertThat(result.getError(), is(\"\")); assertThat(result.getOutput(), is(\"{\\\"currentElementName\\\":\\\"e1\\\"}\" + System.lineSeparator() + \"{\\\"currentElementName\\\":\\\"v1\\\"}\" + System.lineSeparator())); }", "tokens": 112} {"id": 227324, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "/** No start vertex */ public void noStartVertex() { String args[] = {\"offline\", \"-e\", \"v1\", \"-m\", \"graphml/CorrectModels/modelWithNoStartVertex.graphml\", \"a_star(reached_edge(e4))\"}; Result result = runCommand(args); assertThat(result.getStatus(), is(0)); assertThat(result.getError(), is(\"\")); assertThat(result.getOutput(), is(\"{\\\"currentElementName\\\":\\\"v1\\\"}\" + System.lineSeparator() + \"{\\\"currentElementName\\\":\\\"e2\\\"}\" + System.lineSeparator() + \"{\\\"currentElementName\\\":\\\"v2\\\"}\" + System.lineSeparator() + \"{\\\"currentElementName\\\":\\\"e4\\\"}\" + System.lineSeparator())); }", "tokens": 153} {"id": 227419, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "public Context getNextStep() { if (isNull(getContext().getCurrentElement())) { throw new NoPathFoundException(\"Execution context has no current element set\"); } return getContext(); }", "tokens": 37} {"id": 227440, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "private void addRequirements(RuntimeModel model) { requirements.clear(); for (Requirement requirement : model.getRequirements()) { requirements.put(requirement, RequirementStatus.NOT_COVERED); } for (Element element : model.getElements()) { for (Requirement requirement : element.getRequirements()) { requirements.put(requirement, RequirementStatus.NOT_COVERED); } } }", "tokens": 79} {"id": 227508, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "public List getClassifications() { return classifications; }", "tokens": 16} {"id": 227747, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "public void updateBuilder() throws Exception { Vertex vertex1 = new Vertex(); Vertex vertex2 = new Vertex(); Edge edge1 = new Edge().setSourceVertex(vertex1).setTargetVertex(vertex2); Model efsm = new Model().addEdge(edge1); assertThat(efsm.build(), notNullValue()); assertThat(efsm.build().getEdges().size(), is(1)); assertThat(efsm.build().getVertices().size(), is(2)); Edge edge2 = new Edge().setSourceVertex(vertex1).setTargetVertex(vertex2); efsm.addEdge(edge2); assertThat(efsm.build(), notNullValue()); assertThat(efsm.build().getEdges().size(), is(2)); assertThat(efsm.build().getVertices().size(), is(2)); }", "tokens": 166} {"id": 227780, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "public void noFirstExecutionTime() throws Exception { new Profile(context, vertex, Collections.emptyList()).getFirstExecutionTime(); }", "tokens": 25} {"id": 227967, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "public int getErrors() { return errors; }", "tokens": 11} {"id": 227968, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "public String getErrorsAsString() { return String.valueOf(errors); }", "tokens": 16} {"id": 228050, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "public MachineConfiguration getMachineConfiguration() { return machineConfiguration; }", "tokens": 14} {"id": 228057, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "public MachineException getFailure(Context context) { return failures.get(context); }", "tokens": 19} {"id": 228059, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "public void reportResults(File file, Date startTime, Properties properties) { new XMLReportGenerator(startTime, properties).writeReport(file, this); if (!getFailures().isEmpty()) { throw new TestExecutionException( MessageFormat.format(\"There are test failures.\\n\\n Please refer to {0} for the individual test results.\", file.getAbsolutePath())); } }", "tokens": 80} {"id": 228147, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "/** Checks the model for problems or any possible errors. Any findings will be added to a list of strings.

TODO: Implement a rule framework so that organisations and projects can create their own rule set (think model based code convention) @return A list of issues found in the runtime model */ static public List hasIssues(Model.RuntimeModel model) { List issues = new ArrayList<>(ElementChecker.hasIssues(model)); // Check that individual elements are valid for (Vertex.RuntimeVertex vertex : model.getVertices()) { issues.addAll(VertexChecker.hasIssues(vertex)); } for (Edge.RuntimeEdge edge : model.getEdges()) { issues.addAll(EdgeChecker.hasIssues(edge)); } // Check that ids are unique Set ids = new HashSet<>(); for (Element element : model.getElements()) { if (!ids.add(element.getId())) { if (element instanceof Edge.RuntimeEdge) { issues.add(\"Id of the edge is not unique: \" + element.getId()); } else { issues.add(\"Id of the vertex is not unique: \" + element.getId()); } } } // Check for unnamed selfloop edges. for (Edge.RuntimeEdge edge : model.getEdges()) { if (!edge.hasName() && null != edge.getSourceVertex() && null != edge.getTargetVertex() && edge.getSourceVertex().equals(edge.getTargetVertex())) { issues.add(\"Vertex: \" + edge.getSourceVertex() + \", have a unnamed self loop edge.\"); } } return issues; }", "tokens": 335} {"id": 228177, "source": "method", "repo": "graphwalker/graphwalker-project", "text": "public void e_SetData() { response = httpExecute(new HttpPut(\"http://localhost:9191/graphwalker/setData/MAX_BOOKS=6;\")); }", "tokens": 40} {"id": 228317, "source": "method", "repo": "gtasa-savegame-editor/gtasa-savegame-editor", "text": "public static void addSavegame(ExtractorServer.ExtractedSavegameFile file, ExtractorMenu menu) { getSaveGameFiles().add(file); menu.remove(menu.getNoSavegamesItem()); menu.add(new ExtractedSavegameSubmenu(file.getSaveGame(), file.getFileName())); }", "tokens": 64} {"id": 228336, "source": "method", "repo": "gtasa-savegame-editor/gtasa-savegame-editor", "text": "private void sendResponse(HttpExchange exchange) { try { if (sizeExceeded) { exchange.sendResponseHeaders(400, 0); // Bad request } else { exchange.sendResponseHeaders(200, 0); // OK } handler.handle(files); exchange.getResponseBody().close(); exchange.getRequestBody().close(); } catch (IOException e) { JOptionPane.showMessageDialog(MainWindow.getInstance(), e.getMessage(), \"Unable to handle Request\", JOptionPane.ERROR_MESSAGE); } }", "tokens": 104} {"id": 228350, "source": "method", "repo": "gtasa-savegame-editor/gtasa-savegame-editor", "text": "public static void updatePlayerImg() { File newSaDir = FileSystem.getSanAndreasDirectory(); ArchiveReader archive = null; if (Settings.getShowClothes() == Settings.YES && newSaDir != null) { if (newSaDir.equals(saDir)) return; try { if (FileSystem.getPlayerImageFile() != null) archive = new ArchiveReader(FileSystem.getPlayerImageFile()); } catch (FileFormatException | IOException ignored) { } } playerImg.setValue(archive); saDir = archive == null ? null : newSaDir; }", "tokens": 127} {"id": 228701, "source": "method", "repo": "gtasa-savegame-editor/gtasa-savegame-editor", "text": "public YBox() { super(NewBox.Y); }", "tokens": 14} {"id": 228734, "source": "method", "repo": "gtasa-savegame-editor/gtasa-savegame-editor", "text": "public void createContent() { // Add tabs getContentPane().remove(0); tabbedPane = new TabbedPane(); add(tabbedPane); // Observe Savegame.get().addOnGameClosedHandler(v -> { SavegameModel.gameClosed.report(); onGameClose(); tabbedPane.onGameClosed(); tabbedPane.updateUI(); }); Savegame.get().addOnGameLoadedHandler(v -> { SavegameModel.gameLoaded.report(); onTitleChange(); tabbedPane.onGameLoaded(); tabbedPane.updateUI(); }); Variables.get().title.addOnChangeListener(s -> onTitleChange()); invalidate(); validate(); }", "tokens": 127} {"id": 228753, "source": "method", "repo": "gtasa-savegame-editor/gtasa-savegame-editor", "text": "public void testParseValidStableVersion() throws Exception { Version version = new Version(\"v1.0.0\"); assertEquals(1, version.getMajor()); assertEquals(0, version.getMinor()); assertEquals(0, version.getPatch()); assertEquals(Version.Flag.RELEASE, version.getFlag()); }", "tokens": 64} {"id": 228817, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "public void put(int index, String s) { insertElementAt(s, index); }", "tokens": 22} {"id": 228833, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "public Vector toVector() { int size = count; Vector copy = new Vector(size); for (int i = 0; i < size; i++) { Object o = elements[i]; if (o instanceof String[]) o = elements[i] = JSON.parseJSON(((String[]) o)[0]); if (o instanceof JSONObject) { o = ((JSONObject) o).toTable(); } else if (o instanceof JSONArray) { o = ((JSONArray) o).toVector(); } copy.addElement(o); } return copy; }", "tokens": 122} {"id": 228887, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "public JSONObject nextObject() throws IOException { return nextObject(true); }", "tokens": 16} {"id": 228926, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "private static int rand() { int result; do { result = AboutScreen.rng.nextInt()&255; } while (result > 250); return result - 125; }", "tokens": 46} {"id": 229004, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "public void setSocketOption(byte option, int value) { // no op }", "tokens": 18} {"id": 229104, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "public void keyAction(int keycode) { if (!isScrollable) return; switch (getGameAction(keycode)) { case UP: { scroll -= fontHeight*3; break; } case DOWN: { scroll += fontHeight*3; break; } } repaint(); }", "tokens": 61} {"id": 229116, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "public static void show() { try { RecordStore rms = RecordStore.openRecordStore(\"emoji\", false); Util.closeRecordStore(rms); App.disp.setCurrent(new EmojiPicker()); } catch (Exception e) { App.disp.setCurrent(new EmojiDownloadDialog()); } catch (OutOfMemoryError e) { App.error(Locale.get(EMOJI_PICKER_NO_MEMORY)); } }", "tokens": 89} {"id": 229167, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "public int getWidth() { return FormattedStringPartEmoji.emojiSize; }", "tokens": 16} {"id": 229215, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "public static String post(String url, String data, boolean useProxy) throws Exception { return apiRequest(\"POST\", url, data, useProxy); }", "tokens": 33} {"id": 229251, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "protected void checkScrollInRange() { scroll = Math.min(Math.max(scroll, getMinScroll()), getMaxScroll()); }", "tokens": 27} {"id": 229313, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "protected MyCanvas reload() { return get(true); }", "tokens": 13} {"id": 229453, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "public void itemStateChanged(Item i) { int offsetSign = optionsGroup.isSelected(0) ? -1 : 1; int offsetMinutes = hourOffsetGauge.getValue()*60 + minOffsetGauge.getValue(); Settings.timeOffset = offsetSign*offsetMinutes*60*1000; Settings.use12hTime = optionsGroup.isSelected(1); previewItem.setText(Message.formatTimestamp(System.currentTimeMillis())); }", "tokens": 98} {"id": 229588, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "/** Get server response as an input stream that can be used to read streamed data. Stream must be closed with `close()` after use. */ public InputStream getResponseStream() throws Exception { checkMakeRequest(); return is; }", "tokens": 48} {"id": 229596, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "public StandardHTTP(String method, String url) { super(method, url); }", "tokens": 19} {"id": 229606, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "public int init(String appName) throws Exception { return api.init(appName); }", "tokens": 20} {"id": 229675, "source": "method", "repo": "gtrxAC/discord-j2me", "text": "public String getAddress() throws IOException { return socket.getAddress(); }", "tokens": 15} {"id": 229910, "source": "method", "repo": "gu-zt/gugle-carpet-addition", "text": "public JsonElement serialize(ResourceLocation resourceLocation, Type type, JsonSerializationContext jsonSerializationContext) { return new JsonPrimitive(resourceLocation.toString()); }", "tokens": 28} {"id": 229972, "source": "method", "repo": "gu-zt/gugle-carpet-addition", "text": "private static T useOfflineUUID(Optional instance, T other, Operation original) { if (GcaSetting.fakePlayerForceOfflineUUID) return null; return original.call(instance, other); }", "tokens": 49} {"id": 230178, "source": "method", "repo": "guchengwuyue/yshop-crm", "text": "public static Date addTime(Duration duration) { return new Date(System.currentTimeMillis() + duration.toMillis()); }", "tokens": 26} {"id": 230350, "source": "method", "repo": "guchengwuyue/yshop-crm", "text": "default PageResult selectPage2(CrmContractPageReqVO reqVO,List ids) { Long loginAdminId = SecurityFrameworkUtils.getLoginUserId(); return selectJoinPage(reqVO, CrmContractRespVO.class, new MPJLambdaWrapper() .selectAll(CrmContractDO.class) .selectAs(\"t3\",CrmCustomerDO::getName,CrmContractRespVO::getCustomerName) .selectAs(\"t1\", AdminUserDO::getNickname, CrmContractRespVO::getOrderAdminName) .selectAs(\"t2\",AdminUserDO::getNickname, CrmContractRespVO::getCreatorName) .leftJoin(CrmCustomerDO.class,\"t3\",CrmCustomerDO::getId,CrmContractDO::getCustomerId) .leftJoin(AdminUserDO.class, \"t1\",AdminUserDO::getId, CrmContractDO::getOrderAdminId) .leftJoin(AdminUserDO.class, \"t2\",AdminUserDO::getId, CrmContractDO::getCreator) .likeIfExists(CrmCustomerDO::getName, reqVO.getCustomerName()) .likeIfExists(CrmContractDO::getNumber, reqVO.getNumber()) .likeIfExists(CrmContractDO::getName,reqVO.getName()) .eqIfExists(CrmContractDO::getCustomerId, reqVO.getCustomerId()) .eqIfExists(CrmContractDO::getCheckStatus, reqVO.getCheckStatus()) .eqIfExists(CrmContractDO::getExpireHandle, reqVO.getExpireHandle()) .in(!ids.isEmpty(), CrmContractDO::getOwnerUserId,ids) .likeIfExists(\"t1\",AdminUserDO::getNickname, reqVO.getOrderAdminName()) .likeIfExists(\"t2\",AdminUserDO::getNickname, reqVO.getCreatorName()) .orderByDesc(CrmContractDO::getId) .apply(reqVO.getIsCheck(), \"FIND_IN_SET ('\" + loginAdminId + \"',flow_admin_id)\") ); }", "tokens": 431} {"id": 230516, "source": "method", "repo": "guchengwuyue/yshop-crm", "text": "public Set getUserRoleIdListByRoleIds(Collection roleIds) { return permissionService.getUserRoleIdListByRoleId(roleIds); }", "tokens": 36} {"id": 230585, "source": "method", "repo": "guchengwuyue/yshop-crm", "text": "default List selectListByUserIdAndUserTypeAndClientId(Long userId, Integer userType, String clientId) { return selectList(new LambdaQueryWrapperX() .eq(OAuth2ApproveDO::getUserId, userId) .eq(OAuth2ApproveDO::getUserType, userType) .eq(OAuth2ApproveDO::getClientId, clientId)); }", "tokens": 86} {"id": 230757, "source": "method", "repo": "gufranthakur/FlowForge", "text": "public NotEqualToNode(String title, ProgramPanel programPanel) { super(title, programPanel); this.programPanel = programPanel; this.nodeTheme = programPanel.flowForge.comparatorNodeTheme; inputXButton.setText(\"Values\"); JLabel label = new JLabel(\"!=\"); label.setFont(new Font(FlatInterFont.FAMILY, Font.PLAIN, 28)); topPanel.setLayout(new FlowLayout()); topPanel.add(label); }", "tokens": 94} {"id": 230878, "source": "method", "repo": "guilds-plugin/guilds", "text": "/** Runs one shutdown step, logging (never rethrowing) whatever it throws. @param step the routine, or null when the object it needs was never created @param label what is being saved or cleaned up, used in log messages @return true when the step ran without throwing */ private boolean runCleanup(@Nullable SaveRoutine step, String label) { if (step == null) { return false; } try { step.run(); return true; } catch (IOException | RuntimeException e) { LoggingUtils.severe(\"An error occurred while saving or cleaning up \" + label + \".\", e); return false; } }", "tokens": 131} {"id": 230894, "source": "method", "repo": "guilds-plugin/guilds", "text": "public SettingsHandler getSettingsHandler() { return this.settingsHandler; }", "tokens": 16} {"id": 231210, "source": "method", "repo": "guilds-plugin/guilds", "text": "/** Warns about a tier ladder that is likely a typo. Deliberately does not prevent the plugin from starting: an owner with an odd ladder should still get a working server, and refusing to load would be a worse outcome than the problem being reported. */ private void warnAboutSuspiciousTiers() { if (tiers.isEmpty()) { LoggingUtils.severe(\"No guild tiers were loaded from tiers.yml. Every guild will be treated as being at the top tier.\"); return; } final Set levels = tiers.stream().map(GuildTier::getLevel).collect(Collectors.toSet()); if (levels.size() != tiers.size()) { LoggingUtils.severe(\"tiers.yml contains more than one tier with the same level: \" + tiers.stream().map(GuildTier::getLevel).collect(Collectors.toList()) + \". Guilds upgrade to the first tier loaded for a level, so the others are unreachable. \" + \"Give every tier a distinct level.\"); } }", "tokens": 220} {"id": 231240, "source": "method", "repo": "guilds-plugin/guilds", "text": "/** Returns a string list of the name of all guilds on the server @return a string list of guild names */ public List getGuildNames() { return guilds.values().stream().map(Guild::getName).map(ACFBukkitUtil::removeColors).collect(Collectors.toList()); }", "tokens": 66} {"id": 231258, "source": "method", "repo": "guilds-plugin/guilds", "text": "/** Create a guild upgrade ticket @param settingsManager the settings manager @param amount the amount of tickets to give @return the guild upgrade ticket */ public ItemStack getUpgradeTicket(SettingsManager settingsManager, int amount) { ItemBuilder builder = new ItemBuilder(resolveTicketMaterial(settingsManager)); builder.setAmount(amount); builder.setName(StringUtils.color(settingsManager.getProperty(TicketSettings.TICKET_NAME))); builder.setLore(settingsManager.getProperty(TicketSettings.TICKET_LORE).stream().map(StringUtils::color).collect(Collectors.toList())); return builder.build(); }", "tokens": 123} {"id": 231348, "source": "method", "repo": "guilds-plugin/guilds", "text": "/** Handles restrictions on player vs player damage based on guild affiliation. @param event the event triggered by player vs player damage */ public void onEntityDamage(EntityDamageByEntityEvent event) { if (event.isCancelled()) { return; } if (!(event.getEntity() instanceof Player) || !(event.getDamager() instanceof Player)) { return; } final Player player = (Player) event.getEntity(); final Player damager = (Player) event.getDamager(); // Check if they are in the same guild and have permission to damage their guild members if (guildHandler.isSameGuild(player, damager) && !damager.hasPermission(\"guilds.ffa.guild\")) { event.setCancelled(!settingsManager.getProperty(GuildSettings.GUILD_DAMAGE)); return; } // Get the challenge object for the player final GuildChallenge challenge = challengeHandler.getChallenge(player); // Check if they are in a challenge if (challenge != null && challenge.isStarted()) { // Cancel the rest of the checks in case they are battling allies return; } // Check if they are allies and have permission to damage allies if (guildHandler.isAlly(player, damager) && !damager.hasPermission(\"guilds.ffa.ally\")) { event.setCancelled(!settingsManager.getProperty(GuildSettings.ALLY_DAMAGE)); } }", "tokens": 287} {"id": 231408, "source": "method", "repo": "guilds-plugin/guilds", "text": "/** Log a message to console on INFO level. @param msg the msg you want to log. */ public static void info(String msg) { log(Level.INFO, StringUtils.color(msg)); }", "tokens": 45} {"id": 231521, "source": "method", "repo": "guilds-plugin/guilds", "text": "void unknownMemberIsNotRemoved() { final GuildMember stranger = new GuildMember(UUID.randomUUID(), MEMBER); assertFalse(guild.removeMember(stranger)); assertEquals(2, guild.getMembers().size()); }", "tokens": 46} {"id": 231590, "source": "method", "repo": "guobinhit/akka-guide", "text": "public void preStart() { log.info(\"Device actor {}-{} started\", groupId, deviceId); }", "tokens": 23} {"id": 231628, "source": "method", "repo": "guobinhit/akka-guide", "text": "public static void main(String[] args) { final ActorSystem system = ActorSystem.create(\"helloakka\"); try { //#create-actors final ActorRef printerActor = system.actorOf(Printer.props(), \"printerActor\"); final ActorRef howdyGreeter = system.actorOf(Greeter.props(\"Howdy\", printerActor), \"howdyGreeter\"); final ActorRef helloGreeter = system.actorOf(Greeter.props(\"Hello\", printerActor), \"helloGreeter\"); final ActorRef goodDayGreeter = system.actorOf(Greeter.props(\"Good day\", printerActor), \"goodDayGreeter\"); //#create-actors //#main-send-messages howdyGreeter.tell(new WhoToGreet(\"Akka\"), ActorRef.noSender()); howdyGreeter.tell(new Greet(), ActorRef.noSender()); howdyGreeter.tell(new WhoToGreet(\"Lightbend\"), ActorRef.noSender()); howdyGreeter.tell(new Greet(), ActorRef.noSender()); helloGreeter.tell(new WhoToGreet(\"Java\"), ActorRef.noSender()); helloGreeter.tell(new Greet(), ActorRef.noSender()); goodDayGreeter.tell(new WhoToGreet(\"Play\"), ActorRef.noSender()); goodDayGreeter.tell(new Greet(), ActorRef.noSender()); //#main-send-messages System.out.println(\">>> Press ENTER to exit <<<\"); System.in.read(); } catch (IOException ioe) { } finally { system.terminate(); } }", "tokens": 333} {"id": 231672, "source": "method", "repo": "guobinhit/akka-guide", "text": "public void postStop() { cluster.unsubscribe(self()); }", "tokens": 14} {"id": 231759, "source": "method", "repo": "guobinhit/akka-guide", "text": "private void receiveAllServicesKeysChanged(Changed> c) { Set newKeys = c.dataValue().getElements(); Set diff = new HashSet<>(newKeys); diff.removeAll(keys); log.debug(\"Services changed, added: {}, all: {}\", diff, newKeys); diff.forEach(dKey -> { // subscribe to get notifications of when services with this name are added or removed replicator.tell(new Subscribe>(dKey, self()), self()); }); keys = newKeys; }", "tokens": 126} {"id": 231786, "source": "method", "repo": "guobinhit/akka-guide", "text": "private void receiveRemoveItemGetSuccess(GetSuccess> g) { RemoveItem rm = (RemoveItem) g.getRequest().get(); removeItem(rm.productId); }", "tokens": 47} {"id": 231949, "source": "method", "repo": "gurkenlabs/litiengine", "text": "public void modify(Modification modification, double value) { this.modify(new AttributeModifier<>(modification, value)); }", "tokens": 25} {"id": 231967, "source": "method", "repo": "gurkenlabs/litiengine", "text": "public void setHeight(final double height) { setSize(getWidth(), height); }", "tokens": 19} {"id": 231979, "source": "method", "repo": "gurkenlabs/litiengine", "text": "public Shape getLightShape() { return lightShape; }", "tokens": 13} {"id": 232023, "source": "method", "repo": "gurkenlabs/litiengine", "text": "public void loadEnvironment(final Environment env) { Lock lock = Game.loop().getLock(); lock.lock(); try { unloadEnvironment(); this.environment = env; if (env != null) { this.addEnvironment(env); if (env.getGravity() == 0 && this.gravity() != 0) { env.setGravity(this.gravity()); } env.load(); for (final EnvironmentLoadedListener listener : this.loadedListeners) { listener.loaded(env); } // call map specific listeners String mapName = getMapName(env); if (mapName != null && this.environmentLoadedListeners.containsKey(mapName)) { // for the default camera we center the camera on the environment if (this.camera().getClass().equals(Camera.class)) { camera().setFocus(env.getCenter()); } for (EnvironmentLoadedListener listener : this.environmentLoadedListeners.get(mapName)) { listener.loaded(env); } } } } finally { lock.unlock(); } }", "tokens": 212} {"id": 232064, "source": "method", "repo": "gurkenlabs/litiengine", "text": "public boolean isPolygon() { return this.polygon != null; }", "tokens": 15} {"id": 232148, "source": "method", "repo": "gurkenlabs/litiengine", "text": "public void onMousePressed(final Consumer callback) { if (!getMousePressedConsumer().contains(callback)) { getMousePressedConsumer().add(callback); } }", "tokens": 39} {"id": 232156, "source": "method", "repo": "gurkenlabs/litiengine", "text": "public void setFontSize(final float size) { if (this.font == null) { return; } setFont(getFont().deriveFont(size)); }", "tokens": 33} {"id": 232204, "source": "method", "repo": "gurkenlabs/litiengine", "text": "public IEntity getForceEntity() { return this.forceEntity; }", "tokens": 16} {"id": 232425, "source": "method", "repo": "gurkenlabs/litiengine", "text": "void trailingApev2FooterBeforeId3v1DoesNotPreventCompleteDecoding() throws Exception { byte[] mp3 = readSample(); assertArrayEquals(decodeWithLitiengine(mp3, false), decodeWithLitiengine(withTrailingMetadata(mp3, apev2FooterAndId3v1()), false)); }", "tokens": 68} {"id": 232559, "source": "method", "repo": "gurkenlabs/litiengine", "text": "private static void addCreatedMapObject( MapObject mapObject, IMapObjectLayer targetLayer) { if (UI.getLayerController() == null) { targetLayer.addMapObject(mapObject); Game.world().environment().loadFromMap(mapObject.getId()); } else { Editor.instance().getMapComponent().add(mapObject, targetLayer); } UndoManager.instance().mapObjectAdded(mapObject); }", "tokens": 90} {"id": 232649, "source": "method", "repo": "gurkenlabs/litiengine", "text": "static boolean shouldRelinquishEditorFocus(Component focusOwner, Component browserHost) { return focusOwner != null && browserHost != null && focusOwner != browserHost && !SwingUtilities.isDescendingFrom(focusOwner, browserHost); }", "tokens": 52} {"id": 232860, "source": "method", "repo": "gurkenlabs/litiengine", "text": "void disablesDefaultJumpToFirstPrefixMatch() { SearchableSpriteComboBox comboBox = comboBox( \"decormob-butterflyred\", \"decormob-butterflyblue\"); assertFalse(comboBox.selectWithKeyChar('d')); assertNull(comboBox.getSelectedItem()); }", "tokens": 64} {"id": 233015, "source": "method", "repo": "gustiks/neuralogic", "text": "public void incrementBy(VectorValue value) { //increment by zero = no increment }", "tokens": 19} {"id": 233016, "source": "method", "repo": "gustiks/neuralogic", "text": "protected void elementMultiplyBy(VectorValue value) { value.zero(); }", "tokens": 17} {"id": 233466, "source": "method", "repo": "gustiks/neuralogic", "text": "public Stream> buildFrom(PlainQueriesParseTree parseTree) { PlainGrammarVisitor plainGrammarVisitor = new PlainGrammarVisitor(this); PlainQueriesParseTreeExtractor queriesParseTreeExtractor = new PlainQueriesParseTreeExtractor(plainGrammarVisitor); NeuralogicParser.QueriesFileContext queriesFileContext = parseTree.getRoot(); inferInputFormatSettings(queriesFileContext); return queriesParseTreeExtractor.getLabeledQueries(queriesFileContext); }", "tokens": 100} {"id": 233582, "source": "method", "repo": "gustiks/neuralogic", "text": "public static Collection benchmarkSlow(String methodPath, int iterations, int warmupIterations) throws RunnerException { Options opt = new OptionsBuilder() // Specify which benchmarks to run. // You can be more specific if you'd like to run only one benchmark per test. .include(methodPath) // Set the following options as needed .mode(Mode.SingleShotTime) .timeUnit(timeUnit) // .warmupTime(TimeValue.milliseconds(1)) .warmupIterations(warmupIterations) // .measurementTime(TimeValue.seconds(5)) .measurementIterations(iterations) .threads(1) .forks(1) .shouldFailOnError(true) .shouldDoGC(false) //.jvmArgs(\"-XX:+UnlockDiagnosticVMOptions\", \"-XX:+PrintInlining\") // .addProfiler(WinPerfAsmProfiler.class) // .addProfiler(StackProfiler.class) .build(); try { Collection runResults = new Runner(opt).run(); return runResults; } catch (NoBenchmarksException ignored) { LOG.warning(\"Skipping this automatically generated copy of the test...\"); return null; } }", "tokens": 266} {"id": 233631, "source": "method", "repo": "gustiks/neuralogic", "text": "/** Checks if all elements of the matrix are 0. @param matrix the matrix @return true if all elements of the matrix are zero, false otherwise */ public static boolean isZero(double[][] matrix){ for (int i = 0; i < matrix.length; i++){ for (int j = 0; j < matrix.length; j++){ if (matrix[i][j] != 0){ return false; } } } return true; }", "tokens": 97} {"id": 233677, "source": "method", "repo": "gustiks/neuralogic", "text": "/** Computes vector whose elements are the results of logical AND of the respective elements iterable the two given vectors. @param a the first vector @param b the second vector @return the vector containing logical ANDs of the elements of the two given vectors */ public static boolean[] and(boolean a[], boolean b[]){ boolean[] c = new boolean[a.length]; for (int i = 0; i < c.length; i++){ c[i] = a[i] & b[i]; } return c; }", "tokens": 113} {"id": 233811, "source": "method", "repo": "gustiks/neuralogic", "text": "public SampleProgressLog(Logger log, Settings settings, String stage, String... metricNames) { this.log = log; this.stage = stage; this.detailLimit = settings.loggedSampleDetails; this.interval = settings.sampleLogInterval; this.names = metricNames; this.totals = new long[metricNames.length]; }", "tokens": 77} {"id": 234011, "source": "method", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "protected void addCompletions(@NotNull CompletionParameters completionParameters, @NotNull ProcessingContext processingContext, final @NotNull CompletionResultSet completionResultSet) { PsiElement psiElement = completionParameters.getOriginalPosition(); if(!Symfony2ProjectComponent.isEnabled(psiElement)) { return; } XmlTag xmlTag = PsiTreeUtil.getParentOfType(psiElement, XmlTag.class); if(xmlTag == null) { return; } XmlTag xmlTagService = PsiTreeUtil.getParentOfType(xmlTag, XmlTag.class); if(xmlTagService != null) { XmlAttribute xmlAttribute = xmlTagService.getAttribute(\"class\"); if(xmlAttribute != null) { String value = xmlAttribute.getValue(); if(StringUtils.isNotBlank(value)) { PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), value); if(phpClass != null) { FormUtil.attachFormAliasesCompletions(phpClass, completionResultSet); } } } } }", "tokens": 191} {"id": 234060, "source": "method", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "public void actionPerformed(@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) { return; } PsiElement psiElement = e.getData(CommonDataKeys.PSI_ELEMENT); if (psiElement == null) { PsiFile psiFile = e.getData(CommonDataKeys.PSI_FILE); if (psiFile != null) { psiElement = psiFile.findElementAt(e.getData(CommonDataKeys.CARET) != null ? e.getData(CommonDataKeys.CARET).getOffset() : 0); } } if (psiElement == null) { return; } PhpNamedElement commandTarget; if (psiElement instanceof PhpNamedElement phpNamedElement) { commandTarget = phpNamedElement; } else { commandTarget = SymfonyCommandTestRunLineMarkerProvider.getCommandTargetContext(psiElement); if (commandTarget == null && psiElement.getParent() instanceof PhpNamedElement phpNamedElement) { commandTarget = phpNamedElement; } } if (commandTarget == null) { return; } List commandNames = SymfonyCommandTestRunLineMarkerProvider.getCommandNames(commandTarget); if (commandNames.isEmpty()) { return; } String commandName = commandNames.getFirst(); RunManager runManager = RunManager.getInstance(project); SymfonyCommandRunConfigurationType type = SymfonyCommandRunConfigurationType.getInstance(); RunnerAndConfigurationSettings settings = runManager.createConfiguration(commandName, type.getFactory()); SymfonyCommandRunConfiguration configuration = (SymfonyCommandRunConfiguration) settings.getConfiguration(); configuration.setCommandName(commandName); configuration.setExecutionMode(myMode); configuration.setName(commandName); runManager.addConfiguration(settings); runManager.setSelectedConfiguration(settings); try { ExecutionEnvironmentBuilder.create(DefaultRunExecutor.getRunExecutorInstance(), settings) .buildAndExecute(); } catch (ExecutionException ignored) { } }", "tokens": 385} {"id": 234109, "source": "method", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "default String getTableName() { return null; }", "tokens": 11} {"id": 234216, "source": "method", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "private void attachEntityClass(@NotNull Collection> lineMarkerInfos, @NotNull PsiElement psiElement) { if(psiElement.getNode().getElementType() != YAMLTokenTypes.SCALAR_KEY) { return; } PsiElement yamlKeyValue = psiElement.getParent(); if(!(yamlKeyValue instanceof YAMLKeyValue)) { return; } if(yamlKeyValue.getParent() instanceof YAMLMapping && yamlKeyValue.getParent().getParent() instanceof YAMLDocument) { PsiFile containingFile; try { containingFile = yamlKeyValue.getContainingFile(); } catch (PsiInvalidElementAccessException e) { return; } String fileName = containingFile.getName(); if(isMetadataFile(fileName)) { String keyText = ((YAMLKeyValue) yamlKeyValue).getKeyText(); if(StringUtils.isNotBlank(keyText)) { Collection phpClasses = PhpElementsUtil.getClassesInterface(psiElement.getProject(), keyText); if(!phpClasses.isEmpty()) { NavigationGutterIconBuilder builder = NavigationGutterIconBuilder.create(Symfony2Icons.DOCTRINE_LINE_MARKER). setTargets(phpClasses). setTooltipText(\"Navigate to class\"); lineMarkerInfos.add(builder.createLineMarkerInfo(psiElement)); } } } } }", "tokens": 255} {"id": 234316, "source": "method", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "public void renderElement(LookupElementPresentation presentation) { lookupElement.renderElement(presentation); }", "tokens": 19} {"id": 234368, "source": "method", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "/** Resolves {@code enum('App\\\\Status')} from its literal argument, independently of Twig's PHP return declaration. */ private static Collection resolveEnumFunctionTypes(@NotNull PsiElement psiElement) { PsiElement root = findRootPathElement(psiElement, \"enum\"); if (root == null) { return Collections.emptyList(); } PsiElement argument = PsiElementUtils.getNextSiblingAndSkip(root, TwigTokenTypes.STRING_TEXT, TwigTokenTypes.LBRACE, TwigTokenTypes.SINGLE_QUOTE, TwigTokenTypes.DOUBLE_QUOTE); if (argument == null || PsiElementUtils.getNextSiblingAndSkip(argument, TwigTokenTypes.RBRACE, TwigTokenTypes.SINGLE_QUOTE, TwigTokenTypes.DOUBLE_QUOTE) == null) { return Collections.emptyList(); } return TwigConstantEnumResolver.getEnumTargets(argument).stream() .map(phpClass -> new TwigTypeContainer(Collections.singleton(phpClass.getFQN()))) .collect(Collectors.toList()); }", "tokens": 206} {"id": 234403, "source": "method", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "private static boolean isTestFile(@NotNull Project project, @NotNull VirtualFile virtualFile) { // ignore: \"vendor/symonfy/.../tests/fixtures/build/entrypoints.json\" String path = VfsUtil.getRelativePath(virtualFile, ProjectUtil.getProjectDir(project), '/'); if (path != null) { String lowerCase = path.toLowerCase(); return lowerCase.contains(\"/test/\") || lowerCase.contains(\"/tests/\"); } return false; }", "tokens": 105} {"id": 234462, "source": "method", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "/** @deprecated use getMethodWithFirstStringOrNamedArgumentPattern */ static public PsiElementPattern.Capture getMethodWithFirstStringPattern() { return PlatformPatterns .psiElement(StringLiteralExpression.class) .withParent( PlatformPatterns.psiElement(PhpElementTypes.PARAMETER_LIST) .withFirstChild( PlatformPatterns.psiElement(PhpElementTypes.STRING) ) .withParent( PlatformPatterns.psiElement(PhpElementTypes.METHOD_REFERENCE) ) ) .withLanguage(PhpLanguage.INSTANCE); }", "tokens": 113} {"id": 234555, "source": "method", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "public void testThatAutowireForServiceBlocksInspect() { XmlTag xmlTag = createServiceXmlTag( \" \\n\" + \" ice autowire=\\\"true\\\"/>\\n\" + \" \" ); assertFalse(ServiceActionUtil.isValidXmlParameterInspectionService(xmlTag)); }", "tokens": 68} {"id": 234631, "source": "method", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "private StringLiteralExpression findStringLiteral(String contents) { int[] result = {-1}; myFixture.getFile().accept(new com.intellij.psi.PsiRecursiveElementVisitor() { @Override public void visitElement(com.intellij.psi.PsiElement element) { if (element instanceof StringLiteralExpression s && s.getContents().equals(contents)) { result[0] = element.getTextRange().getStartOffset(); } super.visitElement(element); } }); if (result[0] < 0) return null; com.intellij.psi.PsiElement el = myFixture.getFile().findElementAt(result[0]); while (el != null && !(el instanceof StringLiteralExpression)) { el = el.getParent(); } return (StringLiteralExpression) el; }", "tokens": 168} {"id": 234821, "source": "method", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "/** @see fr.adrienbrault.idea.symfony2plugin.util.PhpElementsUtil#getVariableReferencesInScope */ public void testGetVariableReferencesInScopeForVariable() { myFixture.configureByText(PhpFileType.INSTANCE, \"r->format();\" + \" $var->modify();\" + \"\\n}\" ); PsiElement psiElement = myFixture.getFile().findElementAt(myFixture.getCaretOffset()); assertNotNull(psiElement); Collection vars = PhpElementsUtil.getVariableReferencesInScope((Variable) psiElement.getParent()); assertSize(2, vars); assertNotNull(ContainerUtil.find(vars, variable -> \"$var = new \\\\DateTime()\".equals(variable.getParent().getText())) ); assertNotNull(ContainerUtil.find(vars, variable -> \"$var->modify()\".equals(variable.getParent().getText())) ); }", "tokens": 212} {"id": 234827, "source": "method", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "public void testRemoveStartIgnoreCase() { assertEquals(\"Bar\", StringUtils.removeStartIgnoreCase(\"fooBar\", \"foo\")); assertEquals(\"Bar\", StringUtils.removeStartIgnoreCase(\"FOOBar\", \"Foo\")); assertEquals(\"Bar\", StringUtils.removeStartIgnoreCase(\"Bar\", \"\")); assertEquals(\"FooBar\", StringUtils.removeStartIgnoreCase(\"FooBar\", \"xyz\")); assertEquals(\"\", StringUtils.removeStartIgnoreCase(\"action\", \"ACTION\")); }", "tokens": 85} {"id": 234991, "source": "method", "repo": "haehnchen/idea-php-toolbox", "text": "protected Collection resolveParameter(@NotNull PhpIndex phpIndex, @NotNull String parameter) { return phpIndex.getAnyByFQN(parameter); }", "tokens": 34} {"id": 235014, "source": "method", "repo": "haehnchen/idea-php-toolbox", "text": "public void visit(@NotNull Method method, @NotNull StringLiteralExpression psiElement, @NotNull String returnValue) { if (contents.equals(returnValue)) { psiElements.add(method); } }", "tokens": 42} {"id": 235050, "source": "method", "repo": "haehnchen/idea-php-toolbox", "text": "public MethodReferenceBag(ParameterList parameterList, MethodReference methodReference, ParameterBag parameterBag) { this.parameterList = parameterList; this.methodReference = methodReference; this.parameterBag = parameterBag; }", "tokens": 47} {"id": 235262, "source": "method", "repo": "hamza-cskn/obliviate-invs", "text": "static ItemStack getItemStackFromHotkeyClick(InventoryClickEvent event) { if (event.getHotbarButton() == -1) return null; return event.getWhoClicked().getInventory().getItem(event.getHotbarButton()); }", "tokens": 46} {"id": 235365, "source": "method", "repo": "hamza-cskn/obliviate-invs", "text": "XMaterial(int data, @Nonnull String... legacy) { this.data = (byte) data; this.legacy = legacy; Material mat = null; if ((!Data.ISFLAT && this.isDuplicated()) || (mat = Material.getMaterial(this.name())) == null) { for (int i = legacy.length - 1; i >= 0; i--) { mat = Material.getMaterial(legacy[i]); if (mat != null) break; } } this.material = mat; }", "tokens": 112} {"id": 235452, "source": "method", "repo": "hamza-cskn/obliviate-invs", "text": "/** sets durability of icon @param newDamage durability @return this */ public Icon setDurability(final short newDamage) { item.setDurability(newDamage); return this; }", "tokens": 38} {"id": 235698, "source": "method", "repo": "hangarmc/hangar", "text": "Cache indexSitemapCache() { return this.createCache(INDEX_SITEMAP, Duration.ofHours(1), 1); }", "tokens": 29} {"id": 235811, "source": "method", "repo": "hangarmc/hangar", "text": "public UserTableResolver(final UserService userService) { this.userService = userService; }", "tokens": 19} {"id": 236037, "source": "method", "repo": "hangarmc/hangar", "text": "public void setOwnerName(final String ownerName) { this.ownerName = ownerName; }", "tokens": 22} {"id": 236072, "source": "method", "repo": "hangarmc/hangar", "text": "public void setPlatforms(final Map> platforms) { this.platforms = platforms; }", "tokens": 28} {"id": 236123, "source": "method", "repo": "hangarmc/hangar", "text": "public HangarProjectInfo getInfo() { return this.info; }", "tokens": 16} {"id": 236147, "source": "method", "repo": "hangarmc/hangar", "text": "default OrganizationContext createLogContext() { return OrganizationContext.of(this.getOrganizationId()); }", "tokens": 21} {"id": 236610, "source": "method", "repo": "hap-java/hap-java", "text": "public LockPhysicalControlsCharacteristic( Supplier> getter, ExceptionalConsumer setter, Consumer subscriber, Runnable unsubscriber) { super( \"000000A7-0000-1000-8000-0026BB765291\", \"Physical Locks\", LockPhysicalControlsEnum.values(), Optional.of(getter), Optional.of(setter), Optional.of(subscriber), Optional.of(unsubscriber)); }", "tokens": 120} {"id": 236637, "source": "method", "repo": "hap-java/hap-java", "text": "public TargetRelativeHumidityCharacteristic( Supplier> getter, ExceptionalConsumer setter, Consumer subscriber, Runnable unsubscriber) { super( \"00000034-0000-1000-8000-0026BB765291\", \"Target Relative Humidity\", 0, 100, 1, \"%\", Optional.of(getter), Optional.of(setter), Optional.of(subscriber), Optional.of(unsubscriber)); }", "tokens": 122} {"id": 236883, "source": "method", "repo": "hap-java/hap-java", "text": "public int getStatusCode() { return 204; }", "tokens": 14} {"id": 236973, "source": "method", "repo": "hap-java/hap-java", "text": "public OkResponse(byte[] body) { this.body = ByteBuffer.wrap(body); }", "tokens": 21} {"id": 236990, "source": "method", "repo": "hap-java/hap-java", "text": "public void addOptionalCharacteristic(RotationSpeedCharacteristic speed) { addCharacteristic(speed); }", "tokens": 18} {"id": 237093, "source": "method", "repo": "hap-java/hap-java", "text": "public SpeakerService(MuteCharacteristic muteCharacteristic) { super(\"00000113-0000-1000-8000-0026BB765291\"); addCharacteristic(muteCharacteristic); }", "tokens": 57} {"id": 237101, "source": "method", "repo": "hap-java/hap-java", "text": "public void addOptionalCharacteristic(ClosedCaptionsCharacteristic closedCaptions) { addCharacteristic(closedCaptions); }", "tokens": 23} {"id": 237186, "source": "method", "repo": "harmonwood/capacitor-video-player", "text": "private int getColorFromRGBA(String rgbaColor) { int ret = 0; String color = rgbaColor.substring(rgbaColor.indexOf(\"(\") + 1, rgbaColor.indexOf(\")\")); List colors = Arrays.asList(color.split(\",\")); if (colors.size() == 4) { ret = (Math.round(Float.parseFloat(colors.get(3).trim()) * 255) & 0xff) << 24 | (Integer.parseInt(colors.get(0).trim()) & 0xff) << 16 | (Integer.parseInt(colors.get(1).trim()) & 0xff) << 8 | (Integer.parseInt(colors.get(2).trim()) & 0xff); } return ret; }", "tokens": 181} {"id": 237277, "source": "method", "repo": "harshaghanta/springboot-eshopOnContainers", "text": "public InboxMessage(UUID id, String eventTypeName) { this.id = id; this.eventTypeName = eventTypeName; this.processedAt = LocalDateTime.now(); }", "tokens": 38} {"id": 237392, "source": "method", "repo": "harshaghanta/springboot-eshopOnContainers", "text": "public void addDomainEvent(Notification eventItem) { if (domainEvents == null) domainEvents = new ArrayList<>(); domainEvents.add(eventItem); }", "tokens": 33} {"id": 237407, "source": "method", "repo": "harshaghanta/springboot-eshopOnContainers", "text": "public OrderStatus convertToEntityAttribute(Integer id) { return OrderStatus.from(id); }", "tokens": 20} {"id": 237588, "source": "method", "repo": "hash-checker/hash-checker", "text": "private void selectHashType() { clickById(R.id.tv_selected_hash_type); delay(); List hashTypes = new ArrayList<>( Arrays.asList(HashType.values()) ); int hashTypePosition = hashTypes.indexOf(TEST_HASH_TYPE); assertTrue(hashTypePosition >= 0); inRecyclerViewClickOnPosition( R.id.rv_bottom_sheet_list_items, hashTypePosition ); textEquals( TEST_HASH_TYPE.getTypeAsString(), R.id.tv_selected_hash_type ); }", "tokens": 123} {"id": 237622, "source": "method", "repo": "hash-checker/hash-checker", "text": "protected String getHashValueForTestText() { return \"033bd94b1168d7e4f0d644c3c95e35bf\"; }", "tokens": 44} {"id": 237800, "source": "method", "repo": "hash-checker/hash-checker", "text": "public boolean isFile() { return isFile; }", "tokens": 12} {"id": 237825, "source": "method", "repo": "hash-checker/hash-checker", "text": "private static Theme getThemeAnalogue(@NonNull String theme) { return theme.contains(\"DARK\") ? Theme.DARK : Theme.LIGHT; }", "tokens": 31} {"id": 237858, "source": "method", "repo": "hash-checker/hash-checker", "text": "public LanguageConfig langHelper() { return languageConfig; }", "tokens": 13} {"id": 237928, "source": "method", "repo": "hash-checker/hash-checker", "text": "public void setupDialogStyle() { super.setupDialogStyle(); getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); }", "tokens": 35} {"id": 238015, "source": "method", "repo": "hash-checker/hash-checker", "text": "public BaseListHolder getItemsHolder(@NonNull Context themeContext, @NonNull View view) { return new ThemesListHolder(themeContext, view); }", "tokens": 36} {"id": 238348, "source": "method", "repo": "hcaptcha/hcaptcha-android-sdk", "text": "public void startVerification(@NonNull Activity fragmentActivity, @Nullable HCaptchaVerifyParams params) { this.verifyParams = params; if (readyForInteraction && webViewHelper != null) { webViewHelper.setVerifyParams(params); } final FragmentManager fragmentManager = ((FragmentActivity) fragmentActivity).getSupportFragmentManager(); final Fragment oldFragment = fragmentManager.findFragmentByTag(HCaptchaDialogFragment.TAG); if (oldFragment != null && oldFragment.isAdded()) { HCaptchaLog.w(\"DialogFragment was already added.\"); return; } if (fragmentManager.isStateSaved()) { HCaptchaLog.w(\"FragmentActivity is in state saved\"); return; } try { show(fragmentManager, HCaptchaDialogFragment.TAG); } catch (IllegalStateException e) { HCaptchaLog.w(\"DialogFragment.startVerification \" + e.getMessage()); // https://stackoverflow.com/q/14262312/902217 // Happens if Fragment is stopped i.e. activity is about to destroy on show call if (listener != null) { listener.onFailure(new HCaptchaException(HCaptchaError.ERROR)); } } }", "tokens": 238} {"id": 238412, "source": "method", "repo": "hcaptcha/hcaptcha-android-sdk", "text": "HCaptchaWebViewHelper(@NonNull final Handler handler, @NonNull final Context context, @NonNull final HCaptchaConfig config, @NonNull final HCaptchaInternalConfig internalConfig, @NonNull final IHCaptchaVerifier captchaVerifier, @NonNull final HCaptchaWebView webView) { this.context = context; this.config = config; this.captchaVerifier = captchaVerifier; this.webView = webView; this.htmlProvider = internalConfig.getHtmlProvider(); setupWebView(handler); }", "tokens": 96} {"id": 238443, "source": "method", "repo": "hcaptcha/hcaptcha-android-sdk", "text": "/** Creates a config with all features enabled and a single sink @param sink The sink to use for event emission */ public JLConfig(JLSink sink) { this(true, true, true, true, true, true, true, Arrays.asList(sink)); }", "tokens": 59} {"id": 238535, "source": "method", "repo": "hcaptcha/hcaptcha-android-sdk", "text": "public void enum_values() { assertEquals(\"invisible\", HCaptchaSize.INVISIBLE.getSize()); assertEquals(\"compact\", HCaptchaSize.COMPACT.getSize()); assertEquals(\"normal\", HCaptchaSize.NORMAL.getSize()); }", "tokens": 42} {"id": 238632, "source": "method", "repo": "hcaptcha/hcaptcha-android-sdk", "text": "public void testTargetBlankHandled() throws InterruptedException { try { Intents.init(); launchInContainer(); onWebView().check(webMatches(getCurrentUrl(), startsWith(\"about:blank\"))); // WORKAROUND: https://stackoverflow.com/questions/54066941/using-espresso-to-click-on-a-webview-with-href if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { onWebView().withElement(DriverAtoms.findElement(Locator.ID, \"on-target-blank\")) .perform(DriverAtoms.webClick()); } else { onView(withId(R.id.webView)).perform(AssertUtil.clickAt(-5, -5, Gravity.BOTTOM | Gravity.RIGHT)); } intended(allOf( hasAction(Intent.ACTION_VIEW), hasData(Uri.parse(\"https://example.com/\")) )); } finally { Intents.release(); } }", "tokens": 211} {"id": 238848, "source": "method", "repo": "headlesshq/headlessmc", "text": "private void filterAndTrimMatchingPrefix(String prefix, List candidates) { Set replace = new HashSet<>(); for (Completions.Candidate candidate : candidates) { String seq = candidate.getName(); if (seq.startsWith(prefix)) { replace.add(new Completions.Candidate( seq.subSequence(prefix.length(), seq.length()).toString(), candidate.getDescription() )); } } candidates.clear(); candidates.addAll(replace); }", "tokens": 101} {"id": 239096, "source": "method", "repo": "headlesshq/headlessmc", "text": "public void testBoxWithPrimitiveTypes() { Type intType = Type.INT_TYPE; MethodInsnNode methodInsnNode = InstructionUtil.box(intType); assertNotNull(methodInsnNode); assertEquals(INVOKESTATIC, methodInsnNode.getOpcode()); }", "tokens": 48} {"id": 239467, "source": "method", "repo": "heinrichreimer/material-intro", "text": "public int getButtonNextFunction() { return buttonNextFunction; }", "tokens": 15} {"id": 239515, "source": "method", "repo": "heinrichreimer/material-intro", "text": "public void setPageTransformer(boolean reverseDrawingOrder, ViewPager.PageTransformer transformer) { miPager.setPageTransformer(reverseDrawingOrder, transformer); }", "tokens": 35} {"id": 239625, "source": "method", "repo": "heinrichreimer/material-intro", "text": "public static Interpolator getFastOutSlowInInterpolator(Context context) { if (fastOutSlowIn == null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { fastOutSlowIn = AnimationUtils.loadInterpolator(context, android.R.interpolator.fast_out_slow_in); } else { fastOutSlowIn = new FastOutSlowInInterpolator(); } } return fastOutSlowIn; }", "tokens": 96} {"id": 239691, "source": "method", "repo": "heinrichreimer/material-intro", "text": "private void setSelectedPage(int now) { now = Math.min(now, pageCount - 1); if (now == currentPage) return; pageChanging = true; previousPage = currentPage; currentPage = now; final int steps = Math.abs(now - previousPage); if (steps > 1) { if (now > previousPage) { for (int i = 0; i < steps; i++) { setJoiningFraction(previousPage + i, 1f); } } else { for (int i = -1; i > -steps; i--) { setJoiningFraction(previousPage + i, 1f); } } } // create the anim to move the selected dot \u2013 this animator will kick off // retreat animations when it has moved 75% of the way. // The retreat animation in turn will kick of reveal anims when the // retreat has passed any dots to be revealed if (getVisibility() == VISIBLE && dotCenterX != null) createMoveSelectedAnimator(dotCenterX[now], previousPage, now, steps).start(); // dotCenterX is null when getVisibility() != VISIBLE }", "tokens": 246} {"id": 239701, "source": "method", "repo": "heinrichreimer/material-intro", "text": "public RightwardStartPredicate(float thresholdValue) { super(thresholdValue); }", "tokens": 18} {"id": 239806, "source": "method", "repo": "HelpChat/DeluxeMenus", "text": "private Component createMenuListForPlayer(final Map tree, int tabs) { final TextComponent.Builder list = text(); for (final Map.Entry entry : tree.entrySet()) { if (!(entry.getValue() instanceof List)) { list.append(text(\" \".repeat(tabs) + \"|-\" + entry.getKey(), NamedTextColor.DARK_AQUA)).append(newline()); list.append(createMenuListForPlayer((Map) entry.getValue(), tabs + 1)); continue; } for (final Menu menu : (List

) entry.getValue()) { final String menuCommand = getMenuDisplayCommand(menu); list.append( text(\" \".repeat(tabs) + \"- \" + entry.getKey(), NamedTextColor.DARK_AQUA).append(text(\" - \", NamedTextColor.GRAY)).append(text(menu.options().name(), NamedTextColor.GREEN)) .hoverEvent(HoverEvent.showText(menuCommand != null ? text(\"Open Command: \", NamedTextColor.GOLD).append(text(menuCommand, NamedTextColor.YELLOW)) : text(\"No open command\", NamedTextColor.GOLD))) .clickEvent(ClickEvent.suggestCommand((menuCommand != null ? menuCommand : \"No open command\"))) ).append(newline()); } } return list.asComponent(); }", "tokens": 289} {"id": 239970, "source": "method", "repo": "HelpChat/DeluxeMenus", "text": "public static boolean isInMenu(final @NotNull Player player) { return menuHolders.stream().anyMatch(h -> h.getViewerName().equals(player.getName())); }", "tokens": 39} {"id": 240002, "source": "method", "repo": "HelpChat/DeluxeMenus", "text": "public String setPlaceholders(final @NotNull String string) { final Player player = this.placeholderPlayer != null ? this.placeholderPlayer : this.getViewer(); if (player == null) { return string; } return StringUtils.replacePlaceholders(string, player); }", "tokens": 56} {"id": 240112, "source": "method", "repo": "HelpChat/DeluxeMenus", "text": "public MenuItemOptionsBuilder baseColor(final @Nullable DyeColor configBaseColor) { this.baseColor = configBaseColor; return this; }", "tokens": 31} {"id": 240414, "source": "method", "repo": "henninghall/react-native-date-picker", "text": "private String adjust(String displayValue) { return \" \" + displayValue + \" \"; }", "tokens": 21} {"id": 240577, "source": "method", "repo": "henninghall/react-native-date-picker", "text": "public AmPmWheel(final Picker picker, State state) { super(picker, state); }", "tokens": 25} {"id": 240769, "source": "method", "repo": "hernanponcedeleon/dat3m", "text": "public ExprSimplifier(boolean aggressive) { this.aggressive = aggressive; }", "tokens": 21} {"id": 241048, "source": "method", "repo": "hernanponcedeleon/dat3m", "text": "private StoreExclusive(StoreExclusive other) { super(other); this.register = other.register; }", "tokens": 23} {"id": 241052, "source": "method", "repo": "hernanponcedeleon/dat3m", "text": "public PTXAtomExch(Register register, Expression address, Expression value, String mo) { super(register, address, value, mo); }", "tokens": 32} {"id": 241314, "source": "method", "repo": "hernanponcedeleon/dat3m", "text": "public boolean contains(Edge edge) { return containsById(edge.getFirst(), edge.getSecond()); }", "tokens": 22} {"id": 241354, "source": "method", "repo": "hernanponcedeleon/dat3m", "text": "public Object[] toArray() { return Arrays.copyOf(array, numElements); }", "tokens": 19} {"id": 241470, "source": "method", "repo": "hernanponcedeleon/dat3m", "text": "public Coherence visitCoherence(Coherence co) { return new Coherence(translate(co.getDefinedRelation())); }", "tokens": 29} {"id": 241496, "source": "method", "repo": "hernanponcedeleon/dat3m", "text": "public static Iterable data() throws IOException { try (Stream fileStream = Files.walk(getTestResourcePath(\"arrays/error/\"))) { return fileStream .filter(Files::isRegularFile) .filter(f -> hasExtension(f, EXTENSION_LITMUS)) .map(f -> new Object[]{f}) .collect(Collectors.toList()); } }", "tokens": 86} {"id": 241529, "source": "method", "repo": "hernanponcedeleon/dat3m", "text": "public static Iterable data() { return Arrays.asList(new Object[][]{ {\"ttas\", C11, UNKNOWN}, {\"ttas-acq2rx\", C11, FAIL}, {\"ttas-rel2rx\", C11, FAIL}, {\"ticketlock\", C11, PASS}, {\"ticketlock-acq2rx\", C11, FAIL}, {\"ticketlock-rel2rx\", C11, FAIL}, {\"mutex\", C11, UNKNOWN}, {\"mutex-acq2rx_futex\", C11, UNKNOWN}, {\"mutex-acq2rx_lock\", C11, FAIL}, {\"mutex-rel2rx_futex\", C11, UNKNOWN}, {\"mutex-rel2rx_unlock\", C11, FAIL}, {\"spinlock\", C11, PASS}, {\"spinlock-acq2rx\", C11, FAIL}, {\"spinlock-rel2rx\", C11, FAIL}, // For most models the one below is safe (UNKNOWN) // It could be the case for C11 is unsafe (because it is weaker) // but we are not 100% sure about this {\"linuxrwlock\", C11, FAIL}, {\"mutex_musl\", C11, UNKNOWN}, {\"mutex_musl-acq2rx_futex\", C11, UNKNOWN}, {\"mutex_musl-acq2rx_lock\", C11, FAIL}, {\"mutex_musl-rel2rx_futex\", C11, UNKNOWN}, {\"mutex_musl-rel2rx_unlock\", C11, FAIL}, {\"seqlock\", C11, PASS}, {\"clh_mutex\", C11, UNKNOWN}, {\"clh_mutex-acq2rx\", C11, FAIL}, {\"ticket_awnsb_mutex\", C11, PASS}, {\"ticket_awnsb_mutex-acq2rx\", C11, FAIL}, {\"pthread_mutex\", C11, PASS}, }); }", "tokens": 511} {"id": 241541, "source": "method", "repo": "hernanponcedeleon/dat3m", "text": "protected EnumSet getTestedProperties() { return EnumSet.of(PROGRAM_SPEC, TERMINATION, CAT_SPEC); }", "tokens": 30} {"id": 241682, "source": "method", "repo": "hifly81/kafka-examples", "text": "private static void pollAutoCommit() { Properties props = new Properties(); props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, BROKER_LIST); props.put(\"schema.registry.url\", CONFLUENT_SCHEMA_REGISTRY_URL); props.put(ConsumerConfig.GROUP_ID_CONFIG, UUID.randomUUID().toString()); props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, \"earliest\"); props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, KafkaAvroDeserializer.class); props.put(KafkaAvroDeserializerConfig.SPECIFIC_AVRO_READER_CONFIG, true); KafkaConsumer consumer = new KafkaConsumer<>(props); new ConsumerInstance( \"1\", TOPIC, consumer, 100, -1, true, false, true, new ConsumerHandle(null)).consume(); }", "tokens": 211} {"id": 241765, "source": "method", "repo": "hifly81/kafka-examples", "text": "public void process(ConsumerRecords consumerRecords, String groupId, String consumerId) { for (ConsumerRecord record : consumerRecords) { OrderEvent orderEvent = (OrderEvent) record.value(); log.info(\"Received record from kafka {}\", record.key()); //ShipmentClient shipmentClient = new ShipmentClient(); //shipmentClient.sendOrderEvent(REST_SHIPMENT_URI, orderEvent); } }", "tokens": 99} {"id": 241836, "source": "method", "repo": "hifly81/kafka-examples", "text": "public static void bunchOfFFMessages(String topic, JsonProducer baseProducer) { for (int i= 0; i < 10; i++ ) baseProducer.produceFireAndForget(new ProducerRecord<>(topic, new CustomData(i))); baseProducer.stop(); }", "tokens": 62} {"id": 241858, "source": "method", "repo": "hifly81/kafka-examples", "text": "public void testProduceAsync() throws IOException { StringProducer baseProducer = new StringProducer(); final MockProducer mockProducer = new MockProducer<>(true, null, new StringSerializer(), new StringSerializer()); baseProducer.start(mockProducer); final ProducerRecord producerRecord1 = new ProducerRecord<>(\"topicOut\", \"foo\", \"bar\"); final ProducerRecord producerRecord2 = new ProducerRecord<>(\"topicOut\", null, \"test\"); baseProducer.produceAsync(producerRecord1, new ProducerCallback()); baseProducer.produceAsync(producerRecord2, new ProducerCallback()); final List> expectedList = Arrays.asList(KeyValue.pair(\"foo\", \"bar\"), KeyValue.pair(null,\"test\")); final List> actualList = mockProducer.history().stream().map(this::toKeyValue).collect(Collectors.toList()); assertThat(actualList, equalTo(expectedList)); }", "tokens": 207} {"id": 241920, "source": "method", "repo": "hifly81/kafka-examples", "text": "public Topology createTopology( String inputTopic, String outputTopic) { StreamsBuilder builder = new StreamsBuilder(); KStream inputStream = builder.stream(inputTopic); KTable, Long> windowedCounts = inputStream .groupByKey() .windowedBy(TimeWindows.ofSizeWithNoGrace(Duration.ofMinutes(5))) .count(Materialized.as(Stores.persistentWindowStore( \"rocksdb-windowed-count-store\", Duration.ofMinutes(5), Duration.ofMinutes(1), false)) .withKeySerde(Serdes.String()) .withValueSerde(Serdes.Long())); windowedCounts.toStream().to(outputTopic, Produced.with(WindowedSerdes.timeWindowedSerdeFrom(String.class, 1), Serdes.Long())); return builder.build(); }", "tokens": 201} {"id": 241932, "source": "method", "repo": "hifly81/kafka-examples", "text": "public Processor get() { return new JSONArrayRemoveProcessor(\"id\"); }", "tokens": 25} {"id": 242070, "source": "method", "repo": "himitzh/hoj", "text": "public RedisStandaloneConfiguration jedisConfig() { RedisStandaloneConfiguration config = new RedisStandaloneConfiguration(); config.setHostName(Optional.ofNullable(jedisPoolConfigure.getHost()).orElseGet(() -> redisHost)); config.setPort(Optional.ofNullable(jedisPoolConfigure.getPort()).orElseGet(() -> redisPort)); config.setPassword(RedisPassword.of(Optional.ofNullable(jedisPoolConfigure.getPassword()).orElseGet(() -> redisPassword))); return config; }", "tokens": 93} {"id": 242109, "source": "method", "repo": "himitzh/hoj", "text": "public void downloadContestRank(@RequestParam(\"cid\") Long cid, @RequestParam(\"forceRefresh\") Boolean forceRefresh, @RequestParam(value = \"removeStar\", defaultValue = \"false\") Boolean removeStar, @RequestParam(value = \"containEnd\", defaultValue = \"false\") Boolean isContainsAfterContestJudge, HttpServletResponse response) throws StatusFailException, IOException, StatusForbiddenException { contestFileService.downloadContestRank(cid, forceRefresh, removeStar, isContainsAfterContestJudge, response); }", "tokens": 106} {"id": 242122, "source": "method", "repo": "himitzh/hoj", "text": "public CommonResult addContestAnnouncement(@RequestBody AnnouncementDTO announcementDto) { return groupContestAnnouncementService.addContestAnnouncement(announcementDto); }", "tokens": 33} {"id": 242213, "source": "method", "repo": "himitzh/hoj", "text": "private boolean checkListDiff(List list1, List list2) { if (list1.size() != list2.size()) { return true; } return !list1.toString().equals(list2.toString()); }", "tokens": 55} {"id": 242360, "source": "method", "repo": "himitzh/hoj", "text": "public CommonResult register(RegisterDTO registerDto) { try { passportManager.register(registerDto); return CommonResult.successResponse(); } catch (StatusFailException e) { return CommonResult.errorResponse(e.getMessage()); } catch (StatusAccessDeniedException e) { return CommonResult.errorResponse(e.getMessage(), ResultStatus.ACCESS_DENIED); } }", "tokens": 74} {"id": 242429, "source": "method", "repo": "himitzh/hoj", "text": "public PasswordCallback getPasswordCallback() { return this.passwordCallback; }", "tokens": 17} {"id": 242487, "source": "method", "repo": "himitzh/hoj", "text": "protected String getSubmitUrl(String contestNum) { return IMAGE_HOST + \"/gym/\" + contestNum + \"/submit\"; }", "tokens": 32} {"id": 242534, "source": "method", "repo": "HiveGamesOSS/Chunker", "text": "public boolean shouldAllowNBTCopying() { return allowNBTCopying; }", "tokens": 17} {"id": 242666, "source": "method", "repo": "HiveGamesOSS/Chunker", "text": "/** Get the rotation 0-15 which this skull is rotated. @return the rotation value. */ public byte getRotation() { return rotation; }", "tokens": 33} {"id": 242711, "source": "method", "repo": "HiveGamesOSS/Chunker", "text": "/** Check whether a database key identifies column data used during chunk discovery. @param key the database key. @return true if the key has a supported column type and layout. */ public static boolean isColumnKey(byte[] key) { int length = key.length; if (length != 9 && length != 10 && length != 13 && length != 14) return false; if (LevelDBKey.startsWith(key, LevelDBKey.MAP_PREFIX) || LevelDBKey.startsWith(key, LevelDBKey.ACTOR_PREFIX) || LevelDBKey.startsWith(key, LevelDBKey.DIGP_PREFIX) || Arrays.equals(key, LevelDBKey.LOCAL_PLAYER)) { return false; } boolean subChunk = length == 10 || length == 14; byte type = key[subChunk ? length - 2 : length - 1]; if (subChunk) return type == LevelDBChunkType.SUB_CHUNK_PREFIX.getId(); return type == LevelDBChunkType.DATA_2D.getId() || type == LevelDBChunkType.DATA_3D.getId() || type == LevelDBChunkType.ENTITY.getId() || type == LevelDBChunkType.BLOCK_ENTITY.getId(); }", "tokens": 270} {"id": 242734, "source": "method", "repo": "HiveGamesOSS/Chunker", "text": "public Object readCustomLevelSetting(@NotNull CompoundTag root, @NotNull ChunkerLevelSettings chunkerLevelSettings, @NotNull String targetName, @NotNull Class type) { // Check for R20 support if (targetName.equals(\"R20Support\")) { // Check experiment CompoundTag experiments = root.getCompound(\"experiments\"); if (experiments == null) return false; // If the byte is set next update is enabled return experiments.getByte(\"next_major_update\", (byte) 0) == (byte) 1; } return super.readCustomLevelSetting(root, chunkerLevelSettings, targetName, type); }", "tokens": 137} {"id": 242865, "source": "method", "repo": "HiveGamesOSS/Chunker", "text": "public JavaResolversBuilder buildResolvers(Converter converter) { Version version = getVersion(); // Use modern item / block resolvers return super.buildResolvers(converter) .entityResolverConstructor((resolvers) -> new JavaEntityResolver(version, resolvers)) .blockEntityResolverConstructor((resolvers) -> new JavaBlockEntityResolver(version, resolvers)) .itemStackResolverConstructor(JavaItemStackResolver::new) .paintingMotiveResolver(new JavaPaintingMotiveResolver(version)) .itemIdentifierResolver(new JavaItemIdentifierResolver(converter, version, isReader())) .blockIdentifierResolver(new JavaBlockIdentifierResolver(converter, version, isReader(), converter.shouldAllowCustomIdentifiers())) .preTransformManager(isReader() ? new JavaReaderPreTransformManager(version) : new JavaWriterPreTransformManager(version)); }", "tokens": 177} {"id": 242866, "source": "method", "repo": "HiveGamesOSS/Chunker", "text": "public ColumnWriter(JavaWorldWriter parent, Converter converter, JavaResolvers resolvers, Dimension dimension) { super(parent, converter, resolvers, dimension); }", "tokens": 34} {"id": 242980, "source": "method", "repo": "HiveGamesOSS/Chunker", "text": "/** Get the region this chunk co-ordinate pair is inside. @return a new region co-ord pair. */ public RegionCoordPair getRegion() { return new RegionCoordPair(regionX(), regionZ()); }", "tokens": 46} {"id": 243043, "source": "method", "repo": "HiveGamesOSS/Chunker", "text": "/** Set the direction of the portal in the Z axis (1, 0, -1). @param za the direction, either 1, 0 or -1. */ public void setZa(byte za) { this.za = za; }", "tokens": 58} {"id": 243091, "source": "method", "repo": "HiveGamesOSS/Chunker", "text": "public void writeBytes(byte[] value) throws IOException { dataOutput.write(value); }", "tokens": 21} {"id": 243123, "source": "method", "repo": "HiveGamesOSS/Chunker", "text": "/** Add a value to the list tag, when the internal list isn't initialized it will use the type of this value. @param value the new value to add @return whether the add was successful based on the backing list. */ public boolean add(T value) { if (this.value == null) { this.value = new ObjectArrayList<>(1); listType = (TagType) value.getType(); } return this.value.add(value); }", "tokens": 102} {"id": 243181, "source": "method", "repo": "HiveGamesOSS/Chunker", "text": "public void validateWriterInheritance() { MockConverter mockConverter = new MockConverter(null); // BedrockEncoders should inherit from the previous, this ensures that fallback behaviour can be implemented Class lastLevelWriter = BedrockLevelWriter.class; Class lastWorldWriter = BedrockWorldWriter.class; Class lastColumnWriter = BedrockColumnWriter.class; Class lastChunkWriter = BedrockChunkWriter.class; // Loop through every data version for (BedrockDataVersion dataVersion : getBedrockDataVersions()) { Version version = dataVersion.getVersion(); BedrockEncoders.BedrockEncoder bedrockEncoder = BedrockEncoders.getNearestEncoder(dataVersion); if (bedrockEncoder == null) continue; // Check level reader BedrockLevelWriter levelWriter = bedrockEncoder.writerConstructor().construct(null, version, mockConverter); assertInstanceOf(lastLevelWriter, levelWriter, \"LevelWriter \" + levelWriter.getClass() + \" should extend \" + lastLevelWriter); lastLevelWriter = levelWriter.getClass(); // Check world reader BedrockWorldWriter worldWriter = levelWriter.createWorldWriter(); assertInstanceOf(lastWorldWriter, worldWriter, \"WorldWriter \" + worldWriter.getClass() + \" should extend \" + lastWorldWriter); lastWorldWriter = worldWriter.getClass(); // Check column reader BedrockColumnWriter columnWriter = worldWriter.createColumnWriter(null); assertInstanceOf(lastColumnWriter, columnWriter, \"ColumnWriter \" + columnWriter.getClass() + \" should extend \" + lastColumnWriter); lastColumnWriter = columnWriter.getClass(); // Check chunk reader BedrockChunkWriter chunkWriter = columnWriter.createChunkWriter(null); assertInstanceOf(lastChunkWriter, chunkWriter, \"ChunkWriter \" + chunkWriter.getClass() + \" should extend \" + lastChunkWriter); lastChunkWriter = chunkWriter.getClass(); } }", "tokens": 400} {"id": 243299, "source": "method", "repo": "HiveGamesOSS/Chunker", "text": "public void testFenceGates() { checkGroup(\"FENCE_GATES\", ChunkerVanillaBlockGroups.FENCE_GATES, (type) -> { return type instanceof ChunkerVanillaBlockType vanillaBlockType && vanillaBlockType.name().endsWith(\"_FENCE_GATE\"); }); }", "tokens": 58} {"id": 243400, "source": "method", "repo": "hncboy/chatgpt-web-java", "text": "public void onOpen(@NotNull EventSource eventSource, @NotNull Response response) { for (AbstractStreamListener listener : listeners) { listener.onInit(); } }", "tokens": 35} {"id": 243421, "source": "method", "repo": "hncboy/chatgpt-web-java", "text": "public R> list(@Validated RoomMsgCursorQuery cursorQuery) { return R.data(roomWxqfChatMsgService.list(cursorQuery)); }", "tokens": 44} {"id": 243844, "source": "method", "repo": "hoangtien2k3/ecommerce-microservices", "text": "public CartDto update(Integer cartId, CartDto cartDto) { log.info(\"CartDto, service; update cart with cartId\"); CartDto existingCartDto = findById(cartId); modelMapper.map(cartDto, existingCartDto); return CartMappingHelper.map(cartRepository.save(CartMappingHelper.map(existingCartDto))); }", "tokens": 82} {"id": 243846, "source": "method", "repo": "hoangtien2k3/ecommerce-microservices", "text": "public List findAll() { log.info(\"OrderDto List, service; fetch all orders\"); return orderRepository.findAll() .stream() .map(OrderMappingHelper::map) .peek(orderDto -> { try { orderDto.setProductDto(callAPI.receiverProductDto(orderDto.getProductId())); } catch (Exception e) { log.error(\"Error fetching product info: {}\", e.getMessage()); } }) .toList(); }", "tokens": 102} {"id": 243981, "source": "method", "repo": "hoangtien2k3/ecommerce-microservices", "text": "public ResponeStatusVm deleteRating(long ratingId) { Rating rating = ratingRepository.findById(ratingId) .orElseThrow(() -> new NotFoundException(Constants.ErrorCode.RATING_NOT_FOUND, ratingId)); ratingRepository.delete(rating); return new ResponeStatusVm(\"Delete Rating\", Constants.Message.SUCCESS_MESSAGE, HttpStatus.OK.toString()); }", "tokens": 85} {"id": 244070, "source": "method", "repo": "horizenofficial/zencash-swing-wallet-ui", "text": "/** Creates a new JsonArray that contains the JSON representations of the given strings. @param strings the strings to be included in the new JSON array @return a new JSON array that contains the given strings */ public static JsonArray array(String... strings) { if (strings == null) { throw new NullPointerException(\"values is null\"); } JsonArray array = new JsonArray(); for (String value : strings) { array.add(value); } return array; }", "tokens": 96} {"id": 244272, "source": "method", "repo": "horizenofficial/zencash-swing-wallet-ui", "text": "public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } Location other = (Location)obj; return offset == other.offset && column == other.column && line == other.line; }", "tokens": 73} {"id": 244295, "source": "method", "repo": "horizenofficial/zencash-swing-wallet-ui", "text": "public void write(String str, int off, int len) throws IOException { if (fill > buffer.length - len) { flush(); if (len > buffer.length) { writer.write(str, off, len); return; } } str.getChars(off, off + len, buffer, fill); fill += len; }", "tokens": 73} {"id": 244354, "source": "method", "repo": "horizenofficial/zencash-swing-wallet-ui", "text": "/** Returns the current state of the suspension flag. @return the current state of the suspension flag. */ public synchronized boolean isSuspended() { return this.suspended; }", "tokens": 41} {"id": 244357, "source": "method", "repo": "horizenofficial/zencash-swing-wallet-ui", "text": "private void doOneGathering() { // The gathering itself is not synchronized T localData = null; try { localData = this.gatherer.gatherData(); } catch (Exception e) { if (!this.suspended) { Log.error(\"Unexpected error: \", e); if (this.errorReporter != null) { this.errorReporter.reportError(e); } } else { Log.info(\"DataGatheringThread: ignoring \" + e.getClass().getName() + \" due to suspension!\"); } } synchronized (this) { this.lastGatheredData = localData; } }", "tokens": 128} {"id": 244360, "source": "method", "repo": "horizenofficial/zencash-swing-wallet-ui", "text": "public DropdownComboBox(E[] list) { super(list); this.isMenuDown = false; this.initDownListener(); }", "tokens": 30} {"id": 244411, "source": "method", "repo": "horizenofficial/zencash-swing-wallet-ui", "text": "private static boolean checkSHA256(File provingKey, Component parent) throws IOException { MessageDigest sha256; try { sha256 = MessageDigest.getInstance(\"SHA-256\"); } catch (NoSuchAlgorithmException impossible) { throw new IOException(impossible); } try (InputStream is = new BufferedInputStream(new FileInputStream(provingKey))) { ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(parent, LanguageUtil.instance().getString(\"proving.key.fetcher.option.pane.verify.progress.monitor.text\"), is); pmis.getProgressMonitor().setMaximum(PROVING_KEY_SIZE); pmis.getProgressMonitor().setMillisToPopup(10); DigestInputStream dis = new DigestInputStream(pmis, sha256); byte [] temp = new byte[0x1 << 13]; while(dis.read(temp) >= 0); byte [] digest = sha256.digest(); return SHA256.equalsIgnoreCase(Util.bytesToHex(digest)); } }", "tokens": 222} {"id": 244480, "source": "method", "repo": "horizenofficial/zencash-swing-wallet-ui", "text": "public synchronized String[] getWalletPublicAddressesWithUnspentOutputs() throws WalletCallException, IOException, InterruptedException { JsonArray jsonUnspentOutputs = executeCommandAndGetJsonArray(\"listunspent\", \"0\"); Set addresses = new HashSet<>(); for (int i = 0; i < jsonUnspentOutputs.size(); i++) { JsonObject outp = jsonUnspentOutputs.get(i).asObject(); addresses.add(outp.getString(\"address\", \"ERROR!\")); } return addresses.toArray(new String[0]); }", "tokens": 114} {"id": 244670, "source": "method", "repo": "horizenofficial/zencash-swing-wallet-ui", "text": "public void writeNewReceivedMessageForContact(MessagingIdentity contact, Message msg) throws IOException { // Find the contact SingleContactStorage contactStorage = null; for (SingleContactStorage scs : this.contactsList) { if (scs.getIdentity().isIdenticalTo(contact)) { contactStorage = scs; } } contactStorage.receivedMessages.writeNewMessage(msg); }", "tokens": 84} {"id": 244713, "source": "method", "repo": "houko/springbootunity", "text": "public static boolean isAuthorized(HttpSession session) { String currentUser = (String) session.getAttribute(\"currentUser\"); return !(currentUser == null || currentUser.isEmpty()); }", "tokens": 35} {"id": 244775, "source": "method", "repo": "houko/springbootunity", "text": "public static String getFormatDate(Long date, String pattern) { SimpleDateFormat format = new SimpleDateFormat(pattern); return format.format(date); }", "tokens": 33} {"id": 244822, "source": "method", "repo": "houko/springbootunity", "text": "public GroupedOpenApi javaseApi() { return GroupedOpenApi.builder() .group(\"javase\") .packagesToScan(\"info.xiaomo.javase\") .build(); }", "tokens": 42} {"id": 245163, "source": "method", "repo": "however-yir/knowledgeops-agent", "text": "public IngestionJobVO getJob(@PathVariable String jobId) { IngestionJob job = ingestionService.getByJobId(currentTenantId(), jobId); if (job == null) { throw new ResponseStatusException(HttpStatus.NOT_FOUND, \"job not found\"); } return toVO(job); }", "tokens": 64} {"id": 245291, "source": "method", "repo": "however-yir/knowledgeops-agent", "text": "private double scoreDoc(Set promptTokens, Document doc) { Set docTokens = tokenize(doc.getFormattedContent()); if (docTokens.isEmpty()) { return 0.0; } long overlap = promptTokens.stream().filter(docTokens::contains).count(); return (double) overlap / docTokens.size(); }", "tokens": 77} {"id": 245400, "source": "method", "repo": "however-yir/knowledgeops-agent", "text": "private AgentSessionStateRecord findRecord(String tenantId, String sessionId) { if (!StringUtils.hasText(sessionId)) { throw new IllegalArgumentException(\"session id is required\"); } AgentSessionStateRecord record = agentSessionStateMapper.findByTenantAndSessionId(TenantContext.normalize(tenantId), sessionId.trim()); if (record == null) { throw new IllegalArgumentException(\"session not found\"); } return record; }", "tokens": 80} {"id": 245561, "source": "method", "repo": "however-yir/knowledgeops-agent", "text": "private RequestContextFilter newFilter() { ObjectProvider tracerProvider = mock(ObjectProvider.class); when(tracerProvider.getIfAvailable()).thenReturn(null); return new RequestContextFilter(tracerProvider); }", "tokens": 44} {"id": 245640, "source": "method", "repo": "hpi-swa/trufflesqueak", "text": "private long classLargePositiveInteger() { return oopFor(context.largePositiveIntegerClass); }", "tokens": 22} {"id": 245768, "source": "method", "repo": "hpi-swa/trufflesqueak", "text": "protected static final void doCode(final CompiledCodeObject obj, final long index, final long value) { obj.atput0(index, value); }", "tokens": 35} {"id": 245783, "source": "method", "repo": "hpi-swa/trufflesqueak", "text": "protected static final ClassObject doClassOdd(final ClassObject classObject, final int extraSize, @Bind final SqueakImageContext image) { assert extraSize == 0; return new ClassObject(image, classObject, classObject.getBasicInstanceSize() + METACLASS.INST_SIZE); }", "tokens": 65} {"id": 245799, "source": "method", "repo": "hpi-swa/trufflesqueak", "text": "public Object execute(final VirtualFrame frame, final Object receiver, final Object arg1, final Object arg2, final Object arg3) { final PointersObject message = createMessageNode.execute(selector, receiver, new Object[]{arg1, arg2, arg3}); return callNode.call(FrameAccess.newMessageFallbackWith(senderNode.execute(frame), receiver, message)); }", "tokens": 83} {"id": 245801, "source": "method", "repo": "hpi-swa/trufflesqueak", "text": "protected static final Object doCached(final VirtualFrame frame, @SuppressWarnings(\"unused\") final CompiledCodeObject method, final Object receiver, final Object arg1, final Object arg2, final Object arg3, final Object arg4, @Bind final Node node, @SuppressWarnings(\"unused\") @Cached(\"method\") final CompiledCodeObject cachedMethod, @Cached(\"getOrCreateIndexedOrNamed(cachedMethod)\") final AbstractPrimitiveNode primitiveNode, @Cached final InlinedBranchProfile primitiveFailedProfile) { try { return ((Primitive4) primitiveNode).execute(frame, receiver, arg1, arg2, arg3, arg4); } catch (final PrimitiveFailed pf) { primitiveFailedProfile.enter(node); DispatchUtils.handlePrimitiveFailedIndirect(node, method, pf); return null; } }", "tokens": 173} {"id": 245961, "source": "method", "repo": "hpi-swa/trufflesqueak", "text": "public static Object add(final SqueakImageContext image, final NativeObject lhs, final NativeObject rhs) { return add(image, toBigInteger(image, lhs), toBigInteger(image, rhs)); }", "tokens": 40} {"id": 246109, "source": "method", "repo": "hpi-swa/trufflesqueak", "text": "protected static final long setHeader(final CompiledCodeObject receiver, @SuppressWarnings(\"unused\") final long index, final long value) { receiver.setHeader(value); return value; }", "tokens": 39} {"id": 246194, "source": "method", "repo": "hpi-swa/trufflesqueak", "text": "/** Offset for field: {@snippet lang=c : sqInt (*integerValueOf)(sqInt) } */ public static final long integerValueOf$offset() { return integerValueOf$OFFSET; }", "tokens": 42} {"id": 246246, "source": "method", "repo": "hpi-swa/trufflesqueak", "text": "/** Getter for field: {@snippet lang=c : sqInt (*topRemappableOop)(void) } */ public static MemorySegment topRemappableOop(MemorySegment struct) { return struct.get(topRemappableOop$LAYOUT, topRemappableOop$OFFSET); }", "tokens": 58} {"id": 246348, "source": "method", "repo": "hpi-swa/trufflesqueak", "text": "/** Layout for field: {@snippet lang=c : bool down } */ public static final OfBoolean down$layout() { return down$LAYOUT; }", "tokens": 33} {"id": 246368, "source": "method", "repo": "hpi-swa/trufflesqueak", "text": "/** Address for: {@snippet lang=c : extern SDL_IOStream *SDL_IOFromMem(void *mem, size_t size) } */ public static MemorySegment SDL_IOFromMem$address() { return MemorySegment.ofAddress(SDL_IOFromMem.addr); }", "tokens": 62} {"id": 246413, "source": "method", "repo": "hub4j/github-api", "text": "/** Gets owner. @return the owner */ public GHUser getOwner() { return owner; }", "tokens": 21} {"id": 246424, "source": "method", "repo": "hub4j/github-api", "text": "/** Gets the archive download URL. @return the archive download URL */ public URL getArchiveDownloadUrl() { return GitHubClient.parseURL(archiveDownloadUrl); }", "tokens": 33} {"id": 246494, "source": "method", "repo": "hub4j/github-api", "text": "/** Only commits after this date will be returned. @param dt the dt @return the gh commit query builder */ public GHCommitQueryBuilder since(Instant dt) { req.with(\"since\", GitHubClient.printInstant(dt)); return this; }", "tokens": 52} {"id": 246500, "source": "method", "repo": "hub4j/github-api", "text": "/** Create default InnerCommit instance */ public InnerCommit() { }", "tokens": 16} {"id": 246584, "source": "method", "repo": "hub4j/github-api", "text": "/** To string. @return the string */ public String toString() { return filterMode; }", "tokens": 21} {"id": 246622, "source": "method", "repo": "hub4j/github-api", "text": "/** Milestone gh issue query builder.

The milestone must be either an integer (the milestone number), the string * (issues with any milestone) or the string none (issues without milestone). @param milestone the milestone @return the gh issue request query builder */ public ForRepository milestone(String milestone) { req.with(\"milestone\", milestone); return this; }", "tokens": 87} {"id": 246718, "source": "method", "repo": "hub4j/github-api", "text": "/** Create default GHCommitPointer instance */ public GHCommitPointer() { }", "tokens": 16} {"id": 246843, "source": "method", "repo": "hub4j/github-api", "text": "/** Homepage for repository. @param homepage homepage of repository @return a builder to continue with building @throws IOException In case of any networking error or error from the server. */ public S homepage(URL homepage) throws IOException { return homepage(homepage.toExternalForm()); }", "tokens": 56} {"id": 246943, "source": "method", "repo": "hub4j/github-api", "text": "/** Gets the tree SHA 1. @return the tree SHA 1 */ public String getTreeSHA1() { return tree.getSha(); }", "tokens": 32} {"id": 247219, "source": "method", "repo": "hub4j/github-api", "text": "public GitHubApiResponseTransformer(GitHubWireMockRule rule) { this.rule = rule; }", "tokens": 19} {"id": 247283, "source": "method", "repo": "hube12/minemap", "text": "private static BufferedImage getScreenShot(Fragment fragment, int width, int height) { BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); DrawInfo info = new DrawInfo(0, 0, width, height); fragment.drawBiomes(image.getGraphics(), info); fragment.drawFeatures(image.getGraphics(), info); return image; }", "tokens": 80} {"id": 247504, "source": "method", "repo": "hube12/minemap", "text": "public WorldTabs() { super(ComponentOrientation.LEFT_TO_RIGHT); //Copy seed to clipboard. KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(e -> { if (e.getKeyCode() != KeyEvent.VK_C || (e.getModifiersEx() & Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()) == 0) return false; MapPanel map = this.getSelectedMapPanel(); if (map == null) return false; Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(String.valueOf(map.getContext().worldSeed)), null); return true; }); this.closeAllCurrent = new JButton(Icon.getIcon(SquareCloseButton.class, 28, 28, null)); this.closeAllCurrent.setToolTipText(\"Close current seed\"); this.closeAllCurrent.addActionListener(e -> closeTabs()); this.addSideComponent(closeAllCurrent, ButtonSide.TRAILING); this.addSideComponent(dropdown, ButtonSide.TRAILING); dropdown.addActionListener(e -> { if (dropdown.getSelected() != current && dropdown.getSelected() != null) { this.cleanSetTabGroup(dropdown.getSelected()); } }); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { WorldTabs.super.repaint(); } }); this.getJTabbedPane().addChangeListener(e -> { MapPanel mapPanel = this.getSelectedMapPanel(); if (mapPanel != null) { mapPanel.rightBar.searchBox.setVisible(!Configs.USER_PROFILE.getUserSettings().hideDockableContainer); mapPanel.rightBar.chestBox.setVisible(!Configs.USER_PROFILE.getUserSettings().hideDockableContainer); } }); this.getJTabbedPane().addMouseListener(Events.Mouse.onPressed(e -> { if (getSelectedMapPanel() == null) { KeyShortcuts.ShortcutAction.NEW_SEED.action.run(); } })); }", "tokens": 409} {"id": 247520, "source": "method", "repo": "hube12/minemap", "text": "public static void cycle(boolean isRight) { MineMap.INSTANCE.worldTabs.cycleSeed(isRight); }", "tokens": 27} {"id": 247834, "source": "method", "repo": "hube12/minemap", "text": "public Polygon getExactShape() { return null; }", "tokens": 13} {"id": 247863, "source": "method", "repo": "hube12/minemap", "text": "public Runnable newSeed() { return () -> { this.activate.run(); EnterSeedDialog dialog = new EnterSeedDialog(this.deactivate); dialog.setVisible(true); }; }", "tokens": 43} {"id": 247880, "source": "method", "repo": "hube12/minemap", "text": "public Runnable getNStructure() { return () -> { if (!this.listStructure.isEnabled()) return; this.activate.run(); JDialog dialog = new StructureListDialog(this.deactivate); dialog.setVisible(true); }; }", "tokens": 52} {"id": 248018, "source": "method", "repo": "hube12/minemap", "text": "/** Put each ant to construct a solution in the environment. */ public void constructSolutions() { // At the first step reset all ants (clearVisited) and put each one // in a random vertex of the graph. int phase = 0; for (int k = 0; k < getAntPopSize(); k++) { ants[k].clearVisited(); ants[k].startAtRandomPosition(phase); } // Make all ants choose the next non visited vertex based in the // pheromone trails and heuristic of the edge cost. while (phase < getNodesSize() - 1) { phase++; for (int k = 0; k < getAntPopSize(); k++) { ants[k].goToNNListAsDecisionRule(phase); } } // Close the circuit and calculate the total cost for (int k = 0; k < getAntPopSize(); k++) { ants[k].finishTourCircuit(); } }", "tokens": 210} {"id": 248134, "source": "method", "repo": "hube12/minemap", "text": "public TabbedPaneHeader getSelectedHeader() { if (this.getJTabbedPane().getSelectedIndex() < 0) return null; Component c = this.getJTabbedPane().getTabComponentAt(this.getJTabbedPane().getSelectedIndex()); return c instanceof TabbedPaneHeader ? (TabbedPaneHeader) c : null; }", "tokens": 63} {"id": 248139, "source": "method", "repo": "hube12/minemap", "text": "protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) { return Math.max(super.calculateTabHeight(tabPlacement, tabIndex, fontHeight), this.minHeight); }", "tokens": 46} {"id": 248272, "source": "method", "repo": "huxuehao/apboa", "text": "public R> page(StorageProtocol storageProtocol, PageParams pageParams) { return R.data(storageProtocolService.page(MP.getPage(pageParams), MP.getQueryWrapper(storageProtocol))); }", "tokens": 50} {"id": 248447, "source": "method", "repo": "huxuehao/apboa", "text": "public void run(ApplicationArguments args) { configureAgents(registry); }", "tokens": 17} {"id": 248688, "source": "method", "repo": "hypertrack/live-app-android", "text": "public void start() { show(); ((LottieAnimationView) findViewById(R.id.loader)).playAnimation(); }", "tokens": 27} {"id": 248780, "source": "method", "repo": "hypertrack/live-app-android", "text": "void addPlaceToRecent(PlaceModel placeModel) { recentPlaces.remove(placeModel); placeModel.isRecent = true; recentPlaces.add(placeModel); sharedHelper.setRecentPlaces(recentPlaces); }", "tokens": 48} {"id": 249098, "source": "method", "repo": "hypfvieh/dbus-java", "text": "public boolean isListening() { return busAddress != null && busAddress.isListeningSocket(); }", "tokens": 21} {"id": 249143, "source": "method", "repo": "hypfvieh/dbus-java", "text": "private DBusConnectionBuilder(BusAddress _address, String _machineId) { super(DBusConnectionBuilder.class, _address); machineId = _machineId; }", "tokens": 39} {"id": 249174, "source": "method", "repo": "hypfvieh/dbus-java", "text": "public String getAbstract() { return getParameterValue(ABSTRACT); }", "tokens": 14} {"id": 249181, "source": "method", "repo": "hypfvieh/dbus-java", "text": "SaslAuthMode(int _authMode) { authMode = _authMode; }", "tokens": 22} {"id": 249200, "source": "method", "repo": "hypfvieh/dbus-java", "text": "public InvalidBusAddressException(Throwable _cause) { super(_cause); }", "tokens": 18} {"id": 249240, "source": "method", "repo": "hypfvieh/dbus-java", "text": "/** Create a new {@link DBusMatchRule} using the configured values of this builder. @return {@link DBusMatchRule} @throws IllegalStateException when no rule was defined */ public DBusMatchRule build() { if (values.isEmpty() && multiValueFields.isEmpty()) { throw new IllegalStateException(\"No rules defined\"); } return new DBusMatchRule(values, multiValueFields); }", "tokens": 81} {"id": 249277, "source": "method", "repo": "hypfvieh/dbus-java", "text": "/** Ensures there are enough free buffers. @param _num number of free buffers to create. */ private void ensureBuffers(int _num) { int increase = _num - wiredata.length + bufferuse; if (increase > 0) { if (increase < BUFFERINCREMENT) { increase = BUFFERINCREMENT; } logger.trace(\"Resizing {}\", bufferuse); byte[][] temp = new byte[wiredata.length + increase][]; System.arraycopy(wiredata, 0, temp, 0, wiredata.length); wiredata = temp; } }", "tokens": 124} {"id": 249328, "source": "method", "repo": "hypfvieh/dbus-java", "text": "public static Method getPropertiesMethod(String _method, Class... _signature) { try { return Properties.class.getMethod(_method, _signature); } catch (NoSuchMethodException | SecurityException _ex) { throw new DBusExecutionException(\"Unable to get methods of DBus Properties interface\", _ex); } }", "tokens": 70} {"id": 249505, "source": "method", "repo": "hypfvieh/dbus-java", "text": "public void setUp() throws DBusException { serverconn = DBusConnectionBuilder.forSessionBus().withShared(false).build(); clientconn = DBusConnectionBuilder.forSessionBus().withShared(false).build(); serverconn.requestBusName(getTestBusName()); logger.info(\"Client-Conn UniqueID: {}, Server-Conn Unique-ID: {}\", clientconn.getUniqueName(), serverconn.getUniqueName()); tclass = new SampleClass(serverconn); /** This exports an instance of the test class as the object /Test. */ serverconn.exportObject(getTestObjectPath(), tclass); serverconn.addFallback(getTestObjectPath() + \"FallbackTest\", tclass); }", "tokens": 149} {"id": 249721, "source": "method", "repo": "hypfvieh/dbus-java", "text": "public byte[] getGroupId() { return groupId; }", "tokens": 12} {"id": 249733, "source": "method", "repo": "hypfvieh/dbus-java", "text": "protected List readFileDescriptors(SocketChannel _inputChannel) throws DBusException { if (_inputChannel instanceof AFUNIXSocketChannel afUnix) { try { FileDescriptor[] receivedFileDescriptors = afUnix.getReceivedFileDescriptors(); if (receivedFileDescriptors.length == 0) { return null; } else { List fds = new ArrayList<>(); for (FileDescriptor fd : receivedFileDescriptors) { Optional fileDescriptorValue = getSocketProviderImpl().getFileDescriptorValue(fd); fileDescriptorValue.ifPresent(f -> fds.add(new org.freedesktop.dbus.FileDescriptor(f))); } getLogger().debug(\"=> {}\", fds); return fds; } } catch (IOException _ex) { throw new DBusException(\"Cannot read file descriptors\", _ex); } } return null; }", "tokens": 194} {"id": 249810, "source": "method", "repo": "hypfvieh/dbus-java", "text": "public String getMethodPrefix() { return methodPrefix; }", "tokens": 13} {"id": 249840, "source": "method", "repo": "hypfvieh/dbus-java", "text": "public Iterator iterator() { return new SelectedTabIterator(); }", "tokens": 17} {"id": 249934, "source": "method", "repo": "hypixeldev/publicapi", "text": "public Pet(Map stats) { this.stats = stats; if (stats != null) { if (stats.get(\"experience\") != null) { experience = ((Number) stats.get(\"experience\")).intValue(); } if (stats.get(\"name\") != null) { name = (String) stats.get(\"name\"); } } updateLevel(); }", "tokens": 83} {"id": 250066, "source": "method", "repo": "hypixeldev/publicapi", "text": "public void setRateLimit(RateLimit rateLimit) { this.rateLimit = rateLimit; }", "tokens": 19} {"id": 250070, "source": "method", "repo": "hypixeldev/publicapi", "text": "/** @return When the game started */ public ZonedDateTime getStartDate() { return date; }", "tokens": 19} {"id": 250095, "source": "method", "repo": "hypixeldev/publicapi", "text": "public double getSellPrice() { return sellPrice; }", "tokens": 13} {"id": 250097, "source": "method", "repo": "hypixeldev/publicapi", "text": "public long getSellMovingWeek() { return sellMovingWeek; }", "tokens": 15} {"id": 250129, "source": "method", "repo": "hypixeldev/publicapi", "text": "public int hashCode() { return Objects.hash(type, color); }", "tokens": 16} {"id": 250359, "source": "method", "repo": "icij/extract", "text": "public void tearDown() throws Exception { client.deleteByQuery(\"*:*\"); client.commit(true, true); client.optimize(true, true); }", "tokens": 34} {"id": 250391, "source": "method", "repo": "icij/extract", "text": "/** .map(rethrowFunction(name -> Class.forName(name))) or .map(rethrowFunction(Class::forName)) */ public static Function rethrowFunction(Function_WithExceptions function) throws E { return t -> { try { return function.apply(t); } catch (Exception exception) { throwActualException(exception); return null; } }; }", "tokens": 102} {"id": 250395, "source": "method", "repo": "icij/extract", "text": "/** Add a glob pattern for including files. Files not matching the pattern will be ignored. @param pattern the glob pattern */ public void include(final String pattern) { includeGlobs.add(\"glob:\" + pattern); }", "tokens": 47} {"id": 250403, "source": "method", "repo": "icij/extract", "text": "/** Recursively walks the file tree of a directory. When hiswalking is finished or stopped by an exception, the latch is sealed and signalled. @return the path at which scanning started */ public Long call() throws Exception { final Set options; if (followLinks) { options = EnumSet.of(FileVisitOption.FOLLOW_LINKS); } else { options = EnumSet.noneOf(FileVisitOption.class); } logger.info(String.format(\"Starting scan of: \\\"%s\\\".\", path)); try { Files.walkFileTree(path, options, maxDepth, this); } catch (IOException e) { logger.error(String.format(\"Error while scanning path: \\\"%s\\\".\", path), e); throw e; } finally { if (null != latch) { latch.seal(); latch.signal(); } } if (lossyNames > 0) { logger.info(String.format(\"Completed scan of: \\\"%s\\\". %d name(s) will not survive the queue.\", path, lossyNames)); } else { logger.info(String.format(\"Completed scan of: \\\"%s\\\".\", path)); } return queued; }", "tokens": 253} {"id": 250418, "source": "method", "repo": "icij/extract", "text": "public ByteArrayOutputStream getOutputStream() { return outputStream; }", "tokens": 12} {"id": 250499, "source": "method", "repo": "icij/extract", "text": "public long ocrSubmitted() { return ocrSubmitted.get(); }", "tokens": 16} {"id": 250591, "source": "method", "repo": "icij/extract", "text": "public static Map parseScriptLanguages(String value) { Map scriptLanguages = new HashMap<>(); for (String entry : value.split(\",\")) { String[] scriptAndLanguages = entry.split(\":\", 2); if (scriptAndLanguages.length != 2 || !scriptAndLanguages[0].strip().matches(\"\\\\p{Alpha}+\") || scriptAndLanguages[1].isBlank()) { throw new IllegalArgumentException(\"ocrLanguage entry \\\"\" + entry.strip() + \"\\\" is not script:languages, for example Cyrillic:rus+ukr\"); } String languages = scriptAndLanguages[1].strip(); // Throws on what tesseract cannot read, so a bad mapping fails here rather than on every image. new TesseractOCRConfig().setLanguage(languages); scriptLanguages.put(scriptAndLanguages[0].strip(), languages); } return Map.copyOf(scriptLanguages); }", "tokens": 195} {"id": 250607, "source": "method", "repo": "icij/extract", "text": "static void restoreMediaTypes(final Metadata metadata) { restoreMediaType(metadata, CONTENT_TYPE_PARSER_OVERRIDE); restoreMediaType(metadata, Metadata.CONTENT_TYPE); }", "tokens": 38} {"id": 250609, "source": "method", "repo": "icij/extract", "text": "public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException { TesseractOCRConfig callerConfig = context.get(TesseractOCRConfig.class); restoringCallerConfig(context, callerConfig, () -> readStream(stream, handler, metadata, context)); }", "tokens": 69} {"id": 250717, "source": "method", "repo": "icij/extract", "text": "/** Create a Redis-backed set for filtering queues @param setName name of the redis key @param redisAddress redis url i.e. redis://127.0.0.1:6379 */ public RedisDocumentSet(final String setName, final String redisAddress, Class clazz) { this(Options.from(new HashMap<>() {{ put(\"redisAddress\", redisAddress); put(\"setName\", setName); }}), clazz); }", "tokens": 100} {"id": 250808, "source": "method", "repo": "icij/extract", "text": "public String toString() { return name + \"=\" + join(\",\", values.get().stream().map(Object::toString).collect(toList())); }", "tokens": 34} {"id": 250810, "source": "method", "repo": "icij/extract", "text": "public Option get(final String name, final String defaultValue) { return (Option) ofNullable(map.get(name)).orElse((Option) new Option<>(name, StringOptionParser::new).update(defaultValue)); }", "tokens": 58} {"id": 250929, "source": "method", "repo": "icij/extract", "text": "public void testParserTrackedProgressIsNotDoubleCounted() throws Exception { final ExtractionProgress progress = new ExtractionProgress(Paths.get(\"/foo.ost\"), 0L); progress.markParserTracksUnits(); // PST owns the numerator final TikaDocument root = root(\"/foo.ost\"); final EmbedSpawner spawner = new EmbedSpawner(root, progress, 0); spawner.parseEmbedded(new ByteArrayInputStream(\"msg\".getBytes(StandardCharsets.UTF_8)), new BodyContentHandler(), nonInline(\"message1.eml\"), false); assertThat(progress.unitsParsed()).isEqualTo(0L); // EmbedSpawner must not count when parser owns }", "tokens": 142} {"id": 250980, "source": "method", "repo": "icij/extract", "text": "public void testOcrPoolIsNullBeforeAnyExtractionWithOptions() { Extractor extractor = new Extractor(Options.from(Map.of(\"ocrParallelism\", \"2\"))); assertThat(extractor.ocrExecutorOrNull()).isNull(); extractor.close(); }", "tokens": 51} {"id": 251138, "source": "method", "repo": "icij/extract", "text": "public TestingRedisReportMap(RedissonClient redissonClient, String name, Charset charset) { super(redissonClient, name, charset); }", "tokens": 28} {"id": 251337, "source": "method", "repo": "idelice/jls", "text": "private int injectLogger(JCClassDecl classDecl) { var config = LombokAnnotations.configFor(root); var fieldName = config.logFieldName(); if ((classDecl.getKind() == Tree.Kind.INTERFACE || classDecl.getKind() == Tree.Kind.ANNOTATION_TYPE) || !LombokAnnotations.hasLoggingOnlyLombokAnnotation(root, classDecl.getModifiers()) || hasField(classDecl, fieldName)) { return 0; } var loggerType = loggingType(classDecl.getModifiers(), config); if (loggerType == null) return 0; classDecl.defs = classDecl.defs.append(createLogField(loggerType, fieldName)); return 1; }", "tokens": 147} {"id": 251399, "source": "method", "repo": "idelice/jls", "text": "private static boolean validateWrapper(Path wrapper) { try { var process = new ProcessBuilder() .command(wrapper.toString(), \"--version\") .directory(wrapper.getParent().toFile()) .redirectError(ProcessBuilder.Redirect.DISCARD) .redirectOutput(ProcessBuilder.Redirect.DISCARD) .start(); var exit = process.waitFor(); return exit == 0; } catch (IOException | InterruptedException e) { return false; } }", "tokens": 96} {"id": 251844, "source": "method", "repo": "idelice/jls", "text": "public void step() throws IOException, InterruptedException { launchProcess(\"Hello\"); // Attach to the process attach(5005); // Set a breakpoint at HelloWorld.java:4 setBreakpoint(\"Hello\", 4); server.configurationDone(); // Wait for stop stoppedEvents.take(); // Find the main thread var threads = server.threads().threads; for (var t : threads) { if (t.name.equals(\"main\")) { var next = new NextArguments(); next.threadId = t.id; server.next(next); // Wait for stop stoppedEvents.take(); } } // Wait for process to exit server.continue_(new ContinueArguments()); process.waitFor(); }", "tokens": 149} {"id": 251935, "source": "method", "repo": "igvteam/igv", "text": "/** Draw that portion of the alignments track overlapping visibleRect. This is the subset of the track visible in the current viewport. @param context */ public void render(RenderContext context) { int viewWindowSize = context.getReferenceFrame().getCurrentRange().getLength(); if (viewWindowSize > getVisibilityWindow()) { return; } Rectangle trackRect = context.getTrackRectangle(); Rectangle clipBounds = context.getClipBounds(); context.getGraphics2D(\"LABEL\").setFont(FontManager.getFont(GROUP_LABEL_HEIGHT)); int seqHeight = sequenceTrack == null ? 0 : sequenceTrack.getHeight(); int yOffset = seqHeight; if (clipBounds.y < seqHeight) { if (seqHeight > 0) { Rectangle seqRect = new Rectangle(0, 0, trackRect.width, seqHeight); sequenceTrack.render(context); } } // Top gap. boolean downsampled = false; if (clipBounds.y < yOffset + DS_MARGIN_0 + DOWNSAMPLED_ROW_HEIGHT) { Rectangle dsRect = new Rectangle(trackRect); dsRect.y = yOffset + DS_MARGIN_0; dsRect.height = DOWNSAMPLED_ROW_HEIGHT; downsampled = renderDownsampledIntervals(context, dsRect); } if (downsampled) { yOffset += DS_MARGIN_0 + DOWNSAMPLED_ROW_HEIGHT; this.downsampleRect = downsampleRect; } else { this.downsampleRect = null; } yOffset += DS_MARGIN_0; Rectangle alignmentsRect = new Rectangle(trackRect); alignmentsRect.y = yOffset; alignmentsRect.height -= yOffset; renderAlignments(context, alignmentsRect); }", "tokens": 363} {"id": 251950, "source": "method", "repo": "igvteam/igv", "text": "public Count getCount(int position) { Count c = counts.get(position); if (c == null) { c = new Count(); counts.put(position, c); } return c; }", "tokens": 47} {"id": 251965, "source": "method", "repo": "igvteam/igv", "text": "public int getCount(int pos, byte b) { return 0; }", "tokens": 18} {"id": 251975, "source": "method", "repo": "igvteam/igv", "text": "public boolean isMapped() { return true; }", "tokens": 11} {"id": 251988, "source": "method", "repo": "igvteam/igv", "text": "public int getBasesLength() { return length; }", "tokens": 12} {"id": 251993, "source": "method", "repo": "igvteam/igv", "text": "public int getQuality(int pos, byte b) { return 0; }", "tokens": 18} {"id": 252257, "source": "method", "repo": "igvteam/igv", "text": "public static List loadPreferenceList() throws IOException { List groupList = new ArrayList<>(); List prefList = null; BufferedReader reader = null; String nextLine; String group = null; try { reader = new BufferedReader(new InputStreamReader(PreferencesEditor.class.getResourceAsStream(\"/preferences.tab\"))); while ((nextLine = reader.readLine()) != null) { nextLine = nextLine.trim(); if (nextLine.startsWith(\"//\") || nextLine.length() == 0) { continue; } else if (nextLine.startsWith(SEPARATOR_KEY)) { prefList.add(new Preference(SEPARATOR_KEY, group)); continue; } else if (nextLine.startsWith(INFO_KEY)) { Preference preference = new Preference(INFO_KEY, nextLine.substring(INFO_KEY.length()).trim(), group); prefList.add(preference); // \"Blank\" preference continue; } else if (nextLine.startsWith(\"##\")) { group = null; // End previous group if (nextLine.length() > 2) { group = nextLine.substring(2); // New group } continue; } else if (nextLine.startsWith(\"#\")) { // New tab String[] tokens = Globals.tabPattern.split(nextLine); String tabLabel = tokens[0].substring(1); String category = tokens.length > 1 ? tokens[1] : null; prefList = new ArrayList<>(); PreferenceGroup preferenceGroup = new PreferenceGroup(tabLabel, category, prefList); groupList.add(preferenceGroup); group = null; continue; } else { String[] tokens = Globals.tabPattern.split(nextLine); if (tokens.length < 3) { if (tokens.length == 2) { // Hidden preference (not shown in editor) tokens = new String[]{tokens[0], \"\", \"\", tokens[1]}; prefList.add(new Preference(tokens, group)); } } else { prefList.add(new Preference(tokens, group)); } } } } finally { if (reader != null) reader.close(); } return groupList; }", "tokens": 443} {"id": 252477, "source": "method", "repo": "igvteam/igv", "text": "private void cancelButtonActionPerformed(ActionEvent e) { isCanceled = true; setVisible(false); dispose(); }", "tokens": 24} {"id": 252498, "source": "method", "repo": "igvteam/igv", "text": "/** Remove the token for a showWaitCursor() invocation. This indicates that the client has completed its task and removed the wait cursor request. If the last token has been removed reset the cursors on the components to their last requested cursor, or the default cursor if there are no outstanding requests. @param token */ public static void removeWaitCursor(CursorToken token) { tokens.remove(token); if (tokens.isEmpty()) { UIUtilities.invokeOnEventThread(() -> IGV.getInstance().getRootPane().getGlassPane().setVisible(false)); } }", "tokens": 115} {"id": 252526, "source": "method", "repo": "igvteam/igv", "text": "/** Draw vertical lines demarcating regions of interest. */ public void drawAllRegions(final Graphics g) { // TODO -- get rid of this ugly reference to IGV Collection regions = IGV.getInstance().getSession().getRegionsOfInterest(frame.getChrName()); if ((regions == null) || regions.isEmpty()) { return; } boolean drawBars = PreferencesManager.getPreferences().getAsBoolean(Constants.SHOW_REGION_BARS); Graphics2D graphics2D = (Graphics2D) g.create(); try { for (RegionOfInterest regionOfInterest : regions) { if (drawBars || regionOfInterest == RegionOfInterestPanel.getSelectedRegion()) { drawRegion(graphics2D, regionOfInterest); } } } finally { if (graphics2D != null) { graphics2D.dispose(); } } }", "tokens": 183} {"id": 252530, "source": "method", "repo": "igvteam/igv", "text": "public FeatureTrackSelectionDialog(Frame owner, java.util.List tracks) { super(owner, SelectionMode.SINGLE, tracks); }", "tokens": 35} {"id": 252585, "source": "method", "repo": "igvteam/igv", "text": "private ConvertFileDialog(Frame owner, String message, java.util.List chromosomes) { super(owner); this.setModal(true); initComponents(); label.setText(\"\" + message + \"\"); okButton.setText(\"Continue\"); DefaultComboBoxModel boxModel = new DefaultComboBoxModel(); for (String chrom : chromosomes){ boxModel.addElement(chrom); } chromBox.setModel(boxModel); getRootPane().setDefaultButton(okButton); }", "tokens": 102} {"id": 252588, "source": "method", "repo": "igvteam/igv", "text": "public String getExtension() { return fileExtension; }", "tokens": 12} {"id": 252725, "source": "method", "repo": "igvteam/igv", "text": "public SamQueryTextReaderTest() { }", "tokens": 11} {"id": 252906, "source": "method", "repo": "iluwatar/30-seconds-of-java", "text": "/** Find Common Characters inside given two strings. @param firstStr first string @param secondStr second string @return Common Characters. */ public static String getCommonLetters(String firstStr, String secondStr) { Set commonLetters = new HashSet<>(); for (Character currentCharacter : firstStr.toCharArray()) { if (isCommonLetter(secondStr, currentCharacter)) { commonLetters.add(currentCharacter.toString()); } } return String.join(\" \", commonLetters); }", "tokens": 108} {"id": 252948, "source": "method", "repo": "iluwatar/30-seconds-of-java", "text": "/** Test for {@link ArrayModeSnippet #ArrayModeSnippet(int[])}. */ void testModeArray() { assertEquals(List.of(2), ArrayModeSnippet.modeArray(new int[]{1, 2, 2, 3})); assertEquals(List.of(2, 3), ArrayModeSnippet.modeArray(new int[]{1, 2, 2, 3, 3})); assertEquals(List.of(1, 2, 3, 4), ArrayModeSnippet.modeArray(new int[]{1, 2, 3, 4})); assertEquals(List.of(), ArrayModeSnippet.modeArray(new int[]{})); assertEquals(List.of(-1, -2), ArrayModeSnippet.modeArray(new int[]{-1, -1, -2, -2, -3})); }", "tokens": 181} {"id": 253070, "source": "method", "repo": "im-pro-at/cncgcodecontroller", "text": "public CNCCommand(String command) { this.command = command; }", "tokens": 17} {"id": 253134, "source": "method", "repo": "im-pro-at/cncgcodecontroller", "text": "/** Returns the proper Cursor for the given area! @param area @return */ public static Cursor getCursor(EArea area){ switch(area){ case CENTER: return Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR); case RIGHT_SIDE: return Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR); case LEFT_SIDE: return Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR); case UPPER_SIDE: return Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR); case LOWER_SIDE: return Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR); case LL_CORNER: return Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR); case LR_CORNER: return Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR); case UL_CORNER: return Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR); case UR_CORNER: return Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR); default: return Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR); } }", "tokens": 223} {"id": 253240, "source": "method", "repo": "im-pro-at/cncgcodecontroller", "text": "private void jBSendActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBSendActionPerformed if(!jTFSend.getText().equals(\"\") && Communication.isConnected()) { if(Communication.isBussy()) { JOptionPane.showMessageDialog(this, \"Another command is in progress!\"); return; } try { Communication.send(jTFSend.getText()); } catch (ComInterruptException ex) { Logger.getLogger(JPanelCommunication.class.getName()).log(Level.SEVERE, null, ex); } } }", "tokens": 119} {"id": 253259, "source": "method", "repo": "im-pro-at/cncgcodecontroller", "text": "public String getText() { return super.label; }", "tokens": 12} {"id": 253337, "source": "method", "repo": "im-pro-at/cncgcodecontroller", "text": "public static void popUpToolTip(String text, JComponent element) { // build ToolTip from JComponent JToolTip toolTip = element.createToolTip(); // with the good text toolTip.setTipText(text); // get JComponent position Point point; try{ point = element.getLocationOnScreen(); } catch(Exception e){ point = new Point(); } final Popup popup = PopupFactory.getSharedInstance().getPopup(element, toolTip, point.x , point.y + element.getHeight()); // show it popup.show(); // and start a thread to remove it new Timer(5000, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { popup.hide(); } }); } }).start(); }", "tokens": 173} {"id": 253481, "source": "method", "repo": "im-pro-at/cncgcodecontroller", "text": "public boolean connect() { if(isConnected()) { System.err.println(port + \" is already connected.\"); return true; } try { RXTXPort comm = null; CommPortIdentifier ident = null; if((System.getProperty(\"os.name\").toLowerCase().indexOf(\"linux\")!=-1)){ // if ( port.toLowerCase().contains(\"rfcomm\".toLowerCase())|| // port.toLowerCase().contains(\"ttyUSB\".toLowerCase()) || // port.toLowerCase().contains(\"ttyS\".toLowerCase())|| // port.toLowerCase().contains(\"ACM\".toLowerCase()) || // port.toLowerCase().contains(\"Neuron_Robotics\".toLowerCase())|| // port.toLowerCase().contains(\"DyIO\".toLowerCase())|| // port.toLowerCase().contains(\"NR\".toLowerCase())|| // port.toLowerCase().contains(\"FTDI\".toLowerCase())|| // port.toLowerCase().contains(\"ftdi\".toLowerCase()) // ){ System.setProperty(\"gnu.io.rxtx.SerialPorts\", port); // } } ident = CommPortIdentifier.getPortIdentifier(port); try{ comm = ident.open(\"NRSerialPort\", 2000); }catch (PortInUseException e) { System.err.println(\"This is a bug, passed the ownership test above: \" + e.getMessage()); return false; } if ( !(comm instanceof RXTXPort) ) { throw new UnsupportedCommOperationException(\"Non-serial connections are unsupported.\"); } serial = (RXTXPort) comm; serial.enableReceiveTimeout(100); serial.setSerialPortParams(getBaud(), SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); setConnected(true); }catch(NativeResourceException e){ throw new NativeResourceException(e.getMessage()); }catch (Exception e) { System.err.println(\"Failed to connect on port: \"+port+\" exception: \"); e.printStackTrace(); setConnected(false); } if(isConnected()) { serial.notifyOnDataAvailable(true); } return isConnected(); }", "tokens": 453} {"id": 253496, "source": "method", "repo": "im-pro-at/cncgcodecontroller", "text": "/** @param value @return */ private static int rangeCheck(final int value) { if (value > HIGH) { return HIGH; } else if (value < LOW) { return LOW; } return value; }", "tokens": 50} {"id": 253682, "source": "method", "repo": "inaturalist/inaturalistandroid", "text": "public View getView(int position, View convertView, ViewGroup parent) { // Header (negative positions will throw an ArrayIndexOutOfBoundsException) int numHeadersAndPlaceholders = getHeadersCount() * mNumColumns ; if (position < numHeadersAndPlaceholders) { View headerViewContainer = mHeaderViewInfos .get(position / mNumColumns).viewContainer; if (position % mNumColumns == 0) { return headerViewContainer; } else { if (convertView == null) { convertView = new View(parent.getContext()); } // We need to do this because GridView uses the height of the last item // in a row to determine the height for the entire row. convertView.setVisibility(View.INVISIBLE); convertView.setMinimumHeight(headerViewContainer.getHeight()); return convertView; } } // Adapter final int adjPosition = position - numHeadersAndPlaceholders; int adapterCount = 0; if (mAdapter != null) { adapterCount = mAdapter.getCount(); if (adjPosition < adapterCount) { return mAdapter.getView(adjPosition, convertView, parent); } } throw new ArrayIndexOutOfBoundsException(position); }", "tokens": 236} {"id": 253724, "source": "method", "repo": "inaturalist/inaturalistandroid", "text": "public String formatDatetimeISONoTimezone(Timestamp date) { return DATETIME_ISO_NO_TIMEZONE_FORMAT.format(date); }", "tokens": 32} {"id": 253830, "source": "method", "repo": "inaturalist/inaturalistandroid", "text": "public ViewHolder(@NonNull View view) { super(view); username = view.findViewById(R.id.user_name); subject = view.findViewById(R.id.subject); date = view.findViewById(R.id.date); userPic = view.findViewById(R.id.user_pic); unreadIndicator = view.findViewById(R.id.unread_indicator); muteIndicator = view.findViewById(R.id.mute_indicator); flagIndicator = view.findViewById(R.id.flag_indicator); indicatorContainer = view.findViewById(R.id.indicators_container); rootView = view; }", "tokens": 135} {"id": 254048, "source": "method", "repo": "inaturalist/inaturalistandroid", "text": "public void onPause() { super.onPause(); BaseFragmentActivity.safeUnregisterReceiver(mPlaceResultsReceiver, this); }", "tokens": 26} {"id": 254283, "source": "method", "repo": "inaturalist/inaturalistandroid", "text": "public final Mode getMode() { return mMode; }", "tokens": 14} {"id": 254332, "source": "method", "repo": "inaturalist/inaturalistandroid", "text": "public PullToRefreshWebView2(Context context, Mode mode) { super(context, mode); }", "tokens": 23} {"id": 254407, "source": "method", "repo": "incendo/cloud", "text": "/** Returns the exception provider factory. @return the exception provider factory */ public ExceptionHandlerFactory exceptionHandlerFactory() { return this.exceptionHandlerFactory; }", "tokens": 32} {"id": 254438, "source": "method", "repo": "incendo/cloud", "text": "/** Returns a builder that builds {@link StandardArgumentExtractor} instances. @param extractor the extractor to copy from @return the builder */ public static ImmutableStandardArgumentExtractor.@NonNull Builder builder( final @NonNull StandardArgumentExtractor extractor ) { return ImmutableStandardArgumentExtractor.builder().from(extractor); }", "tokens": 63} {"id": 254462, "source": "method", "repo": "incendo/cloud", "text": "public String processString(final @NonNull String input) { return input; }", "tokens": 17} {"id": 254523, "source": "method", "repo": "incendo/cloud", "text": "public void commandMethod( @Argument(\"required\") final String required, @Argument(\"optional\") final String optional ) { }", "tokens": 27} {"id": 254616, "source": "method", "repo": "incendo/cloud", "text": "/** Returns a caption formatter that replaces placeholders in the form of {@code } with the caption variables. @param the command sender type @return the formatter */ static @NonNull CaptionFormatter placeholderReplacing() { return new PatternReplacingCaptionFormatter<>(placeholderPattern()); }", "tokens": 67} {"id": 254777, "source": "method", "repo": "incendo/cloud", "text": "public CompletableFuture<@Nullable Void> executeFuture( final @NonNull CommandContext commandContext ) { @MonotonicNonNull CompletableFuture<@Nullable Void> composedHandler = null; if (this.handlers.isEmpty()) { composedHandler = CompletableFuture.completedFuture(null); } else { for (final CommandExecutionHandler handler : this.handlers) { if (composedHandler == null) { composedHandler = handler.executeFuture(commandContext); } else { composedHandler = composedHandler.thenCompose( ignore -> handler.executeFuture(commandContext) ); } } } return composedHandler; }", "tokens": 125} {"id": 255018, "source": "method", "repo": "incendo/cloud", "text": "public CompletableFuture<@NonNull Suggestions> suggest( final @NonNull CommandContext context, final @NonNull String input ) { return this.suggestFromTree(context, input); }", "tokens": 44} {"id": 255221, "source": "method", "repo": "incendo/cloud", "text": "void GetOrDefault_CloudKey_ValueMissing_ReturnsDefault() { // Act final String result = this.context.getOrDefault(cloudKey(\"foo\", String.class), \"default\"); // Assert assertThat(result).isEqualTo(\"default\"); }", "tokens": 51} {"id": 255604, "source": "method", "repo": "Incendo/cloud-minecraft", "text": "/** Returns the coordinate. @return coordinate */ public double coordinate() { return this.coordinate; }", "tokens": 21} {"id": 255670, "source": "method", "repo": "Incendo/cloud-minecraft", "text": "public SinglePlayerSelector mapResult( final @NonNull String input, final SelectorUtils.@NonNull EntitySelectorWrapper wrapper ) { final Player player = wrapper.singlePlayer(); return new SinglePlayerSelector() { @Override public @NonNull Player single() { return player; } @Override public @NonNull String inputString() { return input; } }; }", "tokens": 74} {"id": 255677, "source": "method", "repo": "Incendo/cloud-minecraft", "text": "static Stream<@NonNull Arguments> Parse_HappyFlow_Success_Source() { return Stream.of( arguments(\"~ ~\", new Vector(0, 0, 0)), arguments(\"~10 ~10\", new Vector(10, 0, 10)), arguments(\"~-10 ~-10\", new Vector(-10, 0, -10)), arguments(\"^ ^\", new Vector(0, 0, 0)), arguments(\"^0 ^0\", new Vector(0, 0, 0)), arguments(\"0 0\", new Vector(0, 0, 0)), arguments(\"10 10\", new Vector(10, 0, 10)), arguments(\"-10 -10\", new Vector(-10, 0, -10)) ); }", "tokens": 181} {"id": 255976, "source": "method", "repo": "Incendo/cloud-minecraft", "text": "private static void registerBrigadierGeneric(final CommandManager commandManager, final Object brigadierManager) { // Paper 1.20+ if (commandManager.capabilities().contains(CloudBukkitCapabilities.ASYNCHRONOUS_COMPLETION) && CraftBukkitReflection.MAJOR_REVISION >= 20) { final BukkitBrigadierMapper mapper; if (commandManager instanceof BukkitCommandManager) { mapper = new BukkitBrigadierMapper<>( ((BukkitCommandManager) commandManager).owningPlugin().getLogger(), (CloudBrigadierManager) brigadierManager); } else { mapper = new BukkitBrigadierMapper<>( Logger.getLogger(((PluginMetaHolder) commandManager).owningPluginMeta().getName()), (CloudBrigadierManager) brigadierManager); } mapper.mapSimpleNMS(new TypeToken>() {}, \"message\", true); } else { SignedArguments.registerDefaultBrigadierMapping(brigadierManager); } }", "tokens": 189} {"id": 255981, "source": "method", "repo": "Incendo/cloud-minecraft", "text": "private Object toNativeAdventure(final @Nullable Component component) { if (component == null) { return null; } final JsonElement tree = GsonComponentSerializer.gson().serializeToTree(component); return this.mapper.proxies().gsonSerializerProxy.deserializeFromTree( this.mapper.proxies().gsonSerializerProxy.gson(), tree ); }", "tokens": 71} {"id": 256008, "source": "method", "repo": "Incendo/cloud-minecraft", "text": "private void registerDefaultExceptionHandlers() { this.registerDefaultExceptionHandlers( triplet -> { final CommandSource source = triplet.first().inject(CommandSource.class).orElseThrow(NullPointerException::new); final String message = triplet.first().formatCaption(triplet.second(), triplet.third()); source.sendMessage(Component.text(message, NamedTextColor.RED)); }, pair -> pair.second().printStackTrace() ); }", "tokens": 92} {"id": 256062, "source": "method", "repo": "Incendo/cloud-minecraft", "text": "private static List<@NonNull BuilderFeature> conditionalFeatures(final @NonNull CommandManager manager) { final List features = new ArrayList<>(); if (manager.hasCapability(CloudBukkitCapabilities.BRIGADIER)) { features.add(new BlockPredicateExample()); features.add(new ItemStackPredicateExample()); } try { Class.forName(\"org.bukkit.NamespacedKey\"); features.add(new NamespacedKeyExample()); } catch (final ClassNotFoundException ignored) { // We do not care. } return features; }", "tokens": 111} {"id": 256076, "source": "method", "repo": "Incendo/cloud-minecraft", "text": "public void registerFeature( final @NonNull ExamplePlugin examplePlugin, final @NonNull BukkitCommandManager manager ) { manager.command( manager.commandBuilder(\"builder\") .literal(\"summon\") .required(\"type\", enumParser(EntityType.class)) .senderType(Player.class) .handler(context -> { final Location location = context.sender().getLocation(); location.getWorld().spawnEntity(location, context.get(\"type\")); }) ); }", "tokens": 100} {"id": 256264, "source": "method", "repo": "influxdata/influxdb-client-java", "text": "/** @return the number of data point to collect in batch @see WriteOptions.Builder#batchSize(int) */ public int getBatchSize() { return batchSize; }", "tokens": 35} {"id": 256575, "source": "method", "repo": "influxdata/influxdb-client-java", "text": "public void cloneNotFound() { Assertions.assertThatThrownBy(() -> notificationEndpointsApi .cloneSlackEndpoint(\"not-found-cloned\", \"token\", \"020f755c3c082000\")) .isInstanceOf(NotFoundException.class) .hasMessage(\"HTTP status code: 404; Message: notification endpoint not found for key \\\"020f755c3c082000\\\"\"); Assertions.assertThatThrownBy(() -> notificationEndpointsApi .clonePagerDutyEndpoint(\"not-found-cloned\", \"token\", \"020f755c3c082000\")) .isInstanceOf(NotFoundException.class) .hasMessage(\"HTTP status code: 404; Message: notification endpoint not found for key \\\"020f755c3c082000\\\"\"); Assertions.assertThatThrownBy(() -> notificationEndpointsApi .cloneHTTPEndpoint(\"not-found-cloned\", \"020f755c3c082000\")) .isInstanceOf(NotFoundException.class) .hasMessage(\"HTTP status code: 404; Message: notification endpoint not found for key \\\"020f755c3c082000\\\"\"); Assertions.assertThatThrownBy(() -> notificationEndpointsApi .cloneHTTPEndpointBearer(\"not-found-cloned\", \"token\", \"020f755c3c082000\")) .isInstanceOf(NotFoundException.class) .hasMessage(\"HTTP status code: 404; Message: notification endpoint not found for key \\\"020f755c3c082000\\\"\"); Assertions.assertThatThrownBy(() -> notificationEndpointsApi .cloneHTTPEndpointBasicAuth(\"not-found-cloned\", \"username\", \"password\", \"020f755c3c082000\")) .isInstanceOf(NotFoundException.class) .hasMessage(\"HTTP status code: 404; Message: notification endpoint not found for key \\\"020f755c3c082000\\\"\"); }", "tokens": 474} {"id": 256619, "source": "method", "repo": "influxdata/influxdb-client-java", "text": "void meAuthenticated() { User me = usersApi.me(); Assertions.assertThat(me).isNotNull(); Assertions.assertThat(me.getName()).isEqualTo(\"my-user\"); }", "tokens": 38} {"id": 256695, "source": "method", "repo": "influxdata/influxdb-client-java", "text": "public void exponentialBaseMax() { RetryAttempt.setRetryRandomSupplier(() -> 1D); WriteOptions options = WriteOptions.builder() .retryInterval(5_000) .exponentialBase(2) .maxRetryDelay(Integer.MAX_VALUE) .build(); RetryAttempt retry = new RetryAttempt(new HttpException(errorResponse(429)), 1, options); Assertions.assertThat(retry.getRetryInterval()).isEqualTo(10_000L); retry = new RetryAttempt(new HttpException(errorResponse(429)), 2, options); Assertions.assertThat(retry.getRetryInterval()).isEqualTo(20_000L); retry = new RetryAttempt(new HttpException(errorResponse(429)), 3, options); Assertions.assertThat(retry.getRetryInterval()).isEqualTo(40_000L); retry = new RetryAttempt(new HttpException(errorResponse(429)), 4, options); Assertions.assertThat(retry.getRetryInterval()).isEqualTo(80_000L); retry = new RetryAttempt(new HttpException(errorResponse(429)), 5, options); Assertions.assertThat(retry.getRetryInterval()).isEqualTo(160_000L); retry = new RetryAttempt(new HttpException(errorResponse(429)), 6, options); Assertions.assertThat(retry.getRetryInterval()).isEqualTo(320_000L); retry = new RetryAttempt(new HttpException(errorResponse(429, 3)), 7, options); Assertions.assertThat(retry.getRetryInterval()).isEqualTo(3_000L); }", "tokens": 360} {"id": 256763, "source": "method", "repo": "influxdata/influxdb-client-java", "text": "void errorBodyResponseWithoutBody() { Assertions .assertThatThrownBy(() -> { throw new InfluxException(new HttpException(errorResponse(\"Wrong query\"))); }) .matches((Predicate) throwable -> ((InfluxException) throwable).errorBody().isEmpty()); }", "tokens": 61} {"id": 257102, "source": "method", "repo": "influxdata/influxdb-client-java", "text": "void fillTime() { Flux flux = Flux .from(\"telegraf\") .fill(Instant.ofEpochMilli(0)); Assertions.assertThat(flux.toString()).isEqualToIgnoringWhitespace(\"from(bucket:\\\"telegraf\\\")\\n\" + \"\\t|> fill(value:1970-01-01T00:00:00.000000000Z)\"); }", "tokens": 90} {"id": 257143, "source": "method", "repo": "influxdata/influxdb-client-java", "text": "void sortByParameters() { Flux flux = Flux .from(\"telegraf\") .sort() .withPropertyNamed(\"columns\", \"columnsParameter\") .withPropertyNamed(\"desc\", \"descParameter\"); HashMap parameters = new HashMap<>(); parameters.put(\"columnsParameter\", new String[]{\"region\", \"tag\"}); parameters.put(\"descParameter\", false); String expected = \"from(bucket:\\\"telegraf\\\") |> sort(columns: [\\\"region\\\", \\\"tag\\\"], desc: false)\"; Assertions .assertThat(flux.toString(parameters)) .isEqualToIgnoringWhitespace(expected); }", "tokens": 128} {"id": 257202, "source": "method", "repo": "influxdata/influxdb-java", "text": "private DatabaseNotFoundException(final String message) { super(message); }", "tokens": 16} {"id": 257306, "source": "method", "repo": "influxdata/influxdb-java", "text": "/** {@inheritDoc} */ public String toString() { StringBuilder builder = new StringBuilder(); builder.append(\"Series [name=\"); builder.append(this.name); builder.append(\", tags=\"); builder.append(this.tags); builder.append(\", columns=\"); builder.append(this.columns); builder.append(\", values=\"); builder.append(this.values); builder.append(\"]\"); return builder.toString(); }", "tokens": 93} {"id": 257331, "source": "method", "repo": "influxdata/influxdb-java", "text": "public int getUdpPort() { return this.udpPort; }", "tokens": 15} {"id": 257346, "source": "method", "repo": "influxdata/influxdb-java", "text": "private String parseHost(final String url) { String hostName; try { URI uri = new URI(url); hostName = uri.getHost(); } catch (URISyntaxException e1) { throw new IllegalArgumentException(\"Unable to parse url: \" + url, e1); } if (hostName == null) { throw new IllegalArgumentException(\"Unable to parse url: \" + url); } try { InetAddress.getByName(hostName); } catch (UnknownHostException e) { throw new InfluxDBIOException(e); } return hostName; }", "tokens": 112} {"id": 257377, "source": "method", "repo": "influxdata/influxdb-java", "text": "/** {@inheritDoc} */ public List describeDatabases() { QueryResult result = executeQuery(this.influxDBService.postQuery(SHOW_DATABASE_COMMAND_ENCODED)); // {\"results\":[{\"series\":[{\"name\":\"databases\",\"columns\":[\"name\"],\"values\":[[\"mydb\"]]}]}]} // Series [name=databases, columns=[name], values=[[mydb], [unittest_1433605300968]]] List> databaseNames = result.getResults().get(0).getSeries().get(0).getValues(); List databases = new ArrayList<>(); if (databaseNames != null) { for (List database : databaseNames) { databases.add(database.get(0).toString()); } } return databases; }", "tokens": 189} {"id": 257441, "source": "method", "repo": "influxdata/influxdb-java", "text": "public Alias(final Object column, final String alias) { this.column = column; this.alias = alias; }", "tokens": 27} {"id": 257587, "source": "method", "repo": "influxdata/influxdb-java", "text": "public SelectionSubQueryImpl all() { selectionCore.all(); return this; }", "tokens": 22} {"id": 257748, "source": "method", "repo": "influxdata/influxdb-java", "text": "/** Test that creating database which name contains - */ public void testCreateDatabaseWithNameContainHyphen() { this.influxDB.query(new Query(\"CREATE DATABASE \\\"123-456\\\"\")); try { List result = this.influxDB.describeDatabases(); Assertions.assertTrue(result.contains(\"123-456\")); } finally { this.influxDB.query(new Query(\"DROP DATABASE \\\"123-456\\\"\")); } }", "tokens": 98} {"id": 257822, "source": "method", "repo": "influxdata/influxdb-java", "text": "/** Tests for #267 @throws Exception */ public void testLineProtocolBigInteger() throws Exception { // GIVEN a point with nanosecond precision farther in the future than a long can hold Instant instant = Instant.EPOCH.plus(600L * 365, ChronoUnit.DAYS); Point p = Point .measurement(\"measurement\") .addField(\"foo\", \"bar\") .time(BigInteger.valueOf(instant.getEpochSecond()) .multiply(BigInteger.valueOf(1000000000L)) .add(BigInteger.valueOf(instant.getNano())), TimeUnit.NANOSECONDS) .build(); // WHEN i call lineProtocol(TimeUnit.NANOSECONDS) String nanosTime = p.lineProtocol(TimeUnit.NANOSECONDS).replace(\"measurement foo=\\\"bar\\\" \", \"\"); // THEN the timestamp is in nanoseconds assertThat(nanosTime).isEqualTo(BigInteger.valueOf(instant.getEpochSecond()) .multiply(BigInteger.valueOf(1000000000L)) .add(BigInteger.valueOf(instant.getNano())).toString()); }", "tokens": 233} {"id": 257933, "source": "method", "repo": "influxdata/influxdb-java", "text": "public void testIllegalField() { InvalidMeasure invalidMeasure = new InvalidMeasure(); invalidMeasure.setVal(new BigDecimal(\"2.3\")); assertThrows( InfluxDBMapperException.class, () -> influxDBMapper.save(invalidMeasure), \"Non supported field\"); }", "tokens": 56} {"id": 257974, "source": "method", "repo": "influxdata/influxdb-java", "text": "public void testTraverseMethod() { MessagePackTraverser traverser = new MessagePackTraverser(); /* a json-like view of msgpack_1.bin {\"results\":[{\"statement_id\":0,\"series\":[{\"name\":\"disk\",\"columns\":[\"time\",\"atag\",\"free\",\"used\"], \"values\":[[(5,0x00005b556c-252f-23-6438),\"a\",1,60],[(5,0x00005b556c-252f-23-6438),\"b\",2,70]],\"partial\":true}],\"partial\":true}]} {\"results\":[{\"statement_id\":0,\"series\":[{\"name\":\"disk\",\"columns\":[\"time\",\"atag\",\"free\",\"used\"],\"values\":[[(5,0x00005b556c-252f-23-6438),\"c\",3,80]]}]}]} */ Iterator iter = traverser.traverse(MessagePackTraverserTest.class.getResourceAsStream(\"msgpack_1.bin\")).iterator(); assertTrue(iter.hasNext()); QueryResult result = iter.next(); List> values = result.getResults().get(0).getSeries().get(0).getValues(); Assertions.assertEquals(2, values.size()); assertEquals(1532325083803052600L, values.get(0).get(0)); assertEquals(\"b\", values.get(1).get(1)); assertTrue(iter.hasNext()); result = iter.next(); values = result.getResults().get(0).getSeries().get(0).getValues(); Assertions.assertEquals(1, values.size()); assertEquals(3, values.get(0).get(2)); assertFalse(iter.hasNext()); }", "tokens": 431} {"id": 258008, "source": "method", "repo": "influxdata/influxdb-java", "text": "public void testSLimit() { Query query = new Query(\"SELECT test1 FROM foobar GROUP BY test2,test3 SLIMIT 1;\", DATABASE); Query select = select().column(\"test1\").from(DATABASE, \"foobar\").groupBy(\"test2\", \"test3\").sLimit(1); assertEquals(query.getCommand(), select.getCommand()); assertEquals(query.getDatabase(), select.getDatabase()); }", "tokens": 88} {"id": 258070, "source": "method", "repo": "ing-bank/INGenious", "text": "public List getQueryParams() { return queryParams; }", "tokens": 14} {"id": 258299, "source": "method", "repo": "ing-bank/INGenious", "text": "public void testDeleteEmulator() { Emulators em = new Emulators(tempDir.toString()); em.addEmulator(\"ToDelete\"); em.deleteEmulator(\"ToDelete\"); assertThat(em.getEmulators()).isEmpty(); }", "tokens": 46} {"id": 258352, "source": "method", "repo": "ing-bank/INGenious", "text": "public void executeTestCase(String scenarioName, String testCaseName) { executeTestCase(scenarioName, testCaseName, userData.getSubIterationAsNumber()); }", "tokens": 33} {"id": 258356, "source": "method", "repo": "ing-bank/INGenious", "text": "public Boolean elementSelected() { if (!elementDisplayed()) { throw new ElementException(ExceptionType.Element_Not_Visible, ObjectName); } return Locator.isChecked(); }", "tokens": 37} {"id": 258406, "source": "method", "repo": "ing-bank/INGenious", "text": "public void quoteRomeoAndJuliet() { try { String strObj = Input; String romeoAndJulietQuote = faker.get(key).shakespeare().romeoAndJulietQuote(); Report.updateTestLog(Action, \"Generated data: \" + romeoAndJulietQuote, Status.DONE); String sheetName = strObj.split(\":\", 2)[0]; String columnName = strObj.split(\":\", 2)[1]; userData.putData(sheetName, columnName, romeoAndJulietQuote); } catch (Exception ex) { Logger .getLogger(this.getClass().getName()) .log(Level.SEVERE, \"Exception during data generation\", ex); Report.updateTestLog( Action, \"Error generating Romeo and Juliet quote: \" + \"\\n\" + ex.getMessage(), Status.DEBUG ); } }", "tokens": 192} {"id": 258591, "source": "method", "repo": "ing-bank/INGenious", "text": "private com.ing.engine.execution.run.TestCaseRunner mockStandaloneReusable( ReusableRef.Scope scope ) { com.ing.engine.execution.run.TestCaseRunner context = mock( com.ing.engine.execution.run.TestCaseRunner.class ); when(context.scenario()).thenReturn(\"Login\"); when(context.testcase()).thenReturn(\"Step1\"); when(context.iteration()).thenReturn(\"1\"); when(context.getResolvedReusableScope()).thenReturn(scope); // Standalone run: this reusable IS its own root. when(context.getRoot()).thenReturn(context); return context; }", "tokens": 130} {"id": 258646, "source": "method", "repo": "ing-bank/INGenious", "text": "public void showAICopilot() { getGlassPane().setVisible(false); slideShow.showSlide(\"AICopilot\"); if (fxStatusBar != null) fxStatusBar.setCurrentView(\"AI Assistant\"); }", "tokens": 42} {"id": 258664, "source": "method", "repo": "ing-bank/INGenious", "text": "private void parseSse(InputStream body, StreamListener listener) throws IOException { try ( BufferedReader reader = new BufferedReader( new InputStreamReader(body, StandardCharsets.UTF_8) ) ) { String line; while ((line = reader.readLine()) != null) { if (line.isEmpty() || !line.startsWith(\"data:\")) { continue; } String data = line.substring(\"data:\".length()).trim(); if (\"[DONE]\".equals(data)) { break; } try { JsonNode chunk = mapper.readTree(data); JsonNode choices = chunk.path(\"choices\"); if (choices.isArray() && choices.size() > 0) { JsonNode content = choices.get(0).path(\"delta\").path(\"content\"); if (content.isTextual()) { listener.onToken(content.asText()); } } JsonNode usage = chunk.get(\"usage\"); if (usage != null && !usage.isNull()) { listener.onUsage(mapper.treeToValue(usage, TokenUsage.class)); } } catch (IOException ex) { LOG.log(Level.FINE, \"Skipping unparseable SSE chunk\", ex); } } } }", "tokens": 249} {"id": 258775, "source": "method", "repo": "ing-bank/INGenious", "text": "private void copyAbove() { stopCellEditing(); int row = testCaseTable.getSelectedRow(); if (row > 0) { for (int col : testCaseTable.getSelectedColumns()) { String value = Objects.toString(testCaseTable.getValueAt(row - 1, col), \"\"); testCaseTable.setValueAt(value, row, col); } } }", "tokens": 74} {"id": 258803, "source": "method", "repo": "ing-bank/INGenious", "text": "private String getScopeName(Object rootNode) { if (rootNode instanceof TestPlanNode) { return \"testplan\"; } if (rootNode instanceof ReusableNode) { return \"project\"; } if (rootNode instanceof SharedReusableNode) { return \"shared\"; } return null; }", "tokens": 58} {"id": 258848, "source": "method", "repo": "ing-bank/INGenious", "text": "protected boolean parseDoubleClickAction( String line, int lineNumber, String transaction, String prefix ) { Pattern pattern = Pattern.compile( Pattern.quote(prefix) + \"session\\\\.findById\\\\(\\\"([^\\\"]+)\\\"\\\\)\\\\.doubleClick\\\\(\\\\)\", Pattern.CASE_INSENSITIVE ); Matcher matcher = pattern.matcher(line); if (matcher.find()) { String id = matcher.group(1); addSapObject(id, \"Element\", transaction); sapActions.add(new SapAction(\"DoubleClick\", id, \"\", lineNumber)); return true; } return false; }", "tokens": 130} {"id": 258936, "source": "method", "repo": "ing-bank/INGenious", "text": "private void setSuggestionModel(ComboBoxModel mdl, String str) { setModel(mdl); setSelectedIndex(-1); textField.setText(str); }", "tokens": 37} {"id": 259108, "source": "method", "repo": "innovativeonlineindustries/industrial-foregoing", "text": "private Pair calculate(ItemStack stack) { if (stack.getItem() == Items.CRIMSON_FUNGUS || stack.getItem() == Items.CRIMSON_ROOTS || stack.getItem() == Items.WEEPING_VINES || stack.getItem() == Items.WARPED_FUNGUS || stack.getItem() == Items.WARPED_ROOTS || stack.getItem() == Items.NETHER_SPROUTS || stack.getItem() == Items.TWISTING_VINES) return Pair.of(10 * 20, 20); if (stack.getItem() == Items.SHROOMLIGHT) return Pair.of(10 * 20, 40); if (stack.getItem() == Items.NETHER_WART_BLOCK || stack.getItem() == Items.WARPED_WART_BLOCK) return Pair.of(20 * 20, 40); return Pair.of(0, 80); }", "tokens": 220} {"id": 259202, "source": "method", "repo": "innovativeonlineindustries/industrial-foregoing", "text": "public EnchantmentFactoryTile getSelf() { return this; }", "tokens": 13} {"id": 259296, "source": "method", "repo": "innovativeonlineindustries/industrial-foregoing", "text": "public BiFunction getOffsetCreation() { return offsetCreation; }", "tokens": 20} {"id": 259448, "source": "method", "repo": "innovativeonlineindustries/industrial-foregoing", "text": "public boolean mouseClicked(double mouseX, double mouseY, int button) { Screen screen = Minecraft.getInstance().screen; if (screen instanceof BasicAddonScreen basicAddonScreen) { if (isMouseOver(mouseX - basicAddonScreen.getGuiLeft(), mouseY - basicAddonScreen.getGuiTop())) { ConfirmLinkScreen.confirmLink(Minecraft.getInstance().screen, \"https://github.com/sponsors/Buuz135\").onPress(null); } } return super.mouseClicked(mouseX, mouseY, button); }", "tokens": 108} {"id": 259570, "source": "method", "repo": "innovativeonlineindustries/industrial-foregoing", "text": "public InteractionResult useOn(UseOnContext context) { ItemStack stack = context.getItemInHand(); InfinityTier infinityTier = getSelectedTier(stack); Player player = context.getPlayer(); if (infinityTier.getRadius() > 1) { Vec3 looking = player.getLookAngle(); Vec3[] all = new Vec3[]{looking, looking.yRot(0.22f), looking.yRot(-0.22f)}; for (Vec3 vector3d : all) { float f = (float) Mth.atan2(vector3d.z, vector3d.x); for (int i = 0; i < infinityTier.getRadius() * 1.5 + 1; i++) { double d2 = 1.25D * (double) (i + 1); int j = 1; this.spawnFangs(player, player.getX() + (double) Mth.cos(f) * d2, player.getZ() + (double) Mth.sin(f) * d2, player.getY() - 1, player.getY() + 1, f, j); consumeFuel(stack); } } player.getCooldowns().addCooldown(this, 12); return InteractionResult.SUCCESS; } return super.useOn(context); }", "tokens": 287} {"id": 259810, "source": "method", "repo": "innovativeonlineindustries/industrial-foregoing", "text": "public ChorusCache(Level world, BlockPos current) { this.world = world; this.chorus = new ArrayList<>(); Stack chorus = new Stack<>(); chorus.push(current); while (!chorus.isEmpty()) { BlockPos checking = chorus.pop(); if (BlockUtils.isChorus(world, checking)) { Iterable area = BlockPos.betweenClosed(checking.offset(-1, 0, -1), checking.offset(1, 1, 1)); for (BlockPos blockPos : area) { // Chorus can grow up to 22 blocks, tall - assuming it grows sideways each time as well, you have a // max distance of sqrt(22^2 + 22^2) = 31.11... // We round that up to 32 then square it to get 1024. if (blockPos.distSqr(current) > 1024) { continue; } if (BlockUtils.isChorus(world, blockPos) && !this.chorus.contains(blockPos)) { chorus.push(blockPos.immutable()); this.chorus.add(blockPos.immutable()); } } } } }", "tokens": 278} {"id": 259882, "source": "method", "repo": "inseefr/keycloak-franceconnect", "text": "static MfaRequirement getOrDefault(String mfaRequirementName, MfaRequirement defaultMfaRequirement) { for (var mfaRequirement : MfaRequirement.values()) { if (mfaRequirement.name().equalsIgnoreCase(mfaRequirementName)) { return mfaRequirement; } } return defaultMfaRequirement; }", "tokens": 65} {"id": 259944, "source": "method", "repo": "inseefr/keycloak-franceconnect", "text": "public FranceConnectIdentityProviderConfig createConfig() { return new FranceConnectIdentityProviderConfig(); }", "tokens": 22} {"id": 259962, "source": "method", "repo": "inseefr/keycloak-franceconnect", "text": "void should_initialize_config_with_selected_eidas_level_from_admin_interface() { var config = givenConfigWithSelectedEnvAndSelectedEidasLevel( \"integration_rie\", \"eidas1\" ); assertThat(config.getEidasLevel()).isEqualTo(EidasLevel.EIDAS1); config = givenConfigWithSelectedEnvAndSelectedEidasLevel( \"integration_rie\", \"eidas2\" ); assertThat(config.getEidasLevel()).isEqualTo(EidasLevel.EIDAS2); config = givenConfigWithSelectedEnvAndSelectedEidasLevel( \"integration_rie\", \"eidas3\" ); assertThat(config.getEidasLevel()).isEqualTo(EidasLevel.EIDAS3); }", "tokens": 139} {"id": 259990, "source": "method", "repo": "inseefr/keycloak-franceconnect", "text": "void should_include_only_eidas3_in_claims_param_when_mfa_enabled_with_eidas3() throws URISyntaxException { mfaConfig = givenConfigWithMfaEnabledAndEidasLevel(EidasLevel.EIDAS3.toString()); mfaConfig.setEnabled(true); mfaProvider = new AgentConnectIdentityProvider(session, mfaConfig); var request = givenAuthenticationRequest(session); var decodedQuery = URLDecoder.decode( mfaProvider.createAuthorizationUrl(request).build().getRawQuery(), StandardCharsets.UTF_8 ); assertThat(decodedQuery).contains(\"eidas3\"); assertThat(decodedQuery).doesNotContain(\"eidas0-mfa\"); assertThat(decodedQuery).doesNotContain(\"eidas1-mfa\"); assertThat(decodedQuery).doesNotContain(\"eidas2\"); }", "tokens": 167} {"id": 260149, "source": "method", "repo": "inventivetalentdev/animatedframes", "text": "public FrameManager(AnimatedFramesPlugin plugin) { this.plugin = plugin; try { this.saveDirectory = new File(new File(plugin.getDataFolder(), \"saves\"), \"frames\"); if (!this.saveDirectory.exists()) { this.saveDirectory.mkdirs(); } this.indexFile = new File(this.saveDirectory, \"index.afi\"); if (!this.indexFile.exists()) { this.indexFile.createNewFile(); } this.imageDirectory = new File(plugin.getDataFolder(), \"images\"); if (!this.imageDirectory.exists()) { this.imageDirectory.mkdirs(); } } catch (IOException e) { throw new RuntimeException(e); } }", "tokens": 145} {"id": 260183, "source": "method", "repo": "inventivetalentdev/animatedframes", "text": "public boolean contains(Vector2DInt pos) { return pos.getX() > this.min.getX() && pos.getY() > this.min.getY() && pos.getX() < this.max.getX() && pos.getY() < this.max.getY(); }", "tokens": 61} {"id": 260257, "source": "method", "repo": "inventivetalentdev/animatedframes", "text": "Country(String isoTag, String name) { this.isoTag = isoTag; this.name = name; }", "tokens": 27} {"id": 260356, "source": "method", "repo": "ipfs-shipyard/java-ipfs-http-client", "text": "public Map stat(Multihash hash) throws IOException { return retrieveMap(\"object/stat?stream-channels=true&arg=\" + hash); }", "tokens": 36} {"id": 260404, "source": "method", "repo": "ipfs-shipyard/java-ipfs-http-client", "text": "public Map listenAddrs() throws IOException { return retrieveMap(\"swarm/addrs/listen\"); }", "tokens": 23} {"id": 260431, "source": "method", "repo": "ipfs-shipyard/java-ipfs-http-client", "text": "public Map dht() throws IOException { return retrieveMap(\"stats/dht\"); }", "tokens": 20} {"id": 260646, "source": "method", "repo": "ipfs-shipyard/java-ipfs-http-client", "text": "public int hashCode() { return target != null ? target.hashCode() : 0; }", "tokens": 20} {"id": 260686, "source": "method", "repo": "ipfs-shipyard/java-ipfs-http-client", "text": "/** Determines whether the major type of a given byte value (representing an encoded {@link CborType}) equals the major type of this {@link CborType}. @param encoded the encoded CBOR type to compare. @return true if the given byte value represents the same major type as this {@link CborType}, false otherwise. */ public boolean isEqualType(int encoded) { return m_major == ((encoded & 0xff) >>> 5); }", "tokens": 107} {"id": 260914, "source": "method", "repo": "ishwi/chuu", "text": "public void setShowBotted(long discordId, boolean show_botted) { try (Connection connection = dataSource.getConnection()) { userGuildDao.setUserProperty(connection, discordId, \"show_botted\", show_botted); } catch (SQLException e) { throw new ChuuServiceException(e); } }", "tokens": 68} {"id": 260968, "source": "method", "repo": "ishwi/chuu", "text": "public int userAlbumCount(Connection connection, String lastfmId, int threshold) { String queryString = \"SELECT COUNT(*) AS numb FROM scrobbled_album WHERE scrobbled_album.lastfm_id= ? AND playnumber >= ?\"; try (PreparedStatement preparedStatement = connection.prepareStatement(queryString)) { int i = 1; preparedStatement.setString(i++, lastfmId); preparedStatement.setInt(i, threshold); /* Execute query. */ ResultSet resultSet = preparedStatement.executeQuery(); if (!resultSet.next()) return 0; return resultSet.getInt(\"numb\"); } catch (SQLException e) { throw new ChuuServiceException(e); } }", "tokens": 141} {"id": 261064, "source": "method", "repo": "ishwi/chuu", "text": "public void setUserA(String userA) { this.userA = userA; }", "tokens": 21} {"id": 261072, "source": "method", "repo": "ishwi/chuu", "text": "public int add() { return votes.incrementAndGet(); }", "tokens": 13} {"id": 261118, "source": "method", "repo": "ishwi/chuu", "text": "public String getAuthToken() throws LastFmException { String url = getSignature(BASE + GET_TOKEN + apiKey + ENDING); return doMethod(url, null, null).getString(\"token\"); }", "tokens": 46} {"id": 261359, "source": "method", "repo": "ishwi/chuu", "text": "protected CommandCategory initCategory() { return CommandCategory.BOT_STATS; }", "tokens": 17} {"id": 261548, "source": "method", "repo": "ishwi/chuu", "text": "public InnerScrobble processAlbum(InnerScrobble innerScrobble) { try (var scope = new StructuredTaskScope.ShutdownOnSuccess()) { scope.fork(() -> albumFinder.find(innerScrobble.artist(), innerScrobble.song()).orElseThrow()); scope.fork(() -> albumFinder.findSpotify(innerScrobble.artist(), innerScrobble.song()).orElseThrow()); scope.join(); Album result = scope.result(); return innerScrobble.withAlbum(result.albumName()).withImage(result.url()); } catch (InterruptedException | ExecutionException e) { Chuu.getLogger().debug(\"Error processing album\", e); return innerScrobble; } }", "tokens": 149} {"id": 261665, "source": "method", "repo": "ishwi/chuu", "text": "GuildConfigType(String command) { commandName = command; }", "tokens": 15} {"id": 261677, "source": "method", "repo": "ishwi/chuu", "text": "public boolean isNormal() { return switch (type) { case NORMAL -> true; case NATURAL -> (count == 1 && !EnumSet.of(NaturalTimeFrameEnum.MINUTE, NaturalTimeFrameEnum.SECOND, NaturalTimeFrameEnum.HOUR).contains(naturalTimeFrameEnum)); case CUSTOM -> false; }; }", "tokens": 74} {"id": 261749, "source": "method", "repo": "ishwi/chuu", "text": "public void prefixSuccesfull() { String s = \"(.*)The prefix must be one of the following:(.*)\"; OneLineUtils.testCommands(\"!prefix \u20acE\u20ac!\", Pattern.compile(s, Pattern.DOTALL), null); Pattern pattern = Pattern .compile(\"(.) is the new server prefix\"); Predicate function = matcher -> matcher.group(1).equals(\"!\"); OneLineUtils.testCommands(\"!prefix !\", pattern, function); }", "tokens": 105} {"id": 261750, "source": "method", "repo": "ishwi/chuu", "text": "public String giveCommandName() { return \"!set\"; }", "tokens": 14} {"id": 261759, "source": "method", "repo": "ishwi/chuu", "text": "public static TestAssertion text(Consumer assertion, String as) { return new TestAssertion<>(EventEmitter.SendText.class, assertion, as); }", "tokens": 46} {"id": 261832, "source": "method", "repo": "itzg/mc-image-helper", "text": "private static boolean isNotFoundResponse(String body) { try { final CurseForgeResponse resp = ObjectMappers.defaultMapper().readValue( body, new TypeReference<>() { } ); return resp.getError().startsWith(\"Error: 404\"); } catch (JsonProcessingException e) { throw new GenericException(\"Unable to parse error response\", e); } }", "tokens": 78} {"id": 261844, "source": "method", "repo": "itzg/mc-image-helper", "text": "/** @throws MissingModsException if any mods need to be manually downloaded */ private void processModpackManifest(InstallContext context, MinecraftModpackManifest modpackManifest, OverridesApplier overridesApplier ) throws IOException { final String modpackName = modpackManifest.getName(); final String modpackVersion = modpackManifest.getVersion(); // absolute value, so negative IDs don't look weird final int pseudoModId = Math.abs(modpackName.hashCode()); final int pseudoFileId = Math.abs(hashModpackFileReferences(modpackManifest.getFiles())); if (matchesPreviousInstall(context, pseudoModId, pseudoFileId)) { if (forceSynchronize) { log.info(\"Requested force synchronize of {}\", modpackName); } else if (Manifests.allFilesPresent(outputDir, context.prevInstallManifest, ignoreMissingFiles)) { log.info(\"Requested CurseForge modpack {} is already installed\", modpackName); finalizeExistingInstallation(context.prevInstallManifest); return; } else { log.warn(\"Re-installing due to missing files from modpack: {}\", Manifests.missingFiles(outputDir, context.prevInstallManifest) ); } } log.info(\"Installing modpack '{}' version {} from provided modpack zip\", modpackName, modpackVersion ); final ModPackResults results = processModpack(context, modpackManifest, overridesApplier); finalizeResults(context, results, pseudoModId, pseudoFileId, results.getName() ); }", "tokens": 309} {"id": 261977, "source": "method", "repo": "itzg/mc-image-helper", "text": "public Integer call() throws Exception { YAMLMapper yamlMapper = new YAMLMapper(); DocumentContext context = JsonPath.using(Configuration.builder() .jsonProvider(new JacksonJsonProvider(yamlMapper)) .build()).parse(yamlFile); Object result = context.read(yamlPath.startsWith(\"$\") ? yamlPath : \"$\" + yamlPath); System.out.println(result); return ExitCode.OK; }", "tokens": 89} {"id": 262157, "source": "method", "repo": "itzg/mc-image-helper", "text": "/** @param value add query parameter if not null */ public QueryParameters add(String name, String value) { if (value != null) { parameters.put(name, value); } return this; }", "tokens": 44} {"id": 262436, "source": "method", "repo": "itzg/mc-image-helper", "text": "void regexFilenameMatchesClientPack(WireMockRuntimeInfo wmInfo) { stubFor(get(urlPathEqualTo(\"/v1/mods/100/files\")) .willReturn(jsonResponse(\"\"\" { \"data\": [ { \"id\": 1, \"modId\": 100, \"fileName\": \"ATM10 To the Sky-1.5.zip\", \"isServerPack\": true }, { \"id\": 2, \"modId\": 100, \"fileName\": \"ATM10 To the Sky-1.5.1b.zip\", \"isServerPack\": false }, { \"id\": 3, \"modId\": 100, \"fileName\": \"ATM10 To the Sky-1.5.zip\", \"isServerPack\": false } ] } \"\"\", 200))); final CurseForgeMod mod = new CurseForgeMod(); mod.setId(100); final CurseForgeFile result; try (CurseForgeApiClient client = new CurseForgeApiClient( wmInfo.getHttpBaseUrl(), \"key\", Options.builder().build(), \"432\", new ApiCachingDisabled() )) { result = client.resolveModpackFile(mod, \"/-1\\\\.5\\\\.zip$/\"); } assertThat(result.getId()).isEqualTo(3); }", "tokens": 289} {"id": 262479, "source": "method", "repo": "itzg/mc-image-helper", "text": "void trimsToLimitAndSuffixes() { final TabularOutput tabOut = new TabularOutput('=', \" \", \"Mod\", \"Version Name\", \"Filename\", \"Download page\" ) .limitColumnWidth(0, 20) .trimSuffix(1, \".jar\"); tabOut.addRow( \"Tidal Towns\", \"tidal-towns-1.2.jar\", \"tidal-towns-1.2.jar\", \"https://www.curseforge.com/minecraft/mc-mods/tidal-towns/files/4723528\" ); tabOut.addRow( \"Fix Experience Bug (now with FABRIC and FORGE versions)\", \"fabric-experiencebugfix-1.20-2.jar\", \"fabric-experiencebugfix-1.20-2.jar\", \"https://www.curseforge.com/minecraft/mc-mods/fix-experience-bug/files/4561361\" ); final StringWriter writer = new StringWriter(); final PrintWriter printWriter = new PrintWriter(writer); tabOut.output(printWriter); printWriter.flush(); assertThat(writer.toString()) .isEqualToNormalizingNewlines( \"Mod Version Name Filename Download page \\n\" + \"======================= ============================== ================================== =============================================================================\\n\" + \"Tidal Towns tidal-towns-1.2 tidal-towns-1.2.jar https://www.curseforge.com/minecraft/mc-mods/tidal-towns/files/4723528 \\n\" + \"Fix Experience Bug (... fabric-experiencebugfix-1.20-2 fabric-experiencebugfix-1.20-2.jar https://www.curseforge.com/minecraft/mc-mods/fix-experience-bug/files/4561361\\n\"); }", "tokens": 440} {"id": 262577, "source": "method", "repo": "itzg/mc-image-helper", "text": "void downloadsAndInstallsModrinthModpack( WireMockRuntimeInfo wm, @TempDir Path tempDir ) throws IOException, URISyntaxException { String expectedFileData = \"some test data\"; String relativeFilePath = \"test_file\"; ModpackFile testFile = createHostedModpackFile( relativeFilePath, relativeFilePath, expectedFileData, wm.getHttpBaseUrl()); ModpackIndex index = createBasicModpackIndex(DependencyId.forge, \"111\"); index.getFiles().add(testFile); stubModrinthModpackApi( wm, projectName, projectId, projectVersion, createModrinthPack(index)); final ModloaderPreparer mockPreparer = Mockito.mock(ModloaderPreparer.class); InstallModrinthModpackCommand commandUT = createInstallModrinthModpackCommand(wm.getHttpBaseUrl(), tempDir, projectName, projectVersionId, ModpackLoader.forge, mockPreparer ); int commandStatus = commandUT.call(); assertThat(commandStatus).isEqualTo(0); assertThat(tempDir.resolve(relativeFilePath)).content() .isEqualTo(expectedFileData); Mockito.verify(mockPreparer, Mockito.times(1)) .prepare(Mockito.any(), Mockito.eq(MINECRAFT_VERSION), Mockito.eq(\"111\")); }", "tokens": 256} {"id": 262589, "source": "method", "repo": "itzg/mc-image-helper", "text": "void commaNewlineDelimited(@TempDir Path tempDir) { setupStubs(); final int exitCode = new CommandLine( new ModrinthCommand() ) .execute( \"--api-base-url\", wm.getRuntimeInfo().getHttpBaseUrl(), \"--output-directory\", tempDir.toString(), \"--game-version\", \"1.19.2\", \"--loader\", \"fabric\", \"--projects\", \"fabric-api, \\n\" + \"cloth-config\" ); assertThat(exitCode).isEqualTo(ExitCode.OK); assertThat(tempDir.resolve(\"mods/fabric-api-0.76.1+1.19.2.jar\")).exists(); assertThat(tempDir.resolve(\"mods/cloth-config-8.3.103-fabric.jar\")).exists(); }", "tokens": 162} {"id": 262627, "source": "method", "repo": "itzg/mc-image-helper", "text": "void constructorPullsProjectSlugFromFileURI(String input) { URI projectUri = Paths.get(input).toUri(); assertThat(new ProjectRef(projectUri, null).getIdOrSlug()) .isEqualTo(\"slug\"); }", "tokens": 50} {"id": 262639, "source": "method", "repo": "itzg/mc-image-helper", "text": "void pullsLayersInManifestOrderAndPrintsPaths( WireMockRuntimeInfo wm, @TempDir Path tempDir ) throws Exception { final byte[] baseLayer = \"shared base layer content\".getBytes(StandardCharsets.UTF_8); final byte[] overlayLayer = \"tech overlay content\".getBytes(StandardCharsets.UTF_8); final String baseDigest = sha256(baseLayer); final String overlayDigest = sha256(overlayLayer); final URI base = URI.create(wm.getHttpBaseUrl()); final String registry = base.getHost() + \":\" + base.getPort(); final String repository = \"owner/pack\"; stubManifest(repository, \"v1\", buildManifest(baseDigest, baseLayer.length, overlayDigest, overlayLayer.length)); stubBlob(repository, baseDigest, baseLayer); stubBlob(repository, overlayDigest, overlayLayer); final Path stage = tempDir.resolve(\"stage\"); final InstallOciPackCommand cmd = new InstallOciPackCommand(); cmd.ref = registry + \"/\" + repository + \":v1\"; cmd.outputDirectory = stage; cmd.filenameStrategy = InstallOciPackCommand.FilenameStrategy.title; cmd.setInsecure(true); final String stdout = tapSystemOutNormalized(() -> assertThat(cmd.call()).isEqualTo(ExitCode.OK)); final Path baseFile = stage.resolve(\"base.tar.gz\"); final Path overlayFile = stage.resolve(\"tech.tar.gz\"); assertThat(baseFile).exists().hasBinaryContent(baseLayer); assertThat(overlayFile).exists().hasBinaryContent(overlayLayer); final String[] printedLines = nonLogLines(stdout); assertThat(printedLines).hasSize(2); assertThat(Path.of(printedLines[0])).isEqualTo(baseFile.toAbsolutePath()); assertThat(Path.of(printedLines[1])).isEqualTo(overlayFile.toAbsolutePath()); }", "tokens": 398} {"id": 262837, "source": "method", "repo": "iyzico/iyzipay-java", "text": "public void setExpireMonth(String expireMonth) { this.expireMonth = expireMonth; }", "tokens": 21} {"id": 262854, "source": "method", "repo": "iyzico/iyzipay-java", "text": "public BigDecimal getMerchantPayoutAmount() { return merchantPayoutAmount; }", "tokens": 17} {"id": 262866, "source": "method", "repo": "iyzico/iyzipay-java", "text": "public static InstallmentInfo retrieve(RetrieveInstallmentInfoRequest request, Options options) { String path = \"/payment/iyzipos/installment\"; return HttpClient.create().post(options.getBaseUrl() + path, getHttpProxy(options), getHttpHeadersV2(path, request, options), request, InstallmentInfo.class); }", "tokens": 73} {"id": 262896, "source": "method", "repo": "iyzico/iyzipay-java", "text": "public void setConsumerToken(String consumerToken) { this.consumerToken = consumerToken; }", "tokens": 21} {"id": 262987, "source": "method", "repo": "iyzico/iyzipay-java", "text": "public String toString() { return new ToStringRequestBuilder(this) .append(\"cardHolderName\", cardHolderName) .append(\"cardNumber\", cardNumber) .append(\"expireYear\", expireYear) .append(\"expireMonth\", expireMonth) .append(\"cvc\", cvc) .append(\"cardUserKey\", cardUserKey) .append(\"cardToken\", cardToken) .toString(); }", "tokens": 94} {"id": 263016, "source": "method", "repo": "iyzico/iyzipay-java", "text": "public static Subscription retrieve(String subscriptionReferenceCode, Options options) { String path = \"/v2/subscription/subscriptions/\" + subscriptionReferenceCode; String uri = options.getBaseUrl() + path; return HttpClient.create().get(uri, getHttpProxy(options), getHttpHeadersV2(path, null, options), null, Subscription.class); }", "tokens": 74} {"id": 263052, "source": "method", "repo": "iyzico/iyzipay-java", "text": "public String getPricingPlanReferenceCode() { return pricingPlanReferenceCode; }", "tokens": 18} {"id": 263071, "source": "method", "repo": "iyzico/iyzipay-java", "text": "public Integer getRecurrenceCount() { return recurrenceCount; }", "tokens": 14} {"id": 263101, "source": "method", "repo": "iyzico/iyzipay-java", "text": "public void setEnabledInstallments(List enabledInstallments) { this.enabledInstallments = enabledInstallments; }", "tokens": 28} {"id": 263263, "source": "method", "repo": "iyzico/iyzipay-java", "text": "public UpdateSubMerchantRequestBuilder taxOffice(String taxOffice) { this.taxOffice = taxOffice; return this; }", "tokens": 25} {"id": 263318, "source": "method", "repo": "j-easy/easy-random", "text": "private T createRandomRecord(Class recordType, final RandomizationContext context) { // generate random values for record components RecordComponent[] recordComponents = recordType.getRecordComponents(); Object[] randomValues = new Object[recordComponents.length]; for (int i = 0; i < recordComponents.length; i++) { Class recordComponentType = recordComponents[i].getType(); if (recordComponentType.isRecord()) { randomValues[i] = this.createRandomRecord(recordComponentType, context); } else { randomValues[i] = this.nextObject(recordComponentType); } } // create a random instance with random values try { return getCanonicalConstructor(recordType).newInstance(randomValues); } catch (Exception e) { throw new ObjectCreationException(\"Unable to create a random instance of recordType \" + recordType, e); } }", "tokens": 191} {"id": 263417, "source": "method", "repo": "j-easy/easy-random", "text": "/** Create a new {@link LatitudeRandomizer}. */ public LatitudeRandomizer() { }", "tokens": 19} {"id": 263469, "source": "method", "repo": "j-easy/easy-random", "text": "/** Create a new {@link BigDecimalRandomizer}. @param seed initial seed */ public BigDecimalRandomizer(final long seed) { delegate = new DoubleRandomizer(seed); }", "tokens": 34} {"id": 263559, "source": "method", "repo": "j-easy/easy-random", "text": "/** Create a new {@link DateRandomizer}. */ public DateRandomizer() { delegate = new DateRangeRandomizer(toDate(EasyRandomParameters.DEFAULT_DATES_RANGE.getMin()), toDate(EasyRandomParameters.DEFAULT_DATES_RANGE.getMax())); }", "tokens": 55} {"id": 263607, "source": "method", "repo": "j-easy/easy-random", "text": "public static LocalDate convertDateToLocalDate(Date date) { return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); }", "tokens": 28} {"id": 263618, "source": "method", "repo": "j-easy/easy-random", "text": "/** Check if the type is public. @param type the type to check @param the actual type to check @return true if the type is public, false otherwise */ public static boolean isPublic(final Class type) { return Modifier.isPublic(type.getModifiers()); }", "tokens": 65} {"id": 263706, "source": "method", "repo": "j-easy/easy-random", "text": "void typedMapClassesShouldNotBeEmpty() { EasyRandom easyRandom = new EasyRandom(); final MapBean mapBean = easyRandom.nextObject(MapBean.class); assertThat(mapBean).isNotNull(); assertContainsNonZeroIntegers(mapBean.getTypedHashMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedHashMap().values()); assertContainsNonZeroIntegers(mapBean.getTypedHashtable().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedHashtable().values()); assertContainsNonZeroIntegers(mapBean.getTypedLinkedHashMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedLinkedHashMap().values()); assertContainsNonZeroIntegers(mapBean.getTypedWeakHashMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedWeakHashMap().values()); assertContainsNonZeroIntegers(mapBean.getTypedIdentityHashMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedIdentityHashMap().values()); assertContainsNonZeroIntegers(mapBean.getTypedTreeMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedTreeMap().values()); assertContainsNonZeroIntegers(mapBean.getTypedConcurrentSkipListMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedConcurrentSkipListMap().values()); }", "tokens": 256} {"id": 264047, "source": "method", "repo": "j-easy/easy-random", "text": "void testCustomExclusionPolicy() { // given EasyRandomParameters parameters = new EasyRandomParameters() .exclusionPolicy(new ExclusionPolicy() { @Override public boolean shouldBeExcluded(Field field, RandomizerContext context) { return field.getName().equals(\"birthDate\"); } @Override public boolean shouldBeExcluded(Class type, RandomizerContext context) { return type.isAssignableFrom(Address.class); } }); EasyRandom easyRandom = new EasyRandom(parameters); // when Person person = easyRandom.nextObject(Person.class); // then assertThat(person).isNotNull(); assertThat(person.getName()).isNotNull(); assertThat(person.getEmail()).isNotNull(); assertThat(person.getPhoneNumber()).isNotNull(); assertThat(person.getBirthDate()).isNull(); assertThat(person.getAddress()).isNull(); }", "tokens": 162} {"id": 264140, "source": "method", "repo": "j-easy/easy-random", "text": "void setUp() { minTime = OffsetTime.MIN; maxTime = OffsetTime.MAX; randomizer = new OffsetTimeRangeRandomizer(minTime, maxTime); }", "tokens": 38} {"id": 264148, "source": "method", "repo": "j-easy/easy-random", "text": "void generatedDateShouldBeAlwaysTheSameForTheSameSeed() { // Given randomizer = new SqlDateRangeRandomizer(minDate, maxDate, SEED); Date expected = new Date(1460448795154L); // When Date randomDate = randomizer.getRandomValue(); // Then assertThat(randomDate).isEqualTo(expected); }", "tokens": 74} {"id": 264412, "source": "method", "repo": "jabref/jabref", "text": "private void forgetDocument() { this.xTextDocument = null; }", "tokens": 15} {"id": 264423, "source": "method", "repo": "jabref/jabref", "text": "public boolean validateExpertSettings() { List validators = List.of( apiBaseUrlValidator, embeddingModelValidator, temperatureTypeValidator, temperatureRangeValidator, contextWindowSizeValidator, documentSplitterChunkSizeValidator, documentSplitterOverlapSizeValidator, ragMaxResultsCountValidator, ragMinScoreTypeValidator, ragMinScoreRangeValidator ); return validators.stream().map(Validator::getValidationStatus).allMatch(ValidationStatus::isValid); }", "tokens": 96} {"id": 264456, "source": "method", "repo": "jabref/jabref", "text": "public void storeSettings() { List enabledExternalList = new ArrayList<>(); List disabledExternalList = new ArrayList<>(); List enabledInternalList = new ArrayList<>(); List disabledInternalList = new ArrayList<>(); for (ProtectedTermsList list : termsFilesProperty.getValue().stream() .map(ProtectedTermsListItemModel::getTermsList).toList()) { if (list.isInternalList()) { if (list.isEnabled()) { enabledInternalList.add(list.getLocation()); } else { disabledInternalList.add(list.getLocation()); } } else { if (list.isEnabled()) { enabledExternalList.add(list.getLocation()); } else { disabledExternalList.add(list.getLocation()); } } } protectedTermsPreferences.setEnabledInternalTermLists(enabledInternalList); protectedTermsPreferences.setEnabledExternalTermLists(enabledExternalList); protectedTermsPreferences.setDisabledInternalTermLists(disabledInternalList); protectedTermsPreferences.setDisabledExternalTermLists(disabledExternalList); termsLoader.update(protectedTermsPreferences); }", "tokens": 223} {"id": 264474, "source": "method", "repo": "jabref/jabref", "text": "private void swap(ObservableList observableList, int i, int j) { List placeholder = new ArrayList<>(observableList); Collections.swap(placeholder, i, j); observableList.sort(Comparator.comparingInt(placeholder::indexOf)); }", "tokens": 59} {"id": 264540, "source": "method", "repo": "jabref/jabref", "text": "void appendToFieldValueShouldDoNothingIfOverwriteFieldContentIsNotEnabled() { editFieldContentViewModel.overwriteFieldContentProperty().set(false); editFieldContentViewModel.selectedFieldProperty().set(StandardField.YEAR); editFieldContentViewModel.fieldValueProperty().set(\"0\"); editFieldContentViewModel.appendToFieldValue(); assertEquals(Optional.of(\"2015\"), entryA.getField(StandardField.YEAR)); }", "tokens": 86} {"id": 264578, "source": "method", "repo": "jabref/jabref", "text": "private static List fontSizeStyleClasses(Parent parent) { return parent.getStyleClass().stream().filter(styleClass -> styleClass.startsWith(\"font-size-\")).toList(); }", "tokens": 40} {"id": 264795, "source": "method", "repo": "jabref/jabref", "text": "public static BstStyle createInternal(String resourcePath) throws IOException { try (InputStream is = BstStyle.class.getResourceAsStream(resourcePath)) { if (is == null) { throw new IOException(\"Internal BST resource not found: \" + resourcePath); } String source = new String(is.readAllBytes(), StandardCharsets.UTF_8); try { return new BstStyle(resourcePath, null, true, source, new BstVM(source)); } catch (ParseCancellationException e) { throw new IOException(\"Could not parse internal BST style: \" + resourcePath, e); } } }", "tokens": 130} {"id": 264898, "source": "method", "repo": "jabref/jabref", "text": "public int hashCode() { return Objects.hash(getName(), getHierarchicalContext(), getSearchExpression(), getSearchFlags()); }", "tokens": 26} {"id": 265358, "source": "method", "repo": "jamesmudd/jhdf", "text": "public boolean isGroup() { return true; }", "tokens": 11} {"id": 265419, "source": "method", "repo": "jamesmudd/jhdf", "text": "private JenkinsLookup3HashLittle() { throw new AssertionError(\"No instances of JenkinsLookup3HashLittle\"); }", "tokens": 23} {"id": 265455, "source": "method", "repo": "jamesmudd/jhdf", "text": "public Iterator iterator() { throw new UnsupportedOperationException(UNKNOWN_GROUP); }", "tokens": 19} {"id": 265471, "source": "method", "repo": "jamesmudd/jhdf", "text": "/** Given hypercube bounds in chunk coordinates, iterate all chunks within the hypercube. */ private List getChunkCoordinateRange(long[] start, long[] end) { List coords = new ArrayList<>(); int dims = start.length; long[] current = Arrays.copyOf(start, dims); while (true) { coords.add(Arrays.copyOf(current, dims)); int dim = dims - 1; while (dim >= 0) { current[dim]++; if (current[dim] > end[dim]) { current[dim] = start[dim]; dim--; } else { break; } } if (dim < 0) break; } return coords; }", "tokens": 153} {"id": 265490, "source": "method", "repo": "jamesmudd/jhdf", "text": "ExtensibleArrayCounter(int initialNumberOfElements) { this.minNumberOfElementsInDataBlock = initialNumberOfElements; }", "tokens": 26} {"id": 265705, "source": "method", "repo": "jamesmudd/jhdf", "text": "public boolean isAlwaysFailOnUnknownType() { return flags.get(ALWAYS_FAIL_ON_UNKNOWN_MESSAGE_TYPE); }", "tokens": 28} {"id": 265763, "source": "method", "repo": "jamesmudd/jhdf", "text": "void testInvalidSignatureThrows() { // Give address of local heap assertThrows(HdfException.class, () -> new GlobalHeap(hdfFc, 1384)); }", "tokens": 37} {"id": 265819, "source": "method", "repo": "jamesmudd/jhdf", "text": "void testOrderedGroup() { Group group = (Group) hdfFile.getByPath(ORDERED_GROUP); assertThat(group.isLinkCreationOrderTracked(), is(true)); assertThat(group.getChildren().keySet(), contains(\"z\", \"h\", \"a\")); }", "tokens": 55} {"id": 265928, "source": "method", "repo": "jamesmudd/jhdf", "text": "Collection stringDataset1DTests() { // List of all the datasetPaths return Arrays.asList( dynamicContainer(\"earliest\", Arrays.asList( dynamicTest(\"fixed ASCII\", createTest(earliestHdfFile, \"/fixed_length_ascii\")), dynamicTest(\"fixed ASCII 1 char\", createTest(earliestHdfFile, \"/fixed_length_ascii_1_char\")), dynamicTest(\"variable ASCII\", createTest(earliestHdfFile, \"/variable_length_ascii\")), dynamicTest(\"variable UTF8\", createTest(earliestHdfFile, \"/variable_length_utf8\")))), dynamicContainer(\"latest\", Arrays.asList( dynamicTest(\"fixed ASCII\", createTest(latestHdfFile, \"/fixed_length_ascii\")), dynamicTest(\"fixed ASCII 1 char\", createTest(latestHdfFile, \"/fixed_length_ascii_1_char\")), dynamicTest(\"variable ASCII\", createTest(latestHdfFile, \"/variable_length_ascii\")), dynamicTest(\"variable UTF8\", createTest(latestHdfFile, \"/variable_length_utf8\"))))); }", "tokens": 206} {"id": 265948, "source": "method", "repo": "jamesmudd/jhdf", "text": "void setUp() { outputStream = new ByteArrayOutputStream(); System.setOut(new PrintStream(outputStream)); }", "tokens": 21} {"id": 265979, "source": "method", "repo": "jamesmudd/jhdf", "text": "public long getObjectId() { return Long.parseLong(removeStart(objId, \"xid_\")); }", "tokens": 24} {"id": 266372, "source": "method", "repo": "janheinrichmerker/material-drawer", "text": "/** Attaches the drawer item to an adapter @param adapter Adapter to attach to */ public DrawerItem attachTo(ArrayAdapter adapter) { mAdapter = adapter; return this; }", "tokens": 42} {"id": 266384, "source": "method", "repo": "janheinrichmerker/material-drawer", "text": "/** Removes the avatar image from the drawer profile */ public DrawerProfile removeAvatar() { mAvatar = null; notifyDataChanged(); return this; }", "tokens": 32} {"id": 266642, "source": "method", "repo": "jaquadro/storagedrawers", "text": "public int getDrawerCount () { return drawerCount; }", "tokens": 14} {"id": 266644, "source": "method", "repo": "jaquadro/storagedrawers", "text": "/** Adds or removes a given amount from the number of items stored in this drawer. @param amount The amount to add (positive) or subtract (negative). @return 0 if the full adjustment was committed, or a positive value representing the remainder if the full amount couldn't be added or subtracted. */ default int adjustStoredItemCount (int amount) { if (amount > 0) { int insert = Math.min(amount, getRemainingCapacity()); setStoredItemCount(getStoredItemCount() + insert); return amount - insert; } else if (amount < 0) { int stored = getStoredItemCount(); int destroy = Math.min(Math.abs(amount), getStoredItemCount()); setStoredItemCount(stored - destroy); return Math.abs(amount + destroy); } else { return 0; } }", "tokens": 172} {"id": 267030, "source": "method", "repo": "jaquadro/storagedrawers", "text": "public boolean addBlacklist (ResourceLocation entry) { if (entry == null) return false; tagBlacklist.add(TagKey.create(Registries.ITEM, entry)); if (ModCommonConfig.INSTANCE.GENERAL.logStartupActivity.get()) ModServices.log.info(\"New conversion denied tag \" + entry); return true; }", "tokens": 67} {"id": 267108, "source": "method", "repo": "jaquadro/storagedrawers", "text": "protected void init () { super.init(); }", "tokens": 12} {"id": 267220, "source": "method", "repo": "jaquadro/storagedrawers", "text": "static BakedModel makeFramedComp2DrawerModel(BakedModel parentModel) { return makeFramedCompDrawerModel(parentModel, DrawerModelStore.FramedComp2DrawerMaterials); }", "tokens": 41} {"id": 267514, "source": "method", "repo": "Jarrettluo/all-docs", "text": "protected static InputStream getInFileStream(String inputFilePath) throws FileNotFoundException { File inFile = new File(inputFilePath); FileInputStream iStream = new FileInputStream(inFile); return iStream; }", "tokens": 42} {"id": 267652, "source": "method", "repo": "jarvis2f/telegram-files", "text": "private static JsonObject sessionBody(IssuedSession session) { return JsonObject.of( \"authenticated\", true, \"username\", session.principal().username(), \"idleExpiresAt\", session.principal().idleExpiresAt(), \"absoluteExpiresAt\", session.principal().absoluteExpiresAt() ); }", "tokens": 57} {"id": 267671, "source": "method", "repo": "jarvis2f/telegram-files", "text": "private void handleTelegramFilesCount(RoutingContext ctx) { boolean offline = Convert.toBool(ctx.queryParams().get(\"offline\"), false); Long telegramId = Convert.toLong(ctx.pathParam(\"telegramId\"), -1L); Long chatId = Convert.toLong(ctx.pathParam(\"chatId\"), -1L); if (offline) { if (Convert.toBool(ctx.queryParams().get(\"seedOnly\"), false)) { Map filter = new HashMap<>(); ctx.queryParams().forEach(entry -> filter.put(entry.getKey(), entry.getValue())); DataVerticle.torrentRepository.countSeedOnlyWithType(filter) .onSuccess(ctx::json) .onFailure(ctx::fail); return; } DataVerticle.fileRepository.countWithType(telegramId, chatId) .onSuccess(ctx::json) .onFailure(ctx::fail); return; } TelegramVerticle telegramVerticle = getTelegramVerticleByPath(ctx); if (telegramVerticle == null) { return; } telegramVerticle.getChatFilesCount(chatId) .onSuccess(ctx::json) .onFailure(ctx::fail); }", "tokens": 239} {"id": 267730, "source": "method", "repo": "jarvis2f/telegram-files", "text": "public JsonObject getExtraInfo() { TdApi.PhotoSize photo = content.photo.sizes[content.photo.sizes.length - 1]; return JsonObject.of(\"width\", photo.width, \"height\", photo.height, \"type\", photo.type); }", "tokens": 59} {"id": 267753, "source": "method", "repo": "jarvis2f/telegram-files", "text": "public boolean equals(Object obj) { if (obj instanceof OrderedChat(long id, TdApi.ChatPosition position1)) { return this.chatId == id && this.position.order == position1.order; } return false; }", "tokens": 51} {"id": 267754, "source": "method", "repo": "jarvis2f/telegram-files", "text": "public void initialize(Client.ResultHandler updateHandler, Client.ExceptionHandler updateExceptionHandler, Client.ExceptionHandler defaultExceptionHandler) { List pendingUpdates = new ArrayList<>(); Client.ResultHandler bufferedUpdateHandler = updateHandler == null ? null : object -> { synchronized (pendingUpdates) { if (!initialized || !pendingUpdates.isEmpty()) { pendingUpdates.add(object); return; } } updateHandler.onResult(object); }; synchronized (this) { if (!initialized) { client = Client.create(bufferedUpdateHandler, updateExceptionHandler, defaultExceptionHandler); initialized = true; } } while (true) { TdApi.Object object; synchronized (pendingUpdates) { if (pendingUpdates.isEmpty()) { return; } object = pendingUpdates.remove(0); } try { updateHandler.onResult(object); } catch (Throwable cause) { handleException(cause, updateExceptionHandler, defaultExceptionHandler); } } }", "tokens": 193} {"id": 267815, "source": "method", "repo": "jarvis2f/telegram-files", "text": "private void handleSaveAvgSpeed() { if (!authorized || telegramRecord == null) return; AvgSpeed.SpeedStats speedStats = avgSpeed.getSpeedStats(); if (speedStats.avgSpeed() == 0 && speedStats.minSpeed() == 0 && speedStats.medianSpeed() == 0 && speedStats.maxSpeed() == 0) { return; } JsonObject data = JsonObject.mapFrom(speedStats); data.remove(\"interval\"); DataVerticle.statisticRepository.create(new StatisticRecord(Convert.toStr(telegramRecord.id()), StatisticRecord.Type.speed, System.currentTimeMillis(), data.encode())); // Avoid speed not being updated for a long time avgSpeed.update(0, System.currentTimeMillis()); }", "tokens": 164} {"id": 267861, "source": "method", "repo": "jarvis2f/telegram-files", "text": "public void start(Promise startPromise) { super.start(startPromise, this::handleAlbumCaption); }", "tokens": 27} {"id": 267898, "source": "method", "repo": "jarvis2f/telegram-files", "text": "public TelegramRecord withProxy(String proxy) { return new TelegramRecord(id, firstName, rootPath, proxy); }", "tokens": 28} {"id": 268020, "source": "method", "repo": "jarvis2f/telegram-files", "text": "public Future issuePasswordRecovery(String requestedUsername) { String username; try { username = normalizeUsername(requestedUsername); } catch (AuthException exception) { return Future.failedFuture(exception); } return findAccountByUsername(username).compose(account -> { if (account == null) { return Future.failedFuture(new AuthException( 404, \"ADMIN_NOT_FOUND\", \"Administrator was not found\" )); } String rawToken = SecurityTokenCodec.randomToken(32); long now = clock.millis(); long expiresAt = now + bootstrapLifetime.toMillis(); return pool.withTransaction(connection -> connection.preparedQuery(sql(\"\"\" DELETE FROM admin_recovery_token WHERE admin_account_id = ? \"\"\")) .execute(Tuple.of(account.id())) .compose(_ -> connection.preparedQuery(sql(\"\"\" UPDATE admin_session SET revoked_at = ? WHERE admin_account_id = ? AND revoked_at IS NULL \"\"\")) .execute(Tuple.of(now, account.id()))) .compose(_ -> connection.preparedQuery(sql(\"\"\" UPDATE admin_account SET session_version = session_version + 1, updated_at = ? WHERE id = ? \"\"\")) .execute(Tuple.of(now, account.id()))) .compose(_ -> connection.preparedQuery(sql(\"\"\" INSERT INTO admin_recovery_token (id, admin_account_id, token_digest, expires_at, consumed_at, created_at) VALUES (?, ?, ?, ?, NULL, ?) \"\"\")) .execute(Tuple.of( UUID.randomUUID().toString(), account.id(), SecurityTokenCodec.digest(rawToken), expiresAt, now ))) ) .compose(_ -> audit( account.id(), \"PASSWORD_RECOVERY_ISSUED\", \"SUCCESS\", \"all sessions revoked\" )) .map(new PasswordRecovery(username, rawToken, expiresAt)); }); }", "tokens": 425} {"id": 268201, "source": "method", "repo": "jarvis2f/telegram-files", "text": "private static String required(JsonObject json, String field) { String value = json.getString(field); if (value == null || value.isBlank()) { throw new IllegalArgumentException(field + \" is required\"); } return value; }", "tokens": 49} {"id": 268366, "source": "method", "repo": "jarvis2f/telegram-files", "text": "private Future createTempSqlClient(Vertx vertx) { if (Config.isSqlite()) { return Future.succeededFuture(JDBCPool.pool(vertx, new JDBCConnectOptions() .setJdbcUrl(\"jdbc:sqlite:%s\".formatted(DataVerticle.getDataPath())), new PoolOptions().setMaxSize(1).setName(\"temp-pool\") )); } else if (Config.isPostgres() || Config.isMysql()) { SqlClient sqlClient = DataVerticle.createSqlClient(vertx, DataVerticle.createDefaultOptions()); String createDatabaseQuery; if (Config.isPostgres()) { createDatabaseQuery = \"\"\" CREATE DATABASE \"%s\"; \"\"\".formatted(Config.DB_NAME); } else { createDatabaseQuery = \"\"\" CREATE DATABASE `%s` collate utf8mb4_bin; \"\"\".formatted(Config.DB_NAME); } return sqlClient.query(createDatabaseQuery) .execute() .onSuccess(r -> log.info(\"Database created\")) .onFailure(err -> log.error(\"Failed to create database: %s\".formatted(err.getMessage()))) .map(DataVerticle.createSqlClient(vertx, DataVerticle.getSqlConnectOptions())); } else { throw new VertxException(\"Unsupported database type\"); } }", "tokens": 280} {"id": 268472, "source": "method", "repo": "jarvis2f/telegram-files", "text": "void disabledConfigurationDoesNotRequirePlatformUrl() { ShareConfiguration configuration = ShareConfiguration.from(Map.of(), appRoot, telegramRoot); assertFalse(configuration.enabled()); assertNull(configuration.platformUri()); assertEquals(appRoot.resolve(\"shared\").normalize(), configuration.sharedRoot()); }", "tokens": 59} {"id": 268548, "source": "method", "repo": "java-aid/hackerrank-solutions", "text": "public Iterable edges() { ArrayList edges = new ArrayList(); for (int v = 1; v <= V; v++) { for (Edge e : adj[v]) { if (e.other(v) > v) edges.add(e); } } return edges; }", "tokens": 68} {"id": 268613, "source": "method", "repo": "java-aid/hackerrank-solutions", "text": "public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int a[] = new int[N]; for (int i = 0; i < N; i++) { a[i] = sc.nextInt(); } partition(a, 0, a.length - 1); sc.close(); }", "tokens": 81} {"id": 268709, "source": "method", "repo": "java-aid/hackerrank-solutions", "text": "void Print(Node head) { Node current = head; while (current != null) { System.out.println(current.data); current = current.next; } }", "tokens": 38} {"id": 268711, "source": "method", "repo": "java-aid/hackerrank-solutions", "text": "Node Reverse(Node head) { if (head == null || head.next == null) return head; Node remaing = Reverse(head.next); head.next.next = head; head.next = null; return remaing; }", "tokens": 54} {"id": 268739, "source": "method", "repo": "java-aid/hackerrank-solutions", "text": "public static void main(String[] args) { TSTPrefix tst = new TSTPrefix(); boolean found = false; TrieNode root = new TrieNode(' '); Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for (int i = 1; i <= n; i++) { String str = sc.next(); if (!tst.add(root, str)) { System.out.println(\"BAD SET \\n\" + str); found = true; break; } } System.out.println(!found ? \"GOOD SET\" : \"\"); sc.close(); }", "tokens": 130} {"id": 268749, "source": "method", "repo": "java-aid/hackerrank-solutions", "text": "public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i = sc.nextInt(); int j = sc.nextInt(); int k = sc.nextInt(); int count = 0; for (int m = i; m <= j; m++) { int reversedString = getReversed(m); if ((reversedString - m) % k == 0) { count++; } } System.out.println(count); sc.close(); }", "tokens": 103} {"id": 268797, "source": "method", "repo": "java-aid/hackerrank-solutions", "text": "static int formingMagicSquare(int[][] s) { int[][][] magicSquareCombinations={ {{4,9,2},{3,5,7},{8,1,6}}, {{8,3,4},{1,5,9},{6,7,2}}, {{6,1,8},{7,5,3},{2,9,4}}, {{2,7,6},{9,5,1},{4,3,8}}, {{2,9,4},{7,5,3},{6,1,8}}, {{8,1,6},{3,5,7},{4,9,2}}, {{6,7,2},{1,5,9},{8,3,4}}, {{4,3,8},{9,5,1},{2,7,6}}}; int minCost = Integer.MAX_VALUE; for (int i = 0; i < magicSquareCombinations.length; i++) { int modifyCost = 0; for (int j = 0; j < 3; j++) { for (int k = 0; k < 3; k++) { modifyCost += Math.abs(s[j][k] - magicSquareCombinations[i][j][k]); } } minCost = Math.min(modifyCost, minCost); } return minCost; }", "tokens": 312} {"id": 268810, "source": "method", "repo": "java-aid/hackerrank-solutions", "text": "/** @param n @param k @param a @return */ private static int getSepcialProblemCount(int n, int k, int[] a) { int pageNumber = 1, specialProblems = 0, problemNumber = 1; for (int chapterNumber = 1; chapterNumber <= n;) { int problemPerPage = (problemNumber + k - 1) < a[chapterNumber-1] ? problemNumber + k - 1 : a[chapterNumber-1]; if (problemNumber <= pageNumber && pageNumber <= problemPerPage) { specialProblems++; } pageNumber++; problemNumber += k; if (problemNumber > a[chapterNumber-1]) { problemNumber = 1; chapterNumber++; } } return specialProblems; }", "tokens": 161} {"id": 268867, "source": "method", "repo": "java-aid/hackerrank-solutions", "text": "public String getType() { return \"Someone ordered a Dessert!\"; }", "tokens": 17} {"id": 268905, "source": "method", "repo": "java-aid/hackerrank-solutions", "text": "public static boolean canWin(int leap, int[] game) { return canWin(leap, game, 0); }", "tokens": 29} {"id": 269023, "source": "method", "repo": "java-aid/hackerrank-solutions", "text": "public char calculate() { int sum = 0; for (int i = 0; i < testScores.length; i++) { sum += testScores[i]; } int avg = (sum) / testScores.length; if (90 <= avg && avg <= 100) { return 'O'; } else if (80 <= avg && avg < 90) { return 'E'; } else if (70 <= avg && avg < 80) { return 'A'; } else if (55 <= avg && avg < 70) { return 'P'; } else if (40 <= avg && avg < 55) { return 'D'; } else { return 'T'; } }", "tokens": 164} {"id": 269376, "source": "method", "repo": "java9-modularity/gradle-modules-plugin", "text": "public static int getValue() { return value; }", "tokens": 11} {"id": 269386, "source": "method", "repo": "javadev/leetcode-in-java", "text": "private List generate(StringBuilder sb, List str, int open, int close) { if (open == 0 && close == 0) { str.add(sb.toString()); return str; } if (open > 0) { sb.append('('); generate(sb, str, open - 1, close); sb.deleteCharAt(sb.length() - 1); } if (close > 0 && open < close) { sb.append(')'); generate(sb, str, open, close - 1); sb.deleteCharAt(sb.length() - 1); } return str; }", "tokens": 146} {"id": 269392, "source": "method", "repo": "javadev/leetcode-in-java", "text": "public String simplifyPath(String path) { Deque stk = new ArrayDeque<>(); int start = 0; while (start < path.length()) { while (start < path.length() && path.charAt(start) == '/') { start++; } int end = start; while (end < path.length() && path.charAt(end) != '/') { end++; } String s = path.substring(start, end); if (s.equals(\"..\")) { if (!stk.isEmpty()) { stk.pop(); } } else if (!s.equals(\".\") && !s.equals(\"\")) { stk.push(s); } start = end + 1; } StringBuilder ans = new StringBuilder(); while (!stk.isEmpty()) { ans.insert(0, stk.pop()); ans.insert(0, \"/\"); } return !ans.isEmpty() ? ans.toString() : \"/\"; }", "tokens": 204} {"id": 269400, "source": "method", "repo": "javadev/leetcode-in-java", "text": "public int next() { int res = -1; while (node != null) { if (node.left != null) { TreeNode rightMost = node.left; while (rightMost.right != null) { rightMost = rightMost.right; } rightMost.right = node; TreeNode temp = node.left; node.left = null; node = temp; } else { res = node.val; node = node.right; return res; } } return res; }", "tokens": 103} {"id": 269460, "source": "method", "repo": "javadev/leetcode-in-java", "text": "public void remove(int key) { int bucket = key % 1000; ArrayList list = arr[bucket]; Entry e = new Entry(); e.key = key; if (list != null) { list.remove(e); } }", "tokens": 59} {"id": 269507, "source": "method", "repo": "javadev/leetcode-in-java", "text": "private void find(TreeNode root, int height) { if (root == null) { return; } if (sums.size() < height) { sums.add(root.val); } else { sums.set(height - 1, sums.get(height - 1) + root.val); } find(root.left, height + 1); find(root.right, height + 1); }", "tokens": 94} {"id": 269509, "source": "method", "repo": "javadev/leetcode-in-java", "text": "private boolean check(int[] q, int[] counts) { int l = q[0]; int r = q[1]; int k = q[2]; int prev = l > 0 ? counts[l - 1] : 0; int kk = Integer.bitCount(prev ^ counts[r]); return (kk / 2) <= k; }", "tokens": 81} {"id": 269789, "source": "method", "repo": "javadev/leetcode-in-java", "text": "void constructor() { Node node = new Node(1); assertThat(node.val, equalTo(1)); assertThat(node.toString(), equalTo(\"Node{val=1,left=null,right=null,next=null}\")); }", "tokens": 51} {"id": 269942, "source": "method", "repo": "javadev/leetcode-in-java", "text": "void recoverFromPreorder2() { TreeNode expected = TreeNode.create(Arrays.asList(1, 2, 5, 3, null, 6, null, 4, null, 7)); assertThat( new Solution().recoverFromPreorder(\"1-2--3---4-5--6---7\").toString(), equalTo(expected.toString())); }", "tokens": 85} {"id": 270249, "source": "method", "repo": "javadev/leetcode-in-java", "text": "void findSafeWalk3() { assertThat( new Solution() .findSafeWalk( ArrayUtils.getLists(new int[][] {{1, 1, 1}, {1, 0, 1}, {1, 1, 1}}), 5), equalTo(true)); }", "tokens": 64} {"id": 270290, "source": "method", "repo": "javadev/leetcode-in-java", "text": "void maximumProfit() { assertThat(new Solution().maximumProfit(new int[] {1, 7, 9, 8, 2}, 2), equalTo(14L)); }", "tokens": 42} {"id": 270411, "source": "method", "repo": "javadev/underscore-java", "text": "private byte[] decodeInternal(final String encoded) { if (encoded.isEmpty()) { return new byte[0]; } int encodedLength = encoded.length(); int outLength = encodedLength * shift / 8; byte[] result = new byte[outLength]; int buffer = 0; int next = 0; int bitsLeft = 0; for (char c : encoded.toCharArray()) { if (!charMap.containsKey(c)) { throw new DecodingException(\"Illegal character: \" + c); } buffer <<= shift; buffer |= charMap.get(c) & mask; bitsLeft += shift; if (bitsLeft >= 8) { result[next++] = (byte) (buffer >> (bitsLeft - 8)); bitsLeft -= 8; } } return result; }", "tokens": 170} {"id": 270493, "source": "method", "repo": "javadev/underscore-java", "text": "public Chain limit(final int size) { return new Chain<>(value().subList(0, size)); }", "tokens": 26} {"id": 270572, "source": "method", "repo": "javadev/underscore-java", "text": "public static String padEnd(final String string, final Integer length) { return createPadDir(true).apply(string, length, null); }", "tokens": 33} {"id": 270659, "source": "method", "repo": "javadev/underscore-java", "text": "private static Object makeObjectEmptyValue(Object value) { final Object result; if (value instanceof List) { List values = new ArrayList<>(); for (Object item : (List) value) { values.add(item instanceof Map ? replaceEmptyValueWithNull((Map) item) : item); } result = values; } else if (value instanceof Map) { result = replaceEmptyValueWithNull((Map) value); } else { result = value; } return result; }", "tokens": 103} {"id": 270884, "source": "method", "repo": "javadev/underscore-java", "text": "public Chain sort() { return new Chain<>(Underscore.sort((List) list)); }", "tokens": 26} {"id": 270994, "source": "method", "repo": "javadev/underscore-java", "text": "private static void addText( final Map map, final String name, final List objects, final Object value, final FromType fromType) { int lastIndex = map.size() - 1; final int index = objects.size(); while (true) { final Map.Entry lastElement = (Map.Entry) map.entrySet().toArray()[lastIndex]; if (String.valueOf(lastElement.getKey()).equals(name)) { break; } final Map item = new LinkedHashMap<>(); final Map text = new LinkedHashMap<>(); text.put(String.valueOf(lastElement.getKey()), map.remove(lastElement.getKey())); item.put(\"#item\", text); objects.add(index, item); lastIndex -= 1; } final Object newValue = getValue(name, value, fromType); if (newValue instanceof List) { objects.add(((List) newValue).get(0)); } else { objects.add(newValue); } }", "tokens": 219} {"id": 271202, "source": "method", "repo": "javadev/underscore-java", "text": "void testXmlDoubleArrayToString() { XmlStringBuilder builder; builder = new XmlStringBuilder(); Xml.XmlArray.writeXml((double[]) null, builder); assertEquals( \"\\n\\n \\n\", builder.toString()); builder = new XmlStringBuilder(); Xml.XmlArray.writeXml(new double[0], builder); assertEquals( \"\\n\\n \\n\", builder.toString()); builder = new XmlStringBuilder(); Xml.XmlArray.writeXml(new double[] {12.8}, builder); assertEquals( \"\\n\\n 12.8\\n\", builder.toString()); builder = new XmlStringBuilder(); Xml.XmlArray.writeXml(new double[] {-7.1, 22.234, 86.7, -99.02}, builder); assertEquals( \"\\n\\n -7.1\\n \" + \"22.234\\n 86.7\\n -99.02\\n\", builder.toString()); }", "tokens": 318} {"id": 271284, "source": "method", "repo": "javadev/underscore-java", "text": "void testCase_0x003C003F() { byte[] buf = {(byte) 0x00, (byte) 0x3C, (byte) 0x00, (byte) 0x3F}; assertEquals( \"UnicodeBigUnmarked\", U.detectEncoding(buf), \"Should return UnicodeBigUnmarked for 0x003C003F\"); }", "tokens": 94} {"id": 271471, "source": "method", "repo": "javagl/jgltf", "text": "/** An array of cameras. (optional)
Minimum number of items: 1
Array elements:
  A camera's projection. A node **MAY** reference a camera to apply a transform to place the camera in the scene. (optional) @return The cameras */ public List getCameras() { return this.cameras; }", "tokens": 89} {"id": 271672, "source": "method", "repo": "javagl/jgltf", "text": "public Set getReferencedModelElements() { Set modelElements = getReferencedExtensionModelElements(); if (bufferViewModel != null) { modelElements.add(bufferViewModel); } return modelElements; }", "tokens": 47} {"id": 271724, "source": "method", "repo": "javagl/jgltf", "text": "/** Add the given {@link ImageModel} instances to this model @param imageModels The instances to add */ public void addImageModels( Collection imageModels) { for (DefaultImageModel imageModel : imageModels) { addImageModel(imageModel); } }", "tokens": 61} {"id": 271743, "source": "method", "repo": "javagl/jgltf", "text": "public NodeModel getParent() { return parent; }", "tokens": 11} {"id": 271794, "source": "method", "repo": "javagl/jgltf", "text": "/** Returns whether the given {@link GltfAsset} contains any {@link GltfReference} that has a URI that is not a data URI.

If the asset does not contain any references, then false is returned.
@param gltfAsset The {@link GltfAsset} @return Whether the asset contains (non-data) URI references */ private static boolean containsFileUriReferences(GltfAsset gltfAsset) { List references = gltfAsset.getReferences(); for (GltfReference reference : references) { String uriString = reference.getUri(); if (!IO.isDataUriString(uriString)) { return true; } } return false; }", "tokens": 153} {"id": 271849, "source": "method", "repo": "javagl/jgltf", "text": "/** Returns the ID that was given to the given {@link BufferViewModel} when it was added @param bufferViewModel The {@link BufferViewModel} @return The ID */ public String getBufferViewId(BufferViewModel bufferViewModel) { return bufferViewIds.get(bufferViewModel); }", "tokens": 59} {"id": 272063, "source": "method", "repo": "javagl/jgltf", "text": "public Object convertToImpl(GltfModel gltfModel, Object modelObject) { DefaultMaterialsSheenModel model = (DefaultMaterialsSheenModel) modelObject; MaterialMaterialsSheen impl = new MaterialMaterialsSheen(); ModelElementsV2.transferGltfPropertyElementsFromModel(model, impl); impl.setSheenColorFactor(Optionals.clone(model.getSheenColorFactor())); impl.setSheenRoughnessFactor(model.getSheenRoughnessFactor()); TextureInfoModel sheenColorTextureInfoModel = model.getSheenColorTexture(); TextureInfo sheenColorTextureInfo = TextureInfos.from(gltfModel, sheenColorTextureInfoModel); impl.setSheenColorTexture(sheenColorTextureInfo); TextureInfoModel sheenRoughnessTextureInfoModel = model.getSheenRoughnessTexture(); TextureInfo sheenRoughnessTextureInfo = TextureInfos.from(gltfModel, sheenRoughnessTextureInfoModel); impl.setSheenRoughnessTexture(sheenRoughnessTextureInfo); return impl; }", "tokens": 232} {"id": 272101, "source": "method", "repo": "javagl/jgltf", "text": "/** Compute all vertices that are reachable from the given starting vertices using only outgoing edges. @param The vertex type @param The edge type @param g The graph @param startingVertices The starting vertices @param ignoredVertices Vertices that should be ignored @return The reachable vertices */ public static > Set computeReachableForward( Graph g, Set startingVertices, Set ignoredVertices) { Set visited = new LinkedHashSet(); visited.addAll(ignoredVertices); for (V v : startingVertices) { traverseForward(g, v, visited); } visited.removeAll(ignoredVertices); return visited; }", "tokens": 152} {"id": 272108, "source": "method", "repo": "javagl/jgltf", "text": "/** Create a test to remove a texture by setting the clearcoat texture info texture to null @return The test */ static TestCase createTestRemoveClearcoatTextureInfoTexture() { String name = \"TexturedSquareWithClearcoat\"; String modifiedName = name + \"-removedClearcoatTextureInfoTexture\"; DefaultGltfModel gltfModel = GltfTestModelCreation.createTexturedSquareWithClearcoat(); Consumer op = (m) -> { MaterialModel material0 = m.getMaterialModel(0); MaterialsClearcoatModel clearcoat0 = material0.getExtensionModel( \"KHR_materials_clearcoat\", MaterialsClearcoatModel.class); TextureInfoModel textureInfo0 = clearcoat0.getClearcoatTexture(); DefaultTextureInfoModel defaultTextureInfo0 = (DefaultTextureInfoModel) textureInfo0; defaultTextureInfo0.setTextureModel(null); GltfModelTransforms.prune(m); }; return TestCase.create(name, modifiedName, gltfModel, op); }", "tokens": 200} {"id": 272110, "source": "method", "repo": "javagl/jgltf", "text": "/** Create a test to remove the skin attribute accessors from the simple skin @return The test */ static TestCase createTestRemoveSkinAttributes() { String name = \"SimpleSkin\"; String modifiedName = name + \"-removedSkinAttributes\"; DefaultGltfModel gltfModel = GltfTestModelCreation.createSimpleSkin(); Consumer op = (m) -> { MeshModel mesh0 = m.getMeshModel(0); MeshPrimitiveModel primitive0 = mesh0.getMeshPrimitiveModels().get(0); DefaultMeshPrimitiveModel defaultPrimitive0 = (DefaultMeshPrimitiveModel) primitive0; defaultPrimitive0.removeAttribute(\"JOINTS_0\"); defaultPrimitive0.removeAttribute(\"WEIGHTS_0\"); GltfModelTransforms.prune(m); }; return TestCase.create(name, modifiedName, gltfModel, op); }", "tokens": 167} {"id": 272161, "source": "method", "repo": "javagl/jgltf", "text": "/** Validate the {@link GlTF#getTechniques()} @param currentContext The optional {@link ValidatorContext} of the glTF @return The {@link ValidatorResult} */ private ValidatorResult validateTechniques(ValidatorContext currentContext) { ValidatorContext context = new ValidatorContext(currentContext); ValidatorResult validatorResult = new ValidatorResult(); validatorResult.add(validateElements( getGltf().getTechniques(), \"techniques\", false, context, techniqueValidator::validateTechnique)); if (validatorResult.hasErrors()) { return validatorResult; } return validatorResult; }", "tokens": 125} {"id": 272245, "source": "method", "repo": "javahuang/surveyking", "text": "public ResponseEntity startSurveyWechat(@RequestBody SurveyWechatOAuthStartRequest request, HttpServletRequest httpRequest) { OAuthStartResponse result = oauthService.startSurveyWechat(request.getProjectId(), request.getRedirect(), httpRequest.getHeader(HttpHeaders.USER_AGENT)); return startResponse(result, httpRequest); }", "tokens": 66} {"id": 272326, "source": "method", "repo": "javahuang/surveyking", "text": "public boolean innerProcess(ApprovalTaskRequest request) { runtimeService.deleteProcessInstance(request.getProcessInstanceId(), request.getComment()); return true; }", "tokens": 32} {"id": 272355, "source": "method", "repo": "javahuang/surveyking", "text": "private SurveySchema filterSchemaByRow(Row row, SurveySchema schema) { List flatSurveySchema = SchemaHelper.flatSurveySchema(schema); return SurveySchema.builder().id(schema.getId()).children(row.stream().map(cell -> { String title = cell.getText(); return flatSurveySchema.stream().filter(x -> x.getTitle().equals(title)).findFirst() .orElse(SurveySchema.builder().build()); }).collect(Collectors.toList())).build(); }", "tokens": 104} {"id": 272490, "source": "method", "repo": "javahuang/surveyking", "text": "private void evictUsers(Collection userIds) { Cache userCache = cacheManager.getCache(CacheConsts.userCacheName); if (userCache == null || userIds == null) { return; } Set affectedUserIds = userIds.stream().filter(Objects::nonNull).collect(Collectors.toSet()); Runnable evict = () -> affectedUserIds.forEach(userCache::evictIfPresent); if (TransactionSynchronizationManager.isActualTransactionActive() && TransactionSynchronizationManager.isSynchronizationActive()) { TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { @Override public void afterCommit() { evict.run(); } }); } else { evict.run(); } }", "tokens": 152} {"id": 272541, "source": "method", "repo": "javahuang/surveyking", "text": "private void validateStrongPassword(String password, Integer rowNum) { if (password != null && STRONG_PASSWORD_PATTERN.matcher(password).matches()) { return; } if (rowNum != null) { throw new InternalServerError(i18n(\"user.import.passwordWeak\", rowNum)); } throw new InternalServerError(i18n(\"user.password.strong\")); }", "tokens": 87} {"id": 272763, "source": "method", "repo": "javahuang/surveyking", "text": "public void init() { try { this.rootLocation = Paths.get(getStorageConfig().getLocal().getRootPath()).toAbsolutePath().normalize(); Files.createDirectories(rootLocation); } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }", "tokens": 62} {"id": 272933, "source": "method", "repo": "JavatoDev-com/internet-banking-concept-microservices", "text": "public List readUsers(Pageable pageable) { Page allUsersInDb = userRepository.findAll(pageable); List users = userMapper.convertToDtoList(allUsersInDb.getContent()); users.forEach(user -> { UserRepresentation userRepresentation = keycloakUserService.readUser(user.getAuthId()); user.setId(user.getId()); user.setEmail(userRepresentation.getEmail()); user.setIdentification(user.getIdentification()); }); return users; }", "tokens": 105} {"id": 272963, "source": "method", "repo": "jbake-org/jbake", "text": "public long getPublishedCount(String docType) { String statement = String.format(STATEMENT_GET_PUBLISHED_COUNT, docType); return (long) query(statement).get(0).get(\"count\"); }", "tokens": 49} {"id": 273003, "source": "method", "repo": "jbake-org/jbake", "text": "private String buildHash(final File sourceFile) { String sha1; try { sha1 = FileUtil.sha1(sourceFile); } catch (Exception e) { logger.error(\"unable to build sha1 hash for source file '{}'\", sourceFile); sha1 = \"\"; } return sha1; }", "tokens": 60} {"id": 273172, "source": "method", "repo": "jbake-org/jbake", "text": "public boolean getRenderTags() { return getAsBoolean(RENDER_TAGS.getKey()); }", "tokens": 19} {"id": 273180, "source": "method", "repo": "jbake-org/jbake", "text": "public String getSiteMapFileName() { return getAsString(SITEMAP_FILE.getKey()); }", "tokens": 21} {"id": 273205, "source": "method", "repo": "jbake-org/jbake", "text": "private void setupDefaultAssetFolder() { String assetFolder = getAsString(ASSET_FOLDER.getKey()); File asset = new File(assetFolder); if(asset.isAbsolute()) { setAssetFolder(asset); } else { setAssetFolder(new File(getSourceFolder(), assetFolder)); } }", "tokens": 62} {"id": 273269, "source": "method", "repo": "jbake-org/jbake", "text": "public File getConfig() { if (config != null) { return new File(config); } else { return new File(getSource(), \"jbake.properties\"); } }", "tokens": 35} {"id": 273590, "source": "method", "repo": "jbake-org/jbake", "text": "public boolean matches(Object o) { return ((String) o).matches(regex); }", "tokens": 22} {"id": 273858, "source": "method", "repo": "jbangdev/jbang", "text": "private boolean checkJbangActionRelease(String version) throws IOException { String tag = \"v\" + version; GHOrganization organization = github.getOrganization(\"jbangdev\"); GHRepository repository = organization.getRepository(\"jbang-action\"); var actionRelease = repository.getReleaseByTagName(tag); return actionRelease != null; }", "tokens": 67} {"id": 273925, "source": "method", "repo": "jbangdev/jbang", "text": "public void testBasicExportClasspath() { rmrf(\"classpath_example.jar\", \"lib\"); assertThat(shell(\"jbang export portable classpath_example.java\")) .succeeded() .errContains(\"Exported to\") .errContains(\"classpath_example.jar\"); assertThat(shell(\"jbang export portable --force classpath_example.java\")) .succeeded() .errContains(\"Exported to\") .errContains( \"classpath_example.jar\"); }", "tokens": 98} {"id": 274005, "source": "method", "repo": "jbangdev/jbang", "text": "/** Finds the nearest catalog file that contains an template with the given name and removes it @param name Name of template to remove */ public static void removeNearestTemplate(String name) { Catalog catalog = Template.findNearestCatalogWithTemplate(Util.getCwd(), name); if (catalog != null) { if (catalog.catalogRef.isURL() && Util.isRemoteRef(catalog.catalogRef.getOriginalResource())) { Util.warnMsg(\"Unable to remove template \" + name + \" because it is imported from a remote catalog\"); } else if (catalog.equals(Catalog.getBuiltin())) { Util.warnMsg(\"Cannot remove template \" + name + \" from built-in catalog\"); } else { removeTemplate(catalog, name); } } }", "tokens": 160} {"id": 274183, "source": "method", "repo": "jbangdev/jbang", "text": "public static Path fetchFromURL(String scriptURL) throws IOException { String url = swizzleURL(scriptURL); return NetUtil.downloadAndCacheFile(url); }", "tokens": 39} {"id": 274221, "source": "method", "repo": "jbangdev/jbang", "text": "private static Path getBuildDir(Path baseDir, Project project) { if (baseDir == null) { baseDir = Settings.getCacheDir(Cache.CacheClass.jars); } return baseDir.resolve( project.getResourceRef().getFile().getFileName() + \".\" + project.getStableId()); }", "tokens": 61} {"id": 274290, "source": "method", "repo": "jbangdev/jbang", "text": "public SourceSet addDependencies(Collection dependencies) { this.dependencies.addAll(dependencies); return this; }", "tokens": 26} {"id": 274348, "source": "method", "repo": "jbangdev/jbang", "text": "protected List collectBinaryDependencies() { final List allDependencies = super.collectBinaryDependencies(); allDependencies.add(\"org.jetbrains.kotlin:kotlin-stdlib:\" + getKotlinVersion()); return allDependencies; }", "tokens": 50} {"id": 274405, "source": "method", "repo": "jbangdev/jbang", "text": "/** Extracts credentials from a single .netrc entry: tries jbang-auth methods in order, then login/password. Returns null if nothing yields credentials. */ private static String[] extractCredsFromEntry(NetrcParser.NetrcEntry entry, String host) { String jbangAuth = entry.getJbangAuth(); if (!isNullOrBlankString(jbangAuth)) { // Use jbang-auth-host as the lookup host if specified String authHost = !isNullOrBlankString(entry.getJbangAuthHost()) ? entry.getJbangAuthHost() : host; for (String method : jbangAuth.split(\",\")) { String[] creds = runAuthMethod(method.trim(), authHost, entry.getLogin()); if (creds != null) { return creds; } } } if (!isNullOrBlankString(entry.getLogin()) && !isNullOrBlankString(entry.getPassword())) { verboseMsg(\"Using .netrc credentials for host: \" + host); return new String[] { entry.getLogin(), entry.getPassword() }; } return null; }", "tokens": 216} {"id": 274409, "source": "method", "repo": "jbangdev/jbang", "text": "public static String unquote(String txt) { if (txt.startsWith(\"\\\"\") && txt.endsWith(\"\\\"\")) { txt = txt.substring(1, txt.length() - 1); } return txt; }", "tokens": 45} {"id": 274552, "source": "method", "repo": "jbangdev/jbang", "text": "public void testDebugWithScript() { Run run = JBang.parseCommand(\"run\", \"--debug\", \"test.java\"); assertThat(run.scriptMixin.scriptOrFile, is(\"test.java\")); assertThat(run.runMixin.debugString, notNullValue()); }", "tokens": 57} {"id": 274573, "source": "method", "repo": "jbangdev/jbang", "text": "void testDepsAddToJavaFile(@TempDir Path outputDir) throws IOException { // Create a test Java file Path testFile = outputDir.resolve(\"test.java\"); String content = \"///usr/bin/env jbang \\\"$0\\\" \\\"$@\\\" ; exit $?\\n\\nclass Test {\\n public static void main(String[] args) {\\n System.out.println(\\\"Hello!\\\");\\n }\\n}\"; Files.write(testFile, content.getBytes()); // Add a dependency int result = JBang.execute(\"deps\", \"add\", \"info.picocli:picocli:4.6.3\", testFile.toString()); assertThat(result).isEqualTo(0); // Verify the dependency was added String fileContent = Util.readString(testFile); assertThat(fileContent).contains(\"//DEPS info.picocli:picocli:4.6.3\"); assertThat(fileContent).contains(\"class Test\"); assertThat(fileContent.indexOf(\"//DEPS info.picocli:picocli:4.6.3\")) .withFailMessage(\"Dependency should be added below the //DEPS line and not 'stuck' to class\") .isGreaterThan(fileContent.indexOf(\"///\")); // Verify it is added below the first line and not \"stuck\" to class assertThat(fileContent).doesNotContain(\"4.6.3\\nclass Test {\"); }", "tokens": 285} {"id": 274585, "source": "method", "repo": "jbangdev/jbang", "text": "void testLocateProjectWithDotJBang(@TempDir Path root) { Map files = new HashMap<>(); files.put(\"src/a/b/test.java\", \"\\n\"); files.put(\".jbang/marker\", \"\"); setupFiles(root, files); assertEquals(root, Edit.locateProjectDir(root.resolve(\"src/a/b/test.java\"))); }", "tokens": 86} {"id": 274761, "source": "method", "repo": "jbangdev/jbang", "text": "void testHasExecutableExtensionJar() { Path jarPath = Paths.get(\"test.jar\"); assertTrue(Project.hasExecutableExtension(jarPath)); }", "tokens": 33} {"id": 274878, "source": "method", "repo": "jcarolus/android-chess", "text": "private void completeMoveAnimation(long generation) { if (generation != moveAnimationGeneration) { return; } final ChessPieceView animationView = animatedMoveView; final ChessPieceView destinationPieceView = hiddenMoveDestinationView; animatedMoveView = null; hiddenMoveDestinationView = null; if (animationView != null && animationView.getParent() == chessBoardView) { chessBoardView.removeView(animationView); } if (destinationPieceView != null && destinationPieceView.getParent() == chessBoardView) { destinationPieceView.setVisibility(View.VISIBLE); } }", "tokens": 126} {"id": 275051, "source": "method", "repo": "jcarolus/android-chess", "text": "public boolean onCreateOptionsMenu(Menu menu) { MenuItem item1; item1 = menu.add(getString(R.string.menu_new_command)); item1.setIcon(R.drawable.ic_plus); return true; }", "tokens": 50} {"id": 275248, "source": "method", "repo": "jcarolus/android-chess", "text": "public void challenge(Map payload) { this.auth.challenge(payload, new Auth.AuthResponseHandler() { @Override public void onResponse(JsonObject result) { Log.d(TAG, \"challenge response\"); } @Override public void onClose(boolean success) { Log.d(TAG, \"challenge closed \" + success); if (apiListener != null) { apiListener.onMyChallengeCancelled(); } } }); }", "tokens": 95} {"id": 275352, "source": "method", "repo": "jcarolus/android-chess", "text": "public void onDestroy() { Log.i(TAG, \"onDestroy\"); lichessApi = null; if (auth != null) { auth.destroy(); auth = null; } super.onDestroy(); }", "tokens": 41} {"id": 275463, "source": "method", "repo": "jcarolus/android-chess", "text": "public int getPGNSize() { return pgnMoves.size(); }", "tokens": 16} {"id": 275699, "source": "method", "repo": "jcarolus/android-chess", "text": "public b(c paramc) { this.a = paramc; }", "tokens": 19} {"id": 275741, "source": "method", "repo": "jcarolus/android-chess", "text": "public PGNEntry(String sM, String sA, int move, int duckMove) { sMove = sM; sAnnotation = sA; this.move = move; this.duckMove = duckMove; }", "tokens": 57} {"id": 275791, "source": "method", "repo": "jcbvm/i18n-editor", "text": "protected GridBagConstraints createVerticalGridBagConstraints() { vGridBagConstraints.gridy = (vGridBagConstraints.gridy + 1) % Integer.MAX_VALUE; return vGridBagConstraints; }", "tokens": 39} {"id": 276022, "source": "method", "repo": "jcbvm/i18n-editor", "text": "/** Constructs a {@link JTextArea}. */ public JTextArea() { super(); Border border = BorderFactory.createLineBorder(Colors.scale(UIManager.getColor(\"Panel.background\"), .8f)); setBorder(BorderFactory.createCompoundBorder(border, BorderFactory.createEmptyBorder(5,8,5,8))); getDocument().addUndoableEditListener(e -> undoManager.addEdit(e.getEdit())); setAlignmentX(LEFT_ALIGNMENT); setLineWrap(true); setWrapStyleWord(true); // Add undo support getActionMap().put(\"undo\", new UndoAction(undoManager)); getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_Z, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()), \"undo\"); // Add redo support getActionMap().put(\"redo\", new RedoAction(undoManager)); getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_Y, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()), \"redo\"); // Add popup menu support addMouseListener(new JTextComponentMenuListener(this, undoManager)); }", "tokens": 228} {"id": 276038, "source": "method", "repo": "jcbvm/i18n-editor", "text": "public SelectAllAction(String name) { super(name); }", "tokens": 15} {"id": 276042, "source": "method", "repo": "jcbvm/i18n-editor", "text": "public static void showInfoDialog(Component parent, String title, String message) { JOptionPane.showMessageDialog(parent, message, title, JOptionPane.INFORMATION_MESSAGE); }", "tokens": 36} {"id": 276058, "source": "method", "repo": "jcbvm/i18n-editor", "text": "/** Sets a value in the property list. The list of values will be converted to a single string separated by {@value #listSeparator}. @param key the key to be placed in this property list. @param values the value corresponding to {@code key}. */ public void setProperty(String key, List values) { setProperty(key, values.stream().collect(Collectors.joining(listSeparator))); }", "tokens": 88} {"id": 276426, "source": "method", "repo": "jchambers/pushy", "text": "public void onHeadersRead(final ChannelHandlerContext context, final int streamId, final Http2Headers headers, final int padding, final boolean endOfStream) { if (endOfStream) { handleEndOfStream(context, streamId); } }", "tokens": 51} {"id": 276518, "source": "method", "repo": "jchambers/pushy", "text": "/**

Sets whether the payload under construction should contain a flag that indicates that new content is available to be downloaded in the background by the receiving app. By default, no content availability flag is included in the payload.

@param contentAvailable {@code true} to include a flag that indicates that new content is available to be downloaded in the background or {@code false} otherwise @return a reference to this payload builder @see Pushing Updates to Your App Silently */ public ApnsPayloadBuilder setContentAvailable(final boolean contentAvailable) { this.contentAvailable = contentAvailable; return this; }", "tokens": 174} {"id": 276542, "source": "method", "repo": "jchambers/pushy", "text": "InterruptionLevel(final String value) { this.value = value; }", "tokens": 17} {"id": 276543, "source": "method", "repo": "jchambers/pushy", "text": "/** Constructs a new push notification with the given token, topic, and payload. A default expiration time is set for the notification; callers that require immediate expiration or a non-default expiration period should use a constructor that accepts an expiration time as an argument. An \"immediate\" delivery priority is used for the notification, and as such the payload should contain an alert, sound, or badge component. No push notification type is specified. @param token the device token to which this push notification should be delivered @param topic the topic to which this notification should be sent @param payload the payload to include in this push notification @see DeliveryPriority#IMMEDIATE @see #DEFAULT_EXPIRATION_PERIOD */ public SimpleApnsPushNotification(final String token, final String topic, final String payload) { this(token, topic, payload, Instant.now().plus(DEFAULT_EXPIRATION_PERIOD), DeliveryPriority.IMMEDIATE, null, null, null); }", "tokens": 191} {"id": 276651, "source": "method", "repo": "jchambers/pushy", "text": "public TestChannel(final boolean initiallyActive) { this.active = initiallyActive; this.closePromise = new DefaultChannelPromise(this, EVENT_EXECUTOR); }", "tokens": 36} {"id": 276671, "source": "method", "repo": "jchambers/pushy", "text": "public static void tearDownAfterClass() throws Exception { CLIENT_RESOURCES.shutdownGracefully().await(); }", "tokens": 22} {"id": 276697, "source": "method", "repo": "jchambers/pushy", "text": "AtomicInteger getConnectionsRemoved() { return this.connectionsRemoved; }", "tokens": 14} {"id": 276754, "source": "method", "repo": "jchambers/pushy", "text": "public SingleHostHttpProxySelector(final String proxiedHost) { this.proxiedHost = proxiedHost; }", "tokens": 24} {"id": 276810, "source": "method", "repo": "jchambers/pushy", "text": "void testHandleNotificationWithMissingTopic() { this.headers.remove(APNS_TOPIC_HEADER); this.assertNotificationRejected(\"Push notifications without a topic should be rejected.\", this.getHandler(DEVICE_TOKENS_BY_TOPIC, Collections.emptyMap()), this.headers, this.payload, RejectionReason.MISSING_TOPIC); }", "tokens": 71} {"id": 276893, "source": "method", "repo": "jdbc-observations/datasource-proxy", "text": "public void increment(QueryType queryType) { switch (queryType) { case SELECT: incrementSelect(); break; case INSERT: incrementInsert(); break; case UPDATE: incrementUpdate(); break; case DELETE: incrementDelete(); break; case OTHER: incrementOther(); } }", "tokens": 60} {"id": 276969, "source": "method", "repo": "jdbc-observations/datasource-proxy", "text": "public void beforeGetTime(MethodExecutionContext executionContext) { }", "tokens": 14} {"id": 277126, "source": "method", "repo": "jdbc-observations/datasource-proxy", "text": "public void beforeSetFetchDirection(MethodExecutionContext executionContext) { }", "tokens": 15} {"id": 277194, "source": "method", "repo": "jdbc-observations/datasource-proxy", "text": "/** Callback method that allows the given query to be reformatted for logging.

Subclasses can override this method to change the query, for example, by calling Hibernate's {@code BasicFormatterImpl}. @param query a query to format @return formatted query @since 1.4.1 */ protected String formatQuery(String query) { return query; }", "tokens": 77} {"id": 277242, "source": "method", "repo": "jdbc-observations/datasource-proxy", "text": "public static PreparedStatement getPreparedStatement(PreparedStatement preparedStatement) { return getNativeJdbcObject(preparedStatement); }", "tokens": 24} {"id": 277291, "source": "method", "repo": "jdbc-observations/datasource-proxy", "text": "public Stopwatch create() { return new SystemStopwatch(); }", "tokens": 13} {"id": 277316, "source": "method", "repo": "jdbc-observations/datasource-proxy", "text": "public String getLogMessage(String datasourceName, QueryCount queryCount) { final StringBuilder sb = new StringBuilder(); sb.append(\"Name:\"); sb.append(datasourceName == null ? \"\" : datasourceName); sb.append(\", \"); sb.append(\"Time:\"); sb.append(queryCount.getTime()); sb.append(\", \"); sb.append(\"Total:\"); sb.append(queryCount.getTotal()); sb.append(\", \"); sb.append(\"Success:\"); sb.append(queryCount.getSuccess()); sb.append(\", \"); sb.append(\"Failure:\"); sb.append(queryCount.getFailure()); sb.append(\", \"); sb.append(\"Select:\"); sb.append(queryCount.getSelect()); sb.append(\", \"); sb.append(\"Insert:\"); sb.append(queryCount.getInsert()); sb.append(\", \"); sb.append(\"Update:\"); sb.append(queryCount.getUpdate()); sb.append(\", \"); sb.append(\"Delete:\"); sb.append(queryCount.getDelete()); sb.append(\", \"); sb.append(\"Other:\"); sb.append(queryCount.getOther()); sb.append(\", \"); sb.append(\"Statement:\"); sb.append(queryCount.getStatement()); sb.append(\", \"); sb.append(\"Prepared:\"); sb.append(queryCount.getPrepared()); sb.append(\", \"); sb.append(\"Callable:\"); sb.append(queryCount.getCallable()); return sb.toString(); }", "tokens": 334} {"id": 277559, "source": "method", "repo": "jdbc-observations/datasource-proxy", "text": "public void trace(Object message) { addMessage(CommonsLogLevel.TRACE, message); }", "tokens": 21} {"id": 277763, "source": "method", "repo": "jdbc-observations/datasource-proxy", "text": "private Connection getProxyConnection(final String replacedQuery) throws Exception { QueryTransformer transformer = new QueryTransformer() { public String transformQuery(TransformInfo transformInfo) { interceptedQueries.add(transformInfo.getQuery()); return replacedQuery; } }; QueryExecutionListener queryListener = mock(QueryExecutionListener.class); ProxyConfig proxyConfig = ProxyConfig.Builder.create() .queryListener(queryListener) .queryTransformer(transformer) .build(); ConnectionInfo connectionInfo = new ConnectionInfo(); connectionInfo.setDataSourceName(\"myDS\"); return new JdkJdbcProxyFactory().createConnection(rawDatasource.getConnection(), connectionInfo, proxyConfig); }", "tokens": 136} {"id": 277824, "source": "method", "repo": "jdeath/homeassistant-addons", "text": "public PlaceInitialSettlement(int playerID, int settlementNum) { _playerID = playerID; _isSetup = false; _settlementNum = settlementNum; assert settlementNum == 1 || settlementNum == 2; // Only supporting placing // the first two // settlements. }", "tokens": 64} {"id": 277914, "source": "method", "repo": "jdeath/homeassistant-addons", "text": "/** Returns true if there are possible permutations of the array. @param data Array to permute @return Boolean stating if there are more permutations */ private boolean permute(int[] data) { int k = data.length - 2; while (data[k] >= data[k + 1]) { k--; if (k < 0) { return false; } } int l = data.length - 1; while (data[k] >= data[l]) { l--; } swap(data, k, l); int length = data.length - (k + 1); for (int i = 0; i < length / 2; i++) { swap(data, k + 1 + i, data.length - i - 1); } return true; }", "tokens": 170} {"id": 278029, "source": "method", "repo": "jdeath/homeassistant-addons", "text": "private double getScoreForResource(Resource res) { return getResourceRatio(res) * getExpectationRatio(res); }", "tokens": 27} {"id": 278083, "source": "method", "repo": "jdeath/homeassistant-addons", "text": "public double getNumResourceCards() { return _player.getNumResourceCards(); }", "tokens": 19} {"id": 278189, "source": "method", "repo": "jdeath/homeassistant-addons", "text": "public double getWildCardRate(Resource res) { return Settings.WILDCARD_RATE; }", "tokens": 20} {"id": 278565, "source": "method", "repo": "jdi-testing/jdi-light", "text": "public void checkSelectValidDate() { momentJsDatepicker.select(\"1/31/2007\"); momentJsDatepicker.is().valid(); }", "tokens": 36} {"id": 278595, "source": "method", "repo": "jdi-testing/jdi-light", "text": "public void openedTest() { dialog.open(); assertTrue(dialog.isOpened()); dialog.close(); }", "tokens": 23} {"id": 278725, "source": "method", "repo": "jdi-testing/jdi-light", "text": "public void offCache() { rows.useCache(false); columns.useCache(false); cells.useCache(false); count.useCache(false); size.useCache(false); header.useCache(false); rowHeader.useCache(false); }", "tokens": 58} {"id": 278755, "source": "method", "repo": "jdi-testing/jdi-light", "text": "public static T initElements(WebDriver driver, Class pageClassToProxy) { T page = getPageObject(driver, pageClassToProxy); String pageName = splitCamelCase(pageClassToProxy.getSimpleName()); WebPage webPage = new WebPage(); webPage.updatePageData( webPage.getClass().getAnnotation(Url.class), webPage.getClass().getAnnotation(Title.class)); webPage.setName(pageName); PAGES.get().update(pageName, webPage); initElements(driver, page); return page; }", "tokens": 120} {"id": 278810, "source": "method", "repo": "jdi-testing/jdi-light", "text": "public String getValue() { return getText(); }", "tokens": 10} {"id": 278857, "source": "method", "repo": "jdi-testing/jdi-light", "text": "public void getTestList() { UIElement item = leftMenuList.get(\"Contact form\"); item.show(); item.is().deselected(); item.click(); item.is().selected(); contactFormPage.checkOpened(); }", "tokens": 49} {"id": 279018, "source": "method", "repo": "jdi-testing/jdi-light", "text": "public void setStartIndex(int index) { startIndex = index; }", "tokens": 15} {"id": 279354, "source": "method", "repo": "jdi-testing/jdi-light", "text": "public AvatarChipAssert is() { return (AvatarChipAssert) new AvatarChipAssert().set(this); }", "tokens": 26} {"id": 279358, "source": "method", "repo": "jdi-testing/jdi-light", "text": "public static Object[][] simpleExpansionPanelsWithOnlyOneOpenPanelData() { return new Object[][]{ {accordionExpansionPanels}, {insetExpansionPanels}, {focusableExpansionPanels}, {popOutExpansionPanels} }; }", "tokens": 52} {"id": 279435, "source": "method", "repo": "jdi-testing/jdi-light", "text": "public void bigDropdownTest() { String name = \"Charles Byers\"; StopWatch timer = StopWatch.createStarted(); userNames.select(name); System.out.println(\"Big dropdown test Time: \" + timer.getTime()); Assert.assertEquals(userNames.selected(), name); }", "tokens": 61} {"id": 279913, "source": "method", "repo": "jenkinsci/ansible-plugin", "text": "private ArgumentListBuilder appendPlaybook(ArgumentListBuilder args) { args.add(envVars.expand(playbook)); return args; }", "tokens": 28} {"id": 280017, "source": "method", "repo": "jenkinsci/ansible-plugin", "text": "public List getExtraVars() { return extraVars; }", "tokens": 17} {"id": 280044, "source": "method", "repo": "jenkinsci/ansible-plugin", "text": "public ListBoxModel doFillVaultCredentialsIdItems(@AncestorInPath Project project) { return new StandardListBoxModel() .withEmptySelection() .withMatching( anyOf(instanceOf(FileCredentials.class), instanceOf(StringCredentials.class)), CredentialsProvider.lookupCredentials(StandardCredentials.class, project)); }", "tokens": 60} {"id": 280100, "source": "method", "repo": "jenkinsci/ansicolor-plugin", "text": "public void emitOpen(Emitter emitter) { final String openingTagHtml = \"<\" + name + (attributes.trim().equals(\"\") ? \"\" : \" \" + attributes) + \">\"; emitter.emitHtml(openingTagHtml); }", "tokens": 51} {"id": 280186, "source": "method", "repo": "jenkinsci/ansicolor-plugin", "text": "private static DescriptorImpl getWrapperDescriptor() { return Jenkins.get().getDescriptorByType(DescriptorImpl.class); }", "tokens": 23} {"id": 280449, "source": "method", "repo": "jenkinsci/bitbucket-branch-source-plugin", "text": "public BitbucketDefaultBranch(@NonNull String repoOwner, @NonNull String repository, @NonNull String defaultBranch) { this.repoOwner = repoOwner; this.repository = repository; this.defaultBranch = defaultBranch; }", "tokens": 46} {"id": 280509, "source": "method", "repo": "jenkinsci/bitbucket-branch-source-plugin", "text": "/** The credentials that the {@link BitbucketSCMSource} will use. @return the credentials that the {@link BitbucketSCMSource} will use. */ public final String credentialsId() { return credentialsId; }", "tokens": 39} {"id": 280846, "source": "method", "repo": "jenkinsci/bitbucket-branch-source-plugin", "text": "private HmacAlgorithms getAlgorithm(String algorithm) { switch (StringUtils.lowerCase(algorithm)) { case \"sha1\": return HmacAlgorithms.HMAC_SHA_1; case \"sha256\": return HmacAlgorithms.HMAC_SHA_256; case \"sha384\": return HmacAlgorithms.HMAC_SHA_384; case \"sha512\": return HmacAlgorithms.HMAC_SHA_512; default: return null; } }", "tokens": 104} {"id": 281103, "source": "method", "repo": "jenkinsci/bitbucket-branch-source-plugin", "text": "public boolean isMatch(@NonNull SCMNavigator navigator) { return false; }", "tokens": 16} {"id": 281169, "source": "method", "repo": "jenkinsci/bitbucket-branch-source-plugin", "text": "void given__instance__when__multipleEndpoints__then__endpointsSelectable() { BitbucketEndpointConfiguration instance = new BitbucketEndpointConfiguration(); instance.setEndpoints( List.of( buildCloudEndpoint(true, \"first\"), new BitbucketServerEndpoint(\"Example Inc\", \"https://bitbucket.example.com/\", new ServerWebhookConfiguration(true, \"second\")), new BitbucketServerEndpoint(\"Example Org\", \"http://example.org:8080/bitbucket/\", new ServerWebhookConfiguration(true, \"third\")) )); assertThat(instance.isEndpointSelectable()).isTrue(); }", "tokens": 126} {"id": 281472, "source": "method", "repo": "jenkinsci/blueocean-plugin", "text": "public BitbucketServerEndpointContainer(Reachable parent) { this.self = parent.getLink().rel(\"servers\"); }", "tokens": 24} {"id": 281683, "source": "method", "repo": "jenkinsci/blueocean-plugin", "text": "protected String owner(@NonNull SCMNavigator scmNavigator) { if(scmNavigator instanceof GitHubSCMNavigator){ return ((GitHubSCMNavigator)scmNavigator).getRepoOwner(); } return null; }", "tokens": 37} {"id": 282200, "source": "method", "repo": "jenkinsci/blueocean-plugin", "text": "/** Exposes {@link RootRoutable}s to the URL space. Returns this if none found, allowing the UI to resolve routes. This also has the side effect that we won't be able to generate 404s for any URL that *might* resolve to a valid UI route. If and when we implement server-side rendering of initial state or to solidify the routes on the back-end for real 404s, we'll need to complicate this behaviour :D */ public Object getDynamic(String route) { // JVM will optimize this branch out typically: if (RunBundleWatches.isEnabled) { RunBundleWatches.waitForScriptBuilds(); } for (RootRoutable r : ExtensionList.lookup(RootRoutable.class)) { if (r.getUrlName().equals(route)) return r; } return this; }", "tokens": 189} {"id": 282336, "source": "method", "repo": "jenkinsci/build-monitor-plugin", "text": "public static String describe( String noItemsTemplate, String singularTemplate, String pluralTemplate, List items) { switch (items.size()) { case 0: return formatted(noItemsTemplate, items); case 1: return formatted(singularTemplate, items); default: return formatted(pluralTemplate, items); } }", "tokens": 75} {"id": 282497, "source": "method", "repo": "jenkinsci/build-monitor-plugin", "text": "public Headline asJson() { return new Headline(text(job.lastBuild())); }", "tokens": 23} {"id": 282684, "source": "method", "repo": "jenkinsci/build-monitor-plugin", "text": "void should_know_how_long_since_the_last_build_happened() throws Exception { String tenMinutesInMilliseconds = String.format(\"%d\", 10 * 60 * 1000); view = a(jobView() .which(new KnowsLastCompletedBuildDetails()) .of(a(job().whereTheLast(build().startedAt(\"18:05:00\").and().took(5)))) .assuming(currentTime().is(\"18:20:00\"))); assertThat(lastCompletedBuildOf(view).timeElapsedSince(), is(tenMinutesInMilliseconds)); }", "tokens": 139} {"id": 282688, "source": "method", "repo": "jenkinsci/build-monitor-plugin", "text": "void should_use_and_instead_of_a_comma_before_the_last_item() { assertThat(Lister.asString(listOf(\"apple\", \"orange\")), is(\"apple and orange\")); }", "tokens": 48} {"id": 282705, "source": "method", "repo": "jenkinsci/build-monitor-plugin", "text": "public BuildStateRecipe finishedWith(Result result) { lenient().when(build.getResult()).thenReturn(result); return this; }", "tokens": 28} {"id": 282890, "source": "method", "repo": "jenkinsci/build-pipeline-plugin", "text": "/** Constructs a List of downstream PipelineBuild objects that make up the current pipeline. @return - List of downstream PipelineBuild objects that make up the current pipeline. */ public List getDownstreamPipeline() { final List pbList = new ArrayList(); final AbstractProject currentProject; currentProject = getProject(); final List> downstreamProjects = ProjectUtil.getDownstreamProjects(currentProject); for (final AbstractProject proj : downstreamProjects) { AbstractBuild returnedBuild = null; if (this.currentBuild != null) { returnedBuild = BuildUtil.getDownstreamBuild(proj, currentBuild); } final PipelineBuild newPB = new PipelineBuild(returnedBuild, proj, this.currentBuild); pbList.add(newPB); } if (Hudson.getInstance().getPlugin(\"parameterized-trigger\") != null) { for (SubProjectsAction action : Util.filter(currentProject.getActions(), SubProjectsAction.class)) { for (BlockableBuildTriggerConfig config : action.getConfigs()) { for (final AbstractProject dependency : config.getProjectList(currentProject.getParent(), null)) { AbstractBuild returnedBuild = null; if (this.currentBuild != null) { returnedBuild = BuildUtil.getDownstreamBuild(dependency, currentBuild); } final PipelineBuild candidate = new PipelineBuild(returnedBuild, dependency, this.currentBuild); // if subprojects come back as downstreams someday, no duplicates wanted if (!pbList.contains(candidate)) { pbList.add(candidate); } } } } } return pbList; }", "tokens": 340} {"id": 283325, "source": "method", "repo": "jenkinsci/cobertura-plugin", "text": "public CoverageResult getCoverageResult(Run run) { CoberturaBuildAction rbb = run.getAction(CoberturaBuildAction.class); return rbb.getResult(); }", "tokens": 33} {"id": 283576, "source": "method", "repo": "jenkinsci/code-coverage-api-plugin", "text": "/** {@inheritDoc} */ public String getUrlName() { return \"coverage\"; }", "tokens": 18} {"id": 283650, "source": "method", "repo": "jenkinsci/code-coverage-api-plugin", "text": "protected StreamSource getRealXSL() throws FileNotFoundException { String xsl = getXSL(); if (StringUtils.isEmpty(xsl)) { throw new FileNotFoundException(\"Cannot found xsl file, xsl path must be no-empty\"); } return new StreamSource(getXSLResourceClass().getResourceAsStream(xsl)); }", "tokens": 67} {"id": 283696, "source": "method", "repo": "jenkinsci/code-coverage-api-plugin", "text": "/** Verifies that the mapping between the file paths of the current build and the former file paths of the reference builds are clearly assigned to each other. This is done to prevent an unexpected behavior triggered by a third party library in case that the code delta does not match with the coverage data. @param oldPathMapping The file path mapping @param log The log @throws CodeDeltaException when the mapping is ambiguous */ static void verifyOldPathMapping(final Map oldPathMapping, final FilteredLog log) throws CodeDeltaException { Set duplicates = StreamEx.of(oldPathMapping.values()) .distinct(2) .collect(Collectors.toSet()); Map duplicateEntries = oldPathMapping.entrySet().stream() .filter(entry -> duplicates.contains(entry.getValue())) .collect(Collectors.toMap(Entry::getKey, Entry::getValue)); if (!duplicates.isEmpty()) { String mismatches = duplicateEntries.entrySet().stream() .limit(20) // prevent log overflows .map(entry -> String.format(\"new: '%s' - former: '%s'\", entry.getKey(), entry.getValue())) .collect(Collectors.joining(\",\" + System.lineSeparator())); String errorMessage = CODE_DELTA_TO_COVERAGE_DATA_MISMATCH_ERROR_TEMPLATE + System.lineSeparator() + mismatches; throw new CodeDeltaException(errorMessage); } log.logInfo(\"Successfully verified that the coverage data matches with the code delta\"); }", "tokens": 318} {"id": 283750, "source": "method", "repo": "jenkinsci/code-coverage-api-plugin", "text": "/** Returns the coverage for the specified metric. @param searchMetric the metric to get the coverage for @return coverage ratio */ public Coverage getCoverage(final CoverageMetric searchMetric) { if (metric.equals(searchMetric)) { return coverage; } return CoverageBuilder.NO_COVERAGE; }", "tokens": 61} {"id": 283809, "source": "method", "repo": "jenkinsci/code-coverage-api-plugin", "text": "public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CoveragePercentage that = (CoveragePercentage) o; return numerator == that.numerator && denominator == that.denominator; }", "tokens": 65} {"id": 284006, "source": "method", "repo": "jenkinsci/code-coverage-api-plugin", "text": "public CoverageColumnType getSelectedCoverageColumnType() { return selectedCoverageColumnType; }", "tokens": 18} {"id": 284335, "source": "method", "repo": "jenkinsci/code-coverage-api-plugin", "text": "void shouldRecognizeInvalidLineNumberOfMethod() { MethodCoverageNode node = new MethodCoverageNode(NAME, 0); assertThat(node.hasValidLineNumber()).isFalse(); }", "tokens": 35} {"id": 284566, "source": "method", "repo": "jenkinsci/configuration-as-code-plugin", "text": "public void doViewExport(StaplerRequest2 req, StaplerResponse2 res) throws Exception { if (!Jenkins.get().hasPermission(Jenkins.SYSTEM_READ)) { res.sendError(HttpServletResponse.SC_FORBIDDEN); return; } ByteArrayOutputStream out = new ByteArrayOutputStream(); export(out); req.setAttribute(\"exportedYaml\", out.toString(StandardCharsets.UTF_8)); req.getView(this, \"viewExport.jelly\").forward(req, res); }", "tokens": 96} {"id": 284572, "source": "method", "repo": "jenkinsci/configuration-as-code-plugin", "text": "public void configure(Collection configParameters) throws ConfiguratorException { List newSources = new ArrayList<>(configParameters); try (FetchContext context = getConfigFromSources(newSources)) { sources = unmodifiableList(newSources); configureWith(context.getSources()); lastTimeLoaded = System.currentTimeMillis(); } }", "tokens": 70} {"id": 284809, "source": "method", "repo": "jenkinsci/configuration-as-code-plugin", "text": "public void merge(Node root, Node node, String source) throws ConfiguratorException { if (root.getNodeId() != node.getNodeId()) { // means one of those yaml file doesn't conform to JCasC schema throw new ConfiguratorException( String.format(\"Found incompatible configuration elements %s %s\", source, node.getStartMark())); } switch (root.getNodeId()) { case sequence: SequenceNode seq = (SequenceNode) root; SequenceNode seq2 = (SequenceNode) node; seq.getValue().addAll(seq2.getValue()); return; case mapping: MappingNode map = (MappingNode) root; MappingNode map2 = (MappingNode) node; // merge common entries final Iterator it = map2.getValue().iterator(); while (it.hasNext()) { NodeTuple t2 = it.next(); for (NodeTuple tuple : map.getValue()) { final Node key = tuple.getKeyNode(); final Node key2 = t2.getKeyNode(); if (key.getNodeId() == NodeId.scalar) { // We don't support merge for more complex cases (yet) if (((ScalarNode) key).getValue().equals(((ScalarNode) key2).getValue())) { merge(tuple.getValueNode(), t2.getValueNode(), source); it.remove(); } } else { throw new ConfiguratorException(String.format( \"Found non-mergeable configuration keys %s %s)\", source, node.getEndMark())); } } } // .. and add others map.getValue().addAll(map2.getValue()); return; default: new OverrideMergeStrategy().merge(root, node, source); } }", "tokens": 356} {"id": 285005, "source": "method", "repo": "jenkinsci/configuration-as-code-plugin", "text": "public void resolve_strictModeSysProp_throwsExceptionOnMissingVar() { System.setProperty(\"casc.strict.secret.resolution\", \"true\"); try { IllegalStateException exception = assertThrows(IllegalStateException.class, () -> { resolve(\"${ANOTHER_MISSING_VAR}\"); }); assertThat(exception.getMessage(), containsString(\"ANOTHER_MISSING_VAR\")); } finally { System.clearProperty(\"casc.strict.secret.resolution\"); } }", "tokens": 92} {"id": 285039, "source": "method", "repo": "jenkinsci/configuration-as-code-plugin", "text": "public void shouldSafelyHandleRawCollections() throws Exception { Type rawListType = getTypeOf(\"rawList\"); Configurator configurator = registry.lookup(rawListType); assertNull(\"Raw collections should safely fall through and return null\", configurator); }", "tokens": 50} {"id": 285200, "source": "method", "repo": "jenkinsci/configuration-as-code-plugin", "text": "void testRetrieveDocStringFromAttribute(JenkinsConfiguredWithCodeRule j) { String expectedDocString = \"If checked, this will allow users who are not authenticated to access Jenkins\\n in a read-only mode.\"; String actualDocString = retrieveDocStringFromAttribute( hudson.security.FullControlOnceLoggedInAuthorizationStrategy.class, \"allowAnonymousRead\"); assertEquals(expectedDocString, actualDocString); }", "tokens": 84} {"id": 285220, "source": "method", "repo": "jenkinsci/configuration-as-code-plugin", "text": "public void reloadReturnsOkWhenCalledWithValidToken() throws IOException, ServletException { System.setProperty(\"casc.reload.token\", \"someSecretValue\"); tokenReloadAction.doIndex(newRequest(\"someSecretValue\"), new ResponseImpl(null, response)); assertConfigReloaded(); }", "tokens": 59} {"id": 285306, "source": "method", "repo": "jenkinsci/configuration-as-code-plugin", "text": "public void shouldSetProxyWithSecretInFields() { ProxyConfiguration proxy = j.jenkins.proxy; assertEquals(proxy.name, \"proxyhost\"); assertEquals(proxy.port, 80); assertEquals(proxy.getUserName(), \"proxy_user\"); assertThat(proxy.getSecretPassword(), hasPlainText(\"proxy_password\")); assertEquals(proxy.noProxyHost, \"external.host\"); assertEquals(proxy.getTestUrl(), \"http://google.com\"); }", "tokens": 95} {"id": 285359, "source": "method", "repo": "jenkinsci/configuration-as-code-plugin", "text": "public PackageParametersNonNullCheckForNull(@CheckForNull Secret secret) { this.secret = secret; }", "tokens": 19} {"id": 285756, "source": "method", "repo": "jenkinsci/credentials-plugin", "text": "/** {@inheritDoc} */ public boolean updateCredentials(@NonNull Domain domain, @NonNull Credentials current, @NonNull Credentials replacement) throws IOException { return SystemCredentialsProvider.getInstance().updateCredentials(domain, current, replacement); }", "tokens": 45} {"id": 285824, "source": "method", "repo": "jenkinsci/credentials-plugin", "text": "public Set> describe() { HashSet> set = new HashSet<>(); Attribute system = new Attribute(\"system\", SystemCredentialsProvider.class) .getter(t -> SystemCredentialsProvider.getInstance()) .setter(noop()); set.add(system); for (CredentialsProvider provider : CredentialsProvider.all()) { String symbol = DescribableAttribute.getPreferredSymbol(provider.getDescriptor(), CredentialsProvider.class, provider.getClass()); set.add(new Attribute(symbol, provider.getClass()) .getter(t -> provider) .setter(noop())); } return set; }", "tokens": 160} {"id": 285835, "source": "method", "repo": "jenkinsci/credentials-plugin", "text": "/** Constructor. @see CredentialsStoreOptionHandler @see CredentialsStore @see OptionHandler */ public CredentialsStoreOptionHandler(CmdLineParser parser, OptionDef option, Setter setter) { super(parser, option, setter); }", "tokens": 48} {"id": 285998, "source": "method", "repo": "jenkinsci/credentials-plugin", "text": "public KeyStore toKeyStore(char[] password) throws NoSuchAlgorithmException, CertificateException, KeyStoreException, KeyStoreException, UnrecoverableKeyException, IOException { return toKeyStore(certChain.getPlainText(), privateKey.getPlainText(), password); }", "tokens": 50} {"id": 286435, "source": "method", "repo": "jenkinsci/docker-build-step-plugin", "text": "public String getDefaultServerAddress() { return AuthConfig.DEFAULT_SERVER_ADDRESS; }", "tokens": 19} {"id": 286447, "source": "method", "repo": "jenkinsci/docker-build-step-plugin", "text": "public DockerContainerConsoleAction(AbstractBuild build, String containerId) { super(); this.build = build; this.containerId = containerId; }", "tokens": 31} {"id": 286486, "source": "method", "repo": "jenkinsci/docker-build-step-plugin", "text": "public String getDns() { return dns; }", "tokens": 11} {"id": 286547, "source": "method", "repo": "jenkinsci/docker-build-step-plugin", "text": "public void execute(Launcher launcher, @SuppressWarnings(\"rawtypes\") AbstractBuild build, ConsoleLogger console) throws DockerException { try { Config cfgData = getConfig(build); Descriptor descriptor = Jenkins.getInstance().getDescriptor(DockerBuilder.class); List containers = launcher.getChannel().call(new ListContainersRemoteCallable(cfgData, descriptor, false)); for (Container container : containers) { launcher.getChannel().call(new RemoveContainerRemoteCallable(cfgData, descriptor, container.getId(), force, removeVolumes)); console.logInfo(\"removed container id \" + container.getId()); } } catch (Exception e) { console.logError(\"failed to stop all containers\"); e.printStackTrace(); throw new IllegalArgumentException(e); } }", "tokens": 153} {"id": 286638, "source": "method", "repo": "jenkinsci/docker-build-step-plugin", "text": "public void close() throws IOException { closed = true; // Jersey will close the stream and release the connection after we read // all the data. // We cannot call the stream's close method because it an instance of // UncloseableInputStream, // where close is a no-op. copy(stream, new OutputStream() { /** Discards the specified byte. */ @Override public void write(int b) { } /** Discards the specified byte array. */ @Override public void write(byte[] b) { checkNotNull(b); } /** Discards the specified byte array. */ @Override public void write(byte[] b, int off, int len) { checkNotNull(b); } @Override public String toString() { return \"ByteStreams.nullOutputStream()\"; }; }); }", "tokens": 168} {"id": 286751, "source": "method", "repo": "jenkinsci/docker-plugin", "text": "public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } DockerCloud that = (DockerCloud) o; // Maintenance note: This should include all non-transient fields. // Fields that are \"usually unique\" should go first. // Primitive fields should be tested before objects. // Computationally-expensive fields get tested last. // Note: If modifying this code, remember to update hashCode() and toString() if (!Objects.equals(name, that.name)) { return false; } if (!Objects.equals(dockerApi, that.dockerApi)) { return false; } if (containerCap != that.containerCap) { return false; } if (exposeDockerHost != that.exposeDockerHost) { return false; } if (!getDisabled().equals(that.getDisabled())) { return false; } if (!Objects.equals(templates, that.templates)) { return false; } return true; }", "tokens": 219} {"id": 286772, "source": "method", "repo": "jenkinsci/docker-plugin", "text": "public WatchdogProcessingTimeout() { super(); }", "tokens": 11} {"id": 286817, "source": "method", "repo": "jenkinsci/docker-plugin", "text": "public String getAdditionalTag() { return additionalTag; }", "tokens": 13} {"id": 286884, "source": "method", "repo": "jenkinsci/docker-plugin", "text": "public String getDisplayName() { return dockerTemplateBase.getDisplayName(); }", "tokens": 13} {"id": 287192, "source": "method", "repo": "jenkinsci/docker-plugin", "text": "private ConnectionCheck(String host, int port) { this.host = host; this.port = port; }", "tokens": 25} {"id": 287284, "source": "method", "repo": "jenkinsci/docker-plugin", "text": "K getKey() { return mKey; }", "tokens": 11} {"id": 287466, "source": "method", "repo": "jenkinsci/docker-plugin", "text": "private static void testFillContainerShmSize( final String imageName, final Integer shmSizeToSet, final boolean shmSizeIsExpectedToBeSet, final Long expectedShmSizeSet) { // Given final CreateContainerCmd mockCmd = mock(CreateContainerCmd.class); final HostConfig mockHostConfig = mock(HostConfig.class); when(mockCmd.getHostConfig()).thenReturn(mockHostConfig); final DockerTemplateBase instanceUnderTest = new DockerTemplateBase(imageName); instanceUnderTest.setShmSize(shmSizeToSet); // When instanceUnderTest.fillContainerConfig(mockCmd); // Then if (shmSizeIsExpectedToBeSet) { verify(mockHostConfig, times(1)).withShmSize(expectedShmSizeSet); } else { verify(mockHostConfig, never()).withShmSize(anyLong()); } }", "tokens": 177} {"id": 287493, "source": "method", "repo": "jenkinsci/docker-plugin", "text": "void testLimits() { DockerTemplate instance; instance = getDockerTemplateInstanceWithDNSHost(\"\"); assertEquals(1024, instance.getDockerTemplateBase().memoryLimit.intValue(), \"Error, wrong memoryLimit\"); assertEquals(1280, instance.getDockerTemplateBase().memorySwap.intValue(), \"Error, wrong memorySwap\"); assertEquals(1000, instance.getDockerTemplateBase().cpuShares.intValue(), \"Error, wrong cpuShares\"); assertEquals(1002, instance.getDockerTemplateBase().shmSize.intValue(), \"Error, wrong shmSize\"); }", "tokens": 124} {"id": 287503, "source": "method", "repo": "jenkinsci/docker-plugin", "text": "public List getContainersRemoved() { return List.copyOf(containersRemoved); }", "tokens": 21} {"id": 287507, "source": "method", "repo": "jenkinsci/docker-plugin", "text": "public static DockerTransientNode createMockedDockerTransientNode( String containerId, String nodeName, DockerCloud cloud, boolean offline) { DockerTransientNode result = Mockito.mock(DockerTransientNode.class); Mockito.when(result.getContainerId()).thenReturn(containerId); Mockito.when(result.getNodeName()).thenReturn(nodeName); Mockito.when(result.getCloud()).thenReturn(cloud); SlaveComputer sc = Mockito.mock(SlaveComputer.class); Mockito.when(sc.isOffline()).thenReturn(offline); Mockito.when(result.getComputer()).thenReturn(sc); return result; }", "tokens": 121} {"id": 287588, "source": "method", "repo": "jenkinsci/docker-plugin", "text": "private void testAgentCanStartAndConnect(final DockerComputerAttachConnector connector, final String testName) throws IOException, ExecutionException, InterruptedException, TimeoutException { final String imagenameAndVersion = ATTACH_AGENT_IMAGE_IMAGENAME + ':' + getJenkinsDockerImageVersionForThisEnvironment(); final DockerTemplate template = new DockerTemplate( new DockerTemplateBase(imagenameAndVersion), connector, getLabelForTemplate(), COMMON_IMAGE_HOMEDIR, INSTANCE_CAP); template.setName(testName); should_connect_agent(template); }", "tokens": 114} {"id": 287650, "source": "method", "repo": "jenkinsci/docker-workflow-plugin", "text": "public LinkedList getFroms() { return froms; }", "tokens": 16} {"id": 287660, "source": "method", "repo": "jenkinsci/docker-workflow-plugin", "text": "public String getFunctionName() { return \"dockerFingerprintFrom\"; }", "tokens": 15} {"id": 287661, "source": "method", "repo": "jenkinsci/docker-workflow-plugin", "text": "public String getDisplayName() { return \"Record trace of a Docker image used in FROM\"; }", "tokens": 19} {"id": 287842, "source": "method", "repo": "jenkinsci/docker-workflow-plugin", "text": "public Set> getRequiredContext() { return ImmutableSet.of(Launcher.class); }", "tokens": 22} {"id": 287951, "source": "method", "repo": "jenkinsci/ec2-plugin", "text": "private void fetchLiveInstanceData(boolean force) throws SdkException { /* * If we've grabbed the data recently, don't bother getting it again unless we are forced */ long now = System.currentTimeMillis(); if ((lastFetchTime > 0) && (now - lastFetchTime < MIN_FETCH_TIME) && !force) { return; } if (getInstanceId() == null || getInstanceId().isEmpty()) { /* * The getInstanceId() implementation on EC2SpotSlave can return null if the spot request doesn't yet know * the instance id that it is starting. What happens is that null is passed to getInstanceId() which * searches AWS but without an instanceID the search returns some random box. We then fetch its metadata, * including tags, and then later, when the spot request eventually gets the instanceID correctly we push * the saved tags from that random box up to the new spot resulting in confusion and delay. */ return; } Instance i = null; try { i = CloudHelper.getInstanceWithRetry(getInstanceId(), getCloud()); } catch (InterruptedException e) { // We'll just retry next time we test for idleness. LOGGER.fine(\"InterruptedException while get \" + getInstanceId() + \" Exception: \" + e); return; } lastFetchTime = now; lastFetchInstance = i; if (i == null) { return; } updateFromFetchedInstance(i); }", "tokens": 301} {"id": 287954, "source": "method", "repo": "jenkinsci/ec2-plugin", "text": "/** Updates instance data from a pre-fetched Instance. Used by batch operations (e.g. EC2SlaveMonitor) to avoid per-node EC2 API calls. */ protected void updateFromFetchedInstance(Instance i) { long now = System.currentTimeMillis(); lastFetchTime = now; lastFetchInstance = i; noteLifecycle(i); publicDNS = i.publicDnsName(); privateDNS = i.privateIpAddress(); createdTime = i.launchTime(); instanceType = i.instanceType().name(); /* * Only fetch tags from live instance if tags are set. This check is required to mitigate a race condition * when fetchLiveInstanceData() is called before pushLiveInstancedata(). */ if (!i.tags().isEmpty()) { tags = new LinkedList<>(); for (Tag t : i.tags()) { tags.add(new EC2Tag(t.key(), t.value())); } } }", "tokens": 193} {"id": 288262, "source": "method", "repo": "jenkinsci/ec2-plugin", "text": "public FormValidation doValidateType(@QueryParameter String value) { InstanceType instanceType = InstanceType.fromValue(value); if (instanceType == InstanceType.UNKNOWN_TO_SDK_VERSION) { return FormValidation.error(\"Instance type unknown to SDK version\"); } return FormValidation.ok(); }", "tokens": 60} {"id": 288331, "source": "method", "repo": "jenkinsci/ec2-plugin", "text": "HostKey getKeyFromLine( @NonNull final Logger logger, @NonNull final String line, @Nullable final TaskListener listener) { String[] parts = line.split(\" \"); if (parts.length >= 2) { // The public SSH key in the console is Base64 encoded return new HostKey(parts[0], Base64.getDecoder().decode(parts[1])); } else { EC2Cloud.log( logger, Level.INFO, listener, String.format( \"The line with the key doesn't have the required format. Found: \\\"%s\\\". Expected a line with this text: \\\"ALGORITHM THEHOSTKEY\\\", example: \\\"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJbvbEIoY3tqKwkeRW/L1FnbCLLp8a1TwSOyZHKJqFFR \\\"\", line)); return null; } }", "tokens": 210} {"id": 288655, "source": "method", "repo": "jenkinsci/ec2-plugin", "text": "/** By default a weight is a share of the requests: weights 3 and 1 pick the heavier template three times as often, and the picks interleave instead of bursting, which is what makes the fallback to the lighter template fast. */ void testWeightedRotationInterleavesPicks() { LabelTemplateRotation rotation = rotation(); List group = List.of(template(\"spot\", 3), template(\"ondemand\", 1)); List heads = heads(rotation, group, 8); assertThat(heads, contains(\"spot\", \"spot\", \"ondemand\", \"spot\", \"spot\", \"spot\", \"ondemand\", \"spot\")); assertThat( \"the heavier template should lead six of eight requests\", heads.stream().filter(\"spot\"::equals).count(), equalTo(6L)); }", "tokens": 181} {"id": 288710, "source": "method", "repo": "jenkinsci/ec2-plugin", "text": "void testDeleteShellMessage() { DeleteShellRequest r = new DeleteShellRequest(url, \"SHELLID\"); assertEquals(\"http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete\", xpath(\"//a:Action\", r.build())); assertEquals(\"http://localhost\", xpath(\"//a:To\", r.build())); assertEquals(\"SHELLID\", xpath(\"//w:Selector[@Name=\\\"ShellId\\\"]\", r.build())); }", "tokens": 96} {"id": 288735, "source": "method", "repo": "jenkinsci/ec2-plugin", "text": "private StrategyTest forAcceptNewStrategy() throws Exception { return new StrategyTest(\"-acceptNewStrategy\", HostKeyVerificationStrategyEnum.ACCEPT_NEW) // We don't even check the console .addConnectionAttempt(builder() .setState(InstanceState.PENDING) .setMessagesInLog(new String[] {\"has been automatically trusted for connections\"})) .addConnectionAttempt(builder() .setMessagesInLog(new String[] {\"Connection allowed after the host key has been verified\"})); }", "tokens": 108} {"id": 288864, "source": "method", "repo": "jenkinsci/email-ext-plugin", "text": "public void setTo(@CheckForNull String to) { this.to = Util.fixNull(to); }", "tokens": 23} {"id": 288930, "source": "method", "repo": "jenkinsci/email-ext-plugin", "text": "public void setMatrixTriggerMode(MatrixTriggerMode matrixTriggerMode) { this.matrixTriggerMode = matrixTriggerMode; }", "tokens": 27} {"id": 289031, "source": "method", "repo": "jenkinsci/email-ext-plugin", "text": "public void debug(PrintStream logger, String format, Object... args) { if (debugMode) { logger.format(format, args); logger.println(); } }", "tokens": 38} {"id": 289066, "source": "method", "repo": "jenkinsci/email-ext-plugin", "text": "public boolean isUseTls() { return useTls; }", "tokens": 13} {"id": 289092, "source": "method", "repo": "jenkinsci/email-ext-plugin", "text": "public boolean permitsMethod(@NonNull Method method, @NonNull Object receiver, @NonNull Object[] args) { if (permitsInstance(receiver) && isClass(method.getDeclaringClass())) { String name = method.getName(); return name.equals(\"write\") || name.equals(\"print\") || name.equals(\"println\") || name.equals(\"printf\") || name.equals(\"format\") || name.equals(\"append\"); } return false; }", "tokens": 95} {"id": 289096, "source": "method", "repo": "jenkinsci/email-ext-plugin", "text": "public Writable make(final Map map) { return new Writable() { /** * Write the template document with the set binding applied to the writer. * * @see groovy.lang.Writable#writeTo(java.io.Writer) */ @Override public Writer writeTo(Writer writer) throws IOException { Binding binding; if (map == null) { binding = new Binding(); } else { binding = new Binding(map); } PrintWriter pw = new PrintWriter(writer); try { if (sandbox) { // Cannot use normal GroovySandbox.runScript here because template preparation // was // separated. try (GroovySandbox.Scope scope = new GroovySandbox().enter()) { final Script scriptObject = InvokerHelper.createScript(script.getClass(), binding); scriptObject.setProperty(\"out\", pw); scriptObject.run(); } } else { final Script scriptObject = InvokerHelper.createScript(script.getClass(), binding); scriptObject.setProperty(\"out\", pw); scriptObject.run(); } } catch (MissingPropertyException x) { throw (IOException) new IOException( \"did you forget to escape \\\\$\" + x.getProperty() + \" for non-Groovy variables?\") .initCause(x); } catch (RuntimeException x) { if (x.getCause() instanceof java.io.NotSerializableException) { throw new GroovyRuntimeException(Messages.SimpleTemplateEngine_NotSerializableError(), x); } throw x; } pw.flush(); return writer; } /** * Convert the template and binding into a result String. * * @see java.lang.Object#toString() */ @Override public String toString() { StringWriter sw = new StringWriter(); try { writeTo(sw); } catch (IOException x) { PrintWriter pw = new PrintWriter(sw); x.printStackTrace(pw); pw.flush(); } return sw.toString(); } }; }", "tokens": 388} {"id": 289160, "source": "method", "repo": "jenkinsci/email-ext-plugin", "text": "private void populateArgs(Object args, Map map, ListMultimap multiMap) { if (args instanceof Object[] argArray) { if (argArray.length > 0) { Map argMap = (Map) argArray[0]; for (Map.Entry entry : argMap.entrySet()) { String value = entry.getValue().toString(); if (entry.getValue() instanceof List) { List valueList = (List) entry.getValue(); for (Object v : valueList) { multiMap.put(entry.getKey(), v.toString()); } value = valueList.get(valueList.size() - 1).toString(); } else { multiMap.put(entry.getKey(), value); } map.put(entry.getKey(), value); } } } }", "tokens": 191} {"id": 289161, "source": "method", "repo": "jenkinsci/email-ext-plugin", "text": "public Object methodMissing(String name, Object args) throws MacroEvaluationException, IOException, InterruptedException { TokenMacro macro = null; for (TokenMacro m : TokenMacro.all()) { if (m.acceptsMacroName(name)) { macro = m; break; } } if (macro == null) { for (TokenMacro m : ContentBuilder.getPrivateMacros()) { if (m.acceptsMacroName(name)) { macro = m; break; } } } if (macro != null) { Map argsMap = new HashMap<>(); ListMultimap argsMultimap = ArrayListMultimap.create(); populateArgs(args, argsMap, argsMultimap); // Get the build, workspace and listener from the binding. Run build = (Run) this.getBinding().getVariable(\"build\"); FilePath workspace = (FilePath) this.getBinding().getVariable(\"workspace\"); TaskListener listener = (TaskListener) this.getBinding().getVariable(\"listener\"); return macro.evaluate(build, workspace, listener, name, argsMap, argsMultimap); } else { // try environment variables // Get the build and listener from the binding. Run build = (Run) this.getBinding().getVariable(\"build\"); TaskListener listener = (TaskListener) this.getBinding().getVariable(\"listener\"); EnvVars vars = EmailExtScriptTokenMacroWhitelist.getCachedEnvVars(); if (vars == null) { // Fallback if called outside sandbox context vars = build.getEnvironment(listener); } if (vars.containsKey(name)) { return vars.get(name, \"\"); } } return \"[Could not find content token (check your usage): %s]\".formatted(name); }", "tokens": 357} {"id": 289191, "source": "method", "repo": "jenkinsci/email-ext-plugin", "text": "public int read(@NonNull byte[] b) throws IOException { return delegate.read(b); }", "tokens": 21} {"id": 289243, "source": "method", "repo": "jenkinsci/email-ext-plugin", "text": "public boolean trigger(AbstractBuild build, TaskListener listener) { return build.getResult() == Result.ABORTED; }", "tokens": 25} {"id": 289346, "source": "method", "repo": "jenkinsci/email-ext-plugin", "text": "/** Verifies that the initializer sets {@code mail.smtp.sendpartial} to {@code \"true\"} when the property is absent. */ void staticInitializerSetsSmtpSendPartialToTrue() throws ReflectiveOperationException { String originalSmtp = System.getProperty(SMTP_SENDPARTIAL); String originalSmtps = System.getProperty(SMTPS_SENDPARTIAL); try { System.clearProperty(SMTP_SENDPARTIAL); System.clearProperty(SMTPS_SENDPARTIAL); loadFreshPluginClass(); assertEquals(\"true\", System.getProperty(SMTP_SENDPARTIAL), SMTP_SENDPARTIAL + \" should be \\\"true\\\"\"); } finally { restoreProperty(SMTP_SENDPARTIAL, originalSmtp); restoreProperty(SMTPS_SENDPARTIAL, originalSmtps); } }", "tokens": 152} {"id": 289366, "source": "method", "repo": "jenkinsci/email-ext-plugin", "text": "void shouldUseCorrectCredentialsAfterUpgrade(JenkinsConfiguredWithCodeRule r) throws Exception { final ExtendedEmailPublisherDescriptor descriptor = ExtensionList.lookupSingleton(ExtendedEmailPublisherDescriptor.class); FreeStyleBuild build = Mockito.mock(FreeStyleBuild.class); Authenticator authenticator = descriptor.getAuthenticatorProvider().apply(descriptor.getMailAccount(), build); Method method = authenticator.getClass().getDeclaredMethod(\"getPasswordAuthentication\"); PasswordAuthentication passwordAuthentication = (PasswordAuthentication) method.invoke(authenticator); assertNotNull(passwordAuthentication); assertEquals(\"smtp-username-xyz\", passwordAuthentication.getUserName()); assertEquals(\"smtp-password-xyz\", passwordAuthentication.getPassword()); }", "tokens": 124} {"id": 289443, "source": "method", "repo": "jenkinsci/email-ext-plugin", "text": "void testIsValidAuthConfigAndTLS() { MailAccount account = new MailAccount(); account.setAddress(\"joe@example.com\"); account.setCredentialsId(\"foo\"); account.setUseTls(true); assertTrue(account.isValid()); }", "tokens": 49} {"id": 289787, "source": "method", "repo": "jenkinsci/embeddable-build-status-plugin", "text": "/** Helper method to reset the cached font metrics for testing */ private void resetFontCache() throws Exception { Field cachedFontMetricsField = StatusImage.class.getDeclaredField(\"cachedFontMetrics\"); cachedFontMetricsField.setAccessible(true); cachedFontMetricsField.set(null, null); }", "tokens": 61} {"id": 289974, "source": "method", "repo": "jenkinsci/ghprb-plugin", "text": "public static GHCommitState getState(Run build) { GHCommitState state; if (build.getResult() == Result.SUCCESS) { state = GHCommitState.SUCCESS; } else if (build.getResult() == Result.UNSTABLE) { state = GhprbTrigger.getDscp().getUnstableAs(); } else { state = GHCommitState.FAILURE; } return state; }", "tokens": 75} {"id": 290141, "source": "method", "repo": "jenkinsci/ghprb-plugin", "text": "public String evaluate( AbstractBuild context, TaskListener listener, String macroName, Map arguments, ListMultimap argumentMultimap ) throws MacroEvaluationException, IOException, InterruptedException { GhprbCause cause = (GhprbCause) context.getCause(GhprbCause.class); if (cause == null) { return \"\"; } if (macroName.equals(\"PR_Title\")) { return cause.getTitle(); } else if (macroName.equals(\"PR_Email\")) { return cause.getAuthorEmail(); } else { return \"\"; } }", "tokens": 119} {"id": 290251, "source": "method", "repo": "jenkinsci/ghprb-plugin", "text": "private void checkCommentsFile() { if (!StringUtils.isEmpty(commentFilePath)) { GhprbCommentFile comments = new GhprbCommentFile(commentFilePath); addIfMissing(comments); commentFilePath = null; } }", "tokens": 43} {"id": 290303, "source": "method", "repo": "jenkinsci/ghprb-plugin", "text": "public GhprbSimpleStatus(String commitStatusContext) { this(false, commitStatusContext, null, null, null, false, new ArrayList(0)); }", "tokens": 39} {"id": 290357, "source": "method", "repo": "jenkinsci/ghprb-plugin", "text": "/** Adds admins for this job. */ public void admin(String admin) { admins.add(admin); }", "tokens": 26} {"id": 290379, "source": "method", "repo": "jenkinsci/ghprb-plugin", "text": "/** Build every pull request automatically without asking. */ public void permitAll(boolean permitAll) { this.permitAll = permitAll; }", "tokens": 29} {"id": 290434, "source": "method", "repo": "jenkinsci/ghprb-plugin", "text": "public void checkCancelBuildsOnUpdateForGetters() { checkClassForGetters(GhprbCancelBuildsOnUpdate.class); }", "tokens": 28} {"id": 290476, "source": "method", "repo": "jenkinsci/ghprb-plugin", "text": "private void startTrigger() throws IOException { trigger.start(project, true); trigger.setHelper(helper); }", "tokens": 25} {"id": 290503, "source": "method", "repo": "jenkinsci/ghprb-plugin", "text": "private static String getCredentialsId() throws Exception { if (credentialsId == null) { credentialsId = setUpCredentials(); } return credentialsId; }", "tokens": 27} {"id": 290821, "source": "method", "repo": "jenkinsci/git-client-plugin", "text": "/** {@inheritDoc} */ public void tag(String tagName, String comment) throws GitException, InterruptedException { proxy.tag(tagName, comment); }", "tokens": 31} {"id": 290929, "source": "method", "repo": "jenkinsci/git-client-plugin", "text": "/** Creates a secure shell host key verification strategy that uses the existing 'known_hosts' file on the controller and on the agent. This assumes the administrator has already configured this file on the controller and on all agents */ public KnownHostsFileVerificationStrategy() { // stapler needs @DataBoundConstructor }", "tokens": 62} {"id": 290983, "source": "method", "repo": "jenkinsci/git-client-plugin", "text": "/** Returns a new fresh folder with a random name under the temporary folder. */ public File newFolder() throws IOException { return createTemporaryFolderIn(getRoot()); }", "tokens": 34} {"id": 291067, "source": "method", "repo": "jenkinsci/git-client-plugin", "text": "void testMergeSquash() throws Exception { workspace.commitEmpty(\"init\"); // First commit to branch1 testGitClient.branch(\"branch1\"); testGitClient.checkout().ref(\"branch1\").execute(); workspace.touch(testGitDir, \"file1\", \"content1\"); testGitClient.add(\"file1\"); testGitClient.commit(\"commit1\"); // Second commit to branch2 workspace.touch(testGitDir, \"file2\", \"content2\"); testGitClient.add(\"file2\"); testGitClient.commit(\"commit2\"); // Merge branch1 with default branch, squashing both commits testGitClient.checkout().ref(defaultBranchName).execute(); testGitClient .merge() .setSquash(true) .setRevisionToMerge(testGitClient.getHeadRev(testGitDir.getAbsolutePath(), \"branch1\")) .execute(); // Compare commit counts of before and after committing the merge, should be one due to the squashing of // commits. final int commitCountBefore = testGitClient.revList(\"HEAD\").size(); testGitClient.commit(\"commitMerge\"); final int commitCountAfter = testGitClient.revList(\"HEAD\").size(); assertEquals( 1, commitCountAfter - commitCountBefore, \"Squash merge failed. Should have merged only one commit.\"); }", "tokens": 257} {"id": 291471, "source": "method", "repo": "jenkinsci/git-plugin", "text": "private GitChangeSet parseCommit(List lines, boolean authorOrCommitter) { return new GitChangeSet(lines, authorOrCommitter, showEntireCommitSummaryInChanges); }", "tokens": 38} {"id": 291542, "source": "method", "repo": "jenkinsci/git-plugin", "text": "/** @deprecated @param build run whose build data is returned @param clone true if returned build data should be copied rather than referenced @return build data for build run */ public BuildData getBuildData(Run build, boolean clone) { return clone ? copyBuildData(build) : getBuildData(build); }", "tokens": 64} {"id": 291816, "source": "method", "repo": "jenkinsci/git-plugin", "text": "/** Returns the name to give the remote. @return the name to give the remote. */ public final String remoteName() { return remoteName; }", "tokens": 32} {"id": 292054, "source": "method", "repo": "jenkinsci/git-plugin", "text": "public TestGitTagAction(Run build, FilePath workspace, Revision revision) { super(build, workspace, revision); }", "tokens": 26} {"id": 292067, "source": "method", "repo": "jenkinsci/git-plugin", "text": "void afterEach() { GitSCM.ALLOW_LOCAL_CHECKOUT = false; }", "tokens": 18} {"id": 292078, "source": "method", "repo": "jenkinsci/git-plugin", "text": "List remoteConfigs(StandardCredentials credentials) { String credentialsId = credentials == null ? null : credentials.getId(); List list = new ArrayList<>(); list.add(new UserRemoteConfig(gitDir.getAbsolutePath(), \"origin\", \"\", credentialsId)); return list; }", "tokens": 58} {"id": 292197, "source": "method", "repo": "jenkinsci/git-plugin", "text": "void testToStringDataBoundConstructor() { submoduleOption = new SubmoduleOption(); assertThat(submoduleOption.toString(), is(\"SubmoduleOption{\" + \"disableSubmodules=false\" + \", recursiveSubmodules=false\" + \", trackingSubmodules=false\" + \", reference='null'\" + \", parentCredentials=false\" + \", timeout=null\" + \", shallow=false\" + \", depth=null\" + \", threads=null\" + '}')); }", "tokens": 101} {"id": 292207, "source": "method", "repo": "jenkinsci/git-plugin", "text": "void afterEach() throws Exception { BuildData.LOGGER.removeHandler(handler); BuildData.LOGGER.setUseParentHandlers(ORIGINAL_USE_PARENT_HANDLERS); BuildData.LOGGER.setLevel(ORIGINAL_LEVEL); }", "tokens": 48} {"id": 292308, "source": "method", "repo": "jenkinsci/git-plugin", "text": "void testBuild_3args_2() throws Exception { Item owner = new ItemImpl(); SCM scm = getSingleBranchSource(remote); SCMHead head = new SCMHead(\"some-name\"); String SHA1 = \"0123456789abcdef0123456789abcdef01234567\"; SCMRevision rev = new AbstractGitSCMSource.SCMRevisionImpl(head, SHA1); SCMFileSystem fileSystem = telescope.build(owner, scm, rev); assertThat(fileSystem.getRevision(), is(rev)); assertThat(fileSystem.isFixedRevision(), is(true)); }", "tokens": 133} {"id": 292389, "source": "method", "repo": "jenkinsci/gitea-plugin", "text": "/** Gets the authority. @return the authority. */ public SCMHeadAuthority getTrust() { return trust; }", "tokens": 42} {"id": 292521, "source": "method", "repo": "jenkinsci/gitea-plugin", "text": "public final boolean wantPRs() { return wantOriginPRs || wantForkPRs; }", "tokens": 21} {"id": 292548, "source": "method", "repo": "jenkinsci/gitea-plugin", "text": "/** Returns the branch details or an empty list if either the request did not specify to {@link #isFetchBranches()} or if the branch details have not been provided by {@link #setBranches(Iterable)} yet. @return the branch details (may be empty) */ public final Iterable getBranches() { return Util.fixNull(branches); }", "tokens": 76} {"id": 292682, "source": "method", "repo": "jenkinsci/gitea-plugin", "text": "/** {@inheritDoc} */ public String toString() { return \"GiteaCommitStatus{\" + \"id=\" + id + \", url='\" + url + '\\'' + \", context='\" + context + '\\'' + \", description='\" + description + '\\'' + \", targetUrl='\" + targetUrl + '\\'' + \", state=\" + state + \", createdAt=\" + createdAt + \", updatedAt=\" + updatedAt + '}'; }", "tokens": 87} {"id": 292692, "source": "method", "repo": "jenkinsci/gitea-plugin", "text": "public static GiteaEventType fromString(String key) { for (GiteaEventType s : values()) { if (key.equals(s.key)) { return s; } } return null; }", "tokens": 43} {"id": 292749, "source": "method", "repo": "jenkinsci/gitea-plugin", "text": "public String getAvatarUrl() { return avatarUrl; }", "tokens": 13} {"id": 292799, "source": "method", "repo": "jenkinsci/gitea-plugin", "text": "public GiteaReleaseEvent clone() { return (GiteaReleaseEvent) super.clone(); }", "tokens": 19} {"id": 293109, "source": "method", "repo": "jenkinsci/github-branch-source-plugin", "text": "/** {@inheritDoc} */ protected void decorateContext(SCMNavigatorContext context) { super.decorateContext(context); GitHubSCMNavigatorContext ctx = (GitHubSCMNavigatorContext) context; ctx.setExcludeArchivedRepositories(true); }", "tokens": 47} {"id": 293110, "source": "method", "repo": "jenkinsci/github-branch-source-plugin", "text": "public String getDisplayName() { return Messages.ExcludeArchivedRepositoriesTrait_displayName(); }", "tokens": 17} {"id": 293166, "source": "method", "repo": "jenkinsci/github-branch-source-plugin", "text": "public Class type() { return GitHubAppCredentials.class; }", "tokens": 19} {"id": 293407, "source": "method", "repo": "jenkinsci/github-branch-source-plugin", "text": "/** {@inheritDoc} */ public void close() throws IOException { if (pullRequests instanceof Closeable) { ((Closeable) pullRequests).close(); } if (branches instanceof Closeable) { ((Closeable) branches).close(); } if (permissionsSource instanceof Closeable) { ((Closeable) permissionsSource).close(); } super.close(); }", "tokens": 73} {"id": 293482, "source": "method", "repo": "jenkinsci/github-branch-source-plugin", "text": "private UntrustedPullRequestSCMRevision(SCMHead head, String hash, String baseHash) { super(head, hash); this.baseHash = baseHash; }", "tokens": 33} {"id": 293776, "source": "method", "repo": "jenkinsci/github-branch-source-plugin", "text": "public void testExistingMultipleTags() throws IOException { // Scenario: Requesting multiple tags SCMHeadObserver mockSCMHeadObserver = Mockito.mock(SCMHeadObserver.class); Mockito.when(mockSCMHeadObserver.getIncludes()) .thenReturn(new HashSet<>(Arrays.asList( new GitHubTagSCMHead(\"existent-multiple-tags1\", System.currentTimeMillis()), new GitHubTagSCMHead(\"existent-multiple-tags2\", System.currentTimeMillis())))); GitHubSCMSourceContext context = new GitHubSCMSourceContext(null, mockSCMHeadObserver); context.wantTags(true); GitHubSCMSourceRequest request = context.newRequest(new GitHubSCMSource(\"cloudbeers\", \"yolo\", null, false), null); Iterator tags = new GitHubSCMSource.LazyTags(request, repo).iterator(); // Expected: When getting the tags, we should get both tags and then we are failing on trying to // get a 3rd tag or remove the iterator assertTrue(tags.hasNext()); assertEquals(\"refs/tags/existent-multiple-tags1\", tags.next().getRef()); assertTrue(tags.hasNext()); assertEquals(\"refs/tags/existent-multiple-tags2\", tags.next().getRef()); assertFalse(tags.hasNext()); try { tags.next(); fail(\"This should throw an exception\"); } catch (NoSuchElementException e) { // Error is expected here so this is \"success\" assertNotEquals(\"This should throw an exception\", e.getMessage()); } try { tags.remove(); fail(\"This should throw an exception\"); } catch (UnsupportedOperationException e) { // Error is expected here so this is \"success\" assertNotEquals(\"This should throw an exception\", e.getMessage()); } }", "tokens": 332} {"id": 293919, "source": "method", "repo": "jenkinsci/github-oauth-plugin", "text": "public boolean canConvert(Class type) { return type == GithubSecurityRealm.class; }", "tokens": 19} {"id": 293963, "source": "method", "repo": "jenkinsci/github-oauth-plugin", "text": "private void sendResponse(HttpExchange he, String response) throws IOException { byte[] body = response.getBytes(StandardCharsets.UTF_8); he.sendResponseHeaders(HttpURLConnection.HTTP_OK, body.length); try (OutputStream os = he.getResponseBody()) { os.write(body); } }", "tokens": 63} {"id": 293967, "source": "method", "repo": "jenkinsci/github-oauth-plugin", "text": "void preventSessionFixation() throws Exception { TestRootAction rootAction = j.jenkins.getExtensionList(UnprotectedRootAction.class).get(TestRootAction.class); assertNotNull(rootAction); wc = j.createWebClient(); servlet.currentLogin = \"alice\"; servlet.organizations = Collections.singletonList(\"org-a\"); servlet.teams = Collections.singletonList(\"team-b\"); String sessionIdBefore = checkSessionFixationWithOAuth(); String sessionIdAfter = rootAction.sessionId; assertNotNull(sessionIdAfter); assertNotEquals(sessionIdBefore, sessionIdAfter, \"Session must be invalidated after login\"); }", "tokens": 127} {"id": 294146, "source": "method", "repo": "jenkinsci/github-plugin", "text": "public String getIconFileName() { return \"symbol-logo-github plugin-github\"; }", "tokens": 19} {"id": 294152, "source": "method", "repo": "jenkinsci/github-plugin", "text": "void process(MarkupText text, String url) { for (SubText st : text.findTokens(pattern)) { st.surroundWith(\"\", \"\"); } }", "tokens": 54} {"id": 294278, "source": "method", "repo": "jenkinsci/github-plugin", "text": "/** Gets the signature algorithm name for UI binding. @return the algorithm name as string (e.g., \"SHA256\", \"SHA1\") @since 1.45.0 */ public String getSignatureAlgorithmName() { return getSignatureAlgorithm().name(); }", "tokens": 60} {"id": 294341, "source": "method", "repo": "jenkinsci/github-plugin", "text": "/** Logs error to build console and changes build result @return true as of it terminating handler */ public boolean handle(Exception e, @NonNull Run run, @NonNull TaskListener listener) { Result toSet = Result.fromString(trimToEmpty(result)); listener.error(\"[GitHub Commit Status Setter] - %s, setting build result to %s\", e.getMessage(), toSet); run.setResult(toSet); return true; }", "tokens": 92} {"id": 294395, "source": "method", "repo": "jenkinsci/github-plugin", "text": "/** Returns the elements from this fluent iterable that satisfy a predicate. The resulting fluent iterable's iterator does not support {@code remove()}. */ public final FluentIterableWrapper filter(Predicate predicate) { return from(Iterables.filter(iterable, predicate)); }", "tokens": 61} {"id": 294428, "source": "method", "repo": "jenkinsci/github-plugin", "text": "/** Used for {@link GitHubPluginConfig#doCheckHookUrl(String)}} */ protected void returnsInstanceIdentityIfLocalUrlTest(StaplerRequest2 req) throws InvocationTargetException { if (req.getHeader(GitHubWebHook.URL_VALIDATION_HEADER) != null) { // when the configuration page provides the self-check button, it makes a request with this header. throw new InvocationTargetException(new HttpResponses.HttpResponseException() { @Override public void generateResponse(StaplerRequest2 req, StaplerResponse2 rsp, Object node) throws IOException, ServletException { RSAPublicKey key = new InstanceIdentity().getPublic(); rsp.setStatus(HttpServletResponse.SC_OK); rsp.setHeader(X_INSTANCE_IDENTITY, new String(encodeBase64(key.getEncoded()), UTF_8)); } }); } }", "tokens": 165} {"id": 294430, "source": "method", "repo": "jenkinsci/github-plugin", "text": "/** Checks that an incoming request has a valid signature, if a hook secret is specified in the GitHub plugin config. If no hook secret is configured, then the signature is ignored. Uses the configured signature algorithm (SHA-256 by default, SHA-1 for legacy support). @param req Incoming request. @throws InvocationTargetException if any of preconditions is not satisfied */ protected void shouldProvideValidSignature(StaplerRequest2 req, Object[] args) throws InvocationTargetException { List secretConfigs = GitHubPlugin.configuration().getHookSecretConfigs(); if (!secretConfigs.isEmpty()) { boolean validSignatureFound = false; for (HookSecretConfig config : secretConfigs) { Secret secret = config.getHookSecret(); if (secret == null) { continue; } SignatureAlgorithm algorithm = config.getSignatureAlgorithm(); String headerName = algorithm.getHeaderName(); String expectedPrefix = algorithm.getSignaturePrefix(); Optional signHeader = Optional.fromNullable(req.getHeader(headerName)); if (!signHeader.isPresent()) { LOGGER.debug(\"No signature header {} found for algorithm {}\", headerName, algorithm); continue; } String fullSignature = signHeader.get(); if (!fullSignature.startsWith(expectedPrefix)) { LOGGER.debug(\"Signature header {} does not start with expected prefix {}\", fullSignature, expectedPrefix); continue; } String digest = substringAfter(fullSignature, expectedPrefix); LOGGER.trace(\"Verifying {} signature from header {}\", algorithm, fullSignature); boolean isValid = GHWebhookSignature.webhookSignature(payloadFrom(req, args), secret) .matches(digest, algorithm); if (isValid) { validSignatureFound = true; // Log deprecation warning for SHA-1 usage if (algorithm == SignatureAlgorithm.SHA1) { LOGGER.warn(\"Using deprecated SHA-1 signature validation. \" + \"Consider upgrading webhook configuration to use SHA-256 \" + \"for enhanced security.\"); } else { LOGGER.debug(\"Successfully validated {} signature\", algorithm); } break; } else { LOGGER.debug(\"Signature validation failed for algorithm {}\", algorithm); } } isTrue(validSignatureFound, \"No valid signature found. Ensure webhook is configured with a supported signature algorithm \" + \"(SHA-256 recommended, SHA-1 for legacy compatibility).\"); } }", "tokens": 478} {"id": 294499, "source": "method", "repo": "jenkinsci/github-plugin", "text": "protected boolean isApplicable(Item project) { return true; }", "tokens": 14} {"id": 294549, "source": "method", "repo": "jenkinsci/github-plugin", "text": "public GitHubServerConfigForTest(String credentialsId) { super(credentialsId); this.setCachedClient(github); }", "tokens": 23} {"id": 294627, "source": "method", "repo": "jenkinsci/github-plugin", "text": "void shouldMatchSignature() throws Exception { assertThat(\"signature should match\", webhookSignature( PAYLOAD, Secret.fromString(SECRET) ).matches(SIGNATURE), equalTo(true)); }", "tokens": 39} {"id": 294735, "source": "method", "repo": "jenkinsci/github-plugin", "text": "void shouldNotPassOnGHEventAndBlankPayload() { assertThrows(InvocationTargetException.class, () -> new RequirePostWithGHHookPayload.Processor().shouldContainParseablePayload( new Object[]{GHEvent.PUSH, \" \"})); }", "tokens": 48} {"id": 294798, "source": "method", "repo": "jenkinsci/gitlab-branch-source-plugin", "text": "/** Setter for stapler to set the buildStatusNameCustomPart of the build status */ public void setBuildStatusNameCustomPart(@NonNull String buildStatusNameCustomPart) { this.buildStatusNameCustomPart = buildStatusNameCustomPart; }", "tokens": 50} {"id": 294873, "source": "method", "repo": "jenkinsci/gitlab-branch-source-plugin", "text": "public boolean isMatch(@NonNull GitLabSCMSource source) { return getPayload().getObjectAttributes().getTargetProjectId().equals(source.getProjectId()); }", "tokens": 28} {"id": 294970, "source": "method", "repo": "jenkinsci/gitlab-branch-source-plugin", "text": "protected List retrieveActions(SCMSourceEvent event, @NonNull TaskListener listener) throws IOException { List result = new ArrayList<>(); try { getGitlabProject(); } catch (GitLabApiException e) { LOGGER.log(Level.WARNING, \"Failed to fetch GitLab project details for \" + projectPath, e); saveTimestampInOwner(); throw new IOException(\"Failed to fetch GitLab project details for \" + projectPath, e); } catch (RuntimeException e) { saveTimestampInOwner(); throw e; } GitLabSCMSourceContext ctx = new GitLabSCMSourceContext(null, SCMHeadObserver.none()).withTraits(traits); String projectUrl = gitlabProject.getWebUrl(); String name = StringUtils.isBlank(projectName) ? gitlabProject.getNameWithNamespace() : projectName; result.add(new ObjectMetadataAction(name, gitlabProject.getDescription(), projectUrl)); String avatarUrl = gitlabProject.getAvatarUrl(); if (!ctx.projectAvatarDisabled() && StringUtils.isNotBlank(avatarUrl)) { result.add(new GitLabAvatar(avatarUrl)); } result.add(GitLabLink.toProject(projectUrl)); return result; }", "tokens": 231} {"id": 294973, "source": "method", "repo": "jenkinsci/gitlab-branch-source-plugin", "text": "public SCMRevision getTrustedRevision(@NonNull SCMRevision revision, @NonNull TaskListener listener) { if (revision instanceof MergeRequestSCMRevision) { MergeRequestSCMHead head = (MergeRequestSCMHead) revision.getHead(); if (SCMHeadOrigin.Default.class.isAssignableFrom(head.getOrigin().getClass())) { return revision; } else if (SCMHeadOrigin.Fork.class.isAssignableFrom( head.getOrigin().getClass())) { try (GitLabSCMSourceRequest request = new GitLabSCMSourceContext(null, SCMHeadObserver.none()) .withTraits(traits) .newRequest(this, listener)) { request.setMembers(getMembers()); boolean isTrusted = request.isTrusted(head); LOGGER.log( Level.FINEST, String.format(\"Trusted Revision: %s -> %s\", head.getOriginOwner(), isTrusted)); if (isTrusted) { return revision; } } catch (IOException | InterruptedException e) { LOGGER.log(Level.SEVERE, \"Exception caught: \" + e, e); } } MergeRequestSCMRevision rev = (MergeRequestSCMRevision) revision; listener.getLogger() .format( \"Loading trusted files from target branch %s at %s rather than %s%n\", head.getTarget().getName(), rev.getBaseHash(), rev.getHeadHash()); return new SCMRevisionImpl(head.getTarget(), rev.getBaseHash()); } return revision; }", "tokens": 278} {"id": 295087, "source": "method", "repo": "jenkinsci/gitlab-branch-source-plugin", "text": "public String getShortDescription() { return description; }", "tokens": 12} {"id": 295290, "source": "method", "repo": "jenkinsci/gitlab-branch-source-plugin", "text": "/** Checks that the supplied URL looks like a valid Jenkins root URL. @param hooksRootUrl the URL to check. @return the validation results. */ public static FormValidation doCheckHooksRootUrl(@QueryParameter String hooksRootUrl) { if (StringUtils.isBlank(hooksRootUrl)) { return FormValidation.ok(); } try { new URL(hooksRootUrl); } catch (MalformedURLException e) { LOGGER.log(Level.FINEST, \"Malformed hooks root URL: {0}\", hooksRootUrl); return FormValidation.error(\"Malformed url (%s)\", e.getMessage()); } if (hooksRootUrl.endsWith(\"/post\") || hooksRootUrl.contains(\"/gitlab-webhook\") || hooksRootUrl.contains(\"/gitlab-systemhook\")) { LOGGER.log(Level.FINEST, \"Dubious hooks root URL: {0}\", hooksRootUrl); return FormValidation.warning(\"This looks like a full webhook URL, it should only be a root URL.\"); } return FormValidation.ok(); }", "tokens": 204} {"id": 295370, "source": "method", "repo": "jenkinsci/gitlab-branch-source-plugin", "text": "public void should_support_configuration_export() throws Exception { ConfiguratorRegistry registry = ConfiguratorRegistry.get(); ConfigurationContext context = new ConfigurationContext(registry); CNode gitLabServers = getUnclassifiedRoot(context).get(\"gitLabServers\"); String exported = toYamlString(gitLabServers); String expected = toStringFromYamlFile(this, \"expected_output.yml\"); assertThat(exported, matchesPattern(expected)); }", "tokens": 92} {"id": 295424, "source": "method", "repo": "jenkinsci/gradle-plugin", "text": "public String copyResourceStep(Resource res, String filename) { return String.format(\"sh '''%s'''%n\", copyResourceShell(res, filename)); }", "tokens": 40} {"id": 295444, "source": "method", "repo": "jenkinsci/gradle-plugin", "text": "public void appliesAutoInjectionIfRepositoryShouldBeIncluded() { // given setGitRepositoryFilters( filter() .include(\"gradle\") .exclude(\"maven\") .build() ); FreeStyleJob job = jenkins.jobs.create(FreeStyleJob.class); job.useScm(GitScm.class) .url(\"https://github.com/c00ler/simple-gradle-project.git\") .branch(\"main\"); GradleStep gradle = job.addBuildStep(GradleStep.class); gradle.setVersion(GRADLE_VERSION); gradle.setSwitches(\"--no-daemon\"); gradle.setTasks(\"help\"); job.save(); // when Build build = job.startBuild(); // then build.shouldSucceed(); assertBuildScanPublished(build, \"> Task :help\", \"To see a list of available tasks, run gradle tasks\"); MockGeServer.ScanTokenRequest scanTokenRequest = mockGeServer.getLastScanTokenRequest(); assertThat(scanTokenRequest, notNullValue()); assertThat(scanTokenRequest.agentVersion, is(equalTo(AGENT_VERSION))); }", "tokens": 219} {"id": 295806, "source": "method", "repo": "jenkinsci/gradle-plugin", "text": "public void setMavenExtensionVersion(String mavenExtensionVersion) { this.mavenExtensionVersion = Util.fixEmptyAndTrim(mavenExtensionVersion); }", "tokens": 28} {"id": 295841, "source": "method", "repo": "jenkinsci/gradle-plugin", "text": "public FormValidation doCheckAccessKeyCredentialId(@QueryParameter String value) { if (doesNotHaveAdministerPermission()) { return FormValidation.error(\"Validating access key credential ID requires 'Administer' permission\"); } String accessKeyId = Util.fixEmptyAndTrim(value); if (accessKeyId == null) { return FormValidation.ok(); } List credentials = CredentialsProvider.lookupCredentialsInItem(StringCredentials.class, null, null); String accessKeyFromCredentialId = credentials.stream() .filter(it -> it.getId().equals(accessKeyId)) .findFirst() .map(it -> it.getSecret().getPlainText()) .orElse(null); return DevelocityAccessCredentials.isValid(accessKeyFromCredentialId) ? FormValidation.ok() : FormValidation.error(Messages.InjectionConfig_InvalidAccessKey()); }", "tokens": 168} {"id": 296002, "source": "method", "repo": "jenkinsci/groovy-sandbox", "text": "public Object onGetProperty(Invoker invoker, Object receiver, String property) throws Throwable { return filterReturnValue(super.onGetProperty(invoker, filterReceiver(receiver), property)); }", "tokens": 39} {"id": 296041, "source": "method", "repo": "jenkinsci/groovy-sandbox", "text": "public void visitSwitch(SwitchStatement statement) { try (StackVariableSet scope = new StackVariableSet(this)) { super.visitSwitch(statement); } }", "tokens": 35} {"id": 296170, "source": "method", "repo": "jenkinsci/groovy-sandbox", "text": "/** Execute a Groovy expression both in and out of the sandbox and check that the script throws an exception with the same class and message in both cases. @param expression The Groovy expression to execute. */ private void assertFailsWithSameException(String expression) { AtomicReference sandboxedException = new AtomicReference<>(); sandboxedEval(expression, ShouldFail.class, sandboxedException::set); AtomicReference unsandboxedException = new AtomicReference<>(); unsandboxedEval(expression, ShouldFail.class, unsandboxedException::set); if (sandboxedException.get() == null || unsandboxedException.get() == null) { return; // Either sandboxedEval or unsandboxedEval will have already recorded an error because the result was not ShouldFail. } ec.checkThat(\"Sandboxed and unsandboxed exception should have the same type\", unsandboxedException.get().getClass(), equalTo(sandboxedException.get().getClass())); ec.checkThat(\"Sandboxed and unsandboxed exception should have the same message\", unsandboxedException.get().getMessage(), equalTo(sandboxedException.get().getMessage())); }", "tokens": 237} {"id": 296239, "source": "method", "repo": "jenkinsci/groovy-sandbox", "text": "public void sandboxAllowsBoxedPrimitiveCasts() { assertIntercept(\"1.0 as Integer\", 1); assertFailsWithSameException(\"[] as Integer\"); assertIntercepted(); assertFailsWithSameException(\"[] as int\"); assertIntercepted(); assertIntercept(\"1 as Double\", 1.0); assertFailsWithSameException(\"[] as Double\"); assertIntercepted(); assertFailsWithSameException(\"[] as double\"); assertIntercepted(); assertIntercept(\"'test' as Character\", 't'); assertFailsWithSameException(\"[] as Character\"); assertIntercepted(); assertFailsWithSameException(\"[] as char\"); assertIntercepted(); assertIntercept(\"1 as String\", \"1\"); assertIntercept(\"[] as String\", \"[]\"); }", "tokens": 137} {"id": 296419, "source": "method", "repo": "jenkinsci/hashicorp-vault-plugin", "text": "public void setVaultNamespace(String vaultNamespace) { this.vaultNamespace = fixEmptyAndTrim(vaultNamespace); }", "tokens": 24} {"id": 296860, "source": "method", "repo": "jenkinsci/http-request-plugin", "text": "public void setValidResponseCodes(String validResponseCodes) { this.validResponseCodes = validResponseCodes; }", "tokens": 25} {"id": 296949, "source": "method", "repo": "jenkinsci/http-request-plugin", "text": "public ListBoxModel doFillProxyAuthenticationItems(@AncestorInPath Item project, @QueryParameter String url) { return HttpRequest.DescriptorImpl.fillAuthenticationItems(project, url); }", "tokens": 32} {"id": 296950, "source": "method", "repo": "jenkinsci/http-request-plugin", "text": "public FormValidation doCheckValidResponseCodes(@QueryParameter String value) { return HttpRequest.DescriptorImpl.checkValidResponseCodes(value); }", "tokens": 26} {"id": 297088, "source": "method", "repo": "jenkinsci/http-request-plugin", "text": "void nonExistentBasicAuthFailsTheBuild() throws Exception { // Prepare the server registerBasicAuth(); // Configure the build WorkflowJob proj = j.jenkins.createProject(WorkflowJob.class, \"proj\"); proj.setDefinition(new CpsFlowDefinition( \"def response = httpRequest url:'\"+baseURL()+\"/basicAuth',\\n\" + \" authentication: 'invalid'\\n\" + \"println('Status: '+response.getStatus())\\n\" + \"println('Response: '+response.getContent())\\n\", true)); // Execute the build WorkflowRun run = proj.scheduleBuild2(0).get(); // Check expectations j.assertBuildStatus(Result.FAILURE, run); j.assertLogContains(\"Authentication 'invalid' doesn't exist anymore\", run); }", "tokens": 157} {"id": 297120, "source": "method", "repo": "jenkinsci/http-request-plugin", "text": "void canDoBasicDigestAuthentication() throws Exception { // Prepare the server registerBasicAuth(); // Prepare the authentication registerBasicCredential(\"keyname1\", \"username1\", \"password1\"); registerBasicCredential(\"keyname2\", \"username2\", \"password2\"); // Prepare HttpRequest HttpRequest httpRequest = new HttpRequest(baseURL() + \"/basicAuth\"); httpRequest.setAuthentication(\"keyname1\"); // Run build FreeStyleProject project = this.j.createFreeStyleProject(); project.getBuildersList().add(httpRequest); FreeStyleBuild build = project.scheduleBuild2(0).get(); // Check expectations this.j.assertBuildStatusSuccess(build); this.j.assertLogContains(\"Success: Status code 200 is in the accepted range: 100:399\", build); }", "tokens": 159} {"id": 297181, "source": "method", "repo": "jenkinsci/jacoco-plugin", "text": "public void setClassDir(FilePath classDir) { this.classDir = classDir; }", "tokens": 21} {"id": 297194, "source": "method", "repo": "jenkinsci/jacoco-plugin", "text": "public Run getBuild() { return owner; }", "tokens": 11} {"id": 297220, "source": "method", "repo": "jenkinsci/jacoco-plugin", "text": "public void setDeltaMethod(float deltaMethod) { this.deltaMethod = deltaMethod; }", "tokens": 21} {"id": 297277, "source": "method", "repo": "jenkinsci/jacoco-plugin", "text": "public String getMaximumComplexityCoverage() { return maximumComplexityCoverage; }", "tokens": 15} {"id": 297412, "source": "method", "repo": "jenkinsci/jacoco-plugin", "text": "public Coverage getInstructionCoverage() { return instruction; }", "tokens": 12} {"id": 297471, "source": "method", "repo": "jenkinsci/jacoco-plugin", "text": "/** Constructor with chart attributes as parameters. DataBoundConstructor annotation helps the Stapler class to find which constructor that should be used when automatically copying values from a web form to a class. @param name chart name @param width the chart width @param height the chart height @param daysNumber the number of days */ public JacocoBuilderTrendChart(String name, String width, String height, String daysNumber) { super(name); this.width = Utils.validateChartAttributes(width, Constants.DEFAULT_WIDTH); this.height = Utils.validateChartAttributes(height, Constants.DEFAULT_HEIGHT); this.daysNumber = Utils.validateChartAttributes(daysNumber, Constants.DEFAULT_DAYS_NUMBER); }", "tokens": 146} {"id": 297486, "source": "method", "repo": "jenkinsci/jacoco-plugin", "text": "public void setName(String name) { this.name = sanitizeName(name); }", "tokens": 20} {"id": 297613, "source": "method", "repo": "jenkinsci/jacoco-plugin", "text": "public void testResolveFilePathsAbstractBuildNoReplace() throws Exception { JacocoPublisher publisher = new JacocoPublisher(); AbstractBuild build = mock(AbstractBuild.class); TaskListener listener = mock(TaskListener.class); expect(build.getEnvironment(listener)).andReturn(new EnvVars()); expect(build.getBuildVariables()).andReturn(Collections.singletonMap(\"key\", \"value\")); EasyMock.replay(build, listener); assertEquals(\"input\", publisher.resolveFilePaths(build, listener, \"input\")); EasyMock.verify(build, listener); }", "tokens": 108} {"id": 297679, "source": "method", "repo": "jenkinsci/jacoco-plugin", "text": "/** Tests {@link hudson.plugins.jacoco.portlet.utils.Utils#roundFloat(int scale, RoundingMode roundingMode, float value) }. */ public void testRoundFloat() { int scale = 1; RoundingMode roundingMode = RoundingMode.HALF_EVEN; final float value = 9.987f; final float roundedAs = 10f; assertEquals(roundedAs, Utils.roundFloat(scale, roundingMode, value)); }", "tokens": 97} {"id": 297854, "source": "method", "repo": "jenkinsci/jenkins", "text": "private void doConfigDotXmlImpl(StaplerRequest2 req, StaplerResponse2 rsp) throws IOException { if (req.getMethod().equals(\"GET\")) { // read rsp.setContentType(\"application/xml\"); writeConfigDotXml(rsp.getOutputStream()); return; } if (req.getMethod().equals(\"POST\")) { // submission updateByXml((Source) new StreamSource(req.getReader())); return; } // huh? rsp.sendError(SC_BAD_REQUEST); }", "tokens": 100} {"id": 297967, "source": "method", "repo": "jenkinsci/jenkins", "text": "public boolean remove(R run) { return removeValue(run); }", "tokens": 16} {"id": 298028, "source": "method", "repo": "jenkinsci/jenkins", "text": "/** Computes the average response time, by taking the time out into account. */ public long getAverage() { long total = 0; for (long l : past5) { if (l < 0) total += TIMEOUT; else total += l; } return total / past5.length; }", "tokens": 65} {"id": 298094, "source": "method", "repo": "jenkinsci/jenkins", "text": "/** @return Delegates to {@link SimpleBuildStep#perform(Run, FilePath, Launcher, TaskListener)} if possible, always returning true or throwing an error. */ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { if (this instanceof SimpleBuildStep step) { // delegate to the overloaded version defined in SimpleBuildStep final FilePath workspace = build.getWorkspace(); if (step.requiresWorkspace() && workspace == null) { throw new AbortException(\"no workspace for \" + build); } if (workspace != null) { // if we have one, provide it regardless of whether it's _required_ step.perform(build, workspace, build.getEnvironment(listener), launcher, listener); } else { step.perform(build, build.getEnvironment(listener), listener); } return true; } else if (build instanceof Build) { // delegate to the legacy signature deprecated in 1.312 return perform((Build) build, launcher, listener); } else { return true; } }", "tokens": 215} {"id": 298270, "source": "method", "repo": "jenkinsci/jenkins", "text": "/** Gets the singleton instance. @return the {@link ItemDeletion} singleton. */ private static ItemDeletion instance() { return ExtensionList.lookup(Queue.QueueDecisionHandler.class).get(ItemDeletion.class); }", "tokens": 47} {"id": 298308, "source": "method", "repo": "jenkinsci/jenkins", "text": "/** Gets default settings of the enabled work directory. */ public static RemotingWorkDirSettings getEnabledDefaults() { return ENABLED_DEFAULT; }", "tokens": 30} {"id": 298310, "source": "method", "repo": "jenkinsci/jenkins", "text": "public Void call() throws Exception { install(c, listener); return null; }", "tokens": 18} {"id": 298326, "source": "method", "repo": "jenkinsci/jenkins", "text": "/** If {@link #pending} is non-null (meaning someone requested the task to be kicked), but {@link #inprogress} is null (meaning none is executing right now), get one going. */ private synchronized void maybeRun() { if (inprogress == null && pending != null) { base.submit((Callable) () -> { synchronized (AtmostOneTaskExecutor.this) { // everyone who submits after this should form a next batch inprogress = pending; pending = null; } try { inprogress.complete(task.call()); } catch (Throwable t) { LOGGER.log(Level.WARNING, null, t); inprogress.completeExceptionally(t); } finally { synchronized (AtmostOneTaskExecutor.this) { // if next one is pending, get that scheduled inprogress = null; maybeRun(); } } return null; }); } }", "tokens": 190} {"id": 298447, "source": "method", "repo": "jenkinsci/jenkins", "text": "void testEquals_Null() throws IOException { String parentFolder = \"parentFolder\"; File parentFile = newFolder(tmp, parentFolder); String child1 = \"child1\"; File childFile1 = new File(parentFile, child1); VirtualFile vf1 = new VirtualFileMinimalImplementation(childFile1); VirtualFile vf2 = null; assertNotEquals(vf2, vf1); }", "tokens": 83} {"id": 298528, "source": "method", "repo": "jenkinsci/jenkins", "text": "void shouldStartupWithCustomUpdateCenter() throws Throwable { session.then(j -> { UpdateCenter uc = j.jenkins.getUpdateCenter(); assertThat(\"Update Center must be a custom instance\", uc, instanceOf(CustomUpdateCenterExtension.CustomUpdateCenter.class)); }); }", "tokens": 61} {"id": 298530, "source": "method", "repo": "jenkinsci/jenkins", "text": "public boolean filter(Object context, Descriptor descriptor) { return false; }", "tokens": 16} {"id": 299056, "source": "method", "repo": "jenkinsci/jenkins-test-harness", "text": "public TopLevelItem createProjectFromXML(String name, InputStream xml) throws IOException { return mixin().createProjectFromXML(name, xml); }", "tokens": 31} {"id": 299070, "source": "method", "repo": "jenkinsci/jenkins-test-harness", "text": "public boolean isNameEditable() { return true; }", "tokens": 12} {"id": 299133, "source": "method", "repo": "jenkinsci/jenkins-test-harness", "text": "private static String problem() { for (Computer c : Jenkins.get().getComputers()) { for (Executor x : c.getAllExecutors()) { if (!x.isIdle()) { return x.getCurrentExecutable() + \" still seems to be running, which could break deletion of log files or metadata\"; } } } for (Queue.Item q : Queue.getInstance().getItems()) { return q + \" is still scheduled, which if it ever runs, could break deletion of log files or metadata\"; } return null; }", "tokens": 109} {"id": 299467, "source": "method", "repo": "jenkinsci/jenkins-test-harness", "text": "public void safeExit() throws Throwable { rr.then(r -> { var p = r.createFreeStyleProject(); p.getBuildersList().add(TestBuilder.of((build, launcher, listener) -> Thread.sleep(Long.MAX_VALUE))); p.scheduleBuild2(0).waitForStart(); }); }", "tokens": 68} {"id": 299490, "source": "method", "repo": "jenkinsci/jenkins-test-harness", "text": "void dynamicLoad() throws Throwable { var pluginJpi = fixture.createSyntheticPlugin(new RealJenkinsFixture.SyntheticPlugin(Stuff.class)); fixture.then(r -> { r.jenkins.pluginManager.dynamicLoad(pluginJpi); assertThat( r.createWebClient() .goTo(\"stuff\", \"text/plain\") .getWebResponse() .getContentAsString(), is(Jenkins.get().getLegacyInstanceId())); }); }", "tokens": 91} {"id": 299812, "source": "method", "repo": "jenkinsci/jira-plugin", "text": "public DefaultRequest build() { return new DefaultRequest( uri, cacheDisabled, attributes, commonBuilder.getHeaders(), method, commonBuilder.getEntityStream(), contentLength); }", "tokens": 35} {"id": 299951, "source": "method", "repo": "jenkinsci/jira-plugin", "text": "/** Performs the actual update based on job configuration. */ public void perform(Run run, EnvVars env, TaskListener listener) throws InterruptedException, IOException { String realComment = Util.fixEmptyAndTrim(env.expand(comment)); String realJql = Util.fixEmptyAndTrim(env.expand(jqlSearch)); String realWorkflowActionName = Util.fixEmptyAndTrim(env.expand(workflowActionName)); JiraSite site = getSiteForJob(run.getParent()); if (site == null) { listener.getLogger().println(Messages.NoJiraSite()); run.setResult(Result.FAILURE); return; } if (StringUtils.isNotEmpty(realWorkflowActionName)) { listener.getLogger().println(Messages.JiraIssueUpdateBuilder_UpdatingWithAction(realWorkflowActionName)); } listener.getLogger().println(\"[Jira] JQL: \" + realJql); try { if (!site.progressMatchingIssues(realJql, realWorkflowActionName, realComment, listener.getLogger())) { listener.getLogger().println(Messages.JiraIssueUpdateBuilder_SomeIssuesFailed()); run.setResult(Result.UNSTABLE); } } catch (RestClientException e) { listener.getLogger().println(e.getMessage()); run.setResult(Result.FAILURE); } }", "tokens": 254} {"id": 299967, "source": "method", "repo": "jenkinsci/jira-plugin", "text": "/** Gets the {@link JiraSite} that this project belongs to. @return null if the configuration becomes out of sync. */ public JiraSite getSite() { List sites = JiraGlobalConfiguration.get().getSites(); if (siteName == null && sites.size() > 0) { // default return sites.get(0); } Stream streams = sites.stream(); if (owner != null) { Stream stream2 = JiraFolderProperty.getSitesFromFolders(owner.getParent()).stream(); streams = Stream.concat(streams, stream2).parallel(); } return streams.filter(jiraSite -> jiraSite.getName().equals(siteName)) .findFirst() .orElse(null); }", "tokens": 158} {"id": 299999, "source": "method", "repo": "jenkinsci/jira-plugin", "text": "public List getVersions(String projectKey) { final URIBuilder builder = new URIBuilder(uri).setPath(String.format(\"%s/project/%s/versions\", baseApiPath, projectKey)); List> decoded = Collections.emptyList(); try { URI uri = builder.build(); final Content content = buildGetRequest(uri).execute().returnContent(); decoded = objectMapper.readValue(content.asString(), new TypeReference>>() {}); } catch (URISyntaxException | IOException e) { LOGGER.log(WARNING, e, () -> \"Jira REST client get versions error. cause: \" + e.getMessage()); throw new RestClientException(\"[Jira] Jira REST client get versions error. cause: \" + e.getMessage(), e); } return decoded.stream() .map(decodedVersion -> { final DateTime startDate = decodedVersion.containsKey(\"startDate\") ? DATE_TIME_FORMATTER.parseDateTime((String) decodedVersion.get(\"startDate\")) : null; final DateTime releaseDate = decodedVersion.containsKey(\"releaseDate\") ? DATE_TIME_FORMATTER.parseDateTime((String) decodedVersion.get(\"releaseDate\")) : null; return new ExtendedVersion( URI.create((String) decodedVersion.get(\"self\")), Long.parseLong((String) decodedVersion.get(\"id\")), (String) decodedVersion.get(\"name\"), (String) decodedVersion.get(\"description\"), (Boolean) decodedVersion.get(\"archived\"), (Boolean) decodedVersion.get(\"released\"), startDate, releaseDate); }) .collect(Collectors.toList()); }", "tokens": 349} {"id": 300130, "source": "method", "repo": "jenkinsci/jira-plugin", "text": "public boolean isFailIfAlreadyExists() { return failIfAlreadyExists; }", "tokens": 15} {"id": 300132, "source": "method", "repo": "jenkinsci/jira-plugin", "text": "public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) { VersionCreator versionCreator = new VersionCreator(); versionCreator.setFailIfAlreadyExists(failIfAlreadyExists); versionCreator.setJiraVersion(jiraVersion); versionCreator.setJiraProjectKey(jiraProjectKey); return versionCreator.perform(build.getProject(), build, listener); }", "tokens": 75} {"id": 300249, "source": "method", "repo": "jenkinsci/jira-plugin", "text": "/** See {@link #addIssuesRecursive(Run, JiraSite, TaskListener, Set)} */ public Set findIssueIds( @NonNull final Run run, @NonNull final JiraSite site, @NonNull final TaskListener listener) { HashSet issuesIds = new LinkedHashSet<>(); addIssuesRecursive(run, site, listener, issuesIds); return issuesIds; }", "tokens": 77} {"id": 300281, "source": "method", "repo": "jenkinsci/jira-plugin", "text": "public void setJiraReleasePattern(String pattern) { if (pattern == null || pattern.isEmpty()) { this.pattern = null; } else { this.pattern = Pattern.compile(pattern); } }", "tokens": 44} {"id": 300319, "source": "method", "repo": "jenkinsci/jira-plugin", "text": "void getActionIdReturnsIdWhenFoundIgnorecaseWorkflow() { String id = randomNumeric(5); Transition action1 = mock(Transition.class); when(action1.getName()).thenReturn(NON_EMPTY_WORKFLOW_LOWERCASE.toUpperCase()); when(restService.getAvailableActions(ISSUE_JQL)).thenReturn(Arrays.asList(action1)); when(action1.getId()).thenReturn(Integer.valueOf(id)); assertThat( spySession.getActionIdForIssue(ISSUE_JQL, NON_EMPTY_WORKFLOW_LOWERCASE), equalTo(Integer.valueOf(id))); }", "tokens": 124} {"id": 300429, "source": "method", "repo": "jenkinsci/jira-plugin", "text": "void shouldAddVersionToAllIssues() throws Exception { final ExtendedVersion newVersion = new ExtendedVersion(new URI(\"self\"), 10L, \"v4.0\", null, false, false, null, null); List myVersions = List.of(newVersion); when(jiraSession.getVersions(PROJECT_KEY)).thenReturn(myVersions); List issues = new ArrayList<>(); issues.add(getIssue(Arrays.asList(\"v1.0\"), 1L)); issues.add(getIssue(Arrays.asList(\"v2.0\", \"v3.0\"), 2L)); when(service.getIssuesFromJqlSearch(QUERY, 0)).thenReturn(issues); jiraSession.addFixVersion(PROJECT_KEY, newVersion.getName(), QUERY); ArgumentCaptor issueKeys = ArgumentCaptor.forClass(String.class); ArgumentCaptor versionList = ArgumentCaptor.forClass(List.class); verify(service, times(issues.size())).updateIssue(issueKeys.capture(), versionList.capture()); // First issue: should have original + new version List firstIssueVersions = versionList.getAllValues().get(0); assertThat(firstIssueVersions, hasItem(hasProperty(\"name\", equalTo(\"v1.0\")))); assertThat(firstIssueVersions, hasItem(hasProperty(\"name\", equalTo(\"v4.0\")))); assertThat(firstIssueVersions.size(), equalTo(2)); // Second issue: should have both original + new version List secondIssueVersions = versionList.getAllValues().get(1); assertThat(secondIssueVersions, hasItem(hasProperty(\"name\", equalTo(\"v2.0\")))); assertThat(secondIssueVersions, hasItem(hasProperty(\"name\", equalTo(\"v3.0\")))); assertThat(secondIssueVersions, hasItem(hasProperty(\"name\", equalTo(\"v4.0\")))); assertThat(secondIssueVersions.size(), equalTo(3)); }", "tokens": 399} {"id": 300510, "source": "method", "repo": "jenkinsci/jira-plugin", "text": "void scriptedPipeline(JenkinsRule r) throws Exception { WorkflowJob p = r.createProject(WorkflowJob.class); p.setDefinition(new CpsFlowDefinition(\"\"\" properties([ parameters([ jiraIssue(name: 'JIRA_ISSUE', description: 'Jira Test Description', jiraIssueFilter: 'project=PRJ') ]) ])\"\"\", true)); r.buildAndAssertSuccess(p); ParametersDefinitionProperty parameters = p.getProperty(ParametersDefinitionProperty.class); assertThat(parameters, is(notNullValue())); assertThat( parameters.getParameterDefinitions(), hasItem(allOf( instanceOf(JiraIssueParameterDefinition.class), hasProperty(\"name\", is(\"JIRA_ISSUE\")), hasProperty(\"description\", is(\"Jira Test Description\")), hasProperty(\"jiraIssueFilter\", is(\"project=PRJ\"))))); }", "tokens": 160} {"id": 300813, "source": "method", "repo": "jenkinsci/kubernetes-cd-plugin", "text": "V1DaemonSet applyResource(V1DaemonSet original, V1DaemonSet current) { V1DaemonSet daemonSet = null; try { daemonSet = appsV1ApiInstance.replaceNamespacedDaemonSet(getName(), getNamespace(), current, getPretty(), null, null); } catch (ApiException e) { handleApiException(e); } return daemonSet; }", "tokens": 77} {"id": 300980, "source": "method", "repo": "jenkinsci/kubernetes-cd-plugin", "text": "void notifyUpdate(AppsV1beta1Deployment original, AppsV1beta1Deployment current) { resourceUpdateMonitor.onDeploymentUpdate(original, current); }", "tokens": 36} {"id": 301023, "source": "method", "repo": "jenkinsci/kubernetes-cd-plugin", "text": "StatefulSetUpdater(V1beta2StatefulSet namespace) { super(namespace); }", "tokens": 20} {"id": 301077, "source": "method", "repo": "jenkinsci/kubernetes-cd-plugin", "text": "public void testDescriptorCheckSshServer() { SSHCredentials.DescriptorImpl descriptor = new SSHCredentials.DescriptorImpl(); assertEquals(FormValidation.ok(), descriptor.doCheckSshServer(\"abc.def\")); assertEquals(FormValidation.Kind.ERROR, descriptor.doCheckSshServer(null).kind); assertEquals(FormValidation.Kind.ERROR, descriptor.doCheckSshServer(\"\").kind); assertEquals(FormValidation.Kind.ERROR, descriptor.doCheckSshServer(\" \").kind); }", "tokens": 93} {"id": 301108, "source": "method", "repo": "jenkinsci/lib-file-leak-detector", "text": "public CloseInterceptor(String methodName) { super(methodName, \"()V\"); }", "tokens": 18} {"id": 301216, "source": "method", "repo": "jenkinsci/lib-file-leak-detector", "text": "public void testInstrumentations(Class c) throws Exception { TransformerImpl t = new TransformerImpl(specs); String name = c.getName().replace('.', '/'); byte[] data; try (InputStream resource = getClass().getClassLoader().getResourceAsStream(name + \".class\")) { assertNotNull(resource, \"Could not load \" + name + \".class\"); data = resource.readAllBytes(); } byte[] data2 = t.transform(name, data); // File classFile = new File(\"/tmp/\" + name + \".class\"); // classFile.getParentFile().mkdirs(); // FileOutputStream o = new FileOutputStream(classFile); // o.write(data2); // o.close(); final String errors; ClassReader classReader = new ClassReader(data2); try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); OutputStreamWriter osw = new OutputStreamWriter(baos, StandardCharsets.UTF_8); PrintWriter pw = new PrintWriter(osw)) { CheckClassAdapter.verify(classReader, false, pw); errors = baos.toString(StandardCharsets.UTF_8); } assertTrue(errors.isEmpty(), \"Verification failed for \" + c + \"\\n\" + errors); }", "tokens": 245} {"id": 301242, "source": "method", "repo": "jenkinsci/lib-file-leak-detector", "text": "public static void setup() { assertTrue( Listener.isAgentInstalled(), \"This test can only run with an injected Java agent for file-leak-detector\"); Listener.TRACE = new PrintWriter(output); }", "tokens": 45} {"id": 301267, "source": "method", "repo": "jenkinsci/lockable-resources-plugin", "text": "public void setLabel(String label) { if (label != null && !label.trim().isEmpty()) { if (!label.equals(label.trim())) { LOG.warning(\"The provided 'label' should not start or end with spaces.\"); } this.label = label.trim(); } }", "tokens": 64} {"id": 301306, "source": "method", "repo": "jenkinsci/lockable-resources-plugin", "text": "public String getDisplayName() { return Messages.LockStepResource_displayName(); }", "tokens": 16} {"id": 301325, "source": "method", "repo": "jenkinsci/lockable-resources-plugin", "text": "public void setEphemeral(boolean ephemeral) { this.ephemeral = ephemeral; }", "tokens": 17} {"id": 301401, "source": "method", "repo": "jenkinsci/lockable-resources-plugin", "text": "private static List _getResourcesWithLabel(String label, final List resources) { List found = new ArrayList<>(); label = Util.fixEmpty(label); if (label == null) { return found; } for (LockableResource r : resources) { if (r != null && r.isValidLabel(label)) found.add(r); } return found; }", "tokens": 83} {"id": 301503, "source": "method", "repo": "jenkinsci/lockable-resources-plugin", "text": "/** Validates the step configuration. @throws IllegalArgumentException if the configuration is invalid */ public void validate() { if (Util.fixEmptyAndTrim(resource) == null) { throw new IllegalArgumentException(Messages.UpdateLockStep_error_resourceRequired()); } if (deleteResource && createResource) { throw new IllegalArgumentException(Messages.UpdateLockStep_error_deleteAndCreateConflict()); } if (deleteResource && (addLabels != null || setLabels != null || removeLabels != null || setNote != null)) { throw new IllegalArgumentException(Messages.UpdateLockStep_error_deleteWithOtherOptions()); } if (setLabels != null && (addLabels != null || removeLabels != null)) { throw new IllegalArgumentException(Messages.UpdateLockStep_error_setLabelsConflict()); } }", "tokens": 164} {"id": 301634, "source": "method", "repo": "jenkinsci/lockable-resources-plugin", "text": "private static boolean isNodeMirrorEnabled() { return SystemProperties.getBoolean(Constants.SYSTEM_PROPERTY_ENABLE_NODE_MIRROR); }", "tokens": 29} {"id": 301674, "source": "method", "repo": "jenkinsci/lockable-resources-plugin", "text": "/** Build the required-resources structure for a project, merging any additional environment variables (e.g. build parameters) into the expansion context. @param project the job whose {@link RequiredResourcesProperty} is read @param additionalEnv extra variables to use when expanding {@code ${...}} references; may be {@code null} @return the struct, or {@code null} if the project has no lockable-resource property */ public static LockableResourcesStruct requiredResources( @NonNull Job project, @CheckForNull EnvVars additionalEnv) { EnvVars env = new EnvVars(); for (var ma : ExtensionList.lookup(MatrixAssist.class)) { env.putAll(ma.getCombination(project)); project = ma.getMainProject(project); } if (additionalEnv != null) { env.putAll(additionalEnv); } RequiredResourcesProperty property = project.getProperty(RequiredResourcesProperty.class); if (property != null) return new LockableResourcesStruct(property, env); return null; }", "tokens": 211} {"id": 301694, "source": "method", "repo": "jenkinsci/lockable-resources-plugin", "text": "private String extractRemoteCode(String responseBody) { if (responseBody == null || responseBody.isEmpty()) { return null; } try { JSONObject json = JSONObject.fromObject(responseBody); String code = json.optString(\"errorCode\", null); if (code == null || code.isEmpty()) { code = json.optString(\"code\", null); } return code; } catch (RuntimeException ex) { return null; } }", "tokens": 86} {"id": 301929, "source": "method", "repo": "jenkinsci/lockable-resources-plugin", "text": "void testReset() { instance.reset(); }", "tokens": 11} {"id": 302130, "source": "method", "repo": "jenkinsci/lockable-resources-plugin", "text": "void releaseSchedulesQueueMaintenanceForLocalWaiters(JenkinsRule j) { // Verify that release() does not throw and clears remoteLockedBy // (full local-waiter wake-up is tested by integration; this is a smoke check) LockableResourcesManager manager = LockableResourcesManager.get(); manager.setRemoteApiEnabled(true); manager.setExposeLabel(\"hw\"); manager.createResourceWithLabel(\"board-1\", \"hw\"); RemoteLockRecord record = RemoteLockManager.get().enqueue(req(\"board-1\"), null); assertEquals(RemoteLockState.ACQUIRED, record.getState()); assertNotNull(manager.fromName(\"board-1\").getRemoteLockedBy()); RemoteLockManager.get().release(record.getLockId()); assertNull(manager.fromName(\"board-1\").getRemoteLockedBy()); }", "tokens": 162} {"id": 302210, "source": "method", "repo": "jenkinsci/mcp-server-plugin", "text": "/** Sets the shutdown state of the MCP server. Called by {@link McpServerShutdownListener} when Jenkins begins shutdown. @param shutdown true if Jenkins is shutting down */ public static void setShuttingDown(boolean shutdown) { shuttingDown.set(shutdown); if (shutdown) { log.info(\"MCP Server health endpoint marked as shutting down\"); } }", "tokens": 74} {"id": 302319, "source": "method", "repo": "jenkinsci/mcp-server-plugin", "text": "private static ParameterValue createRunParameterValue(RunParameterDefinition param, Object inputValue) { if (inputValue != null) { String value = String.valueOf(inputValue); return param.createValue(value); } return param.getDefaultParameterValue(); }", "tokens": 56} {"id": 302391, "source": "method", "repo": "jenkinsci/mcp-server-plugin", "text": "void testMetricsEndpointRequiresAuthentication(JenkinsRule jenkins) throws Exception { // Configure Jenkins to require authentication jenkins.jenkins.setSecurityRealm(jenkins.createDummySecurityRealm()); var authStrategy = new FullControlOnceLoggedInAuthorizationStrategy(); authStrategy.setAllowAnonymousRead(false); jenkins.jenkins.setAuthorizationStrategy(authStrategy); try (JenkinsRule.WebClient webClient = jenkins.createWebClient()) { webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); var url = jenkins.getURL(); var metricsUrl = url.toString() + McpConnectionMetrics.URL_NAME; var request = new WebRequest(new URL(metricsUrl), HttpMethod.GET); WebResponse response = webClient.loadWebResponse(request); // Should require authentication assertThat(response.getStatusCode()).isEqualTo(HttpServletResponse.SC_FORBIDDEN); } }", "tokens": 160} {"id": 302448, "source": "method", "repo": "jenkinsci/mcp-server-plugin", "text": "private Map getBuildLogResult( McpSyncClient client, String jobFullName, Long skip, Integer limit, String cursor) { Map params = new HashMap<>(); params.put(\"jobFullName\", jobFullName); if (skip != null) { params.put(\"skip\", skip); } if (limit != null) { params.put(\"limit\", limit); } if (cursor != null) { params.put(\"cursor\", cursor); } return readResult(client, \"getBuildLog\", params); }", "tokens": 112} {"id": 302794, "source": "method", "repo": "jenkinsci/performance-plugin", "text": "private String[] getBztCheckCommand(FilePath workspace) { return new String[]{getVirtualenvPath(workspace) + \"bzt\", HELP_OPTION}; }", "tokens": 38} {"id": 302814, "source": "method", "repo": "jenkinsci/performance-plugin", "text": "public String getDisplayName() { return \"Absolute Constraint\"; }", "tokens": 12} {"id": 302865, "source": "method", "repo": "jenkinsci/performance-plugin", "text": "public FormValidation doCheckTimeframeEndString(@QueryParameter String timeframeEndString) { if (NOW.equals(timeframeEndString)) { return FormValidation.ok(); } return dateCheck(timeframeEndString); }", "tokens": 45} {"id": 303032, "source": "method", "repo": "jenkinsci/performance-plugin", "text": "public long getSumValidationErrors() { long sumValidationErrors = 0; synchronized (validationErrors) { for (Long value : validationErrors.values()) { sumValidationErrors += value; } } return sumValidationErrors; }", "tokens": 48} {"id": 303452, "source": "method", "repo": "jenkinsci/pipeline-as-yaml-plugin", "text": "public String getDisplayName() { return Messages.Project_SnippetizerDisplayName(); }", "tokens": 16} {"id": 303455, "source": "method", "repo": "jenkinsci/pipeline-as-yaml-plugin", "text": "public void setYamlJenkinsFile(String yamlJenkinsFile) { this.yamlJenkinsFile = yamlJenkinsFile; }", "tokens": 25} {"id": 303484, "source": "method", "repo": "jenkinsci/pipeline-as-yaml-plugin", "text": "public String toGroovy() { return new StringBuffer() .append(directive) .append(getDirectiveOpen()) .append(messageKey) .append(this.getStringOpen()) .append(this.message) .append(this.getStringClose()) .append(this.optionalStringToGroovy(id, idKey)) .append(this.optionalStringToGroovy(ok, okKey)) .append(this.optionalStringToGroovy(submitter, submitterKey)) .append(this.optionalStringToGroovy(submitterParameter, submitterParameterKey)) .append(this.parametersModel.map(ParametersModel::toGroovy).orElse(\"\")) .append(getDirectiveClose()) .toString(); }", "tokens": 162} {"id": 303494, "source": "method", "repo": "jenkinsci/pipeline-as-yaml-plugin", "text": "/** @param parametersList List pf parameters */ public ParametersModel(List parametersList) { this.parametersList = parametersList; }", "tokens": 33} {"id": 303569, "source": "method", "repo": "jenkinsci/pipeline-as-yaml-plugin", "text": "/** @param parentNode Parent Node which contains model definition as yaml */ public WhenConditionalParser(LinkedHashMap parentNode) { this.parentNode = parentNode; }", "tokens": 35} {"id": 303587, "source": "method", "repo": "jenkinsci/pipeline-as-yaml-plugin", "text": "void parametersSingleTest() throws IOException { String jenkinsFileContent = FileUtils.readFileToString( new File(\"src/test/resources/parameters/parametersSingle.yml\"), StandardCharsets.UTF_8); PipelineParser pipelineParser = new PipelineParser(jenkinsFileContent); Optional pipelineModel = pipelineParser.parse(); assertTrue(pipelineModel.isPresent()); Optional parametersModel = pipelineModel.get().getParameters(); assertTrue(parametersModel.isPresent()); assertEquals(1, parametersModel.get().getParametersList().size()); }", "tokens": 109} {"id": 303696, "source": "method", "repo": "jenkinsci/pipeline-utility-steps-plugin", "text": "/** An Object containing data to be saved. @param data data to save as yaml */ public void setData(Object data) { if (!isValidObjectType(data)) { throw new IllegalArgumentException(\"data parameter has invalid content (no-basic classes)\"); } this.data = data; }", "tokens": 61} {"id": 303704, "source": "method", "repo": "jenkinsci/pipeline-utility-steps-plugin", "text": "public String getFunctionName() { return \"writeYaml\"; }", "tokens": 14} {"id": 303803, "source": "method", "repo": "jenkinsci/pipeline-utility-steps-plugin", "text": "protected void finished(StepContext sc) throws Exception { filter.close(); }", "tokens": 16} {"id": 303818, "source": "method", "repo": "jenkinsci/pipeline-utility-steps-plugin", "text": "protected ExecutionImpl(@NonNull TouchStep step, @NonNull StepContext context) { super(context); this.step = step; }", "tokens": 29} {"id": 303857, "source": "method", "repo": "jenkinsci/pipeline-utility-steps-plugin", "text": "protected Execution(@NonNull ReadMavenPomStep step, @NonNull StepContext context) { super(context); this.step = step; }", "tokens": 29} {"id": 304060, "source": "method", "repo": "jenkinsci/pipeline-utility-steps-plugin", "text": "void readDirectText() throws Exception { WorkflowJob p = j.jenkins.createProject(WorkflowJob.class, \"p\"); p.setDefinition(new CpsFlowDefinition( \"\"\" def json = readJSON text: '[ { \"key\": 0 }, { \"key\": \"value\" }, { \"key\": true } ]' assert json.isArray() == true assert json.size() == 3 assert json[0].key == 0 assert json[1].key == 'value' assert json[2].key == true \"\"\", true)); j.assertBuildStatusSuccess(p.scheduleBuild2(0)); }", "tokens": 127} {"id": 304069, "source": "method", "repo": "jenkinsci/pipeline-utility-steps-plugin", "text": "void readTextHideFlags() throws Exception { WorkflowJob p = j.jenkins.createProject(WorkflowJob.class, \"p\"); p.setDefinition(new CpsFlowDefinition(\"readJSON returnPojo: true, text: '{\\\"val\\\":\\\"\" + \"s3cr3t\".repeat(500) + \"\\\"}'\", true)); WorkflowRun b = j.assertBuildStatusSuccess(p.scheduleBuild2(0)); for (FlowNode n : new DepthFirstScanner().allNodes(b.getExecution())) { assertThat(\"did not leak secret in \" + n + \" ~ \" + n.getDisplayName(), ArgumentsAction.getStepArgumentsAsString(n), not(containsString(\"s3cr3t\"))); assertThat(\"did not include flags \" + n + \" ~ \" + n.getDisplayName(), ArgumentsAction.getStepArgumentsAsString(n), not(containsString(\"true\"))); } }", "tokens": 178} {"id": 304556, "source": "method", "repo": "jenkinsci/plugin-installation-manager-tool", "text": "void proxyToWireMock() { archives = new WireMockServer(WireMockConfiguration.options().dynamicPort().notifier(new ConsoleNotifier(true))); archives.start(); protectedArchives = new WireMockServer(WireMockConfiguration.options().dynamicPort().notifier(new ConsoleNotifier(true))); protectedArchives.start(); cfg = Config.builder() .withJenkinsWar(Settings.DEFAULT_WAR) .withPluginDir(new File(folder, \"plugins\")) .withCredentials(Collections.singletonList(new Credentials(\"myuser\", \"mypassword\", \"localhost\", protectedArchives.port()))) .withCachePath(newFolder(folder, \"junit\").toPath()) .build(); pm = new PluginManager(cfg); if (record) { archives.stubFor(proxyAllTo(\"http://archives.jenkins-ci.org\").atPriority(1)); } // the mappings from src/test/resources/mappings are used otherwise }", "tokens": 197} {"id": 304823, "source": "method", "repo": "jenkinsci/remoting", "text": "public FutureImpl(java.util.concurrent.Future f) { this.f = Objects.requireNonNull(f); }", "tokens": 29} {"id": 304841, "source": "method", "repo": "jenkinsci/remoting", "text": "int max() { return Integer.MAX_VALUE; }", "tokens": 13} {"id": 305002, "source": "method", "repo": "jenkinsci/remoting", "text": "public void setCredentials(String credentials) { this.credentials = credentials; }", "tokens": 17} {"id": 305038, "source": "method", "repo": "jenkinsci/remoting", "text": "/** Peek the specified number of bytes ({@code len}) at the specified offset in this buffer ({@code offset}) and places it into the specified position ({@code start}) of the array ({@code data}) @return number of bytes actually peeked. Can be 0 if the offset goes beyond the current readable size in this buffer. Never negative. */ public int peek(int offset, byte[] data, int start, int len) { synchronized (lock) { len = Math.min(len, readable() - offset); // can't read beyond the end of the readable buffer if (len <= 0) { return 0; } Pointer v = this.r.copy(); v.forward(offset); v.read(data, start, len); return len; } }", "tokens": 168} {"id": 305066, "source": "method", "repo": "jenkinsci/remoting", "text": "public SocketChannel create(OutputStream out) throws IOException { return create(unwrap(out)); }", "tokens": 20} {"id": 305183, "source": "method", "repo": "jenkinsci/remoting", "text": "/** Returns how much data is remaining between the current read index and the write index. @return the total number of bytes remaining in this buffer queue. */ public long remaining() { long total = buffers[readIndex].position() - readPosition; for (int i = readIndex + 1; i <= writeIndex; i++) { total += buffers[i].position(); } return total; }", "tokens": 83} {"id": 305355, "source": "method", "repo": "jenkinsci/remoting", "text": "void test2(ChannelRunner channelRunner) throws Exception { channelRunner.withChannel(channel -> { final RuntimeException e = assertThrows(RuntimeException.class, () -> channel.call(new Callable2())); assertEquals(\"foo\", e.getMessage()); }); }", "tokens": 55} {"id": 305395, "source": "method", "repo": "jenkinsci/remoting", "text": "private void assertAllocationFails(File workDir, String internalDirName) throws AssertionError { try { WorkDirManager.getInstance().initializeWorkDir(workDir, internalDirName, false); } catch (IOException ex) { assertThat( ex.getMessage(), containsString(String.format( \"Name of %s ('%s') is not compliant with the required format\", WorkDirManager.DirType.INTERNAL_DIR, internalDirName))); return; } fail(\"Initialization of WorkDirManager with invalid internal directory '\" + internalDirName + \"' should have failed\"); }", "tokens": 118} {"id": 305730, "source": "method", "repo": "jenkinsci/role-strategy-plugin", "text": "public String getDisplayName() { return dispName; }", "tokens": 11} {"id": 305830, "source": "method", "repo": "jenkinsci/role-strategy-plugin", "text": "private static Permission getSafePermission(String id) { Permission permission = Permission.fromId(id); if (permission != null && isDangerous(permission)) { LOGGER.log(Level.WARNING, \"The permission: '\" + permission + \"' is dangerous and will be ignored.\"); return null; } return permission; }", "tokens": 69} {"id": 305834, "source": "method", "repo": "jenkinsci/role-strategy-plugin", "text": "protected Set run() throws Exception { Set roleSet = new HashSet<>(); Authentication auth = getAuthentication(); if (auth == null) { return roleSet; } RoleMap roleMap = getRoleMap(); if (roleMap != null) { if (auth == ACL.SYSTEM2) { return roleMap.getRoles().stream().map(Role::getName).collect(Collectors.toSet()); } return roleMap.getRolesForAuth(auth); } return roleSet; }", "tokens": 104} {"id": 305929, "source": "method", "repo": "jenkinsci/role-strategy-plugin", "text": "public void setup() throws Exception { Jenkins jenkins = getJenkins(); jenkins.setSecurityRealm(new JenkinsRule().createDummySecurityRealm()); RoleBasedAuthorizationStrategy rbas = new RoleBasedAuthorizationStrategy(); jenkins.setAuthorizationStrategy(rbas); for (int i = 0; i < 200; i++) { jenkins.createProject(Folder.class, \"Foooooolder\" + i); } Random rand = new Random(33); for (int i = 0; i < 300; i++) { if (rand.nextBoolean()) { rbas.doAddRole(RoleBasedAuthorizationStrategy.PROJECT, \"role\" + i, \"hudson.model.Item.Discover,hudson.model.Item.Read,hudson.model.Item.Build\", \"true\", \"F(o+)+lder[\" + rand.nextInt(10) + rand.nextInt(10) + \"]{1,2}\", \"\"); } rbas.doAssignRole(RoleBasedAuthorizationStrategy.PROJECT, \"role\" + i, \"user\" + i); } }", "tokens": 224} {"id": 305974, "source": "method", "repo": "jenkinsci/role-strategy-plugin", "text": "void testGetMatchingAgentsWithInvalidPattern() throws Exception { URL apiUrl = new URL(jenkinsRule.jenkins.getRootUrl() + \"role-strategy/strategy/getMatchingAgents?pattern=(\"); WebRequest request = new WebRequest(apiUrl, HttpMethod.GET); performAsAndExpect(\"adminUser\", request, HttpURLConnection.HTTP_BAD_REQUEST); }", "tokens": 75} {"id": 306104, "source": "method", "repo": "jenkinsci/role-strategy-plugin", "text": "public AssignRolesPage clickNextPage() { page.locator(\".rsp-pagination\") .getByRole(AriaRole.BUTTON, new Locator.GetByRoleOptions().setName(\"Next\")).click(); return this; }", "tokens": 48} {"id": 306165, "source": "method", "repo": "jenkinsci/slack-plugin", "text": "public MessageBuilder appendStatusMessage() { message.append(this.escape(getStatusMessage(build))); return this; }", "tokens": 26} {"id": 306363, "source": "method", "repo": "jenkinsci/slack-plugin", "text": "public static StandardSlackServiceBuilder builder() { return new StandardSlackServiceBuilder(); }", "tokens": 16} {"id": 306480, "source": "method", "repo": "jenkinsci/slack-plugin", "text": "public String getFunctionName() { return \"slackUserIdsFromCommitters\"; }", "tokens": 17} {"id": 306517, "source": "method", "repo": "jenkinsci/slack-plugin", "text": "public void setToken(String token) { this.token = Util.fixEmpty(token); }", "tokens": 21} {"id": 306568, "source": "method", "repo": "jenkinsci/slack-plugin", "text": "public String getResponseString() { return null; }", "tokens": 12} {"id": 306760, "source": "method", "repo": "jenkinsci/ssh-agents-plugin", "text": "public String getPrefixStartSlaveCmd() { return Util.fixNull(prefixStartSlaveCmd); }", "tokens": 22} {"id": 306777, "source": "method", "repo": "jenkinsci/ssh-agents-plugin", "text": "public void write(int b) throws IOException { if (out != null) out.write(b); }", "tokens": 24} {"id": 306789, "source": "method", "repo": "jenkinsci/ssh-agents-plugin", "text": "/** Retrieve the currently trusted host key for the requested computer, or null if no key is currently trusted. @param host the Computer to retrieve the key for. @return the currently trusted key for the requested host, or null if no key is trusted. @throws IOException if the host key can not be read from storage */ public HostKey getHostKey(Computer host) throws IOException { HostKey key = cache.get(host); if (null == key) { File hostKeyFile = getSshHostKeyFile(host.getNode()); if (hostKeyFile.exists()) { XmlFile xmlHostKeyFile = new XmlFile(hostKeyFile); key = (HostKey) xmlHostKeyFile.read(); } else { key = null; } cache.put(host, key); } return key; }", "tokens": 165} {"id": 306867, "source": "method", "repo": "jenkinsci/ssh-agents-plugin", "text": "private static File newFolder(File root, String... subDirs) { String subFolder = String.join(\"/\", subDirs); File result = new File(root, subFolder); assertFalse(!result.exists() && !result.mkdirs(), \"Couldn't create folders \" + result); return result; }", "tokens": 66} {"id": 307129, "source": "method", "repo": "jenkinsci/warnings-ng-plugin", "text": "/** Creates a new instance of {@link ExcludeMessage}. @param pattern the regular expression of the filter */ public ExcludeMessage(final String pattern) { super(pattern); }", "tokens": 36} {"id": 307219, "source": "method", "repo": "jenkinsci/warnings-ng-plugin", "text": "private StaticAnalysisLabelProvider createNamedLabelProvider( final StaticAnalysisLabelProvider labelProvider, final String name) { labelProvider.setName(name); return labelProvider; }", "tokens": 33} {"id": 307264, "source": "method", "repo": "jenkinsci/warnings-ng-plugin", "text": "private String getIcon(final IssueType type) { return switch (type) { case BUG -> \"symbol-solid/bug plugin-font-awesome-api\"; case DUPLICATION -> \"symbol-regular/clone plugin-font-awesome-api\"; case VULNERABILITY -> \"symbol-solid/shield-halved plugin-font-awesome-api\"; default -> ANALYSIS_SVG_ICON; }; }", "tokens": 92} {"id": 307337, "source": "method", "repo": "jenkinsci/warnings-ng-plugin", "text": "private Run findStartOfSearch(final Run reference, final Report issues) { // The reference recorder skips failed builds, even if they failed only due to a quality gate: so restart the // search at the previous completed build (only for the same job, newer builds of other jobs are not valid) Run previous = run.getPreviousCompletedBuild(); if (previous != null && isNewerBuildOfSameJob(previous, reference)) { issues.logInfo( \"Analyzing builds newer than reference build '%s' as well, \" + \"since builds that failed due to a quality gate might be used as reference\", reference.getFullDisplayName()); return previous; } return reference; }", "tokens": 143} {"id": 307559, "source": "method", "repo": "jenkinsci/warnings-ng-plugin", "text": "/** Build the tests argument. @return test arg */ Arguments build() { return Arguments.of(name, descriptor, run, series); }", "tokens": 30} {"id": 307573, "source": "method", "repo": "jenkinsci/warnings-ng-plugin", "text": "void shouldRejectEverythingForEmptyList() { var filter = new FileNameFilter(List.of()); assertThat(filter.test(issue(\"src/File.ts\"))).isFalse(); }", "tokens": 40} {"id": 307640, "source": "method", "repo": "jenkinsci/warnings-ng-plugin", "text": "private Folder createFolderInFolder(final Folder parent, final String name) throws IOException { return parent.createProject(Folder.class, name); }", "tokens": 33} {"id": 307661, "source": "method", "repo": "jenkinsci/warnings-ng-plugin", "text": "void shouldShowTableWithTwoSelectedTools() { Job job = createJobWithActions( createAction(SPOT_BUGS_ID, SPOT_BUGS_NAME, 1), createAction(CHECK_STYLE_ID, CHECK_STYLE_NAME, 2)); var portlet = createPortlet(); assertThat(portlet.getSelectTools()).isFalse(); assertThat(portlet.getShowIcons()).isFalse(); assertThat(portlet.getHideCleanJobs()).isFalse(); assertThat(portlet.getTools()).isEmpty(); portlet.setSelectTools(true); portlet.setTools(List.of(createTool(SPOT_BUGS_ID), createTool(CHECK_STYLE_ID))); assertThat(portlet.getSelectTools()).isTrue(); assertThat(portlet.getTools()).extracting(ToolSelection::getId).containsExactly(SPOT_BUGS_ID, CHECK_STYLE_ID); List> jobs = List.of(job); verifySpotBugsAndCheckStyle(job, portlet.getModel(jobs)); portlet.setTools(List.of(createTool(SPOT_BUGS_ID))); verifySingleTool(job, portlet.getModel(jobs), SPOT_BUGS_ID, SPOT_BUGS_NAME, 1); portlet.setTools(List.of(createTool(CHECK_STYLE_ID))); verifySingleTool(job, portlet.getModel(jobs), CHECK_STYLE_ID, CHECK_STYLE_NAME, 2); portlet.setTools(Collections.emptyList()); var model = portlet.getModel(jobs); assertThat(model.getColumns()).isEmpty(); List rows = model.getRows(); assertThat(rows).hasSize(1); var actualRow = rows.get(0); assertThat(actualRow.getJob()).isSameAs(job); assertThat(actualRow.getResults()).isEmpty(); }", "tokens": 402} {"id": 307959, "source": "method", "repo": "jenkinsci/warnings-ng-plugin", "text": "protected IssuesTableRow createRow(final WebElement row) { return new IssuesTableRow(row, this); }", "tokens": 24} {"id": 308104, "source": "method", "repo": "jetbrains/intellij-samples", "text": "public String firstName() { return firstName; }", "tokens": 12} {"id": 308122, "source": "method", "repo": "jetbrains/intellij-samples", "text": "public static void main(String[] args) { shouldThrowClassCastException(); }", "tokens": 16} {"id": 308155, "source": "method", "repo": "jetbrains/intellij-samples", "text": "public void regularExpressions() { String creditCard = \"^4[0-9]{12}(?:[0-9]{3})?$\"; String grouping = \"(?Something \\\\k<\"; }", "tokens": 51} {"id": 308166, "source": "method", "repo": "jetbrains/intellij-samples", "text": "public void setNotes(String notes) { this.notes = notes; }", "tokens": 17} {"id": 308212, "source": "method", "repo": "jetbrains/intellij-samples", "text": "List suggestingUsingCopyOf(Collection collection) { return Collections.unmodifiableList(new ArrayList<>(collection)); }", "tokens": 29} {"id": 308393, "source": "method", "repo": "jetbrains/intellij-samples", "text": "public String getCountryWeather() { return season; }", "tokens": 13} {"id": 308563, "source": "method", "repo": "jetbrains/js-graphql-intellij-plugin", "text": "public void visitEnumValueDefinition(@NotNull GraphQLEnumValueDefinition o) { visitDirectivesAware(o); // visitDescriptionAware(o); }", "tokens": 28} {"id": 308677, "source": "method", "repo": "jetbrains/js-graphql-intellij-plugin", "text": "public boolean isAlwaysShowsPlus(StructureViewTreeElement element) { return false; }", "tokens": 19} {"id": 308915, "source": "method", "repo": "jetbrains/js-graphql-intellij-plugin", "text": "/** This is used to clear all the directives in the builder so far. @return the builder */ public Builder clearDirectives() { directives.clear(); return this; }", "tokens": 35} {"id": 309023, "source": "method", "repo": "jetbrains/js-graphql-intellij-plugin", "text": "public static Options defaultOptions() { return new Options(false); }", "tokens": 17} {"id": 309074, "source": "method", "repo": "jetbrains/js-graphql-intellij-plugin", "text": "public Predicate getIncludeSchemaElement() { return includeSchemaElement; }", "tokens": 19} {"id": 309201, "source": "method", "repo": "jetbrains/js-graphql-intellij-plugin", "text": "protected void handleNotObjectError(Value value, GraphQLInputObjectType type) { errorMessage = \"must be an object type\"; }", "tokens": 28} {"id": 309416, "source": "method", "repo": "jhy/jsoup", "text": "/** Find Nodes that match the supplied XPath expression.

For example, to select TextNodes under {@code p} elements:

List<TextNode> textNodes = doc.selectXpath(\"//body//p//text()\", TextNode.class);

Note that in the jsoup DOM, Attribute objects are not Nodes. To directly select attribute values, do something like:

List<String> hrefs = doc.selectXpath(\"//a\").eachAttr(\"href\");
@param xpath XPath expression @param nodeType the jsoup node type to return @see #selectXpath(String) @return a list of matching nodes @since 1.14.3 */ public List selectXpath(String xpath, Class nodeType) { return NodeUtils.selectXpath(xpath, this, nodeType); }", "tokens": 213} {"id": 309419, "source": "method", "repo": "jhy/jsoup", "text": "/** Create a new element by tag name, and add it as this Element's first child. @param tagName the name of the tag (e.g. {@code div}). @return the new element, to allow you to add content to it, e.g.: {@code parent.prependElement(\"h1\").attr(\"id\", \"header\").text(\"Welcome\");} */ public Element prependElement(String tagName) { return prependElement(tagName, tag.namespace()); }", "tokens": 103} {"id": 309478, "source": "method", "repo": "jhy/jsoup", "text": "/** Create a stand-alone, deep copy of this node, and all of its children. The cloned node will have no siblings.

  • If this node is a {@link LeafNode}, the clone will have no parent.
  • If this node is an {@link Element}, the clone will have a simple owning {@link Document} to retain the configured output settings and parser.

The cloned node may be adopted into another Document or node structure using {@link Element#appendChild(Node)}.

@return a stand-alone cloned node, including clones of any children @see #shallowClone() */ // because it does call super.clone in doClone - analysis just isn't following public Node clone() { Node thisClone = doClone(null); // splits for orphan // Queue up nodes that need their children cloned (BFS). final LinkedList nodesToProcess = new LinkedList<>(); nodesToProcess.add(thisClone); while (!nodesToProcess.isEmpty()) { Node currParent = nodesToProcess.remove(); final int size = currParent.childNodeSize(); for (int i = 0; i < size; i++) { final List childNodes = currParent.ensureChildNodes(); Node childClone = childNodes.get(i).doClone(currParent); childNodes.set(i, childClone); nodesToProcess.add(childClone); } } return thisClone; }", "tokens": 318} {"id": 309482, "source": "method", "repo": "jhy/jsoup", "text": "public boolean hasNext() { maybeFindNext(); return next != null; }", "tokens": 16} {"id": 309594, "source": "method", "repo": "jhy/jsoup", "text": "boolean hasInternalSubset() { return sawInternalSubset; }", "tokens": 13} {"id": 309610, "source": "method", "repo": "jhy/jsoup", "text": "final boolean isCData() { return this instanceof CData; }", "tokens": 15} {"id": 309731, "source": "method", "repo": "jhy/jsoup", "text": "/** Removes from this list, and from the DOM, each of the nodes that are contained in the specified collection and are in this list. @param c collection containing nodes to be removed from this list @return {@code true} if nodes were removed from this list */ public boolean removeAll(Collection c) { boolean anyRemoved = false; for (Object o : c) { anyRemoved |= this.remove(o); } return anyRemoved; }", "tokens": 94} {"id": 309791, "source": "method", "repo": "jhy/jsoup", "text": "void normalizesMultiColonElementQName() { String html = \"
inside

after

\"; org.w3c.dom.Document w3CDoc = new W3CDom().fromJsoup(Jsoup.parseBodyFragment(html)); org.w3c.dom.Element main = (org.w3c.dom.Element) w3CDoc.getElementsByTagName(\"main\").item(0); org.w3c.dom.Element child = (org.w3c.dom.Element) w3CDoc.getElementsByTagName(\"a:b_c\").item(0); org.w3c.dom.Element span = (org.w3c.dom.Element) w3CDoc.getElementsByTagName(\"span\").item(0); org.w3c.dom.Element p = (org.w3c.dom.Element) w3CDoc.getElementsByTagName(\"p\").item(0); assertSame(main, child.getParentNode()); assertSame(child, span.getParentNode()); assertSame(main, p.getParentNode()); }", "tokens": 252} {"id": 309876, "source": "method", "repo": "jhy/jsoup", "text": "void makesRepairedHtmlAttributeNameUnique() { // valid names are preserved and repaired collisions receive an underscore prefix Attributes attributes = new Attributes(); attributes.put(\"A=B\", \"one\"); attributes.put(\"a_b\", \"two\"); assertEquals(\" _A_B=\\\"one\\\" a_b=\\\"two\\\"\", attributes.html()); }", "tokens": 75} {"id": 310121, "source": "method", "repo": "jhy/jsoup", "text": "void tokenDataToString() { TokenData data = new TokenData(); assertEquals(\"\", data.toString()); data.set(\"abc\"); assertEquals(\"abc\", data.toString()); data.append(\"def\"); assertEquals(\"abcdef\", data.toString()); }", "tokens": 51} {"id": 310456, "source": "method", "repo": "jingsewu/open-wes", "text": "/** push first sku batch picking task to view @param viewContext */ public void setSkuTaskInfo(ViewContext viewContext) { OutboundWorkStationCache workStationCache = viewContext.getWorkStationCache(); if (CollectionUtils.isEmpty(workStationCache.getOperateTasks())) { return; } WorkStationVO workStationVO = viewContext.getWorkStationVO(); OperationTaskVO firstTaskVO = workStationCache.getFirstOperationTaskVO(); OperationTaskDTO operationTaskDTO = firstTaskVO.getOperationTaskDTO(); List operationTaskDTOs = workStationCache.getOperateTasks().stream() .map(OperationTaskVO::getOperationTaskDTO) .filter(vo -> operationTaskDTO.getSourceContainerCode().equals(vo.getSourceContainerCode()) && operationTaskDTO.getSourceContainerSlot().equals(vo.getSourceContainerSlot()) && operationTaskDTO.getSkuBatchStockId().equals(vo.getSkuBatchStockId())).toList(); WorkStationVO.SkuArea.SkuTaskInfo skuTaskInfo = new WorkStationVO.SkuArea .SkuTaskInfo(firstTaskVO.getSkuMainDataDTO(), firstTaskVO.getSkuBatchAttributeDTO(), operationTaskDTOs); workStationVO.getSkuArea().setPickingViews(Lists.newArrayList(skuTaskInfo)); }", "tokens": 271} {"id": 310529, "source": "method", "repo": "jingsewu/open-wes", "text": "public Object update(@RequestBody @Valid RoleDTO param) { roleService.updateRole(param); return Response.success(); }", "tokens": 28} {"id": 310737, "source": "method", "repo": "jingsewu/open-wes", "text": "public void save(WarehouseMainData warehouse) { warehouseMainDataPORepository.save(warehouseMainDataPOTransfer.toPO(warehouse)); }", "tokens": 31} {"id": 310830, "source": "method", "repo": "jingsewu/open-wes", "text": "void containsBarcode_ValidInput_ReturnsTrue() { skuMainData.setSkuBarcode(new BarcodeDTO()); skuMainData.getSkuBarcode().setBarcodes(new ArrayList<>()); skuMainData.getSkuBarcode().getBarcodes().add(\"testBarcode\"); assertTrue(skuMainData.containsBarcode(\"testBarcode\")); }", "tokens": 65} {"id": 310967, "source": "method", "repo": "jingsewu/open-wes", "text": "public void initSkuInfo(Set skuMainDataDTOS) { Map skuMap = skuMainDataDTOS.stream() .collect(Collectors.toMap( k -> new SkuMainDataDTO.Key(k.getSkuCode(), k.getOwnerCode(), k.getWarehouseCode()), v -> v, (existing, replacement) -> existing )); this.details.forEach(v -> { SkuMainDataDTO.Key key = new SkuMainDataDTO.Key(v.getSkuCode(), v.getOwnerCode(), this.warehouseCode); SkuMainDataDTO skuMainDataDTO = skuMap.get(key); if (skuMainDataDTO != null) { v.setSkuId(skuMainDataDTO.getId()); v.setSkuName(skuMainDataDTO.getSkuName()); } }); }", "tokens": 190} {"id": 311055, "source": "method", "repo": "jingsewu/open-wes", "text": "public void addQty(Integer addQty) { log.info(\"container stock: {} add qty: {}\", id, addQty); this.totalQty += addQty; this.availableQty += addQty; validateQty(); }", "tokens": 49} {"id": 311229, "source": "method", "repo": "jitseb/npclib", "text": "public void hide(Player player) { hide(player, false); }", "tokens": 16} {"id": 311428, "source": "method", "repo": "jixxed/ed-odyssey-materials-helper", "text": "static void launchFx(final String[] args) { Locale.setDefault(Locale.ENGLISH); final ApplicationLocale applicationLocale = ApplicationLocale.valueOf(PreferencesService.getPreference(PreferenceConstants.LANGUAGE, \"ENGLISH\")); LocaleService.setCurrentLocale(applicationLocale.getLocale()); launch(args); }", "tokens": 59} {"id": 311515, "source": "method", "repo": "jixxed/ed-odyssey-materials-helper", "text": "double getMenuItemX(final int index) { return this.menuItems.get(index).getX(); }", "tokens": 25} {"id": 311569, "source": "method", "repo": "jixxed/ed-odyssey-materials-helper", "text": "private DestroyableButton continueButton() { return ButtonBuilder.builder() .withText(\"dialog.start.continue\") .withOnAction(_ -> this.stage.close()) .build(); }", "tokens": 43} {"id": 311776, "source": "method", "repo": "jixxed/ed-odyssey-materials-helper", "text": "public void close() { if (this.moduleSelectPopover != null) { this.moduleSelectPopover.close(); this.moduleSelectPopover = null; } }", "tokens": 38} {"id": 311790, "source": "method", "repo": "jixxed/ed-odyssey-materials-helper", "text": "public void updateMounting(ShipModule shipModule) { if (shipModule instanceof HardpointModule hardpointModule) { if (!isCurrentShip()) { this.mountingUp.setVisible(hardpointModule.findHigherMounting().isPresent()); this.mountingDown.setVisible(hardpointModule.findLowerMounting().isPresent()); } if (this.mountingLabel.getGraphic() != null) { ((Destroyable) this.mountingLabel.getGraphic()).destroy(); } var graphic = createIconWithoutTooltip(hardpointModule.getMounting().getIcon(), \"icon\"); this.mountingLabel.setGraphic(graphic); this.mountingLabel.register(graphic); } }", "tokens": 147} {"id": 312273, "source": "method", "repo": "jixxed/ed-odyssey-materials-helper", "text": "private DestroyableHBox createHorizonsRemainingAvailableSetting() { DestroyableLabel flipHorizonsRemainingAvailableLabel = LabelBuilder.builder() .withStyleClass(SETTINGS_LABEL_CLASS) .withText(\"tab.settings.flip.remaining.available.horizons\") .build(); DestroyableLabel flipHorizonsRemainingAvailableExplainLabel = LabelBuilder.builder() .withStyleClass(SETTINGS_LABEL_CLASS) .withText(\"tab.settings.flip.remaining.available.horizons.explain\") .build(); //available is default(false) DestroyableCheckBox flipHorizonsRemainingAvailableCheckBox = CheckBoxBuilder.builder() .withSelected(PreferencesService.getPreference(PreferenceConstants.FLIP_WISHLIST_REMAINING_AVAILABLE_HORIZONS, Boolean.FALSE))//available is default(false) .withSelectedProperty((_, _, newValue) -> { PreferencesService.setPreference(PreferenceConstants.FLIP_WISHLIST_REMAINING_AVAILABLE_HORIZONS, newValue); EventService.publish(new FlipRemainingAvailableEvent(Expansion.HORIZONS, newValue)); }) .build(); return BoxBuilder.builder() .withStyleClasses(SETTINGS_JOURNAL_LINE_STYLE_CLASS, SETTINGS_SPACING_10_CLASS) .withNodes(flipHorizonsRemainingAvailableLabel, flipHorizonsRemainingAvailableCheckBox, flipHorizonsRemainingAvailableExplainLabel) .buildHBox(); }", "tokens": 309} {"id": 312280, "source": "method", "repo": "jixxed/ed-odyssey-materials-helper", "text": "public void initEventHandling() { register(EventService.addListener(true, this, AfterFontSizeSetEvent.class, fontSizeEvent -> applyFontSizeToComponents(fontSizeEvent.getFontSize(), this.readingDirectionSelect))); }", "tokens": 45} {"id": 312525, "source": "method", "repo": "jmetal/jmetal", "text": "public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem() throws Exception { algorithm = new MOCellBuilder(problem, crossover, mutation) .setArchive(new CrowdingDistanceArchive<>(100)) .build(); algorithm.run(); List population = algorithm.result(); /* Rationale: the default problem is ZDT4, and MOCell, configured with standard settings, should return 100 solutions */ assertTrue(population.size() >= 98); }", "tokens": 114} {"id": 313031, "source": "method", "repo": "jmetal/jmetal", "text": "/** Case 6 Solution list: 0 1 2 3 The solution location is 2, the neighborhood is 0, 3 */ void shouldGetNeighborsReturnFourNeighborsCase6() { int rows = 2 ; int columns = 2 ; L5 neighborhood = new L5(rows, columns) ; List list = new ArrayList<>(rows*columns) ; for (int i = 0 ; i < rows*columns; i++) { list.add(mock(IntegerSolution.class)) ; } List result = neighborhood.getNeighbors(list, 2) ; Assertions.assertEquals(4, result.size()); assertThat(result, hasItems(list.get(0), list.get(3))) ; assertThat(result, not(hasItems(list.get(1), list.get(2)))) ; }", "tokens": 202} {"id": 313036, "source": "method", "repo": "jmetal/jmetal", "text": "void getNeighboursWithIndexOneOnAListWithTwoSolutionsReturnsTwoCopiesOfTheFirstSolution(){ DoubleProblem problem = new FakeDoubleProblem(3, 2, 0) ; DoubleSolution solution1 = problem.createSolution() ; DoubleSolution solution2 = problem.createSolution() ; var solutions = List.of(solution1, solution2) ; var neighborhood = new RingNeighborhood() ; var neighbors = neighborhood.getNeighbors(solutions, 1) ; assertEquals(2, neighbors.size()); assertSame(solution1, neighbors.get(0)); assertSame(solution1, neighbors.get(1)); }", "tokens": 142} {"id": 313039, "source": "method", "repo": "jmetal/jmetal", "text": "void createIntegerPermutationRaisesAnExceptionWhenRandomGeneratorIsNull() { assertThatThrownBy(() -> PermutationFactory.createIntegerPermutation(4, null)); }", "tokens": 32} {"id": 313110, "source": "method", "repo": "jmetal/jmetal", "text": "public RCM40OptimalPowerFlowActiveReactiveLossProblem() { super(2, \"OptimalPowerFlowActiveReactiveLossProblem\"); }", "tokens": 29} {"id": 313524, "source": "method", "repo": "jmxtrans/jmxtrans-agent", "text": "/** @param urlStr @return url composed with the query string */ private URL parseUrlStr(String urlStr) { try { // TODO shouldn't we check if it is \"?\" or \"&\" according to the existence of a querystring part in the configuration URL? return new URL(urlStr + \"?\" + buildQueryString()); } catch (MalformedURLException e) { throw new RuntimeException(e); } }", "tokens": 85} {"id": 313660, "source": "method", "repo": "jmxtrans/jmxtrans-agent", "text": "public static Resource newResource(@Nonnull String path) { Preconditions2.checkNotNull(path, \"Given 'path' cannot be null\"); if (path.startsWith(\"classpath:\")) { return new ClasspathResource(path); } else if (path.contains(\"://\")) { return new UrlResource(path); } else { return new FileResource(path); } }", "tokens": 77} {"id": 313676, "source": "method", "repo": "jmxtrans/jmxtrans-agent", "text": "/** Parses the given input string as JSON. The input must contain a valid JSON value, optionally padded with whitespace. @param string the input string, must be valid JSON @return a value that represents the parsed JSON @throws ParseException if the input is not valid JSON */ public static org.jmxtrans.agent.util.json.JsonValue parse(String string) { if (string == null) { throw new NullPointerException(\"string is null\"); } DefaultHandler handler = new DefaultHandler(); new JsonParser(handler).parse(string); return handler.getValue(); }", "tokens": 115} {"id": 313763, "source": "method", "repo": "jmxtrans/jmxtrans-agent", "text": "private void closeChannelAndClearMessages() throws IOException { if (channel != null) { channel.close(); } receivedMessages.clear(); }", "tokens": 29} {"id": 313867, "source": "method", "repo": "jmxtrans/jmxtrans-agent", "text": "public void loadFromFileUrl() throws Exception { File file = createTempTestFile(); PropertiesLoader loader = new ResourcePropertiesLoader(\"file://\" + addSlashIfMissing(file.getAbsolutePath())); Map properties = loader.loadProperties(); assertThat(properties.size(), equalTo(1)); assertThat(properties, hasEntry(\"test\", \"testvalue\")); }", "tokens": 74} {"id": 313872, "source": "method", "repo": "jmxtrans/jmxtrans-agent", "text": "private File createTempTestFile() throws IOException, FileNotFoundException { Path tmpFile = Files.createTempFile(this.getClass().getSimpleName(), null); File file = tmpFile.toFile(); file.deleteOnExit(); try (FileOutputStream fileOutputStream = new FileOutputStream(file)) { fileOutputStream.write(\"test=testvalue\".getBytes()); } return file; }", "tokens": 73} {"id": 313902, "source": "method", "repo": "jmxtrans/jmxtrans-agent", "text": "public void divide() { int responseCode = HttpURLConnection.HTTP_FORBIDDEN; int responseCodeGroup = responseCode / 100; assertThat(responseCodeGroup, equalTo(4)); }", "tokens": 38} {"id": 314189, "source": "method", "repo": "jncrmx/discord-game-sdk4j", "text": "public void handle(Command command, DiscordUser user) { core.currentUser = user; core.getEventAdapter().onCurrentUserUpdate(); }", "tokens": 29} {"id": 314284, "source": "method", "repo": "jobmission/oauth2-server", "text": "public JdbcClientRegistrationRepository(OauthClientRepository oauthClientRepository) { this.oauthClientRepository = oauthClientRepository; }", "tokens": 26} {"id": 314340, "source": "method", "repo": "jobmission/oauth2-server", "text": "public String getAccountOpenCode() { return accountOpenCode; }", "tokens": 15} {"id": 314421, "source": "method", "repo": "jobmission/oauth2-server", "text": "public RegisteredClientRepositoryImpl(OauthClientRepository oauthClientRepository, CacheManager cacheManager) { this.oauthClientRepository = oauthClientRepository; this.cacheManager = cacheManager; }", "tokens": 39} {"id": 314465, "source": "method", "repo": "jobmission/oauth2-server", "text": "public void checkPwd() { System.out.println(StringUtils.center(\"123\", 30, \"-\") + CheckPasswordStrength.check(\"123\")); System.out.println(StringUtils.center(\"123456\", 30, \"-\") + CheckPasswordStrength.check(\"123456\")); System.out.println(StringUtils.center(\"258369\", 30, \"-\") + CheckPasswordStrength.check(\"258369\")); System.out.println(StringUtils.center(\"123456a\", 30, \"-\") + CheckPasswordStrength.check(\"123456a\")); System.out.println(StringUtils.center(\"123456a!\", 30, \"-\") + CheckPasswordStrength.check(\"123456a!\")); System.out.println(StringUtils.center(\"123567aAa\", 30, \"-\") + CheckPasswordStrength.check(\"123567aAa\")); System.out.println(StringUtils.center(\"123789a!\", 30, \"-\") + CheckPasswordStrength.check(\"123789a!\")); System.out.println(StringUtils.center(\"123789A!\", 30, \"-\") + CheckPasswordStrength.check(\"123789A!\")); System.out.println(StringUtils.center(\"123789Aa!\", 30, \"-\") + CheckPasswordStrength.check(\"123789Aa!\")); System.out.println(StringUtils.center(\"!123789Aa!\", 30, \"-\") + CheckPasswordStrength.check(\"!123789Aa!\")); }", "tokens": 386} {"id": 314493, "source": "method", "repo": "joey-zhou/xiaozhi-esp32-server-java", "text": "public ToolCallingManager toolCallingManager(ObservationRegistry observationRegistry, @Autowired(required = false) ToolCallbackResolver toolCallbackResolver, @Autowired(required = false) ToolExecutionExceptionProcessor toolExecutionExceptionProcessor) { return new XiaoZhiToolCallingManager(observationRegistry, toolCallbackResolver != null ? toolCallbackResolver : name -> null, toolExecutionExceptionProcessor == null ? defaultToolExecutionExceptionProcessor : toolExecutionExceptionProcessor); }", "tokens": 92} {"id": 315115, "source": "method", "repo": "john-paul-r/essential-commands", "text": "protected int exec(CommandContext context, ServerPlayer respondingPlayer, ServerPlayer requesterPlayer) { var senderPlayerData = PlayerData.access(respondingPlayer); var targetPlayerData = ((ServerPlayerEntityAccess) requesterPlayer).ec$getPlayerData(); //identify if target player did indeed request to teleport. Continue if so, otherwise throw exception. Optional teleportRequest = targetPlayerData.getSentTeleportRequests() .getRequestToPlayer(senderPlayerData); if (teleportRequest.isPresent() && teleportRequest.get().getTargetPlayer().equals(respondingPlayer)) { //inform target player that teleport has been accepted via chat targetPlayerData.sendMessage(\"cmd.tpaccept.feedback\"); //Conduct teleportation teleportRequest.get().queue(); //Send message to command sender confirming that request has been accepted senderPlayerData.sendMessage(\"cmd.tpaccept.feedback\"); // Remove the tp request, as it has been completed. teleportRequest.get().end(); return SINGLE_SUCCESS; } else { senderPlayerData.sendError(\"cmd.tpa_reply.error.no_request_from_target\"); return -1; } }", "tokens": 237} {"id": 315131, "source": "method", "repo": "john-paul-r/essential-commands", "text": "private void exec( CommandContext context, ServerPlayer targetPlayer) throws CommandSyntaxException { var worldDataManager = ManagerLocator.getInstance().getWorldDataManager(); var senderPlayer = context.getSource().getPlayerOrException(); var ecText = ECText.access(senderPlayer); String warpName = StringArgumentType.getString(context, \"warp_name\"); var warpNameText = ecText.accent(warpName); WarpLocation loc = worldDataManager.getWarp(warpName); if (loc == null) { throw CommandUtil.createSimpleException(ecText.getText( \"cmd.warp.tp.error.not_found\", TextFormatType.Error, warpNameText)); } if (!loc.hasPermission(senderPlayer)) { throw CommandUtil.createSimpleException(ecText.getText( \"cmd.warp.tp.error.permission\", TextFormatType.Error, warpNameText)); } // Teleport & chat message PlayerTeleporter.requestTeleport( targetPlayer, loc, ecText.getText(\"cmd.warp.location_name\", warpNameText)); }", "tokens": 224} {"id": 315192, "source": "method", "repo": "john-paul-r/essential-commands", "text": "public static EssentialCommandsConfigSnapshot create(EssentialCommandsConfig config) { return new EssentialCommandsConfigSnapshot(config); }", "tokens": 27} {"id": 315207, "source": "method", "repo": "john-paul-r/essential-commands", "text": "private Dynamic removeEmptyObjectSpawnFields(Dynamic dynamic) { var hasSpawnValueWithEmptyObject = dynamic.get(\"spawn\") .get() .mapOrElse( // if we've got a spawn spawn -> spawn.getMapValues().map(Map::isEmpty).getOrThrow(), // and that spawn object is empty (_keyMissingError) -> false // (false if no spawn key in WorldData) ); if (hasSpawnValueWithEmptyObject) { return dynamic.remove(\"spawn\"); } return dynamic; }", "tokens": 110} {"id": 315217, "source": "method", "repo": "john-paul-r/essential-commands", "text": "public void onPlayerLeave(ServerPlayer player, CallbackInfo callbackInfo) { PlayerLeaveCallback.EVENT.invoker().onPlayerLeave(player); }", "tokens": 29} {"id": 315274, "source": "method", "repo": "john-paul-r/essential-commands", "text": "public void sendError(String messageKey, Component... args) { this.player.sendSystemMessage(ECText.access(this.player).getText(messageKey, TextFormatType.Error, args)); }", "tokens": 47} {"id": 315446, "source": "method", "repo": "john-paul-r/essential-commands", "text": "public Style getStyle() { return style.getValue(); }", "tokens": 13} {"id": 315636, "source": "method", "repo": "joml-ci/joml", "text": "/** Multiply this by the matrix
 0 1 0 1 0 0 0 0 -1 
@return this */ public Matrix3d mapYXnZ() { return mapYXnZ(this); }", "tokens": 58} {"id": 315644, "source": "method", "repo": "joml-ci/joml", "text": "public Matrix3d negateZ(Matrix3d dest) { return dest._m00(m00)._m01(m01)._m02(m02)._m10(m10)._m11(m11)._m12(m12)._m20(-m20)._m21(-m21)._m22(-m22); }", "tokens": 111} {"id": 315695, "source": "method", "repo": "joml-ci/joml", "text": "/** Apply a rotation transformation to this matrix by rotating the given amount of radians about the specified rotation center (x, y) and store the result in dest.

This method is equivalent to calling: translate(x, y, dest).rotate(ang).translate(-x, -y)

If M is this matrix and R the rotation matrix, then the new matrix will be M * R. So when transforming a vector v with the new matrix by using M * R * v, the rotation will be applied first! @see #translate(double, double, Matrix3x2d) @see #rotate(double, Matrix3x2d) @param ang the angle in radians @param x the x component of the rotation center @param y the y component of the rotation center @param dest will hold the result @return dest */ public Matrix3x2d rotateAbout(double ang, double x, double y, Matrix3x2d dest) { double tm20 = m00 * x + m10 * y + m20; double tm21 = m01 * x + m11 * y + m21; double cos = Math.cos(ang); double sin = Math.sin(ang); double nm00 = m00 * cos + m10 * sin; double nm01 = m01 * cos + m11 * sin; dest.m10 = m00 * -sin + m10 * cos; dest.m11 = m01 * -sin + m11 * cos; dest.m00 = nm00; dest.m01 = nm01; dest.m20 = dest.m00 * -x + dest.m10 * -y + tm20; dest.m21 = dest.m01 * -x + dest.m11 * -y + tm21; return dest; }", "tokens": 447} {"id": 315702, "source": "method", "repo": "joml-ci/joml", "text": "/** Create a new 3x2 matrix using the supplied float values. The order of the parameter is column-major, so the first two parameters specify the two elements of the first column. @param m00 the value of m00 @param m01 the value of m01 @param m10 the value of m10 @param m11 the value of m11 @param m20 the value of m20 @param m21 the value of m21 */ public Matrix3x2f(float m00, float m01, float m10, float m11, float m20, float m21) { this.m00 = m00; this.m01 = m01; this.m10 = m10; this.m11 = m11; this.m20 = m20; this.m21 = m21; }", "tokens": 206} {"id": 315742, "source": "method", "repo": "joml-ci/joml", "text": "public DoubleBuffer getTransposed(DoubleBuffer dest) { MemUtil.INSTANCE.putTransposed(this, dest.position(), dest); return dest; }", "tokens": 33} {"id": 316160, "source": "method", "repo": "joml-ci/joml", "text": "public Vector3d transformInverseUnit(Vector3dc vec, Vector3d dest) { return transformInverseUnit(vec.x(), vec.y(), vec.z(), dest); }", "tokens": 40} {"id": 316170, "source": "method", "repo": "joml-ci/joml", "text": "/** Apply a rotation to this quaternion rotating the given radians about the x axis.

If Q is this quaternion and R the quaternion representing the specified rotation, then the new quaternion will be Q * R. So when transforming a vector v with the new quaternion by using Q * R * v, the rotation added by this method will be applied first! @param angle the angle in radians to rotate about the x axis @return this */ public Quaternionf rotateX(float angle) { return rotateX(angle, this); }", "tokens": 129} {"id": 316261, "source": "method", "repo": "joml-ci/joml", "text": "/** Multiply the transpose of the given 4x4 matrix mat with this.

This method assumes the w component of this to be 0.0.

Note that this method performs the operation M^T * this, where M is the provided matrix and thus interprets this as a column vector. @param mat the matrix whose transpose to multiply this vector by @return this */ public Vector3d mulTransposeDirection(Matrix4dc mat) { return mulTransposeDirection(mat, this); }", "tokens": 139} {"id": 316305, "source": "method", "repo": "joml-ci/joml", "text": "/** Get the length of a 3-dimensional single-precision vector. @param x The vector's x component @param y The vector's y component @param z The vector's z component @return the length squared of the given vector */ public static double length(int x, int y, int z) { return Math.sqrt((long) x * x + (long) y * y + (long) z * z); }", "tokens": 96} {"id": 316313, "source": "method", "repo": "joml-ci/joml", "text": "/** Set the x, y, z, and w components to the supplied values. @param x the x component @param y the y component @param z the z component @param w the w component @return this */ public Vector4L set(long x, long y, long z, long w) { this.x = x; this.y = y; this.z = z; this.w = w; return this; }", "tokens": 93} {"id": 316370, "source": "method", "repo": "joml-ci/joml", "text": "public Vector3f mulProjectAffine(Matrix4fc mat, Vector3f dest) { float invW = 1.0f / w; float rx = Math.fma(mat.m00(), x, Math.fma(mat.m10(), y, Math.fma(mat.m20(), z, mat.m30() * w))) * invW; float ry = Math.fma(mat.m01(), x, Math.fma(mat.m11(), y, Math.fma(mat.m21(), z, mat.m31() * w))) * invW; float rz = Math.fma(mat.m02(), x, Math.fma(mat.m12(), y, Math.fma(mat.m22(), z, mat.m32() * w))) * invW; dest.x = rx; dest.y = ry; dest.z = rz; return dest; }", "tokens": 214} {"id": 316415, "source": "method", "repo": "joml-ci/joml", "text": "void testPositiveXRotateY() { Vector3d dir = new Vector3d(); Matrix4x3dc m = new Matrix4x3d() .rotateY(Math.toRadians(90)); m.positiveX(dir); assertVector3dEquals(new Vector3d(0, 0, 1), dir, 1E-7f); }", "tokens": 80} {"id": 316538, "source": "method", "repo": "jonafanho/minecraft-transit-railway", "text": "public void writeCompoundTag(CompoundTag compoundTag) { final List trackPositionsList = new ArrayList<>(); trackPositions.forEach(position -> trackPositionsList.add(position.asLong())); compoundTag.putLongArray(KEY_TRACK_FLOOR_POS, trackPositionsList); }", "tokens": 57} {"id": 316585, "source": "method", "repo": "jonafanho/minecraft-transit-railway", "text": "public BlockPIDSHorizontalBase(int maxArrivals) { super(maxArrivals, BlockPIDSHorizontalBase::canStoreData, BlockPIDSHorizontalBase::getBlockPosWithData); }", "tokens": 41} {"id": 316870, "source": "method", "repo": "jonafanho/minecraft-transit-railway", "text": "public final void render(GraphicsHolder graphicsHolder, int light, int overlay, float red, float green, float blue, float alpha) { }", "tokens": 30} {"id": 317010, "source": "method", "repo": "jonafanho/minecraft-transit-railway", "text": "protected boolean isLeft(BlockState state) { return IBlock.getStatePropertySafe(state, SIDE_EXTENDED) == IBlock.EnumSide.LEFT; }", "tokens": 34} {"id": 317314, "source": "method", "repo": "jonafanho/minecraft-transit-railway", "text": "protected void doPost(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { final AsyncContext asyncContext = httpServletRequest.startAsync(); asyncContext.setTimeout(0); setEncoding(httpServletRequest, httpServletResponse); switch (httpServletRequest.getPathInfo()) { case \"/update\": update(httpServletRequest, httpServletResponse, asyncContext); break; default: returnErrorResponse(httpServletResponse, asyncContext); break; } }", "tokens": 86} {"id": 317849, "source": "method", "repo": "jopt-simple/jopt-simple", "text": "public void allowsTypingOfNonOptionArguments() { OptionSpec nonOptions = parser.nonOptions().ofType( File.class ); OptionSet options = parser.parse( \"/opt\", \"/var\" ); assertEquals( asList( new File( \"/opt\" ), new File( \"/var\" ) ), nonOptions.values( options ) ); }", "tokens": 80} {"id": 317889, "source": "method", "repo": "jopt-simple/jopt-simple", "text": "public void tooManyHyphens() { parser.accepts( \"b\" ); var exception = assertThrows( OptionException.class, () -> parser.parse( \"---b\" ) ); assertTrue( exception.options().contains( \"-b\" ) ); }", "tokens": 60} {"id": 317954, "source": "method", "repo": "jopt-simple/jopt-simple", "text": "public void parsesSeparatedValuesWhenArgumentAbuttedWithEquals() { assertCorrectParse( \"classpath\", ':', \"--classpath=/usr:/opt:/var\" ); }", "tokens": 40} {"id": 318078, "source": "method", "repo": "jopt-simple/jopt-simple", "text": "public void illegalLongOption() { var exception = assertThrows( OptionException.class, () -> parser.parse( \"-W\", \"foo=bar\" )); assertTrue( exception.options().contains(\"foo\") ); }", "tokens": 49} {"id": 318113, "source": "method", "repo": "jopt-simple/jopt-simple", "text": "public void raisesExceptionContainingValueAndPattern() { var exception = assertThrows( ValueConversionException.class, () -> RegexConverter.of( \"\\\\d+\", 0 ).convert( \"asdf\" ) ); assertTrue( exception.getMessage().contains( \"\\\\d+\" ) ); assertTrue( exception.getMessage().contains( \"asdf\" ) ); }", "tokens": 82} {"id": 318318, "source": "method", "repo": "jorelali/commandapi", "text": "public final ArgumentType _ArgumentMinecraftKeyRegistered() { return IdentifierArgument.id(); }", "tokens": 21} {"id": 318324, "source": "method", "repo": "jorelali/commandapi", "text": "public final ArgumentType _ArgumentBlockPredicate() { return BlockPredicateArgument.blockPredicate(getCommandBuildContext()); }", "tokens": 25} {"id": 318485, "source": "method", "repo": "jorelali/commandapi", "text": "public void createDispatcherFile(File file, CommandDispatcher brigadierDispatcher) throws IOException { throw new UnimplementedMethodException(); }", "tokens": 32} {"id": 318771, "source": "method", "repo": "jozufozu/flywheel", "text": "public MeshPool meshPool() { return meshPool; }", "tokens": 14} {"id": 318987, "source": "method", "repo": "jozufozu/flywheel", "text": "default Self rotateCentered(float radians, Axis axis) { if (radians == 0) { return self(); } return rotateCentered(axis.rotation(radians)); }", "tokens": 38} {"id": 319072, "source": "method", "repo": "jozufozu/flywheel", "text": "private void flywheel$beforeRenderCrumbling(CallbackInfo ci) { if (flywheel$renderContext != null) { VisualizationManager manager = VisualizationManager.get(level); if (manager != null) { manager.renderDispatcher().beforeSubmitCrumbling(flywheel$renderContext, destructionProgress); } } }", "tokens": 66} {"id": 319107, "source": "method", "repo": "jozufozu/flywheel", "text": "private LoadResult _load(Identifier id) { var maybeFound = sources.get(id); if (maybeFound == null) { return new LoadResult.Failure(new LoadError.IOError(id, new FileNotFoundException(id.toString()))); } return SourceFile.parse(this::find, id, maybeFound); }", "tokens": 70} {"id": 319144, "source": "method", "repo": "jozufozu/flywheel", "text": "public VertexConsumer setLineWidth(float width) { throw new UnsupportedOperationException(\"NeoForgeMeshEmitter only supports putBakedQuad/putBlockBakedQuad!\"); }", "tokens": 28} {"id": 319170, "source": "method", "repo": "jozufozu/flywheel", "text": "/** Constructs the entity visualizer and sets it for the entity type. @return The entity visualizer. */ public SimpleEntityVisualizer apply(boolean enabledByDefault) { Objects.requireNonNull(visualFactory, \"Visual factory cannot be null!\"); if (skipVanillaRender == null) { skipVanillaRender = entity -> true; } SimpleEntityVisualizer visualizer = new SimpleEntityVisualizer<>(visualFactory, skipVanillaRender); configurator.register(type, visualizer, enabledByDefault); return visualizer; }", "tokens": 107} {"id": 319230, "source": "method", "repo": "jpenilla/minimotd", "text": "public ConfigLoader( final Class configClass, final Path configPath ) { this(configClass, configPath, options -> options); }", "tokens": 33} {"id": 319351, "source": "method", "repo": "jpenilla/minimotd", "text": "public void description(final Component description) { Objects.requireNonNull(description, \"description\"); this.description = description; }", "tokens": 26} {"id": 319396, "source": "method", "repo": "jpenilla/tabtps", "text": "public DisplayHandler tab() { return this.tabDisplayHandler; }", "tokens": 20} {"id": 319468, "source": "method", "repo": "jpenilla/tabtps", "text": "public static TickInfoCommand defaultFormatter(final TabTPS tabTPS, final Commands commands) { return withFormatter(tabTPS, commands, new DefaultFormatter(tabTPS)); }", "tokens": 37} {"id": 319748, "source": "method", "repo": "jpenilla/tabtps", "text": "public JoinQuitListener(final TabTPSPlugin plugin) { this.plugin = plugin; }", "tokens": 21} {"id": 319829, "source": "method", "repo": "jruby/joni", "text": "private void noNameDisableMapFor_listAlt(Node node, int[]map, Ptr counter) { ListNode can = (ListNode)node; do { can.setValue(noNameDisableMap(can.value, map, counter)); } while ((can = can.tail) != null); }", "tokens": 66} {"id": 320149, "source": "method", "repo": "jruby/joni", "text": "boolean equal(MinMaxLen other) { return min == other.min && max == other.max; }", "tokens": 23} {"id": 320163, "source": "method", "repo": "jruby/joni", "text": "public int getBeg(int index) { return begEnd[index * 2]; }", "tokens": 22} {"id": 320172, "source": "method", "repo": "jruby/joni", "text": "public void addBackref(int backRef) { backNum++; switch (backNum) { case 1: backRef1 = backRef; break; case 2: alloc(); backRefs[0] = backRef1; backRefs[1] = backRef; break; default: ensureSize(); backRefs[backNum - 1] = backRef; } }", "tokens": 82} {"id": 320311, "source": "method", "repo": "jruby/joni", "text": "protected final void unfetch() { p = lastFetched; }", "tokens": 14} {"id": 320445, "source": "method", "repo": "jruby/joni", "text": "public boolean opEscBraceInterval() { return isOp(OP_ESC_BRACE_INTERVAL); }", "tokens": 22} {"id": 320635, "source": "method", "repo": "jruby/joni", "text": "protected int popularNum() { if (greedy) { if (lower == 0) { if (upper == 1) return 0; else if (isRepeatInfinite(upper)) return 1; } else if (lower == 1) { if (isRepeatInfinite(upper)) return 2; } } else { if (lower == 0) { if (upper == 1) return 3; else if (isRepeatInfinite(upper)) return 4; } else if (lower == 1) { if (isRepeatInfinite(upper)) return 5; } } return -1; }", "tokens": 132} {"id": 320665, "source": "method", "repo": "jruby/joni", "text": "public void clearNamedGroup() { state &= ~NST_NAMED_GROUP; }", "tokens": 20} {"id": 320830, "source": "method", "repo": "jruby/jruby-maven-plugins", "text": "public Collection getMetadataList() { return this.artifact.getMetadataList(); }", "tokens": 21} {"id": 320867, "source": "method", "repo": "jruby/jruby-maven-plugins", "text": "private MavenProject projectFromArtifact(final Artifact artifact) throws ProjectBuildingException, GemException { final ProjectBuildingRequest request = new DefaultProjectBuildingRequest().setLocalRepository(this.localRepository) .setRemoteRepositories(this.project.getRemoteArtifactRepositories()); manager.setRepositorySession(request, this.repositorySession ); final MavenProject project = this.builder.build(artifact, request) .getProject(); if (project.getDistributionManagement() != null && project.getDistributionManagement().getRelocation() != null) { final Relocation reloc = project.getDistributionManagement() .getRelocation(); final String key = artifact.getGroupId() + \":\" + artifact.getArtifactId() + \":\" + artifact.getType() + \":\" + artifact.getVersion(); artifact.setArtifactId(reloc.getArtifactId()); artifact.setGroupId(reloc.getGroupId()); if (reloc.getVersion() != null) { artifact.setVersion(reloc.getVersion()); } this.relocationMap.put(key, artifact.getGroupId() + \":\" + artifact.getArtifactId() + \":\" + artifact.getType() + \":\" + artifact.getVersion()); return projectFromArtifact(artifact); } else { return project; } }", "tokens": 246} {"id": 320939, "source": "method", "repo": "jruby/jruby-maven-plugins", "text": "private void resolveJarDepedencies(Set jars) { ArtifactResolutionRequest req = new ArtifactResolutionRequest() .setArtifact(project.getArtifact()) .setResolveRoot(false) .setArtifactDependencies(jars) .setResolveTransitively(true) .setLocalRepository(localRepository) .setRemoteRepositories(project.getRemoteArtifactRepositories()) .setCollectionFilter(new ArtifactFilter() { // we want to skip all those jruby artifacts to be on the safe side public boolean include(Artifact artifact) { return !(artifact.getGroupId().equals(\"org.jruby\") && (artifact.getArtifactId().equals(\"jruby\") || artifact.getArtifactId().equals(\"jruby-complete\") || artifact.getArtifactId().equals(\"jruby-core\") || artifact.getArtifactId().equals(\"jruby-stdlib\"))); } }); ArtifactResolutionResult result = this.repositorySystem.resolve(req); Set resolvedArtifacts = result.getArtifacts(); for( Artifact artifact : resolvedArtifacts ){ // * compile scope we leave things as they are // * other scopes we only take runtime, compile time artifacts and set the scope to outer scope if (\"compile\".equals(scope)) { if (artifact.getScope() == null) artifact.setScope(scope); jars.add(artifact); } else if (!\"test\".equals(artifact.getScope()) && !\"provided\".equals(artifact.getScope())) { artifact.setScope(scope); jars.add(artifact); } } }", "tokens": 313} {"id": 321091, "source": "method", "repo": "jruby/jruby-maven-plugins", "text": "public GemRequirement getVersion_requirement() { return null; }", "tokens": 13} {"id": 321102, "source": "method", "repo": "jruby/jruby-maven-plugins", "text": "public String getBindir() { return this.bindir; }", "tokens": 15} {"id": 321298, "source": "method", "repo": "jruby/jruby-maven-plugins", "text": "public void executeScript(final String script, final List args, final OutputStream outputStream) throws ScriptException, IOException { executeScript(null, script, args, outputStream); }", "tokens": 38} {"id": 321558, "source": "method", "repo": "jrvansuita/materialabout", "text": "/** Starts a new direct Whatsapp chat @param phone any phone number @return the same {@link AboutBuilder} instance */ public AboutBuilder addWhatsAppDirectChat(@StringRes int phone) { return addWhatsAppDirectChat(context.getString(phone)); }", "tokens": 52} {"id": 321800, "source": "method", "repo": "jscep/jscep", "text": "/** Creates a new instance of this class from the given sequence. @param seq the sequence. */ public IssuerAndSubject(final ASN1Sequence seq) { issuer = X500Name.getInstance(seq.getObjectAt(0)); subject = X500Name.getInstance(seq.getObjectAt(1)); }", "tokens": 69} {"id": 322196, "source": "method", "repo": "jscep/jscep", "text": "public void testMissingOperation() throws Exception { Map expectedResponseHeaders = new HashMap(); expectedResponseHeaders.put(\"Cache-Control\", \"must-revalidate,no-cache,no-store\"); expectedResponseHeaders.put(\"Content-Type\", \"text/html;charset=iso-8859-1\"); String response = verifyResponse(getURL(), 400, expectedResponseHeaders); // assertThat(response, containsString(errorMessage)); assertThat(response, containsString(\"Jetty\")); }", "tokens": 107} {"id": 322230, "source": "method", "repo": "jscep/jscep", "text": "protected Transport getTransport(URL url) { return new UrlConnectionPostTransport(url); }", "tokens": 21} {"id": 322271, "source": "method", "repo": "jscep/jscep", "text": "public void testUpdateNotSupported() { Capabilities caps = new Capabilities(); Assert.assertFalse(caps.isUpdateSupported()); }", "tokens": 26} {"id": 322581, "source": "method", "repo": "jsondb/jsondb-core", "text": "/** test to find a document with a existing id. */ public void testFindById_ForExistingId() { Instance instance = jsonDBTemplate.findById(\"01\", Instance.class); assertNotNull(instance); assertEquals(instance.getId(), \"01\"); }", "tokens": 52} {"id": 322592, "source": "method", "repo": "jsondb/jsondb-core", "text": "/** test to find a single document from the complete collection. */ public void testFindOne_Document() { String jxQuery = \".\"; //XPATH for all elements in a collection Instance instance = jsonDBTemplate.findOne(jxQuery, Instance.class); assertNotNull(instance); }", "tokens": 55} {"id": 322675, "source": "method", "repo": "jsondb/jsondb-core", "text": "/** Test to remove a object from a non-existent collection */ public void testRemoveBatch_FromNonExistingCollection() { expectedException.expect(InvalidJsonDbApiUsageException.class); expectedException.expectMessage(\"Collection by name 'sites' not found. Create collection first\"); Site s = new Site(); s.setId(\"000012\"); List ss = new ArrayList(); ss.add(s); jsonDBTemplate.remove(ss, \"sites\"); }", "tokens": 105} {"id": 322747, "source": "method", "repo": "jsondb/jsondb-core", "text": "public boolean add(E o) { super.add(o); while (size() > limit) { super.remove(); } return true; }", "tokens": 32} {"id": 322929, "source": "method", "repo": "jsorrell/carpetskyadditions", "text": "public void carpetSkyAdditions$makeStandaloneCamel() { brain = makeBrain(getBlankBrainDynamic()); }", "tokens": 24} {"id": 322940, "source": "method", "repo": "jsorrell/carpetskyadditions", "text": "private Dolphin asDolphin() { if ((WaterAnimal) this instanceof Dolphin dolphin) { return dolphin; } else { throw new AssertionError(\"Not dolphin\"); } }", "tokens": 46} {"id": 323268, "source": "method", "repo": "jtang613/GhidrAssist", "text": "public void addMessage(PersistedChatMessage message) { lock.writeLock().lock(); try { messages.add(message); cachedConversation = null; // Invalidate cache } finally { lock.writeLock().unlock(); } }", "tokens": 45} {"id": 323342, "source": "method", "repo": "jtang613/GhidrAssist", "text": "/** Get context status without modification. @param conversationHistory Current conversation messages @param tools Tool definitions (for token estimation) @return Context status */ public CompletableFuture getStatus( List conversationHistory, List> tools ) { return CompletableFuture.supplyAsync(() -> { // Count tokens in conversation int conversationTokens = tokenCounter.countTokens(conversationHistory); // Estimate tokens for tools (if present) int toolTokens = 0; if (tools != null && !tools.isEmpty()) { toolTokens = tokenCounter.estimateTokensForTools(tools); } // Total tokens int totalTokens = conversationTokens + toolTokens; // Check if compression needed boolean needsCompression = totalTokens > config.getCompressionThresholdTokens(); if (needsCompression) { return ContextStatus.needsCompression( totalTokens, config.getMaxContextTokens(), config.getCompressionThresholdTokens(), conversationHistory.size() ); } else { return ContextStatus.withinLimits( totalTokens, config.getMaxContextTokens(), config.getCompressionThresholdTokens(), conversationHistory.size() ); } }); }", "tokens": 239} {"id": 323352, "source": "method", "repo": "jtang613/GhidrAssist", "text": "private static void executeAutoCreateStruct(JsonObject arguments, Program program, Address address) throws Exception { String varName = arguments.get(\"var_name\").getAsString().strip(); Function function = getFunctionAtAddress(program, address); DecompInterface decompiler = new DecompInterface(); try { setupDecompiler(decompiler, program); DecompileResults results = decompiler.decompileFunction(function, 30, TaskMonitor.DUMMY); if (!results.decompileCompleted()) { throw new Exception(\"Decompilation failed for function: \" + function.getName()); } HighFunction highFunction = results.getHighFunction(); HighVariable highVar = findHighVariable(highFunction, varName); if (highVar == null) { throw new InvalidInputException(\"Variable not found: \" + varName); } createAndApplyStructure(program, function, highVar, decompiler); } finally { decompiler.dispose(); } }", "tokens": 193} {"id": 323505, "source": "method", "repo": "jtang613/GhidrAssist", "text": "public LabeledEdge(EdgeType type) { this.type = type; }", "tokens": 18} {"id": 323611, "source": "method", "repo": "jtang613/GhidrAssist", "text": "public void setSummary(String summary) { this.summary = summary; }", "tokens": 17} {"id": 323746, "source": "method", "repo": "jtang613/GhidrAssist", "text": "public String getDecompiledCode() { return decompiledCode; }", "tokens": 14} {"id": 323799, "source": "method", "repo": "jtang613/GhidrAssist", "text": "public void setContext(Program program) { this.currentProgram = program; for (ToolProvider provider : nativeProviders) { provider.setContext(program); } // Also propagate address context to providers that need it if (currentAddress != null) { ghidraToolProvider.setAddress(currentAddress); actionToolProvider.setAddress(currentAddress); } Msg.debug(this, \"Updated program context for \" + nativeProviders.size() + \" native providers\"); }", "tokens": 97} {"id": 323827, "source": "method", "repo": "jtang613/GhidrAssist", "text": "public boolean isCellEditable(int row, int column) { return column == 2; // Only enabled column is editable }", "tokens": 27} {"id": 324137, "source": "method", "repo": "juanjuandog/FinSight-AI", "text": "public String markdown(String symbol, String reportId) { StockAnalysisReport report = reportDiffService.requireReport(normalizeSymbol(symbol), reportId); ExportContext context = context(report); return markdownExporter.export(context.report(), context.company(), context.metrics(), context.risks()); }", "tokens": 65} {"id": 324237, "source": "method", "repo": "juanjuandog/FinSight-AI", "text": "public List findByCompanySymbol(String companySymbol) { return documents.values().stream() .filter(document -> document.companySymbol().equals(companySymbol)) .sorted(Comparator.comparing(FinancialDocument::publishedAt).reversed()) .toList(); }", "tokens": 60} {"id": 324283, "source": "method", "repo": "juanjuandog/FinSight-AI", "text": "public List findAll() { return new ArrayList<>(tasks.values()); }", "tokens": 19} {"id": 324337, "source": "method", "repo": "juanjuandog/FinSight-AI", "text": "public Optional findLatest(String companySymbol) { return jdbcTemplate.query(\"\"\" SELECT id, company_symbol, rating, summary, positive_points::text, risk_points::text, confidence, citations::text, model, source, ai_generated, context_hash, data_snapshot_hash, report_version, generated_at FROM stock_analysis_reports WHERE company_symbol = ? ORDER BY generated_at DESC LIMIT 1 \"\"\", this::mapReport, companySymbol).stream().findFirst(); }", "tokens": 115} {"id": 324467, "source": "method", "repo": "juanjuandog/FinSight-AI", "text": "public Binding retryBinding( Queue workflowRetryQueue, DirectExchange workflowExchange, RabbitWorkflowProperties properties ) { return BindingBuilder.bind(workflowRetryQueue) .to(workflowExchange) .with(properties.retryRoutingKey()); }", "tokens": 52} {"id": 324545, "source": "method", "repo": "juanjuandog/FinSight-AI", "text": "private void assertReconstructs( List> edits, List before, List after ) { List reconstructedBefore = new ArrayList<>(); List reconstructedAfter = new ArrayList<>(); edits.forEach(edit -> { if (edit.operation() != MyersDiff.Operation.INSERT) { reconstructedBefore.add(edit.value()); } if (edit.operation() != MyersDiff.Operation.DELETE) { reconstructedAfter.add(edit.value()); } }); assertThat(reconstructedBefore).isEqualTo(before); assertThat(reconstructedAfter).isEqualTo(after); }", "tokens": 142} {"id": 324751, "source": "method", "repo": "juliand665/dynamic-fps", "text": "public void setCondition(IdleCondition value) { this.condition = value; }", "tokens": 18} {"id": 324805, "source": "method", "repo": "juliand665/dynamic-fps", "text": "public WindowObserver(long address) { long flags = SDLVideo.SDL_GetWindowFlags(address); this.isFocused = (flags & SDLVideo.SDL_WINDOW_INPUT_FOCUS) != 0; this.isHovered = (flags & SDLVideo.SDL_WINDOW_MOUSE_FOCUS) != 0; this.isIconified = (flags & SDLVideo.SDL_WINDOW_MINIMIZED) != 0 || (flags & SDLVideo.SDL_WINDOW_OCCLUDED) != 0; }", "tokens": 111} {"id": 325202, "source": "method", "repo": "juliarn/npc-lib", "text": "public PlatformLogger logger() { return this.logger; }", "tokens": 13} {"id": 325216, "source": "method", "repo": "juliarn/npc-lib", "text": "public Platform.Builder npcTracker(@NotNull NpcTracker npcTracker) { this.npcTracker = Objects.requireNonNull(npcTracker, \"npcTracker\"); return this; }", "tokens": 53} {"id": 325221, "source": "method", "repo": "juliarn/npc-lib", "text": "public Platform.Builder packetFactory(@NotNull PlatformPacketAdapter packetFactory) { this.packetAdapter = Objects.requireNonNull(packetFactory, \"packetFactory\"); return this; }", "tokens": 54} {"id": 325336, "source": "method", "repo": "juliarn/npc-lib", "text": "public String extractWorldIdentifier(@NotNull Instance world) { return world.getUuid().toString(); }", "tokens": 20} {"id": 325382, "source": "method", "repo": "junjunguo/pocketmaps", "text": "protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_download); final ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { // return up one level getSupportActionBar().setDisplayHomeAsUpEnabled(true); } // set status bar new SetStatusBarColor().setStatusBarColor(findViewById(R.id.statusBarBackgroundDownload), getResources().getColor(R.color.my_primary_dark), this); List cloudMaps = Variable.getVariable().getCloudMaps(); try { String dlFiles[] = Variable.getVariable().getDownloadsFolder().list(); if (cloudMaps == null || cloudMaps.isEmpty() || isCloudMapsUpdateOld()) { cloudMaps = null; } if (cloudMaps!=null && dlFiles.length==0) { log(\"Skip downloading existing cloud-map-list\"); Collections.sort(cloudMaps); activateRecyclerView(filterDeprecatedMaps(cloudMaps)); } else { listDownloadPB = (ProgressBar) findViewById(R.id.my_maps_download_load_list_pb); listDownloadTV = (TextView) findViewById(R.id.my_maps_download_load_list_tv); listDownloadTV.bringToFront(); listDownloadPB.setProgress(0); listDownloadPB.setMax(100); listDownloadPB.setIndeterminate(false); listDownloadPB.setVisibility(View.VISIBLE); listDownloadPB.bringToFront(); activateRecyclerView(new ArrayList()); downloadList(this, cloudMaps, dlFiles); } } catch (Exception e) {e.printStackTrace();} }", "tokens": 354} {"id": 325391, "source": "method", "repo": "junjunguo/pocketmaps", "text": "/** list of countries are ready @param myMaps MyMap */ private void listReady(List myMaps) { if (myMaps.isEmpty()) { logUser(\"No connection to server!\"); } else { Variable.getVariable().updateCloudMaps(myMaps); cloudMapsTime = System.currentTimeMillis(); myDownloadAdapter.clearList(); myDownloadAdapter.addAll(filterDeprecatedMaps(myMaps)); } }", "tokens": 90} {"id": 325500, "source": "method", "repo": "junjunguo/pocketmaps", "text": "void setQuickButtonsClearVisible(boolean isStartP, boolean vis) { int curVis = View.VISIBLE; if (isStartP) { if (!vis) { curVis = View.INVISIBLE; } activity.findViewById(R.id.nav_settings_from_del_btn).setVisibility(curVis); if (vis) { curVis = View.INVISIBLE; } else { curVis = View.VISIBLE; } activity.findViewById(R.id.nav_settings_from_search_btn).setVisibility(curVis); activity.findViewById(R.id.nav_settings_from_fav_btn).setVisibility(curVis); activity.findViewById(R.id.nav_settings_from_cur_btn).setVisibility(curVis); } else { if (!vis) { curVis = View.INVISIBLE; } activity.findViewById(R.id.nav_settings_to_del_btn).setVisibility(curVis); if (vis) { curVis = View.INVISIBLE; } else { curVis = View.VISIBLE; } activity.findViewById(R.id.nav_settings_to_search_btn).setVisibility(curVis); activity.findViewById(R.id.nav_settings_to_fav_btn).setVisibility(curVis); activity.findViewById(R.id.nav_settings_to_sel_btn).setVisibility(curVis); } }", "tokens": 321} {"id": 325596, "source": "method", "repo": "junjunguo/pocketmaps", "text": "public boolean isReceiving() { return service.getState() == BluetoothService.STATE_LISTEN; }", "tokens": 21} {"id": 325622, "source": "method", "repo": "junjunguo/pocketmaps", "text": "/** Check if file is complete downloaded or DL error, or in progress. */ public static void checkMap(Activity activity, MyMap tmpMap, StatusUpdate stUpdate) { File idFile = MyMap.getMapFile(tmpMap, MyMap.MapFileType.DlIdFile); if (!idFile.exists()) { // File complete downloaded stUpdate.logUserThread(\"Unzipping: \" + tmpMap.getMapName()); unzipBg(activity, tmpMap, stUpdate); return; } String idFileContent = IO.readFromFile(idFile, \"\\n\"); if (idFileContent.startsWith(\"\" + MyMap.DlStatus.Error + \": \")) { // Error stUpdate.logUserThread(idFileContent); DownloadMapActivity.clearDlFile(tmpMap); } else if (!idFileContent.replace(\"\\n\", \"\").isEmpty()) { // Maybe in progress int id = Integer.parseInt(idFileContent.replace(\"\\n\", \"\")); broadcastReceiverCheck(activity, tmpMap, stUpdate, id); } }", "tokens": 220} {"id": 325637, "source": "method", "repo": "junjunguo/pocketmaps", "text": "public ProgressPublisher(Context c) { this.c = c; this.id = (int)(Math.random() * 100000.0); }", "tokens": 39} {"id": 325695, "source": "method", "repo": "junjunguo/pocketmaps", "text": "public MyMapAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.my_maps_item, parent, false); ViewHolder vh = new ViewHolder(v, onClickMapListener, isDownloadingView); return vh; }", "tokens": 69} {"id": 325733, "source": "method", "repo": "junjunguo/pocketmaps", "text": "private Address clearAddress(Address curAddress) { if (curAddress.getAddressLine(ADDR_TYPE_COUNTRY) == null) { // Clear this curAddress for reuse! curAddress.clearLatitude(); curAddress.clearLongitude(); for (int i=10; i>0; i--) { curAddress.setAddressLine(i, null); } curAddress.setAddressLine(ADDR_TYPE_COUNTRY, null); } else { curAddress = new Address(locale); } return curAddress; }", "tokens": 106} {"id": 325987, "source": "method", "repo": "junjunguo/pocketmaps", "text": "public boolean isSupported() { return isSupported; }", "tokens": 12} {"id": 325988, "source": "method", "repo": "junjunguo/pocketmaps", "text": "public void cleanup(Activity activity) { setLight(Brightness.USER); SensorManager mySensorManager = (SensorManager)activity.getSystemService(android.app.Service.SENSOR_SERVICE); Sensor lightSensor = mySensorManager.getDefaultSensor(Sensor.TYPE_LIGHT); if(lightSensor != null) { mySensorManager.unregisterListener(this, lightSensor); } affectedWin = null; }", "tokens": 86} {"id": 326025, "source": "method", "repo": "junjunguo/pocketmaps", "text": "public String getMapUrlJSON() { return mapUrlJSON; }", "tokens": 15} {"id": 326046, "source": "method", "repo": "junjunguo/pocketmaps", "text": "public String getRoutingAlgorithms() { return routingAlgorithms; }", "tokens": 13} {"id": 326292, "source": "method", "repo": "justauth/justauth", "text": "public String refresh() { return \"https://openapi.waimai.meituan.com/oauth/refresh_token\"; }", "tokens": 30} {"id": 326461, "source": "method", "repo": "justauth/justauth", "text": "public AuthUser getUserInfo(AuthToken authToken) { String accessToken = authToken.getAccessToken(); String response = new HttpUtils(config.getHttpConfig()).get(source.userInfo(), null, new HttpHeader() .add(\"Content-Type\", \"application/json\") .add(\"Authorization\", \"Bearer \" + accessToken), false).getBody(); JSONObject object = JSON.parseObject(response); this.checkResponse(object); JSONObject data = object.getJSONObject(\"data\"); return AuthUser.builder() .rawUserInfo(object) .uuid(data.getString(\"union_id\")) .username(data.getString(\"name\")) .nickname(data.getString(\"name\")) .avatar(data.getString(\"avatar_url\")) .email(data.getString(\"email\")) .gender(AuthUserGender.UNKNOWN) .token(authToken) .source(source.toString()) .build(); }", "tokens": 193} {"id": 326487, "source": "method", "repo": "justauth/justauth", "text": "public AuthHuaweiRequest(AuthConfig config) { super(config, AuthDefaultSource.HUAWEI); }", "tokens": 23} {"id": 326563, "source": "method", "repo": "justauth/justauth", "text": "public AuthSlackRequest(AuthConfig config, AuthStateCache authStateCache) { super(config, AuthDefaultSource.SLACK, authStateCache); }", "tokens": 28} {"id": 326591, "source": "method", "repo": "justauth/justauth", "text": "public String authorize(String state) { return UrlBuilder.fromBaseUrl(source.authorize()) .queryParam(\"appid\", config.getClientId()) .queryParam(\"agentid\", config.getAgentId()) .queryParam(\"redirect_uri\", config.getRedirectUri()) .queryParam(\"state\", getRealState(state)) .queryParam(\"lang\", config.getLang()) .build(); }", "tokens": 83} {"id": 326834, "source": "method", "repo": "jvondermarck/dinosaur-exploder", "text": "public HealthbarComponent getHealthBar() { return healthBar; }", "tokens": 16} {"id": 326892, "source": "method", "repo": "jvondermarck/dinosaur-exploder", "text": "public int getBossesToDefeat() { return levelGoals.bossesToDefeat(); }", "tokens": 23} {"id": 326977, "source": "method", "repo": "jvondermarck/dinosaur-exploder", "text": "public void register() { onCollisionBegin( EntityType.PROJECTILE, EntityType.ORANGE_DINO, (projectile, orangeDino) -> { spawn(\"explosion\", orangeDino.getX() - 25, orangeDino.getY() - 30); projectile.removeFromWorld(); AudioManager.getInstance().playSound(GameConstants.ENEMY_EXPLODE_SOUND); collisionHandler.handleHitBoss(orangeDino.getComponent(OrangeDinoComponent.class)); if (orangeDino.getComponent(OrangeDinoComponent.class).getLives() == 0) { // if the boss is defeated it drops 100% a heart spawn(\"heart\", orangeDino.getX(), orangeDino.getY()); // if the boss dino is defeated it drops twice as many coins as the current level for (int i = 0; i < levelManager.getCurrentLevel() * 2; i++) { spawn( \"coin\", orangeDino.getX() + random(-25, 25), orangeDino.getY() + random(-25, 25)); } bossSpawner.removeBossEntity(orangeDino); if (collisionHandler.isLevelUpAfterBossDefeat( score.getComponent(ScoreComponent.class), levelProgressBar.getComponent(LevelProgressBarComponent.class))) { gameActions.showLevelMessage(); logger.info(\"Level up!\"); } } else { orangeDino.getComponent(OrangeDinoComponent.class).getHealthBar().updateBar(); } }); }", "tokens": 334} {"id": 327145, "source": "method", "repo": "jvondermarck/dinosaur-exploder", "text": "public static void showConfirmationDialog( String title, Boolean isQuestion, Runnable onYes, Runnable onNo) { LanguageManager lm = LanguageManager.getInstance(); Button yesButton = getUIFactoryService().newButton(lm.getTranslation(\"yes\")); yesButton.setPrefWidth(200); yesButton.setOnAction(e -> onYes.run()); Button noButton = getUIFactoryService().newButton(lm.getTranslation(\"no\")); noButton.setPrefWidth(200); noButton.setOnAction(e -> onNo.run()); String newTitle = Boolean.TRUE.equals(isQuestion) ? title + \"?\" : title; getDialogService().showBox(newTitle, new VBox(), yesButton, noButton); }", "tokens": 149} {"id": 327279, "source": "method", "repo": "jvondermarck/dinosaur-exploder", "text": "public SoundMenu() { super(MenuType.GAME_MENU); MenuHelper.setupSelectionMenu( this, createHeaderZone(), createOptionsZone(), createBackButton(), SPACE_ZONE, getAppWidth(), getAppHeight()); }", "tokens": 48} {"id": 327417, "source": "method", "repo": "jwdeveloper/TikTokLiveJava", "text": "public TikTokCaptionEvent(WebcastCaptionMessage msg) { super(msg.getCommon()); captionTimeStamp = msg.getTimestampMs(); contents = new ArrayList<>(); for (WebcastCaptionMessage.CaptionContent captionContent : msg.getContentList()) contents.add(new CaptionContent(captionContent)); }", "tokens": 61} {"id": 327447, "source": "method", "repo": "jwdeveloper/TikTokLiveJava", "text": "public static TikTokLiveEndedEvent of() { return new TikTokLiveEndedEvent(); }", "tokens": 16} {"id": 327508, "source": "method", "repo": "jwdeveloper/TikTokLiveJava", "text": "public static TikTokFollowEvent of(User user) { return new TikTokFollowEvent(WebcastSocialMessage.newBuilder() .setUser(io.github.jwdeveloper.tiktok.api.messages.data.User.newBuilder() .setUsername(user.getName()) .setNickname(user.getProfileName() != null ? user.getProfileName() : user.getName()) .setId(user.getId()) .build()) .build()); }", "tokens": 96} {"id": 327882, "source": "method", "repo": "jwdeveloper/TikTokLiveJava", "text": "public HttpClient(HttpClientSettings httpClientSettings, String url, HttpRequest.BodyPublisher bodyPublisher) { this(httpClientSettings, url, bodyPublisher, HttpClientFactory.forSettings(httpClientSettings)); }", "tokens": 39} {"id": 327973, "source": "method", "repo": "jwdeveloper/TikTokLiveJava", "text": "public List handleGift(WebcastGiftMessage currentMessage) { var now = clock.getAsLong(); var events = new ArrayList<>(flushTimedOutCombos(now)); //If gift is not streakable just return onGift event if (currentMessage.getGift().getType() != 1) { events.add(getGiftComboEvent(currentMessage, GiftComboStateType.Finished)); events.add(getGiftEvent(currentMessage)); return events; } var key = comboKey(currentMessage); var currentType = GiftComboStateType.fromNumber(currentMessage.getSendType()); if (currentType == GiftComboStateType.Active) { var previous = activeCombos.put(key, new ComboState(currentMessage, now)); events.add(getGiftComboEvent(currentMessage, previous == null ? GiftComboStateType.Begin : GiftComboStateType.Active)); return events; } //TikTok may repeat the finishing frame of a streak under a fresh msgId. Without this guard //every repeat raises another onGift and the gift gets counted twice. var finalizedUntil = finalizedCombos.get(key); if (finalizedUntil != null && finalizedUntil > now) return events; var previous = activeCombos.remove(key); finalizedCombos.put(key, now + FINALIZED_RETENTION_MS); if (previous != null) events.add(getGiftComboEvent(currentMessage, GiftComboStateType.Finished)); events.add(getGiftEvent(currentMessage)); return events; }", "tokens": 338} {"id": 328195, "source": "method", "repo": "jzvd/jzvideo", "text": "public void onStatePause() { super.onStatePause(); if (danmakuView.isPrepared()) { danmakuView.pause(); } }", "tokens": 36} {"id": 328261, "source": "method", "repo": "jzvd/jzvideo", "text": "public void onClick(View v) { if (isAtList) bottomContainer.setVisibility(GONE); if (v.getId() == cn.jzvd.R.id.surface_container && (state == STATE_PLAYING || state == STATE_PAUSE)) { if (clickUi != null) clickUi.onClickUiToggle(); } super.onClick(v); }", "tokens": 77} {"id": 328396, "source": "method", "repo": "jzvd/jzvideo", "text": "public void onSeekComplete(MediaPlayer mediaPlayer) { handler.post(() -> jzvd.onSeekComplete()); }", "tokens": 26} {"id": 328576, "source": "method", "repo": "jzvd/jzvideo", "text": "public int getItemCount() { return videoIndexs.length; }", "tokens": 15} {"id": 328680, "source": "method", "repo": "jzvd/jzvideo", "text": "public void run() { ViewGroup.LayoutParams params = mFlingView.getLayoutParams(); int height = params.height; if (overScroller.computeScrollOffset() && height >= minHeight && height <= childHeight) { int newHeight = Math.min(overScroller.getCurrY(), childHeight); if (newHeight != height) { if (newHeight < minHeight) newHeight = minHeight; params.height = newHeight; mFlingView.setLayoutParams(params); } ViewCompat.postOnAnimation(mFlingView, this); } else { mFlingView.removeCallbacks(this); } }", "tokens": 132} {"id": 328707, "source": "method", "repo": "jzvd/jzvideo", "text": "public JZMediaInterface(Jzvd jzvd) { this.jzvd = jzvd; }", "tokens": 20} {"id": 328889, "source": "method", "repo": "jzyong/game-server", "text": "public void setBoomStartTime(long boomStartTime) { this.boomStartTime = boomStartTime; }", "tokens": 24} {"id": 328987, "source": "method", "repo": "jzyong/game-server", "text": "static public float log(float a, float value) { return (float) (Math.log(value) / Math.log(a)); }", "tokens": 32} {"id": 329010, "source": "method", "repo": "jzyong/game-server", "text": "/** Linearly interpolates between this matrix and the given matrix mixing by alpha @param matrix the matrix @param alpha the alpha value in the range [0,1] @return This matrix for the purpose of chaining methods together. */ public Matrix4 lerp(Matrix4 matrix, float alpha) { for (int i = 0; i < 16; i++) this.val[i] = this.val[i] * (1 - alpha) + matrix.val[i] * alpha; return this; }", "tokens": 112} {"id": 329087, "source": "method", "repo": "jzyong/game-server", "text": "/** Left-multiplies the vector by the given matrix, assuming the fourth (w) component of the vector is 1. @param matrix The matrix @return This vector for chaining */ public Vector3 mul(final Matrix4 matrix) { final float l_mat[] = matrix.val; return this.set(x * l_mat[Matrix4.M00] + y * l_mat[Matrix4.M01] + z * l_mat[Matrix4.M02] + l_mat[Matrix4.M03], x * l_mat[Matrix4.M10] + y * l_mat[Matrix4.M11] + z * l_mat[Matrix4.M12] + l_mat[Matrix4.M13], x * l_mat[Matrix4.M20] + y * l_mat[Matrix4.M21] + z * l_mat[Matrix4.M22] + l_mat[Matrix4.M23]); }", "tokens": 228} {"id": 329120, "source": "method", "repo": "jzyong/game-server", "text": "/**

Setter for the field maxScheduledWriteMessages.

@param maxScheduledWriteMessages a int. */ public void setMaxScheduledWriteMessages(int maxScheduledWriteMessages) { this.maxScheduledWriteMessages = maxScheduledWriteMessages < 256 ? 256 : maxScheduledWriteMessages; }", "tokens": 71} {"id": 329350, "source": "method", "repo": "jzyong/game-server", "text": "public static void setSslEnabled(boolean newSslEnabled) { sslEnabled = newSslEnabled; }", "tokens": 22} {"id": 329364, "source": "method", "repo": "jzyong/game-server", "text": "public void run() { QuitSubGameRequest request = getMsg(); }", "tokens": 17} {"id": 329690, "source": "method", "repo": "kafka-ops/julie", "text": "public List lookupKafkaPrincipalsByRoleForKafka(String role) { Map> clusters = clusterIDs.forKafka().asMap(); return lookupKafkaPrincipalsByRole(role, clusters); }", "tokens": 50} {"id": 329867, "source": "method", "repo": "kafka-ops/julie", "text": "public void setConfigs_topic(Optional configs_topic) { this.configs_topic = configs_topic; }", "tokens": 29} {"id": 330249, "source": "method", "repo": "kafka-ops/julie", "text": "public void testMDSLogin() throws IOException { apiClient.setBasicAuth(new BasicAuth(mdsUser, mdsPassword)); apiClient.authenticate(); AuthenticationCredentials credentials = apiClient.getCredentials(); assertFalse(credentials.getAuthToken().isEmpty()); }", "tokens": 50} {"id": 330285, "source": "method", "repo": "kafka-ops/julie", "text": "public void testTopicCreation() throws ExecutionException, InterruptedException, IOException { Topology topology = new TopologyImpl(); topology.setContext(\"testTopicCreation\"); Project project = new ProjectImpl(\"project\"); topology.addProject(project); HashMap config = new HashMap<>(); config.put(TopicManager.NUM_PARTITIONS, \"1\"); config.put(TopicManager.REPLICATION_FACTOR, \"1\"); Topic topicA = new Topic(\"topicA\", config); project.addTopic(topicA); config = new HashMap<>(); config.put(TopicManager.NUM_PARTITIONS, \"1\"); config.put(TopicManager.REPLICATION_FACTOR, \"1\"); Topic topicB = new Topic(\"topicB\", config); project.addTopic(topicB); topicManager.updatePlan(topology, plan); plan.run(); verifyTopics(Arrays.asList(topicA.toString(), topicB.toString())); }", "tokens": 194} {"id": 330364, "source": "method", "repo": "kafka-ops/julie", "text": "public void shouldVerifyDifferentValuesWhenUsingLte() throws ValidationException, ConfigurationException { Map config = new HashMap<>(); config.put(\"replication.factor\", \"34\"); config.put(\"num.partitions\", \"123\"); Topic topic = new Topic(\"topic\", config); ReplicationFactorValidation validation = new ReplicationFactorValidation((short) 15, \"lte\"); validation.valid(topic); }", "tokens": 96} {"id": 330383, "source": "method", "repo": "kagof/intellij-pokemon-progress", "text": "private static Paint getTransparencyPaint(final Color backgroundColor, final int width, final boolean movingRight) { final JBColor transparent = new JBColor(new Color(0, 0, 0, 0), new Color(0, 0, 0, 0)); return new LinearGradientPaint(0, JBUIScale.scale(2f), width, JBUIScale.scale(2f), new float[]{0, 1}, new Color[]{movingRight ? backgroundColor : transparent, movingRight ? transparent : backgroundColor}); }", "tokens": 116} {"id": 330535, "source": "method", "repo": "kalaspuffar/secure-quick-reliable-login", "text": "public void testIdentitySettingsActivityAccessibility() throws Exception { Context targetContext = InstrumentationRegistry.getInstrumentation() .getTargetContext(); Intent intent = new Intent(targetContext, IdentitySettingsActivity.class); IdentitySettingsActivity a = identitySettingsActivityRule.launchActivity(intent); unlockScreen(a); onView(withId(R.id.identitySettingsActivityView)).perform(click()); }", "tokens": 80} {"id": 330575, "source": "method", "repo": "kalaspuffar/secure-quick-reliable-login", "text": "private static int multiply(int x, int y) { if (x >>> 8 != 0 || y >>> 8 != 0) throw new IllegalArgumentException(\"Byte out of range\"); // Russian peasant multiplication int z = 0; for (int i = 7; i >= 0; i--) { z = (z << 1) ^ ((z >>> 7) * 0x11D); z ^= ((y >>> i) & 1) * x; } if (z >>> 8 != 0) throw new AssertionError(); return z; }", "tokens": 129} {"id": 330683, "source": "method", "repo": "kalaspuffar/secure-quick-reliable-login", "text": "public void surfaceDestroyed(SurfaceHolder holder) { holder.removeCallback(this); }", "tokens": 19} {"id": 330732, "source": "method", "repo": "kalaspuffar/secure-quick-reliable-login", "text": "public void deleteIdentity(long id) { this.getWritableDatabase().delete( IdentityEntry.TABLE_NAME, IdentityEntry._ID + \" = \" + id, null ); }", "tokens": 41} {"id": 330752, "source": "method", "repo": "kalaspuffar/secure-quick-reliable-login", "text": "private void sendDummyGifImage(Socket socket) { try { byte[] content = EncryptionUtils.decodeUrlSafe( \"R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" ); OutputStream os = socket.getOutputStream(); StringBuilder out = new StringBuilder(); out.append(\"HTTP/1.0 200 OK\\r\\n\"); out.append(\"Content-Type: image/gif\\r\\n\"); out.append(\"Content-Length: \").append(content.length).append(\"\\r\\n\\r\\n\"); Log.i(TAG, out.toString()); os.write(out.toString().getBytes(\"UTF-8\")); os.write(content); os.flush(); os.close(); } catch (Exception e) { e.printStackTrace(); } }", "tokens": 182} {"id": 331028, "source": "method", "repo": "karatelabs/karate", "text": "/** Create a builder for a mock server from a feature string. @deprecated Use {@link io.karatelabs.core.MockServer#featureString(String)} instead. */ public static Builder featureString(String featureContent) { return new Builder().featureString(featureContent); }", "tokens": 58} {"id": 331033, "source": "method", "repo": "karatelabs/karate", "text": "private String resolveOutputDir() { if (outputDir != null) { return outputDir; } if (pom != null) { String pomOutputDir = pom.getOutput().getDir(); if (pomOutputDir != null && !pomOutputDir.isEmpty()) { return pomOutputDir; } } // Default: detect build tool (Gradle uses \"build\", Maven uses \"target\") return FileUtils.getBuildDir() + \"/karate-reports\"; }", "tokens": 86} {"id": 331066, "source": "method", "repo": "karatelabs/karate", "text": "/** karate.configure() - Apply configuration from JavaScript. */ JavaInvokable configure() { return args -> { if (args.length < 2) { throw new RuntimeException(\"configure() needs two arguments: key and value\"); } String key = args[0].toString(); Object value = args[1]; ScenarioRuntime rt = getRuntime(); if (rt != null) { rt.configure(key, value); } return null; }; }", "tokens": 94} {"id": 331112, "source": "method", "repo": "karatelabs/karate", "text": "private void runParallel() { // Initialize ALL parallel infrastructure BEFORE creating executor availableLanes = new ConcurrentLinkedQueue<>(); for (int i = 1; i <= threadCount; i++) { availableLanes.add(i); } scenarioSemaphore = new Semaphore(threadCount); logger.info(\"Parallel execution initialized: threadCount={}, semaphore permits={}\", threadCount, scenarioSemaphore.availablePermits()); try (ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor()) { scenarioExecutor = executor; List> futures = new ArrayList<>(); for (Feature feature : features) { if (isAborted() || isFeatureIgnored(feature)) { continue; } Future future = executor.submit(() -> { initThreadListeners(); try { FeatureResult featureResult = runFeatureSafely(feature); if (outputConsoleSummary) { featureResult.printSummary(dryRun); } return featureResult; } finally { cleanupThreadListeners(); } }); futures.add(future); } // Collect results for (Future future : futures) { try { FeatureResult featureResult = future.get(); result.addFeatureResult(featureResult); } catch (Exception e) { logger.error(\"Unexpected error collecting feature result: {}\", e.getMessage(), e); } } } finally { scenarioExecutor = null; scenarioSemaphore = null; } }", "tokens": 283} {"id": 331118, "source": "method", "repo": "karatelabs/karate", "text": "/** A pure-JS locator is a JS expression that evaluates to an element at runtime \u2014 produced by {@link #closest(String)} and anything else routing through {@link Locators#wrapInFunctionInvoke}. Distinguished from XPath (which starts with {@code (//}) and from wildcard/CSS. */ protected static boolean isPureJsLocator(String locator) { return locator.startsWith(\"(\") && !locator.startsWith(\"(//\"); }", "tokens": 100} {"id": 331240, "source": "method", "repo": "karatelabs/karate", "text": "/** Set global variables that will be available in all templates and API handlers. These variables are injected into the JavaScript engine context. */ public ServerConfig globalVariables(Map globalVariables) { this.globalVariables = globalVariables; return this; }", "tokens": 55} {"id": 331269, "source": "method", "repo": "karatelabs/karate", "text": "private static Match.Type macroToMatchType(boolean each, String macro) { if (macro.startsWith(\"^^\")) { return each ? Match.Type.EACH_CONTAINS_ONLY : Match.Type.CONTAINS_ONLY; } else if (macro.startsWith(\"^+\")) { return each ? Match.Type.EACH_CONTAINS_DEEP : Match.Type.CONTAINS_DEEP; } else if (macro.startsWith(\"^*\")) { return each ? Match.Type.EACH_CONTAINS_ANY : Match.Type.CONTAINS_ANY; } else if (macro.startsWith(\"^\")) { return each ? Match.Type.EACH_CONTAINS : Match.Type.CONTAINS; } else if (macro.startsWith(\"!^\")) { return each ? Match.Type.EACH_NOT_CONTAINS : Match.Type.NOT_CONTAINS; } else if (macro.startsWith(\"!<\")) { return Match.Type.NOT_WITHIN; } else if (macro.startsWith(\"<\")) { return Match.Type.WITHIN; } else if (macro.startsWith(\"!=\")) { return each ? Match.Type.EACH_NOT_EQUALS : Match.Type.NOT_EQUALS; } else { return each ? Match.Type.EACH_EQUALS : Match.Type.EQUALS; } }", "tokens": 273} {"id": 331293, "source": "method", "repo": "karatelabs/karate", "text": "void testBothSerializersAgreeOnArrays() { // there are two JSON writers in play \u2014 this json-smart one (match messages, request // bodies) and StringUtils.formatJson (print, karate.pretty, the callSingle disk cache). // An array rendered as its JVM identity by one and as a JSON array by the other is how // a byte[] came to be written into the disk cache as \"[B@1a2b3c\" Map map = new LinkedHashMap<>(); map.put(\"bytes\", new byte[]{1, -2}); map.put(\"chars\", new char[]{'h', 'i'}); map.put(\"shorts\", new short[]{3, 4}); map.put(\"ints\", new int[]{5, 6}); map.put(\"longs\", new long[]{7L, 8L}); map.put(\"floats\", new float[]{1.5f}); map.put(\"doubles\", new double[]{2.5}); map.put(\"bools\", new boolean[]{true, false}); map.put(\"strings\", new String[]{\"a\", null}); map.put(\"objects\", new Object[]{null, 1, \"two\", List.of(3), new byte[]{9}}); map.put(\"empty\", new int[0]); map.put(\"nested\", new byte[][]{{1}, {2, 3}}); assertEquals(Json.stringifyStrict(map), StringUtils.formatJson(map, false, false, false)); }", "tokens": 322} {"id": 331564, "source": "method", "repo": "karatelabs/karate", "text": "/** Closes the scenario's wrapper, which returns its connections to the pool rather than shutting it: {@code ApacheHttpClient} builds with {@code setConnectionManagerShared(true)} whenever {@code sharedConnectionManager()} is non-null. */ public void release(HttpClient client) { try { client.close(); } catch (Exception e) { // A wrapper that will not close is not worth failing a simulation over; the pool // survives it, and the connection it held is reclaimed when the pool is closed. System.err.println(\"[karate] error closing a pooled client wrapper: \" + e); } }", "tokens": 128} {"id": 331693, "source": "method", "repo": "karatelabs/karate", "text": "private Object get(Context context, Object[] args) { return asMap(context).getValue(args.length > 0 ? args[0] : Terms.UNDEFINED); }", "tokens": 40} {"id": 331716, "source": "method", "repo": "karatelabs/karate", "text": "private Object repeat(Context context, Object[] args) { String s = thisString(context, \"repeat\"); // Spec: ToIntegerOrInfinity, then RangeError if < 0 or +Infinity. // We only carry double precision through argInt; check the original // numeric for the -0 / +Infinity edge before clamping. if (args.length == 0 || args[0] == null || args[0] == Terms.UNDEFINED) return \"\"; double d = Terms.objectToNumber(args[0]).doubleValue(); if (Double.isNaN(d)) return \"\"; if (d < 0 || Double.isInfinite(d)) { throw JsErrorException.rangeError(\"Invalid count value\"); } int count = (int) d; return s.repeat(count); }", "tokens": 172} {"id": 331824, "source": "method", "repo": "karatelabs/karate", "text": "void testExtendsNonConstructorThrows() { assertEquals(\"TypeError\", eval(\"var notCtor = 42;\\n\" + \"try { class B extends notCtor {} } catch (e) { e.name }\")); }", "tokens": 48} {"id": 331826, "source": "method", "repo": "karatelabs/karate", "text": "void testStaticFieldNotOnInstance() { assertEquals(true, eval(\"class C { static n = 1 }\\ntypeof new C().n === 'undefined'\")); }", "tokens": 39} {"id": 331837, "source": "method", "repo": "karatelabs/karate", "text": "void testFunctionDeclarationDestructuring() { assertEquals(5, eval(\"function foo([a, b]) { return a + b }; foo([2, 3])\")); assertEquals(5, eval(\"function foo({ a, b }) { return a + b }; foo({ a: 2, b: 3 })\")); }", "tokens": 78} {"id": 331896, "source": "method", "repo": "karatelabs/karate", "text": "void testSimpleObjectWithJsKeys() { Engine engine = new Engine(); SimpleObject config = new SimpleObject() { @Override public Collection jsKeys() { return List.of(\"host\", \"port\", \"debug\"); } @Override public Object jsGet(String name) { return switch (name) { case \"host\" -> \"localhost\"; case \"port\" -> 8080; case \"debug\" -> true; default -> null; }; } }; engine.put(\"config\", config); // Property access works assertEquals(\"localhost\", engine.eval(\"config.host\")); assertEquals(8080, engine.eval(\"config.port\")); assertEquals(true, engine.eval(\"config.debug\")); // toMap() uses jsKeys() var map = config.toMap(); assertEquals(3, map.size()); assertEquals(\"localhost\", map.get(\"host\")); assertEquals(8080, map.get(\"port\")); assertEquals(true, map.get(\"debug\")); }", "tokens": 209} {"id": 331988, "source": "method", "repo": "karatelabs/karate", "text": "/** The message for scenarios that were generated and never ran.

Pinned because it was briefly impossible to produce: the suite's result is dereferenced before the floor probe, and this branch still read a count off it \u2014 so the one diagnostic that explains this workload's most deceptive failure threw a {@code NullPointerException} instead of printing. It is built from primitives now, and this asserts the numbers reach it. */ void testTheMissingScenarioDiagnosticSurvivesTheDereferencedResult() { String message = SuiteSoakWorkload.missingScenariosMessage(2, 0, 87_500); assertTrue(message.contains(\"suite 2 ran 0 scenarios, not the 87500\"), \"the diagnostic must carry both counts: \" + message); assertTrue(message.contains(\"did not run at all\"), \"and must say they were not executed rather than failed: \" + message); }", "tokens": 200} {"id": 331990, "source": "method", "repo": "kdn251/interviews", "text": "public int majorityElement(int[] nums) { if(nums.length == 1) { return nums[0]; } HashMap map = new HashMap(); for(int current: nums) { if(map.containsKey(current) && map.get(current) + 1 > nums.length / 2) { return current; } else if(map.containsKey(current)) { map.put(current, map.get(current) + 1); } else { map.put(current, 1); } } //no majority element exists return -1; }", "tokens": 131} {"id": 332161, "source": "method", "repo": "kdn251/interviews", "text": "public int maxProduct(int[] nums) { if(nums == null || nums.length == 0) { return 0; } int result = nums[0]; int max = nums[0]; int min = nums[0]; for(int i = 1; i < nums.length; i++) { int temp = max; max = Math.max(Math.max(nums[i] * max, nums[i] * min), nums[i]); min = Math.min(Math.min(nums[i] * temp, nums[i] * min), nums[i]); if(max > result) { result = max; } } return result; }", "tokens": 146} {"id": 332169, "source": "method", "repo": "kdn251/interviews", "text": "public boolean canPermutePalindrome(String s) { char[] characters = new char[256]; for(int i = 0; i < s.length(); i++) { characters[s.charAt(i)]++; } int oddCount = 0; for(int i = 0; i < characters.length; i++) { if(!(characters[i] % 2 == 0)) { oddCount++; if(oddCount > 1) { return false; } } } return true; }", "tokens": 113} {"id": 332171, "source": "method", "repo": "kdn251/interviews", "text": "public int findMissing(ArrayList array) { /* start from the least significant bit, and work our way up */ return findMissing(array, 0); }", "tokens": 37} {"id": 332271, "source": "method", "repo": "kdn251/interviews", "text": "public int maxPathSum(TreeNode root) { maxPathSumRecursive(root); return max; }", "tokens": 22} {"id": 332521, "source": "method", "repo": "kennycason/kumo", "text": "public CollisionRaster(final BufferedImage bufferedImage) { this(new Dimension(bufferedImage.getWidth(), bufferedImage.getHeight())); for (int y = 0; y < dimension.height; y++) { for (int x = 0; x < dimension.width; x++) { final boolean pixelIsTransparent = (bufferedImage.getRGB(x, y) & 0xFF000000) == 0x00000000; if (!pixelIsTransparent) { setPixelIsNotTransparent(x, y); } } } }", "tokens": 119} {"id": 332634, "source": "method", "repo": "kennycason/kumo", "text": "private static InputStream getInputStream(String path) { return Thread.currentThread().getContextClassLoader().getResourceAsStream(path); }", "tokens": 25} {"id": 332737, "source": "method", "repo": "kiooeht/modthespire", "text": "public Set getOutJarClasses() { return outJar; }", "tokens": 18} {"id": 332814, "source": "method", "repo": "kiooeht/modthespire", "text": "public static String makeFilePath(String modName, String fileName) { return makeFilePath(modName, fileName, EXTENSION); }", "tokens": 28} {"id": 332846, "source": "method", "repo": "kiooeht/modthespire", "text": "InsertParamInfo2(CtBehavior toPatch, CtMethod patchMethod, int position) throws PatchingException { super(toPatch, patchMethod, position); }", "tokens": 33} {"id": 333055, "source": "method", "repo": "kiooeht/modthespire", "text": "/** Construct a new OrClassFilter with no contained filters. */ public OrClassFilter() { // Nothing to do }", "tokens": 31} {"id": 333068, "source": "method", "repo": "kiooeht/modthespire", "text": "/** Constructs an exception containing an error message, but no nested exception. @param message the message to associate with this exception */ public CommandLineUserException(String message) { super (message); }", "tokens": 40} {"id": 333113, "source": "method", "repo": "kiooeht/modthespire", "text": "/** Load the configuration from a URL. @param url the URL @param encoding the encoding, if known, or null @throws IOException on I/O error @throws ConfigurationException on configuration error */ public void load(URL url, String encoding) throws IOException, ConfigurationException { clear(); parse(url.openStream(), encoding, url); this.configURL = url; }", "tokens": 77} {"id": 333127, "source": "method", "repo": "kiooeht/modthespire", "text": "/** Constructs an exception containing a resource bundle name, a message key, and a default message (in case the resource bundle can't be found). Using this constructor is equivalent to calling the {@link #ConfigurationException(String,String,String,Object[],Throwable)} constructor, with a null pointer for the Throwable parameter. Calls to {@link NestedException#getMessage(Locale)} will attempt to retrieve the top-most message (i.e., the message from this exception, not from nested exceptions) by querying the named resource bundle. Calls to {@link NestedException#printStackTrace(PrintWriter,Locale)} will do the same, where applicable. The message is not retrieved until one of those methods is called, because the desired locale is passed into getMessage() and printStackTrace(), not this constructor. @param bundleName resource bundle name @param messageKey the key to the message to find in the bundle @param defaultMsg the default message @param msgParams parameters to the message, if any, or null @see #ConfigurationException(String,String,String,Object[]) @see NestedException#getMessage(Locale) */ public ConfigurationException (String bundleName, String messageKey, String defaultMsg, Object[] msgParams) { super (bundleName, messageKey, defaultMsg, msgParams); }", "tokens": 291} {"id": 333130, "source": "method", "repo": "kiooeht/modthespire", "text": "/** Constructs an exception. @param sectionName the section that doesn't have the variable @param variableName the variable name to which the exception pertains */ public NoSuchVariableException (String sectionName, String variableName) { super (Package.BUNDLE_NAME, \"noSuchVariable\", \"Variable \\\"{0}\\\" does not exist in configuration section \" + \"\\\"{1}\\\"\", new Object[] {variableName, sectionName}); this.sectionName = sectionName; this.variableName = variableName; }", "tokens": 103} {"id": 333188, "source": "method", "repo": "kiooeht/modthespire", "text": "/** Print a float. @param f The floating point number to print */ public void print (float f) { Float F = new Float (f); write (F.toString()); }", "tokens": 39} {"id": 333223, "source": "method", "repo": "kiooeht/modthespire", "text": "/** Create a new RollingFileWriter that will write to the specified file, optionally automatically rolling the file over when it exceeds a specified maximum size. @param fileNamePattern The name pattern for the file to open @param charsetName The name of the character encoding to use for the output, or null for the default @param maxRolledFileSize The maximum size, in bytes, that the file can be before it is rolled over, or 0 for no maximum. @param maxRolledOverFiles The maximum number of rolled-over log files to retain, or 0 for no maximum. @param compressionType {@link Compression#COMPRESS_BACKUPS} to compress backups, {@link Compression#DONT_COMPRESS_BACKUPS} to leave backups uncompressed @param callback The callback object to invoke on roll-over, or null for none @throws IOExceptionExt Failed to open file. @see #RollingFileWriter(String) @see #RollingFileWriter(String,Compression) @see #RollingFileWriter(String,String,Compression) @see #RollingFileWriter(String,long,int,Compression) */ public RollingFileWriter (String fileNamePattern, String charsetName, long maxRolledFileSize, int maxRolledOverFiles, Compression compressionType, RolloverCallback callback) throws IOExceptionExt { super (openPrimaryFile (fileNamePattern, charsetName, maxRolledOverFiles, compressionType, callback), true); this.filePattern = fileNamePattern; this.compressionType = compressionType; this.primaryFile = resolveFilePattern (fileNamePattern, null, maxRolledOverFiles, null); this.callback = callback; this.charsetName = charsetName; this.compressionType = compressionType; this.maxRolledFileSize = maxRolledFileSize; this.maxRolledOverFiles = maxRolledOverFiles; }", "tokens": 386} {"id": 333355, "source": "method", "repo": "kiooeht/modthespire", "text": "/**

Add an EventListener that will be called whenever an object is removed from the cache. If automaticOnly is true, then the listener is only notified for objects that are removed automatically when the cache needs to be cleared to make room for new objects. If automaticOnly is false, then the listener is notified whenever an object is removed for any reason, include a call to the {@link #remove remove()} method.

Note that when this map announces the removal of an object, it passes an {@link ObjectRemovalEvent} that contains a java.util.Map.Entry object that wraps the actual object that was removed. That way, both the key and the value are available for the removed object.

@param listener the listener to add @param automaticOnly see above @see #removeRemovalListener */ public synchronized void addRemovalListener (ObjectRemovalListener listener, boolean automaticOnly) { if (removalListeners == null) removalListeners = new ListenerMap(); removalListeners.put (listener, new RemovalListenerWrapper (listener, automaticOnly)); }", "tokens": 258} {"id": 333364, "source": "method", "repo": "kiooeht/modthespire", "text": "/** Get the number of entries in the map. Note that this value can temporarily exceed the maximum capacity of the map. See the class documentation for details. @return the number of entries in the map */ public int size() { return lruQueue.size; }", "tokens": 55} {"id": 333383, "source": "method", "repo": "kiooeht/modthespire", "text": "/** Constructs a new, empty map with a default capacity and load factor. This class's default load factor is the same as the default load factor for the java.util.HashMap class. */ public MultiValueMap() { this.map = new HashMap>(); }", "tokens": 67} {"id": 333388, "source": "method", "repo": "kiooeht/modthespire", "text": "/** Returns true if this map maps one or more keys to the specified value. The values are compared via their compareTo() and/or equals() methods, so this method is only useful if the map contains values of the same type. @param value value whose presence in this map is to be tested. @return true if this map maps one or more keys to the specified value, false otherwise. */ public boolean containsValue(Object value) { boolean found = false; Iterator> it = map.values().iterator(); while ((! found) && it.hasNext()) { Collection values = it.next(); if (values.contains(value)) found = true; } return found; }", "tokens": 178} {"id": 333530, "source": "method", "repo": "kiooeht/modthespire", "text": "/** Remove the characters in a substring of this XStringBuffer. The substring begins at the specified start and extends to the character at index end - 1, or to the end of the string, if no such character exists. If start is equal to end, no changes are made. @param start The beginning index, inclusive @param end The ending index, exclusive @return This object @throws IndexOutOfBoundsException if start is negative, greater than length(), or greater than end */ public XStringBufBase delete (int start, int end) throws IndexOutOfBoundsException { deleteCharacters (start, end); return this; }", "tokens": 179} {"id": 333604, "source": "method", "repo": "kiooeht/stslib", "text": "public MoveCardsAction(CardGroup destination, CardGroup source, Predicate predicate, int amount, Consumer> callback) { p = AbstractDungeon.player; this.destination = destination; this.source = source; this.predicate = predicate; this.callback = callback; setValues(p, AbstractDungeon.player, amount); actionType = AbstractGameAction.ActionType.CARD_MANIPULATION; duration = Settings.ACTION_DUR_MED; }", "tokens": 104} {"id": 333703, "source": "method", "repo": "kiooeht/stslib", "text": "public AbstractCreature getOwner() { return owner; }", "tokens": 12} {"id": 333809, "source": "method", "repo": "kiooeht/stslib", "text": "public int compareTo(AbstractDamageModifier other) { return this.priority - other.priority; }", "tokens": 20} {"id": 333910, "source": "method", "repo": "kiooeht/stslib", "text": "public static void RememberCardPreUseCall(AbstractPlayer __instance, AbstractCard c, AbstractMonster monster, int energyOnUse) { //Right before you call card.use, set it as the object in use cardInUse = c; }", "tokens": 52} {"id": 334324, "source": "method", "repo": "kiooeht/stslib", "text": "public CardVertex getVertexByCard(AbstractCard card) { for (CardVertex v : vertices) { if (v.card == card) { return v; } } return null; }", "tokens": 40} {"id": 334333, "source": "method", "repo": "kiooeht/stslib", "text": "public void clear() { parents.clear(); children.clear(); exclusions.clear(); }", "tokens": 21} {"id": 335121, "source": "method", "repo": "kishanrajput23/java-projects-collections", "text": "public double calculatePrice(int ticketClass, int numberOfTickets) { if (ticketClass == 1) return numberOfTickets * 1500.0; if (ticketClass == 2) return numberOfTickets * 1200.0; if (ticketClass == 3) return numberOfTickets * 1000.0; return 0.0; }", "tokens": 86} {"id": 335220, "source": "method", "repo": "kishanrajput23/java-projects-collections", "text": "public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new replace().setVisible(true); } }); }", "tokens": 39} {"id": 335257, "source": "method", "repo": "kittehorg/kittehircclientlib", "text": "public Tags add(@NonNull String name) { validateTagName(name); this.tags.add(new MessageTagManager.DefaultMessageTag(name, null)); return this; }", "tokens": 39} {"id": 335315, "source": "method", "repo": "kittehorg/kittehircclientlib", "text": "public WhoisCommand whois() { return new WhoisCommand(DefaultClient.this); }", "tokens": 23} {"id": 335385, "source": "method", "repo": "kittehorg/kittehircclientlib", "text": "public Optional getRealName() { return Optional.ofNullable(this.realName); }", "tokens": 22} {"id": 335636, "source": "method", "repo": "kittehorg/kittehircclientlib", "text": "protected ToStringer toStringer() { return super.toStringer().add(\"newUser\", this.newUser).add(\"change\", this.change); }", "tokens": 35} {"id": 335642, "source": "method", "repo": "kittehorg/kittehircclientlib", "text": "protected ToStringer toStringer() { return super.toStringer().add(\"deletedCapabilities\", this.deletedCapabilities); }", "tokens": 26} {"id": 335671, "source": "method", "repo": "kittehorg/kittehircclientlib", "text": "/** Creates the event. @param client client for which this is occurring @param sourceMessage source message @param channel the channel joined @param user the client */ public RequestedChannelJoinCompleteEvent(@NonNull Client client, @NonNull ServerMessage sourceMessage, @NonNull Channel channel, @NonNull User user) { super(client, sourceMessage, channel, user); }", "tokens": 76} {"id": 335766, "source": "method", "repo": "kittehorg/kittehircclientlib", "text": "public void authenticate(ClientReceiveCommandEvent event) { if (!event.getParameters().isEmpty()) { String base64; if (\"+\".equals(event.getParameters().getFirst())) { base64 = Base64.getEncoder().encodeToString(SaslEcdsaNist256PChallenge.this.getAuthLine().getBytes()); } else { String challenge = event.getParameters().getFirst(); try { base64 = SaslEcdsaNist256PChallenge.sign(SaslEcdsaNist256PChallenge.this.privateKey, challenge); } catch (Exception e) { throw new RuntimeException(e); // TODO make this better } } SaslEcdsaNist256PChallenge.this.getClient().sendRawLineImmediately(\"AUTHENTICATE \" + base64); } }", "tokens": 181} {"id": 335767, "source": "method", "repo": "kittehorg/kittehircclientlib", "text": "protected void toString(final ToStringer stringer) { super.toString(stringer); stringer.add(\"privateKey\", this.privateKey); }", "tokens": 32} {"id": 335869, "source": "method", "repo": "kittehorg/kittehircclientlib", "text": "private HostWithPort(@NonNull String host, int port) { this.host = host; this.port = port; }", "tokens": 28} {"id": 336201, "source": "method", "repo": "klausbrunner/solarpositioning", "text": "/** Returns elevation in degrees, positive above the horizon. */ public double elevation() { return 90.0 - zenithAngle; }", "tokens": 34} {"id": 336248, "source": "method", "repo": "klausbrunner/solarpositioning", "text": "private static boolean crosses(double before, double after, double angle, boolean rising) { return rising ? before < angle && after > angle : before > angle && after < angle; }", "tokens": 42} {"id": 336264, "source": "method", "repo": "klausbrunner/solarpositioning", "text": "void handlesZenithAndNadirRoundoff( ZonedDateTime time, double latitude, double longitude, double elevation) { var position = POSITIONS.at(time, latitude, longitude, 69.184); assertEquals(elevation, position.elevation(), 0.00002); assertEquals(position, POSITIONS.forTime(time, 69.184).at(latitude, longitude)); }", "tokens": 95} {"id": 336268, "source": "method", "repo": "klausbrunner/solarpositioning", "text": "void matchesIndependentJplEvents( Instant start, Instant end, double latitude, double longitude, double horizon, String rises, String sets, String transits) { var result = EVENTS.forDate( start.atZone(ZoneOffset.UTC).toLocalDate(), ZoneOffset.UTC, latitude, longitude, DELTA_T, horizon); assertThat(result.start().toInstant()).isEqualTo(start); assertThat(result.end().toInstant()).isEqualTo(end); compareEvents(rises, result.rises(), timeTolerance(rises, latitude, longitude)); compareEvents(sets, result.sets(), timeTolerance(sets, latitude, longitude)); compareEvents(transits, result.transits(), 1.0); }", "tokens": 161} {"id": 336300, "source": "method", "repo": "klausbrunner/solarpositioning", "text": "public void rejectsSillyZenithAngle() { assertThrows(IllegalArgumentException.class, () -> new SolarPosition(90, -0.1)); assertThrows(IllegalArgumentException.class, () -> new SolarPosition(90, 180.1)); }", "tokens": 62} {"id": 336317, "source": "method", "repo": "klikli-dev/occultism", "text": "public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (this.getClass() != obj.getClass()) return false; GlobalBlockPos other = (GlobalBlockPos) obj; if (!this.pos.equals(other.pos)) return false; return this.dimensionKey.equals(other.dimensionKey); }", "tokens": 80} {"id": 336379, "source": "method", "repo": "klikli-dev/occultism", "text": "public boolean isAutocraftingMode() { return this.mode == StorageControllerGuiMode.AUTOCRAFTING; }", "tokens": 22} {"id": 336478, "source": "method", "repo": "klikli-dev/occultism", "text": "public void playerDestroy(Level worldIn, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity te, ItemStack stack) { super.playerDestroy(worldIn, player, pos, IOtherworldBlock.super.getHarvestState(player, state, stack), te, stack); }", "tokens": 60} {"id": 336490, "source": "method", "repo": "klikli-dev/occultism", "text": "public long getAmountAsLong(int slot) { return this.internal.getAmountAsLong(slot); }", "tokens": 22} {"id": 336726, "source": "method", "repo": "klikli-dev/occultism", "text": "public void setItemSlot(EquipmentSlot slotIn, ItemStack stack) { if (slotIn == EquipmentSlot.MAINHAND) { try (var tx = Transaction.openRoot()) { this.inventory.set(0, ItemResource.of(stack), stack.getCount()); tx.commit(); } } }", "tokens": 62} {"id": 336834, "source": "method", "repo": "klikli-dev/occultism", "text": "public MutableComponent visit(IsInDimensionCondition condition, OccultismConditionContext context) { return Component.translatable( Ritual.IS_IN_DIMENSION_DESCRIPTION, Component.translatable(Util.makeDescriptionId(\"dimension\", condition.dimension().identifier())), Component.translatable(Util.makeDescriptionId(\"dimension\", context.dimension().identifier())) ); }", "tokens": 74} {"id": 336909, "source": "method", "repo": "klikli-dev/occultism", "text": "protected BookIconModel entryIcon() { return BookIconModel.create(OccultismItems.BOOK_OF_BINDING_BOUND_FOLIOT.get()); }", "tokens": 29} {"id": 336913, "source": "method", "repo": "klikli-dev/occultism", "text": "protected BookIconModel entryIcon() { return BookIconModel.create(OccultismItems.CHALK_YELLOW.get()); }", "tokens": 24} {"id": 336972, "source": "method", "repo": "klikli-dev/occultism", "text": "protected String entryName() { return \"Possessed Warden\"; }", "tokens": 17} {"id": 337152, "source": "method", "repo": "klikli-dev/occultism", "text": "public MessageSetItemMode(int mode, InteractionHand hand) { this.mode = mode; this.hand = hand; }", "tokens": 27} {"id": 337159, "source": "method", "repo": "klikli-dev/occultism", "text": "public void compress(RegistryAccess registryAccess) { @SuppressWarnings(\"resource\") Deflater compressor = new Deflater(); compressor.setLevel(Deflater.BEST_SPEED); // Give the compressor the data to compress //create buffer with reasonable size (will increase automatically as needed var uncompressed = RegistryFriendlyByteBuf.decorator(registryAccess, ConnectionType.NEOFORGE).apply(new FriendlyByteBuf(Unpooled.buffer(DEFAULT_BUFFER_SIZE * this.stacks.size()))); uncompressed.writeInt(this.stacks.size()); for (ItemStack stack : this.stacks) { ItemStack.OPTIONAL_STREAM_CODEC.encode(uncompressed, stack); uncompressed.writeInt(stack.getCount()); } compressor.setInput(uncompressed.array(), 0, uncompressed.readableBytes()); compressor.finish(); this.payload = Unpooled.buffer(DEFAULT_BUFFER_SIZE); // Compress the data byte[] buf = new byte[1024]; while (!compressor.finished()) { int count = compressor.deflate(buf); this.payload.writeBytes(buf, 0, count); } }", "tokens": 230} {"id": 337191, "source": "method", "repo": "kneesnap/froglord", "text": "public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final RGB other = (RGB) obj; return this.r == other.r && this.g == other.g && this.b == other.b; }", "tokens": 69} {"id": 337319, "source": "method", "repo": "kneesnap/froglord", "text": "/** Gets the GemType corresponding to the provided value. @param value The value to lookup. @param allowNull If null is allowed. @return gemType */ public static CoinType getType(int value, boolean allowNull) { if (value < 0 || value >= values().length) { if (allowNull) return null; throw new RuntimeException(\"Couldn't determine the coin type from value \" + value + \".\"); } return values()[value]; }", "tokens": 99} {"id": 337464, "source": "method", "repo": "kneesnap/froglord", "text": "/** Set the values of this vector. Equivalent to MR_VEC_EQUALS_SVEC. @param copyVector the vector to copy values from */ public void setValues(SVector copyVector) { this.x = copyVector.getX(); this.y = copyVector.getY(); this.z = copyVector.getZ(); }", "tokens": 73} {"id": 337485, "source": "method", "repo": "kneesnap/froglord", "text": "public RwMaterialListChunk(RwStreamFile streamFile, int version, RwStreamChunk parentChunk) { super(streamFile, RwStreamChunkType.MATERIAL_LIST, version, parentChunk); }", "tokens": 47} {"id": 337621, "source": "method", "repo": "kneesnap/froglord", "text": "public FroggerConfig getConfig() { return (FroggerConfig) super.getConfig(); }", "tokens": 18} {"id": 337673, "source": "method", "repo": "kneesnap/froglord", "text": "public MediEvilConfig(String internalName) { super(internalName); }", "tokens": 20} {"id": 337690, "source": "method", "repo": "kneesnap/froglord", "text": "private void addGridSquareToList(MediEvilMapGridSquare gridSquare) { int searchIndex = Collections.binarySearch(this.gridSquares, gridSquare, Comparator.comparingInt(MediEvilMapGridSquare::getSquareIndex)); if (searchIndex >= 0) throw new IllegalStateException(gridSquare + \" is already registered in the list.\"); this.gridSquares.add(-(searchIndex + 1), gridSquare); }", "tokens": 97} {"id": 337739, "source": "method", "repo": "kneesnap/froglord", "text": "/** Gets the map file which the mesh represents. */ public OldFroggerMapFile getMap() { return getMesh().getMap(); }", "tokens": 29} {"id": 337815, "source": "method", "repo": "kneesnap/froglord", "text": "public void save(DataWriter writer) { writer.writeInt(this.flags); writer.writeUnsignedShort(this.skinVectorCount); writer.writeUnsignedShort(this.skinVertexCount); writer.writeUnsignedShort(this.primitiveBlocks.size()); writer.writeUnsignedShort(this.collprims.size()); this.mimeVectorStartAddress = writer.writeNullPointer(); this.vectorStartAddress = writer.writeNullPointer(); this.primitiveBlockStartAddress = writer.writeNullPointer(); this.collprimListAddress = writer.writeNullPointer(); }", "tokens": 113} {"id": 337934, "source": "method", "repo": "kneesnap/froglord", "text": "/** Moves the view entry in the given direction in the underlying collection, if possible and supported. Throws exceptions if unsupported, so call isMoveOperationSupported() first. @param viewEntry the entry to move @param moveOffset the amount of indices to move the view entry by. */ public void moveViewEntry(@NonNull TViewEntry viewEntry, int moveOffset) { List list = getStrictlyTypedList(); int oldIndex = list.indexOf(viewEntry); if (oldIndex < 0) throw new IllegalStateException(\"The value '\" + viewEntry + \"' was not found as part of the viewEntryList. So it cannot be moved.\"); boolean wasSelected = getRootNode().getSelectionModel().isSelected(oldIndex); int newIndex = Math.max(0, Math.min(list.size() - 1, oldIndex + moveOffset)); if (oldIndex == newIndex) { return; } else if (newIndex > oldIndex) { for (int i = oldIndex; i < newIndex; i++) list.set(i, list.get(i + 1)); list.set(newIndex, viewEntry); } else { for (int i = oldIndex; i > newIndex; i--) list.set(i, list.get(i - 1)); list.set(newIndex, viewEntry); } refreshDisplay(); if (wasSelected) getRootNode().getSelectionModel().select(newIndex); }", "tokens": 312} {"id": 337988, "source": "method", "repo": "kneesnap/froglord", "text": "/** Creates a box for the given mesh entry, conforming to the specified positions @param entry the entry to write mesh data to @param minX the x coordinate for the minimum corner of the box @param minY the y coordinate for the minimum corner of the box @param minZ the z coordinate for the minimum corner of the box @param maxX the x coordinate for the maximum corner of the box @param maxY the y coordinate for the maximum corner of the box @param maxZ the z coordinate for the maximum corner of the box @param uvIndex the index of the uv to apply to the vertices */ public static void createBox(DynamicMeshDataEntry entry, double minX, double minY, double minZ, double maxX, double maxY, double maxZ, int uvIndex) { createBox(entry, minX, minY, minZ, maxX, maxY, maxZ, uvIndex, false); }", "tokens": 178} {"id": 338106, "source": "method", "repo": "kneesnap/froglord", "text": "/** Convert a byte array to a number. @param data The data to turn into a number. @return intValue */ public static int readNumberFromBytes(byte[] data) { return readNumberFromBytes(data, data.length, 0); }", "tokens": 55} {"id": 338191, "source": "method", "repo": "knowm/xchange", "text": "void ascendexOrderHistoryResponseTest() throws Exception { // Read in the JSON from the example resources InputStream is = AscendexTradeDataJSONTest.class.getResourceAsStream( \"/org/knowm/xchange/ascendex/ascendexOrderHistoryResponseExample.json\"); // Use Jackson to parse it ObjectMapper mapper = new ObjectMapper(); AscendexResponse> ascendexAssets = mapper.readValue( is, new TypeReference>>() {}); // Verify that the example data was unmarshalled correctly assertThat(ascendexAssets.getData().size()).isEqualTo(1); assertThat(ascendexAssets.getData().get(0).getAvgPx()) .isEqualByComparingTo(BigDecimal.valueOf(7243.34)); assertThat(ascendexAssets.getData().get(0).getSymbol()) .isEqualTo(CurrencyPairDeserializer.getCurrencyPairFromString(\"BTC/USDT\").toString()); }", "tokens": 210} {"id": 338197, "source": "method", "repo": "knowm/xchange", "text": "/** @return The lowCny */ public BigDecimal getLowCny() { return lowCny; }", "tokens": 23} {"id": 338488, "source": "method", "repo": "knowm/xchange", "text": "public CoinoneTradeResponse placeLimitOrderRaw(LimitOrder limitOrder) throws CoinoneException, IOException { CoinoneTradeRequest request = new CoinoneTradeRequest( apiKey, exchange.getNonceFactory().createValue(), limitOrder.getLimitPrice(), limitOrder.getOriginalAmount(), limitOrder.getCurrencyPair().getBase()); if (limitOrder.getType().equals(OrderType.ASK)) { return coinone.limitSell(payloadCreator, signatureCreator, request); } else { return coinone.limitBuy(payloadCreator, signatureCreator, request); } }", "tokens": 117} {"id": 338566, "source": "method", "repo": "knowm/xchange", "text": "public DefaultQueryOrderParamInstrument(Instrument instrument, String orderId) { super(orderId); this.instrument = instrument; }", "tokens": 26} {"id": 338616, "source": "method", "repo": "knowm/xchange", "text": "void deserializeInstrumentTest() throws Exception { // given InputStream is = DeribitInstrument.class.getResourceAsStream( \"/org/knowm/xchange/deribit/v2/dto/marketdata/example-instrument.json\"); // when ObjectMapper mapper = new ObjectMapper(); DeribitInstrument instrument = mapper.readValue(is, DeribitInstrument.class); // then assertThat(instrument).isNotNull(); assertThat(instrument.getTickSize()).isEqualTo(new BigDecimal(\"0.01\")); assertThat(instrument.getSettlementPeriod()).isEqualTo(\"week\"); assertThat(instrument.getQuoteCurrency()).isEqualTo(\"USD\"); assertThat(instrument.getMinTradeAmount()).isEqualTo(new BigDecimal(\"1\")); assertThat(instrument.getKind()).isEqualTo(Kind.FUTURES); assertThat(instrument.isActive()).isTrue(); assertThat(instrument.getInstrumentName()).isEqualTo(\"BTC-15FEB19\"); assertThat(instrument.getExpirationTimestamp().getTime()).isEqualTo(1550228400000L); assertThat(instrument.getCreationTimestamp().getTime()).isEqualTo(1549537259000L); assertThat(instrument.getContractSize()).isEqualTo(10); assertThat(instrument.getBaseCurrency()).isEqualTo(\"BTC\"); }", "tokens": 262} {"id": 338649, "source": "method", "repo": "knowm/xchange", "text": "public Trades trades(CurrencyPair... currencyPairs) { return trades(Arrays.asList(currencyPairs)); }", "tokens": 25} {"id": 338690, "source": "method", "repo": "knowm/xchange", "text": "public List getHitbtcCandles( CurrencyPair currencyPair, int limit, String period, String sort) throws IOException { return hitbtc.getHitbtcOHLC( HitbtcAdapters.adaptCurrencyPair(currencyPair), limit, period, sort); }", "tokens": 59} {"id": 338865, "source": "method", "repo": "knowm/xchange", "text": "public void setPYG(double pYG) { this.pYG = pYG; }", "tokens": 25} {"id": 339020, "source": "method", "repo": "knowm/xchange", "text": "void trades() { Observable observable = exchange.getStreamingMarketDataService().getTrades(CurrencyPair.BTC_USD); TestObserver testObserver = observable.test(); var trades = testObserver // .awaitDone(1, TimeUnit.MINUTES) .awaitCount(1) .values(); testObserver.dispose(); log.info(\"Received trades: {}\", trades); assumeThat(trades).overridingErrorMessage(\"No trades happened\").isNotEmpty(); assertThat(trades.get(0)).hasNoNullFieldsOrPropertiesExcept(\"makerOrderId\", \"takerOrderId\"); assertThat(trades.get(0).getInstrument()).isEqualTo(CurrencyPair.BTC_USD); }", "tokens": 146} {"id": 339154, "source": "method", "repo": "knuddelsgmbh/jtokkit", "text": "public byte[] decodeBytes(IntArrayList tokens) { ByteArrayList out = new ByteArrayList(10 * tokens.size()); for (int i = 0; i < tokens.size(); i++) { byte[] decodedToken = decodeToken(tokens.get(i)); for (byte b : decodedToken) { out.add(b); } } return out.toArray(); }", "tokens": 81} {"id": 339268, "source": "method", "repo": "knuddelsgmbh/jtokkit", "text": "void o200kBaseBaseEncodesStable(String input) { var actual = ENCODING.decode(ENCODING.encode(input)); assertEquals(input, actual); }", "tokens": 38} {"id": 339313, "source": "method", "repo": "kobylynskyi/graphql-java-codegen", "text": "public File getCustomTemplatesRoot() { return customTemplatesRoot; }", "tokens": 15} {"id": 339345, "source": "method", "repo": "kobylynskyi/graphql-java-codegen", "text": "public String getTypeResolverSuffix() { return typeResolverSuffix; }", "tokens": 14} {"id": 339402, "source": "method", "repo": "kobylynskyi/graphql-java-codegen", "text": "private void updateOrderItem(Item item, Product product, int quantity) { item.setQuantity(item.getQuantity() + quantity); item.setTotal(product.getPrice().multiply(BigDecimal.valueOf(item.getQuantity()))); }", "tokens": 47} {"id": 339768, "source": "method", "repo": "kobylynskyi/graphql-java-codegen", "text": "/** Inverted copy of org.apache.commons.lang3.StringUtils.isBlank(CharSequence cs) @param cs the CharSequence to check, may be null @return {@code false} if the CharSequence is null, empty or whitespace only */ public static boolean isNotBlank(CharSequence cs) { int strLen; if (cs == null || (strLen = cs.length()) == 0) { return false; } for (int i = 0; i < strLen; i++) { if (!Character.isWhitespace(cs.charAt(i))) { return true; } } return false; }", "tokens": 127} {"id": 339913, "source": "method", "repo": "kobylynskyi/graphql-java-codegen", "text": "void serialize_multipleRequests_DiffTypes(String name, Function serializer, Function expectedQueryDecorator) { GraphQLRequests graphQLRequests = new GraphQLRequests( new GraphQLRequest(new EventsByCategoryAndStatusQueryRequest()), new GraphQLRequest(new UpdateIssueMutationRequest())); assertThrows(IllegalArgumentException.class, () -> serializer.apply(graphQLRequests)); }", "tokens": 83} {"id": 340002, "source": "method", "repo": "kobylynskyi/graphql-java-codegen", "text": "public UpdateIssuePayloadResponseProjection union(String alias, UpdateNodeUnionResponseProjection subProjection) { add$(new GraphQLResponseField(\"union\").alias(alias).projection(subProjection)); return this; }", "tokens": 45} {"id": 340211, "source": "method", "repo": "kohsuke/args4j", "text": "public String getDefaultMetaVariable() { final String tMetaVar = individualOptionHandler.getDefaultMetaVariable(); if (tMetaVar == null || tMetaVar.trim().isEmpty()) return tMetaVar; return \"<\" + tMetaVar + delimiter + tMetaVar + delimiter + \"...>\"; }", "tokens": 64} {"id": 340300, "source": "method", "repo": "kohsuke/args4j", "text": "public String getDefaultMetaVariable() { StringBuffer rv = new StringBuffer(); rv.append(\"[\"); for (SubCommand sc : commands.value()) { rv.append(sc.name()).append(\" | \"); } rv.delete(rv.length()-3, rv.length()); rv.append(\"]\"); return rv.toString(); }", "tokens": 70} {"id": 340498, "source": "method", "repo": "kohsuke/args4j", "text": "public void setUp() { handler = new MultiPathOptionHandler(null, null, null); }", "tokens": 20} {"id": 340631, "source": "method", "repo": "konbai-q/ruoyi-flowable-plus", "text": "private List findRegistryByAppName(String appnameParam) { HashMap> appAddressMap = new HashMap>(); List list = xxlJobRegistryDao.findAll(RegistryConfig.DEAD_TIMEOUT, new Date()); if (list != null) { for (XxlJobRegistry item : list) { if (RegistryConfig.RegistType.EXECUTOR.name().equals(item.getRegistryGroup())) { String appname = item.getRegistryKey(); List registryList = appAddressMap.get(appname); if (registryList == null) { registryList = new ArrayList(); } if (!registryList.contains(item.getRegistryValue())) { registryList.add(item.getRegistryValue()); } appAddressMap.put(appname, registryList); } } } return appAddressMap.get(appnameParam); }", "tokens": 193} {"id": 340641, "source": "method", "repo": "konbai-q/ruoyi-flowable-plus", "text": "public ReturnT remove(HttpServletRequest request, int id) { // avoid opt login seft XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY); if (loginUser.getId() == id) { return new ReturnT(ReturnT.FAIL.getCode(), I18nUtil.getString(\"user_update_loginuser_limit\")); } xxlJobUserDao.delete(id); return ReturnT.SUCCESS; }", "tokens": 105} {"id": 340652, "source": "method", "repo": "konbai-q/ruoyi-flowable-plus", "text": "public JobAlarmer getJobAlarmer() { return jobAlarmer; }", "tokens": 17} {"id": 340750, "source": "method", "repo": "konbai-q/ruoyi-flowable-plus", "text": "private void addTags(List sourceTags, Set tags, Locale locale) { Optional> optionalTagSet = AnnotationsUtils .getTags(sourceTags.toArray(new io.swagger.v3.oas.annotations.tags.Tag[0]), true); optionalTagSet.ifPresent(tagsSet -> { tagsSet.forEach(tag -> { tag.name(propertyResolverUtils.resolve(tag.getName(), locale)); tag.description(propertyResolverUtils.resolve(tag.getDescription(), locale)); if (tags.stream().noneMatch(t -> t.getName().equals(tag.getName()))) tags.add(tag); }); }); }", "tokens": 189} {"id": 340772, "source": "method", "repo": "konbai-q/ruoyi-flowable-plus", "text": "public TableDataInfo selectPageDictDataList(SysDictData dictData, PageQuery pageQuery) { LambdaQueryWrapper lqw = new LambdaQueryWrapper() .eq(StringUtils.isNotBlank(dictData.getDictType()), SysDictData::getDictType, dictData.getDictType()) .like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel()) .eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus()) .orderByAsc(SysDictData::getDictSort); Page page = baseMapper.selectPage(pageQuery.build(), lqw); return TableDataInfo.build(page); }", "tokens": 168} {"id": 341267, "source": "method", "repo": "kong/unirest-java", "text": "private static void proxiedResponse(Context context) { simpleResponse(context) .orElseGet(() -> { RequestCapture value = getRequestCapture(context); value.setIsProxied(true); return om.writeValue(value); }); }", "tokens": 52} {"id": 341362, "source": "method", "repo": "kong/unirest-java", "text": "public void setRevision(Revision revision) { this.revision = revision; }", "tokens": 17} {"id": 341516, "source": "method", "repo": "kong/unirest-java", "text": "void deserializeDate_iso_datetime_noMillies() { var back = getTestDate(\"date\", \"1985-07-03T18:30:00Z\"); assertEquals(489263400000L, back.getDate().getTime()); }", "tokens": 67} {"id": 341594, "source": "method", "repo": "kong/unirest-java", "text": "/** {@inheritDoc}

Records the received text message for later assertion via {@link #assertReceivedMessage(Object, boolean)}.

*/ public CompletionStage onText(WebSocket webSocket, CharSequence data, boolean last) { messagesReceived.add(new Message(String.valueOf(data), last)); return WebSocket.Listener.super.onText(webSocket, data, last); }", "tokens": 82} {"id": 341613, "source": "method", "repo": "kong/unirest-java", "text": "public Assert wasInvokedTimes(int i) { Integer sum = sumInvokes(); if (sum != i) { throw new UnirestAssertion( \"Incorrect number of invocations. Expected %s got %s\\n%s %s\", i, sum, method, path); } return this; }", "tokens": 62} {"id": 341800, "source": "method", "repo": "kosmx/minecraftplayeranimator", "text": "public AnimationBuilder mutableCopy() { HashMap newParts = new HashMap<>(); for (Map.Entry part : this.bodyParts.entrySet()) { newParts.put(part.getKey(), part.getValue().copy()); } return new AnimationBuilder(beginTick, endTick, stopTick, isInfinite, returnToTick, newParts, isEasingBefore, nsfw, uuid, animationFormat, extraData); }", "tokens": 100} {"id": 341820, "source": "method", "repo": "kosmx/minecraftplayeranimator", "text": "public StateCollection copy() { return new StateCollection(this); }", "tokens": 17} {"id": 341831, "source": "method", "repo": "kosmx/minecraftplayeranimator", "text": "/** Add a new keyframe to the emote @param tick where @param value what value @param ease with what easing @param rotate 360 degrees turn @param degrees is the value in degrees (or radians if false) @param easingArg self-explanatory @return is the keyframe valid */ public boolean addKeyFrame(int tick, float value, Ease ease, int rotate, boolean degrees, Float easingArg) { if (degrees && this.isAngle) value *= 0.01745329251f; boolean bl = this.addKeyFrame(new KeyFrame(tick, value, ease, easingArg)); if (isAngle && rotate != 0) { bl = this.addKeyFrame(new KeyFrame(tick, (float) (value + Math.PI * 2d * rotate), ease, easingArg)) && bl; } return bl; }", "tokens": 194} {"id": 341836, "source": "method", "repo": "kosmx/minecraftplayeranimator", "text": "public void replaceEase(int pos, Ease ease) { KeyFrame original = this.keyFrames.get(pos); replace(new KeyFrame(original.tick, original.value, ease), pos); }", "tokens": 46} {"id": 342547, "source": "method", "repo": "kostyasha/github-integration-plugin", "text": "private List getEvents() { return handler.getEvents(); }", "tokens": 18} {"id": 342596, "source": "method", "repo": "kostyasha/github-integration-plugin", "text": "/** Expand all what we can from given run */ public static String expandAll(String content, Run run, TaskListener listener) throws IOException, InterruptedException { if (isEmpty(content)) { return content; // Do nothing for an empty String } // Expand environment variables String body = run.getEnvironment(listener).expand(content); // Expand build variables + token macro if they available if (run instanceof AbstractBuild) { final AbstractBuild build = (AbstractBuild) run; body = Util.replaceMacro(body, build.getBuildVariableResolver()); try { Jenkins jenkins = Jenkins.getActiveInstance(); ClassLoader uberClassLoader = jenkins.pluginManager.uberClassLoader; List macros = null; if (nonNull(jenkins.getPlugin(\"token-macro\"))) { // get private macroses like groovy template ${SCRIPT} if available if (nonNull(jenkins.getPlugin(\"email-ext\"))) { Class contentBuilderClazz = uberClassLoader.loadClass(\"hudson.plugins.emailext.plugins.ContentBuilder\"); Method getPrivateMacrosMethod = contentBuilderClazz.getDeclaredMethod(\"getPrivateMacros\"); macros = new ArrayList((Collection) getPrivateMacrosMethod.invoke(null)); } // call TokenMacro.expand(build, listener, content, false, macros) Class tokenMacroClazz = uberClassLoader.loadClass(\"org.jenkinsci.plugins.tokenmacro.TokenMacro\"); Method tokenMacroExpand = tokenMacroClazz.getDeclaredMethod(\"expand\", AbstractBuild.class, TaskListener.class, String.class, boolean.class, List.class); body = (String) tokenMacroExpand.invoke(null, build, listener, body, false, macros); } } catch (ClassNotFoundException e) { LOGGER.error(\"Can't find class\", e); } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { LOGGER.error(\"Can't evaluate macro\", e); } } return body; }", "tokens": 401} {"id": 342809, "source": "method", "repo": "kostyasha/github-integration-plugin", "text": "public void branchNotChangedExisted() throws IOException { commonExpectations(); assertThat( event.check(newGitHubBranchDecisionContext() .withLocalBranch(localBranch) .withBranchTrigger(trigger) .withLocalRepo(localRepo) .withRemoteBranch(remoteBranch) .withListener(listener) .build()), nullValue() ); }", "tokens": 73} {"id": 342997, "source": "method", "repo": "kousen/java_latest", "text": "public static void main(String[] args) { Map map = Map.ofEntries(entry(\"a\", 1), entry(\"b\", 2), entry(\"c\", 3)); map.forEach((k,v) -> System.out.println(k + \" : \" + v)); System.out.println(map.getClass().getName()); }", "tokens": 82} {"id": 343023, "source": "method", "repo": "kousen/java_latest", "text": "public static String getPersonInfo(Person person) { // Exhaustive switch expression with record patterns (Java 21) return switch (person) { case User(var id, var name, var email) -> \"User: %s (%s)\".formatted(name, email); case Admin(var id, var name, var email, var permissions) -> \"Admin: %s (%s) with permissions: %s\" .formatted(name, email, permissions); }; }", "tokens": 105} {"id": 343128, "source": "method", "repo": "kousen/java_latest", "text": "public String getFastestQuote() throws InterruptedException { try (var scope = StructuredTaskScope.open( StructuredTaskScope.Joiner.anySuccessfulResultOrThrow())) { scope.fork(() -> fetchQuote(\"fast server\", 50)); scope.fork(() -> fetchQuote(\"slow server\", 200)); return scope.join(); // result of the first subtask to succeed } }", "tokens": 87} {"id": 343280, "source": "method", "repo": "kousen/java_latest", "text": "void testOrElseGetDemo() { // Test the demo that shows the difference between // orElse (eager) and orElseGet (lazy) evaluation assertDoesNotThrow(() -> OrElseGetDemo.main(new String[]{})); }", "tokens": 48} {"id": 343417, "source": "method", "repo": "kousen/java_latest", "text": "public void ofNullableExample() { String value = null; // Create stream from nullable value long count = Stream.ofNullable(value).count(); assertEquals(0, count); value = \"hello\"; count = Stream.ofNullable(value).count(); assertEquals(1, count); }", "tokens": 60} {"id": 343528, "source": "method", "repo": "kousen/java_upgrade", "text": "public static void main(String[] args) { // multiply numbers between 100 and 200 by 2, then find first n divisible by 3 int firstEvenDoubleDivBy3 = IntStream.rangeClosed(100, 200) .map(n -> n * 2) .filter(n -> n % 3 == 0) .findFirst().orElse(0); System.out.println(firstEvenDoubleDivBy3); // Demonstrate laziness using print statements firstEvenDoubleDivBy3 = IntStream.rangeClosed(100, 2_000_000) // .parallel() .filter(LazyStreams::modByThree) .map(LazyStreams::multByTwo) .findFirst().orElse(0); System.out.printf(\"First even divisible by 3 is %d%n\", firstEvenDoubleDivBy3); }", "tokens": 203} {"id": 343603, "source": "method", "repo": "kousen/java_upgrade", "text": "public void salariesGT100k() { assertThat(dao.salariesGreaterThan(100000.0)).isTrue(); }", "tokens": 35} {"id": 343887, "source": "method", "repo": "kousen/junit5_workshop", "text": "void descriptiveAssertions() { // Using assertThat with as() for better failure messages assertThat(jeanLuc.first()) .as(\"Captain's first name\") .isEqualTo(\"Jean-Luc\"); // Using assertThat with describedAs() for better failure messages assertThat(jeanLuc.last()) .describedAs(\"Captain's last name\") .isEqualTo(\"Picard\"); // Using overrideErrorMessage for complete control over error message assertThat(jeanLuc.dob()) .overridingErrorMessage(\"Expected Captain Picard's birth date to be %s but was %s\", LocalDate.of(2305, Month.JULY, 13), jeanLuc.dob()) .isEqualTo(LocalDate.of(2305, Month.JULY, 13)); }", "tokens": 186} {"id": 343915, "source": "method", "repo": "kousen/junit5_workshop", "text": "private String getLogMessage() { log.info(\"Creating log message...\"); return \"Log message\"; }", "tokens": 21} {"id": 343966, "source": "method", "repo": "kousen/spring-and-spring-boot", "text": "public Greeting greetPost(@RequestBody Greeting greeting) { return new Greeting(greeting.message().toUpperCase()); }", "tokens": 27} {"id": 344047, "source": "method", "repo": "kousen/spring-and-spring-boot", "text": "public void findById() { getIds().forEach(id -> { Optional officer = repository.findById(id); assertTrue(officer.isPresent()); assertEquals(id, officer.get().getId()); }); }", "tokens": 51} {"id": 344271, "source": "method", "repo": "kousen/spring-and-spring-boot", "text": "void testReserveStockInsufficientStock() { // Given when(productRepository.findById(1L)).thenReturn(Optional.of(testProduct)); // When/Then assertThrows(InsufficientStockException.class, () -> productService.reserveStock(1L, 15)); verify(productRepository).findById(1L); verify(productRepository, never()).save(any(Product.class)); }", "tokens": 85} {"id": 344400, "source": "method", "repo": "krabcode/lazygui", "text": "/** Loads a specific save file on startup, tries to look inside the save folder for the file first before assuming the user gave the absolute path. Also disables loading the latest save on startup. @param fileName name of the save file inside the save folder to load in the format \"1\" or \"1.json\" or a full absolute path to it anywhere on disk @return this settings object for chaining statements easily @see #setLoadLatestSaveOnStartup(boolean) @see #setLoadSpecificSaveOnStartupOnce(String) */ public LazyGuiSettings setLoadSpecificSaveOnStartup(String fileName) { this.pathToSpecificSaveToLoadOnStartup = fileName; return this; }", "tokens": 142} {"id": 344810, "source": "method", "repo": "krabcode/lazygui", "text": "public void mouseReleasedAnywhere(LazyMouseEvent e) { super.mouseReleasedAnywhere(e); if(valueStringWhenMouseDragStarted != null && !valueStringWhenMouseDragStarted.equals(getValueAsString())){ onValueChangingActionEnded(); } valueStringWhenMouseDragStarted = null; }", "tokens": 63} {"id": 344934, "source": "method", "repo": "krabcode/lazygui", "text": "public static void setMaxWindowHeight(int maxWindowHeight) { LayoutStore.maxWindowHeight = maxWindowHeight; }", "tokens": 26} {"id": 344991, "source": "method", "repo": "krabcode/lazygui", "text": "public ArrayList build() { return list; }", "tokens": 13} {"id": 345056, "source": "method", "repo": "krabcode/lazygui", "text": "void open(boolean setFocus) { closed = false; if (setFocus) { isBeingDraggedAround = true; setFocusOnThis(); } }", "tokens": 33} {"id": 345116, "source": "method", "repo": "kyoripowered/adventure", "text": "/** Creates a new bossbar. @param name the name @param progress the progress, between 0 and 1 @param color the color @param overlay the overlay @param flags the flags @return a bossbar @throws IllegalArgumentException if progress is less than 0 or greater than 1 @since 4.0.0 */ static BossBar bossBar(final Component name, final float progress, final Color color, final Overlay overlay, final Set flags) { BossBarImpl.checkProgress(progress); return new BossBarImpl(name, progress, color, overlay, flags); }", "tokens": 127} {"id": 345163, "source": "method", "repo": "kyoripowered/adventure", "text": "public Builder volume(final @Range(from = 0, to = Integer.MAX_VALUE) float volume) { this.volume = volume; return this; }", "tokens": 36} {"id": 345185, "source": "method", "repo": "kyoripowered/adventure", "text": "/** Creates a coordinate with the given value and type. @param value the value @param type the type @return a coordinate @since 4.10.0 */ static Coordinate coordinate(final int value, final Type type) { return new BlockNBTComponentImpl.WorldPosImpl.CoordinateImpl(value, type); }", "tokens": 67} {"id": 345447, "source": "method", "repo": "kyoripowered/adventure", "text": "public void testOf() { final int[] hits = {0}; Component.text() .content(\"Purity Ring \") .append(Component.text(\"are absolutely \", NamedTextColor.DARK_PURPLE)) .append(Component.text(\"the best \")) .append(Component.translatable(\"some.adjective\")) .append(Component.text(\" band\", NamedTextColor.GREEN).hoverEvent(HoverEvent.showText(Component.text(\"ever\")))) .append(Component.text(\".\")) .build() .iterable(ComponentIteratorType.DEPTH_FIRST) .forEach(component -> hits[0]++); assertEquals(6, hits[0]); }", "tokens": 147} {"id": 345506, "source": "method", "repo": "kyoripowered/adventure", "text": "void testRedComponent() { final ShadowColor clr = ShadowColor.shadowColor(0xff, 0xbb, 0xcc, 0xdd); assertEquals(0xff, clr.red()); }", "tokens": 47} {"id": 345536, "source": "method", "repo": "kyoripowered/adventure", "text": "void roundTripRgbHsvTest() { NamedTextColor.NAMES.values().forEach(namedTextColor -> { final TextColor roundTripped = TextColor.color(namedTextColor.asHSV()); assertEquals(namedTextColor, roundTripped); }); }", "tokens": 52} {"id": 345583, "source": "method", "repo": "kyoripowered/adventure", "text": "public StringTagParseException makeError(final String message) { return new StringTagParseException(message, this.sequence, this.index); }", "tokens": 30} {"id": 345676, "source": "method", "repo": "kyoripowered/adventure", "text": "void testIntArrayTag() throws IOException { assertEquals(\"[I;1,2,3]\", this.tagToString(IntArrayBinaryTag.intArrayBinaryTag(1, 2, 3))); assertEquals(IntArrayBinaryTag.intArrayBinaryTag(2, 4, 6, 8, 10, 12), this.stringToTag(\"[I; 2, 4, 6, 8, 10, 12]\")); }", "tokens": 96} {"id": 345677, "source": "method", "repo": "kyoripowered/adventure", "text": "void testReadingEmbeddedCompound() throws IOException { final String input = \"{test: \\\"hello\\\"} extra content\"; final StringBuilder remainderBuilder = new StringBuilder(); final CompoundBinaryTag tag = TagStringIO.tagStringIO().asCompound(input, remainderBuilder); assertEquals(CompoundBinaryTag.builder().putString(\"test\", \"hello\").build(), tag); assertEquals(\" extra content\", remainderBuilder.toString()); }", "tokens": 81} {"id": 345849, "source": "method", "repo": "kyoripowered/adventure", "text": "GradientTag(final double phase, final List colors, final Context ctx) { super(ctx); if (colors.isEmpty()) { this.colors = new TextColor[]{DEFAULT_WHITE, DEFAULT_BLACK}; } else { this.colors = colors.toArray(new TextColor[0]); } if (phase < 0) { this.negativePhase = true; this.phase = 1 + phase; // [-1, 0) -> [0, 1) Collections.reverse(Arrays.asList(this.colors)); } else { this.negativePhase = false; this.phase = phase; } }", "tokens": 133} {"id": 346137, "source": "method", "repo": "kyoripowered/adventure-platform", "text": "public void playSound(final @NotNull Player viewer, final Object message) { this.sendPacket(viewer, message); }", "tokens": 26} {"id": 346204, "source": "method", "repo": "kyoripowered/adventure-platform", "text": "public Object serialize(final @NotNull Component component) { if (!SUPPORTED) throw INITIALIZATION_ERROR.get(); if (TEXT_SERIALIZER_DESERIALIZE_TREE != null || MC_TEXT_GSON != null) { final JsonElement json = gson().serializer().toJsonTree(component); try { if (TEXT_SERIALIZER_DESERIALIZE_TREE != null) { final Object unRelocatedJsonElement = PARSE_JSON.invoke(JSON_PARSER_INSTANCE, json.toString()); return TEXT_SERIALIZER_DESERIALIZE_TREE.invoke(unRelocatedJsonElement); } return ((Gson) MC_TEXT_GSON).fromJson(json, CLASS_CHAT_COMPONENT); } catch (final Throwable error) { throw new UnsupportedOperationException(error); } } else { try { if (COMPONENTSERIALIZATION_CODEC_DECODE != null && CREATE_SERIALIZATION_CONTEXT != null) { final Object serializationContext = CREATE_SERIALIZATION_CONTEXT.bindTo(REGISTRY_ACCESS).invoke(JSON_OPS_INSTANCE); final Object result = COMPONENTSERIALIZATION_CODEC_DECODE.invoke(serializationContext, gson().serializeToTree(component)); final Method getOrThrow = result.getClass().getMethod(\"getOrThrow\", java.util.function.Function.class); final Object pair = getOrThrow.invoke(result, (java.util.function.Function) RuntimeException::new); final Method getFirst = pair.getClass().getMethod(\"getFirst\"); return getFirst.invoke(pair); } return TEXT_SERIALIZER_DESERIALIZE.invoke(gson().serialize(component)); } catch (final Throwable error) { throw new UnsupportedOperationException(error); } } }", "tokens": 355} {"id": 346294, "source": "method", "repo": "kyoripowered/adventure-platform", "text": "public void clearTitle(final @NotNull ProxiedPlayer viewer) { viewer.sendTitle(CLEAR); }", "tokens": 23} {"id": 346305, "source": "method", "repo": "kyoripowered/adventure-platform", "text": "public void bossBarFlagsChanged(final net.kyori.adventure.bossbar.@NotNull BossBar bar, final @NotNull Set flagsAdded, final @NotNull Set flagsRemoved) { this.bar.setFlags(this.createFlag(this.bar.getFlags(), flagsAdded, flagsRemoved)); this.broadcastPacket(ACTION_FLAG); }", "tokens": 97} {"id": 346316, "source": "method", "repo": "kyoripowered/adventure-platform", "text": "Translator() { super(ProxyServer.class); }", "tokens": 12} {"id": 346351, "source": "method", "repo": "kyoripowered/adventure-platform", "text": "public void clearTitle() { if (this.title == null) return; for (final V viewer : this.viewers) { this.title.clearTitle(viewer); } }", "tokens": 40} {"id": 346397, "source": "method", "repo": "kyoripowered/adventure-platform", "text": "/** Gets whether a facet should be enabled.

Use the JVM flag, {@code -Dnet.kyori.adventure.=true}, to enable the facet.

@param key a key @param defaultValue the default value @return if the feature is enabled @since 4.0.0 */ public static boolean isEnabled(final @NotNull String key, final boolean defaultValue) { return System.getProperty(NAMESPACE + \".\" + key, Boolean.toString(defaultValue)) .equalsIgnoreCase(\"true\"); }", "tokens": 108} {"id": 346409, "source": "method", "repo": "kyoripowered/adventure-platform", "text": "public Audience player(final @NotNull Player player) { return this.player(player.getUniqueId()); }", "tokens": 23} {"id": 346457, "source": "method", "repo": "kyoripowered/adventure-platform", "text": "public void close() { this.bar.removePlayers(this.bar.getPlayers()); }", "tokens": 20} {"id": 346698, "source": "method", "repo": "lacuna/bifurcan", "text": "public static Iterable bfsVertices(V start, Function> adjacent) { return bfsVertices(LinearList.of(start), adjacent); }", "tokens": 45} {"id": 346705, "source": "method", "repo": "lacuna/bifurcan", "text": "/** @return the index of {@code vertex}, if it's present */ default OptionalLong indexOf(V vertex) { return vertices().indexOf(vertex); }", "tokens": 33} {"id": 346790, "source": "method", "repo": "lacuna/bifurcan", "text": "default OptionalLong indexOf(K key) { OptionalLong idx = inclusiveFloorIndex(key); return idx.isPresent() && comparator().compare(key, nth(idx.getAsLong()).key()) == 0 ? idx : OptionalLong.empty(); }", "tokens": 50} {"id": 346961, "source": "method", "repo": "lacuna/bifurcan", "text": "/** @return a set containing the elements in {@code iterable} */ public static LinearSet from(Iterable iterable) { return from(iterable.iterator()); }", "tokens": 42} {"id": 346984, "source": "method", "repo": "lacuna/bifurcan", "text": "public static List of(V... elements) { List list = new List().linear(); for (V e : elements) { list.addLast(e); } return list.forked(); }", "tokens": 54} {"id": 347171, "source": "method", "repo": "lacuna/bifurcan", "text": "public static String toString(ISet set, Function elementPrinter) { StringBuilder sb = new StringBuilder(\"{\"); Iterator it = set.elements().iterator(); while (it.hasNext()) { sb.append(elementPrinter.apply(it.next())); if (it.hasNext()) { sb.append(\", \"); } } sb.append(\"}\"); return sb.toString(); }", "tokens": 92} {"id": 347387, "source": "method", "repo": "lacuna/bifurcan", "text": "/** Performs a binary search for the given rowValue. @param set the bit-int set @param bitsPerElement the bits per element @param size the number of elements in the set @param val the rowValue to search for @return If idx >= 0, the actual table of the rowValue. Otherwise, the return rowValue represents the table where the rowValue would be inserted, where -1 represents the 0th element, -2 represents the 1st element, and so on. */ public static int indexOf(long[] set, int bitsPerElement, int size, long val) { int low = 0; int high = size - 1; int mid = 0; while (low <= high) { mid = (low + high) >>> 1; long curr = get(set, bitsPerElement, mid); if (curr < val) { low = mid + 1; } else if (curr > val) { high = mid - 1; } else { return mid; } } return -(low + 1); }", "tokens": 224} {"id": 347416, "source": "method", "repo": "lacuna/bifurcan", "text": "public ConcatList(IList a, IList b) { lists = new IntMap>().put(0, a).put(a.size(), b); size = a.size() + b.size(); }", "tokens": 60} {"id": 347697, "source": "method", "repo": "Ladysnake/Cardinal-Components-API", "text": "public Vita get(Direction side) { return storage.get(side); }", "tokens": 18} {"id": 347753, "source": "method", "repo": "Ladysnake/Cardinal-Components-API", "text": "public void registerFor(Class target, ComponentKey type, ComponentFactory factory) { this.checkLoading(EntityComponentFactoryRegistry.class, \"register\"); this.register0(target, type, new QualifiedComponentFactory<>(factory, type.getComponentClass(), Set.of())); }", "tokens": 82} {"id": 347767, "source": "method", "repo": "Ladysnake/Cardinal-Components-API", "text": "private void toTag(ValueOutput view, CallbackInfo ci) { this.components.writeData(view); }", "tokens": 24} {"id": 347777, "source": "method", "repo": "Ladysnake/Cardinal-Components-API", "text": "public void cca$markAsSwitchingCharacter() { this.switchingCharacter = true; }", "tokens": 21} {"id": 347878, "source": "method", "repo": "Ladysnake/Cardinal-Components-API", "text": "public void registerTeamComponent(ComponentKey type, Class impl, TeamComponentFactoryV2 factory) { this.checkLoading(ScoreboardComponentFactoryRegistry.class, \"register\"); this.teamFactories.component(type, impl, factory, Set.of()); }", "tokens": 71} {"id": 347920, "source": "method", "repo": "Ladysnake/Cardinal-Components-API", "text": "public VitalityStickItem(Properties settings) { super(settings); }", "tokens": 17} {"id": 348062, "source": "method", "repo": "laigeoffer/pmhub", "text": "public List getList() { return list; }", "tokens": 12} {"id": 348236, "source": "method", "repo": "lamarios/homedash2", "text": "public HomeDashClassPathTemplateLoader(String templateRoot) { if (!templateRoot.endsWith(File.separator)) { templateRoot = templateRoot + File.separator; } this.templateRoot = templateRoot; }", "tokens": 45} {"id": 348351, "source": "method", "repo": "lamarios/homedash2", "text": "public RadarrApi(String baseUrl, String apiKey, ImagePath imagePath, Function cachePathToUrlPath) { super(cachePathToUrlPath); this.baseUrl = baseUrl; this.imagePath = imagePath; url = baseUrl + \"api/%s?apikey=\" + apiKey; this.apiKey = apiKey; }", "tokens": 73} {"id": 348359, "source": "method", "repo": "lamarios/homedash2", "text": "public void setCoverType(String coverType) { this.coverType = coverType; }", "tokens": 21} {"id": 348477, "source": "method", "repo": "lamarios/homedash2", "text": "public Map exposeSettings() { Map result = new Hashtable<>(); result.put(\"Path\", mountPoint.toString()); return result; }", "tokens": 38} {"id": 348660, "source": "method", "repo": "lamarios/homedash2", "text": "protected Object refresh(String size) throws Exception { getData(DATA_SPOTIFY_TOKEN, SpotifyToken.class).ifPresent(t -> this.token = (SpotifyToken) t); try { if (token != null) { SpotifyNowPlaying nowPlaying = nowPlaying(); Optional error = Optional.ofNullable(nowPlaying().error); if (!error.isPresent()) { return nowPlaying; } else { if (error.get().message.equals(MESSAGE_TOKEN_EXPIRED)) { refreshToken(); return refresh(size); } else { return needAuth(); } } } else { return needAuth(); } } catch (UnirestException e) { return needAuth(); } }", "tokens": 142} {"id": 348850, "source": "method", "repo": "lamarios/homedash2", "text": "/** Gets the next available size for a module for resize purpose. @param request @param response @return */ private Object getNextAvailableSize(Request request, Response response) throws Exception { Optional currentSize = Optional.ofNullable(request.queryParams(\"currentSize\")); Optional moduleId = Optional.ofNullable(request.queryParams(\"moduleId\")).map(s -> Integer.parseInt(s)); Optional availableWidth = Optional.ofNullable(request.queryParams(\"availableWidth\")).map(s -> Integer.parseInt(s)); if (currentSize.isPresent() && moduleId.isPresent() && availableWidth.isPresent()) { String[] sizes = PluginModuleMaintainer.INSTANCE.getPluginForModule(moduleId.get()).getSizes(); Arrays.sort(sizes); List filteredSizes = Stream.of(sizes) .filter(s -> !s.equalsIgnoreCase(ModuleLayout.FULL_SCREEN)) .filter(s -> !s.equalsIgnoreCase(ModuleLayout.KIOSK)) .filter(s -> Integer.parseInt(String.valueOf(s.charAt(0))) <= availableWidth.get()) .collect(Collectors.toList()); int newIndex = filteredSizes.indexOf(currentSize.get()) + 1; if (newIndex < filteredSizes.size()) { return filteredSizes.get(newIndex); } else { return filteredSizes.get(0); } } else { Spark.halt(404); return \"Missing paramters\"; } }", "tokens": 318} {"id": 348871, "source": "method", "repo": "lamarios/homedash2", "text": "public ModuleLayout get(Integer id) throws SQLException { return DB.MODULE_LAYOUT_DAO.queryForId(id); }", "tokens": 27} {"id": 348872, "source": "method", "repo": "lamarios/homedash2", "text": "public List getAll() throws SQLException { return DB.MODULE_LAYOUT_DAO.queryForAll(); }", "tokens": 25} {"id": 349029, "source": "method", "repo": "lambdaurora/spruceui", "text": "public SimpleBorder(int thickness, int red, int green, int blue, int alpha) { this(thickness, red, green, blue, alpha, red, green, blue, alpha); }", "tokens": 42} {"id": 349215, "source": "method", "repo": "lambdaurora/spruceui", "text": "public Builder text(Component text) { this.entries.add(new TextEntry(text)); return this; }", "tokens": 25} {"id": 349344, "source": "method", "repo": "lambdaurora/spruceui", "text": "/** Returns whether this checkbox shows a cross for the {@code false} value. @return {@code true} if this checkbox can show a cross, else {@code false} */ public boolean showCross() { return this.showCross; }", "tokens": 50} {"id": 349360, "source": "method", "repo": "lambdaurora/spruceui", "text": "/** Sets the text of this label. @param text the text to set */ public void setText(Component text) { this.text = text; this.lines = this.client.font.split(text, this.maxWidth); int width = this.lines.stream().mapToInt(this.client.font::width).max().orElse(this.maxWidth); if (width > this.maxWidth) { width = this.maxWidth; } if (this.isCentered()) { this.position.setRelativeX(this.baseX + this.maxWidth / 2 - width / 2); } else { this.position.setRelativeX(this.baseX); } this.width = width; this.height = this.lines.size() * this.client.font.lineHeight + 2; }", "tokens": 178} {"id": 349442, "source": "method", "repo": "lambdaurora/spruceui", "text": "public List children() { return this.children; }", "tokens": 16} {"id": 349465, "source": "method", "repo": "lambdaurora/spruceui", "text": "protected boolean removeEntry(E entry) { if (this.getFocused() == entry) { this.refocusOnRemoval(entry); } return this.entries.remove(entry); }", "tokens": 40} {"id": 349567, "source": "method", "repo": "lambdaurora/spruceui", "text": "public boolean isEditorActive() { return this.isActive() && this.isFocused(); }", "tokens": 19} {"id": 349747, "source": "method", "repo": "Lambdua/openai4j", "text": "public static StreamEvent valueByName(String eventName) { for (StreamEvent value : values()) { if (value.eventName.equals(eventName)) { return value; } } throw new IllegalArgumentException(\"Unknown event name: \" + eventName); }", "tokens": 55} {"id": 349776, "source": "method", "repo": "Lambdua/openai4j", "text": "/** Deserializes the message to an object of the specified target class. @param targetClass the type of the object @return the deserialized object */ public T parsed(Class targetClass) { try { return JsonUtil.getInstance().readValue(getTextContent(), targetClass); } catch (Exception e) { throw new RuntimeException(e); } }", "tokens": 73} {"id": 349914, "source": "method", "repo": "Lambdua/openai4j", "text": "/** Checks if the accumulated message contains a function call. @return true if the accumulated message contains a function call, false otherwise. */ public boolean isFunctionCall() { AssistantMessage asstMsg = getAccumulatedMessage(); return (asstMsg.getFunctionCall() != null && asstMsg.getFunctionCall().getName() != null) || (asstMsg.getToolCalls() != null && !asstMsg.getToolCalls().isEmpty()); }", "tokens": 92} {"id": 349959, "source": "method", "repo": "Lambdua/openai4j", "text": "public CompletionResult createCompletion(CompletionRequest request) { return execute(api.createCompletion(request)); }", "tokens": 23} {"id": 350013, "source": "method", "repo": "Lambdua/openai4j", "text": "public VectorStore retrieveVectorStore(String vectorStoreId) { return execute(api.retrieveVectorStore(vectorStoreId)); }", "tokens": 25} {"id": 350155, "source": "method", "repo": "Lambdua/openai4j", "text": "void testServerError() { String errorBody = \"{\\\"error\\\":{\\\"message\\\":\\\"Invalid auth token\\\",\\\"type\\\":\\\"type\\\",\\\"param\\\":\\\"param\\\",\\\"code\\\":\\\"code\\\"}}\"; ResponseBody body = ResponseBody.create(MediaType.get(\"application/json\"), errorBody); Call call = Calls.response(Response.error(401, body)); Flowable flowable = Flowable.create(emitter -> call.enqueue(new ResponseBodyCallback(emitter, true)), BackpressureStrategy.BUFFER); TestSubscriber testSubscriber = new TestSubscriber<>(); flowable.subscribe(testSubscriber); testSubscriber.assertError(OpenAiHttpException.class); assertEquals(\"Invalid auth token\", testSubscriber.errors().get(0).getMessage()); }", "tokens": 158} {"id": 350201, "source": "method", "repo": "langgraph4j/langgraph4j", "text": "public void testTextMessageEndEventSerialization() { final var timestamp = System.currentTimeMillis(); // Implement test for TextMessageEndEvent serialization and deserialization Event eventIn = new TextMessageEndEvent( \"1\", timestamp, null); // Test serialization var json = serializer.serialize(eventIn); assertEquals(\"\"\" {\"type\":\"TEXT_MESSAGE_END\",\"messageId\":\"1\",\"timestamp\":%d}\"\"\" .formatted(timestamp), json); // Test deserialization final TextMessageEndEvent eventOut = serializer.deserialize(json, TextMessageEndEvent.class); assertEquals(\"1\", eventOut.messageId()); assertEquals(timestamp, eventOut.timestamp()); }", "tokens": 133} {"id": 350235, "source": "method", "repo": "langgraph4j/langgraph4j", "text": "public State(Map initData) { super(initData); }", "tokens": 21} {"id": 350266, "source": "method", "repo": "langgraph4j/langgraph4j", "text": "public String getItemsJson() { return toJson(initialItems); }", "tokens": 15} {"id": 350325, "source": "method", "repo": "langgraph4j/langgraph4j", "text": "public ChatResponse doChat(ChatRequest r) { int n = c.incrementAndGet(); if (n == throwOnCall) throw new RuntimeException(\"boom from callModel #\" + n); if (n == 1) { var req = ToolExecutionRequest.builder().id(\"t1\").name(\"echo\") .arguments(\"{\\\"arg0\\\":\\\"x\\\"}\").build(); return ChatResponse.builder() .aiMessage(AiMessage.from(req)) .finishReason(FinishReason.TOOL_EXECUTION).build(); } return ChatResponse.builder() .aiMessage(AiMessage.from(\"done\")) .finishReason(FinishReason.STOP).build(); }", "tokens": 143} {"id": 350466, "source": "method", "repo": "langgraph4j/langgraph4j", "text": "public StateSerializer getStateSerializer() { return stateSerializer; }", "tokens": 17} {"id": 350613, "source": "method", "repo": "langgraph4j/langgraph4j", "text": "/** Returns an unmodifiable view of the data map. @return an unmodifiable map of the data */ public final java.util.Map data() { return unmodifiableMap(data); }", "tokens": 42} {"id": 350616, "source": "method", "repo": "langgraph4j/langgraph4j", "text": "/** Returns the value associated with the given key or a default value if no such key exists. @param key The key to retrieve the value for. @param defaultProvider A provider function that returns the default value if the key is not found. @param the type of the value @return The value associated with the key, or the default value provided by {@code defaultProvider}. */ public final T value(String key, Supplier defaultProvider) { return this.value(key).orElseGet(defaultProvider); }", "tokens": 118} {"id": 350659, "source": "method", "repo": "langgraph4j/langgraph4j", "text": "void retryBackOffLetsAForkJoinPoolExecutorRunOtherWork() throws Exception { var forkJoinPool = new ForkJoinPool(1); var firstAttemptFailed = new CountDownLatch(1); var attempts = new AtomicInteger(); var graph = new StateGraph<>(AgentState::new) .addNode(\"n1\", node_async(state -> { if (attempts.incrementAndGet() == 1) { firstAttemptFailed.countDown(); throw new IOException(\"transient\"); } return Map.of(); })) .addWrapCallNodeHook(\"n1\", RetryPolicy.builder() .retryDelay(Duration.ofSeconds(2)) .jitter(false) .retryOn(IOException.class) .build() .asHook()) .addEdge(START, \"n1\") .addEdge(\"n1\", END) .compile(); try { var run = CompletableFuture.runAsync(() -> graph.invoke(GraphInput.noArgs(), RunnableConfig.builder().emitterExecutor(forkJoinPool).build())); assertTrue(firstAttemptFailed.await(5, TimeUnit.SECONDS)); CompletableFuture.runAsync(() -> {}, forkJoinPool).get(1, TimeUnit.SECONDS); run.get(5, TimeUnit.SECONDS); } finally { forkJoinPool.shutdownNow(); } }", "tokens": 268} {"id": 350666, "source": "method", "repo": "langgraph4j/langgraph4j", "text": "String nextNode() { return this.value(\"NEXT_NODE\" ).orElse(StateGraph.END); }", "tokens": 29} {"id": 350755, "source": "method", "repo": "langgraph4j/langgraph4j", "text": "/** Creates a new storage strategy. @param dynamoDbClient DynamoDB client for chunk table operations @param tableName name of the DynamoDB table for payload chunks @param s3Client optional S3 client for large data offloading (nullable) @param s3Bucket optional S3 bucket name (nullable) @param s3KeyPrefix optional prefix prepended to all S3 keys (nullable) @param ttlSeconds optional TTL in seconds for automatic cleanup (nullable) */ StorageStrategy(DynamoDbClient dynamoDbClient, String tableName, S3Client s3Client, String s3Bucket, String s3KeyPrefix, Long ttlSeconds) { this.dynamoDbClient = dynamoDbClient; this.tableName = tableName; this.s3Client = s3Client; this.s3Bucket = s3Bucket; this.s3KeyPrefix = s3KeyPrefix != null ? s3KeyPrefix.replaceAll(\"^/+|/+$\", \"\") : null; this.ttlSeconds = ttlSeconds; this.s3Enabled = s3Client != null && s3Bucket != null; // Configure S3 lifecycle policy if TTL is set if (this.s3Enabled && this.ttlSeconds != null && this.ttlSeconds > 0) { ensureS3LifecyclePolicy(); } }", "tokens": 275} {"id": 350758, "source": "method", "repo": "langgraph4j/langgraph4j", "text": "private boolean processBatchWithRetry(Map> initialRequestItems) { Map> requestItems = initialRequestItems; int retryRound = 0; try { while (!requestItems.isEmpty() && retryRound <= BATCH_RETRY_MAX_ROUNDS) { BatchWriteItemRequest request = BatchWriteItemRequest.builder() .requestItems(requestItems) .build(); BatchWriteItemResponse response = dynamoDbClient.batchWriteItem(request); if (!response.hasUnprocessedItems() || response.unprocessedItems().isEmpty()) { return true; } requestItems = response.unprocessedItems(); retryRound++; if (retryRound <= BATCH_RETRY_MAX_ROUNDS) { sleepForBackoff(retryRound); } } } catch (Exception e) { log.error(\"Error during DynamoDB batch delete\", e); return false; } return requestItems.isEmpty(); }", "tokens": 201} {"id": 351139, "source": "method", "repo": "lavalink-devs/youtube-source", "text": "public String getTimestamp(HttpInterface httpInterface, String sourceUrl) throws IOException { synchronized (this) { HttpPost request = new HttpPost(getRemoteEndpoint(\"get_sts\")); log.debug(\"Getting timestamp for script: {}\", sourceUrl); String requestBody = JsonWriter.string() .object() .value(\"player_url\", sourceUrl) .end() .done(); request.setEntity(new StringEntity(requestBody, ContentType.APPLICATION_JSON)); try (CloseableHttpResponse response = configureHttpInterface(httpInterface).execute(request)) { String responseBody = validateAndGetResponseBody(response); log.debug(\"Received response from remote cipher service: {}\", responseBody); JsonBrowser json = JsonBrowser.parse(responseBody); return json.get(\"sts\").text(); } } }", "tokens": 163} {"id": 351173, "source": "method", "repo": "lavalink-devs/youtube-source", "text": "public String getVisitorData() { return this.visitorData; }", "tokens": 15} {"id": 351317, "source": "method", "repo": "lavalink-devs/youtube-source", "text": "public void appendField(String name, Object value) { builder.append(\"\\n \").append(name).append(\": \"); if (value == null) { builder.append(\"\"); } else { builder.append(value.toString()); } }", "tokens": 56} {"id": 351384, "source": "method", "repo": "lavalink-devs/youtube-source", "text": "public void onRequest(HttpClientContext context, org.apache.http.client.methods.HttpUriRequest request, boolean isRepetition) { // No operation }", "tokens": 34} {"id": 351478, "source": "method", "repo": "LegacyLands/legacy-lands-library", "text": "/** Creates a test runner instance using dependency injection. @return the configured test runner */ public static AnnotationTestRunner create() { try { AnnotationProcessingServiceInterface processingService = Containers.get(AnnotationProcessingService.class); TestableAnnotationProcessor testProcessor = Containers.get(TestableAnnotationProcessor.class); return new AnnotationTestRunner(processingService, testProcessor); } catch (Exception exception) { TestLogger.logFailure(\"annotation\", \"Failed to create AnnotationTestRunner: %s\", exception.getMessage()); throw new RuntimeException(\"Failed to create test runner\", exception); } }", "tokens": 117} {"id": 351748, "source": "method", "repo": "LegacyLands/legacy-lands-library", "text": "public void saveUser(String username) { }", "tokens": 11} {"id": 351885, "source": "method", "repo": "LegacyLands/legacy-lands-library", "text": "/** Creates a Caffeine asynchronous cache service with default configuration. @param the cache key type @param the cache value type @return a new async Caffeine cache service instance @see CacheServiceInterface @see AsyncCache @see CaffeineAsyncCacheService */ public static CacheServiceInterface, V> createCaffeineAsyncCache() { return new CaffeineAsyncCacheService<>(); }", "tokens": 92} {"id": 351957, "source": "method", "repo": "LegacyLands/legacy-lands-library", "text": "/** Schedule a periodic {@link Callable} task with a fixed delay and interval in ticks.

The callable is expected to return a {@link TaskResponse} which defines whether the task should continue or terminate. @param task the callable task to be executed @param delayTicks the initial delay in ticks before the first execution @param intervalTicks the interval in ticks between consecutive executions @param the return type wrapped by {@link TaskResponse} @return a {@link ScheduledTask} representing the scheduled task */ default ScheduledTask scheduleAtFixedRate(Callable> task, long delayTicks, long intervalTicks) { return getMCScheduler().scheduleAtFixedRate(task, delayTicks, intervalTicks); }", "tokens": 153} {"id": 352142, "source": "method", "repo": "LegacyLands/legacy-lands-library", "text": "/** Creates and starts a new entity stream task.

This method creates a new {@link EntityRStreamTask} with the provided parameters and starts it immediately, returning the resulting {@link ScheduledTask}. @param actionName the name of the task @param data the data payload of the task @param expirationTime the duration after which the task expires @return a {@link CompletableFuture} instance tracking the execution status of the task */ public CompletableFuture createEntityStreamTask(String actionName, String data, Duration expirationTime) { return pubEntityRStreamTask(EntityRStreamTask.of(actionName, data, expirationTime)); }", "tokens": 133} {"id": 352216, "source": "method", "repo": "LegacyLands/legacy-lands-library", "text": "/** {@inheritDoc} */ public FailureHandlingResult handle(FailureContext context) { if (context.getAttemptNumber() <= retryPolicy.getMaxAttempts() && retryPolicy.shouldRetry(context.getException())) { return FailureHandlingResult.retry(retryPolicy.calculateDelay(context.getAttemptNumber())); } return FailureHandlingResult.giveUp(compensationAction); }", "tokens": 80} {"id": 352257, "source": "method", "repo": "LegacyLands/legacy-lands-library", "text": "/** {@inheritDoc} @return {@inheritDoc} */ public boolean isRecordLimit() { return delegate.isRecordLimit(); }", "tokens": 26} {"id": 352377, "source": "method", "repo": "LegacyLands/legacy-lands-library", "text": "/** {@inheritDoc} @param compiledScript {@inheritDoc} @param functionName {@inheritDoc} @param scriptScope {@inheritDoc} @param args {@inheritDoc} @return {@inheritDoc} @throws ScriptException {@inheritDoc} */ public Object invokeCompiledFunction(Object compiledScript, String functionName, ScriptScope scriptScope, Object... args) throws ScriptException { Validate.notNull(rhinoContext, \"Rhino context is not initialized.\"); // Use a provided scope or the root scope if none is provided Scriptable scope = scriptScope == null ? rootScope : ((RhinoScriptScope) scriptScope).getScriptable(); try { if (compiledScript != null) { executeCompiled(compiledScript, scriptScope); } Object function = scope.get(functionName, scope); if (!(function instanceof org.mozilla.javascript.Function rhinoFunction)) { throw new ScriptException(\"Function '\" + functionName + \"' not found or not a function.\"); } return rhinoFunction.call(rhinoContext, scope, scope, args); } catch (Exception exception) { throw new ScriptException(\"Error invoking function '\" + functionName + \"': \" + exception.getMessage(), exception); } }", "tokens": 235} {"id": 352408, "source": "method", "repo": "LegacyLands/legacy-lands-library", "text": "/** Tests creation of V8 script engine. */ public static boolean testCreateV8Engine() { try { ScriptEngineInterface engine = ScriptEngineFactory.createV8Engine(); boolean isNotNull = engine != null; boolean isCorrectType = engine instanceof V8ScriptEngine; boolean implementsInterface = engine instanceof ScriptEngineInterface; TestLogger.logInfo(\"script\", \"V8 engine creation test: notNull=%s, correctType=%s, implementsInterface=%s\", isNotNull, isCorrectType, implementsInterface); return isNotNull && isCorrectType && implementsInterface; } catch (Exception exception) { TestLogger.logFailure(\"script\", \"V8 engine creation test failed: %s\", exception.getMessage()); return false; } }", "tokens": 148} {"id": 352411, "source": "method", "repo": "LegacyLands/legacy-lands-library", "text": "/** Tests scope integration with Nashorn engine. */ public static boolean testNashornEngineIntegration() { try { ScriptEngineInterface engine = ScriptEngineFactory.createNashornScriptEngine(); NashornScriptScope scope = new NashornScriptScope(); // Set variables in scope scope.setVariable(\"x\", 10); scope.setVariable(\"y\", 20); scope.setVariable(\"name\", \"Nashorn\"); // Execute script using scope variables Object sumResult = engine.execute(\"x + y\", scope); boolean sumCorrect = sumResult != null && (sumResult.toString().equals(\"30\") || sumResult.toString().equals(\"30.0\")); Object stringResult = engine.execute(\"'Hello ' + name\", scope); boolean stringCorrect = stringResult != null && stringResult.equals(\"Hello Nashorn\"); // Verify global scope is not affected Object globalCheck = engine.execute(\"typeof x\"); boolean globalClean = globalCheck != null && globalCheck.equals(\"undefined\"); TestLogger.logInfo(\"script\", \"Nashorn engine integration test: sum=%s, string=%s, globalClean=%s\", sumCorrect, stringCorrect, globalClean); return sumCorrect && stringCorrect && globalClean; } catch (Exception exception) { TestLogger.logFailure(\"script\", \"Nashorn engine integration test failed: %s\", exception.getMessage()); return false; } }", "tokens": 280} {"id": 352582, "source": "method", "repo": "leibnitz27/cfr", "text": "public void collectStatement(String name, StructuredStatement statement) { SuperFunctionInvokation superInvokation = wcm.getSuperFunction(\"s1\").getMatch(); if (canBeNopped(superInvokation)) { statement.getContainer().nopOut(); Set declarationsToNop = getDeclarationsToNop(wcm); if (declarationsToNop != null) { List decls = Functional.filter(structuredStatements, new Predicate() { @Override public boolean test(StructuredStatement in) { return (in instanceof StructuredDefinition); } }); for (StructuredStatement decl : decls) { StructuredDefinition defn = (StructuredDefinition) decl; if (declarationsToNop.contains(defn.getLvalue())) { defn.getContainer().nopOut(); } } } } }", "tokens": 179} {"id": 352651, "source": "method", "repo": "leibnitz27/cfr", "text": "public void renameToAvoidHiding(Set avoid, List collisions) { StructuredScopeWithVars structuredScopeWithVars = new StructuredScopeWithVars(); structuredScopeWithVars.add(null); structuredScopeWithVars.markInitiallyDefined(avoid); for (LocalVariable hider : collisions) { // This will cause it to be renamed. structuredScopeWithVars.defineHere(hider); } }", "tokens": 88} {"id": 352915, "source": "method", "repo": "leibnitz27/cfr", "text": "public NewArrayWildcard getNewArrayWildCard(String name) { return getNewArrayWildCard(name, 1, null); }", "tokens": 30} {"id": 353265, "source": "method", "repo": "leibnitz27/cfr", "text": "public boolean hasLocalInstance(JavaRefTypeInstance type) { return localTypeNames.containsKey(type); }", "tokens": 24} {"id": 353269, "source": "method", "repo": "leibnitz27/cfr", "text": "public BufferedOutputStream getAdditionalOutputStream(String description) { throw new IllegalStateException(); }", "tokens": 18} {"id": 353324, "source": "method", "repo": "leibnitz27/cfr", "text": "public void accept(Collection items) { try { BufferedOutputStream stream = dumper.getAdditionalOutputStream(\"lineNumberTable\"); OutputStreamWriter sw = new OutputStreamWriter(stream); try { sw.write(\"------------------\\n\"); sw.write(\"Line number table:\\n\\n\"); for (Item item : items) { sw.write(item.getMethod().getMethodPrototype().toString()); sw.write(\"\\n----------\\n\"); for (Map.Entry entry : item.getBytecodeLocs().entrySet()) { sw.write(\"Line \" + entry.getValue() + \"\\t: \" + entry.getKey() + \"\\n\"); } sw.write(\"\\n\"); } } finally { sw.close(); } } catch (IOException e) { throw new ConfusedCFRException(e); } }", "tokens": 171} {"id": 353334, "source": "method", "repo": "leibnitz27/cfr", "text": "public ToStringDumper() { super(new MovableDumperContext()); }", "tokens": 17} {"id": 353344, "source": "method", "repo": "leibnitz27/cfr", "text": "public Dumper beginBlockComment(boolean inline) { if (context.inBlockComment != BlockCommentState.Not) { throw new IllegalStateException(\"Attempt to nest block comments.\"); } context.inBlockComment = inline ? BlockCommentState.InLine : BlockCommentState.In; print(\"/* \"); if (inline) newln(); return this; }", "tokens": 78} {"id": 353346, "source": "method", "repo": "leibnitz27/cfr", "text": "public Dumper print(String s) { sink(UNCLASSIFIED, s); return this; }", "tokens": 24} {"id": 353486, "source": "method", "repo": "lenni0451/classtransform", "text": "/** Transform the bytecode of the given class.
The name must be in the class format (e.g. {@code java.lang.String}). @param name The name of the class @param bytecode The bytecode of the class @return The modified bytecode of the class or null if not changed */ public byte[] transform(final String name, byte[] bytecode) { return this.transform(name, bytecode, true); }", "tokens": 90} {"id": 353491, "source": "method", "repo": "lenni0451/classtransform", "text": "private void retransformClasses(@Nullable final Set classesToRetransform) { if (this.instrumentation != null && this.instrumentation.isRetransformClassesSupported()) { List> classes = new ArrayList<>(); Set classSet; if (classesToRetransform != null) classSet = classesToRetransform; else classSet = this.transformedClasses; for (Class loadedClass : this.instrumentation.getAllLoadedClasses()) { if (loadedClass != null && classSet.contains(loadedClass.getName())) classes.add(loadedClass); } if (!classes.isEmpty()) { try { this.instrumentation.retransformClasses(classes.toArray(new Class[0])); } catch (Throwable t) { Logger.error(\"Failed to retransform classes '{}'\", classes.stream().map(Class::getName).collect(Collectors.joining(\", \")), t); if (FailStrategy.EXIT.equals(this.failStrategy)) System.exit(-1); else if (FailStrategy.THROW.equals(this.failStrategy)) Sneaky.sneakyThrow(t); } } } }", "tokens": 236} {"id": 353651, "source": "method", "repo": "lenni0451/classtransform", "text": "private InsnList getReturnInstructions(final ClassNode classNode, final MethodNode target, final MethodNode source, final boolean cancellable, final boolean hasArgs, final boolean hasCallback, final List transformerMethodCalls) { Type returnType = returnType(target.desc); boolean isVoid = returnType.equals(Type.VOID_TYPE); int callbackVar = ASMUtils.getFreeVarIndex(target); //The return value has to be stored locally. We just take the callbackVar + 1 since callbackVar is the last element on the variable table int returnVar = callbackVar + 1; InsnList instructions = this.getLoadInstructions(target, hasArgs); this.createCallback(instructions, cancellable, hasCallback, callbackVar, returnType, returnVar); this.callInjectionMethod(instructions, classNode, target, source, transformerMethodCalls); this.getCancelInstructions(instructions, cancellable, hasCallback, callbackVar, returnType, returnVar); if (!isVoid && hasCallback) { instructions.insert(new VarInsnNode(ASMUtils.getStoreOpcode(returnType), returnVar)); //If the method is not a void, store the return value if (!cancellable) instructions.add(new VarInsnNode(ASMUtils.getLoadOpcode(returnType), returnVar)); } return instructions; }", "tokens": 268} {"id": 353787, "source": "method", "repo": "lenni0451/classtransform", "text": "private String stripPackage(final String className) { if (className.contains(\".\")) return className.substring(className.lastIndexOf(\".\") + 1); return className; }", "tokens": 36} {"id": 353865, "source": "method", "repo": "lenni0451/classtransform", "text": "/** Iterate through all invisible annotations in a {@link FieldNode}. @param fieldNode The field node to iterate through @param annotationConsumer The consumer to consume the annotations */ public static void forEachInvisible(final FieldNode fieldNode, final Consumer annotationConsumer) { if (fieldNode.invisibleAnnotations != null) { for (AnnotationNode annotation : fieldNode.invisibleAnnotations) annotationConsumer.accept(annotation); } }", "tokens": 89} {"id": 353963, "source": "method", "repo": "lenni0451/classtransform", "text": "/** Check if the given class is protected and should not be transformed/loaded by this class loader. @param className The name of the class to check @return If the class is protected */ public boolean isProtected(final String className) { for (String protectedPackage : this.protectedPackages) { if (className.startsWith(protectedPackage)) { for (String protectionException : this.protectionExceptions) { if (className.startsWith(protectionException)) return false; } return true; } } return false; }", "tokens": 106} {"id": 354103, "source": "method", "repo": "lenni0451/classtransform", "text": "public void redirectVirtualInvoke() { ClassNode transformer = this.getTransformerClass(\"net.lenni0451.classtransform.transformer.impl.CRedirectAnnotationHandlerTest$VInvokeTestTransformer\"); this.transformer.transform(this.transformerManager, this.virtualCalculatorClass, transformer); Class clazz = TestClassLoader.load(this.virtualCalculatorClass); Object instance = assertDoesNotThrow(() -> clazz.getDeclaredConstructor().newInstance()); int rint = assertDoesNotThrow(() -> (int) clazz.getDeclaredMethod(\"rint\").invoke(instance)); assertEquals(rint, 1234); }", "tokens": 130} {"id": 354378, "source": "method", "repo": "LeoMinecraftModding/eternal-starlight", "text": "public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { this.root().getAllParts().forEach(ModelPart::resetPose); this.animate(entity.idleAnimationState, CreteorAnimation.IDLE, ageInTicks); rotator.xRot = -90 * Mth.DEG_TO_RAD; rotator.zRot = 90 * Mth.DEG_TO_RAD; rotator.yRot = -(Mth.rotLerp(Mth.frac(ageInTicks), entity.prevRollAngle, entity.rollAngle) + 90) * Mth.DEG_TO_RAD; if (entity.getSwell() >= 80) { root.yRot = Mth.lerp(Mth.frac(ageInTicks), entity.prevSpin, entity.spin) * Mth.DEG_TO_RAD; } }", "tokens": 193} {"id": 354403, "source": "method", "repo": "LeoMinecraftModding/eternal-starlight", "text": "public Vector4f getColor(float progress) { return new Vector4f(red.calculate(progress), green.calculate(progress), blue.calculate(progress), alpha.calculate(progress)); }", "tokens": 42} {"id": 354775, "source": "method", "repo": "LeoMinecraftModding/eternal-starlight", "text": "protected void onHit(HitResult hitResult) { super.onHit(hitResult); if (!level().isClientSide && hitResult.getType() != HitResult.Type.MISS && (target == null || level().getEntitiesOfClass(Entity.class, getBoundingBox().inflate(2.5)).contains(target))) { explode(); } }", "tokens": 71} {"id": 354844, "source": "method", "repo": "LeoMinecraftModding/eternal-starlight", "text": "public Container getContainer() { return container; }", "tokens": 11} {"id": 355014, "source": "method", "repo": "LeoMinecraftModding/eternal-starlight", "text": "protected void nineBlockStorageCustomPacking(RecipeOutput recipeOutput, RecipeCategory unpackCategory, ItemLike unpacked, RecipeCategory packCategory, ItemLike packed, String packName, String packGroup) { nineBlockStorage(recipeOutput, unpackCategory, unpacked, packCategory, packed, packName, packGroup, getSimpleRecipeName(unpacked), null); }", "tokens": 76} {"id": 355156, "source": "method", "repo": "leonmangler/supervanish", "text": "public void showPlayer(Player player) { plugin.getVisibilityChanger().showPlayer(player); }", "tokens": 22} {"id": 355173, "source": "method", "repo": "leonmangler/supervanish", "text": "public RecreateFiles(SuperVanish plugin) { super(plugin); }", "tokens": 15} {"id": 355192, "source": "method", "repo": "leonmangler/supervanish", "text": "private boolean fileRequiresRecreation(String currentVersion, boolean isSettingsFile) { if (currentVersion == null) return true; for (String ignoredVersion : isSettingsFile ? NON_REQUIRED_SETTINGS_UPDATES : NON_REQUIRED_MESSAGES_UPDATES) { if (currentVersion.equalsIgnoreCase(ignoredVersion)) return false; } return true; }", "tokens": 77} {"id": 355267, "source": "method", "repo": "leonmangler/supervanish", "text": "public void onJoin(final PlayerJoinEvent e) { if (plugin.getVanishStateMgr().isVanished(e.getPlayer().getUniqueId())) new BukkitRunnable() { @Override public void run() { setCantPush(e.getPlayer()); } }.runTaskLater(plugin, 5); }", "tokens": 60} {"id": 355303, "source": "method", "repo": "leonmangler/supervanish", "text": "public void onNPCTarget(NPCSpeechEvent e) { e.setCancelled(!checkContext(e.getContext())); }", "tokens": 25} {"id": 355380, "source": "method", "repo": "leonmangler/supervanish", "text": "public static void checkNotNull(Object... objects) { checkNotNull(null, objects); }", "tokens": 20} {"id": 355478, "source": "method", "repo": "lgooddatepicker/lgooddatepicker", "text": "/** setSettings, This will set the settings instance for this calendar panel. The previous settings will be deleted. Note that calling this function effectively re-initializes the picker component. All aspects of the component will be changed to match the provided settings. Any currently selected date will not be changed by this function. */ public void setSettings(DatePickerSettings datePickerSettings) { // If no settings were supplied, then create a default settings instance. if (datePickerSettings == null) { datePickerSettings = new DatePickerSettings(); } // Save the settings. this.settings = datePickerSettings; // If this is an independent calendar panel, store the parent calendar panel in the // settings instance. if (isIndependentCalendarPanel) { settings.zSetParentCalendarPanel(this); } // If no date is selected, then apply the default displayedYearMonth from settings. if (displayedSelectedDate == null) { displayedYearMonth = settings.zGetDefaultYearMonthAsUsed(); } // Apply the border properties settings. // This is applied regardless of whether the calendar panel was created by a date picker, // or as an independent calendar panel. zApplyBorderPropertiesList(); // Set the label indicators to their default states. zSetAllLabelIndicatorColorsToDefaultState(); // If this is an an independent calendar panel, apply needed settings. // At the time of this writing, the \"applied needed settings\" included: // allow empty dates. if (isIndependentCalendarPanel) { // Note: CalendarPanel.zApplyBorderPropertiesList() is called from the calendar panel // constructor so it will be run both for independent and date picker calendar panels. settings.zApplyAllowEmptyDates(); } // Apply the button visibility settings to the buttons. zApplyVisibilityOfButtons(); // Redraw the calendar. drawCalendar(); }", "tokens": 367} {"id": 355597, "source": "method", "repo": "lgooddatepicker/lgooddatepicker", "text": "/** setFontVetoedDate, This sets the text field text font for vetoed dates. The default font crosses out the vetoed date. (Has a strikethrough font attribute.) */ public void setFontVetoedDate(Font fontVetoedDate) { this.fontVetoedDate = fontVetoedDate; }", "tokens": 69} {"id": 355824, "source": "method", "repo": "lgooddatepicker/lgooddatepicker", "text": "/** main, This is the entry point for the demo. */ public static void main(String[] args) { // Initialize the form components. initializeComponents(); // Create a calendar panel. DatePickerSettings settings = new DatePickerSettings(); CalendarPanel calendarPanel = new CalendarPanel(settings); // Add a calendar selection listener to the CalendarPanel. calendarPanel.addCalendarListener(new SampleCalendarListener()); // Add the CalendarPanel to the form. container.add(calendarPanel); // Display the frame. frame.setVisible(true); }", "tokens": 109} {"id": 355843, "source": "method", "repo": "lgooddatepicker/lgooddatepicker", "text": "/** getNewDate, Returns the new selected date. */ public LocalDate getNewDate() { return newDate; }", "tokens": 25} {"id": 355889, "source": "method", "repo": "lgooddatepicker/lgooddatepicker", "text": "/** getMostCommonElementInList, This returns the most common element in the supplied list. In the event of a tie, any element that is tied as the \"largest element\" may be returned. If the list has no elements, or if the list is null, then this will return null. This can also return null if null happens to be the most common element in the source list. */ public static T getMostCommonElementInList(List sourceList) { if (sourceList == null || sourceList.isEmpty()) { return null; } Map hashMap = new HashMap<>(); for (T element : sourceList) { Integer countOrNull = hashMap.get(element); int newCount = (countOrNull == null) ? 1 : (countOrNull + 1); hashMap.put(element, newCount); } // Find the largest entry. // In the event of a tie, the first entry (the first entry in the hash map, not in the list) // with the maximum count will be returned. Entry largestEntry = null; for (Entry currentEntry : hashMap.entrySet()) { if (largestEntry == null || currentEntry.getValue() > largestEntry.getValue()) { largestEntry = currentEntry; } } T result = (largestEntry == null) ? null : largestEntry.getKey(); return result; }", "tokens": 304} {"id": 356035, "source": "method", "repo": "lgooddatepicker/lgooddatepicker", "text": "/** Indicates whether some other BoundedSize is \"equal to\" this one. @param object the object with which to compare @return {@code true} if this object is the same as the object argument, {@code false} otherwise. @see Object#hashCode() @see java.util.Hashtable */ public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof BoundedSize)) { return false; } BoundedSize size = (BoundedSize) object; return basis.equals(size.basis) && (lowerBound == null && size.lowerBound == null || lowerBound != null && lowerBound.equals(size.lowerBound)) && (upperBound == null && size.upperBound == null || upperBound != null && upperBound.equals(size.upperBound)); }", "tokens": 169} {"id": 356172, "source": "method", "repo": "lgooddatepicker/lgooddatepicker", "text": "private static boolean isConstant(Size aSize) { return aSize instanceof ConstantSize || aSize instanceof PrototypeSize; }", "tokens": 27} {"id": 356255, "source": "method", "repo": "lgooddatepicker/lgooddatepicker", "text": "/** Computes and returns the average character width of the specified test string using the given FontMetrics. The test string shall represent an \"average\" text. @param metrics used to compute the test string's width @param testString the string that shall represent an \"average\" text @return the test string's average character width. */ protected double computeAverageCharWidth(FontMetrics metrics, String testString) { int width = metrics.stringWidth(testString); double average = (double) width / testString.length(); // System.out.println(\"Average width of '\" + testString + \"'=\" + average); return average; }", "tokens": 134} {"id": 356295, "source": "method", "repo": "lgooddatepicker/lgooddatepicker", "text": "public ConstantSize getLinePad() { return LINE_PAD; }", "tokens": 15} {"id": 356307, "source": "method", "repo": "lgooddatepicker/lgooddatepicker", "text": "public static java.lang.reflect.Method accessPrivateMethod( Class clazz, String method, Class... argclasses) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { java.lang.reflect.Method private_method = clazz.getDeclaredMethod(method, argclasses); private_method.setAccessible(true); return private_method; }", "tokens": 71} {"id": 356435, "source": "method", "repo": "li2109/langtorch", "text": "public static CohereAIApi buildApi(CohereAIServiceConfig config) { Objects.requireNonNull(config.apiKey(), \"Cohere token required\"); OkHttpClient client = defaultClient(config.apiKey(), config.timeoutDuration()); Retrofit retrofit = defaultRetrofit(client, gson); return retrofit.create(CohereAIApi.class); }", "tokens": 69} {"id": 356444, "source": "method", "repo": "li2109/langtorch", "text": "public static Builder builder() { return new AutoValue_CohereGenerateRequest.Builder() .model(DEFAULT_MODEL) .numGenerations(1) .maxTokens(20) .preset(\"\") .temperature(0.0) .k(0) .p(0.0) .frequencyPenalty(0.0) .presencePenalty(0.0) .endSequences(new ArrayList<>()) .stopSequences(new ArrayList<>()) .logitBias(new HashMap<>()) .returnLikelihoods(\"NONE\") .truncate(\"END\"); }", "tokens": 129} {"id": 356703, "source": "method", "repo": "li2109/langtorch", "text": "public Optional getExpireAfterAccess() { return Optional.ofNullable(expireAfterAccess); }", "tokens": 22} {"id": 356819, "source": "method", "repo": "li2109/langtorch", "text": "public static String getGroupId(FluentLogger logger, Environment environment) { return getGroupId(Optional.ofNullable(logger), environment); }", "tokens": 28} {"id": 356832, "source": "method", "repo": "li2109/langtorch", "text": "public long getDelayMillis(int retryCount, long intervalMillis) { return intervalMillis * fibonacci(retryCount); }", "tokens": 27} {"id": 356930, "source": "method", "repo": "li2109/langtorch", "text": "void testAnnotationBasedPromptTemplateMissingAnnotation() { // Arrange class NoAnnotation { public String name = \"Jane\"; public String age = \"30\"; } NoAnnotation noAnnotation = new NoAnnotation(); // Act and Assert assertThrows( IllegalArgumentException.class, () -> PromptProcessor.createPromptTemplate(NoAnnotation.class, noAnnotation)); }", "tokens": 72} {"id": 356967, "source": "method", "repo": "li2109/langtorch", "text": "void testUpdateDocuments() { EmbeddingOutput embeddingOutput = EmbeddingOutput.of(EmbeddingType.OPEN_AI, getEmbeddings()); Mockito.when(embeddingProcessor.run(ArgumentMatchers.any())).thenReturn(embeddingOutput); ListenableFuture future = Futures.immediateFuture(new UpdateResponse()); Mockito.when(pineconeService.updateAsync(ArgumentMatchers.any())).thenReturn(future); // Act. boolean isSuccess = pineconeVectorStore.updateDocuments(getDocuments()); // Assert. assertThat(isSuccess).isTrue(); }", "tokens": 113} {"id": 357106, "source": "method", "repo": "linlinjava/litemall", "text": "/** This method was generated by MyBatis Generator. This method corresponds to the database table litemall_admin @mbg.generated */ public Criteria andPasswordGreaterThanOrEqualToColumn(LitemallAdmin.Column column) { addCriterion(new StringBuilder(\"`password` >= \").append(column.getEscapedColumnName()).toString()); return (Criteria) this; }", "tokens": 68} {"id": 357149, "source": "method", "repo": "linlinjava/litemall", "text": "/** This method was generated by MyBatis Generator. This method corresponds to the database table litemall_brand @mbg.generated */ public Criteria andAddTimeLessThanColumn(LitemallBrand.Column column) { addCriterion(new StringBuilder(\"add_time < \").append(column.getEscapedColumnName()).toString()); return (Criteria) this; }", "tokens": 68} {"id": 357218, "source": "method", "repo": "linlinjava/litemall", "text": "public Criteria andUpdateTimeLessThan(LocalDateTime value) { addCriterion(\"update_time <\", value, \"updateTime\"); return (Criteria) this; }", "tokens": 33} {"id": 357248, "source": "method", "repo": "linlinjava/litemall", "text": "public Criteria andUpdateTimeBetween(LocalDateTime value1, LocalDateTime value2) { addCriterion(\"update_time between\", value1, value2, \"updateTime\"); return (Criteria) this; }", "tokens": 42} {"id": 357610, "source": "method", "repo": "linlinjava/litemall", "text": "public int update(LitemallCouponUser couponUser) { couponUser.setUpdateTime(LocalDateTime.now()); return couponUserMapper.updateByPrimaryKeySelective(couponUser); }", "tokens": 37} {"id": 357649, "source": "method", "repo": "lisawray/groupie", "text": "private Group makeCarouselGroup() { CarouselItemDecoration carouselDecoration = new CarouselItemDecoration(gray, betweenPadding); GroupieAdapter carouselAdapter = new GroupieAdapter(); for (int i = 0; i < 10; i++) { carouselAdapter.add(new CarouselCardItem(rainbow200[i])); } return new CarouselGroup(carouselDecoration, carouselAdapter); }", "tokens": 96} {"id": 357684, "source": "method", "repo": "lisawray/groupie", "text": "private void animateProgress(ItemHeartCardBinding binding) { binding.favorite.setImageResource(R.drawable.avd_favorite_progress); ((Animatable) binding.favorite.getDrawable()).start(); }", "tokens": 44} {"id": 357840, "source": "method", "repo": "lisawray/groupie", "text": "public Map getExtras() { return item.getExtras(); }", "tokens": 20} {"id": 358018, "source": "method", "repo": "lisawray/groupie", "text": "public void testGroupCountForRemoveAll() { ExpandableGroup expandableGroup = new ExpandableGroup(parent); List items = createDummyItems(); expandableGroup.addAll(items); expandableGroup.registerGroupDataObserver(groupAdapter); expandableGroup.removeAll(items); expandableGroup.onToggleExpanded(); assertEquals(1, expandableGroup.getGroupCount()); }", "tokens": 66} {"id": 358128, "source": "method", "repo": "liuzhihang/doc-view", "text": "public void actionPerformed(@NotNull AnActionEvent e) { super.actionPerformed(e); }", "tokens": 19} {"id": 358367, "source": "method", "repo": "liuzhihang/doc-view", "text": "protected String getTestDataPath() { return Path.of(\"src/test/testData\").toAbsolutePath().toString(); }", "tokens": 24} {"id": 358585, "source": "method", "repo": "llamalad7/mixinextras", "text": "public FlowValue mergeWith(FlowValue other, FlowContext ctx) { if (this.equals(other)) { return this; } if (other instanceof ComplexFlowValue) { return other.mergeWith(this, ctx); } if (this.isTypeKnown() && other.isTypeKnown()) { return new DummyFlowValue(ExpressionASMUtils.getCommonSupertype(ctx, getType(), other.getType())); } return new ComplexFlowValue(getSize(), new HashSet<>(Arrays.asList(this, other)), ctx); }", "tokens": 106} {"id": 358722, "source": "method", "repo": "llamalad7/mixinextras", "text": "public static Type getInnerType(Type arrayType) { if (arrayType.equals(BOTTOM_TYPE)) { return BOTTOM_TYPE; } return Type.getType(arrayType.getDescriptor().substring(1)); }", "tokens": 47} {"id": 358753, "source": "method", "repo": "llamalad7/mixinextras", "text": "private void gatherDefinitions(RoundEnvironment roundEnv) { for (Element elem : roundEnv.getElementsAnnotatedWith(Definition.class)) { AnnotationHandle def = AnnotationHandle.of(elem, Definition.class); registerDefinition(elem, def); } for (Element elem : roundEnv.getElementsAnnotatedWith(Definitions.class)) { AnnotationHandle defs = AnnotationHandle.of(elem, Definitions.class); for (AnnotationHandle def : defs.getAnnotationList(\"value\")) { registerDefinition(elem, def); } } }", "tokens": 110} {"id": 358772, "source": "method", "repo": "llamalad7/mixinextras", "text": "public MixinExtrasConfig(String configName, MixinExtrasConfig parent, String minVersion) { this.configName = configName; this.parent = parent; this.minVersionString = minVersion; this.minVersion = minVersion != null ? determineMinVersion() : parent != null ? parent.minVersion : null; }", "tokens": 70} {"id": 358806, "source": "method", "repo": "llamalad7/mixinextras", "text": "protected Type replaceIntLike(InjectionInfo info, Type desc, Type replacement) { if (!ExpressionASMUtils.isIntLike(replacement)) { throw CompatibilityHelper.makeInvalidInjectionException( info, String.format( \"Expected int-like type (boolean, byte, char, short, int), got %s\", replacement ) ); } Type returnType = desc.getReturnType(); if (returnType.equals(ExpressionASMUtils.INTLIKE_TYPE)) { returnType = replacement; } Type[] args = Arrays.stream(desc.getArgumentTypes()) .map(it -> it.equals(ExpressionASMUtils.INTLIKE_TYPE) ? replacement : it) .toArray(Type[]::new); return Type.getMethodType(returnType, args); }", "tokens": 155} {"id": 358838, "source": "method", "repo": "llamalad7/mixinextras", "text": "public void invokeHandler(Type valueType, InsnList after, StackExtension stack) { LabelNode originalJumpTarget = null; if (isStringConcat) { // We copy the StringBuilder, build it, let the user modify the String, and then replace the // contents of the StringBuilder with what they returned. after.add(new InsnNode(Opcodes.DUP)); stack.extra(1); after.add(new MethodInsnNode( Opcodes.INVOKEVIRTUAL, Type.getInternalName(StringBuilder.class), \"toString\", Bytecode.generateDescriptor(String.class), false )); } else if (comparison != null) { originalJumpTarget = comparison.getJumpTarget(target); ASMUtils.ifElse( after, label -> comparison.getJumpInsn(target).label = label, () -> after.add(new InsnNode(comparison.jumpOnTrue ? Opcodes.ICONST_0 : Opcodes.ICONST_1)), () -> after.add(new InsnNode(comparison.jumpOnTrue ? Opcodes.ICONST_1 : Opcodes.ICONST_0)) ); } ModifyExpressionValueInjector.this.invokeHandler(valueType, target, after, stack); if (isStringConcat) { after.add( new MethodInsnNode( Opcodes.INVOKESTATIC, Type.getInternalName(MixinExtrasHooks.class), \"replaceContents\", Bytecode.generateDescriptor(StringBuilder.class, StringBuilder.class, String.class), false ) ); } else if (comparison != null) { after.add(new JumpInsnNode(comparison.jumpOnTrue ? Opcodes.IFNE : Opcodes.IFEQ, originalJumpTarget)); } }", "tokens": 330} {"id": 358913, "source": "method", "repo": "llamalad7/mixinextras", "text": "String getName() { return ((MethodInsnNode) currentTarget).name; }", "tokens": 17} {"id": 359217, "source": "method", "repo": "ln-zap/zap-android", "text": "public void onExistingInvoiceUpdated(Invoice invoice) { // This has to happen on the UI thread. Only this thread can change the UI. runOnUiThread(new Runnable() { public void run() { // Check if the invoice was payed if (Wallet.getInstance().isInvoicePayed(invoice)) { // The updated invoice is payed, now check if it is the invoice whe currently have opened. if (invoice.getAddIndex() == mLnInvoiceAddIndex) { // It was payed, show success screen mFinishedAmount.setText(MonetaryUtil.getInstance().getPrimaryDisplayAmountAndUnit(invoice.getAmtPaidSat())); mClPaymentReceivedView.setVisibility(View.VISIBLE); mClRequestView.setVisibility(View.GONE); } } } }); }", "tokens": 163} {"id": 359754, "source": "method", "repo": "ln-zap/zap-android", "text": "public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) { NodeItemViewHolder nodeViewHolder = (NodeItemViewHolder) holder; ZapNodeConfig remoteNodeItem = mItems.get(position); nodeViewHolder.bindRemoteNodeItem(remoteNodeItem); }", "tokens": 57} {"id": 360129, "source": "method", "repo": "loiane/crud-angular-spring", "text": "CommandLineRunner initDatabase(CourseRepository courseRepository) { return args -> seedDatabase(courseRepository); }", "tokens": 22} {"id": 360273, "source": "method", "repo": "loiane/crud-angular-spring", "text": "void testCascadeOperations() { // Given - Create course with lessons Course course = createCourseWithLessons(\"Course with Lessons\", Category.BACK_END); // When - Save course (should cascade to lessons) Course savedCourse = courseRepository.save(course); // Then - Lessons should be saved assertThat(savedCourse.getLessons()).hasSize(2); savedCourse.getLessons().forEach(lesson -> assertTrue(lesson.getId() > 0)); // When - Delete course courseRepository.delete(savedCourse); entityManager.flush(); // Then - Lessons should also be soft deleted (status-based deletion) // Note: This depends on the specific cascade configuration in the entity }", "tokens": 156} {"id": 360343, "source": "method", "repo": "lothrazar/cyclic", "text": "public boolean shouldDisplayFluidOverlay(BlockState state, BlockAndTintGetter world, BlockPos pos, FluidState fluidState) { return true; }", "tokens": 28} {"id": 360360, "source": "method", "repo": "lothrazar/cyclic", "text": "public TileAnvilVoid(BlockPos pos, BlockState state) { super(TileRegistry.ANVILVOID.get(), pos, state); this.needsRedstone = 0; }", "tokens": 36} {"id": 360412, "source": "method", "repo": "lothrazar/cyclic", "text": "public TileCableBundled(BlockPos pos, BlockState state) { super(TileRegistry.BUNDLED_PIPE.get(), pos, state); this.setIsEnergy(); this.setIsItem(); this.setIsFluid(); }", "tokens": 46} {"id": 360482, "source": "method", "repo": "lothrazar/cyclic", "text": "public ScreenDetectorItem(ContainerDetectorItem screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); this.imageHeight = 214; }", "tokens": 41} {"id": 360602, "source": "method", "repo": "lothrazar/cyclic", "text": "public boolean isItemValid(int slot, ItemStack stack) { return true; // stack.isFood(); }", "tokens": 24} {"id": 360721, "source": "method", "repo": "lothrazar/cyclic", "text": "public Sound getSound() { return sound.getSound(); }", "tokens": 13} {"id": 360822, "source": "method", "repo": "lothrazar/cyclic", "text": "public static int scoreboardRng(CommandContext x, Collection scoreHolderTargets, Objective objective, int min, int max) { Scoreboard scoreboard = x.getSource().getServer().getScoreboard(); int i = 0; for (ScoreHolder holder : scoreHolderTargets) { ScoreAccess score = scoreboard.getOrCreatePlayerScore(holder, objective); if (min < max) { score.set(CommandRegistry.RAND.nextInt(min, max)); } else { score.set(min); } i += score.get(); } return i; }", "tokens": 124} {"id": 360896, "source": "method", "repo": "lothrazar/cyclic", "text": "public OreProspector(Properties properties) { super(properties); }", "tokens": 17} {"id": 360967, "source": "method", "repo": "lothrazar/cyclic", "text": "public void init() { super.init(); int x = leftPos + 150; int y = topPos + 8; int size = 20; btnType = this.addRenderableWidget(new ButtonTextured(x, y, size, size, TextureEnum.RENDER_HIDE, \"\", b -> { PacketDistributor.sendToServer(new PacketFluidFilterCard(PacketFluidFilterCard.TOGGLE_IGNORE)); FluidFilterCardItem.toggleFilterType(screenContainer.bag); })); size=14; btnTagMatch = this.addRenderableWidget(new ButtonTextured(x+3, topPos + 51, size, size, TextureEnum.CRAFT_EMPTY, \"\", b -> { PacketDistributor.sendToServer(new PacketFluidFilterCard(PacketFluidFilterCard.TOGGLE_TAGMATCH)); FluidFilterCardItem.toggleTagMatch(screenContainer.bag); })); }", "tokens": 183} {"id": 361033, "source": "method", "repo": "lothrazar/cyclic", "text": "public ItemMobContainer(Properties properties) { super(properties); }", "tokens": 15} {"id": 361203, "source": "method", "repo": "low-drag-mc/shimmer", "text": "/** helper method for drawing suggestion background */ private void fillSuggestionBackground(GuiGraphics guiGraphics, int minY, int height, int color) { guiGraphics.fill(getX(), minY, getX() + width, minY + height, color); }", "tokens": 49} {"id": 361213, "source": "method", "repo": "low-drag-mc/shimmer", "text": "public void remove() { if (lightManager != null) { lightManager.removeLight(this); lightManager = null; } }", "tokens": 29} {"id": 361237, "source": "method", "repo": "low-drag-mc/shimmer", "text": "public static int getTotalLightCount() { return getTotalNoUVLightCount() + getTotalUVLightCount(); }", "tokens": 23} {"id": 361310, "source": "method", "repo": "low-drag-mc/shimmer", "text": "public static PostProcessing getPost(String name) { return POST_PROCESSING_MAP.get(name); }", "tokens": 24} {"id": 361359, "source": "method", "repo": "low-drag-mc/shimmer", "text": "public ProxyTarget(boolean useDepth) { super(useDepth); }", "tokens": 16} {"id": 361668, "source": "method", "repo": "low-drag-mc/shimmer", "text": "public static ForgeConfigSpec.IntValue getUboOffset() { if (UBO_OFFSET == null) { logAccessUnInit(\"UBO_OFFSET\"); registerConfig(); } return UBO_OFFSET; }", "tokens": 45} {"id": 362096, "source": "method", "repo": "ls1intum/artemis", "text": "/** downloads all repos of the exercise and runs JPlag @param programmingExerciseId the id of the programming exercises which should be checked @param similarityThreshold ignore comparisons whose similarity is below this threshold (in % between 0 and 100) @param minimumScore consider only submissions whose score is greater or equal to this value @param minimumSize consider only submissions whose number of lines in diff to template is greater or equal to this value @return a zip file that can be returned to the client */ public File checkPlagiarismWithJPlagReport(long programmingExerciseId, float similarityThreshold, int minimumScore, int minimumSize) { long start = System.nanoTime(); final var programmingExercise = programmingExerciseRepository.findByIdWithTemplateAndSolutionParticipationElseThrow(programmingExerciseId); JPlagResult result = computeJPlagResult(programmingExercise, similarityThreshold, minimumScore, minimumSize); log.info(\"JPlag programming comparison finished with {} comparisons in {}\", result.getAllComparisons().size(), TimeLogUtil.formatDurationFrom(start)); return generateJPlagReportZip(result, programmingExercise); }", "tokens": 240} {"id": 362183, "source": "method", "repo": "ls1intum/artemis", "text": "/** Creates (or reuses) a User with tutor authorities and immediately enrolls them in the given course via {@code user_course_role}. @param login The login of the teaching assistant @param course The course the teaching assistant should be enrolled in @return the saved User with up-to-date course roles loaded */ public User addTeachingAssistantToCourse(final String login, final Course course) { addTeachingAssistant(login); User user = getUserByLogin(login); enrollUserInCourse(user, course, CourseRole.TEACHING_ASSISTANT); return getUserByLogin(login); }", "tokens": 138} {"id": 362505, "source": "method", "repo": "ls1intum/artemis", "text": "private static OnlineUnitDTO onlineUnitDtoForRequest(OnlineUnit onlineUnit) { return new OnlineUnitDTO(onlineUnit.getId(), onlineUnit.getName(), onlineUnit.getReleaseDate(), onlineUnit.getDescription(), onlineUnit.getSource(), null, null); }", "tokens": 58} {"id": 362581, "source": "method", "repo": "ls1intum/artemis", "text": "void shouldReturnCourseNotificationsWhenRequested() { long courseId = 123L; long userId = 1L; Pageable pageable = Pageable.unpaged(); CourseNotification entity = createTestCourseNotificationEntity(1L); CourseNotificationParameter param1 = new CourseNotificationParameter(entity, \"key1\", \"value1\"); CourseNotificationParameter param2 = new CourseNotificationParameter(entity, \"key2\", \"value2\"); PageImpl page = new PageImpl<>(List.of(new CourseNotificationWithStatusDTO(entity.getId(), entity.getCourse().getId(), entity.getType(), entity.getCreationDate(), UserCourseNotificationStatusType.SEEN))); when(courseNotificationRepository.findCourseNotificationsByUserIdAndCourseIdAndStatusNotArchived(userId, courseId, pageable)).thenReturn(page); // The cached read answers with the key and value alone, so that the store never holds the parameter entity. when(courseNotificationParameterRepository.findByCourseNotificationIdEquals(entity.getId())) .thenReturn(Set.of(new CourseNotificationParameterDTO(param1.getKey(), param1.getValue()), new CourseNotificationParameterDTO(param2.getKey(), param2.getValue()))); when(courseNotificationRegistryService.getNotificationClass(any())).thenReturn((Class) TestNotification.class); CourseNotificationPageableDTO result = courseNotificationService.getCourseNotifications(pageable, courseId, userId); assertThat(result).isNotNull(); assertThat(result.content()).hasSize(1); var dto = result.content().getFirst(); assertThat(dto).isNotNull(); assertThat(dto.notificationType()).isEqualTo(\"testNotification\"); assertThat(dto.courseId()).isEqualTo(123L); }", "tokens": 366} {"id": 362590, "source": "method", "repo": "ls1intum/artemis", "text": "void testGetRequestResponse() throws Exception { BuildPlanDTO buildPlan = request.get(\"/api/localci/programming-exercises/\" + programmingExercise.getId() + \"/build-plan/for-editor\", HttpStatus.OK, BuildPlanDTO.class); assertThat(buildPlan.id()).isNotNull(); assertThat(buildPlan.buildPlan()).isEqualTo(\"dummy-build-plan\"); }", "tokens": 80} {"id": 362621, "source": "method", "repo": "ls1intum/artemis", "text": "/** Waits for a specific directory to exist with retry logic. This is crucial for slow CI environments where repository operations may not complete immediately. @param directoryPath the path of the directory to wait for @param description description for logging @throws InterruptedException if interrupted while waiting @throws IllegalStateException if directory does not exist after all retries */ private void waitForDirectoryToExist(Path directoryPath, String description) throws InterruptedException { final int maxRetries = 30; // Increased retries for slow CI final int retryDelayMs = 1000; // 1 second delay (30 seconds total) for (int attempt = 1; attempt <= maxRetries; attempt++) { if (Files.exists(directoryPath) && Files.isDirectory(directoryPath)) { log.info(\"{} found after {} attempt(s) at: {}\", description, attempt, directoryPath); return; } if (attempt < maxRetries) { log.debug(\"{} not found yet (attempt {}/{}), waiting {} ms...\", description, attempt, maxRetries, retryDelayMs); Thread.sleep(retryDelayMs); } } // Log diagnostic information for debugging Path parentDir = directoryPath.getParent(); String diagnosticInfo = \"Parent directory %s exists: %s\".formatted(parentDir, Files.exists(parentDir)); if (Files.exists(parentDir)) { try (Stream files = Files.list(parentDir)) { List dirNames = files.filter(Files::isDirectory).map(Path::getFileName).map(Path::toString).toList(); diagnosticInfo += \", contains %d subdirectories: %s\".formatted(dirNames.size(), dirNames); } catch (IOException e) { diagnosticInfo += \", unable to list parent directory: \" + e.getMessage(); } } log.error(\"{} not found after {} retries. {}\", description, maxRetries, diagnosticInfo); throw new IllegalStateException(\"%s not found at %s after %d attempts. %s\".formatted(description, directoryPath, maxRetries, diagnosticInfo)); }", "tokens": 432} {"id": 362762, "source": "method", "repo": "lsgwr/spring-boot-online-exam", "text": "public ApiResponse meta() { return ApiResponse.ok(service.meta()); }", "tokens": 19} {"id": 362993, "source": "method", "repo": "lucko/helper", "text": "public List getBacking() { return this.objects; }", "tokens": 16} {"id": 363082, "source": "method", "repo": "lucko/helper", "text": "/** Returns a predicate which only returns true if the login is allowed @param the event type @return a predicate which only returns true if the login is allowed */ public static Predicate ignoreDisallowedLogin() { return (Predicate) IGNORE_DISALLOWED_LOGIN; }", "tokens": 72} {"id": 363123, "source": "method", "repo": "lucko/helper", "text": "public SingleSubscriptionBuilder handleSubclasses() { this.handleSubclasses = true; return this; }", "tokens": 23} {"id": 363379, "source": "method", "repo": "lucko/helper", "text": "public Map asMap() { return this.asMap; }", "tokens": 18} {"id": 363700, "source": "method", "repo": "lucko/helper", "text": "public static Vector3d deserialize3d(JsonElement element) { return new Vector3d( element.getAsJsonObject().get(\"x\").getAsDouble(), element.getAsJsonObject().get(\"y\").getAsDouble(), element.getAsJsonObject().get(\"z\").getAsDouble() ); }", "tokens": 53} {"id": 363864, "source": "method", "repo": "luckperms/luckperms", "text": "/** Gets a {@link NodeMatcher} which matches {@link MetaNode}s with the same {@link MetaNode#getMetaKey() meta key}.

The {@link String#equalsIgnoreCase(String)} method is used to test key equality.

@param metaNode the meta node to use for the meta key @return the matcher */ static NodeMatcher metaKey(MetaNode metaNode) { return metaKey(metaNode.getMetaKey()); }", "tokens": 100} {"id": 363975, "source": "method", "repo": "luckperms/luckperms", "text": "protected Plugin checkPlugin(Object plugin) throws IllegalArgumentException { if (plugin instanceof Plugin) { Plugin bungeePlugin = (Plugin) plugin; // add a custom log handler to effectively listen for the plugin being disabled. // BungeeCord doesn't really support enabling/disabling plugins at runtime, and as // such doesn't have a PluginDisableEvent. However, some plugins do exist to reload // plugins at runtime. We rely on these plugins following the BungeeCord behaviour, // and #close ing the plugins logger, so we can unregister the listeners. :) Handler[] handlers = bungeePlugin.getLogger().getHandlers(); for (Handler handler : handlers) { if (handler instanceof UnloadHookLoggerHandler) { return bungeePlugin; } } bungeePlugin.getLogger().addHandler(new UnloadHookLoggerHandler(bungeePlugin)); return bungeePlugin; } throw new IllegalArgumentException(\"Object \" + plugin + \" (\" + plugin.getClass().getName() + \") is not a plugin.\"); }", "tokens": 214} {"id": 364062, "source": "method", "repo": "luckperms/luckperms", "text": "public ApiPlayerAdapter(UserManager userManager, ContextManager contextManager) { this.userManager = userManager; this.contextManager = contextManager; }", "tokens": 40} {"id": 364420, "source": "method", "repo": "luckperms/luckperms", "text": "public void setTypeMap(Map> map) throws SQLException { this.delegate.setTypeMap(map); }", "tokens": 28} {"id": 364469, "source": "method", "repo": "luckperms/luckperms", "text": "public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; VerboseCheckTarget that = (VerboseCheckTarget) o; return this.type.equals(that.type) && this.name.equals(that.name) && Objects.equals(this.id, that.id); }", "tokens": 83} {"id": 364574, "source": "method", "repo": "luckperms/luckperms", "text": "protected void setup() { this.plugin.onLoad(); }", "tokens": 14} {"id": 364963, "source": "method", "repo": "lukflug/panelstudio", "text": "public void init (FMLInitializationEvent event) { Category.init(); Category.OTHER.modules.add(new ClickGUIModule()); Category.OTHER.modules.add(new HUDEditorModule()); Category.HUD.modules.add(new TabGUIModule()); Category.HUD.modules.add(new WatermarkModule()); Category.HUD.modules.add(new LogoModule()); gui=new ClickGUI(); MinecraftForge.EVENT_BUS.register(this); }", "tokens": 102} {"id": 365292, "source": "method", "repo": "lukflug/panelstudio", "text": "public IContainerRenderer getContainerRenderer (int logicalLevel, int graphicalLevel, boolean horizontal) { return new IContainerRenderer() { @Override public void renderBackground (Context context, boolean focus) { if (graphicalLevel==0 && !buttonRainbow.isOn()) renderRainbowRect(context.getRect(),context,focus); } }; }", "tokens": 71} {"id": 365317, "source": "method", "repo": "lukflug/panelstudio", "text": "public ISwitchRenderer getCycleSwitchRenderer (int logicalLevel, int graphicalLevel, boolean container) { return new ISwitchRenderer() { @Override public void renderButton (Context context, String title, boolean focus, String state) { boolean effFocus=container?context.hasFocus():focus; Color colorA=getMainColor(effFocus,true); if (container && effFocus) context.getInterface().fillRect(context.getRect(),colorA,colorA,colorA,colorA); Context subContext=new Context(context,context.getSize().width-2*context.getSize().height,new Point(0,0),true,true); subContext.setHeight(context.getSize().height); Color textColor=(container&&effFocus)?getMainColor(effFocus,false):getFontColor(effFocus); context.getInterface().drawString(new Point(context.getPos().x+padding,context.getPos().y+padding),height,title+separator+state,textColor); Rectangle rect=getOnField(context); subContext=new Context(context,rect.width,new Point(rect.x-context.getPos().x,0),true,true); subContext.setHeight(rect.height); getSmallButtonRenderer(ITheme.RIGHT,logicalLevel,graphicalLevel,container).renderButton(subContext,null,effFocus,null); rect=getOffField(context); subContext=new Context(context,rect.width,new Point(rect.x-context.getPos().x,0),true,true); subContext.setHeight(rect.height); getSmallButtonRenderer(ITheme.LEFT,logicalLevel,graphicalLevel,false).renderButton(subContext,null,effFocus,null); } @Override public int getDefaultHeight() { return getBaseHeight(); } @Override public Rectangle getOnField (Context context) { Rectangle rect=context.getRect(); return new Rectangle(rect.x+rect.width-rect.height,rect.y,rect.height,rect.height); } @Override public Rectangle getOffField (Context context) { Rectangle rect=context.getRect(); return new Rectangle(rect.x+rect.width-2*rect.height,rect.y,rect.height,rect.height); } }; }", "tokens": 482} {"id": 365460, "source": "method", "repo": "lukflug/panelstudio", "text": "public void drawRect (Rectangle r, Color c1, Color c2, Color c3, Color c4) { Tessellator tessellator = Tessellator.getInstance(); WorldRenderer bufferbuilder = tessellator.getWorldRenderer(); bufferbuilder.begin(GL11.GL_LINE_LOOP, DefaultVertexFormats.POSITION_COLOR); bufferbuilder.pos(r.x,r.y+r.height,getZLevel()).color(c4.getRed()/255.0f,c4.getGreen()/255.0f,c4.getBlue()/255.0f,c4.getAlpha()/255.0f).endVertex(); bufferbuilder.pos(r.x+r.width,r.y+r.height,getZLevel()).color(c3.getRed()/255.0f,c3.getGreen()/255.0f,c3.getBlue()/255.0f,c3.getAlpha()/255.0f).endVertex(); bufferbuilder.pos(r.x+r.width,r.y,getZLevel()).color(c2.getRed()/255.0f,c2.getGreen()/255.0f,c2.getBlue()/255.0f,c2.getAlpha()/255.0f).endVertex(); bufferbuilder.pos(r.x,r.y,getZLevel()).color(c1.getRed()/255.0f,c1.getGreen()/255.0f,c1.getBlue()/255.0f,c1.getAlpha()/255.0f).endVertex(); tessellator.draw(); }", "tokens": 379} {"id": 365717, "source": "method", "repo": "LunaDeerMC/Dominion", "text": "protected Set columns(Connection connection, String tableName) throws SQLException { Set columns = new HashSet<>(); DatabaseMetaData metaData = connection.getMetaData(); try (ResultSet rs = metaData.getColumns(catalog(connection), schema(connection), tableName, \"%\")) { while (rs.next()) { columns.add(rs.getString(\"COLUMN_NAME\").toLowerCase(Locale.ROOT)); } } if (columns.isEmpty() && type == DatabaseType.SQLITE) { try (Statement statement = connection.createStatement(); ResultSet rs = statement.executeQuery(\"PRAGMA table_info(\" + tableName + \")\")) { while (rs.next()) { columns.add(rs.getString(\"name\").toLowerCase(Locale.ROOT)); } } } return columns; }", "tokens": 159} {"id": 365842, "source": "method", "repo": "LunaDeerMC/Dominion", "text": "private void addTemplates(Player player, DialogRoute route, DominionDTO dominion, List entries) { for (TemplateDTO template : TemplateProvider.getInstance() .getTemplates(player.getUniqueId())) { entries.add(new PickerEntry(template.getName(), config.text(\"labels.template\"), false, false, () -> { MemberDTO member = requireMember(dominion, route.integer(\"member\")); ui.submit(player, TemplateProvider.getInstance() .applyTemplate(player, dominion, member, template), ignored -> nav.back(player)); }, null, null)); } }", "tokens": 130} {"id": 366093, "source": "method", "repo": "LunaDeerMC/Dominion", "text": "private void finish() throws Exception { for(Entity e:entities)e.remove(); dom.setGuestFlagValue(Flags.CUSHION_PLACE,true);dom.setGuestFlagValue(Flags.CUSHION_BREAK,true); dom.setEnvFlagValue(Flags.CUSHION_MOB_DAMAGE,true);dom.setEnvFlagValue(Flags.CUSHION_ENVIRONMENT_BREAK,true); getConfig().set(\"claim\",dom.getName());saveConfig();summary(); }", "tokens": 107} {"id": 366140, "source": "method", "repo": "LunaDeerMC/Dominion", "text": "public void handler(PlayerInteractEvent event) { if (event.isCancelled() || event.getAction() != Action.RIGHT_CLICK_BLOCK) return; Block block = event.getClickedBlock(); if (block == null || !Tag.TRAPDOORS.isTagged(block.getType())) return; Player player = event.getPlayer(); checkPrivilegeFlag(block.getLocation(), Flags.TRAPDOOR, player, event); }", "tokens": 91} {"id": 366206, "source": "method", "repo": "LunaDeerMC/Dominion", "text": "/** Create teleport packet using the 1.21.2+ PositionMoveRotation format. */ private ClientboundTeleportEntityPacket createTeleportPacket() { PositionMoveRotation positionMoveRotation = new PositionMoveRotation( new Vec3(location.getX(), location.getY(), location.getZ()), Vec3.ZERO, location.getYaw(), location.getPitch() ); return new ClientboundTeleportEntityPacket( entityId, positionMoveRotation, Set.of(), false ); }", "tokens": 93} {"id": 366287, "source": "method", "repo": "LunarClient/Apollo", "text": "/** Converts a {@link Location} to an {@link ApolloBlockLocation} object. @param location the location @return the converted apollo block location object @since 1.0.0 */ public static ApolloBlockLocation toApolloBlockLocation(@NonNull Location location) { return ApolloBlockLocation.builder() .world(location.getWorld().getName()) .x(location.getBlockX()) .y(location.getBlockY()) .z(location.getBlockZ()) .build(); }", "tokens": 105} {"id": 366294, "source": "method", "repo": "LunarClient/Apollo", "text": "/** Converts a {@link Entity} to an {@link ApolloEntity} object. @param entity the entity @return the converted apollo entity object @since 1.1.8 */ public static ApolloEntity toApolloEntity(@NonNull Entity entity) { return new ApolloEntity(entity.getEntityId(), entity.getUniqueId()); }", "tokens": 66} {"id": 366375, "source": "method", "repo": "LunarClient/Apollo", "text": "protected ChatModule() { this.registerOptions( ChatModule.BROADCAST_LIVE_BUTTONS, ChatModule.SEND_DEFAULT_BUTTONS, ChatModule.DEFAULT_BUTTONS ); }", "tokens": 41} {"id": 366449, "source": "method", "repo": "LunarClient/Apollo", "text": "private LiveButton createLiveButton(ApolloButtonContent content, @Nullable ApolloButtonTooltip tooltip, long now) { long contentInterval = 0L; for (ApolloButtonContentPart part : content.getParts()) { if (!(part instanceof LiveComponentPart)) { continue; } LiveComponentPart livePart = (LiveComponentPart) part; long interval = this.millisToTicks(livePart.getUpdateInterval()); if (contentInterval == 0L || interval < contentInterval) { contentInterval = interval; } } Duration tooltipUpdateInterval = tooltip != null ? tooltip.getUpdateInterval() : null; long tooltipInterval = tooltipUpdateInterval != null ? this.millisToTicks(tooltipUpdateInterval) : 0L; return new LiveButton(content, tooltip, contentInterval, tooltipInterval, now); }", "tokens": 163} {"id": 366670, "source": "method", "repo": "LunarClient/Apollo", "text": "public void resetBordersExample(Player viewer) { Optional apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId()); apolloPlayerOpt.ifPresent(this.borderModule::resetBorders); }", "tokens": 41} {"id": 366946, "source": "method", "repo": "LunarClient/Apollo", "text": "public static void enableModules(Player player) { JsonArray settings = APOLLO_MODULES.stream() .map(module -> JsonPacketUtil.createEnableModuleObject(module, CONFIG_MODULE_PROPERTIES.row(module))) .collect(JsonArray::new, JsonArray::add, JsonArray::addAll); JsonObject message = new JsonObject(); message.addProperty(\"@type\", \"type.googleapis.com/lunarclient.apollo.configurable.v1.OverrideConfigurableSettingsMessage\"); message.add(\"configurable_settings\", settings); JsonPacketUtil.sendPacket(player, message); }", "tokens": 121} {"id": 367019, "source": "method", "repo": "LunarClient/Apollo", "text": "public void resetInventoryButtonsExample(Player viewer) { ResetInventoryButtonsMessage message = ResetInventoryButtonsMessage.getDefaultInstance(); ProtobufPacketUtil.sendPacket(viewer, message); UUID playerIdentifier = viewer.getUniqueId(); this.staffViewers.remove(playerIdentifier); this.menuViewers.remove(playerIdentifier); this.minigameViewers.remove(playerIdentifier); }", "tokens": 78} {"id": 367645, "source": "method", "repo": "lushen124/universal-fe-randomizer", "text": "public Map counters() { Map counterMap = new HashMap(); return counterMap; }", "tokens": 35} {"id": 367676, "source": "method", "repo": "lushen124/universal-fe-randomizer", "text": "public void setStatBonusPointer(long address) { if (address == 0) { data[12] = 0; data[13] = 0; data[14] = 0; data[15] = 0; } else { byte[] pointer = WhyDoesJavaNotHaveThese.bytesFromAddress(address); data[12] = pointer[0]; data[13] = pointer[1]; data[14] = pointer[2]; data[15] = pointer[3]; } wasModified = true; }", "tokens": 122} {"id": 367914, "source": "method", "repo": "lushen124/universal-fe-randomizer", "text": "public void setBaseSTR(int newBaseSTR) { data[0x3A] = (byte)(newBaseSTR & 0xFF); wasModified = true; }", "tokens": 39} {"id": 367927, "source": "method", "repo": "lushen124/universal-fe-randomizer", "text": "public void setSKLGrowth(int newGrowth) { data[0x57] = (byte)(newGrowth & 0xFF); wasModified = true; }", "tokens": 38} {"id": 368018, "source": "method", "repo": "lushen124/universal-fe-randomizer", "text": "public PushGlobalArrayVarItem16Instruction(byte[] arg) { globalVariableNumber = (int)(WhyDoesJavaNotHaveThese.longValueFromByteArray(arg, false) & 0xFFFF); }", "tokens": 44} {"id": 368028, "source": "method", "repo": "lushen124/universal-fe-randomizer", "text": "public int numArgBytes() { return 4; }", "tokens": 13} {"id": 368054, "source": "method", "repo": "lushen124/universal-fe-randomizer", "text": "public int getDEFGrowth() { return data[13] & 0xFF; }", "tokens": 20} {"id": 368189, "source": "method", "repo": "lushen124/universal-fe-randomizer", "text": "public boolean isArmory(GBAFEShop shop) { return provider.allArmories().contains(shop); }", "tokens": 25} {"id": 368403, "source": "method", "repo": "lushen124/universal-fe-randomizer", "text": "private void buildCharacterComposite() { characterComposite = new Composite(group, SWT.NONE); characterComposite.setLayout(new FormLayout()); charactersLabel = new Label(characterComposite, SWT.NONE); charactersLabel.setText(\"Characters\"); FormData labelData = new FormData(); labelData.top = new FormAttachment(0, 0); labelData.left = new FormAttachment(0, 0); charactersLabel.setLayoutData(labelData); List characterList = new ArrayList(characterDataProvider.allCanonicalPlayableCharacters().stream().toList()); characterList.addAll(characterDataProvider.extraCharacters()); characterList.sort(ListDisplayable.displayableComparator); characterSelection = new DualListSelectionView(characterComposite, \"Ignore\", \"Randomize\", \"Select None\", \"Select All\", characterList, characterDataProvider.extraCharacters().stream().sorted(ListDisplayable.displayableComparator).toList(), characterDataProvider.allCanonicalPlayableCharacters().stream().sorted(ListDisplayable.displayableComparator).toList()); FormData compositeData = new FormData(); compositeData.top = new FormAttachment(charactersLabel, 5); compositeData.left = new FormAttachment(charactersLabel, 5, SWT.LEFT); compositeData.right = new FormAttachment(100, 0); compositeData.bottom = new FormAttachment(100, 0); characterSelection.setLayoutData(compositeData); }", "tokens": 303} {"id": 368577, "source": "method", "repo": "lvlrsajjad/react-native-blur-overlay", "text": "public void setGlassParams(float cornerPx, float bandPx, float thicknessPx, float ior, float specular, float rim, float tint, float bleedPx) { this.cornerPx = cornerPx; this.bandPx = bandPx; this.thicknessPx = thicknessPx; this.ior = ior; this.specular = specular; this.rim = rim; this.tint = tint; this.bleedPx = bleedPx; }", "tokens": 112} {"id": 368684, "source": "method", "repo": "lwjglgamedev/vulkanbook", "text": "private static DescPoolInfo createDescPoolInfo(Device device, Map descLimits) { Map descCount = new HashMap<>(); List descTypeCounts = new ArrayList<>(); descLimits.forEach((k, v) -> { descCount.put(k, v); descTypeCounts.add(new DescPool.DescTypeCount(k, v)); }); var descPool = new DescPool(device, descTypeCounts); return new DescPoolInfo(descCount, descPool); }", "tokens": 124} {"id": 369003, "source": "method", "repo": "lwjglgamedev/vulkanbook", "text": "public boolean getVSync() { return vSync; }", "tokens": 13} {"id": 369024, "source": "method", "repo": "lwjglgamedev/vulkanbook", "text": "public synchronized void cleanup(Device device) { Logger.debug(\"Destroying descriptor allocator\"); descSetInfoMap.clear(); descPoolList.forEach(d -> d.descPool.cleanup(device)); }", "tokens": 45} {"id": 369057, "source": "method", "repo": "lwjglgamedev/vulkanbook", "text": "public Matrix4f getNodeTransformation() { return nodeTransformation; }", "tokens": 14} {"id": 369081, "source": "method", "repo": "lwjglx/lwjgl3-awt", "text": "/** Triggers the one-time runtime dependency check. */ public static void check() { if (!INITIALIZED) { throw new AssertionError(\"LWJGL version check did not initialize\"); } }", "tokens": 38} {"id": 369113, "source": "method", "repo": "lwjglx/lwjgl3-awt", "text": "public void drawRect(int x, int y, int width, int height) { delegate.drawRect(x, y, width, height); }", "tokens": 32} {"id": 369141, "source": "method", "repo": "lwjglx/lwjgl3-awt", "text": "public NonClearGraphics2D create(int x, int y, int width, int height) { return new NonClearGraphics2D((Graphics2D)delegate.create(x, y, width, height)); }", "tokens": 48} {"id": 369312, "source": "method", "repo": "lwjglx/lwjgl3-awt", "text": "private static AWTException cglException(String message, int error) { return new AWTException(message + \": \" + CGLErrorString(error) + \" (\" + error + \")\"); }", "tokens": 41} {"id": 369387, "source": "method", "repo": "lwjglx/lwjgl3-awt", "text": "void warningIdentifiesMismatchedModulesAndLikelyFailure() throws Exception { LWJGLVersionChecker.BuildMetadata metadata = new LWJGLVersionChecker.BuildMetadata(\"0.1.8\", \"3.3.3\"); List modules = Arrays.asList( new LWJGLVersionChecker.ModuleVersion(\"lwjgl\", \"3.3.6\"), new LWJGLVersionChecker.ModuleVersion(\"lwjgl-jawt\", \"3.3.6\"), new LWJGLVersionChecker.ModuleVersion(\"lwjgl-opengl\", \"3.3.3\")); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); boolean warned; try (PrintStream output = new PrintStream(bytes, true, \"UTF-8\")) { warned = LWJGLVersionChecker.warnIfIncompatible(metadata, modules, output); } String warning = bytes.toString(\"UTF-8\"); assertTrue(warned); assertTrue(warning.contains(\"lwjgl3-awt 0.1.8 was compiled against LWJGL 3.3.3\")); assertTrue(warning.contains(\"lwjgl: 3.3.6\")); assertTrue(warning.contains(\"lwjgl-jawt: 3.3.6\")); assertFalse(warning.contains(\"lwjgl-opengl: 3.3.3\")); assertTrue(warning.contains(\"LWJGL BOM\")); assertTrue(warning.contains(\"NoSuchMethodError\")); }", "tokens": 283} {"id": 369495, "source": "method", "repo": "lwjglx/lwjgl3-awt", "text": "void highestAllowsAProfileWithoutAConfiguredVersion() { GLData data = new GLData(); data.profile = GLData.Profile.CORE; data.versionPolicy = GLData.VersionPolicy.HIGHEST; GLUtil.validateAttributes(data); }", "tokens": 50} {"id": 369620, "source": "method", "repo": "lwjglx/lwjgl3-awt", "text": "final void deleteTexture(int texture) { runInContext(() -> withCapabilities(() -> glDeleteTextures(texture))); }", "tokens": 28} {"id": 369632, "source": "method", "repo": "lwjglx/lwjgl3-awt", "text": "private static long getLockedJAWTHdc(AWTGLCanvas canvas) { try { Field hdc = PlatformWin32GLCanvas.class.getDeclaredField(\"hdc\"); hdc.setAccessible(true); return hdc.getLong(canvas.platformCanvas); } catch (ReflectiveOperationException e) { throw new AssertionError(\"Unable to inspect the locked JAWT HDC\", e); } }", "tokens": 81} {"id": 369719, "source": "method", "repo": "maddevsio/mad-location-manager", "text": "public void setData(double... args) { assert(args.length == rows * cols); for (int r = 0; r < rows; ++r) { for (int c = 0; c < cols; ++c) { data[r][c] = args[r*cols + c]; } } }", "tokens": 73} {"id": 369734, "source": "method", "repo": "maddevsio/mad-location-manager", "text": "void shearRow(int r1, int r2, double scalar) { assert(r1 != r2); assert(r1 < rows && r2 < rows); int c; for (c = 0; c < cols; ++c) data[r1][c] += data[r2][c] * scalar; }", "tokens": 73} {"id": 369786, "source": "method", "repo": "maddevsio/mad-location-manager", "text": "public double[] getSigmas() { return m_sigmas; }", "tokens": 17} {"id": 369899, "source": "method", "repo": "magefree/mage", "text": "public int calculate(Game game, Ability sourceAbility, Effect effect) { UUID targetPlayer; switch (this) { case ACTIVE: targetPlayer = game.getActivePlayerId(); break; case TARGET: targetPlayer = effect.getTargetPointer().getFirst(game, sourceAbility); break; case REGULAR: targetPlayer = sourceAbility.getControllerId(); break; default: targetPlayer = null; } return game.getBattlefield() .getActivePermanents( StaticFilters.FILTER_CONTROLLED_PERMANENT_LANDS, targetPlayer, sourceAbility, game ).stream() .map(permanent -> SubType .getBasicLands() .stream() .filter(subType -> permanent.hasSubtype(subType, game)) .collect(Collectors.toSet())) .flatMap(Collection::stream) .distinct() .mapToInt(x -> 1) .sum(); }", "tokens": 191} {"id": 369974, "source": "method", "repo": "magefree/mage", "text": "public Effects getEffects(Game game, EffectType effectType) { return ability.getEffects(game, effectType); }", "tokens": 28} {"id": 370191, "source": "method", "repo": "magefree/mage", "text": "public Disfigure(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},\"{B}\"); this.getSpellAbility().addEffect(new BoostTargetEffect(-2, -2, Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); }", "tokens": 67} {"id": 370270, "source": "method", "repo": "magefree/mage", "text": "public FreestriderCommando(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, \"{2}{G}\"); this.subtype.add(SubType.CENTAUR); this.subtype.add(SubType.MERCENARY); this.power = new MageInt(3); this.toughness = new MageInt(3); // Freestrider Commando enters the battlefield with two +1/+1 counters on it if it wasn't cast or no mana was spent to cast it. this.addAbility(new EntersBattlefieldAbility( new ConditionalOneShotEffect( new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), FreestriderCommandoCondition.instance, \"\" ), \"with two +1/+1 counters on it if it wasn't cast or no mana was spent to cast it\" )); // Plot {3}{G} this.addAbility(new PlotAbility(\"{3}{G}\")); }", "tokens": 213} {"id": 370288, "source": "method", "repo": "magefree/mage", "text": "public GlaiveOfTheGuildpact(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, \"{2}\"); this.subtype.add(SubType.EQUIPMENT); // Equipped creature gets +1/+0 for each Gate you control and has vigilance and menace. Ability ability = new SimpleStaticAbility(new BoostEquippedEffect(GateYouControlCount.instance, StaticValue.get(0))); ability.addEffect(new GainAbilityAttachedEffect( VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT ).setText(\"and has vigilance\")); ability.addEffect(new GainAbilityAttachedEffect( new MenaceAbility(), AttachmentType.EQUIPMENT ).setText(\"and menace. (A creature with menace can't be blocked except by two or more creatures.)\")); ability.addHint(GatesYouControlHint.instance); this.addAbility(ability); // Equip {3} this.addAbility(new EquipAbility(3)); }", "tokens": 240} {"id": 370319, "source": "method", "repo": "magefree/mage", "text": "public HauntedRidge(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.LAND}, \"\"); // Haunted Ridge enters the battlefield tapped unless you control two or more other lands. this.addAbility(new EntersBattlefieldTappedUnlessAbility(condition).addHint(condition.getHint())); // {T}: Add {B}. this.addAbility(new BlackManaAbility()); // {T}: Add {R}. this.addAbility(new RedManaAbility()); }", "tokens": 115} {"id": 370376, "source": "method", "repo": "magefree/mage", "text": "private JarOfEyeballs(final JarOfEyeballs card) { super(card); }", "tokens": 22} {"id": 370484, "source": "method", "repo": "magefree/mage", "text": "private ObscuringHaze(final ObscuringHaze card) { super(card); }", "tokens": 26} {"id": 370485, "source": "method", "repo": "magefree/mage", "text": "public OgnisTheDragonsLash copy() { return new OgnisTheDragonsLash(this); }", "tokens": 29} {"id": 370639, "source": "method", "repo": "magefree/mage", "text": "public SpectacularPileup(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, \"{3}{W}{W}\"); // All creatures and Vehicles lose indestructible until end of turn, then destroy all creatures and Vehicles. this.getSpellAbility().addEffect(new LoseAbilityAllEffect( IndestructibleAbility.getInstance(), Duration.EndOfTurn, filter) .setText(\"All creatures and Vehicles lose indestructible until end of turn\") ); this.getSpellAbility().addEffect(new DestroyAllEffect(filter).concatBy(\", then\")); // Cycling {2} this.addAbility(new CyclingAbility(new ManaCostsImpl<>(\"{2}\"))); }", "tokens": 168} {"id": 370779, "source": "method", "repo": "magefree/mage", "text": "private WellLaidPlansPreventionEffect(final WellLaidPlansPreventionEffect effect) { super(effect); }", "tokens": 30} {"id": 370824, "source": "method", "repo": "magefree/mage", "text": "/** Check that a cost modification effect that increases the cost of an spell cast properly effects Disturb. */ public void test_CostModification_CanNotPlay() { // Disturb {1}{U} // Hook-Haunt Drifter addCard(Zone.GRAVEYARD, playerA, \"Baithook Angler\", 1); // {1}{U} addCard(Zone.BATTLEFIELD, playerA, \"Island\", 2); // addCustomEffect_SpellCostModification(playerA, 1); checkPlayableAbility(\"before\", 1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Cast Hook-Haunt Drifter using Disturb\", false); setStrictChooseMode(true); setStopAt(1, PhaseStep.END_TURN); execute(); }", "tokens": 176} {"id": 371126, "source": "method", "repo": "malikzh/ncanode", "text": "public static URL createNewUrl(String url, Logger log) { try { return new URL(url); } catch (MalformedURLException e) { log.warn(\"Cannot parse url '{}'\", url, e); return null; } }", "tokens": 47} {"id": 371200, "source": "method", "repo": "malte0811/ferritecore", "text": "public int getValueIndex(int stateIndex, int propertyIndex) { return this.keys.get(propertyIndex).getIndexIn(stateIndex); }", "tokens": 33} {"id": 371271, "source": "method", "repo": "malte0811/ferritecore", "text": "private static void crashRelease(SmallThreadDetectable owner) { var state = getAndWait(owner, ThreadRole.RELEASE); throw state.mainException; }", "tokens": 34} {"id": 371305, "source": "method", "repo": "malte0811/ferritecore", "text": "public String computeStateHolderValuesName() { return \"values\"; }", "tokens": 15} {"id": 371621, "source": "method", "repo": "mamiiblt/instafel", "text": "public void openDeveloperOptions() { /* This method should need to be filled by patcher. If you want to inspect it, please see ChangeHomeLongClick patch. */ }", "tokens": 37} {"id": 371651, "source": "method", "repo": "mamiiblt/instafel", "text": "public void dismiss() { dialog.dismiss(); }", "tokens": 11} {"id": 371704, "source": "method", "repo": "mamiiblt/instafel", "text": "public void onCreate() { super.onCreate(); LocalizationUtils.applyLocale(this); }", "tokens": 20} {"id": 371720, "source": "method", "repo": "mamiiblt/instafel", "text": "public void onCreate() { this.df = new DecimalFormat(\"#.##\"); this.ctx = getApplicationContext(); this.logUtils = new LogUtils(ctx); this.preferences = PreferenceManager.getDefaultSharedPreferences(ctx); this.notificationManager = ctx.getSystemService(NotificationManager.class); this.notificationBuilder = new NotificationCompat.Builder(ctx, CHANNEL_ID); this.appPreferences = new AppPreferences( preferences.getBoolean(\"send_notification\", true), preferences.getBoolean(\"use_mobile_data\", false), preferences.getBoolean(\"12_hour_rule\", false), preferences.getBoolean(\"disable_error_notifications\", false), preferences.getBoolean(\"crash_logger\", false)); super.onCreate(); }", "tokens": 150} {"id": 371866, "source": "method", "repo": "manuelbl/swissqrbill", "text": "private void preparePage(PDDocument doc, int pageNo) throws IOException { if (pageNo == NEW_PAGE_AT_END) { PDPage page = new PDPage(new PDRectangle((float) (210 * MM_TO_PT), (float) (297 * MM_TO_PT))); doc.addPage(page); contentStream = new PDPageContentStream(doc, page, PDPageContentStream.AppendMode.OVERWRITE, true, true); } else { if (pageNo == LAST_PAGE) pageNo = doc.getNumberOfPages() - 1; PDPage page = doc.getPage(pageNo); contentStream = new PDPageContentStream(doc, page, PDPageContentStream.AppendMode.APPEND, true, true); } }", "tokens": 170} {"id": 371970, "source": "method", "repo": "manuelbl/swissqrbill", "text": "/** Sets the character set used for the QR bill data.

Defaults to {@link SPSCharacterSet#LATIN_1_SUBSET}.

@param characterSet the character set used for the QR bill data. */ public void setCharacterSet(SPSCharacterSet characterSet) { this.characterSet = characterSet; }", "tokens": 75} {"id": 372052, "source": "method", "repo": "manuelbl/swissqrbill", "text": "/** Calculate the reference's modulo 97 checksum according to ISO11649 and IBAN standard.

The string may only contains digits, letters ('A' to 'Z' and 'a' to 'z', no accents). It must not contain white space.

@param reference the reference @return the checksum (0 to 96) @throws IllegalArgumentException thrown if the reference contains an invalid character */ private static int calculateMod97(String reference) { int len = reference.length(); if (len < 5) throw new IllegalArgumentException(\"Insufficient characters for checksum calculation\"); String rearranged = reference.substring(4) + reference.substring(0, 4); int sum = 0; for (int i = 0; i < len; i++) { char ch = rearranged.charAt(i); if (ch >= '0' && ch <= '9') { sum = sum * 10 + (ch - '0'); } else if (ch >= 'A' && ch <= 'Z') { sum = sum * 100 + (ch - 'A' + 10); } else if (ch >= 'a' && ch <= 'z') { sum = sum * 100 + (ch - 'a' + 10); } else { throw new IllegalArgumentException(\"Invalid character in reference: \" + ch); } if (sum > 9999999) sum = sum % 97; } sum = sum % 97; return sum; }", "tokens": 343} {"id": 372055, "source": "method", "repo": "manuelbl/swissqrbill", "text": "private static int calculateMod10(String reference) { int len = reference.length(); int carry = 0; for (int i = 0; i < len; i++) { int digit = reference.charAt(i) - '0'; carry = MOD_10[(carry + digit) % 10]; } return (10 - carry) % 10; }", "tokens": 88} {"id": 372122, "source": "method", "repo": "manuelbl/swissqrbill", "text": "/** Gets the start date of the period when the service was supplied (e.g. a subscription).

If this VAT start date is given, the VAT end date must all be given and the VAT date must be {@code null}.

@return the VAT start date */ public LocalDate getVatStartDate() { return vatStartDate; }", "tokens": 80} {"id": 372160, "source": "method", "repo": "manuelbl/swissqrbill", "text": "private void setPaymentConditions(SwicoBillInformation billInformation, String value) { // Split into tuples String[] tuples = value.split(\";\"); List list = new ArrayList<>(); for (String listEntry : tuples) { // Split into tuple (discount, days) String[] detail = listEntry.split(\":\"); if (detail.length != 2) continue; BigDecimal discount = getDecimalValue(detail[0]); Integer days = getIntValue(detail[1]); if (discount != null && days != null) list.add(new PaymentCondition(discount, days)); } if (!list.isEmpty()) billInformation.setPaymentConditions(list); }", "tokens": 141} {"id": 372181, "source": "method", "repo": "manuelbl/swissqrbill", "text": "/** Sets the language neutral key of the message. @param messageKey the message key */ public void setMessageKey(String messageKey) { this.messageKey = messageKey; }", "tokens": 39} {"id": 372213, "source": "method", "repo": "manuelbl/swissqrbill", "text": "private void cleanAddressFields(Address addressOut, String fieldRoot) { addressOut.setName(clippedValue(addressOut.getName(), 70, fieldRoot, ValidationConstants.SUBFIELD_NAME)); if (addressOut.getType() == Address.Type.STRUCTURED) { addressOut.setStreet(clippedValue(addressOut.getStreet(), 70, fieldRoot, ValidationConstants.SUBFIELD_STREET)); addressOut.setHouseNo(clippedValue(addressOut.getHouseNo(), 16, fieldRoot, ValidationConstants.SUBFIELD_HOUSE_NO)); addressOut.setPostalCode(clippedValue(addressOut.getPostalCode(), 16, fieldRoot, ValidationConstants.SUBFIELD_POSTAL_CODE)); addressOut.setTown(clippedValue(addressOut.getTown(), 35, fieldRoot, ValidationConstants.SUBFIELD_TOWN)); } if (addressOut.getType() == Address.Type.COMBINED_ELEMENTS) { addressOut.setAddressLine1(clippedValue(addressOut.getAddressLine1(), 70, fieldRoot, ValidationConstants.SUBFIELD_ADDRESS_LINE_1)); addressOut.setAddressLine2(clippedValue(addressOut.getAddressLine2(), 70, fieldRoot, ValidationConstants.SUBFIELD_ADDRESS_LINE_2)); } if (addressOut.getCountryCode() != null) addressOut.setCountryCode(addressOut.getCountryCode().toUpperCase(Locale.US)); }", "tokens": 313} {"id": 372660, "source": "method", "repo": "manuelbl/swissqrbill", "text": "void encodeExample3() { SwicoBillInformation billInfo = SwicoExamples.createExample3(); String text = billInfo.encodeAsText(); assertEquals(SwicoExamples.EXAMPLE_3_TEXT, text); }", "tokens": 43} {"id": 372668, "source": "method", "repo": "manuelbl/swissqrbill", "text": "void emptyString() { assertNull(Strings.trimmed(\"\")); }", "tokens": 14} {"id": 372696, "source": "method", "repo": "manuelbl/swissqrbill", "text": "private static byte[] loadReferenceFile(String filename, boolean doRemoveCR) throws IOException { try (InputStream is = FileComparison.class.getResourceAsStream(\"/\" + filename)) { if (is == null) throw new FileNotFoundException(filename); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); byte[] chunk = new byte[8192]; while (true) { int len = is.read(chunk); if (len == -1) break; if (doRemoveCR) len = removeCR(chunk, len); buffer.write(chunk, 0, len); } return buffer.toByteArray(); } }", "tokens": 128} {"id": 372908, "source": "method", "repo": "mapbox/mapbox-java", "text": "public void sanity() throws Exception { DirectionsRoute route = DirectionsRoute.builder() .distance(100d) .duration(100d) .build(); assertNotNull(route); }", "tokens": 44} {"id": 373108, "source": "method", "repo": "mapbox/mapbox-java", "text": "/** A {@link Point} object which represents the routable point location. @return a GeoJson {@link Point} which defines the routable point location */ public Point coordinate() { final double[] coordinate = rawCoordinate(); if (coordinate != null && coordinate.length == 2) { return Point.fromLngLat(coordinate[0], coordinate[1]); } return null; }", "tokens": 80} {"id": 373145, "source": "method", "repo": "mapbox/mapbox-java", "text": "public void intersectionSearch_AddIntersectionToQuery() { MapboxGeocoding mapboxGeocoding = MapboxGeocoding.builder() .accessToken(ACCESS_TOKEN) .intersectionStreets(\"Market Street\", \"Fremont Street\") .proximity(\"-122.39738575285674,37.792514711136945\") .geocodingTypes(GeocodingCriteria.TYPE_ADDRESS) .baseUrl(mockUrl.toString()) .build(); assertNotNull(mapboxGeocoding); assertTrue(mapboxGeocoding.cloneCall().request().url().toString() .contains(\"Market%20Street%20and%20Fremont%20Street\")); }", "tokens": 162} {"id": 373156, "source": "method", "repo": "mapbox/mapbox-java", "text": "public void geometry_returnsPointGeometry() throws Exception { MapboxGeocoding mapboxGeocoding = MapboxGeocoding.builder() .accessToken(ACCESS_TOKEN) .query(Point.fromLngLat(-77.0366, 38.8971)) .baseUrl(mockUrl.toString()) .build(); GeocodingResponse response = mapboxGeocoding.executeCall().body(); assertNotNull(response); CarmenFeature feature = response.features().get(0); assertThat(feature.geometry(), notNullValue()); assertTrue(feature.geometry() instanceof Point); assertThat(((Point) feature.geometry()).longitude(), equalTo(106.820552)); assertThat(((Point) feature.geometry()).latitude(), equalTo(39.458115)); }", "tokens": 168} {"id": 373660, "source": "method", "repo": "maplibre/maplibre-navigation-android", "text": "public Class getActivity() { return activity; }", "tokens": 10} {"id": 373806, "source": "method", "repo": "maplibre/maplibre-navigation-android", "text": "NavigationViewRouteEngineListener(NavigationViewModel navigationViewModel) { this.navigationViewModel = navigationViewModel; }", "tokens": 22} {"id": 373831, "source": "method", "repo": "maplibre/maplibre-navigation-android", "text": "protected void onDetachedFromWindow() { super.onDetachedFromWindow(); clearListeners(); }", "tokens": 17} {"id": 373883, "source": "method", "repo": "maplibre/maplibre-navigation-android", "text": "/** Creates a tilt value based on the distance remaining for the current {@link LegStep}.

Checks if the calculated value is within the set min / max bounds. @param distanceRemaining from the current step @return tilt within set min / max bounds */ private double createTilt(double distanceRemaining) { double tilt = distanceRemaining / 5; if (tilt > MAX_CAMERA_TILT) { return MAX_CAMERA_TILT; } else if (tilt < MIN_CAMERA_TILT) { return MIN_CAMERA_TILT; } return Math.round(tilt); }", "tokens": 128} {"id": 373999, "source": "method", "repo": "maplibre/maplibre-navigation-android", "text": "/** Initializes all animations needed to show / hide views. */ private void initializeAnimations() { Context context = getContext(); rerouteSlideDownTop = AnimationUtils.loadAnimation(context, R.anim.slide_down_top); rerouteSlideUpTop = AnimationUtils.loadAnimation(context, R.anim.slide_up_top); }", "tokens": 73} {"id": 374135, "source": "method", "repo": "maplibre/maplibre-navigation-android", "text": "public void onProgressChange(Location location, RouteProgress routeProgress) { mapWayName.updateProgress(location, positionsToMapLibre(routeProgress.getCurrentStepPoints())); }", "tokens": 37} {"id": 374382, "source": "method", "repo": "maplibre/maplibre-navigation-android", "text": "SpeechAnnouncementMap() { super(2); put(true, new SpeechAnnouncementUpdate() { @Override public Pair buildTextAndTypeFrom(SpeechAnnouncement speechAnnouncement) { return new Pair<>(speechAnnouncement.ssmlAnnouncement(), SSML_TEXT_TYPE); } }); put(false, new SpeechAnnouncementUpdate() { @Override public Pair buildTextAndTypeFrom(SpeechAnnouncement speechAnnouncement) { return new Pair<>(speechAnnouncement.announcement(), TEXT_TYPE); } }); }", "tokens": 115} {"id": 374523, "source": "method", "repo": "maplibre/maplibre-navigation-android", "text": "public void updateEnabled_falseResetsToMax() { MapLibreMap mapLibreMap = mock(MapLibreMap.class); LocationComponent locationComponent = mock(LocationComponent.class); LocationFpsDelegate locationFpsDelegate = new LocationFpsDelegate(mapLibreMap, locationComponent); locationFpsDelegate.updateEnabled(false); verify(locationComponent).setMaxAnimationFps(eq(Integer.MAX_VALUE)); }", "tokens": 76} {"id": 374648, "source": "method", "repo": "marhali/easy-i18n", "text": "public Set handle(@NotNull ConfiguredModulesQuery _query) { return projectConfigPort.read().modules().keySet(); }", "tokens": 30} {"id": 374774, "source": "method", "repo": "marhali/easy-i18n", "text": "/** Retrieves the specified module. @param moduleId Module identifier @return {@link I18nModule} or throws {@link NullPointerException} if unknown */ public I18nModule getModuleOrThrow(@NotNull ModuleId moduleId) { return Objects.requireNonNull(getModule(moduleId), \"Project does not contain module with: \" + moduleId); }", "tokens": 73} {"id": 374843, "source": "method", "repo": "marhali/easy-i18n", "text": "public Builder importSources(@NotNull Set value) { this.importSources = value; return this; }", "tokens": 25} {"id": 374854, "source": "method", "repo": "marhali/easy-i18n", "text": "public EditorRule withExcludeRule(boolean excludeRule) { return new EditorRule(id, languages, triggerKind, constraints, priority, excludeRule); }", "tokens": 31} {"id": 374923, "source": "method", "repo": "marhali/easy-i18n", "text": "public ShowAsTreeToggleAction( @NotNull Producer queryToggleState, @NotNull Consumer onToggleAction ) { super( PluginBundle.message(\"action.show.tree.label\"), null, PluginIcon.SHOW_AS_TREE_ICON, queryToggleState, onToggleAction ); }", "tokens": 69} {"id": 375280, "source": "method", "repo": "marhali/easy-i18n", "text": "public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { var component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); // Always reset custom colors to prevent weird color rendering setForeground(null); if (!isSelected && !hasFocus) { var foreground = ((I18nTableViewModel) table.getModel()).getForeground(row, column); if (foreground != null) { setForeground(foreground); } } setBorder(DEFAULT_BORDER); return component; }", "tokens": 122} {"id": 375299, "source": "method", "repo": "marhali/easy-i18n", "text": "public void setShowAsTree(boolean showAsTree) { mutateStateAndInvalidate(state -> state.showAsTree = showAsTree); }", "tokens": 32} {"id": 375505, "source": "method", "repo": "marhali/easy-i18n", "text": "public void test_constraint_parameter_template_returns_constraint_segment() { Assert.assertEquals( new Template(\"{mySegment::[^/]+}\", List.of(TemplateElement.fromPlaceholder(\"mySegment\", null, \"[^/]+\"))), TemplateDefinitionParser.parse(\"{mySegment::[^/]+}\") ); }", "tokens": 69} {"id": 375555, "source": "method", "repo": "marianobarrios/tls-channel", "text": "public void free(ByteBuffer buffer) { // GC does it }", "tokens": 14} {"id": 375572, "source": "method", "repo": "marianobarrios/tls-channel", "text": "public boolean getRunTasks() { return runTasks; }", "tokens": 13} {"id": 375656, "source": "method", "repo": "marianobarrios/tls-channel", "text": "/** Return the total number of read operations that were cancelled. @return number of operations */ public long getCancelledReadCount() { return cancelledReads.longValue(); }", "tokens": 34} {"id": 375725, "source": "method", "repo": "marianobarrios/tls-channel", "text": "private static Map exploreSNIExt(ByteBuffer input, int extLen) throws SSLProtocolException { Map sniMap = new HashMap<>(); int remains = extLen; if (extLen >= 2) { // \"server_name\" extension in ClientHello int listLen = getUnsignedInt16(input); // length of server_name_list if (listLen == 0 || listLen + 2 != extLen) { throw new SSLProtocolException(\"Invalid server name indication extension\"); } remains -= 2; // 2: the length field of server_name_list while (remains > 0) { int code = getUnsignedInt8(input); // name_type int snLen = getUnsignedInt16(input); // length field of server name if (snLen > remains) { throw new SSLProtocolException(\"Not enough data to fill declared vector size\"); } byte[] encoded = new byte[snLen]; input.get(encoded); SNIServerName serverName; if (code == StandardConstants.SNI_HOST_NAME) { if (encoded.length == 0) { throw new SSLProtocolException(\"Empty HostName in server name indication\"); } serverName = new SNIHostName(encoded); } else { serverName = new UnknownServerName(code, encoded); } // check for duplicated server name type if (sniMap.put(serverName.getType(), serverName) != null) { throw new SSLProtocolException(\"Duplicated server name of type \" + serverName.getType()); } remains -= encoded.length + 3; // NameType: 1 byte; HostName // length: 2 bytes } } else if (extLen == 0) { // \"server_name\" extension in ServerHello throw new SSLProtocolException(\"Not server name indication extension in client\"); } if (remains != 0) { throw new SSLProtocolException(\"Invalid server name indication extension\"); } return sniMap; }", "tokens": 425} {"id": 375764, "source": "method", "repo": "marianobarrios/tls-channel", "text": "public void testOldToOldHalfDuplex() throws IOException, InterruptedException { SocketGroups.OldOldSocketPair socketPair = factory.oldOld(Optional.empty()); halfDuplexStream( new SSLSocketWriter(socketPair.server), new SocketReader(socketPair.client), new SSLSocketWriter(socketPair.client), new SocketReader(socketPair.server)); }", "tokens": 80} {"id": 375821, "source": "method", "repo": "marianobarrios/tls-channel", "text": "public static void readerLoop( int size, SocketGroup socketGroup, boolean gathering, boolean readEof, boolean close) { TestUtil.cannotFail(() -> { logger.fine(() -> String.format(\"Starting reader loop. Size: $size, gathering: %s\", gathering)); byte[] readArray = new byte[bufferSize]; int bytesRemaining = size; MessageDigest digest = MessageDigest.getInstance(hashAlgorithm); while (bytesRemaining > 0) { ByteBuffer readBuffer = ByteBuffer.wrap(readArray, 0, Math.min(bufferSize, bytesRemaining)); int c; if (gathering) { c = (int) socketGroup.tls.read(multiWrap(readBuffer)); } else { c = socketGroup.external.read(readBuffer); } assertTrue(c > 0, \"blocking read must return a positive number\"); digest.update(readBuffer.array(), 0, readBuffer.position()); bytesRemaining -= c; assertTrue(bytesRemaining >= 0); } if (readEof) assertEquals(-1, socketGroup.external.read(ByteBuffer.wrap(readArray))); byte[] actual = digest.digest(); assertArrayEquals(expectedBytesHash.apply(size), actual); if (close) socketGroup.external.close(); logger.fine(\"Finalizing reader loop\"); }); }", "tokens": 282} {"id": 375866, "source": "method", "repo": "marianobarrios/tls-channel", "text": "public long getLastAccessedTime() { return System.currentTimeMillis(); }", "tokens": 16} {"id": 375932, "source": "method", "repo": "marianobarrios/tls-channel", "text": "public void remainingEmptyBuffer() { ByteBuffer buf = ByteBuffer.allocate(8); buf.position(8); assertEquals(0, new ByteBufferSet(buf).remaining()); }", "tokens": 37} {"id": 376078, "source": "method", "repo": "markusfisch/pielauncher", "text": "public void onCreate() { super.onCreate(); registerConfigurationChangedReceiver(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { registerLauncherAppsCallback(); registerManagedEventReceiver(); } else { registerPackageEventReceiver(); } // Note it's not required to unregister receivers because they // need to be there as long as this application is running. }", "tokens": 80} {"id": 376134, "source": "method", "repo": "markusfisch/pielauncher", "text": "public void acceptPinRequest(Context context, Intent intent) { // Keep the PinItemRequest reference out of this method so it can be // safely invoked on pre-O devices without tripping class verification. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && isPinItemRequest(intent)) { acceptPinRequestApi26(context, intent); } }", "tokens": 82} {"id": 376535, "source": "method", "repo": "markusfisch/shadereditor", "text": "private static String buildCrashRecoverySource(@Nullable String source) { if (source != null && source.startsWith(CRASH_RECOVERY_COMMENT)) { return source; } StringBuilder builder = new StringBuilder(); builder.append(CRASH_RECOVERY_COMMENT); builder.append(\"#if 0\\n\"); if (source != null && !source.isEmpty()) { builder.append(source); if (!source.endsWith(\"\\n\")) { builder.append('\\n'); } } builder.append(\"#endif\\n\"); return builder.toString(); }", "tokens": 115} {"id": 376569, "source": "method", "repo": "markusfisch/shadereditor", "text": "public void goToFaq() { tryStartActivity(new Intent(Intent.ACTION_VIEW, Uri.parse( \"https://github.com/markusfisch/ShaderEditor/blob/master/FAQ.md\"))); }", "tokens": 53} {"id": 376677, "source": "method", "repo": "markusfisch/shadereditor", "text": "public void onCreate(SQLiteDatabase db) { // Do nothing. }", "tokens": 14} {"id": 376696, "source": "method", "repo": "markusfisch/shadereditor", "text": "public void updateShaderName(long id, @NonNull String name) { SQLiteDatabase db = dbHelper.getWritableDatabase(); var cv = new ContentValues(); cv.put(DatabaseContract.ShaderColumns.NAME, name); db.update(DatabaseContract.ShaderColumns.TABLE_NAME, cv, DatabaseContract.ShaderColumns._ID + \" = ?\", new String[]{String.valueOf(id)}); }", "tokens": 85} {"id": 377057, "source": "method", "repo": "markusfisch/shadereditor", "text": "Iterable getTextures() { return textures.values(); }", "tokens": 16} {"id": 377091, "source": "method", "repo": "markusfisch/shadereditor", "text": "public static List parseAll( @NonNull String infoLog, int silentlyAddedExtraLines) { return parseAll( infoLog, ShaderLineMapping.withLeadingInsertedLines(silentlyAddedExtraLines)); }", "tokens": 47} {"id": 377203, "source": "method", "repo": "markusfisch/shadereditor", "text": "public void setWallpaperShader(long id) { wallpaperShaderId = id; putString(WALLPAPER_SHADER, String.valueOf(wallpaperShaderId)); }", "tokens": 35} {"id": 377236, "source": "method", "repo": "markusfisch/shadereditor", "text": "private static String requireText(String value, String name) { String text = Objects.requireNonNull(value, name).trim(); if (text.isEmpty()) { throw new IllegalArgumentException(name + \" must not be empty\"); } return text; }", "tokens": 53} {"id": 377248, "source": "method", "repo": "markusfisch/shadereditor", "text": "public ShaderProjectSession withQuality(float quality) { return new ShaderProjectSession(project, activeFilePath, quality); }", "tokens": 26} {"id": 377351, "source": "method", "repo": "markusfisch/shadereditor", "text": "public LineNumbers(Context context, AttributeSet attrs) { super(context, attrs); // Try-with-resources not allowed for API < 31 // noinspection resource TypedArray a = context.getTheme().obtainStyledAttributes( attrs, R.styleable.LineNumbers, 0, 0); try { sourceId = a.getResourceId(R.styleable.LineNumbers_source, 0); } finally { a.recycle(); } setClickable(false); setFocusable(false); setTextIsSelectable(false); setText(\"0\"); }", "tokens": 115} {"id": 377382, "source": "method", "repo": "markusfisch/shadereditor", "text": "public static void addSearchMenu(@NonNull Menu menu, @NonNull MenuInflater inflater, @NonNull OnSearchListener onSearchListener) { inflater.inflate(R.menu.search, menu); SearchView searchView = (SearchView) Objects.requireNonNull(menu.findItem(R.id.search).getActionView()); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextChange(String newText) { onSearchListener.filter(newText); return false; } @Override public boolean onQueryTextSubmit(String query) { onSearchListener.filter(query); return true; } }); searchView.setOnCloseListener(() -> { onSearchListener.filter(null); return false; }); }", "tokens": 164} {"id": 377411, "source": "method", "repo": "markusfisch/shadereditor", "text": "private Editable highlight(@NonNull Editable e, boolean complete) { int length = e.length(); clearError(e); if (length == 0) { tokens = new ArrayList<>(); return e; } // When pasting text from other apps, e.g. Github Mobile code // viewer, the text can be tainted with No-Break Space (U+00A0) // characters. for (Matcher m = PATTERN_NO_BREAK_SPACE.matcher(e); m.find(); ) { e.replace(m.start(), m.end(), \" \"); } if (ShaderEditorApp.preferences.disableHighlighting() && length > 4096) { clearSpans(e, 0, length, ForegroundColorSpan.class); return e; } List newTokens = tokenListUpdater.ensureUpdated(e, revision); if (complete) { clearSpans(e, 0, length, ForegroundColorSpan.class); for (Token token : newTokens) { @ColorInt int color = colors[Highlight.from(token.type()).ordinal()]; if (color != textColor) { e.setSpan( new ForegroundColorSpan(color), token.startOffset(), token.endOffset(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } } } else { Lexer.Diff diff = Lexer.diff(tokens, newTokens); if (diff.start <= diff.deleteEnd) { int startOffset = newTokens.get(diff.start).startOffset(); int endOffset = newTokens.get(diff.insertEnd).endOffset(); clearSpans(e, startOffset, endOffset, ForegroundColorSpan.class); } for (int i = diff.start; i <= diff.insertEnd; ++i) { Token token = newTokens.get(i); e.setSpan( new ForegroundColorSpan( colors[Highlight.from(token.type()).ordinal()]), token.startOffset(), token.endOffset(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } } tokens = newTokens; return e; }", "tokens": 434} {"id": 377497, "source": "method", "repo": "markusfisch/wavelineswallpaper", "text": "public static void startWithIndex(Context context, int index) { Intent intent = new Intent(context, ThemeActivity.class); intent.putExtra(THEME_INDEX, index); context.startActivity(intent); }", "tokens": 45} {"id": 377609, "source": "method", "repo": "markusfisch/wavelineswallpaper", "text": "protected void setPaused(boolean paused) { this.paused = paused; if (paused) { stopRunnable(); } else if (visible) { resetDelay(); nextFrame(); } }", "tokens": 39} {"id": 377680, "source": "method", "repo": "markusfisch/wavelineswallpaper", "text": "public ThemePreview(Context context, AttributeSet attrs) { super(context, attrs); initView(); }", "tokens": 22} {"id": 377808, "source": "method", "repo": "martinpaljak/ant-javacard", "text": "public Converter classes(Path dir) { classDir = dir; return this; }", "tokens": 19} {"id": 377845, "source": "method", "repo": "martinpaljak/ant-javacard", "text": "public Optional api(APIVersion version) { if (version == release.api()) { return Optional.of(api()); } if (!release.targets().contains(version)) { return Optional.empty(); } List jars = new ArrayList<>(); jars.add(Paths.get(\"lib\", String.format(\"api_classic-%s.jar\", version.v))); jars.add(Paths.get(\"lib\", String.format(\"api_classic_annotations-%s.jar\", version.v))); return Optional.of(new JavaCardAPI(this, version, under(jars), path.resolve(targetExportDir(version)))); }", "tokens": 142} {"id": 378018, "source": "method", "repo": "martinpaljak/ant-javacard", "text": "static int getCurrentJDKVersion() { String v = System.getProperty(\"java.version\", \"0.0.0\"); if (v.startsWith(\"1.8.\")) { v = \"8.\" + v.substring(4); } // An early access build reads 26-ea or 24-loom+1-15 return Integer.parseInt(v.split(\"\\\\D\", 2)[0]); }", "tokens": 92} {"id": 378209, "source": "method", "repo": "martinpaljak/apdu4j", "text": "public String toLogString() { var sb = new StringBuilder(); int[] fields = parseFields(apdu); var nc = fields[0]; var ne = fields[1]; var dataOffset = fields[2]; // Header always first sb.append(HexUtils.bin2hex(Arrays.copyOfRange(apdu, 0, 4))); if (apdu.length == 4) { return sb.toString(); // case 1 } // Length encoding: everything between header and data (or end if no data) if (nc > 0) { sb.append(' ').append(HexUtils.bin2hex(Arrays.copyOfRange(apdu, 4, dataOffset))); sb.append(' ').append(HexUtils.bin2hex(Arrays.copyOfRange(apdu, dataOffset, dataOffset + nc))); if (ne > 0) { sb.append(' ').append(HexUtils.bin2hex(Arrays.copyOfRange(apdu, dataOffset + nc, apdu.length))); } } else { // case 2s or 2e: Le encoding after header sb.append(' ').append(HexUtils.bin2hex(Arrays.copyOfRange(apdu, 4, apdu.length))); } return sb.toString(); }", "tokens": 272} {"id": 378349, "source": "method", "repo": "martinpaljak/apdu4j", "text": "void testErrorLogging() { var lines = new ArrayList(); var mock = MockBIBO.throwing(); var logging = LoggingBIBO.wrap(mock, lines::add); assertThrows(BIBOException.class, () -> logging.transceive(HexUtils.hex2bin(\"00A40400\"))); assertEquals(lines.size(), 2); assertEquals(lines.get(0), \">> 00A40400\"); assertTrue(lines.get(1).startsWith(\"<< [error] MockBIBO: configured to throw (\")); }", "tokens": 119} {"id": 378447, "source": "method", "repo": "martinpaljak/apdu4j", "text": "public ReaderSelector filter(Predicate predicate) { return new ReaderSelectorImpl(mgr, new SelectionCriteria(selection.hint(), selection.ignoreFragments(), selection.filter().and(predicate)), config, logStream, dumpStream, onWait); }", "tokens": 55} {"id": 378462, "source": "method", "repo": "martinpaljak/apdu4j", "text": "public T run(Function fn) { var name = resolveReaderName(); return withCardTerminal(name, ct -> connectAndRun(wrapLog(ct), fn)); }", "tokens": 48} {"id": 378639, "source": "method", "repo": "martinpaljak/apdu4j", "text": "public void present(BIBO bibo) { present(bibo, defaultAtr()); }", "tokens": 19} {"id": 378819, "source": "method", "repo": "martinpaljak/apdu4j", "text": "public JCSDKServer(Function sim) { super(sim); host = DEFAULT_JCSDK_HOST; port = DEFAULT_JCSDK_PORT; }", "tokens": 39} {"id": 378985, "source": "method", "repo": "mastercard/client-encryption-java", "text": "private void checkParameterValues() { if (decryptionKey == null && encryptionCertificate == null && encryptionKey == null) { throw new IllegalArgumentException(\"You must include at least an encryption key/certificate or a decryption key\"); } }", "tokens": 50} {"id": 379451, "source": "method", "repo": "mattjlewis/diozero", "text": "public boolean isNewData() { return newData; }", "tokens": 13} {"id": 379659, "source": "method", "repo": "mattjlewis/diozero", "text": "public float getScaledValue() throws RuntimeIOException { return getTemperature(); }", "tokens": 16} {"id": 379715, "source": "method", "repo": "mattjlewis/diozero", "text": "public VL6180() { device = I2CDevice.builder(DEFAULT_ADDRESS).setByteOrder(ByteOrder.BIG_ENDIAN).build(); init(); modelId = (short) (readByte(IDENTIFICATION_MODEL_ID) & 0xff); modelMajor = (short) (readByte(IDENTIFICATION_MODEL_REV_MAJOR) & 0x07); modelMinor = (short) (readByte(IDENTIFICATION_MODEL_REV_MINOR) & 0x07); moduleMajor = (short) (readByte(IDENTIFICATION_MODULE_REV_MAJOR) & 0x07); moduleMinor = (short) (readByte(IDENTIFICATION_MODULE_REV_MINOR) & 0x07); int id_date = readShort(IDENTIFICATION_DATE) & 0xffff; int year = (id_date >> 12) & 0xf; int month = (id_date >> 8) & 0xf; int day_of_month = (id_date >> 3) & 0x1f; manufacturePhase = id_date & 0x07; int time = (readShort(IDENTIFICATION_TIME) & 0xffff) * 2; manufactureDateTime = new GregorianCalendar(2010 + year, month - 1, day_of_month - 1, time / 60 / 60, (time / 60) % 60, time % 60).getTime(); }", "tokens": 351} {"id": 379878, "source": "method", "repo": "mattjlewis/diozero", "text": "public MutableInt setBit(final int bit) { value = setBitValue(value, bit, true); return this; }", "tokens": 28} {"id": 379888, "source": "method", "repo": "mattjlewis/diozero", "text": "/** Map a number from one range to another. Based on Arduino's map(). Example: RangeUtil.map(500, 0, 1000, 0, 256); returns 128. @param value value to map @param fromLow low end of originating range @param fromHigh high end of originating range @param toLow low end of target range @param toHigh high end of target range @param constrain whether to constrain the returned value to the specified range @return mapped value */ public static double map(double value, double fromLow, double fromHigh, double toLow, double toHigh, boolean constrain) { double result = (value - fromLow) * (toHigh - toLow) / (fromHigh - fromLow) + toLow; if (constrain) { result = constrain(result, toLow, toHigh); } return result; }", "tokens": 205} {"id": 379910, "source": "method", "repo": "mattjlewis/diozero", "text": "public void unipolarStepForward() { unipolarController.stepForward(StepStyle.SINGLE); for (int i = 0; i < 4; i++) assertEquals(1, unipolarPins[i].requests.size(), \"Pin \" + i + \" not requested.\"); assertTrue(unipolarPins[3].requests.get(0), \"Pin 4 did not fire\"); for (int i = 0; i < 3; i++) assertFalse(unipolarPins[i].requests.get(0), \"Pin \" + i + \" fired\"); }", "tokens": 130} {"id": 379981, "source": "method", "repo": "mattjlewis/diozero", "text": "/** Get duration of walking time. @return time Walk time in milliseconds. @throws RuntimeIOException if an I/O error occurs */ public long dmp_get_pedometer_walk_time() throws RuntimeIOException { byte[] tmp = mpu.mpu_read_mem(DMP612.D_PEDSTD_TIMECTR, 4); return (((long)tmp[0] << 24) | ((long)(tmp[1] & 0xff) << 16) | ((long)(tmp[2] & 0xff) << 8) | (tmp[3] & 0xff)) * 20; }", "tokens": 151} {"id": 379987, "source": "method", "repo": "mattjlewis/diozero", "text": "public Vector3D getGyroData() throws RuntimeIOException { return ImuDataFactory.createVector(mpu.mpu_get_gyro_reg(), mpu.mpu_get_gyro_fsr().getScale()); }", "tokens": 53} {"id": 380062, "source": "method", "repo": "mattjlewis/diozero", "text": "public MockAnalogInputDevice(String key, MockDeviceFactory deviceFactory, int gpio) { super(key, deviceFactory); this.deviceFactory = deviceFactory; mock = deviceFactory.provisionGpio(gpio, DeviceMode.ANALOG_INPUT, 0); }", "tokens": 57} {"id": 380187, "source": "method", "repo": "mattjlewis/diozero", "text": "public static void main(String[] args) { if (args.length < 2) { Logger.error(\"Usage: {} \", PwmServoTest.class.getName()); System.exit(1); } int pwm_freq = Integer.parseInt(args[0]); int pin_number = Integer.parseInt(args[1]); test(pwm_freq, pin_number); }", "tokens": 92} {"id": 380194, "source": "method", "repo": "mattjlewis/diozero", "text": "private boolean booleanInputPrompt(String prompt, boolean currentVal) { while (true) { System.out.print( prompt + \"? (y/n,yes/no,true/false,on/off) [currently \" + (currentVal ? \"on\" : \"off\") + \"]> \"); System.out.flush(); String s = readLine(); if (s.equalsIgnoreCase(\"y\") || s.equalsIgnoreCase(\"yes\") || s.equalsIgnoreCase(\"true\") || s.equalsIgnoreCase(\"on\")) { return true; } if (s.equalsIgnoreCase(\"n\") || s.equalsIgnoreCase(\"no\") || s.equalsIgnoreCase(\"false\") || s.equalsIgnoreCase(\"off\")) { return false; } System.out.println(\"Invalid response '\" + s + \"'\"); } }", "tokens": 172} {"id": 380466, "source": "method", "repo": "maximiliananzinger/pgdp2223-tests", "text": "void deleteMemberShouldReturnDeletedUser() { final var pinguTalk = new PinguTalk(0, 0); final var name = \"Test\"; final var supervisor = getTestUser(); final var addedMember = pinguTalk.addMember(name, supervisor); final var deletedMember = pinguTalk.deleteMember(addedMember.getId()); assertEquals(addedMember, deletedMember); }", "tokens": 87} {"id": 380614, "source": "method", "repo": "maximiliananzinger/pgdp2223-tests", "text": "void onBlueDownShouldNotSwitchToInitialStateWhenStateIsNotBlue() { sut.up(\"red\"); assertFalse(sut.down(\"blue\")); expectLevel(4); assertEquals(\"red\", sut.getDepiction()); }", "tokens": 45} {"id": 380711, "source": "method", "repo": "maximiliananzinger/pgdp2223-tests", "text": "void artemisExample2() { var factory = new TaskFactory(); var func = new TaskFunction<>(SQUARE); var task1 = factory.create(5, func); var task2 = new Task<>(5, func); assertEquals(task1, factory.intern(task2), \"intern should return the equal, already existing task instead of the method parameter.\"); }", "tokens": 81} {"id": 380817, "source": "method", "repo": "maximiliananzinger/pgdp2223-tests", "text": "public Numeric(String s, int l, int p) { super(s, l, p); }", "tokens": 25} {"id": 380827, "source": "method", "repo": "maximiliananzinger/pgdp2223-tests", "text": "public void testExample() { Stream trainConnections = exampleTrainConnections.stream(); Map expected = Map.of( 10, 0.0, 11, 0.0, 12, 15.0, 13, 20.0); Map actual = DataProcessing.averageDelayByHour(trainConnections); assertEquals(expected, actual); }", "tokens": 97} {"id": 380843, "source": "method", "repo": "maximiliananzinger/pgdp2223-tests", "text": "void testRegularAllStops() { // A list of train connections with only regular stops. List trainConnections = trainConnectionsWithOnly(TrainStop.Kind.REGULAR); double exepcted = 100.0; double actual = DataProcessing.percentOfKindStops(trainConnections.stream(), TrainStop.Kind.REGULAR); assertEquals(exepcted, actual); }", "tokens": 85} {"id": 380852, "source": "method", "repo": "maximiliananzinger/pgdp2223-tests", "text": "public static TrainConnection getIceBasicParsed() { return iceBasicParsed; }", "tokens": 19} {"id": 380943, "source": "method", "repo": "maximiliananzinger/pgdp2223-tests", "text": "static Stream findPathArguments() { return Stream.of( Arguments.of(\"\"\" s -> a; s -> b; a -> c; b -> c; \"\"\", \"s\", \"c\", List.of(List.of(\"s\", \"b\", \"c\"), List.of(\"s\", \"a\", \"c\"))), Arguments.of( \"\"\" s -> a; a -> b; a -> c; b -> c; b -> t; c -> t; \"\"\", \"s\", \"b\", List.of(List.of(\"s\", \"a\", \"b\")) ), Arguments.of( \"\"\" s -> a; a -> b; a -> c; b -> c; b -> t; c -> t; \"\"\", \"s\", \"t\", List.of(List.of(\"s\", \"a\", \"b\", \"t\"), List.of(\"s\", \"a\", \"c\", \"t\"), List.of(\"s\", \"a\", \"b\", \"c\", \"t\")) ), Arguments.of( \"\"\" a -> b (0/1); b -> (0/0); \"\"\", \"a\", \"c\", List.of() ), Arguments.of( // tests with potential loops \"\"\" s -> a; a -> b; a -> t; b -> c; c -> a; b -> t; c -> t; \"\"\", \"s\", \"t\", List.of(List.of(\"s\", \"a\", \"b\", \"t\"), List.of(\"s\", \"a\", \"t\"), List.of(\"s\", \"a\", \"b\", \"c\", \"t\")) ) ); }", "tokens": 353} {"id": 381154, "source": "method", "repo": "maxmaeder/drivebackupv2", "text": "public GlobBackupLocation(String glob) { this.glob = glob; }", "tokens": 18} {"id": 381306, "source": "method", "repo": "maxmaeder/drivebackupv2", "text": "/** Deletes the oldest files in the specified folder past the number to retain from the authenticated user's Google Drive.

The number of files to retain is specified by the user in the {@code config.yml} @param folder the folder containing the files @throws Exception */ private void pruneBackups(File folder) throws Exception { int fileLimit = ConfigParser.getConfig().backupStorage.keepCount; if (fileLimit == -1) { return; } List files = getFiles(folder); if (files.size() > fileLimit) { logger.info( intl(\"backup-method-limit-reached\"), \"file-count\", String.valueOf(files.size()), \"upload-method\", getName(), \"file-limit\", String.valueOf(fileLimit)); for (Iterator iterator = files.iterator(); iterator.hasNext(); ) { if (files.size() == fileLimit) { break; } ChildReference file = iterator.next(); Drive.Files.Delete removeItem = service.files().delete(file.getId()).setSupportsAllDrives(true); removeItem.execute(); iterator.remove(); } } }", "tokens": 252} {"id": 381424, "source": "method", "repo": "maxmaeder/drivebackupv2", "text": "/** Adds all online players to the list of recipients @return the calling MessageUtil's instance */ public MessageUtil all() { for (Player p : Bukkit.getOnlinePlayers()) { recipients.add(p); } return this; }", "tokens": 46} {"id": 381512, "source": "method", "repo": "maze-runnar/interview-preparation-kit", "text": "void solve() { int Q = ni(); while(Q-->0) { int n = ni(); int m = ni(); long cl = ni(); long cr = ni(); DJSet set = new DJSet(n); while(m-->0) set.union(ni()-1,ni()-1); long ans = 0; for(int i=0;i[] strWords) { for(int i = 0; i < strWords.length; i++) { System.out.println(i + \" \" + strWords[i]); } }", "tokens": 52} {"id": 381707, "source": "method", "repo": "maze-runnar/interview-preparation-kit", "text": "public int compareTo(Object o) { IceCream o2 = (IceCream) o; if(this.flavor != o2.flavor) return this.flavor - o2.flavor; return this.index - o2.index; }", "tokens": 55} {"id": 381733, "source": "method", "repo": "maze-runnar/interview-preparation-kit", "text": "static void inOrderTraverse(Node n) { if (n != null){ inOrderTraverse(n.left); inOrderTraverseResult.add(n.data + 1); inOrderTraverse(n.right); } }", "tokens": 45} {"id": 381846, "source": "method", "repo": "mcdcorp/opentest", "text": "public void run() { super.run(); driver.resetApp(); }", "tokens": 16} {"id": 381967, "source": "method", "repo": "mcdcorp/opentest", "text": "/** Reads the argument value for the specified key, as a string. @param argName The argument whose value will be returned */ public Object readArgument(String argName) { if (this.hasArgument(argName)) { return args.get(argName); } else { throw new ArgumentException(String.format( \"Mandatory argument \\\"%s\\\" was not provided for action %s.\", argName, this.getClass().getName())); } }", "tokens": 94} {"id": 381995, "source": "method", "repo": "mcdcorp/opentest", "text": "/** Writes an output value for the current this.action. @param key @param value */ protected void writeOutput(String key, Object value) { this.outputs.put(key, value); }", "tokens": 44} {"id": 382313, "source": "method", "repo": "mcdcorp/opentest", "text": "public void testStringToBoooleanNegative() { try { TypeConverter.toBooolean(\"I'm no boolean\"); fail(\"Expected exception was not thrown\"); } catch (Exception ex) { assertTrue(ex.getMessage().contains(\"value I'm no boolean\")); } }", "tokens": 60} {"id": 382370, "source": "method", "repo": "mcdcorp/opentest", "text": "public void run() { super.run(); try { this.driver.switchTo().defaultContent(); } catch (Exception ex) { throw new RuntimeException( \"Failed to switch back to the main page content\", ex); } }", "tokens": 48} {"id": 382443, "source": "method", "repo": "mcjtymods/lostcities", "text": "public static ArgumentBuilder register(CommandDispatcher dispatcher) { return Commands.literal(\"exportpart\") .requires(cs -> cs.hasPermission(1)) .then(Commands.argument(\"name\", StringArgumentType.word()).executes(CMD)); }", "tokens": 63} {"id": 382510, "source": "method", "repo": "mcjtymods/lostcities", "text": "public static EditorInfo createEditorInfo(UUID uuid, String partName, BlockPos bottomLocation) { EditorInfo info = new EditorInfo(partName, bottomLocation); EDITING.put(uuid, info); return info; }", "tokens": 48} {"id": 382515, "source": "method", "repo": "mcjtymods/lostcities", "text": "private void nl() { y += YOFFSET; }", "tokens": 12} {"id": 382631, "source": "method", "repo": "mcjtymods/lostcities", "text": "public static double squaredDistanceBoxPoint(AABB chunkBox, BlockPos center) { double dmin = 0; if (center.getX() < chunkBox.minX) { dmin += Math.pow(center.getX() - chunkBox.minX, 2); } else if (center.getX() > chunkBox.maxX) { dmin += Math.pow(center.getX() - chunkBox.maxX, 2); } if (center.getY() < chunkBox.minY) { dmin += Math.pow(center.getY() - chunkBox.minY, 2); } else if (center.getY() > chunkBox.maxY) { dmin += Math.pow(center.getY() - chunkBox.maxY, 2); } if (center.getZ() < chunkBox.minZ) { dmin += Math.pow(center.getZ() - chunkBox.minZ, 2); } else if (center.getZ() > chunkBox.maxZ) { dmin += Math.pow(center.getZ() - chunkBox.maxZ, 2); } return dmin; }", "tokens": 245} {"id": 382651, "source": "method", "repo": "mcjtymods/lostcities", "text": "private > String getName(Property property, Comparable comparable) { return property.getName((T)comparable); }", "tokens": 38} {"id": 382885, "source": "method", "repo": "mcjtymods/lostcities", "text": "public Optional getRoute(HighwayConnectionKey key) { return getOwnedRoutes(key.owner()).stream().filter(route -> route.key().equals(key)).findFirst(); }", "tokens": 42} {"id": 382886, "source": "method", "repo": "mcjtymods/lostcities", "text": "public HighwayInfo getHighwayInfo(int chunkX, int chunkZ) { ChunkKey key = new ChunkKey(chunkX, chunkZ); return chunkCache.computeIfAbsent(key, ignored -> { uncachedChunkQueries.incrementAndGet(); return calculateHighwayInfo(chunkX, chunkZ); }); }", "tokens": 58} {"id": 383025, "source": "method", "repo": "mcjtymods/lostcities", "text": "public static void cleanCache() { MULTICHUNKS.clear(); }", "tokens": 16} {"id": 383034, "source": "method", "repo": "mcjtymods/lostcities", "text": "public static void cleanCache() { RAIL_INFO.clear(); }", "tokens": 16} {"id": 383237, "source": "method", "repo": "mcjtymods/lostcities", "text": "public List tunnel(boolean bi) { return bi ? tunnelBi : tunnel; }", "tokens": 21} {"id": 383384, "source": "method", "repo": "mcmonkeyprojects/sentinel", "text": "/** Gets the owner identity of an NPC for output (player name or default String value). */ public String getOwner(NPC npc, String defName) { Owner trait = npc.getOrAddTrait(Owner.class); if (trait.getOwnerId() == null) { return trait.getOwner(); } OfflinePlayer player = Bukkit.getOfflinePlayer(trait.getOwnerId()); if (player == null || !player.hasPlayedBefore() || player.getName() == null) { return defName; } return player.getName(); }", "tokens": 112} {"id": 383514, "source": "method", "repo": "mcmonkeyprojects/sentinel", "text": "/** Handles a player or server command. */ public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { String modifier = args.length > 0 ? args[0] : \"\"; if (!manager.hasCommand(command, modifier) && !modifier.isEmpty()) { String closest = manager.getClosestCommandModifier(command.getName(), modifier); if (!closest.isEmpty()) { sender.sendMessage(prefixBad + \"Unknown command. Did you mean:\"); sender.sendMessage(prefixGood + \" /\" + command.getName() + \" \" + closest); } else { sender.sendMessage(prefixBad + \"Unknown command.\"); } return true; } NPC selected = CitizensAPI.getDefaultNPCSelector().getSelected(sender); SentinelTrait sentinel = null; CommandContext context = new CommandContext(sender, args); if (context.hasValueFlag(\"id\") && sender.hasPermission(\"npc.select\")) { try { selected = CitizensAPI.getNPCRegistry().getById(context.getFlagInteger(\"id\")); } catch (NumberFormatException ex) { sender.sendMessage(prefixBad + \"ID input is invalid (not an integer)!\"); return true; } } if (selected != null) { sentinel = selected.getTraitNullable(SentinelTrait.class); } Object[] methodArgs; if (isSentinelRequired(command.getName(), modifier)) { if (sentinel == null) { if (selected == null) { sender.sendMessage(prefixBad + \"Must have a Sentinel NPC selected!\"); } else { sender.sendMessage(prefixBad + \"Selected NPC is not a Sentinel! Use /trait sentinel to ensure an NPC becomes a Sentinel.\"); } return true; } if (!selected.getOrAddTrait(Owner.class).isOwnedBy(sender) && !sender.hasPermission(\"citizens.admin\")) { sender.sendMessage(prefixBad + \"You do not own this NPC (and you are not an admin).\"); return true; } methodArgs = new Object[]{sender, sentinel}; } else { methodArgs = new Object[]{ sender }; } return manager.executeSafe(command, args, sender, methodArgs); }", "tokens": 452} {"id": 383515, "source": "method", "repo": "mcmonkeyprojects/sentinel", "text": "private static List filterForArg(Collection output, String arg1) { String low = arg1.toLowerCase(); return output.stream().filter(s -> s.startsWith(low)).collect(Collectors.toList()); }", "tokens": 53} {"id": 383721, "source": "method", "repo": "mcmonkeyprojects/sentinel", "text": "/** Adds a set of materials to a map as keys with a specific value. */ public static void allMaterialsTo(Map map, Set set, Double val) { for (Material mat : set) { map.put(mat, val); } }", "tokens": 61} {"id": 383948, "source": "method", "repo": "mcphackers/retromcp-java", "text": "public Stage stage(String name, int percentage, TaskRunnable task) { return new Stage(name, percentage, task); }", "tokens": 27} {"id": 383958, "source": "method", "repo": "mcphackers/retromcp-java", "text": "public void updateMD5(boolean reobf) throws IOException { final Path binPath = MCPPaths.get(mcp, BIN, side); final Path md5 = MCPPaths.get(mcp, reobf ? MD5_RO : MD5, side); if (!Files.exists(binPath)) { IOException t = new IOException(side.name + \" classes not found!\"); Util.throwExceptionInIDE(t); throw t; } try (BufferedWriter writer = Files.newBufferedWriter(md5)) { progress = 0; int total; try (Stream pathStream = Files.walk(binPath)) { total = (int) pathStream.parallel() .filter(p -> !p.toFile().isDirectory()) .count(); } Files.walkFileTree(binPath, new SimpleFileVisitor() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { String md5_hash = Util.getMD5(file); String fileName = binPath.relativize(file).toString().replace(\"\\\\\", \"/\").replace(\".class\", \"\"); writer.append(fileName).append(\" \").append(md5_hash).append(\"\\n\"); progress++; setProgress(50 + (int) ((double) progress / (double) total * 50)); return FileVisitResult.CONTINUE; } }); } }", "tokens": 295} {"id": 384054, "source": "method", "repo": "mcphackers/retromcp-java", "text": "private static String[] normalize(String[] raw) { if (raw == null) return new String[0]; java.util.List out = new java.util.ArrayList<>(raw.length); for (String s : raw) { if (s == null) continue; String t = s.trim(); if (t.isEmpty()) continue; int eq = t.indexOf('='); if (eq >= 0) t = t.substring(eq + 1).trim(); if (t.isEmpty()) continue; t = t.replace('.', '/'); if (!t.endsWith(\"/\")) t = t + \"/\"; out.add(t); } return out.toArray(new String[0]); }", "tokens": 153} {"id": 384265, "source": "method", "repo": "mcxr-org/mcxr", "text": "public static void resetView() { Vector3f pos = new Vector3f(MCXRPlayClient.viewSpacePoses.getStagePose().getPos()); new Quaternionf().rotateLocalY(stageTurn).transform(pos); if (MCXRCore.getCoreConfig().roomscaleMovement()) { playerPhysicalPosition.set(MCXRPlayClient.viewSpacePoses.getPhysicalPose().getPos()); } else { playerPhysicalPosition.zero(); } MCXRPlayClient.stagePosition = new Vector3f(0, 0, 0).sub(pos).mul(1, 0, 1); }", "tokens": 127} {"id": 384348, "source": "method", "repo": "mcxr-org/mcxr", "text": "public void capsButton(Button button) { _caps = !_caps; this._signEditScreen.clear(); renderKeyboard(_shift? this.getShiftCharset() : _caps? this.getCapsCharset() : this.getDefaultCharset(), _signEditScreen.width, _signEditScreen.height, 30); }", "tokens": 77} {"id": 384578, "source": "method", "repo": "mdeverdelhan/ta4j-origins", "text": "public int getBeginIndex() { return seriesBeginIndex; }", "tokens": 14} {"id": 384667, "source": "method", "repo": "mdeverdelhan/ta4j-origins", "text": "/** Runs the provided strategy over the managed series (from startIndex to finishIndex).

Opens the trades with {@link OrderType.BUY} orders. @param strategy the trading strategy @param startIndex the start index for the run (included) @param finishIndex the finish index for the run (included) @return the trading record coming from the run */ public TradingRecord run(Strategy strategy, int startIndex, int finishIndex) { return run(strategy, OrderType.BUY, Decimal.NaN, startIndex, finishIndex); }", "tokens": 112} {"id": 384818, "source": "method", "repo": "mdeverdelhan/ta4j-origins", "text": "public WilliamsRIndicator(TimeSeries timeSeries, int timeFrame) { this(new ClosePriceIndicator(timeSeries), timeFrame, new MaxPriceIndicator(timeSeries), new MinPriceIndicator( timeSeries)); }", "tokens": 44} {"id": 384820, "source": "method", "repo": "mdeverdelhan/ta4j-origins", "text": "public ZLEMAIndicator(Indicator indicator, int timeFrame) { super(indicator); this.indicator = indicator; this.timeFrame = timeFrame; k = Decimal.TWO.dividedBy(Decimal.valueOf(timeFrame + 1)); lag = (timeFrame - 1) / 2; }", "tokens": 66} {"id": 384866, "source": "method", "repo": "mdeverdelhan/ta4j-origins", "text": "protected Decimal calculate(int index) { Tick tick = series.getTick(index); return ((tick.getClosePrice().minus(tick.getMinPrice())).minus(tick.getMaxPrice().minus(tick.getClosePrice()))) .dividedBy(tick.getMaxPrice().minus(tick.getMinPrice())); }", "tokens": 65} {"id": 385032, "source": "method", "repo": "mdeverdelhan/ta4j-origins", "text": "public void addTickWithEndTimePriorToSeriesEndTimeShouldThrowException() { defaultSeries.addTick(new MockTick(ZonedDateTime.of(2000, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault()), 99d)); }", "tokens": 61} {"id": 385296, "source": "method", "repo": "mdeverdelhan/ta4j-origins", "text": "public void getValue() { List ticks = new ArrayList(); ticks.add(new MockTick(0, 12, 15, 8)); ticks.add(new MockTick(0, 8, 11, 6)); ticks.add(new MockTick(0, 15, 17, 14)); ticks.add(new MockTick(0, 15, 17, 14)); ticks.add(new MockTick(0, 0, 0, 2)); TrueRangeIndicator tr = new TrueRangeIndicator(new MockTimeSeries(ticks)); assertDecimalEquals(tr.getValue(0), 7); assertDecimalEquals(tr.getValue(1), 6); assertDecimalEquals(tr.getValue(2), 9); assertDecimalEquals(tr.getValue(3), 3); assertDecimalEquals(tr.getValue(4), 15); }", "tokens": 193} {"id": 385311, "source": "method", "repo": "mdeverdelhan/ta4j-origins", "text": "public void testGetTotalReturn() { PeriodicalGrowthRateIndicator gri = new PeriodicalGrowthRateIndicator(this.closePrice, 5); double expResult = 0.9564; double result = gri.getTotalReturn(); assertEquals(expResult, result, 0.01); }", "tokens": 68} {"id": 385426, "source": "method", "repo": "megavexnetwork/scoreboard-library", "text": "public boolean removePlayer(@NotNull Player player) { return players.remove(player); }", "tokens": 19} {"id": 385452, "source": "method", "repo": "megavexnetwork/scoreboard-library", "text": "public Collection players() { return closed ? Collections.emptySet() : Collections.unmodifiableSet(players); }", "tokens": 24} {"id": 385476, "source": "method", "repo": "megavexnetwork/scoreboard-library", "text": "public TeamDisplay suffix(@NotNull ComponentLike suffix) { this.suffix = suffix.asComponent(); return this; }", "tokens": 24} {"id": 385606, "source": "method", "repo": "megavexnetwork/scoreboard-library", "text": "public void display(@NotNull ObjectiveDisplaySlot displaySlot, @NotNull ScoreboardObjective objective) { Preconditions.checkNotNull(displaySlot); Preconditions.checkNotNull(objective); checkClosed(); if (!(objective instanceof ScoreboardObjectiveImpl)) { throw new IllegalArgumentException(\"Invalid objective implementation\"); } ScoreboardObjectiveImpl impl = (ScoreboardObjectiveImpl) objective; if (objectives.get(impl.name()) != impl) { throw new IllegalArgumentException(\"Objective is from a different manager\"); } displaySlots.put(displaySlot, impl); taskQueue.add(new ObjectiveManagerTask.UpdateDisplaySlot(displaySlot, impl)); }", "tokens": 128} {"id": 385655, "source": "method", "repo": "megavexnetwork/scoreboard-library", "text": "public ObjectivePacketAdapter createObjectiveAdapter(@NotNull String objectiveName) { if (!NmsClasses.IS_1_13_OR_ABOVE) { return new LegacyObjectivePacketAdapterImpl(this, objectiveName); } return NmsComponent.IS_NATIVE_ADVENTURE ? new PaperObjectivePacketAdapter(this, objectiveName) : new SpigotObjectivePacketAdapter(this, objectiveName); }", "tokens": 85} {"id": 385702, "source": "method", "repo": "megavexnetwork/scoreboard-library", "text": "public void sendScore(@NotNull Collection players, @NotNull String entry, int value, @Nullable Component display, @Nullable ScoreFormat scoreFormat) { LocalePacketUtil.sendLocalePackets(provider.packetSender(), players, locale -> { Object nmsDisplay = display == null ? null : NmsComponent.fromAdventure(display, locale); Object numberFormat = NmsScoreFormat.convert(locale, scoreFormat); return createScorePacket(entry, value, nmsDisplay, numberFormat); }); }", "tokens": 108} {"id": 385720, "source": "method", "repo": "megavexnetwork/scoreboard-library", "text": "public void sendEntries(@NotNull EntriesPacketType packetType, @NotNull Collection players, @NotNull Collection entries) { Object packet = NmsTeams.TEAM_PACKET_CONSTRUCTOR.invoke(); Objects.requireNonNull(NmsTeams.TEAM_NAME_FIELD).set(packet, teamName); Objects.requireNonNull(NmsTeams.TEAM_MODE_FIELD).set(packet, TeamConstants.mode(packetType)); Objects.requireNonNull(NmsTeams.TEAM_ENTRIES_FIELD).set(packet, entries); provider.packetSender().sendPacket(players, packet); }", "tokens": 125} {"id": 385737, "source": "method", "repo": "megavexnetwork/scoreboard-library", "text": "public static int mode(@NotNull EntriesPacketType packetType) { switch (packetType) { case ADD: return MODE_ADD_ENTRIES; case REMOVE: return MODE_REMOVE_ENTRIES; default: throw new IllegalStateException(); } }", "tokens": 54} {"id": 385821, "source": "method", "repo": "megavexnetwork/scoreboard-library", "text": "public int objectiveScore() { return objectiveScore; }", "tokens": 12} {"id": 386003, "source": "method", "repo": "meilisearch/meilisearch-java", "text": "/** Renders a template using the experimental render-template route. @param request Render template request body @return Rendered template result @throws MeilisearchException if an error occurs */ public RenderTemplateResult renderTemplate(RenderTemplateRequest request) throws MeilisearchException { return this.config.httpClient.post(\"/render-template\", request, RenderTemplateResult.class); }", "tokens": 74} {"id": 386112, "source": "method", "repo": "meilisearch/meilisearch-java", "text": "/** Updates the synonyms settings of the index @param synonyms key (String) value (array) pair of synonyms @return TaskInfo instance @throws MeilisearchException if an error occurs @see API specification */ public TaskInfo updateSynonymsSettings(Map synonyms) throws MeilisearchException { return this.settingsHandler.updateSynonymsSettings(this.uid, synonyms); }", "tokens": 111} {"id": 386173, "source": "method", "repo": "meilisearch/meilisearch-java", "text": "/** Constructor for MultiSearchRequest for building search queries with the default values: offset: 0, limit: 20, attributesToRetrieve: [\"*\"], attributesToCrop: null, cropLength: 200, attributesToHighlight: null, filter: null, showMatchesPosition: false, facets: null, sort: null, showRankingScore: false, showRankingScoreDetails: false, rankingScoreThreshold: null distinct: null, retrieveVectors: false, hybrid: null @param indexUid uid of the requested index String */ public IndexSearchRequest(String indexUid) { this(); this.indexUid = indexUid; }", "tokens": 136} {"id": 386296, "source": "method", "repo": "meilisearch/meilisearch-java", "text": "/** Add index uid to index uids list in task query */ TasksQuery addIndexUidToQuery(String indexUid, TasksQuery param) { if (param != null && param.getIndexUids() != null) { String[] newIndexUid = new String[param.getIndexUids().length + 1]; for (int i = 0; i < param.getIndexUids().length; i++) newIndexUid[i] = param.getIndexUids()[i]; newIndexUid[param.getIndexUids().length] = indexUid; param.setIndexUids(newIndexUid); } else if (param != null) { param.setIndexUids(new String[] {indexUid}); } else { param = new TasksQuery().setIndexUids(new String[] {indexUid}); } return param; }", "tokens": 187} {"id": 386385, "source": "method", "repo": "meilisearch/meilisearch-java", "text": "private void writeNull(JsonWriter writer, String key) throws IOException { writer.name(key).nullValue(); }", "tokens": 25} {"id": 386431, "source": "method", "repo": "meilisearch/meilisearch-java", "text": "private EmbedderSource(String source) { this.source = source; }", "tokens": 17} {"id": 386445, "source": "method", "repo": "meilisearch/meilisearch-java", "text": "public IndexStats( long numberOfDocuments, boolean isIndexing, Map fieldDistribution, long rawDocumentDbSize, long avgDocumentSize, long numberOfEmbeddedDocuments, long numberOfEmbeddings) { this.numberOfDocuments = numberOfDocuments; this.isIndexing = isIndexing; this.fieldDistribution = fieldDistribution; this.rawDocumentDbSize = rawDocumentDbSize; this.avgDocumentSize = avgDocumentSize; this.numberOfEmbeddedDocuments = numberOfEmbeddedDocuments; this.numberOfEmbeddings = numberOfEmbeddings; }", "tokens": 109} {"id": 386576, "source": "method", "repo": "meilisearch/meilisearch-java", "text": "public void testAttributeToSearchOnSuccess() throws Exception { String indexUid = \"SearchOnAttributesSuccess\"; Index index = client.index(indexUid); GsonJsonHandler jsonGson = new GsonJsonHandler(); TestData testData = this.getTestData(MOVIES_INDEX, Movie.class); TaskInfo task = index.addDocuments(testData.getRaw()); index.waitForTask(task.getTaskUid()); SearchRequest searchRequest = SearchRequest.builder() .q(\"videogame\") .attributesToSearchOn(new String[] {\"overview\"}) .build(); Results resGson = jsonGson.decode(index.rawSearch(searchRequest), Results.class); assertThat(resGson.hits, is(arrayWithSize(1))); assertThat(resGson.hits[0].getOverview(), instanceOf(String.class)); }", "tokens": 169} {"id": 386717, "source": "method", "repo": "meilisearch/meilisearch-java", "text": "public void testGetWebhooks() throws Exception { HashMap headers = new HashMap<>(); headers.put(\"authorization\", \"MASTER_KEY\"); headers.put(\"referer\", \"http://example.com\"); CreateUpdateWebhookRequest webhookReq1 = new CreateUpdateWebhookRequest(\"http://webiste.com\", headers); CreateUpdateWebhookRequest webhookReq2 = new CreateUpdateWebhookRequest(\"http://webiste1.com\", headers); this.client.createWebhook(webhookReq1); this.client.createWebhook(webhookReq2); Results webhooks = client.getWebhooks(); Webhook webhook = webhooks.getResults()[0]; Webhook webhook1 = webhooks.getResults()[1]; assertThat(webhook, is(instanceOf(Webhook.class))); assertThat(webhook.getUuid(), is(notNullValue())); assertThat(webhook.getHeaders(), is(notNullValue())); assertThat(webhook.getUrl(), is(notNullValue())); assertThat(webhook.isEditable(), is(notNullValue())); assertThat(webhook1, is(instanceOf(Webhook.class))); assertThat(webhook1.getUuid(), is(notNullValue())); assertThat(webhook1.getHeaders(), is(notNullValue())); assertThat(webhook1.getUrl(), is(notNullValue())); assertThat(webhook1.isEditable(), is(notNullValue())); cleanUp(); }", "tokens": 268} {"id": 386847, "source": "method", "repo": "meilisearch/meilisearch-java", "text": "public String[] getGenres() { return genres; }", "tokens": 14} {"id": 386941, "source": "method", "repo": "mekanism/mekanism", "text": "public int hashCode() { int result = input.hashCode(); result = 31 * result + leftChemicalOutput.hashCode(); result = 31 * result + rightChemicalOutput.hashCode(); result = 31 * result + energyMultiplier; return result; }", "tokens": 56} {"id": 386964, "source": "method", "repo": "mekanism/mekanism", "text": "default int insert(@Range(from = 0, to = Integer.MAX_VALUE) int index, RESOURCE resource, @Range(from = 0, to = Integer.MAX_VALUE) int amount, TransactionContext transaction, AutomationType automationType) { return getContainer(index).insert(resource, amount, transaction, automationType); }", "tokens": 76} {"id": 386981, "source": "method", "repo": "mekanism/mekanism", "text": "private void addSolarNeutronActivatorRecipes() { String basePath = \"activating/\"; ChemicalToChemicalRecipeBuilder.activating( IngredientCreatorAccess.chemicalStack().from(this.chemicals, ChemicalIds.LITHIUM, 1), chemicalTemplate(ChemicalIds.TRITIUM, 1) ).save(output, MekanismGenerators.rl(basePath + \"tritium\")); }", "tokens": 91} {"id": 386999, "source": "method", "repo": "mekanism/mekanism", "text": "protected void addFluid(FluidRegistryObject fluidRO, String name) { add(fluidRO.getBlock(), name); add(fluidRO.getBucket(), name + \" Bucket\"); add(ItemTags.create(Tags.Items.BUCKETS.location().withSuffix(\"/\" + fluidRO.getName())), name + \" Buckets\"); }", "tokens": 78} {"id": 387118, "source": "method", "repo": "mekanism/mekanism", "text": "private static void addFluidComponent(Set representation, ItemAccess itemAccess) { ResourceHandler handler = ContainerType.FLUID.getCapOrUnexposed(itemAccess); if (handler != null) { int tanks = handler.size(); if (tanks == 1) { FluidResource fluidStack = handler.getResource(0); if (!fluidStack.isEmpty()) { representation.add(fluidStack); } } else if (tanks > 1) { List fluids = new ArrayList<>(tanks); for (int tank = 0; tank < tanks; tank++) { fluids.add(handler.getResource(tank)); } representation.add(fluids); } } }", "tokens": 157} {"id": 387155, "source": "method", "repo": "mekanism/mekanism", "text": "public BooleanSupplier trackWarning(WarningType type, BooleanSupplier warningSupplier) { if (warningTracker == null) { warningTracker = new WarningTracker(); } return warningTracker.trackWarning(type, warningSupplier); }", "tokens": 47} {"id": 387216, "source": "method", "repo": "mekanism/mekanism", "text": "public void tick() { super.tick(); //Decrease timer for stack display rotation if (stackSwitchTicker > 0) { stackSwitchTicker--; } //Update displayed stacks if (iterStacks.isEmpty()) { renderStack = ItemStack.EMPTY; } else if (stackSwitchTicker == 0) { int size = iterStacks.size(); if (stackIndex == -1 || stackIndex == size - 1) { stackIndex = 0; } else if (stackIndex < size - 1) { stackIndex++; } stackIndex = Math.min(size - 1, stackIndex); renderStack = iterStacks.get(stackIndex); stackSwitchTicker = SharedConstants.TICKS_PER_SECOND; } }", "tokens": 152} {"id": 387241, "source": "method", "repo": "mekanism/mekanism", "text": "public boolean isSingleItem() { return tile.getSingleItem(); }", "tokens": 15} {"id": 387244, "source": "method", "repo": "mekanism/mekanism", "text": "protected void drawForegroundText(GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY) { if (inputGauge == null) { renderTitleText(guiGraphics); } else { renderTitleTextWithOffset(guiGraphics, inputGauge.getRelativeRight()); } super.drawForegroundText(guiGraphics, mouseX, mouseY); }", "tokens": 63} {"id": 387380, "source": "method", "repo": "mekanism/mekanism", "text": "public ConfigTranslation(String getTranslationKey, String title, String tooltip) { this(getTranslationKey, title, tooltip, null); }", "tokens": 28} {"id": 387452, "source": "method", "repo": "mekanism/mekanism", "text": "protected QIOItemTypeData.Snapshot createSnapshot() { return new QIOItemTypeData.Snapshot(count, justAdded, new HashSet<>(containingDrives)); }", "tokens": 34} {"id": 387478, "source": "method", "repo": "mekanism/mekanism", "text": "public Object convert(@Nullable BlockState state) { if (state == null) { return null; } Map wrapped = new HashMap<>(2); wrapped.put(SerializationConstants.BLOCK, state.typeHolder().getRegisteredName()); Map stateData = state.getValues().collect(HashMap::new, (map, entry) -> { Property property = entry.property(); Object value = entry.value(); if (!(property instanceof IntegerProperty) && !(property instanceof BooleanProperty)) { value = Util.getPropertyName(property, value); } map.put(property.getName(), value); }, HashMap::putAll); if (!stateData.isEmpty()) { wrapped.put(SerializationConstants.STATE, stateData); } return wrapped; }", "tokens": 161} {"id": 387509, "source": "method", "repo": "mekanism/mekanism", "text": "protected void onSwapCraft(int numItemsCrafted) { //Note: This method is only called if mayPickup returns true amountCrafted += numItemsCrafted; }", "tokens": 38} {"id": 387559, "source": "method", "repo": "mekanism/mekanism", "text": "public Version(ModContainer container) { this(container.getModInfo().getVersion()); }", "tokens": 18} {"id": 387715, "source": "method", "repo": "mekanism/mekanism", "text": "public void serialize(ValueOutput securityOutput) { if (securityMode != SecurityMode.PUBLIC) { securityOutput.store(SerializationConstants.SECURITY_MODE, SecurityMode.CODEC, securityMode); } securityOutput.storeNullable(SerializationConstants.OWNER_UUID, UUIDUtil.CODEC, ownerUUID); }", "tokens": 65} {"id": 388080, "source": "method", "repo": "MemoryZy/Json-Assistant", "text": "public String type() { return DataTypeConstant.TYPE_SCRIPT; }", "tokens": 15} {"id": 388149, "source": "method", "repo": "MemoryZy/Json-Assistant", "text": "public Deque getHistories() { return histories; }", "tokens": 19} {"id": 388319, "source": "method", "repo": "MemoryZy/Json-Assistant", "text": "private ErrorBorder(Border delegate) { errorDelegateBorder = delegate; }", "tokens": 16} {"id": 388342, "source": "method", "repo": "MemoryZy/Json-Assistant", "text": "protected boolean accept(@Nullable String name) { if (name == null) return true; return mySpeedSearch.matchingFragments(name) != null; }", "tokens": 33} {"id": 388568, "source": "method", "repo": "meraki-analytics/orianna", "text": "/** @return the backoffFactor */ public int getBackoffFactor() { return backoffFactor; }", "tokens": 20} {"id": 388744, "source": "method", "repo": "meraki-analytics/orianna", "text": "public StatTotals get() { if(coreData.getCreepScore() == null) { return null; } return new StatTotals(coreData.getCreepScore()); }", "tokens": 43} {"id": 388747, "source": "method", "repo": "meraki-analytics/orianna", "text": "public Item get() { if(coreData.getItemId() == 0) { return null; } return Item.withId(coreData.getItemId()).get(); }", "tokens": 33} {"id": 388840, "source": "method", "repo": "meraki-analytics/orianna", "text": "private SubsetBuilder(final Iterable ids, final boolean areIds) { if(areIds) { this.ids = (Iterable)ids; } else { names = (Iterable)ids; } }", "tokens": 50} {"id": 389011, "source": "method", "repo": "meraki-analytics/orianna", "text": "/** @param onHitPhysicalDamageAgainstMinions the onHitPhysicalDamageAgainstMinions to set */ public void setOnHitPhysicalDamageAgainstMinions(final double onHitPhysicalDamageAgainstMinions) { this.onHitPhysicalDamageAgainstMinions = onHitPhysicalDamageAgainstMinions; }", "tokens": 63} {"id": 389030, "source": "method", "repo": "meraki-analytics/orianna", "text": "/** @param legacyMode the legacyMode to set */ public void setLegacyMode(final String legacyMode) { this.legacyMode = legacyMode; }", "tokens": 33} {"id": 389033, "source": "method", "repo": "meraki-analytics/orianna", "text": "public boolean equals(final Object obj) { if(this == obj) { return true; } if(obj == null) { return false; } if(getClass() != obj.getClass()) { return false; } final ReforgedRuneTree other = (ReforgedRuneTree)obj; if(domination == null) { if(other.domination != null) { return false; } } else if(!domination.equals(other.domination)) { return false; } if(inspriation == null) { if(other.inspriation != null) { return false; } } else if(!inspriation.equals(other.inspriation)) { return false; } if(precision == null) { if(other.precision != null) { return false; } } else if(!precision.equals(other.precision)) { return false; } if(resolve == null) { if(other.resolve != null) { return false; } } else if(!resolve.equals(other.resolve)) { return false; } if(sorcery == null) { if(other.sorcery != null) { return false; } } else if(!sorcery.equals(other.sorcery)) { return false; } return true; }", "tokens": 282} {"id": 389158, "source": "method", "repo": "meraki-analytics/orianna", "text": "/** @return the gameMode */ public String getGameMode() { return gameMode; }", "tokens": 19} {"id": 389613, "source": "method", "repo": "mercadopago/sdk-java", "text": "void updateWithRequestOptionsSuccess() throws IOException, MPException, MPApiException { HttpResponse httpResponse = generateHttpResponseFromFile(paymentBaseJson, OK); doReturn(httpResponse) .when(HTTP_CLIENT) .execute(any(HttpRequestBase.class), any(HttpContext.class)); AdvancedPaymentUpdateRequest request = AdvancedPaymentUpdateRequest.builder() .capture(true) .build(); AdvancedPayment payment = client.update(20458724L, request, buildRequestOptions()); assertNotNull(payment.getResponse()); assertEquals(OK, payment.getResponse().getStatusCode()); assertEquals(20458724L, payment.getId()); }", "tokens": 132} {"id": 389646, "source": "method", "repo": "mercadopago/sdk-java", "text": "public void createWithRequestOptionsSuccess() { try { CustomerRequest request = CustomerRequest.builder().email(generateTestEmail()).build(); Customer customer = customerClient.create(request, buildRequestOptions()); assertNotNull(customer.getResponse()); assertEquals(CREATED, customer.getResponse().getStatusCode()); assertNotNull(customer.getId()); } catch (MPApiException mpApiException) { fail(mpApiException.getApiResponse().getContent()); } catch (MPException mpException) { fail(mpException.getMessage()); } }", "tokens": 96} {"id": 389701, "source": "method", "repo": "mercadopago/sdk-java", "text": "void checkoutProResponseHasRetriesConfig() throws MPException, MPApiException, IOException { HttpResponse response = generateHttpResponseFromFile(CHECKOUT_PRO_RESPONSE_FILE, HttpStatus.CREATED); Mockito.doReturn(response).when(HTTP_CLIENT).execute(any(HttpRequestBase.class), any(HttpContext.class)); Order order = client.create(buildCheckoutProRequest()); OrderOnlineConfig onlineConfig = order.getConfig().getOnline(); Assertions.assertNotNull(onlineConfig.getRetries()); Assertions.assertFalse(onlineConfig.getRetries().getAllowed()); }", "tokens": 112} {"id": 389738, "source": "method", "repo": "mercadopago/sdk-java", "text": "void validTransactionIDWithEmptyIdThrowsException() { String emptyId = \"\"; IllegalArgumentException exception = Assertions.assertThrows(IllegalArgumentException.class, () -> { client.validateTransactionID(emptyId); }); Assertions.assertEquals(\"Transaction id cannot be null or empty\", exception.getMessage()); }", "tokens": 60} {"id": 389798, "source": "method", "repo": "mercadopago/sdk-java", "text": "private Payment createPixPayment(MPRequestOptions requestOptions) throws IOException, MPException, MPApiException { return this.createPayment(\"pix\", requestOptions); }", "tokens": 29} {"id": 389832, "source": "method", "repo": "mercadopago/sdk-java", "text": "void getPaymentIntentStatusWithRequestOptionsSuccess() { try { PointPaymentIntentRequest request = buildPaymentIntentRequest(); PointPaymentIntent paymentIntent = client.createPaymentIntent(deviceId, request); PointStatusPaymentIntent paymentIntentStatus = client.getPaymentIntentStatus(paymentIntent.getId(), buildRequestOptions()); assertNotNull(paymentIntentStatus.getResponse()); assertEquals(OK, paymentIntentStatus.getResponse().getStatusCode()); assertEquals(\"OPEN\", paymentIntentStatus.getStatus()); assertNotNull(paymentIntentStatus.getCreatedOn()); client.cancelPaymentIntent(deviceId, paymentIntent.getId()); } catch (MPApiException mpApiException) { fail(mpApiException.getApiResponse().getContent()); } catch (MPException mpException) { fail(mpException.getMessage()); } }", "tokens": 139} {"id": 389853, "source": "method", "repo": "mercadopago/sdk-java", "text": "void getWithRequestOptionsSuccess() { try { PreapprovalCreateRequest request = generatePreapprovalRequest(); Preapproval preapprovalCreated = client.create(request); MPRequestOptions requestOptions = buildRequestOptions(); Preapproval preapproval = client.get(preapprovalCreated.getId(), requestOptions); assertNotNull(preapproval.getResponse()); assertEquals(OK, preapproval.getResponse().getStatusCode()); assertEquals(preapprovalCreated.getId(), preapproval.getId()); } catch (MPApiException mpApiException) { fail(mpApiException.getApiResponse().getContent()); } catch (MPException mpException) { fail(mpException.getMessage()); } }", "tokens": 118} {"id": 389904, "source": "method", "repo": "mercadopago/sdk-java", "text": "void rateLimitException_statusCode429_withRetryAfter() { MPRateLimitException ex = new MPRateLimitException(\"msg\", buildResponse(429), 30L); assertInstanceOf(MPApiException.class, ex); assertEquals(429, ex.getStatusCode()); assertEquals(30L, ex.getRetryAfter()); }", "tokens": 72} {"id": 389956, "source": "method", "repo": "mercadopago/sdk-java", "text": "void send_402_throwsMPPaymentException() throws IOException { doReturn(buildResponse(402, \"{}\")) .when(HTTP_CLIENT) .execute(any(HttpRequestBase.class), any(HttpContext.class)); MPApiException ex = assertThrows(MPApiException.class, () -> client.send(buildGetRequest())); assertInstanceOf(MPPaymentException.class, ex); assertEquals(402, ex.getStatusCode()); }", "tokens": 92} {"id": 389987, "source": "method", "repo": "mercadopago/sdk-java", "text": "public void deserializeResultsResourcesPageFromJsonErrorThrowsJsonParseException() { Type responseType = new TypeToken>() {}.getType(); assertThrows( MPJsonParseException.class, () -> Serializer.deserializeElementsResourcesPageFromJson(responseType, malformedJson)); }", "tokens": 55} {"id": 390045, "source": "method", "repo": "mercedes-benz/dna", "text": "public ResponseEntity permissionDetails(String dagName, String projectId) { AirflowRetryDagVo data = dagMgmtService.getPermission(dagName, projectId); AirflowDagRetryResponseVO res = new AirflowDagRetryResponseVO(); res.setStatus(\"SUCCESS\"); res.setData(data); return new ResponseEntity(res, HttpStatus.OK); }", "tokens": 90} {"id": 390070, "source": "method", "repo": "mercedes-benz/dna", "text": "public void init(FilterConfig filterconfig) throws ServletException { }", "tokens": 15} {"id": 390084, "source": "method", "repo": "mercedes-benz/dna", "text": "public ResponseEntity updateAirflowDag(AirflowDagUpdateVO dag) { LOGGER.trace(\"Entering updateAirflowDag.\"); AirflowDagUpdateResponseVO res = new AirflowDagUpdateResponseVO(); HttpStatus status = null; AirflowProjectUserVO currentUser = this.userStore.getVO(); List validErrors = validateUpdate(dag, currentUser); if (ObjectUtils.isEmpty(validErrors)) { List errors = airflowGitClient.updateAirflowDag(dag, currentUser); if (ObjectUtils.isEmpty(errors)) { status = HttpStatus.CREATED; } else { status = HttpStatus.INTERNAL_SERVER_ERROR; } } else { status = HttpStatus.BAD_REQUEST; res.setErrors(validErrors); } res.setData(dag); LOGGER.trace(\"Returning from updateAirflowDag.\"); return new ResponseEntity(res, status); }", "tokens": 204} {"id": 390197, "source": "method", "repo": "mercedes-benz/dna", "text": "public TagVO toVo(TagNsql entity) { TagVO tagVO = null; if (Objects.nonNull(entity)) { tagVO = new TagVO(); tagVO.setId(entity.getId()); tagVO.setName(entity.getData().getName()); } return tagVO; }", "tokens": 61} {"id": 390266, "source": "method", "repo": "mercedes-benz/dna", "text": "private void setAttrs(Attrs attrs) { this.id = attrs.getUid() != null ? attrs.getUid().get(0) : \"\"; this.firstName = attrs.getGivenName() != null ? attrs.getGivenName().get(0) : \"\"; this.lastName = attrs.getSn() != null ? attrs.getSn().get(0) : \"\"; this.email = attrs.getMail() != null ? attrs.getMail().get(0) : \"\"; this.mobileNumber = attrs.getMobile() != null ? attrs.getMobile().get(0) : \"\"; this.department = attrs.getDepartmentNumber() != null ? attrs.getDepartmentNumber().get(0) : \"\"; }", "tokens": 151} {"id": 390384, "source": "method", "repo": "mercedes-benz/dna", "text": "private Object[] getLiteralForVariable(CriteriaBuilder cb, Root root, String inputVariable) { List> expressions = new ArrayList<>(); boolean isNumber = false; if (inputVariable != null) { switch (inputVariable) { case \"productName\": expressions.add(root.get(\"data\")); expressions.add(cb.literal(\"productName\")); break; case \"currentPhase\": expressions.add(root.get(\"data\")); expressions.add(cb.literal(\"currentPhase\")); expressions.add(cb.literal(\"name\")); break; case \"division\": expressions.add(root.get(\"data\")); expressions.add(cb.literal(\"division\")); expressions.add(cb.literal(\"name\")); break; case \"projectStatus\": expressions.add(root.get(\"data\")); expressions.add(cb.literal(\"projectStatus\")); expressions.add(cb.literal(\"name\")); break; case \"digitalValue\": expressions.add(root.get(\"data\")); expressions.add(cb.literal(\"digitalValueDetails\")); expressions.add(cb.literal(\"digitalValue\")); isNumber = true; break; default: break; } } return new Object[] { expressions.toArray(new Expression[expressions.size()]), isNumber }; }", "tokens": 268} {"id": 390481, "source": "method", "repo": "mercedes-benz/dna", "text": "public static String generateJWT(LoginController.UserInfo userInfo, String authToken) { final Map tokenData = new HashMap<>(); tokenData.put(\"id\", userInfo.getId()); tokenData.put(\"firstName\", userInfo.getFirstName()); tokenData.put(\"lastName\", userInfo.getLastName()); tokenData.put(\"email\", userInfo.getEmail()); tokenData.put(\"nounce\", Math.random()); tokenData.put(\"mobileNumber\", userInfo.getMobileNumber()); tokenData.put(\"department\", userInfo.getDepartment()); tokenData.put(\"digiRole\", userInfo.getDigiRole()); tokenData.put(\"authToken\", authToken); final JwtBuilder jwtBuilder = Jwts.builder(); jwtBuilder.setClaims(tokenData); jwtBuilder.setExpiration(new Date(System.currentTimeMillis() + TOKEN_EXPIRY * 60 * 1000)); final String token = jwtBuilder.signWith(SignatureAlgorithm.HS512, SECRET_KEY).compact(); return token; }", "tokens": 219} {"id": 390486, "source": "method", "repo": "mercedes-benz/dna", "text": "public byte[] serialize(String topic, GenericEventRecord record) { try { if (record == null) { LOG.debug(\"Null received at serializing\"); return null; } LOG.debug(\"Serializing GenericEventRecord received from topic\"); return objectMapper.writeValueAsBytes(record); } catch (Exception e) { throw new SerializationException(\"Error when serializing MessageDto to byte[]\"); } }", "tokens": 83} {"id": 390584, "source": "method", "repo": "mercedes-benz/dna", "text": "private String getProcessOwnersPredicateString(List processOwners) { if (processOwners != null && !processOwners.isEmpty()) { String delimiterSeparatedProcessOwners = processOwners.stream().map(String::toLowerCase) .collect(Collectors.joining(\"%|%\", \"%\", \"%\")); delimiterSeparatedProcessOwners = \"'\" + delimiterSeparatedProcessOwners + \"'\"; return \" and (lower(jsonb_extract_path_text(data,'customer','processOwners')) similar to \" + delimiterSeparatedProcessOwners + \" ) \"; } return \"\"; }", "tokens": 127} {"id": 390621, "source": "method", "repo": "mercedes-benz/dna", "text": "public BaseReportingCauseService(ReportingCauseRepository jpaRepo) { super(jpaRepo); }", "tokens": 21} {"id": 390722, "source": "method", "repo": "mercedes-benz/dna", "text": "public List getEventCategories(String userId) { List results = new ArrayList<>(); List allRecords = dynamicConsumer.consumeRecordsFromTopic(Arrays.asList(userId)); if (allRecords != null && !allRecords.isEmpty()) { results = allRecords.stream().map(n -> n.getEventType()).collect(Collectors.toList()); results = results.stream().distinct().collect(Collectors.toList()); LOGGER.debug(\"List of all event catergories for user {} is {} \", userId, results); } return results; }", "tokens": 124} {"id": 390773, "source": "method", "repo": "mercedes-benz/dna", "text": "public ResponseEntity getByBucketName(String bucketName) { HttpStatus httpStatus; BucketResponseVO bucketResponseVO = new BucketResponseVO(); LOGGER.debug(\"Check if bucket exists.\"); boolean isBucketExists = dnaMinioClient.isBucketExists(bucketName); if (!isBucketExists) { httpStatus = HttpStatus.NOT_FOUND; LOGGER.info(\"Bucket not found.\"); } else { LOGGER.debug(\"Fetching Current user.\"); String currentUser = userStore.getUserInfo().getId(); // Setting bucket details bucketResponseVO.setBucketName(bucketName); bucketResponseVO.setCollaborators(dnaMinioClient.getBucketCollaborators(bucketName, currentUser)); bucketResponseVO.setPermission(dnaMinioClient.getBucketPermission(bucketName, currentUser)); httpStatus = HttpStatus.OK; } return new ResponseEntity<>(bucketResponseVO, httpStatus); }", "tokens": 169} {"id": 390789, "source": "method", "repo": "mercedes-benz/sechub", "text": "public NetsparkerConfigBuilder setAgentGroupName(String agentGroupName) { this.agentGroupName = agentGroupName; return this; }", "tokens": 28} {"id": 390932, "source": "method", "repo": "mercedes-benz/sechub", "text": "void getProjectDataList_users_receive_expected_project_data(String variant, String userId, Set projectIds, boolean isOwner, String expectedOwnerUserId, String expectedOwnerEmailAddress) { /* prepare */ DomainMessageSynchronousResult mockedResponse = mock(); when(mockedResponse.get(PROJECT_ASSIGNED_AND_ENABLED_PROFILE_IDS)).thenReturn(Collections.emptyMap()); when(eventBus.sendSynchron(any())).thenReturn(mockedResponse); /* execute */ List projects = serviceToTest.getProjectDataList(userId); /* test */ assertThat(projects).isNotNull(); assertThat(projects.size()).isEqualTo(projectIds.size()); for (ProjectData project : projects) { ProjectUserData expectedOwnerData = new ProjectUserData(); expectedOwnerData.setUserId(expectedOwnerUserId); expectedOwnerData.setEmailAddress(expectedOwnerEmailAddress); assertThat(project.isOwned()).isEqualTo(isOwner); assertThat(project.getOwner()).isEqualTo(expectedOwnerData); assertThat(project).matches(p -> projectIds.contains(p.getProjectId())); } }", "tokens": 223} {"id": 391102, "source": "method", "repo": "mercedes-benz/sechub", "text": "public static ShowProductExecutorTemplatesDialogAction createPDS_INFRASCAN_V1Action(UIContext context) { return createPDSV1Action(context, ProductIdentifier.PDS_INFRASCAN, 1); }", "tokens": 47} {"id": 391231, "source": "method", "repo": "mercedes-benz/sechub", "text": "public String toString() { return \"TestJobStatisticData [\" + (sechubJobUUID != null ? \"sechubJobUUID=\" + sechubJobUUID + \", \" : \"\") + (type != null ? \"type=\" + type + \", \" : \"\") + (id != null ? \"id=\" + id + \", \" : \"\") + (value != null ? \"value=\" + value : \"\") + \"]\"; }", "tokens": 87} {"id": 391242, "source": "method", "repo": "mercedes-benz/sechub", "text": "public MockedAdapterSetupCombination getSetupCombinationById(String id) { return mapIdToMockCombination.get(id); }", "tokens": 28} {"id": 391428, "source": "method", "repo": "mercedes-benz/sechub", "text": "void too_long_list_entry_in_optional_lists_returns_invalid_result() { /* prepare */ String tooLongEntry = \"a\".repeat(41); List methods = new ArrayList<>(); methods.add(tooLongEntry); WebscanFalsePositiveProjectData webScan = createWebscanFalsePositiveProjectDataWithValidMandatoryParts(); webScan.setMethods(methods); /* execute */ ValidationResult result = validationToTest.validate(webScan); /* test */ assertFalse(result.isValid()); List errors = result.getErrors(); assertEquals(1, errors.size()); assertTrue(errors.get(0).contains(METHODS_FIELD_NAME)); }", "tokens": 145} {"id": 391432, "source": "method", "repo": "mercedes-benz/sechub", "text": "public void before() { strategyToTest = new IntranetIPpatternResolveStrategy(); }", "tokens": 19} {"id": 391438, "source": "method", "repo": "mercedes-benz/sechub", "text": "public String getPasswordWhenIntranetTarget() { return getPasswordOrAPIToken(); }", "tokens": 20} {"id": 391455, "source": "method", "repo": "mercedes-benz/sechub", "text": "private void handleProcessAccessLevelChanged(DomainMessage request) { ProjectMessage data = request.get(MessageDataKeys.PROJECT_ACCESS_LEVEL_CHANGE_DATA); String projectId = data.getProjectId(); ProjectAccessLevel formerAccessLevel = data.getFormerAccessLevel(); ProjectAccessLevel newAccessLevel = data.getNewAccessLevel(); projectConfigService.changeProjectAccessLevel(projectId, newAccessLevel, formerAccessLevel); }", "tokens": 79} {"id": 391801, "source": "method", "repo": "MetaGLM/zhipuai-sdk-java-v4", "text": "public Single queryAgentsAsyncResult(Map request) { return agentsApi.queryAgentsAsyncResult(request); }", "tokens": 35} {"id": 391833, "source": "method", "repo": "MetaGLM/zhipuai-sdk-java-v4", "text": "public DocumentPageGenerationChain queryDocumentList(QueryDocumentRequest params) { Single single = documentApi.queryDocumentList(params.getOptions()); return new DocumentPageGenerationChain(params, single); }", "tokens": 46} {"id": 392009, "source": "method", "repo": "MetaGLM/zhipuai-sdk-java-v4", "text": "public DocumentDataFailInfo getNullValue(DeserializationContext ctxt) { return null; }", "tokens": 18} {"id": 392029, "source": "method", "repo": "MetaGLM/zhipuai-sdk-java-v4", "text": "public SearchResultDeserializer() { super(SearchResult.class, null); }", "tokens": 15} {"id": 392092, "source": "method", "repo": "MetaGLM/zhipuai-sdk-java-v4", "text": "public void setTotal(KnowledgeStatistics total) { this.total = total; this.set(\"total\", total); }", "tokens": 26} {"id": 392227, "source": "method", "repo": "MetaGLM/zhipuai-sdk-java-v4", "text": "public ResponseCreate() { super(); this.setType(\"response.create\"); this.response = new ResponseObj(); }", "tokens": 25} {"id": 392240, "source": "method", "repo": "MetaGLM/zhipuai-sdk-java-v4", "text": "public ParameterObj() { this.type = \"object\"; this.properties = new HashMap<>(); this.required = new ArrayList<>(); }", "tokens": 28} {"id": 392256, "source": "method", "repo": "MetaGLM/zhipuai-sdk-java-v4", "text": "public ConversationItemCreated() { super.setType(\"conversation.item.created\"); this.previousItemId = \"\"; this.item = new ItemObj(); }", "tokens": 33} {"id": 392309, "source": "method", "repo": "MetaGLM/zhipuai-sdk-java-v4", "text": "public void setRefer(String refer) { this.refer = refer; this.put(\"refer\", refer); }", "tokens": 28} {"id": 392331, "source": "method", "repo": "MetaGLM/zhipuai-sdk-java-v4", "text": "public void setTaskStatus(String taskStatus) { this.taskStatus = taskStatus; this.put(\"task_status\", taskStatus); }", "tokens": 31} {"id": 392374, "source": "method", "repo": "MetaGLM/zhipuai-sdk-java-v4", "text": "/** V4 Fine-tuning upload dataset */ public void testUploadFile() throws JsonProcessingException { String filePath = \"demo.jsonl\"; String path = ClassLoader.getSystemResource(filePath).getPath(); String purpose = \"fine-tune\"; UploadFileRequest request = UploadFileRequest.builder() .purpose(purpose) .filePath(path) .build(); FileApiResponse fileApiResponse = client.invokeUploadFileApi(request); logger.info(\"model output: {}\", mapper.writeValueAsString(fileApiResponse)); }", "tokens": 107} {"id": 392486, "source": "method", "repo": "meteorOSS/wechat-bc", "text": "public Contact getContact(Map source, String key) { if(contactMap.containsKey(key)) return contactMap.get(key); else { for (Contact value : source.values()) { if(value.getNickName().equalsIgnoreCase(key)) { contactMap.put(key,value); return value; } } } return null; }", "tokens": 79} {"id": 392502, "source": "method", "repo": "meteorOSS/wechat-bc", "text": "public OwnerMessageEvent(Message message) { super(message); }", "tokens": 15} {"id": 392514, "source": "method", "repo": "meteorOSS/wechat-bc", "text": "public void setSyncKey(SyncKey syncKey) { this.syncKey = syncKey; }", "tokens": 22} {"id": 392530, "source": "method", "repo": "meteorOSS/wechat-bc", "text": "public Message processMessage(JSONObject jsonObject) { return concreteMessageFactory.createMessage(jsonObject); }", "tokens": 21} {"id": 392534, "source": "method", "repo": "meteorOSS/wechat-bc", "text": "public WeChatCookieJar(){ this.cookieMap = new ConcurrentHashMap<>(); }", "tokens": 17} {"id": 392553, "source": "method", "repo": "meteorOSS/wechat-bc", "text": "/** Create an alphanumeric string generator. */ public RandomString(int length, Random random) { this(length, random, alphanum); }", "tokens": 31} {"id": 392681, "source": "method", "repo": "methusalah/OpenRTS", "text": "public Chain(Collection col) { super(col); }", "tokens": 16} {"id": 392728, "source": "method", "repo": "methusalah/OpenRTS", "text": "public Point2D getCenter() { return new Point2D(minX + width / 2, minY + height / 2); }", "tokens": 30} {"id": 392748, "source": "method", "repo": "methusalah/OpenRTS", "text": "public OrientedBoundingBox(ArrayList points, double orientation) { super(); ArrayList rotated = new ArrayList(); for(Point2D p : points) rotated.add(p.getRotation(-orientation)); computeWith(rotated); this.orientation = orientation; }", "tokens": 69} {"id": 392775, "source": "method", "repo": "methusalah/OpenRTS", "text": "private void check() { String valid = \"\"; if (points.size() < 3) valid += \"illegal size \"; if (!isSimple()) valid += \"complex \"; if (!isCounterClockwise()) valid += \"clockwise\"; if (valid != \"\") throw new RuntimeException(\"Can't construct invalid \" + this.getClass().getName() + \" (\" + valid + \") : \" + this); }", "tokens": 87} {"id": 392859, "source": "method", "repo": "methusalah/OpenRTS", "text": "public String toString() { String res = new String(\"total width : \"+totalWidth); int cumul = 0; for(Splitting s : allSplittings) for(int i=0; i groundPoints) { Point2D sw = new Point2D(-0.5, -0.5); Point2D se = new Point2D(0.5, -0.5); Point2D ne = new Point2D(0.5, 0.5); Point2D nw = new Point2D(-0.5, 0.5); Ring elevatedRing = new Ring<>(); for (Point3D p : groundPoints) { double elevation; // TODO: smell like switch case if (p.get2D().equals(sw)) { elevation = getElevation(t, c); } else if (p.get2D().equals(se)) { elevation = getElevation(t.e(), c); } else if (p.get2D().equals(ne)) { elevation = getElevation(t.n().e(), c); } else if (p.get2D().equals(nw)) { elevation = getElevation(t.n(), c); } else { elevation = c.level * Tile.STAGE_HEIGHT; } elevatedRing.add(p.getAddition(0, 0, elevation)); } if (elevatedRing.isEmpty()) { logger.warning(\"ground is empty\"); } Polygon3D res = null; try { res = new Polygon3D(elevatedRing); } catch (Exception e) { logger.info(\"can't generate cliff ground at \" + t + \" because \" + e); } return res; }", "tokens": 357} {"id": 393232, "source": "method", "repo": "methusalah/OpenRTS", "text": "public static void attachTrinket(Trinket t, Map m){ m.addTrinket(t); Tile containerTile = m.get(t.getCoord()); containerTile.addData(t); TileArtisanUtil.checkBlockingTrinkets(containerTile); }", "tokens": 56} {"id": 393467, "source": "method", "repo": "methusalah/OpenRTS", "text": "private static boolean approxEqual(Vector2f u, Vector2f v) { float tolerance = 1E-4f; return (FastMath.abs(u.x - v.x) < tolerance) && (FastMath.abs(u.y - v.y) < tolerance); }", "tokens": 66} {"id": 393492, "source": "method", "repo": "methusalah/OpenRTS", "text": "public void handleGroundUpdateEvent(UpdateGroundAtlasEvent e) { updateGroundTexture(); }", "tokens": 19} {"id": 393506, "source": "method", "repo": "methusalah/OpenRTS", "text": "public static Point3D toPoint3D(Vector3f v) { return new Point3D(v.x, v.y, v.z); }", "tokens": 36} {"id": 393581, "source": "method", "repo": "mezz/justenoughitems", "text": "public IIngredientFilterConfig getIngredientFilterConfig() { return ingredientFilterConfig; }", "tokens": 18} {"id": 393590, "source": "method", "repo": "mezz/justenoughitems", "text": "IngredientGridSharedConfig(IConfigCategoryBuilder category) { backgroundStyle = category.addValue( \"drawBackground\", defaultBackgroundStyle, LegacyEnumSerializers.enumOrBoolean(IngredientGridBackgroundStyle.class, IngredientGridBackgroundStyle::fromBoolean) ) .addLegacyValue(\"ingredientList\", \"drawBackground\") .setEditMode(ConfigValueEditMode.IMMEDIATE) .build(); navigationMode = category.addValue( \"navigationMode\", defaultNavigationMode, LegacyEnumSerializers.enumWithLegacyName( IngredientGridNavigationMode.class, \"SMOOTH_SCROLLING\", IngredientGridNavigationMode.SCROLLING ) ) .addLegacyValue(\"ingredientList\", \"navigationMode\") .setEditMode(ConfigValueEditMode.IMMEDIATE) .build(); navigationVisibility = category.addEnum(\"navigationVisibility\", defaultNavigationVisibility) .addLegacyValue(\"ingredientList\", \"navigationVisibility\") .addLegacyValue(\"ingredientList\", \"buttonNavigationVisibility\") .setEditMode(ConfigValueEditMode.IMMEDIATE) .build(); shrinkToFit = category.addBoolean(\"shrinkToFit\", true) .setEditMode(ConfigValueEditMode.IMMEDIATE) .build(); }", "tokens": 245} {"id": 393607, "source": "method", "repo": "mezz/justenoughitems", "text": "public static void onResourceManagerReload(ResourceManager resourceManager) { Map loadedColors = createDefaultColors(); for (Resource resource : resourceManager.getResourceStack(COLORS_RESOURCE)) { try (Reader reader = resource.openAsReader()) { JsonElement jsonElement = JsonParser.parseReader(reader); loadColors(jsonElement, loadedColors); } catch (IOException | RuntimeException e) { LOGGER.error(\"Failed to load JEI GUI colors from resource: {}\", COLORS_RESOURCE, e); } } colors = Map.copyOf(loadedColors); }", "tokens": 115} {"id": 393729, "source": "method", "repo": "mezz/justenoughitems", "text": "public void testShutdownWithoutScheduledCommands() { // Setup: no commands are scheduled. // Operation: shut down an idle executor. executor.shutdown(); // Assertions: no exception is thrown for an idle shutdown. }", "tokens": 44} {"id": 393763, "source": "method", "repo": "mezz/justenoughitems", "text": "public ErrorIngredient copyIngredient(ErrorIngredient ingredient) { return ingredient; }", "tokens": 16} {"id": 393825, "source": "method", "repo": "mezz/justenoughitems", "text": "public Optional getLevelId(MinecraftServer server) { return Optional.of(server.storageSource.getLevelId()); }", "tokens": 28} {"id": 393956, "source": "method", "repo": "mezz/justenoughitems", "text": "public IngredientGridTooltipHelper( IIngredientManager ingredientManager, IIngredientFilterConfig ingredientFilterConfig, IClientToggleState toggleState, IInternalKeyMappings keyBindings, IColorHelper colorHelper ) { this.ingredientManager = ingredientManager; this.ingredientFilterConfig = ingredientFilterConfig; this.toggleState = toggleState; this.keyBindings = keyBindings; this.colorHelper = colorHelper; }", "tokens": 85} {"id": 393965, "source": "method", "repo": "mezz/justenoughitems", "text": "public static ImmutableRect2i getAvailableGridArea( IIngredientGridConfig gridConfig, ImmutableRect2i availableArea ) { return getAvailableGridArea(gridConfig, availableArea, true); }", "tokens": 43} {"id": 393985, "source": "method", "repo": "mezz/justenoughitems", "text": "public boolean nextPage() { if (isScrolling()) { return scrollRecipes(getScrollState().getVisibleHeight()); } if (state.nextPage()) { stateListener.onStateChange(); return true; } return false; }", "tokens": 47} {"id": 394003, "source": "method", "repo": "mezz/justenoughitems", "text": "public void back() { logic.back(); }", "tokens": 11} {"id": 394059, "source": "method", "repo": "mezz/justenoughitems", "text": "public void scrollbarLayoutReclaimsNavigationHeight() { // Setup: the same grid can use either page buttons or scrollbar navigation. ImmutableRect2i availableArea = largeAvailableArea(); TestGridConfig pageConfig = config() .drawBackground(false) .navigationVisibility(NavigationVisibility.ENABLED); TestGridConfig scrollbarConfig = config() .drawBackground(false) .navigationMode(IngredientGridNavigationMode.SCROLLING) .navigationVisibility(NavigationVisibility.ENABLED); // Operation: calculate both layouts. IngredientGridWithNavigationLayout pageLayout = IngredientGridButtonNavigationLayout.calculate( pageConfig, availableArea, Set.of(), 100 ); IngredientGridWithNavigationLayout scrollbarLayout = IngredientGridScrollbarLayout.calculate( scrollbarConfig, availableArea, Set.of(), 100, false ); // Assertions: without page buttons, the scrollable grid can start higher in the same available area. assertPositiveArea(pageLayout.navigationArea()); assertPositiveArea(scrollbarLayout.scrollbarArea()); assertTrue(scrollbarLayout.ingredientGridArea().y() < pageLayout.ingredientGridArea().y()); }", "tokens": 228} {"id": 394067, "source": "method", "repo": "mezz/justenoughitems", "text": "public void getPageAnchorElementClearsStaleAnchor() { // Setup: the remembered clicked ingredient is no longer present after filtering or bookmark changes. IngredientGridPageState pageState = new IngredientGridPageState(); IElement staleAnchor = new IngredientElement<>(new TestTypedIngredient<>(OBJECT_TYPE, new Object())); List> elements = List.of( new IngredientElement<>(new TestTypedIngredient<>(OBJECT_TYPE, new Object())) ); pageState.setPageAnchorElement(staleAnchor); // Operation: ask for the anchor twice after it has gone stale. IElement firstLookup = pageState.getPageAnchorElement(elements); IElement secondLookup = pageState.getPageAnchorElement(elements); // Assertions: the stale anchor is not returned, and it is cleared so the caller owns fallback behavior. assertNull(firstLookup); assertNull(secondLookup); }", "tokens": 181} {"id": 394227, "source": "method", "repo": "mezz/justenoughitems", "text": "public List getSourceRecipeIds(IJeiCompostingRecipe recipe) { return List.of(); }", "tokens": 25} {"id": 394424, "source": "method", "repo": "mezz/justenoughitems", "text": "public boolean isActiveAndMatchesAllowingExtraModifiers(InputConstants.Key key) { if (keyMapping.isUnbound() || !keyMapping.getKey().equals(key)) { return false; } if (!keyMapping.getKeyConflictContext().isActive()) { return false; } KeyModifier keyModifier = keyMapping.getKeyModifier(); return keyModifier == KeyModifier.NONE || isKeyModifierActive(key); }", "tokens": 86} {"id": 394655, "source": "method", "repo": "mgks/android-smartwebview", "text": "public String getPluginName() { return \"ImageCompressionPlugin\"; }", "tokens": 14} {"id": 394679, "source": "method", "repo": "mgks/android-smartwebview", "text": "public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode == PermissionManager.INITIAL_REQUEST_CODE) { boolean locationGranted = false; for (int i = 0; i < permissions.length; i++) { if (permissions[i].equals(Manifest.permission.ACCESS_FINE_LOCATION) && grantResults[i] == PackageManager.PERMISSION_GRANTED) { locationGranted = true; break; } } if (locationGranted) { // If a JS request was waiting for permission, fulfill it now if (pendingJsCallback != null) { getLocation(pendingJsCallback); } else { getLocation(null); // Fetch for cookies if no JS request was pending } } else if (pendingJsCallback != null) { sendLocationError(\"Location permission denied.\"); } } }", "tokens": 177} {"id": 394868, "source": "method", "repo": "michaelwuensch/bitbanana", "text": "public Single listPeers(com.github.lightningnetwork.lnd.lnrpc.ListPeersRequest request) { return DefaultSingle.createDefault(emitter -> asyncStub.listPeers(request, new RemoteSingleObserver<>(emitter))); }", "tokens": 64} {"id": 394884, "source": "method", "repo": "michaelwuensch/bitbanana", "text": "public Single listAddresses(com.github.lightningnetwork.lnd.walletrpc.ListAddressesRequest request) { return DefaultSingle.createDefault(emitter -> asyncStub.listAddresses(request, new RemoteSingleObserver<>(emitter))); }", "tokens": 60} {"id": 394990, "source": "method", "repo": "michaelwuensch/bitbanana", "text": "public void setupWithLNAddress(LnAddress lnAddress, boolean includeQRCode) { reset(); mIsQRCodeIncluded = includeQRCode; if (mIsQRCodeIncluded) { setupSwitchListeners(); } showAvatar(); showIdentity(lnAddress); }", "tokens": 52} {"id": 395106, "source": "method", "repo": "michaelwuensch/bitbanana", "text": "public PeerItemAdapter(PeerSelectListener peerSelectListener) { mPeerSelectListener = peerSelectListener; }", "tokens": 25} {"id": 395153, "source": "method", "repo": "michaelwuensch/bitbanana", "text": "private void removeWatchtowerPart2() { mCompositeDisposable.add(BackendManager.api().removeWatchtower(mWatchtower.getPubKey()) .timeout(ApiUtil.getBackendTimeout(), TimeUnit.SECONDS) .subscribe(() -> { BBLog.d(LOG_TAG, \"Successfully removed watchtower.\"); Intent intentRemoveWatchtower = new Intent(); intentRemoveWatchtower.putExtra(ScanContactActivity.EXTRA_NODE_URI, LightningNodeUriParser.parseNodeUri(mWatchtower.getPubKey() + \"@\" + mWatchtower.getAddress())); setResult(RESPONSE_CODE_REMOVE_WATCHTOWER, intentRemoveWatchtower); finish(); }, throwable -> { BBLog.e(LOG_TAG, \"Error removing watchtower: \" + throwable.getMessage()); showError(throwable.getMessage(), RefConstants.ERROR_DURATION_MEDIUM); })); }", "tokens": 178} {"id": 395309, "source": "method", "repo": "michaelwuensch/bitbanana", "text": "public void setBlockHeight(int blockHeight) { BlockHeight = blockHeight; }", "tokens": 19} {"id": 395390, "source": "method", "repo": "michaelwuensch/bitbanana", "text": "static String redactException(@Nullable Throwable throwable) { if (throwable == null) return \"null\"; if (throwable instanceof URISyntaxException) { URISyntaxException uriSyntaxException = (URISyntaxException) throwable; return \"URISyntaxException: \" + uriSyntaxException.getReason() + \" at index \" + uriSyntaxException.getIndex() + \" (message redacted)\"; } return throwable.getClass().getSimpleName() + \" (message redacted)\"; }", "tokens": 89} {"id": 395397, "source": "method", "repo": "michaelwuensch/bitbanana", "text": "/** Returns true if the device supports strong biometrics, but no biometrics (e.g. fingerprints) are enrolled in the Android system settings. */ public static boolean noBiometricsEnrolledOnDevice() { return BiometricManager.from(App.getAppContext()).canAuthenticate(AUTHENTICATORS) == BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED; }", "tokens": 88} {"id": 395403, "source": "method", "repo": "michaelwuensch/bitbanana", "text": "/** Creates the CryptoObject that has to be passed to the BiometricPrompt. @return null if the key is missing or was invalidated because the biometrics of the device changed. In that case biometric unlock gets disabled and the user has to unlock with the PIN/password and enable it again in the settings. */ public static BiometricPrompt.CryptoObject createCryptoObject() { try { KeyStore keyStore = KeyStore.getInstance(ANDROID_KEY_STORE_NAME); keyStore.load(null); SecretKey key = (SecretKey) keyStore.getKey(KEY_BIOMETRIC_UNLOCK, null); if (key == null) throw new IllegalStateException(\"Biometric unlock key does not exist.\"); Cipher cipher = Cipher.getInstance(CIPHER_TRANSFORMATION); cipher.init(Cipher.ENCRYPT_MODE, key); return new BiometricPrompt.CryptoObject(cipher); } catch (KeyPermanentlyInvalidatedException e) { BBLog.w(LOG_TAG, \"Biometrics of the device changed. Biometric unlock gets disabled.\"); disableBiometricUnlock(); } catch (Exception e) { BBLog.w(LOG_TAG, \"Biometric unlock not possible: \" + e.getMessage()); disableBiometricUnlock(); } return null; }", "tokens": 256} {"id": 395504, "source": "method", "repo": "michaelwuensch/bitbanana", "text": "public void givenHttpOnionUrl_whenIsSecureLnUrlUrl_thenTrue() { assertTrue(LnUrlReader.isSecureLnUrlUrl(\"http://abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuv.onion/lnurlp/alice\")); }", "tokens": 57} {"id": 395670, "source": "method", "repo": "microapp-store/flash-waimai", "text": "public Double getSatisfy_rate() { return satisfy_rate; }", "tokens": 15} {"id": 395845, "source": "method", "repo": "microapp-store/flash-waimai", "text": "private boolean sendSmsMessage( String receiver, String content, MessageTemplate messageTemplate,String... args) throws Exception { String tplCode = getTpl(messageTemplate); SmsSender smsSender = getSmsSender(messageTemplate); boolean success = false; String[] receivers = receiver.split(\",|;\", -1); for (String oneReceiver : receivers) { try { if (StringUtils.isNotEmpty(oneReceiver)) { success = smsSender.sendSms(tplCode, oneReceiver, args, content); } } catch (Exception e) { logger.error(e.getMessage(), e); } } return success; }", "tokens": 140} {"id": 396199, "source": "method", "repo": "microsoft/azure-devops-intellij", "text": "public static SyncResults syncWorkspace(final ServerContext context, final List filesUpdatePaths, final boolean needRecursion, final boolean shouldThrowBadExitCode) { final SyncCommand command = new SyncCommand(context, filesUpdatePaths, needRecursion, shouldThrowBadExitCode); return command.runSynchronously(); }", "tokens": 63} {"id": 396612, "source": "method", "repo": "microsoft/azure-devops-intellij", "text": "public void setValueAt(final Object aValue, final int rowIndex, final int columnIndex) { if (Column.values()[columnIndex] == Column.Selection) { items.get(rowIndex).selected = (Boolean) aValue; myEventDispatcher.getMulticaster().selectionChanged(); } }", "tokens": 61} {"id": 396646, "source": "method", "repo": "microsoft/azure-devops-intellij", "text": "public SimpleNode[] getChildren() { return NO_CHILDREN; }", "tokens": 17} {"id": 396786, "source": "method", "repo": "microsoft/azure-devops-intellij", "text": "public void testGetArgumentBuilder_withContext() { final RenameCommand cmd = new RenameCommand(context, OLD_NAME, NEW_NAME); final ToolRunner.ArgumentBuilder builder = cmd.getArgumentBuilder(); Assert.assertEquals(String.format(\"rename -noprompt -collection:http://server:8080/tfs/defaultcollection ******** %s %s\", OLD_NAME, NEW_NAME), builder.toString()); }", "tokens": 93} {"id": 396812, "source": "method", "repo": "microsoft/azure-devops-intellij", "text": "public static void setOnce() throws Exception { String path = System.getProperty(\"java.io.tmpdir\") + File.separator + TfTool.TF_DIRECTORY_PREFIX + \"-\" + TfTool.TF_MIN_VERSION; exeDirectory = new File(path); exeDirectory.mkdir(); exeFile = new File(path, \"tf.cmd\"); exeFile.createNewFile(); }", "tokens": 89} {"id": 396828, "source": "method", "repo": "microsoft/azure-devops-intellij", "text": "public void testProcessCommandBadCommand() { List args = new ArrayList(Arrays.asList(\"fakeCommand\", VALID_GIT_URL)); vstsStarter.processCommand(args); verify(mockSimpleCheckoutStarter, never()).processCommand(); }", "tokens": 58} {"id": 397054, "source": "method", "repo": "microsoft/azure-maven-plugins", "text": "/** @param lineNumber the lineNumber to set */ public void setLineNumber(int lineNumber) { this.lineNumber = lineNumber; }", "tokens": 26} {"id": 397106, "source": "method", "repo": "microsoft/azure-maven-plugins", "text": "public void testWithDeploymentName() { final AppDeploymentMavenConfig deploy = new AppDeploymentMavenConfig(); deploy.setDeploymentName(\"deploymentName1\"); assertEquals(\"deploymentName1\", deploy.getDeploymentName()); }", "tokens": 45} {"id": 397168, "source": "method", "repo": "microsoft/azure-maven-plugins", "text": "public void setAppSettings(Map appSettings) { this.ensureConfig().setAppSettings(appSettings); }", "tokens": 28} {"id": 397241, "source": "method", "repo": "microsoft/azure-maven-plugins", "text": "public WebAppDeploymentSlotModule slots() { return this.deploymentModule; }", "tokens": 17} {"id": 397596, "source": "method", "repo": "microsoft/azure-maven-plugins", "text": "protected CassandraKeyspace newResource(@Nonnull CassandraKeyspaceGetResultsInner resource) { return new CassandraKeyspace(resource, this); }", "tokens": 29} {"id": 397645, "source": "method", "repo": "microsoft/azure-maven-plugins", "text": "public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final JdbcUrl jdbcUrl = (JdbcUrl) o; return Objects.equals(uri.toString(), jdbcUrl.uri.toString()); }", "tokens": 68} {"id": 397860, "source": "method", "repo": "microsoft/azure-maven-plugins", "text": "protected Iterator> loadResourcePagesFromAzure() { return Optional.ofNullable(this.getClient()) .map(c -> c.listBlobsByHierarchy(this.parent.getPath()).iterableByPage(getPageSize()).iterator()) .orElse(Collections.emptyIterator()); }", "tokens": 70} {"id": 397885, "source": "method", "repo": "microsoft/azure-maven-plugins", "text": "public ShareModule(@Nonnull IStorageAccount parent) { super(NAME, parent); }", "tokens": 19} {"id": 397927, "source": "method", "repo": "microsoft/botbuilder-java", "text": "/** Gets whether the http client. @return OkHttpClient used to query the Luis Service. */ public OkHttpClient getHttpClient() { return httpClient; }", "tokens": 32} {"id": 398455, "source": "method", "repo": "microsoft/botbuilder-java", "text": "public void setEndMin(int endMin) { this.endMin = endMin; }", "tokens": 21} {"id": 398543, "source": "method", "repo": "microsoft/botbuilder-java", "text": "public AreaParserConfiguration() { this(new CultureInfo(Culture.English)); }", "tokens": 20} {"id": 398549, "source": "method", "repo": "microsoft/botbuilder-java", "text": "public AreaExtractorConfiguration() { this(new CultureInfo(Culture.French)); }", "tokens": 20} {"id": 398721, "source": "method", "repo": "microsoft/botbuilder-java", "text": "/** Sets the id of the command. @param withCommandId The CommandId value. */ public void setCommandId(String withCommandId) { this.commandId = withCommandId; }", "tokens": 42} {"id": 398726, "source": "method", "repo": "microsoft/botbuilder-java", "text": "/** Bot participating in this conversation. @return the bot value */ public ChannelAccount getBot() { return this.bot; }", "tokens": 30} {"id": 398947, "source": "method", "repo": "microsoft/copilot-for-eclipse", "text": "public void setSubAgent(boolean subAgent) { this.subAgent = subAgent; }", "tokens": 21} {"id": 399117, "source": "method", "repo": "microsoft/copilot-for-eclipse", "text": "void testConstructorWithInputs() { List inputs = Arrays.asList(\"input1\", \"input2\"); navigation = new InputNavigation(inputs); assertEquals(2, navigation.size()); assertEquals(2, navigation.currentPosition); }", "tokens": 50} {"id": 399399, "source": "method", "repo": "microsoft/copilot-for-eclipse", "text": "/** Builds a versioned package identifier with the given separator. @param pkg The package @param separator The separator between identifier and version @return The versioned package identifier */ private static String buildVersionedIdentifier(Package pkg, String separator) { return StringUtils.isNotBlank(pkg.version()) ? pkg.identifier() + separator + pkg.version() : pkg.identifier(); }", "tokens": 77} {"id": 399435, "source": "method", "repo": "microsoft/copilot-for-eclipse", "text": "public void setTargetUiElement(UIElement uiElement) { this.uiElement = uiElement; }", "tokens": 22} {"id": 399477, "source": "method", "repo": "microsoft/copilot-for-eclipse", "text": "public void init(IWorkbench workbench) { setPreferenceStore(CopilotUi.getPlugin().getPreferenceStore()); noDefaultAndApplyButton(); }", "tokens": 28} {"id": 399523, "source": "method", "repo": "microsoft/copilot-for-eclipse", "text": "private void onResetToDefaults() { boolean confirmed = MessageDialog.openQuestion(getShell(), Messages.preferences_page_terminal_auto_approve_reset_title, Messages.preferences_page_auto_approve_reset_message); if (confirmed) { rules.clear(); rules.addAll(TerminalConfirmationHandler.DEFAULT_RULES.stream() .map(r -> new TerminalAutoApproveRule( r.getCommand(), r.isAutoApprove())) .toList()); tableViewer.refresh(); updateButtonState(); } }", "tokens": 110} {"id": 399577, "source": "method", "repo": "microsoft/copilot-for-eclipse", "text": "/** Adapt an object to IResource. */ private static IResource adaptToResource(Object obj) { if (obj instanceof IResource r) { return r; } if (obj instanceof IAdaptable a) { IResource r = a.getAdapter(IResource.class); if (r != null) { return r; } } return (IResource) Platform.getAdapterManager().getAdapter(obj, IResource.class); }", "tokens": 84} {"id": 399596, "source": "method", "repo": "microsoft/copilot-for-eclipse", "text": "private boolean hasShellIntegrationMarker() { if (Platform.getOS().equals(Platform.OS_WIN32)) { return ShellIntegrationScripts.getPowerShellScriptPath() != null; } if (Platform.getOS().equals(Platform.OS_LINUX)) { return ShellIntegrationScripts.getBashScriptPath() != null; } return false; }", "tokens": 75} {"id": 399796, "source": "method", "repo": "microsoft/gctoolkit", "text": "/** @param timeStamp time of the event @param cause reason to trigger the event @param duration duration of the event */ public ConcurrentScanRootRegion(DateTimeStamp timeStamp, GCCause cause, double duration) { super(timeStamp, GarbageCollectionTypes.ConcurrentRootRegionScan, cause, duration); }", "tokens": 60} {"id": 400143, "source": "method", "repo": "microsoft/gctoolkit", "text": "int getHeapRegionSize() { return heapRegionSize; }", "tokens": 14} {"id": 400246, "source": "method", "repo": "microsoft/gctoolkit", "text": "public void parNewReferenceSplit(GCLogTrace trace, String line) { scavengeTimeStamp = getClock(); garbageCollectionTypeForwardReference = GarbageCollectionTypes.ParNew; gcCauseForwardReference = trace.gcCause(); referenceGCForwardReference = extractPrintReferenceGC(line); }", "tokens": 55} {"id": 400251, "source": "method", "repo": "microsoft/gctoolkit", "text": "public void parNewFloatingReference(GCLogTrace trace, String line) { referenceGCForwardReference = extractPrintReferenceGC(line); }", "tokens": 27} {"id": 400761, "source": "method", "repo": "microsoft/Generative-AI-for-beginners-java", "text": "static OpenAIClient createOpenAiClient(String endpoint, Credential credential) { return OpenAIOkHttpClient.builder().baseUrl(openAiBaseUrl(endpoint)).credential(credential) .timeout(Duration.ofSeconds(60)).maxRetries(0).build(); }", "tokens": 52} {"id": 400985, "source": "method", "repo": "microsoft/hydralab", "text": "public void onOpen(ServerHandshake handShakeData) { connectionActive = true; log.info(\"onOpen message {}, {}\", handShakeData.getHttpStatus(), handShakeData.getHttpStatusMessage()); }", "tokens": 43} {"id": 401031, "source": "method", "repo": "microsoft/hydralab", "text": "private int getSelectedAudioBitrate() { if (mAudioBitrate == null) throw new IllegalStateException(); Integer selectedItem = mAudioBitrate.getSelectedItem(); return selectedItem * 1000; // bps }", "tokens": 45} {"id": 401064, "source": "method", "repo": "microsoft/hydralab", "text": "private void releaseWakeLock() { if (wakeLock != null) { Log.d(TAG, \"stop wake lock\"); wakeLock.release(); } }", "tokens": 35} {"id": 401287, "source": "method", "repo": "microsoft/hydralab", "text": "void fileTokenOnlyAuthorizesItsCanonicalPath() { LocalStorageToken readToken = token(\"token=file-read\"); when(storageClient.generateAccessTokenForFile(Const.FilePermission.READ, \"packages/app.apk\")) .thenReturn(readToken); when(storageClient.isAccessTokenExpired(readToken)).thenReturn(false); tokenService.generateReadTokenForFile(\"reader\", \"packages/app.apk\"); assertTrue(tokenService.validateTokenVal(\"file-read\", \"packages/app.apk\")); assertTrue(tokenService.validateTokenVal(\"file-read\", \"packages/folder/../app.apk\")); assertFalse(tokenService.validateTokenVal(\"file-read\", \"packages/other.apk\")); }", "tokens": 155} {"id": 401357, "source": "method", "repo": "microsoft/hydralab", "text": "public String getTestGifBlobPath() { return getBlobPathStr(testGifPath); }", "tokens": 20} {"id": 401543, "source": "method", "repo": "microsoft/hydralab", "text": "public List queryFileInfoByFileType(String fileType) { return storageFileInfoRepository.queryStorageFileInfoByFileType(fileType); }", "tokens": 32} {"id": 401553, "source": "method", "repo": "microsoft/hydralab", "text": "public static Date endOfDay(Date date) { return cn.hutool.core.date.DateUtil.endOfDay(date); }", "tokens": 30} {"id": 401902, "source": "method", "repo": "microsoft/LangChain4j-for-Beginners", "text": "void testAskWithServiceException() throws Exception { // Given RagRequest request = new RagRequest(\"What is Azure OpenAI?\", \"conv-123\", 5); when(ragService.ask(any(RagRequest.class))) .thenThrow(new RuntimeException(\"Service error\")); // When & Then mockMvc.perform(post(\"/api/rag/ask\") .contentType(MediaType.APPLICATION_JSON) .content(jsonMapper.writeValueAsString(request))) .andExpect(status().isInternalServerError()) .andExpect(jsonPath(\"$.error\").exists()) .andExpect(jsonPath(\"$.message\").exists()); }", "tokens": 134} {"id": 402046, "source": "method", "repo": "microsoft/malmo", "text": "/** Initialize malmo env configuration. For now either on or \"legacy\" AgentHost protocol. */ static public void update(Configuration configs) { envPolicy = configs.get(MalmoMod.ENV_CONFIGS, \"env\", \"false\").getBoolean(); }", "tokens": 55} {"id": 402277, "source": "method", "repo": "microsoft/malmo", "text": "public IMessage onMessage(final AttackActionMessage message, final MessageContext ctx) { IThreadListener mainThread = null; if (ctx.side == Side.CLIENT) return null; // Not interested. mainThread = (WorldServer)ctx.getServerHandler().playerEntity.world; mainThread.addScheduledTask(new Runnable() { @Override public void run() { EntityPlayerMP player = ctx.getServerHandler().playerEntity; IBlockState iblockstate = player.world.getBlockState(message.pos); Block block = iblockstate.getBlock(); if (iblockstate.getMaterial() != Material.AIR) { PlayerInteractEvent event = new PlayerInteractEvent.LeftClickBlock(player, message.pos, message.face, message.hitVec); MinecraftForge.EVENT_BUS.post(event); if (!event.isCanceled()) { boolean dropBlock = false; // We do things this way, rather than pass true for dropBlock in world.destroyBlock, // because we want this to take instant effect - we don't want the intermediate stage // of spawning a free-floating item that the player must pick up. java.util.List items = block.getDrops(player.world, message.pos, iblockstate, 0); player.world.destroyBlock( message.pos, dropBlock ); for (ItemStack item : items) { if (!player.inventory.addItemStackToInventory(item)) { Block.spawnAsEntity(player.world, message.pos, item); // Didn't fit in inventory, so spawn it. } } BlockEvent.BreakEvent breakevent = new BlockEvent.BreakEvent(player.world, message.pos, iblockstate, player); MinecraftForge.EVENT_BUS.post(breakevent); } } } }); return null; }", "tokens": 371} {"id": 402280, "source": "method", "repo": "microsoft/malmo", "text": "public boolean parseParameters(Object params) { if (params == null || !(params instanceof DrawingDecorator)) return false; this.drawing = (DrawingDecorator) params; return true; }", "tokens": 41} {"id": 402317, "source": "method", "repo": "microsoft/malmo", "text": "private void initRNGs() { // Initialise a RNG for this scene: long seed = 0; if (this.mazeParams.getSeed() == null || this.mazeParams.getSeed().equals(\"random\")) seed = System.currentTimeMillis(); else seed = Long.parseLong(this.mazeParams.getSeed()); this.pathrand = new Random(seed); this.blockrand = new Random(seed); // Should we initialise a separate RNG for the block types? if (this.mazeParams.getMaterialSeed() != null) { long bseed = 0; if (this.mazeParams.getMaterialSeed().equals(\"random\")) bseed = System.currentTimeMillis(); else bseed = Long.parseLong(this.mazeParams.getMaterialSeed()); this.blockrand = new Random(bseed); } }", "tokens": 180} {"id": 402500, "source": "method", "repo": "microsoft/malmo", "text": "/** Helper function for adding a chat match specification to the pattern map. @param c the chat message specification that contains the pattern and reward. */ private void addChatMatchSpecToRewardStructure(ChatMatchSpec c) { Float reward = c.getReward().floatValue(); Pattern pattern = Pattern.compile(c.getRegex(), Pattern.CASE_INSENSITIVE); patternMap.put(pattern, reward); distributionMap.put(pattern, c.getDistribution()); }", "tokens": 97} {"id": 402574, "source": "method", "repo": "microsoft/malmo", "text": "protected void clearUserConnectionWatchList() { this.userConnectionWatchList.clear(); }", "tokens": 20} {"id": 402701, "source": "method", "repo": "microsoft/malmo", "text": "/** Convenient constructor for the case where all that is required is the flat patch of ground
around the player's feet. @param xMargin number of blocks around the player in the x-axis @param zMargin number of blocks around the player in the z-axis */ public GridDimensions(int xMargin, int zMargin) { this.xMin = -xMargin; this.xMax = xMargin; this.yMin = -1; this.yMax = -1; // Flat patch of ground at the player's feet. this.zMin = -zMargin; this.zMax = zMargin; this.absoluteCoords = false; }", "tokens": 147} {"id": 402758, "source": "method", "repo": "microsoft/malmo", "text": "public void run() { final int MAX_STR_LEN = 10000000; try { Log(Level.INFO, \"About to try reading inputstream...\"); BufferedReader br = new BufferedReader(new InputStreamReader(this.socket.getInputStream())); StringBuffer sb = new StringBuffer(); int intC; while ((intC = br.read()) != -1) { char c = (char) intC; if (c == '\\n') { String command = sb.toString(); Log(Level.FINE, \"Received this: \" + command); InetAddress address = this.socket.getInetAddress(); Log(Level.INFO, \"Read line from \" + this.socket.getRemoteSocketAddress() + \"(remote), \" + address.getHostName() + \"(hostname) \" + address.getHostAddress() + \"(hostaddress)\"); String originator = address.getHostName(); DataOutputStream dos = new DataOutputStream(this.socket.getOutputStream()); poller.commandReceived(command, originator, dos); if (singleRequestReply) { // Stop handling the connection after one interaction. this.socket.close(); return; } sb.setLength(0); } else { sb.append(c); } if (sb.length() >= MAX_STR_LEN) { DataOutputStream dos = new DataOutputStream(this.socket.getOutputStream()); poller.onError(\"MALMOERROR Input too long\", dos); Log(Level.WARNING, \"Input too long (greater than \" + MAX_STR_LEN + \") - discarding.\"); break; // discard anything else we received } } } catch (IOException e) { Log(Level.SEVERE, \"Socket stream error: \" + e); } }", "tokens": 362} {"id": 402809, "source": "method", "repo": "microsoft/mssql-jdbc", "text": "static FedAuthDllInfo getAccessTokenForWindowsIntegrated(String stsURL, String servicePrincipalName, String clientConnectionId, String clientId, long expirationFileTime) throws DLLException { try { lock.lock(); return ADALGetAccessTokenForWindowsIntegrated(stsURL, servicePrincipalName, clientConnectionId, clientId, expirationFileTime, authLogger); } finally { lock.unlock(); } }", "tokens": 86} {"id": 402908, "source": "method", "repo": "microsoft/mssql-jdbc", "text": "/** Validates whether the source JDBC types are compatible with the destination table data types. We need to do this only once for the whole bulk copy session. */ private void validateDataTypeConversions(int srcColOrdinal, int destColOrdinal) throws SQLServerException { // Reducing unnecessary assignment to optimize for performance. This reduces code readability, but // may be worth it for the bulk copy. CryptoMetadata sourceCryptoMeta = srcColumnMetadata.get(srcColOrdinal).cryptoMeta; CryptoMetadata destCryptoMeta = destColumnMetadata.get(destColOrdinal).cryptoMeta; JDBCType srcJdbcType = (null != sourceCryptoMeta) ? sourceCryptoMeta.baseTypeInfo.getSSType().getJDBCType() : JDBCType.of(srcColumnMetadata.get(srcColOrdinal).jdbcType); SSType destSSType = (null != destCryptoMeta) ? destCryptoMeta.baseTypeInfo.getSSType() : destColumnMetadata.get(destColOrdinal).ssType; // Throw if the source type cannot be converted to the destination type. if (!srcJdbcType.convertsTo(destSSType)) { DataTypes.throwConversionError(srcJdbcType.toString(), destSSType.toString()); } }", "tokens": 265} {"id": 402953, "source": "method", "repo": "microsoft/mssql-jdbc", "text": "SQLServerColumnEncryptionKeyStoreProvider getColumnEncryptionKeyStoreProviderOnConnection( String providerName) throws SQLServerException { lock.lock(); try { // Check for a connection-level provider first if (null != connectionColumnEncryptionKeyStoreProvider && connectionColumnEncryptionKeyStoreProvider.size() > 0) { // If any connection-level providers are registered, we don't fall back to system/global providers if (connectionColumnEncryptionKeyStoreProvider.containsKey(providerName)) { return connectionColumnEncryptionKeyStoreProvider.get(providerName); } else { MessageFormat form = new MessageFormat( SQLServerException.getErrString(\"R_UnrecognizedConnectionKeyStoreProviderName\")); Object[] msgArgs = {providerName, getAllConnectionColumnEncryptionKeyStoreProviders()}; throw new SQLServerException(form.format(msgArgs), null); } } // No connection-level providers registered, so return system/global provider return getSystemOrGlobalColumnEncryptionKeyStoreProvider(providerName); } finally { lock.unlock(); } }", "tokens": 202} {"id": 403012, "source": "method", "repo": "microsoft/mssql-jdbc", "text": "private boolean compareRows(Map otherRows) { if (rows == otherRows) { return true; } if (rows.size() != otherRows.size()) { return false; } try { for (Entry e : rows.entrySet()) { Integer key = e.getKey(); Object[] value = e.getValue(); if (null == value) { if (!(null == otherRows.get(key) && otherRows.containsKey(key))) { return false; } } else { if (!Arrays.equals(value, otherRows.get(key))) { return false; } } } } catch (ClassCastException unused) { return false; } catch (NullPointerException unused) { return false; } return true; }", "tokens": 160} {"id": 403382, "source": "method", "repo": "microsoft/mssql-jdbc", "text": "/** Ensure that CRL properly re-reads rules after INTERVAL_BETWEEN_READS_IN_MS (30 secs). */ public void rereadAfterInterval() { try { testStatementRetry(\"retryExec={2716:1,2*2:CREATE;};\"); Thread.sleep(30000); // Sleep to ensure it has been INTERVAL_BETWEEN_READS_IN_MS between reads testStatementRetry(\"retryExec={2714:1,2*2:CREATE;};\"); } catch (Exception e) { Assertions.fail(TestResource.getResource(\"R_unexpectedException\")); } }", "tokens": 138} {"id": 403528, "source": "method", "repo": "microsoft/mssql-jdbc", "text": "CharacterType(String name, String sampleChars) { this.name = name; this.sampleChars = sampleChars; }", "tokens": 27} {"id": 403531, "source": "method", "repo": "microsoft/mssql-jdbc", "text": "/** Reads a Reader into a String. */ private String readerToString(Reader reader) throws Exception { if (reader == null) { return null; } try { StringBuilder sb = new StringBuilder(); char[] buf = new char[1024]; int len; while ((len = reader.read(buf)) != -1) { sb.append(buf, 0, len); } return sb.toString(); } finally { reader.close(); } }", "tokens": 97} {"id": 403575, "source": "method", "repo": "microsoft/mssql-jdbc", "text": "/** Verifies that an exception message (and all causes) does not contain the given password. */ private void assertExceptionDoesNotContainPassword(SQLException e, String password) { Throwable current = e; while (current != null) { String msg = current.getMessage(); if (msg != null) { assertFalse(msg.contains(password), \"Exception message (\" + current.getClass().getSimpleName() + \") must NOT contain the password. Message: \" + msg.substring(0, Math.min(msg.length(), 200))); } current = current.getCause(); } }", "tokens": 122} {"id": 403580, "source": "method", "repo": "microsoft/mssql-jdbc", "text": "public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException { logUsage(); return new Socket(address, port, localAddress, localPort); }", "tokens": 41} {"id": 403601, "source": "method", "repo": "microsoft/mssql-jdbc", "text": "void setup() throws Exception { try (Connection conn = getConnection(); Statement stmt = conn.createStatement()) { TestUtils.dropTableIfExists(tbl, stmt); stmt.execute(\"CREATE TABLE \" + tbl + \" (id INT PRIMARY KEY, value INT NULL, name VARCHAR(200) NULL)\"); stmt.execute(\"INSERT INTO \" + tbl + \" VALUES (1, 10, 'Original')\"); } }", "tokens": 92} {"id": 403696, "source": "method", "repo": "microsoft/mssql-jdbc", "text": "/** Numeric types test @throws SQLException */ public void numericTest() throws SQLException { try { populateNumericTable(); testBeforeExcute(); selectNumeric(); checkNumericMetaData(); // old PQ implementation doesn't work with \"insert\" if (version >= SQL_SERVER_2012_VERSION) { insertNumeric(); checkNumericMetaData(); updateNumeric(); checkNumericMetaData(); } deleteNumeric(); checkNumericMetaData(); } catch (Exception e) { fail(e.getMessage()); } }", "tokens": 102} {"id": 403755, "source": "method", "repo": "microsoft/semantic-kernel-java", "text": "/** Constructor for ChatHistoryAgentThread. @param id The ID of the thread. @param chatHistory The chat history. */ public ChatHistoryAgentThread(String id, @Nullable ChatHistory chatHistory) { super(id); this.chatHistory = chatHistory != null ? chatHistory : new ChatHistory(); }", "tokens": 66} {"id": 403759, "source": "method", "repo": "microsoft/semantic-kernel-java", "text": "public Flux> getStreamingChatMessageContentsAsync( ChatHistory chatHistory, @Nullable Kernel kernel, @Nullable InvocationContext invocationContext) { LOGGER.warn(\"Streaming has been called on GeminiChatCompletion service. \" + \"This is currently not supported in Gemini. \" + \"The results will be returned in a non streaming fashion.\"); return getChatMessageContentsAsync(chatHistory, kernel, invocationContext) .flatMapIterable(chatMessageContents -> chatMessageContents) .map(content -> { return new GeminiStreamingChatMessageContent( content.getAuthorRole(), content.getContent(), getModelId(), content.getInnerContent(), content.getEncoding(), content.getMetadata(), null, UUID.randomUUID().toString()); }); }", "tokens": 150} {"id": 404178, "source": "method", "repo": "microsoft/semantic-kernel-java", "text": "/** Adds a trivial split filter to the builder. Pages that match this filter will be merged into the previous chunk. @param trivialChunkFilter @return the builder */ public Builder setTrivialSplitFilter(TrivialChunkFilter trivialChunkFilter) { this.trivialChunkFilter = trivialChunkFilter; return this; }", "tokens": 65} {"id": 404238, "source": "method", "repo": "microsoft/semantic-kernel-java", "text": "/** Creates a new instance of the {@link InstantContextVariableTypeConverter} class. */ public InstantContextVariableTypeConverter() { super( Instant.class, s -> { if (s instanceof String) { return Instant.parse((String) s); } else if (s instanceof OffsetDateTime) { return ((OffsetDateTime) s).toInstant(); } return null; }, Object::toString, o -> { return Instant.parse(o); }); }", "tokens": 98} {"id": 404354, "source": "method", "repo": "microsoft/semantic-kernel-java", "text": "public PromptTemplate tryCreate(@NonNull PromptTemplateConfig templateConfig) { for (PromptTemplateFactory factory : templateFactories) { try { return factory.tryCreate(templateConfig); } catch (UnknownTemplateFormatException ignored) { // No-op } } throw new UnknownTemplateFormatException(templateConfig.getTemplateFormat()); }", "tokens": 65} {"id": 404589, "source": "method", "repo": "microsoft/typespec", "text": "/** {@inheritDoc}. */ public UnionClientBuilder httpInstrumentationOptions(HttpInstrumentationOptions httpInstrumentationOptions) { this.httpInstrumentationOptions = httpInstrumentationOptions; return this; }", "tokens": 36} {"id": 404646, "source": "method", "repo": "microsoft/typespec", "text": "/** Gets the QueriesImpl object to access its operations. @return the QueriesImpl object. */ public QueriesImpl getQueries() { return this.queries; }", "tokens": 36} {"id": 404771, "source": "method", "repo": "microsoft/typespec", "text": "/** The withClass operation. @param body The body parameter. @param requestContext The context to configure the HTTP request before HTTP client sends it. @throws IllegalArgumentException thrown if parameters fail the validation. @throws HttpResponseException thrown if the service returns an error. @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @return the {@link Response}. */ public Response withClassWithResponse(ClassModel body, RequestContext requestContext) { return this.instrumentation.instrumentWithResponse(\"SpecialWords.Models.withClass\", requestContext, updatedContext -> { final String contentType = \"application/json\"; return service.withClass(this.client.getEndpoint(), contentType, body, updatedContext); }); }", "tokens": 147} {"id": 404979, "source": "method", "repo": "microsoft/typespec", "text": "private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, \"'endpoint' cannot be null.\"); }", "tokens": 61} {"id": 405006, "source": "method", "repo": "microsoft/typespec", "text": "public void get() { EnumProperty enumProperty = client.get(); FixedInnerEnum innerEnum = enumProperty.getProperty(); Assertions.assertEquals(\"ValueOne\", innerEnum.toString()); }", "tokens": 39} {"id": 405094, "source": "method", "repo": "microsoft/typespec", "text": "/** Creates a base node for a JSON flattened tree. @return A new base node for a JSON flattened tree. */ public static JsonFlattenedPropertiesTree createBaseNode() { return new JsonFlattenedPropertiesTree(null, null); }", "tokens": 50} {"id": 405185, "source": "method", "repo": "microsoft/typespec", "text": "public Proxy build() { return new Proxy(name, clientTypeName, baseURL, methods); }", "tokens": 21} {"id": 405604, "source": "method", "repo": "microsoft/vscode-gradle", "text": "protected Compiler newCompiler() { // disable entire javadoc support if not interested in diagnostics Map projectOptions = ((JavaProblemChecker) this.javaBuilder).javaProject.getOptions(true); String option = projectOptions.get(JavaCore.COMPILER_PB_INVALID_JAVADOC); if (option == null || option.equals(JavaCore.IGNORE)) { // TODO (frederic) see why option is null sometimes while running model tests!? option = projectOptions.get(JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS); if (option == null || option.equals(JavaCore.IGNORE)) { option = projectOptions.get(JavaCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS); if (option == null || option.equals(JavaCore.IGNORE)) { option = projectOptions.get(JavaCore.COMPILER_PB_UNUSED_IMPORT); if (option == null || option.equals(JavaCore.IGNORE)) { // Unused import need also to look inside javadoc comment projectOptions.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.DISABLED); } } } } // called once when the builder is initialized... can override if needed CompilerOptions compilerOptions = new CompilerOptions(projectOptions); compilerOptions.performMethodsFullRecovery = true; compilerOptions.performStatementsRecovery = true; Compiler newCompiler = createCompiler(compilerOptions); CompilerOptions options = newCompiler.options; // temporary code to allow the compiler to revert to a single thread String setting = System.getProperty(\"jdt.compiler.useSingleThread\"); //$NON-NLS-1$ newCompiler.useSingleThread = setting != null && setting.equals(\"true\"); //$NON-NLS-1$ // enable the compiler reference info support options.produceReferenceInfo = true; if (options.complianceLevel >= ClassFileConstants.JDK1_6 && options.processAnnotations) { // support for Java 6 annotation processors initializeAnnotationProcessorManager(newCompiler); } return newCompiler; }", "tokens": 444} {"id": 405944, "source": "method", "repo": "microsoft/vscode-gradle", "text": "void recordStructuralDependency(IProject prereqProject, State prereqState) { if (prereqState != null) if (prereqState.lastStructuralBuildTime > 0) // can skip if 0 (full build) since its assumed to be 0 if unknown this.structuralBuildTimes.put(prereqProject.getName(), Long.valueOf(prereqState.lastStructuralBuildTime)); }", "tokens": 90} {"id": 405950, "source": "method", "repo": "microsoft/vscode-gradle", "text": "private static IPath readNullablePath(CompressedReader in) throws IOException { String path = in.readStringUsingDictionary(); if (!path.isEmpty()) return new Path(path); return null; }", "tokens": 41} {"id": 406266, "source": "method", "repo": "microsoft/vscode-gradle", "text": "private void replyWithStandardError(byte[] bytes) { ByteString byteString = ByteString.copyFrom(bytes); notify(RunBuildReply.newBuilder() .setOutput(Output.newBuilder().setOutputType(Output.OutputType.STDERR).setOutputBytes(byteString)) .build()); }", "tokens": 64} {"id": 406425, "source": "method", "repo": "microsoftgraph/msgraph-sdk-java", "text": "/** Sets the encryptionCertificateId property value. The encryptionCertificateId property @param value Value to set for the encryptionCertificateId property. */ public void setEncryptionCertificateId(@jakarta.annotation.Nullable final String value) { this.backingStore.set(\"encryptionCertificateId\", value); }", "tokens": 61} {"id": 406461, "source": "method", "repo": "microwind/algorithms", "text": "public JobScheduling(int[] jobTimes, int numMachines) { this.jobTimes = jobTimes; this.numMachines = numMachines; this.n = jobTimes.length; this.minMakespan = Integer.MAX_VALUE; this.bestSchedule = new ArrayList<>(); this.currentSchedule = new ArrayList<>(); this.machineTimes = new int[numMachines]; for (int i = 0; i < numMachines; i++) { currentSchedule.add(new ArrayList<>()); } }", "tokens": 110} {"id": 406513, "source": "method", "repo": "microwind/algorithms", "text": "static void testMultipleJumps() { System.out.println(\"\\n[Test 6] Requires multiple jumps\"); int[] nums = {2, 3, 1, 1, 1}; JumpGameAnalysis analysis = analyzeJumpGame(nums); System.out.println(\"Input: \" + Arrays.toString(nums)); System.out.println(\"Analysis: \" + analysis); }", "tokens": 87} {"id": 406557, "source": "method", "repo": "microwind/algorithms", "text": "public static int powerOfTwoExponent(int n) { if (!isPowerOfTwo(n)) { return -1; } int exp = 0; while ((n & 1) == 0) { n >>= 1; exp++; } return exp; }", "tokens": 57} {"id": 406618, "source": "method", "repo": "microwind/algorithms", "text": "public static void main(String[] args) { DoubleLinkedList doubleLinkedList = new DoubleLinkedList(); doubleLinkedList.add(1); doubleLinkedList.add(2); doubleLinkedList.add(3); doubleLinkedList.add(3); doubleLinkedList.add(4); doubleLinkedList.add(5); doubleLinkedList.printNode(); doubleLinkedList.remove(3); doubleLinkedList.printNode(); }", "tokens": 82} {"id": 406639, "source": "method", "repo": "microwind/algorithms", "text": "public boolean isQueueEmpty() { return size == 0; }", "tokens": 15} {"id": 406640, "source": "method", "repo": "microwind/algorithms", "text": "public boolean isQueueFull() { return size == MAX_QUEUE_SIZE; }", "tokens": 18} {"id": 406685, "source": "method", "repo": "microwind/algorithms", "text": "public static int digitSum(int n) { int sum = 0; while (n > 0) { sum += n % 10; n /= 10; } return sum; }", "tokens": 44} {"id": 406993, "source": "method", "repo": "microwind/design-patterns", "text": "public int getTotalPages() { if (pageSize <= 0) { return 0; } return (int) ((totalElements + pageSize - 1) / pageSize); }", "tokens": 38} {"id": 407213, "source": "method", "repo": "mik3y/usb-serial-for-android", "text": "void stop() { mainLooper.removeCallbacks(runnable); rtsBtn.setChecked(false); ctsBtn.setChecked(false); dtrBtn.setChecked(false); dsrBtn.setChecked(false); cdBtn.setChecked(false); riBtn.setChecked(false); }", "tokens": 62} {"id": 407514, "source": "method", "repo": "mik3y/usb-serial-for-android", "text": "public int getWriteTimeout() { return mWriteTimeout; }", "tokens": 14} {"id": 407527, "source": "method", "repo": "mik3y/usb-serial-for-android", "text": "/** Continuously services the read buffers until {@link #stop()} is called, or until a driver exception is raised. */ void runRead() { Log.i(TAG, \"runRead running ...\"); try { setThreadPriority(); mStartuplatch.countDown(); do { stepRead(); } while (isStillRunning()); Log.i(TAG, \"runRead: Stopping mState=\" + getState()); } catch (Throwable e) { if (Thread.currentThread().isInterrupted()) { Log.w(TAG, \"runRead: interrupted\"); } else if(mSerialPort.isOpen()) { Log.w(TAG, \"runRead ending due to exception: \" + e.getMessage(), e); } else { Log.i(TAG, \"runRead: Socket closed\"); } notifyErrorListener(e); } finally { if (mState.compareAndSet(State.RUNNING, State.STOPPING)) { synchronized (mWriteBufferLock) { mWriteBufferLock.notifyAll(); // wake up write thread to check the stop condition } } else if (mState.compareAndSet(State.STOPPING, State.STOPPED)) { Log.i(TAG, \"runRead: Stopped mState=\" + getState()); } } }", "tokens": 257} {"id": 407585, "source": "method", "repo": "MindustryTool/MindustryToolMod", "text": "void resetUnitState(@Nullable Unit unit) { if (unit != null) { unit.isShooting(false); unit.mineTile = null; } if (currentTask != null && currentTask.getAI() != null) { currentTask.getAI().clearTargetPos(); } }", "tokens": 63} {"id": 407696, "source": "method", "repo": "MindustryTool/MindustryToolMod", "text": "public void setFog(boolean enabled) { if (Vars.state != null && Vars.state.rules != null) { Vars.state.rules.fog = enabled; if (Vars.net.server()) { Call.setRules(Vars.state.rules); } } }", "tokens": 61} {"id": 407698, "source": "method", "repo": "MindustryTool/MindustryToolMod", "text": "public void killUnits(@Nullable UnitType unit, @Nullable Team team) { if (unit != null && team != null) { js(\"Groups.unit.each(u => u.type.id == @ && u.team.id == @, u => u.kill());\", unit.id, team.id); } }", "tokens": 73} {"id": 407786, "source": "method", "repo": "MindustryTool/MindustryToolMod", "text": "public void keepInScreen() { if (hud != null) { hud.keepInScreen(); } }", "tokens": 23} {"id": 407826, "source": "method", "repo": "MindustryTool/MindustryToolMod", "text": "public void setSelectedTeam(Team team) { this.selectedTeam = team; this.selectedTeamSignal.set(team); this.usedUnits.clear(); this.usedUnitsSignal.set(new Seq<>()); lastSnapshot.clear(); rateDisplay.clear(); this.teamGraphs.clear(); tickSignal.set(tickSignal.get() + 1); }", "tokens": 80} {"id": 407850, "source": "method", "repo": "MindustryTool/MindustryToolMod", "text": "public String getName() { return Core.bundle != null ? Core.bundle.get(\"feature.translation.provider.devx\", \"DevX\") : \"DevX\"; }", "tokens": 38} {"id": 407954, "source": "method", "repo": "MindustryTool/MindustryToolMod", "text": "void move_respectsBoundariesAndUnknownIds() { TestFeature a = new TestFeature(\"qa-a\", true, false); TestFeature b = new TestFeature(\"qa-b\", true, false); FeatureManager.register(a, b); QuickAccessFeature feature = new QuickAccessFeature(); feature.displayOrderConfig.set(Seq.with(\"qa-a\", \"qa-b\")); assertFalse(feature.moveUp(\"qa-a\")); assertFalse(feature.moveDown(\"qa-b\")); assertFalse(feature.moveUp(\"unknown-id\")); assertFalse(feature.moveUp(null)); assertEquals(Seq.with(\"qa-a\", \"qa-b\"), feature.getDisplayOrder()); }", "tokens": 148} {"id": 408258, "source": "method", "repo": "MindustryTool/MindustryToolMod", "text": "public SolimButtonStyleBuilder disabled(@Nullable Cons config) { if (config != null) { if (disabled == null) { disabled = new ButtonStateBuilder(); } config.get(disabled); } return this; }", "tokens": 52} {"id": 408266, "source": "method", "repo": "MindustryTool/MindustryToolMod", "text": "void testNamespaceAndKeyResolution() { ConfigGroup root = ConfigGroup.of(\"my.mod\"); assertEquals(\"my.mod\", root.getNamespace()); assertEquals(\"my.mod.enabled\", root.resolveKey(\"enabled\")); assertEquals(\"my.mod.enabled\", root.resolveKey(\".enabled\")); ConfigGroup sub = root.group(\"feature\"); assertEquals(\"my.mod.feature\", sub.getNamespace()); assertEquals(\"my.mod.feature.timeout\", sub.resolveKey(\"timeout\")); ConfigGroup empty = ConfigGroup.of(\"\"); assertEquals(\"standalone\", empty.resolveKey(\"standalone\")); }", "tokens": 123} {"id": 408431, "source": "method", "repo": "MindustryTool/MindustryToolMod", "text": "void testUntrackedExecution() { Signal count = Signal.of(0); int[] effectRuns = new int[]{0}; Effect.of(() -> { effectRuns[0]++; // read inside untracked int val = ReactiveContext.untracked(count::get); assertEquals(val, count.peek()); }); assertEquals(1, effectRuns[0]); count.set(1); count.set(2); assertEquals(1, effectRuns[0], \"Effect should not re-run because signal read was untracked\"); }", "tokens": 115} {"id": 408577, "source": "method", "repo": "MindustryVN/MindustryToolMod", "text": "private void buildRoomInviteCard(String link) { PlayerConnectFeature pc = FeatureManager.getFeature(PlayerConnectFeature.class); Readable roomSignal = (pc != null && pc.isEnabled()) ? pc.getRooms().map(rooms -> findRoomByLink(rooms, link)) : Signal.of(null); dynamic(roomSignal, room -> { if (room != null) { new RoomCard(room, false); } else { buildFallbackRoomCardContent(link); } }) .height(ChatMessageHeightCalculator.INVITE_CARD_HEIGHT) .growX() .name(\"pc-card-wrapper\"); }", "tokens": 142} {"id": 408673, "source": "method", "repo": "MindustryVN/MindustryToolMod", "text": "public String nameKey() { return \"pretty-chat.prettier.bubble.name\"; }", "tokens": 22} {"id": 408701, "source": "method", "repo": "MindustryVN/MindustryToolMod", "text": "public float getButtonOpacity() { Float opacity = buttonOpacityConfig.get(); float value = opacity != null ? opacity : MAX_BUTTON_OPACITY; return Math.max(MIN_BUTTON_OPACITY, Math.min(MAX_BUTTON_OPACITY, value)); }", "tokens": 62} {"id": 408711, "source": "method", "repo": "MindustryVN/MindustryToolMod", "text": "private void openScreenshotsFolder() { try { Fi directory = Vars.screenshotDirectory; if (!Core.app.openFolder(directory.absolutePath())) { Core.app.setClipboardText(directory.absolutePath()); Vars.ui.showInfoFade(Core.bundle.get(\"feature.screenshot.success.copied\")); } } catch (Exception e) { Vars.ui.showException(e); } }", "tokens": 89} {"id": 408768, "source": "method", "repo": "MindustryVN/MindustryToolMod", "text": "public String header(String name) { if (headers == null || name == null) return null; for (Map.Entry> entry : headers.entrySet()) { if (name.equalsIgnoreCase(entry.getKey())) { List values = entry.getValue(); return (values != null && !values.isEmpty()) ? values.get(0) : null; } } return null; }", "tokens": 89} {"id": 408880, "source": "method", "repo": "MindustryVN/MindustryToolMod", "text": "public ContextualConfigValue boolValueKeyed( String name, Readable discriminant, Func keySuffix, boolean defaultValue) { return valueKeyed(name, discriminant, keySuffix, defaultValue, ConfigPersister.BOOLEAN); }", "tokens": 62} {"id": 409044, "source": "method", "repo": "MindustryVN/MindustryToolMod", "text": "static Readable from(Prov Prov) { return Prov::get; }", "tokens": 26} {"id": 409084, "source": "method", "repo": "MindustryVN/MindustryToolMod", "text": "void appliesCellConstraintsDirectlyOnAttachmentStackAttach() { Table root = new Table(); AttachmentStack.push(root); TestLeaf leaf = new TestLeaf(); leaf.minWidth(80f).growX(); AttachmentStack.pop(); Cell cell = root.getCell(leaf.element()); assertNotNull(cell); assertEquals(80f, CellAccess.minWidth(cell), 0.01f); assertEquals(1, CellAccess.expandX(cell)); assertEquals(1f, CellAccess.fillX(cell), 0.01f); }", "tokens": 116} {"id": 409106, "source": "method", "repo": "MindustryVN/MindustryToolMod", "text": "void reactiveVisibleUpdatesLabelVisibility() { Signal vis = Signal.of(true); Text t = new Text(\"Hello\").visible(vis); assertTrue(t.label().visible); vis.set(false); assertFalse(t.label().visible); vis.set(true); assertTrue(t.label().visible); t.dispose(); }", "tokens": 78} {"id": 409320, "source": "method", "repo": "Minecraft-Transit-Railway/Minecraft-Transit-Railway", "text": "public void randomDisplayTick2(BlockState state, World world, BlockPos pos, Random random) { final boolean light = hasLight(IBlock.getStatePropertySafe(state, FACING), pos); if (IBlock.getStatePropertySafe(state, LIGHT) != light) { world.setBlockState(pos, state.with(new Property<>(LIGHT.data), light)); } }", "tokens": 79} {"id": 409455, "source": "method", "repo": "Minecraft-Transit-Railway/Minecraft-Transit-Railway", "text": "public void tick(long millisElapsed) { if (enabled) { time += millisElapsed; amount = amplitude * Math.sin(PERIOD_MULTIPLIER * time); if (amplitude < scheduledAmplitude) { amplitude = Math.min(scheduledAmplitude, amplitude + millisElapsed / DAMPING_1); } else if (amplitude > 0.01) { amplitude /= Math.exp(millisElapsed / DAMPING_2); scheduledAmplitude = 0; } else { amplitude = 0; time = 0; } } }", "tokens": 112} {"id": 409574, "source": "method", "repo": "Minecraft-Transit-Railway/Minecraft-Transit-Railway", "text": "private PacketUpdateData(String content) { super(content); }", "tokens": 15} {"id": 409576, "source": "method", "repo": "Minecraft-Transit-Railway/Minecraft-Transit-Railway", "text": "public static void sendDirectlyToServerSignalModification(ServerWorld serverWorld, SignalModification signalModification) { new PacketUpdateData(new UpdateDataRequest(new MinecraftClientData()).addSignalModification(signalModification)).runServerOutbound(serverWorld, null); }", "tokens": 52} {"id": 409691, "source": "method", "repo": "Minecraft-Transit-Railway/Minecraft-Transit-Railway", "text": "public int getColor(boolean formatted) { return color; }", "tokens": 13} {"id": 409766, "source": "method", "repo": "Minecraft-Transit-Railway/Minecraft-Transit-Railway", "text": "protected void doPost(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { final AsyncContext asyncContext = httpServletRequest.startAsync(); asyncContext.setTimeout(0); setEncoding(httpServletRequest, httpServletResponse); switch (httpServletRequest.getPathInfo()) { case \"/zip\": reset(); uploadZip(httpServletRequest, httpServletResponse, asyncContext); break; case \"/resources\": uploadResource(httpServletRequest, httpServletResponse, asyncContext); break; default: returnErrorResponse(httpServletResponse, asyncContext); break; } }", "tokens": 107} {"id": 409786, "source": "method", "repo": "MinecraftFreecam/Freecam", "text": "/** Init {@link #factory} lazily, so that {@link ModConfigScreenFactory} is not class-loaded immediately.

This gives consumers an opportunity to test {@link ClothConfigScreenProvider#isAvailable()} before use. @return {@link #factory} initialized */ private ModConfigScreenFactory factory() { if (factory == null) { factory = new ModConfigScreenFactory(ConfigControllerRegistry.get(ModConfigDTO.class)); } return factory; }", "tokens": 95} {"id": 409827, "source": "method", "repo": "MinecraftFreecam/Freecam", "text": "public static void disableNextTick() { disableNextTick = true; }", "tokens": 16} {"id": 409882, "source": "method", "repo": "MinecraftFreecam/Freecam", "text": "static CollisionPredicate create(CollisionConfig config) { if (config.ignoreAll) return IGNORE; CollisionPredicateBuilder builder = builder(); if (config.ignoreTransparent) builder.matching(IGNORE_TRANSPARENT); if (config.ignoreOpenable) builder.matching(IGNORE_OPENABLE); if (config.ignoreCustom) builder.matching(whitelist(config.whitelist)); return builder.build(); }", "tokens": 86} {"id": 410130, "source": "method", "repo": "minelittlepony/minelittlepony", "text": "public Models steve() { return new Models(steveKey, armorFactory); }", "tokens": 33} {"id": 410436, "source": "method", "repo": "minelittlepony/minelittlepony", "text": "public Optional> getModelData() { return key.getOrLoadModelData(); }", "tokens": 20} {"id": 410440, "source": "method", "repo": "minelittlepony/minelittlepony", "text": "static & MsonModel & PonyModel> PlayerModelKey registerPlayer(String name, Race race, BiFunction constructor) { return registerPlayer(name, race, constructor, PonyArmourModel::new); }", "tokens": 63} {"id": 410451, "source": "method", "repo": "minelittlepony/minelittlepony", "text": "private Stream performLookup(ArmourTexture id) { List options = Stream.of(id).flatMap(ArmourTexture::ponify).toList(); return options.stream().distinct() .filter(ArmourTexture::validate) .findFirst() .or(() -> { MineLittlePony.LOGGER.warn(\"Could not identify correct texture to use for {}. Was none of: [\" + System.lineSeparator() + \"{}\" + System.lineSeparator() + \"]\", id, options.stream() .map(ArmourTexture::texture) .map(Identifier::toString) .collect(Collectors.joining(\",\" + System.lineSeparator()))); return Optional.empty(); }).stream(); }", "tokens": 155} {"id": 410507, "source": "method", "repo": "minelittlepony/minelittlepony", "text": "public void positionheldItem(WitchRenderer.State state, HumanoidArm arm, PoseStack matrices) { super.positionheldItem(state, arm, matrices); matrices.rotateDegrees(Axis.XP, 10); }", "tokens": 45} {"id": 410523, "source": "method", "repo": "minelittlepony/minelittlepony", "text": "public SeaponyModel(ModelPart tree) { this(tree, false); }", "tokens": 18} {"id": 410590, "source": "method", "repo": "minelittlepony/minelittlepony", "text": "public boolean shouldApply() { return MobRenderers.COPPER_GOLEMS.option().get() && ResourceUtil.textureExists(texture); }", "tokens": 32} {"id": 410656, "source": "method", "repo": "minelittlepony/minelittlepony", "text": "public void submit(Pair, T> data, PoseStack matrices, SubmitNodeCollector frame, int light, int overlay, boolean glint, int outline) { if (data.getFirst() == null || !data.getFirst().submit(matrices, frame, light, outline, null)) { renderer.submit(data.getSecond(), matrices, frame, light, overlay, glint, outline); } }", "tokens": 89} {"id": 410735, "source": "method", "repo": "minelittlepony/minelittlepony", "text": "public Identifier getTextureLocation(State state) { return MineLittlePony.getInstance().getVariatedTextures().get(BREEZIE_PONIES).getId(state.uuid).orElse(DefaultPonySkinHelper.STEVE); }", "tokens": 55} {"id": 410803, "source": "method", "repo": "minelittlepony/minelittlepony", "text": "public PonifiedFeature(RenderLayerParent context, T feature) { super(context); this.feature = feature; }", "tokens": 37} {"id": 411073, "source": "method", "repo": "minimallycorrect/tickthreading", "text": "public synchronized void lockInterruptibly() throws InterruptedException { throw new UnsupportedOperationException(); }", "tokens": 18} {"id": 411088, "source": "method", "repo": "minimallycorrect/tickthreading", "text": "public Condition newCondition() { throw new UnsupportedOperationException(\"TwoWayReentrantReadWriteLock doesn't support this.\"); }", "tokens": 27} {"id": 411146, "source": "method", "repo": "minimallycorrect/tickthreading", "text": "public static void setDateFormat(SimpleDateFormat dateFormat) { if (dateFormat != null) { LogFormatter.dateFormat = dateFormat; } }", "tokens": 29} {"id": 411190, "source": "method", "repo": "minimallycorrect/tickthreading", "text": "public static int get(String name, int default_) { return Integer.parseInt(System.getProperty(PROPERTY_PREFIX + name, String.valueOf(default_))); }", "tokens": 37} {"id": 411259, "source": "method", "repo": "mioclient/oyvey-ported", "text": "public static RequiredArgumentBuilder argument(String name, ArgumentType type) { return RequiredArgumentBuilder.argument(name, type); }", "tokens": 37} {"id": 411269, "source": "method", "repo": "mioclient/oyvey-ported", "text": "private int settingChangeReturn(final Setting setting) { return success(\"Set %s.%s to %s\", module.getName(), setting.getName(), setting.getValue()); }", "tokens": 39} {"id": 411367, "source": "method", "repo": "mioclient/oyvey-ported", "text": "public void onKeyPressed(int key) { }", "tokens": 11} {"id": 411407, "source": "method", "repo": "mioclient/oyvey-ported", "text": "public void mouseClicked(int mouseX, int mouseY, int mouseButton) { super.mouseClicked(mouseX, mouseY, mouseButton); if (!this.items.isEmpty()) { if (mouseButton == 1 && this.isHovering(mouseX, mouseY)) { this.subOpen = !this.subOpen; mc.getSoundManager().play(SimpleSoundInstance.forUI(SoundEvents.UI_BUTTON_CLICK, 1f)); } if (this.subOpen) { for (Item item : this.items) { if (item.isHidden()) continue; item.mouseClicked(mouseX, mouseY, mouseButton); } } } }", "tokens": 128} {"id": 411474, "source": "method", "repo": "mioclient/oyvey-ported", "text": "private void onPacketSend(PacketEvent.Send event) { if (event.getPacket() instanceof ServerboundInteractPacket packet && packet.action.getType() == ServerboundInteractPacket.ActionType.ATTACK) { Entity entity = mc.level.getEntity(packet.entityId); if (entity == null || entity instanceof EndCrystal || !mc.player.onGround() || !(entity instanceof LivingEntity)) return; boolean bl = mc.player.horizontalCollision; mc.player.connection.send(new ServerboundMovePlayerPacket.Pos(mc.player.getX(), mc.player.getY() + 0.1f, mc.player.getZ(), false, bl)); mc.player.connection.send(new ServerboundMovePlayerPacket.Pos(mc.player.getX(), mc.player.getY(), mc.player.getZ(), false, bl)); mc.player.crit(entity); } }", "tokens": 190} {"id": 411601, "source": "method", "repo": "mioclient/oyvey-ported", "text": "public void fromJson(JsonElement element) { friends.clear(); if (element == null || !element.isJsonObject()) return; JsonElement array = element.getAsJsonObject().get(\"friends\"); if (array == null || !array.isJsonArray()) return; for (JsonElement e : array.getAsJsonArray()) { String name = e.getAsString(); if (!friends.contains(name)) friends.add(name); } }", "tokens": 86} {"id": 411715, "source": "method", "repo": "mioclient/oyvey-ported", "text": "public static float clamp(float num, float min, float max) { return num < min ? min : Math.min(num, max); }", "tokens": 32} {"id": 411747, "source": "method", "repo": "mioclient/oyvey-ported", "text": "public static void init() { if (formatter != null) throw new IllegalStateException(\"Formatter is already initialized\"); formatter = new FabricCatFormat(true); initColors(); }", "tokens": 36} {"id": 412014, "source": "method", "repo": "misterpemodder/shulkerboxtooltip", "text": "public BooleanValueConfigEntry(ConfigCategoryTab tab, ValueConfigNode valueNode) { super(tab, valueNode); this.valueButton = CycleButton.booleanBuilder(CommonComponents.GUI_YES.copy().withStyle(ChatFormatting.GREEN), CommonComponents.GUI_NO.copy().withStyle(ChatFormatting.RED), this.getValue()).displayOnlyValue().create(0, 0, 160, 20, valueNode.getTitle(), (b, value) -> this.setValue(value)); this.children.addFirst(this.valueButton); }", "tokens": 130} {"id": 412037, "source": "method", "repo": "misterpemodder/shulkerboxtooltip", "text": "public List children() { return this.textWidgetAsList; }", "tokens": 19} {"id": 412065, "source": "method", "repo": "misterpemodder/shulkerboxtooltip", "text": "/** Writes a version to the given packet buffer. @param buf The byte buffer. */ public void writeToPacketBuf(FriendlyByteBuf buf) { buf.writeInt(this.major); buf.writeInt(this.minor); }", "tokens": 47} {"id": 412268, "source": "method", "repo": "misterpemodder/shulkerboxtooltip", "text": "public Class getType() { return this.type; }", "tokens": 16} {"id": 412321, "source": "method", "repo": "misterpemodder/shulkerboxtooltip", "text": "/** Add the passed stack into the item list. Does not check if items are equal. @param stack The stack to add @param slot The slot this stack is located in. */ public void add(ItemStack stack, int slot, ItemStackMergingStrategy mergingStrategy) { if (slot < 0 || slot >= this.subItems.size()) return; this.subItems.set(slot, stack.copy()); if (slot < this.firstSlot) this.firstSlot = slot; if (this.merged.isEmpty()) { if (mergingStrategy == ItemStackMergingStrategy.IGNORE) { this.merged = copyStackWithoutComponents(stack); } else { this.merged = stack.copy(); } } else { this.merged.grow(stack.getCount()); } }", "tokens": 162} {"id": 412513, "source": "method", "repo": "mizosoft/methanol", "text": "/** Returns {@code true} if {@code response.statusCode()} is a 3xx redirection status code. */ public static boolean isRedirection(HttpResponse response) { return isRedirection(response.statusCode()); }", "tokens": 44} {"id": 412524, "source": "method", "repo": "mizosoft/methanol", "text": "public Optional adapterCodec() { return adapterCodec; }", "tokens": 16} {"id": 412640, "source": "method", "repo": "mizosoft/methanol", "text": "public void onComplete() { if (completed) { return; } completed = true; upstream.clear(); try (decoder) { // Acknowledge final decode round. source.complete(); decoder.decode(source, sink); if (source.hasRemaining()) { throw new IOException(\"un-exhausted bytes after final source: \" + source.remaining()); } } catch (IOException e) { subscription().fireOrKeepAliveOnError(e); return; } var remaining = sink.slice(true); if (remaining.isEmpty()) { subscription().complete(); } else { subscription().submitAndComplete(remaining); } }", "tokens": 126} {"id": 412760, "source": "method", "repo": "mizosoft/methanol", "text": "/** Creates a new {@code DeflateBodyDecoderFactory}. Meant to be called by {@code ServiceLoader}. */ public DeflateBodyDecoderFactory() {}", "tokens": 34} {"id": 412764, "source": "method", "repo": "mizosoft/methanol", "text": "AsyncDecoder newDecoder() { return new GzipDecoder(); }", "tokens": 14} {"id": 412769, "source": "method", "repo": "mizosoft/methanol", "text": "void onPrepare(GzipDecoder decoder) {}", "tokens": 10} {"id": 412931, "source": "method", "repo": "mizosoft/methanol", "text": "private static T getBody(BodySubscriber s) throws ExecutionException, InterruptedException { return toFuture(s).get(); }", "tokens": 35} {"id": 413025, "source": "method", "repo": "mizosoft/methanol", "text": "void tearDown() throws IOException { fileSystem.close(); }", "tokens": 12} {"id": 413112, "source": "method", "repo": "mizosoft/methanol", "text": "public byte[] readBytesGzipDecoder() throws Exception { return client .sendAsync(defaultGet, MoreBodyHandlers.decoding(BodyHandlers.ofInputStream())) .thenApply(HttpResponse::body) .join() .readAllBytes(); }", "tokens": 49} {"id": 413339, "source": "method", "repo": "mizosoft/methanol", "text": "public boolean isReadOnly() { return delegate.isReadOnly(); }", "tokens": 13} {"id": 413355, "source": "method", "repo": "mizosoft/methanol", "text": "private Path wrapNullable(@Nullable Path path) { return path != null ? wrap(path) : null; }", "tokens": 24} {"id": 413536, "source": "method", "repo": "mjedynak/builder-generator-idea-plugin", "text": "private void removeLastSemicolon(StringBuilder sb) { if (sb.toString().endsWith(SEMICOLON)) { sb.deleteCharAt(sb.length() - 1); } }", "tokens": 42} {"id": 413637, "source": "method", "repo": "mjedynak/builder-generator-idea-plugin", "text": "void shouldGetItsOwnText() { // when String result = action.getText(); // then assertThat(result).isEqualTo(TEXT); }", "tokens": 29} {"id": 413665, "source": "method", "repo": "mjedynak/builder-generator-idea-plugin", "text": "void shouldFindConstructorWithExactMatching() { doTest( Lists.newArrayList(psiField1, psiField2), new PsiMethod[] {constructor0, constructor1, constructor2a, constructor2b, constructor3}, constructor2a); }", "tokens": 52} {"id": 413695, "source": "method", "repo": "mjedynak/builder-generator-idea-plugin", "text": "private void initOtherCommonMocks() { given(builderClass.getMethods()) .willReturn(asList(method1, method2, method3).toArray(PsiMethod[]::new)); given(method1.getName()).willReturn(\"Builder\"); given(method2.getName()).willReturn(\"aBuilder\"); given(method2.getParameterList()).willReturn(parameterList1); given(parameterList1.getParametersCount()).willReturn(0); given(method3.getName()).willReturn(\"withAge\"); given(method3.getParameterList()).willReturn(parameterList2); given(parameterList2.getParametersCount()).willReturn(1); given(parameterList2.getParameters()).willReturn(List.of(parameter).toArray(PsiParameter[]::new)); given(parameter.getName()).willReturn(\"age\"); }", "tokens": 164} {"id": 413727, "source": "method", "repo": "mjedynak/builder-generator-idea-plugin", "text": "void shouldVerifyThatClassIsABuilderWhenItHasBuilderSuffix() { // given given(psiClass.getName()).willReturn(\"AnyNameThatEndsWithBuilder\"); // when boolean result = builderVerifier.isBuilder(psiClass); // then assertThat(result).isTrue(); }", "tokens": 56} {"id": 413827, "source": "method", "repo": "mkirsche/jasmine", "text": "static double editDistanceSimilarity(String s, String t) { int n = s.length(), m = t.length(); int[][] editDistance = new int[n+1][m+1]; for(int i = 1; i<=m; i++) editDistance[0][i] = i; for(int i = 1; i<=n; i++) editDistance[i][0] = i; for(int i = 1; i<=n; i++) { for(int j = 1; j<=m; j++) { boolean sameChar = s.charAt(i-1) == t.charAt(j-1); int bestDistance = editDistance[i-1][j-1] + (sameChar ? 0 : 1); bestDistance = Math.min(bestDistance, 1 + editDistance[i-1][j]); bestDistance = Math.min(bestDistance, 1 + editDistance[i][j-1]); editDistance[i][j] = bestDistance; } } return 1.0 * editDistance[n][m] / Math.max(n, m); }", "tokens": 255} {"id": 413844, "source": "method", "repo": "mkirsche/jasmine", "text": "public static TreeMap> readAllFiles(String fileList) throws Exception { ArrayList fileNames = PipelineManager.getFilesFromList(fileList); TreeMap>[] variantsPerFile = new TreeMap[fileNames.size()]; for(int i = 0; i> res = new TreeMap>(); for(int i = 0; i()); } for(Variant v : variantsPerFile[i].get(s)) { res.get(s).add(v); } } } return res; }", "tokens": 208} {"id": 413980, "source": "method", "repo": "mkotsur/restito", "text": "/** In case of POST request - returns post body */ public String getPostBody() { return postBody; }", "tokens": 25} {"id": 414040, "source": "method", "repo": "mkotsur/restito", "text": "/** This constructor allows to specify the port beside stubs. If the port is busy, Restito won't try to pick different one and java.net.BindException will be thrown. */ public StubServer(int port, Stub... stubs) { this.stubs.addAll(Arrays.asList(stubs)); simpleServer = HttpServer.createSimpleServer(null, port); }", "tokens": 84} {"id": 414093, "source": "method", "repo": "mkotsur/restito", "text": "public void shouldWorkIfPathContainsSpaces() { String path = smartDiscoverer.discoverResource(Method.POST, \"/spaces%20here/1.xml\").getPath(); assertTrue(path + \" does not ends as expected\", path.endsWith(prefix + \"/spaces%20here/1.xml\")); }", "tokens": 68} {"id": 414394, "source": "method", "repo": "mkpaz/atlantafx", "text": "public boolean canClose(Tab tab) { return true; }", "tokens": 14} {"id": 414514, "source": "method", "repo": "mkpaz/atlantafx", "text": "/** Applies or replaces a dynamic CSS stylesheet on a scene's root.

If the value is present, the generated CSS is encoded and appended or updated in place. If the value is {@code null}, any previously added CSS with the same identifier is removed. @param id the unique option identifier @param scene the target scene @param styleSupplier function generating plain CSS from the option value */ public void applyStylesheet(String id, Scene scene, Function styleSupplier) { applyStylesheet(id, scene.getRoot(), styleSupplier); }", "tokens": 117} {"id": 414530, "source": "method", "repo": "mkpaz/atlantafx", "text": "/** Stores the current Y scale factor of the specified node. @param node the target node */ public ResetState storeScaleY(Node node) { double val = node.getScaleY(); if (Double.compare(val, DEFAULT_SCALE) != 0) { this.scaleY = val; this.mask |= MASK_SCALE_Y; } else { this.mask &= ~MASK_SCALE_Y; } return this; }", "tokens": 94} {"id": 414565, "source": "method", "repo": "mkpaz/atlantafx", "text": "boolean isChangeListAllocated() { return changeListeners != null; }", "tokens": 15} {"id": 414747, "source": "method", "repo": "mkpaz/atlantafx", "text": "private Button createSearchButton() { var titleLbl = new Label(\"Search\", new FontIcon(Material2MZ.SEARCH)); var hintLbl = new Label(\"Press /\"); hintLbl.getStyleClass().addAll(\"hint\", TEXT_MUTED, TEXT_SMALL); var searchBox = new HBox(titleLbl, new Spacer(), hintLbl); searchBox.getStyleClass().add(\"content\"); searchBox.setAlignment(Pos.CENTER_LEFT); var root = new Button(); root.setContentDisplay(ContentDisplay.GRAPHIC_ONLY); root.getStyleClass().addAll(\"search-button\"); root.setGraphic(searchBox); root.setOnAction(_ -> openSearchDialog()); root.setMaxWidth(Double.MAX_VALUE); return root; }", "tokens": 152} {"id": 415003, "source": "method", "repo": "mkpaz/atlantafx", "text": "/** Type-helper method used to wrap a single {@link Supplier} when mixing static values and lambdas in the {@link #of(Object...)} overload. @param supplier the supplier instance to pass through @return the same supplier instance, with target type inferred */ public static Supplier cast(Supplier supplier) { return supplier; }", "tokens": 77} {"id": 415154, "source": "method", "repo": "mobclub/sharesdk-for-android", "text": "protected void onDestroy() { super.onDestroy(); manager.stopListen(); Log.e(TAG, \" onDestroy() \"); }", "tokens": 27} {"id": 415184, "source": "method", "repo": "mobclub/sharesdk-for-android", "text": "protected BasePresenter createPresenter() { return new ShowUserInfoPresenter(); }", "tokens": 15} {"id": 415385, "source": "method", "repo": "mobclub/sharesdk-for-android", "text": "public void printerestAuthorize() { Platform printerestShare = ShareSDK.getPlatform(Pinterest.NAME); doAuthorize(printerestShare); }", "tokens": 30} {"id": 415400, "source": "method", "repo": "mobclub/sharesdk-for-android", "text": "public void facebookMessageAuthorize() { Platform facebookMessageShare = ShareSDK.getPlatform(FacebookMessenger.NAME); doAuthorize(facebookMessageShare); }", "tokens": 32} {"id": 415478, "source": "method", "repo": "mobclub/sharesdk-for-android", "text": "public void shareText(PlatformActionListener mListener){ Platform platform = ShareSDK.getPlatform(KaiXin.NAME); Platform.ShareParams shareParams = new Platform.ShareParams(); shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText()); platform.setPlatformActionListener(mListener); platform.share(shareParams); }", "tokens": 65} {"id": 415500, "source": "method", "repo": "mobclub/sharesdk-for-android", "text": "public LittleredbookShare(PlatformActionListener listener) { this.platformActionListener = listener; }", "tokens": 21} {"id": 415774, "source": "method", "repo": "mobends/mobends", "text": "public void swapRotationYZ(String boneName) { Bone bone = bones.get(boneName); if (bone != null) for (Keyframe keyframe : bone.keyframes) keyframe.swapRotationYZ(); }", "tokens": 49} {"id": 415907, "source": "method", "repo": "mobends/mobends", "text": "public SectionIcon(int u, int v, int width, int height) { this.texU = u; this.texV = v; this.texWidth = width; this.texHeight = height; }", "tokens": 47} {"id": 416078, "source": "method", "repo": "mobends/mobends", "text": "public double getInterpolatedMotionZ() { return this.prevMotionZ + (this.motionZ - this.prevMotionZ) * DataUpdateHandler.partialTicks; }", "tokens": 37} {"id": 416160, "source": "method", "repo": "mobends/mobends", "text": "public void validate(IKumoValidationContext context) throws MalformedKumoTemplateException { // Does nothing by default. }", "tokens": 25} {"id": 416164, "source": "method", "repo": "mobends/mobends", "text": "public Quaternion() { this(0, 0, 0, 1); }", "tokens": 19} {"id": 416177, "source": "method", "repo": "mobends/mobends", "text": "public SmoothOrientation rotateInstant(float angle, float x, float y, float z) { Quaternion rotation = new Quaternion(); rotation.setFromAxisAngle(x, y, z, angle / 180.0F * PI); Quaternion.mul(rotation, this.end, this.end); this.start.set(this.end); this.smooth.set(this.end); return this; }", "tokens": 91} {"id": 416284, "source": "method", "repo": "mobends/mobends", "text": "/** Necessary empty constructor, because of dynamic instancing. */ public MessageConfigRequest() {}", "tokens": 20} {"id": 416451, "source": "method", "repo": "mobends/mobends", "text": "public String[] getActions(ZombieDataBase data) { return new String[] { \"stumbling\" }; }", "tokens": 28} {"id": 416456, "source": "method", "repo": "mobends/mobends", "text": "public Collection perform(SkeletonData skeletonData) { EntitySkeleton skeleton = skeletonData.getEntity(); if (!skeletonData.isOnGround() || skeletonData.getTicksAfterTouchdown() < 1) { this.layerBase.playOrContinueBit(bitJump, skeletonData); } else { if (skeletonData.isStillHorizontally()) { this.layerBase.playOrContinueBit(bitStand, skeletonData); } else { this.layerBase.playOrContinueBit(bitWalk, skeletonData); } } List actions = new ArrayList<>(); this.layerBase.perform(skeletonData, actions); this.performActionAnimations(skeletonData, skeleton); return actions; }", "tokens": 149} {"id": 416617, "source": "method", "repo": "mobends/mobends", "text": "public static void deletePreviewData() { PREVIEW_DATA = null; }", "tokens": 17} {"id": 416855, "source": "method", "repo": "mockbukkit/mockbukkit", "text": "public EntityType getType() { return EntityType.ENDER_DRAGON; }", "tokens": 14} {"id": 416886, "source": "method", "repo": "mockbukkit/mockbukkit", "text": "public boolean hasCooldown(@NotNull Material material) { Preconditions.checkArgument(material != null, \"Material cannot be null\"); Preconditions.checkArgument(material.isItem(), \"Material %s is not an item\", material); return this.hasCooldown(ItemStack.of(material)); }", "tokens": 58} {"id": 416918, "source": "method", "repo": "mockbukkit/mockbukkit", "text": "public boolean isScared() { return this.mainGene == Gene.WORRIED; }", "tokens": 24} {"id": 417101, "source": "method", "repo": "mockbukkit/mockbukkit", "text": "public Thread getThread() { return thread; }", "tokens": 11} {"id": 417115, "source": "method", "repo": "mockbukkit/mockbukkit", "text": "/** Helper function to create a palette based on the materials. @param materials The materials. @return The palette. */ public static PaletteMock of(@NotNull Material... materials) { Preconditions.checkNotNull(materials, \"materials must not be null\"); List blockStates = new ArrayList<>(materials.length); for (Material material : materials) { BlockState blockState = BlockStateMockFactory.mock(material); blockStates.add(blockState); } return new PaletteMock(blockStates); }", "tokens": 106} {"id": 417173, "source": "method", "repo": "mockbukkit/mockbukkit", "text": "void isSomeoneOnline_NoOneOnline_False() { assertFalse(playerList.isSomeoneOnline()); }", "tokens": 25} {"id": 417220, "source": "method", "repo": "mockbukkit/mockbukkit", "text": "void givenDefaultMaximumValue() { assertEquals(5, beehive.getMaximumHoneyLevel()); }", "tokens": 22} {"id": 417423, "source": "method", "repo": "mockbukkit/mockbukkit", "text": "void getAmbientSound() { assertEquals(Sound.ENTITY_SHULKER_AMBIENT, shulker.getAmbientSound()); }", "tokens": 27} {"id": 417772, "source": "method", "repo": "mockito/mockito", "text": "public boolean isInvokable() { return false; }", "tokens": 13} {"id": 417813, "source": "method", "repo": "mockito/mockito", "text": "public String toString() { return \"matches(\\\"\" + pattern.pattern().replace(\"\\\\\", \"\\\\\\\\\") + \"\\\")\"; }", "tokens": 25} {"id": 418221, "source": "method", "repo": "mockito/mockito", "text": "public void should_be_able_to_mock_interface_method_package_private_param() throws Exception { PublicInterfaceWithPackagePrivateMethodParam publicClass = mock(PublicInterfaceWithPackagePrivateMethodParam.class); publicClass.doSomething(null); }", "tokens": 57} {"id": 418291, "source": "method", "repo": "mockito/mockito", "text": "public void nullable_matcher() throws Exception { // imagine a Stream.of(...).map(c -> mock.oneArg(c))... mock.oneArg((Character) null); mock.oneArg(Character.valueOf('\\u20AC')); verify(mock, times(2)).oneArg(nullable(Character.class)); }", "tokens": 74} {"id": 418292, "source": "method", "repo": "mockito/mockito", "text": "public void shouldAllowAnyIterable() { when(mock.forIterable(anyIterable())).thenReturn(\"matched\"); assertEquals(\"matched\", mock.forIterable(new HashSet())); assertEquals(null, mock.forIterable(null)); verify(mock, times(1)).forIterable(anyIterable()); }", "tokens": 64} {"id": 418305, "source": "method", "repo": "mockito/mockito", "text": "public boolean equals(final Object obj) { return obj != null && obj.getClass().equals(getClass()); }", "tokens": 24} {"id": 418316, "source": "method", "repo": "mockito/mockito", "text": "public void should_serialize_and_deserialize_mock_created_with_serializable_and_strict_stubs() throws Exception { // given when(sampleClass.isFalse()).thenReturn(true); // when SampleClass deserializedSample = serializeAndBack(sampleClass); // to satisfy strict stubbing deserializedSample.isFalse(); verify(deserializedSample).isFalse(); verify(sampleClass, never()).isFalse(); // then assertThat(deserializedSample.isFalse()).isEqualTo(true); assertThat(sampleClass.isFalse()).isEqualTo(true); }", "tokens": 110} {"id": 418397, "source": "method", "repo": "mockito/mockito", "text": "public void shouldVerifyInOrderOnlyMockTwo() { inOrder.verify(mockTwo, times(2)).simpleMethod(2); inOrder.verify(mockTwo).simpleMethod(2); verifyNoMoreInteractions(mockTwo); }", "tokens": 45} {"id": 418427, "source": "method", "repo": "mockito/mockito", "text": "public Character charObjectReturningMethod() { return null; }", "tokens": 13} {"id": 418479, "source": "method", "repo": "mockito/mockito", "text": "public void sanity_test() { // given watch.start(); final AtomicInteger value = new AtomicInteger(0); // when async.runAfter( 200, new Runnable() { public void run() { value.incrementAndGet(); } }); // then the runnable is truly async and has not ran yet: assertEquals(0, value.get()); // after some wait... watch.waitFor(300); // we actually waited for some time watch.assertElapsedTimeIsMoreThan(200, MILLISECONDS); // and the async has actually ran: assertEquals(1, value.get()); }", "tokens": 127} {"id": 418548, "source": "method", "repo": "mockito/mockito", "text": "public void can_define_class_in_closed_module() throws Exception { assumeThat(Plugins.getMockMaker() instanceof InlineByteBuddyMockMaker, is(false)); Path jar = modularJar(true, true, false); ModuleLayer layer = layer(jar, false, namedModules); ClassLoader loader = layer.findLoader(\"mockito.test\"); Class type = loader.loadClass(\"sample.MyCallable\"); ClassLoader contextLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(loader); try { Class mockito = loader.loadClass(Mockito.class.getName()); @SuppressWarnings(\"unchecked\") Callable mock = (Callable) mockito.getMethod(\"mock\", Class.class).invoke(null, type); Object stubbing = mockito.getMethod(\"when\", Object.class).invoke(null, mock.call()); loader.loadClass(OngoingStubbing.class.getName()) .getMethod(\"thenCallRealMethod\") .invoke(stubbing); boolean relocated = !Boolean.getBoolean(\"org.mockito.internal.noUnsafeInjection\") && ClassInjector.UsingReflection.isAvailable(); String prefix = relocated ? \"sample.MyCallable$MockitoMock$\" : \"org.mockito.codegen.MyCallable$MockitoMock$\"; assertThat(mock.getClass().getName()).startsWith(prefix); assertThat(mock.call()).isEqualTo(\"foo\"); } finally { Thread.currentThread().setContextClassLoader(contextLoader); } }", "tokens": 307} {"id": 418655, "source": "method", "repo": "modelcontextprotocol/java-sdk", "text": "public void customize(HttpRequest.Builder builder, String method, URI endpoint, String body, McpTransportContext context) { this.delegates.forEach(delegate -> delegate.customize(builder, method, endpoint, body, context)); }", "tokens": 49} {"id": 418985, "source": "method", "repo": "modelcontextprotocol/java-sdk", "text": "void shouldInvokePostInitializationHookAgainAfterReinitialization() { AtomicInteger hookInvocationCount = new AtomicInteger(0); when(mockPostInitializationHook.apply(any(Initialization.class))).thenAnswer(invocation -> { hookInvocationCount.incrementAndGet(); return Mono.empty(); }); // First initialization StepVerifier.create(initializer.withInitialization(\"test1\", init -> Mono.just(\"result1\"))) .expectNext(\"result1\") .verifyComplete(); assertThat(hookInvocationCount.get()).isEqualTo(1); // Simulate transport session exception to trigger re-initialization initializer.handleException(new McpTransportSessionNotFoundException(\"Session lost\")); // Hook should be called twice (once for each initialization) assertThat(hookInvocationCount.get()).isEqualTo(2); }", "tokens": 155} {"id": 419059, "source": "method", "repo": "modelcontextprotocol/java-sdk", "text": "void testPingWithMcpError() { // Given - Mock an MCP-specific error during ping McpError mcpError = McpError.builder(McpSchema.ErrorCodes.INTERNAL_ERROR).message(\"Server unavailable\").build(); when(mockSession.sendRequest(eq(McpSchema.METHOD_PING), eq(null), any(TypeRef.class))) .thenReturn(Mono.error(mcpError)); // When & Then assertThatThrownBy(() -> exchange.ping()).isInstanceOf(McpError.class).hasMessage(\"Server unavailable\"); verify(mockSession, times(1)).sendRequest(eq(McpSchema.METHOD_PING), eq(null), any(TypeRef.class)); }", "tokens": 143} {"id": 419072, "source": "method", "repo": "modelcontextprotocol/java-sdk", "text": "void noopAcceptsAll() { assertThatCode(() -> ServerHttpHeaderValidator.NOOP.validate(emptyAccessor())).doesNotThrowAnyException(); assertThatCode(() -> ServerTransportSecurityValidator.NOOP.validateHeaders(new HashMap<>())) .doesNotThrowAnyException(); }", "tokens": 55} {"id": 419134, "source": "method", "repo": "modelcontextprotocol/java-sdk", "text": "public T readValue(byte[] content, TypeRef type) throws IOException { JavaType javaType = jsonMapper.getTypeFactory().constructType(type.getType()); try { return jsonMapper.readValue(content, javaType); } catch (JacksonException ex) { throw new IOException(\"Failed to read value\", ex); } }", "tokens": 73} {"id": 419195, "source": "method", "repo": "modelcontextprotocol/java-sdk", "text": " void verifyCallSucceedsWithImplicitInitialization(Function blockingOperation, String action) { withClient(createMcpTransport(), mcpSyncClient -> { StepVerifier.create(Mono.fromSupplier(() -> blockingOperation.apply(mcpSyncClient)) // Offload the blocking call to the real scheduler .subscribeOn(Schedulers.boundedElastic())).expectNextCount(1).verifyComplete(); }); }", "tokens": 89} {"id": 419204, "source": "method", "repo": "modelcontextprotocol/java-sdk", "text": "void testRemoveRoot() { withClient(createMcpTransport(), mcpSyncClient -> { Root root = Root.builder(\"file:///test/path/to/remove\").name(\"root-to-remove\").build(); assertThatCode(() -> { mcpSyncClient.addRoot(root); mcpSyncClient.removeRoot(root.uri()); }).doesNotThrowAnyException(); }); }", "tokens": 82} {"id": 419322, "source": "method", "repo": "modelcontextprotocol/java-sdk", "text": "public void before() { // Create and configure the transport provider mcpServerTransportProvider = HttpServletSseServerTransportProvider.builder() .contextExtractor(TEST_CONTEXT_EXTRACTOR) .messageEndpoint(CUSTOM_MESSAGE_ENDPOINT) .sseEndpoint(CUSTOM_SSE_ENDPOINT) .maxRequestSize(MAX_REQUEST_SIZE) .build(); MCP_SERVLET.setDelegate(mcpServerTransportProvider); clientBuilders .put(\"httpclient\", McpClient.sync(HttpClientSseClientTransport.builder(\"http://localhost:\" + PORT) .sseEndpoint(CUSTOM_SSE_ENDPOINT) .build()).requestTimeout(Duration.ofHours(10))); }", "tokens": 142} {"id": 419511, "source": "method", "repo": "ModelEngine-Group/app-platform", "text": "public FlowDefinitionResult getSameFlowDefinition(AippDto aippDto) { String metaId = aippDto.getMetaId(); String version = aippDto.getVersion(); List flowDefinitions = this.flowDefinitionService.getFlowDefinitionByMetaIdAndPartVersion( metaId, version + \"-\", null); String parsedGraphData = this.flowDefinitionService.getParsedGraphData( JsonUtils.toJsonString(aippDto.getFlowViewData()), version); Map aippFlowDefinitionMapping = this.buildFlowDefinition(parsedGraphData); return flowDefinitions.stream().limit(1).filter(definition -> { Map map = this.buildFlowDefinition(definition.getGraph()); return this.compareMaps(map, aippFlowDefinitionMapping); }).findAny().orElse(null); }", "tokens": 183} {"id": 419607, "source": "method", "repo": "ModelEngine-Group/app-platform", "text": "private void validateFileType(File[] files) { Arrays.stream(files).forEach(file -> { if (file.isDirectory()) { this.validateFileType(file.listFiles()); return; } String fileName = file.getName(); String extension = fileName.substring(fileName.lastIndexOf(\".\")); if (DISALLOWED_FILE_TYPE.contains(extension)) { throw new AippException(AippErrCode.CONTAIN_DISALLOWED_FILE, fileName); } }); }", "tokens": 100} {"id": 419674, "source": "method", "repo": "ModelEngine-Group/app-platform", "text": "void cleanAippInstanceNormalLogShouldNotDeleteWhenBackupFailed() throws Exception { List mockLogIds = List.of(1L, 2L); when(this.instanceLogRepo.getExpireInstanceLogIds(AippTypeEnum.NORMAL.type(), 30, 100)).thenReturn(mockLogIds) .thenReturn(Collections.emptyList()); when(this.instanceLogRepo.selectByLogIds(anyList())).thenReturn(Collections.singletonList(new AippInstLog())); CSVWriter csvWriter = mock(CSVWriter.class); when(this.csvWriterHelper.createCsvWriter(any(), anyBoolean())).thenThrow(new IOException(\"error\")); this.logCleaner.cleanAippInstanceNormalLog(30, 100); verify(this.instanceLogRepo, times(1)).getExpireInstanceLogIds(anyString(), anyInt(), anyInt()); verify(this.instanceLogRepo, times(0)).forceDeleteInstanceLogs(anyList()); verify(csvWriter, times(0)).writeAll(anyList()); }", "tokens": 221} {"id": 419803, "source": "method", "repo": "ModelEngine-Group/app-platform", "text": "public GetPageResponse findFlowDefinitionsPage(String data, String tenantId) { throw new JobberException(NOT_SUPPORT, \"findFlowDefinitionsPage\"); }", "tokens": 34} {"id": 419954, "source": "method", "repo": "ModelEngine-Group/app-platform", "text": "public int findEndContextsPageNumByTraceId(String traceId, String endNode) { return contextMapper.findEndContextsNumByTraceId(traceId, endNode); }", "tokens": 42} {"id": 420128, "source": "method", "repo": "ModelEngine-Group/app-platform", "text": "void shouldOkWhenJava() { assertDoesNotThrow(() -> { this.processor.validate(this.javaPlugin, null); }); }", "tokens": 30} {"id": 420152, "source": "method", "repo": "ModelEngine-Group/fit-framework", "text": "private O parse0(String input) { StringBuilder dst = new StringBuilder(); StringBuilder stack = new StringBuilder(); boolean isInsideString = false; boolean isEscaped = false; for (char c : input.toCharArray()) { if (isInsideString) { if (c == '\"' && !isEscaped) { isInsideString = false; } else if (c == '\\n' && !isEscaped) { dst.append(\"\\\\n\"); continue; } else if (c == '\\\\') { isEscaped = !isEscaped; } else { isEscaped = false; } } else { if (c == '\"') { isInsideString = true; } else { dealParenthesis(stack, c); } } dst.append(c); } if (isInsideString) { dst.append('\"'); } return this.parseCompleteJson(dst, stack.reverse().toString()); }", "tokens": 180} {"id": 420534, "source": "method", "repo": "ModelEngine-Group/fit-framework", "text": "private static boolean isNotPublicStaticFinal(int modifiers) { return !Modifier.isPublic(modifiers) || !Modifier.isStatic(modifiers) || !Modifier.isFinal(modifiers); }", "tokens": 39} {"id": 420550, "source": "method", "repo": "ModelEngine-Group/fit-framework", "text": "public void removeAll(Collection> consumers) { LockUtils.synchronize(this.lock.writeLock(), () -> this.decorated.removeAll(consumers)); }", "tokens": 40} {"id": 420602, "source": "method", "repo": "ModelEngine-Group/fit-framework", "text": "void givenClassFileThenReturnDescriptionReferenceTypeIncompleteException() { assertThatThrownBy(() -> MethodDescriptor.parse(\"(ID)Lmodelengine/fitframework/jvm/test/AttributeTarget\")) .isInstanceOf(IllegalStateException.class); }", "tokens": 50} {"id": 420727, "source": "method", "repo": "ModelEngine-Group/fit-framework", "text": "public TypeExpr typeInfer(SyntaxNode node) { ImportNode importNode = ObjectUtils.cast(node); Optional ast = node.ast().asf().ast(importNode.source().lexeme()); if (ast.isPresent()) { Map exports = new HashMap<>(); ast.get().exports().forEach(e -> exports.put(e.lexeme(), e.typeExpr())); for (Pair symbol : importNode.symbols()) { String key = symbol.first().lexeme(); if (Objects.equals(key, Constants.STAR)) { continue; } if (exports.containsKey(key)) { (ObjectUtils.cast(node.ast() .symbolTable() .getSymbol(symbol.second().lexeme(), node.scope()))).setTypeExpr(exports.get(key)); } else { symbol.second().panic(SyntaxError.IMPORT_ERROR_ID); } } } else { node.panic(SyntaxError.IMPORT_ERROR_SOURCE); } return super.typeInfer(node); }", "tokens": 242} {"id": 420748, "source": "method", "repo": "ModelEngine-Group/fit-framework", "text": "public List> handleTask(List> param) { param.get(0).put(\"k2\", \"v2\"); return param; }", "tokens": 47} {"id": 420777, "source": "method", "repo": "modificationstation/stationapi", "text": "public int getTextureId(BlockView view, int x, int y, int z, int side) { return (side & 1) == 0 ? OBSIDIAN.textureId : LAVA.textureId; }", "tokens": 47} {"id": 420782, "source": "method", "repo": "modificationstation/stationapi", "text": "public void onAdded(boolean appliedNow) { PlayerEntity player = (PlayerEntity) entity; originalHealth = player.health; player.health = 5; }", "tokens": 35} {"id": 420832, "source": "method", "repo": "modificationstation/stationapi", "text": "public static TriState fromBool(boolean b) { return b ? TRUE : FALSE; }", "tokens": 23} {"id": 420916, "source": "method", "repo": "modificationstation/stationapi", "text": "public PacketType getType() { return TYPE; }", "tokens": 22} {"id": 421110, "source": "method", "repo": "modificationstation/stationapi", "text": "private void stationapi_endTick(CallbackInfo ci) { StationAPI.EVENT_BUS.post(GameTickEvent.End.builder().build()); }", "tokens": 32} {"id": 421151, "source": "method", "repo": "modificationstation/stationapi", "text": "public void transpose() { float f = this.a01; this.a01 = this.a10; this.a10 = f; f = this.a02; this.a02 = this.a20; this.a20 = f; f = this.a12; this.a12 = this.a21; this.a21 = f; }", "tokens": 93} {"id": 421295, "source": "method", "repo": "modificationstation/stationapi", "text": "public Named getOrCreateEntryList(TagKey tag) { Named named = this.tagToEntryList.get(tag); if (named == null) { named = this.createNamedEntryList(tag); Reference2ReferenceMap, Named> map = new Reference2ReferenceOpenHashMap<>(this.tagToEntryList); map.put(tag, named); this.tagToEntryList = map; } return named; }", "tokens": 103} {"id": 421454, "source": "method", "repo": "modificationstation/stationapi", "text": "public Sprite(Identifier id, Resource resource, int regionCount) { this.id = id; this.resource = resource; this.regionCount = new AtomicInteger(regionCount); }", "tokens": 40} {"id": 421495, "source": "method", "repo": "modificationstation/stationapi", "text": "private int stationapi_bed_modTexture1Width( int constant, @Share(\"texture\") LocalRef texture ) { return texture.get().getContents().getWidth(); }", "tokens": 39} {"id": 421613, "source": "method", "repo": "modificationstation/stationapi", "text": "public TemplateBlockWithEntity(int id, Material material) { super(id, material); }", "tokens": 21} {"id": 421725, "source": "method", "repo": "mohamed-taman/springy-store-microservices", "text": "public Map getKey() { RSAPublicKey publicKey = (RSAPublicKey) this.keyPair.getPublic(); RSAKey key = new RSAKey.Builder(publicKey).build(); return new JWKSet(key).toJSONObject(); }", "tokens": 54} {"id": 421801, "source": "method", "repo": "mohamed-taman/springy-store-microservices", "text": "private boolean areProductEqual(ProductEntity expectedEntity, ProductEntity actualEntity) { return (expectedEntity.getId().equals(actualEntity.getId())) && (expectedEntity.getVersion().equals(actualEntity.getVersion())) && (expectedEntity.getProductId() == actualEntity.getProductId()) && (expectedEntity.getName().equals(actualEntity.getName())) && (expectedEntity.getWeight() == actualEntity.getWeight()); }", "tokens": 87} {"id": 421850, "source": "method", "repo": "mohamed-taman/springy-store-microservices", "text": "public ReviewServiceImpl( Scheduler scheduler, ReviewRepository repository, ReviewMapper mapper, ServiceUtil serviceUtil) { this.repository = repository; this.mapper = mapper; this.serviceUtil = serviceUtil; this.scheduler = scheduler; }", "tokens": 51} {"id": 421952, "source": "method", "repo": "mojang/brigadier", "text": "public ParseResults(final CommandContextBuilder context, final ImmutableStringReader reader, final Map, CommandSyntaxException> exceptions) { this.context = context; this.reader = reader; this.exceptions = exceptions; }", "tokens": 54} {"id": 422033, "source": "method", "repo": "mojang/brigadier", "text": "public String toString() { if (minimum == Long.MIN_VALUE && maximum == Long.MAX_VALUE) { return \"longArg()\"; } else if (maximum == Long.MAX_VALUE) { return \"longArg(\" + minimum + \")\"; } else { return \"longArg(\" + minimum + \", \" + maximum + \")\"; } }", "tokens": 73} {"id": 422049, "source": "method", "repo": "mojang/brigadier", "text": "public T executes(final Command command) { this.command = command; return getThis(); }", "tokens": 24} {"id": 422110, "source": "method", "repo": "mojang/brigadier", "text": "public String toString() { return node + \"@\" + range; }", "tokens": 14} {"id": 422184, "source": "method", "repo": "mojang/brigadier", "text": "public String apply(final String input) { if (range.getStart() == 0 && range.getEnd() == input.length()) { return text; } final StringBuilder result = new StringBuilder(); if (range.getStart() > 0) { result.append(input.substring(0, range.getStart())); } result.append(text); if (range.getEnd() < input.length()) { result.append(input.substring(range.getEnd())); } return result.toString(); }", "tokens": 104} {"id": 422197, "source": "method", "repo": "mojang/brigadier", "text": "public static CompletableFuture empty() { return CompletableFuture.completedFuture(EMPTY); }", "tokens": 20} {"id": 422237, "source": "method", "repo": "mojang/brigadier", "text": "private int parse(final StringReader reader) { final int start = reader.getCursor(); if (reader.canRead(literal.length())) { final int end = start + literal.length(); if (reader.getString().substring(start, end).equals(literal)) { reader.setCursor(end); if (!reader.canRead() || reader.peek() == ' ') { return end; } else { reader.setCursor(start); } } } return -1; }", "tokens": 99} {"id": 422281, "source": "method", "repo": "mojang/brigadier", "text": "public void testGetPath() { final LiteralCommandNode bar = literal(\"bar\").build(); subject.register(literal(\"foo\").then(bar)); assertThat(subject.getPath(bar), equalTo(Lists.newArrayList(\"foo\", \"bar\"))); }", "tokens": 53} {"id": 422305, "source": "method", "repo": "mojang/brigadier", "text": "public void getCompletionSuggestions_rootCommands_partial_withInputOffset() throws Exception { subject.register(literal(\"foo\")); subject.register(literal(\"bar\")); subject.register(literal(\"baz\")); final Suggestions result = subject.getCompletionSuggestions(subject.parse(inputWithOffset(\"Zb\", 1), source)).join(); assertThat(result.getRange(), equalTo(StringRange.between(1, 2))); assertThat(result.getList(), equalTo(Lists.newArrayList(new Suggestion(StringRange.between(1, 2), \"bar\"), new Suggestion(StringRange.between(1, 2), \"baz\")))); }", "tokens": 135} {"id": 422383, "source": "method", "repo": "mojang/brigadier", "text": "public void parse_tooBig() throws Exception { final StringReader reader = new StringReader(\"5\"); try { doubleArg(-100, 0).parse(reader); fail(); } catch (final CommandSyntaxException ex) { assertThat(ex.getType(), is(CommandSyntaxException.BUILT_IN_EXCEPTIONS.doubleTooHigh())); assertThat(ex.getCursor(), is(0)); } }", "tokens": 83} {"id": 422386, "source": "method", "repo": "mojang/brigadier", "text": "public void setUp() throws Exception { type = floatArg(-100, 100); }", "tokens": 24} {"id": 422466, "source": "method", "repo": "mojang/brigadier", "text": "public void suggest_replaces() { final Suggestions result = builder.suggest(\"everybody\").build(); assertThat(result.getList(), equalTo(Lists.newArrayList(new Suggestion(StringRange.between(6, 7), \"everybody\")))); assertThat(result.getRange(), equalTo(StringRange.between(6, 7))); assertThat(result.isEmpty(), is(false)); }", "tokens": 81} {"id": 422593, "source": "method", "repo": "mojang/datafixerupper", "text": "public P14 and(final P12 p) { return new P14<>(t1, t2, p.t1, p.t2, p.t3, p.t4, p.t5, p.t6, p.t7, p.t8, p.t9, p.t10, p.t11, p.t12); }", "tokens": 226} {"id": 422602, "source": "method", "repo": "mojang/datafixerupper", "text": "public P5 and(final App t5) { return new P5<>(t1, t2, t3, t4, t5); }", "tokens": 61} {"id": 422608, "source": "method", "repo": "mojang/datafixerupper", "text": "public P11 and(final P6 p) { return new P11<>(t1, t2, t3, t4, t5, p.t1, p.t2, p.t3, p.t4, p.t5, p.t6); }", "tokens": 147} {"id": 422803, "source": "method", "repo": "mojang/datafixerupper", "text": "public App2, Either, Either> right(final App2, A, B> input) { final Affine affine = Affine.unbox(input); return Optics.affine( either -> either.map( c -> Either.left(Either.left(c)), a -> affine.preview(a).mapLeft(Either::right) ), (b, either) -> either.map(Either::left, r -> Either.right(affine.set(b, r))) ); }", "tokens": 159} {"id": 422877, "source": "method", "repo": "mojang/datafixerupper", "text": "default App2 cimap(final Supplier> arg, final Function g, final Function h) { return cimap(g, h).apply(arg); }", "tokens": 70} {"id": 423036, "source": "method", "repo": "mojang/datafixerupper", "text": "private RewriteResult wrap(final RewriteResult instance) { if (instance.view().isNop()) { return instance; } final Type output = DSL.field(name, instance.view().newType()); return opticView(this, instance, new TypedOptic<>( Profunctor.Mu.TYPE_TOKEN, this, output, instance.view().type(), instance.view().newType(), Optics.id() )); }", "tokens": 108} {"id": 423253, "source": "method", "repo": "mojang/datafixerupper", "text": "public float asFloat(final float defaultValue) { return asNumber(defaultValue).floatValue(); }", "tokens": 21} {"id": 423263, "source": "method", "repo": "mojang/datafixerupper", "text": "public Dynamic createBoolean(final boolean value) { return new Dynamic<>(ops, ops.createBoolean(value)); }", "tokens": 28} {"id": 423274, "source": "method", "repo": "mojang/datafixerupper", "text": "default DataResult>> getMapEntries(final T input) { return getMapValues(input).map(s -> c -> s.forEach(p -> c.accept(p.getFirst(), p.getSecond()))); }", "tokens": 55} {"id": 423383, "source": "method", "repo": "mojang/datafixerupper", "text": "public DataResult, T>> decode(final DynamicOps ops, final T input) { final DataResult, T>> firstRead = first.decode(ops, input).map(vo -> vo.mapFirst(Either::left)); if (firstRead.isSuccess()) { return firstRead; } final DataResult, T>> secondRead = second.decode(ops, input).map(vo -> vo.mapFirst(Either::right)); if (secondRead.isSuccess()) { return secondRead; } if (firstRead.hasResultOrPartial()) { return firstRead; } if (secondRead.hasResultOrPartial()) { return secondRead; } return DataResult.error(() -> \"Failed to parse either. First: \" + firstRead.error().orElseThrow().message() + \"; Second: \" + secondRead.error().orElseThrow().message()); }", "tokens": 211} {"id": 423392, "source": "method", "repo": "mojang/datafixerupper", "text": "public void accept(final T value) { totalCount++; if (elements.size() >= maxSize) { failed.add(value); return; } final DataResult> elementResult = elementCodec.decode(ops, value); elementResult.error().ifPresent(error -> failed.add(value)); elementResult.resultOrPartial().ifPresent(pair -> elements.add(pair.getFirst())); result = result.apply2stable((result, element) -> result, elementResult); }", "tokens": 108} {"id": 423455, "source": "method", "repo": "mojang/datafixerupper", "text": "public void unitMapCodecEncoding() { final Object marker = new Object(); assertRoundTrip( MapCodec.unit(marker).codec(), marker, Map.of() ); }", "tokens": 37} {"id": 423599, "source": "method", "repo": "mojohaus/aspectj-maven-plugin", "text": "public void setVersion(String arg0) { throw new RuntimeException(\"Not implemented\"); }", "tokens": 20} {"id": 423756, "source": "method", "repo": "mojohaus/build-helper-maven-plugin", "text": "protected void defineProperty(String name, String value) { properties.put(name, value); }", "tokens": 22} {"id": 423811, "source": "method", "repo": "monkeywie/proxyee", "text": "protected RequestProto getRequestProto() { return requestProto; }", "tokens": 13} {"id": 423868, "source": "method", "repo": "monkeywie/proxyee", "text": "public int hashCode() { int result = proxyType != null ? proxyType.hashCode() : 0; result = 31 * result + (host != null ? host.hashCode() : 0); result = 31 * result + port; result = 31 * result + (user != null ? user.hashCode() : 0); result = 31 * result + (pwd != null ? pwd.hashCode() : 0); return result; }", "tokens": 101} {"id": 423919, "source": "method", "repo": "monkeywie/proxyee", "text": "public void setMaxInitialLineLength(int maxInitialLineLength) { this.maxInitialLineLength = maxInitialLineLength; }", "tokens": 28} {"id": 424049, "source": "method", "repo": "morenoh149/react-native-contacts", "text": "/** Introduced for iOS compatibility. Same as getAll @param promise promise */ public void getAllWithoutPhotos(Promise promise) { contactsManagerImpl.getAllWithoutPhotos(promise); }", "tokens": 35} {"id": 424289, "source": "method", "repo": "mortuusars/Exposure", "text": "public ShutterSpeedButton(int x, int y, int width, int height, List values, @NotNull ShutterSpeed startingValue, Function spritesFunc, OnCycle onCycle) { super(x, y, width, height, values, startingValue, spritesFunc, onCycle); mainFontColor = Config.getColor(Config.Client.VIEWFINDER_FONT_MAIN_COLOR); secondaryFontColor = Config.getColor(Config.Client.VIEWFINDER_FONT_SECONDARY_COLOR); }", "tokens": 129} {"id": 424334, "source": "method", "repo": "mortuusars/Exposure", "text": "public void onRelease(double mouseX, double mouseY) { super.playDownSound(Minecraft.getInstance().getSoundManager()); }", "tokens": 27} {"id": 424403, "source": "method", "repo": "mortuusars/Exposure", "text": "private void renderCamera(T entity, float entityYaw, float entityPitch, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight) { poseStack.pushPose(); poseStack.translate(0, 1.125, 0); poseStack.mulPose(Axis.YP.rotationDegrees(-entityYaw + 180)); poseStack.mulPose(Axis.XP.rotationDegrees(-entityPitch)); poseStack.translate(0, 0.125 * MOUNT_SCALE, 0); if (entity.isMalfunctioned()) { poseStack.mulPose(Axis.ZP.rotationDegrees(-50)); poseStack.mulPose(Axis.XP.rotationDegrees(-15)); } ItemStack camera = entity.getCamera(); float scale = camera.getItem() instanceof CameraItem cameraItem ? cameraItem.getScaleOnStand() : MOUNT_SCALE; poseStack.scale(scale, scale, scale); poseStack.translate(0, 0.5, 0); Minecrft.get().getItemRenderer().renderStatic(camera, ItemDisplayContext.NONE, packedLight, OverlayTexture.NO_OVERLAY, poseStack, bufferSource, entity.level(), 0); poseStack.popPose(); }", "tokens": 253} {"id": 424447, "source": "method", "repo": "mortuusars/Exposure", "text": "private static void test() { Minecrft.get().setScreen(new TestImageScreen()); }", "tokens": 21} {"id": 424482, "source": "method", "repo": "mortuusars/Exposure", "text": "public void setRecipe(@NotNull IRecipeLayoutBuilder builder, @NotNull PhotographStackingJeiRecipe recipe, @NotNull IFocusGroup focuses) { if (recipe.getType() == PhotographStackingJeiRecipe.STACKING) { builder.addSlot(RecipeIngredientRole.INPUT, 11, 11) .addItemStacks(List.of(new ItemStack(Exposure.Items.PHOTOGRAPH.get()), new ItemStack(Exposure.Items.STACKED_PHOTOGRAPHS.get()))) .setOverlay(stackCursor, 7, -6) .setSlotName(\"Input\"); builder.addSlot(RecipeIngredientRole.OUTPUT, 82, 11) .addItemStack(new ItemStack(Exposure.Items.STACKED_PHOTOGRAPHS.get())) .setSlotName(\"Result\"); } if (recipe.getType() == PhotographStackingJeiRecipe.REMOVING) { builder.addSlot(RecipeIngredientRole.INPUT, 11, 11) .addItemStack(new ItemStack(Exposure.Items.STACKED_PHOTOGRAPHS.get())) .setOverlay(removeCursor, 11, 4) .setSlotName(\"Input\"); builder.addSlot(RecipeIngredientRole.OUTPUT, 82, 11) .addItemStack(new ItemStack(Exposure.Items.PHOTOGRAPH.get())) .setSlotName(\"Result\"); } }", "tokens": 296} {"id": 424495, "source": "method", "repo": "mortuusars/Exposure", "text": "private int onGetColor(int original) { if (!Config.Common.DIFFERENT_DEVELOPING_POTION_COLORS.get() || original != 0xFF385DC6) { // Default color return original; } if (potion().isPresent()) { if (potion().get().value().equals(Potions.MUNDANE.value())) { return 0xFF424D8F; } if (potion().get().value().equals(Potions.AWKWARD.value())) { return 0xFF653594; } if (potion().get().value().equals(Potions.THICK.value())) { return 0xFF3E7782; } } return original; }", "tokens": 162} {"id": 424614, "source": "method", "repo": "mortuusars/Exposure", "text": "public VoxelShape getShape(@NotNull BlockState pState, @NotNull BlockGetter pLevel, @NotNull BlockPos pPos, CollisionContext pContext) { return pContext.isHoldingItem(Items.LIGHT) ? Shapes.block() : Shapes.empty(); }", "tokens": 54} {"id": 424653, "source": "method", "repo": "mortuusars/Exposure", "text": "public Camera ifPresent(BiConsumer ifPresent, Runnable orElse) { ItemStack stack = getItemStack(); if (stack.getItem() instanceof CameraItem item) { ifPresent.accept(item, stack); } else { orElse.run(); } return this; }", "tokens": 61} {"id": 424682, "source": "method", "repo": "mortuusars/Exposure", "text": "public boolean equals(Object obj) { if (obj == this) return true; if (obj == null || obj.getClass() != this.getClass()) return false; var that = (FocalRange) obj; return this.min == that.min && this.max == that.max; }", "tokens": 65} {"id": 424730, "source": "method", "repo": "mortuusars/Exposure", "text": "protected double getDefaultGravity() { return 0.08; }", "tokens": 15} {"id": 424763, "source": "method", "repo": "mortuusars/Exposure", "text": "public boolean isAlbumEditable() { return true; }", "tokens": 12} {"id": 424768, "source": "method", "repo": "mortuusars/Exposure", "text": "public Optional getPhotographSlot(int index) { if (index >= 0 && index < photographSlots.size()) return Optional.ofNullable(photographSlots.get(index)); return Optional.empty(); }", "tokens": 50} {"id": 424889, "source": "method", "repo": "mortuusars/Exposure", "text": "public int getRemainingTicks(CameraHolder holder, ItemStack stack) { return (int)Math.max(-1, getEndTick(stack) - holder.asHolderEntity().level().getGameTime()); }", "tokens": 44} {"id": 424927, "source": "method", "repo": "mortuusars/Exposure", "text": "public void expect(ServerPlayer player, String id) { expect(player, id, (pl, i) -> {}); }", "tokens": 27} {"id": 425005, "source": "method", "repo": "moshowgame/springbootcodegenerator", "text": "/** Set debug flag to true. Otherwise use default settings. See the default constructor. @param debug turn debug on with a true argument */ public HTMLFilter(final boolean debug) { this(); vDebug = debug; }", "tokens": 46} {"id": 425015, "source": "method", "repo": "moshowgame/springbootcodegenerator", "text": "private static String regexReplace(final Pattern regex_pattern, final String replacement, final String s) { Matcher m = regex_pattern.matcher(s); return m.replaceAll(replacement); }", "tokens": 42} {"id": 425289, "source": "method", "repo": "moxy-community/moxy", "text": "public final Activity getActivity() { throw new RuntimeException(\"Stub!\"); }", "tokens": 15} {"id": 425313, "source": "method", "repo": "moxy-community/moxy", "text": "public static String getFullClassName(TypeMirror typeMirror) { if (!(typeMirror instanceof DeclaredType)) { return \"\"; } TypeElement typeElement = (TypeElement) ((DeclaredType) typeMirror).asElement(); return getFullClassName(typeElement); }", "tokens": 57} {"id": 425360, "source": "method", "repo": "moxy-community/moxy", "text": "public MvpPresenter providePresenter(GenericPresenterTarget delegated) { return delegated.providePresenter(); }", "tokens": 24} {"id": 425366, "source": "method", "repo": "moxy-community/moxy", "text": "public MvpPresenter providePresenter(SimpleInjectPresenterTarget delegated) { return new EmptyViewPresenter(); }", "tokens": 24} {"id": 425577, "source": "method", "repo": "moyangzhan/langchain4j-aideepin", "text": "public MessageSource messageSource() { ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); messageSource.setBasenames(\"i18n/messages\"); messageSource.setDefaultEncoding(\"UTF-8\"); messageSource.setUseCodeAsDefaultMessage(true); return messageSource; }", "tokens": 58} {"id": 425856, "source": "method", "repo": "moyangzhan/langchain4j-aideepin", "text": "public boolean softDelBy(Long userId, Long characterId) { return this.lambdaUpdate() .eq(CharacterPresetRel::getUserId, userId) .eq(CharacterPresetRel::getUserCharacterId, characterId) .set(CharacterPresetRel::getIsDeleted, true) .update(); }", "tokens": 66} {"id": 426053, "source": "method", "repo": "moyangzhan/langchain4j-aideepin", "text": "public static InputAdaptorMsg isQuestionValid(String userQuestion, int maxInputTokens, TokenCountEstimator tokenizer) { InputAdaptorMsg result = new InputAdaptorMsg(); result.setTokenTooMuch(InputAdaptorMsg.TOKEN_TOO_MUCH_NOT); int questionLength = tokenizer.estimateTokenCountInText(userQuestion); result.setUserQuestionTokenCount(questionLength); if (questionLength > maxInputTokens) { log.warn(\"User question too long, exceeded {} tokens\", maxInputTokens); result.setTokenTooMuch(InputAdaptorMsg.TOKEN_TOO_MUCH_QUESTION); } return result; }", "tokens": 135} {"id": 426120, "source": "method", "repo": "moyangzhan/langchain4j-aideepin", "text": "public boolean checkValue(NodeIOData data) { if (!(data.getContent() instanceof NodeIODataTextContent optionsData)) { return false; } String value = optionsData.getValue(); if (required && null == value) { return false; } if (null != maxLength && value.length() > maxLength) { return false; } return true; }", "tokens": 74} {"id": 426204, "source": "method", "repo": "mp911de/logstash-gelf", "text": "public void setExtractStackTrace(boolean extractStackTrace) { this.stackTraceExtraction = stackTraceExtraction.applyExtaction(\"\" + extractStackTrace); }", "tokens": 30} {"id": 426300, "source": "method", "repo": "mp911de/logstash-gelf", "text": "static void removeAllAddedSenderProviders() { synchronized (providerList) { providerList.removeAll(addedProviders); addedProviders.clear(); } }", "tokens": 31} {"id": 426312, "source": "method", "repo": "mp911de/logstash-gelf", "text": "/** Determine if {@code c} lies within the range of values defined for Surrogate Code Point. @param c the character to check. @return {@code true} if {@code c} lies within the range of values defined for Surrogate Code Point. {@code false} otherwise. */ private static boolean isSurrogate(char c) { return c >= '\\uD800' && c <= '\\uDFFF'; }", "tokens": 131} {"id": 426404, "source": "method", "repo": "mp911de/logstash-gelf", "text": "/** @param host the host, must not be {@literal null}. @param port the port. @param connectTimeoutMs connection timeout, in {@link TimeUnit#MILLISECONDS}. @param readTimeoutMs read timeout, in {@link TimeUnit#MILLISECONDS}. @param deliveryAttempts number of delivery attempts. @param keepAlive {@literal true} to enable TCP keep-alive. @param backoff Backoff strategy to activate if a socket sender buffer is full and several attempts to write to the socket are unsuccessful due to it. @param writeBackoffThreshold attempts to write to a socket before a backoff will be activated. @param errorReporter the error reporter, must not be {@literal null}. @throws IOException in case of I/O errors */ public GelfTCPSender(String host, int port, int connectTimeoutMs, int readTimeoutMs, int deliveryAttempts, boolean keepAlive, BackOff backoff, int writeBackoffThreshold, ErrorReporter errorReporter) throws IOException { super(errorReporter, host, port); this.connectTimeoutMs = connectTimeoutMs; this.readTimeoutMs = readTimeoutMs; this.keepAlive = keepAlive; this.deliveryAttempts = deliveryAttempts < 1 ? Integer.MAX_VALUE : deliveryAttempts; this.backoff = backoff; this.writeBackoffThreshold = writeBackoffThreshold; this.setChannel(createSocketChannel(readTimeoutMs, keepAlive)); }", "tokens": 275} {"id": 426409, "source": "method", "repo": "mp911de/logstash-gelf", "text": "protected boolean isConnected(SocketChannel channel) { return channel.isConnected(); }", "tokens": 16} {"id": 426596, "source": "method", "repo": "mp911de/logstash-gelf", "text": "public void setErrorReporter(ErrorReporter errorReporter) { this.errorReporter = errorReporter; }", "tokens": 21} {"id": 426812, "source": "method", "repo": "mp911de/logstash-gelf", "text": "void testWithLocation() throws Exception { Logger logger = loggerContext.getLogger(\"async.location\"); logger.info(LOG_MESSAGE); waitForGelf(); List jsonValues = server.getJsonValues(); assertThat(jsonValues).hasSize(1); Map jsonValue = (Map) jsonValues.get(0); assertThat(jsonValue.get(GelfMessage.FIELD_HOST)).isEqualTo(RuntimeContainer.FQDN_HOSTNAME); assertThat(jsonValue.get(\"_server.simple\")).isEqualTo(RuntimeContainer.HOSTNAME); assertThat(jsonValue.get(\"_server.fqdn\")).isEqualTo(RuntimeContainer.FQDN_HOSTNAME); assertThat(jsonValue.get(\"_server\")).isEqualTo(RuntimeContainer.FQDN_HOSTNAME); assertThat(jsonValue.get(\"_server.addr\")).isEqualTo(RuntimeContainer.ADDRESS); assertThat(jsonValue.get(\"_className\")).isEqualTo(getClass().getName()); assertThat(jsonValue.get(\"_simpleClassName\")).isEqualTo(getClass().getSimpleName()); assertThat(jsonValue.get(GelfMessage.FIELD_FULL_MESSAGE)).isEqualTo(EXPECTED_LOG_MESSAGE); assertThat(jsonValue.get(GelfMessage.FIELD_SHORT_MESSAGE)).isEqualTo(EXPECTED_LOG_MESSAGE); assertThat(jsonValue.get(\"_level\")).isEqualTo(\"INFO\"); assertThat(jsonValue.get(GelfMessage.FIELD_LEVEL)).isEqualTo(\"6\"); assertThat(jsonValue.get(GelfMessage.FIELD_FACILITY)).isEqualTo(\"logstash-gelf\"); assertThat(jsonValue.get(\"_fieldName1\")).isEqualTo(\"fieldValue1\"); assertThat(jsonValue.get(\"_fieldName2\")).isEqualTo(\"fieldValue2\"); }", "tokens": 349} {"id": 426964, "source": "method", "repo": "mpatric/mp3agic", "text": "public void shouldPackSynchsafeIntegersCorrectly() { assertArrayEquals(new byte[]{(byte) 0, (byte) 0, (byte) 0x09, (byte) 0x41}, BufferTools.packSynchsafeInteger(1217)); assertArrayEquals(new byte[]{(byte) 0, (byte) 0, (byte) 0x09, (byte) 0x4B}, BufferTools.packSynchsafeInteger(1227)); assertArrayEquals(new byte[]{(byte) 0, (byte) 0, (byte) 0x07, (byte) 0x6A}, BufferTools.packSynchsafeInteger(1002)); assertArrayEquals(new byte[]{(byte) 0, (byte) 0, (byte) 2, (byte) 1}, BufferTools.packSynchsafeInteger(0x0101)); assertArrayEquals(new byte[]{(byte) 8, (byte) 4, (byte) 2, (byte) 1}, BufferTools.packSynchsafeInteger(0x01010101)); }", "tokens": 255} {"id": 427005, "source": "method", "repo": "mpatric/mp3agic", "text": "public void shouldStillReturnBytesWhenUnicodeStringIsEmpty() { EncodedText encodedText = new EncodedText(EncodedText.TEXT_ENCODING_UTF_16, \"\"); assertArrayEquals(new byte[]{}, encodedText.toBytes(false, false)); assertArrayEquals(new byte[]{(byte) 0xff, (byte) 0xfe}, encodedText.toBytes(true, false)); assertArrayEquals(new byte[]{0, 0}, encodedText.toBytes(false, true)); assertArrayEquals(new byte[]{(byte) 0xff, (byte) 0xfe, 0, 0}, encodedText.toBytes(true, true)); }", "tokens": 136} {"id": 427034, "source": "method", "repo": "mpatric/mp3agic", "text": "public void setsTitleOnV1TagOnly() { ID3v1 id3v1Tag = new ID3v1TagForTesting(); ID3Wrapper wrapper = new ID3Wrapper(id3v1Tag, null); wrapper.setTitle(\"a title\"); assertEquals(\"a title\", id3v1Tag.getTitle()); }", "tokens": 68} {"id": 427535, "source": "method", "repo": "mrcrayfish/controllable", "text": "public void resetToCenter() { Minecraft mc = Minecraft.getInstance(); this.renderX = this.x = this.prevX = this.lastMoveX = mc.getWindow().getScreenWidth() / 2.0; this.renderY = this.y = this.prevY = this.lastMoveY = mc.getWindow().getScreenHeight() / 2.0; }", "tokens": 82} {"id": 427707, "source": "method", "repo": "mrcrayfish/controllable", "text": "private void updateSelected() { Controller controller = Controllable.getController(); if(controller == null) { this.setSelected(null); return; } List entries = this.children(); for(ControllerEntry entry : entries) { if(Objects.equals(entry.getJid(), controller.getJid())) { this.setSelected(entry); break; } } }", "tokens": 80} {"id": 427810, "source": "method", "repo": "mrcrayfish/controllable", "text": "public boolean keyPressed(KeyEvent event) { if(event.key() == GLFW.GLFW_KEY_ESCAPE && this.configureButton != -1) { this.configureButton = -1; return true; } return super.keyPressed(event); }", "tokens": 54} {"id": 427828, "source": "method", "repo": "mrcrayfish/controllable", "text": "private void filterItems(String s) { this.list.replaceEntries(s.isEmpty() ? this.items : this.items.stream() .filter(item -> item instanceof ISearchable searchable && searchable.getLabel() .getString() .toLowerCase(Locale.ENGLISH) .contains(s.toLowerCase(Locale.ENGLISH))) .collect(Collectors.toList())); if(!s.isEmpty()) { this.list.setScrollAmount(0); } }", "tokens": 102} {"id": 427936, "source": "method", "repo": "mrcrayfish/controllable", "text": "public void tick() { this.updateControllers(); }", "tokens": 13} {"id": 428008, "source": "method", "repo": "mrcrayfish/controllable", "text": "protected float internalGetLTriggerValue() { return Mth.clamp((this.controller.axes(GLFW.GLFW_GAMEPAD_AXIS_LEFT_TRIGGER) + 1.0F) / 2.0F, 0, 1); }", "tokens": 56} {"id": 428065, "source": "method", "repo": "mrcrayfish/controllable", "text": "public void render(GuiGraphicsExtractor graphics, int mouseX, int mouseY, DeltaTracker tracker) { List tabs = this.navigationBar.children(); ScreenRectangle firstTab = tabs.get(0).getRectangle(); ClientHelper.drawButton(graphics, firstTab.left() - 18, (firstTab.height() - 11) / 2, ButtonBindings.NEXT_RECIPE_TAB.getButton()); ScreenRectangle lastTab = tabs.get(tabs.size() - 1).getRectangle(); ClientHelper.drawButton(graphics, lastTab.right() + 5, (lastTab.height() - 11) / 2, ButtonBindings.PREVIOUS_RECIPE_TAB.getButton()); }", "tokens": 159} {"id": 428087, "source": "method", "repo": "mrcrayfish/controllable", "text": "public static boolean isSubtitleShowing() { Minecraft mc = Minecraft.getInstance(); return mc.options.showSubtitles().get() && mc.gui.screen() == null; }", "tokens": 39} {"id": 428112, "source": "method", "repo": "mrcrayfish/controllable", "text": "public void setRight(boolean right) { this.right = right; this.changed = true; }", "tokens": 23} {"id": 428275, "source": "method", "repo": "mrpkdeveloper/450-dsa-questions", "text": "Node(int x) { data = x; next = null; }", "tokens": 16} {"id": 428496, "source": "method", "repo": "mrpkdeveloper/450-dsa-questions", "text": "public boolean checkduplicatesub() { return checkduplicatesub(this.root).ans; }", "tokens": 21} {"id": 428551, "source": "method", "repo": "mrpkdeveloper/450-dsa-questions", "text": "public void path(int k) { ArrayList ans = new ArrayList<>(); path(this.root, k, ans); }", "tokens": 31} {"id": 428634, "source": "method", "repo": "mrpkdeveloper/450-dsa-questions", "text": "public static void solve(int[] arr) { int[] dp = new int[arr.length]; dp[0] = arr[0]; dp[1] = arr[0] + arr[1]; dp[2] = Math.max(dp[1], Math.max(arr[1] + arr[2], arr[0] + arr[2])); for (int i = 3; i < dp.length; i++) { // not include me int a = dp[i - 1]; // include me int b = arr[i] + dp[i - 2]; int c = arr[i] + arr[i - 1] + dp[i - 3]; dp[i] = Math.max(a, Math.max(b, c)); } int ans = 0; for (int i = 0; i < dp.length; i++) { if (ans < dp[i]) { ans = dp[i]; } } System.out.println(ans); }", "tokens": 223} {"id": 428792, "source": "method", "repo": "mrpkdeveloper/450-dsa-questions", "text": "public static void largest(int[] arr, int k) { // create min heap minheap heap = new minheap(); for (int i = 0; i < arr.length; i++) { if (i < k) { heap.add(arr[i]); } else if (heap.heap.get(0) < arr[i]) { heap.remove(); heap.add(arr[i]); } } while (heap.heap.size() > 0) { System.out.println(heap.remove()); } }", "tokens": 115} {"id": 428866, "source": "method", "repo": "mrpkdeveloper/450-dsa-questions", "text": "public static void main(String[] args) { // TODO Auto-generated method stub // int arr[] = { 1, 3, 5, 5, 5, 5, 67, 123, 125 }; int arr[] = { 1 }; // int arr[] = { 2, 2 }; // int arr[] = { 1, 4 }; find(arr, 4); }", "tokens": 100} {"id": 428986, "source": "method", "repo": "mrpkdeveloper/450-dsa-questions", "text": "public static void main(String[] args) { // TODO Auto-generated method stub // minswap(\"]][[\"); // minswapoptimised(\"]][[\"); minswapoptimised(\"[]][][\"); }", "tokens": 48} {"id": 429060, "source": "method", "repo": "mrtjp/projectred", "text": "public ItemStack getCraftingRemainingItem(ItemStack itemStack) { if (isDamageable(itemStack)) { ItemStack ret = itemStack.copy(); ret.setDamageValue(ret.getDamageValue() + 1); return ret; } return itemStack; }", "tokens": 51} {"id": 429158, "source": "method", "repo": "mrtjp/projectred", "text": "private static void assertVertArrayEquals(@Nullable Vertex5[] expected, @Nullable Vertex5[] actual) { if (expected == null || actual == null) { assertEquals(expected, actual); return; } assertEquals(expected.length, actual.length); for (int i = 0; i < expected.length; i++) { assertEquals(expected[i].vec, actual[i].vec); assertEquals(expected[i].uv, actual[i].uv); } }", "tokens": 100} {"id": 429417, "source": "method", "repo": "mrtjp/projectred", "text": "public boolean canTransitionTo(int id) { return id == STATE_AWAITING_COMPILE; }", "tokens": 22} {"id": 429505, "source": "method", "repo": "mrtjp/projectred", "text": "protected int redstoneOutputMask() { return 0; }", "tokens": 13} {"id": 429592, "source": "method", "repo": "mrtjp/projectred", "text": "public void onTabOpened() { setHidden(false); manager.swapTools(tool.getToolType()); }", "tokens": 24} {"id": 429615, "source": "method", "repo": "mrtjp/projectred", "text": "public boolean hasBody() { return true; }", "tokens": 11} {"id": 429638, "source": "method", "repo": "mrtjp/projectred", "text": "public static void register() { FABRICATION_CREATIVE_TAB = ProjectRedIntegration.CREATIVE_TABS.register(\"fabrication\", () -> CreativeModeTab.builder() .icon(() -> new ItemStack(IC_WORKBENCH_BLOCK.get())) .title(Component.translatable(\"itemGroup.\" + MOD_ID)) .displayItems((params, output) -> { // Blocks output.accept(IC_WORKBENCH_BLOCK.get()); output.accept(PLOTTING_TABLE_BLOCK.get()); output.accept(LITHOGRAPHY_TABLE_BLOCK.get()); output.accept(PACKAGING_TABLE_BLOCK.get()); // Items output.accept(IC_BLUEPRINT_ITEM.get()); output.accept(BLANK_PHOTOMASK_ITEM.get()); output.accept(PHOTOMASK_SET_ITEM.get()); output.accept(ROUGH_SILICON_WAFER_ITEM.get()); output.accept(VALID_DIE_ITEM.get()); output.accept(INVALID_DIE_ITEM.get()); }) .build()); }", "tokens": 233} {"id": 429666, "source": "method", "repo": "mrtjp/projectred", "text": "protected void gateLogicOnScheduledTick() { // Push latched inputs into simulation registers simulationContainer.pushInputs(0xF); // Run simulation simulationContainer.simulate(); int changeMask = simulationContainer.pullOutputs(); if (changeMask != 0) { setState(state() & 0xF | getModeBasedOutputStateMask() << 4); onOutputChange(changeMask); } // Re-check inputs in case they changed during scheduled tick gateLogicOnChange(); }", "tokens": 100} {"id": 429695, "source": "method", "repo": "mrtjp/projectred", "text": "public void renderStatic(MultipartLightPart part, @Nullable RenderType layer, CCRenderState ccrs) { if (layer == null || layer == RenderType.cutout()) { ccrs.brightness = 0; part.getProperties().render(part, Vector3.ZERO, ccrs); } }", "tokens": 58} {"id": 429799, "source": "method", "repo": "mrtjp/projectred", "text": "public double getHeight(int r) { return 10.0D; }", "tokens": 18} {"id": 429966, "source": "method", "repo": "msemys/esjc", "text": "/** Unsubscribes from the catch-up subscription. @param timeout the maximum wait time before it should timeout. @throws TimeoutException when timeouts */ public void stop(Duration timeout) throws TimeoutException { stop(); logger.trace(\"Waiting on subscription to stop\"); if (!awaitStopped(timeout)) { throw new TimeoutException(String.format(\"Could not stop %s in time.\", getClass().getSimpleName())); } }", "tokens": 86} {"id": 430034, "source": "method", "repo": "msemys/esjc", "text": "/** Sets the amount of time to delay before attempting to reconnect (by default, 1 second). @param duration the amount of time to delay before attempting to reconnect. @return the builder reference */ public EventStoreBuilder reconnectionDelay(Duration duration) { settingsBuilder.reconnectionDelay(duration); return this; }", "tokens": 67} {"id": 430072, "source": "method", "repo": "msemys/esjc", "text": "private void onAuthenticationCompleted(AuthenticationStatus status) { if (status == AuthenticationStatus.SUCCESS || status == AuthenticationStatus.IGNORED) { gotoIdentificationPhase(); } else { fireEvent(Events.authenticationFailed()); } }", "tokens": 46} {"id": 430088, "source": "method", "repo": "msemys/esjc", "text": "public CompletableFuture write(Transaction transaction, Iterable events, UserCredentials userCredentials) { checkNotNull(transaction, \"transaction is null\"); checkNotNull(events, \"events is null\"); CompletableFuture result = new CompletableFuture<>(); enqueue(new TransactionalWriteOperation(result, settings.requireMaster, transaction.transactionId, events, userCredentials)); return result; }", "tokens": 79} {"id": 430105, "source": "method", "repo": "msemys/esjc", "text": "/** Sets the number of times a message should be retried before being considered a bad message (by default, 10 times). @param maxRetryCount the maximum retry count. @return the builder reference */ public Builder maxRetryCount(int maxRetryCount) { this.maxRetryCount = maxRetryCount; return this; }", "tokens": 65} {"id": 430133, "source": "method", "repo": "msemys/esjc", "text": "/** Sets the maximum number of times to allow for reconnection (by default, 10 times). @param maxReconnections the maximum number of times to allow for reconnection (use {@code -1} for unlimited). @return the builder reference */ public Builder maxReconnections(int maxReconnections) { this.maxReconnections = maxReconnections; return this; }", "tokens": 82} {"id": 430149, "source": "method", "repo": "msemys/esjc", "text": "private StreamMetadata(Builder builder) { maxCount = builder.maxCount; maxAge = builder.maxAge; truncateBefore = builder.truncateBefore; cacheControl = builder.cacheControl; acl = (builder.aclBuilder != null) ? builder.aclBuilder.build() : null; customProperties = (builder.customProperties != null) ? unmodifiableList(builder.customProperties) : emptyList(); }", "tokens": 85} {"id": 430176, "source": "method", "repo": "msemys/esjc", "text": "/** Unsubscribes from the stream. */ public void close() { unsubscribe(); }", "tokens": 19} {"id": 430398, "source": "method", "repo": "msemys/esjc", "text": "public Position lastProcessedPosition() { Position oldPosition = lastProcessedPosition; Position currentPosition; while (oldPosition != (currentPosition = lastProcessedPosition)) { oldPosition = currentPosition; } return currentPosition; }", "tokens": 46} {"id": 430586, "source": "method", "repo": "msemys/esjc", "text": "public void appends_0em1_1e0_2e1_1any_1any_idempotent() { final String stream = generateStreamName(); List events = range(0, 3).mapToObj(i -> newTestEvent()).collect(toList()); TransactionalWriter writer = newTransactionalWriter(stream); assertEquals(2, writer.startTransaction(-1).write(events).commit().nextExpectedVersion); assertEquals(0, writer.startTransaction(ExpectedVersion.ANY) .write(events.get(0)) .write(events.get(0)) .commit().nextExpectedVersion); assertEquals(events.size(), size(stream)); }", "tokens": 146} {"id": 430608, "source": "method", "repo": "msemys/esjc", "text": "public void returnsEventsInSameOrderAsWritten() { final String stream = generateStreamName(); List events = newTestEvents(20); Position position = eventstore.appendToStream(stream, ExpectedVersion.NO_STREAM, events.get(0)).join().logPosition; eventstore.appendToStream(stream, 0, events.stream().skip(1).collect(toList())).join(); List result = new ArrayList<>(); eventstore.iterateAllEventsForward(position, 3, false).forEachRemaining(e -> result.add(e.event)); assertEquals(20, result.size()); assertThat(result, containsInOrder(events)); }", "tokens": 139} {"id": 430623, "source": "method", "repo": "msemys/esjc", "text": "public void failsToCallNextWhenIteratingDeletedStream() { final String stream = generateStreamName(); eventstore.deleteStream(stream, ExpectedVersion.NO_STREAM, true).join(); Iterator iterator = eventstore.iterateStreamEventsForward(stream, 0, 5, false); try { iterator.next(); fail(\"should fail with 'StreamDeletedException'\"); } catch (Exception e) { assertThat(e, instanceOf(StreamDeletedException.class)); assertEquals(stream, ((StreamDeletedException) e).stream); } }", "tokens": 115} {"id": 430651, "source": "method", "repo": "msemys/esjc", "text": "public void retrievesJsonFlagProperly() { final String stream = generateStreamName(); List events = newTestEvents(); eventstore.appendToStream(stream, ExpectedVersion.NO_STREAM, events).join(); EventReadResult result = eventstore.readEvent(stream, 1, false).join(); assertEquals(EventReadStatus.Success, result.status); assertEquals(events.get(1).eventId, result.event.originalEvent().eventId); assertTrue(result.event.originalEvent().isJson); }", "tokens": 111} {"id": 430746, "source": "method", "repo": "msemys/esjc", "text": "public void failsToCommitIfStartedWithCorrectVersionButOnCommitStreamWasDeleted() { final String stream = generateStreamName(); Transaction transaction = eventstore.startTransaction(stream, ExpectedVersion.NO_STREAM).join(); transaction.write(newTestEvent()).join(); eventstore.deleteStream(stream, ExpectedVersion.NO_STREAM, true).join(); try { transaction.commit().join(); fail(\"should fail with 'StreamDeletedException'\"); } catch (Exception e) { assertThat(e.getCause(), instanceOf(StreamDeletedException.class)); } }", "tokens": 115} {"id": 430839, "source": "method", "repo": "msemys/esjc", "text": "public void changesPassword() { final String username = UUID.randomUUID().toString(); final String password = \"password\"; final String newPassword = \"newPassword\"; userManager.create(username, \"---\", password, asList(\"$admins\")).join(); assertFalse(userManager.findAll(new UserCredentials(username, password)).join().isEmpty()); userManager.changePassword(username, password, newPassword).join(); sleepUninterruptibly(3000); assertFalse(userManager.findAll(new UserCredentials(username, newPassword)).join().isEmpty()); }", "tokens": 115} {"id": 431018, "source": "method", "repo": "MSPaintIDE/MSPaintIDE", "text": "protected GoOptions nameToEnum(String name) { return GoOptions.staticFromName(name); }", "tokens": 23} {"id": 431080, "source": "method", "repo": "MSPaintIDE/MSPaintIDE", "text": "public boolean hasRuntime() { return Commandline.runCommand(\"node\", \"--version\").startsWith(\"v\"); }", "tokens": 23} {"id": 431095, "source": "method", "repo": "MSPaintIDE/MSPaintIDE", "text": "public boolean hasRuntime() { return Commandline.runCommand(\"python\", \"--version\").startsWith(\"Python \"); }", "tokens": 24} {"id": 431312, "source": "method", "repo": "MSPaintIDE/MSPaintIDE", "text": "public void setRealPadding(String padding) { realPaddingProperty().set(padding); styles.put(\"padding\", \"-fx-padding: \" + padding + \";\"); computeStyles(); }", "tokens": 42} {"id": 431447, "source": "method", "repo": "MSPaintIDE/MSPaintIDE", "text": "public ReplaceManager(MainGUI mainGUI) { this.mainGUI = mainGUI; }", "tokens": 18} {"id": 431530, "source": "method", "repo": "MSPaintIDE/MSPaintIDE", "text": "public static void main(String[] args) { try { MainGUI.main(args); } catch (IOException | InterruptedException | ExecutionException e) { e.printStackTrace(); } }", "tokens": 39} {"id": 431544, "source": "method", "repo": "MSPaintIDE/MSPaintIDE", "text": "public void refreshProject() { refreshProject(false); }", "tokens": 13} {"id": 431609, "source": "method", "repo": "MSPaintIDE/MSPaintIDE", "text": "public MergenceManager getMergenceManager() { return mergenceManager; }", "tokens": 17} {"id": 431665, "source": "method", "repo": "MSPaintIDE/MSPaintIDE", "text": "SettingType(Class type) { this.type = type; }", "tokens": 15} {"id": 431763, "source": "method", "repo": "mtedone/podam", "text": "/** {@inheritDoc} */ public void setMemoization(boolean isMemoizationEnabled) { this.isMemoizationEnabled.set(isMemoizationEnabled); }", "tokens": 34} {"id": 431818, "source": "method", "repo": "mtedone/podam", "text": "/** {@inheritDoc} */ public PodamFactory setClassStrategy(ClassInfoStrategy classInfoStrategy) { this.classInfoStrategy = classInfoStrategy; return this; }", "tokens": 31} {"id": 431819, "source": "method", "repo": "mtedone/podam", "text": "/** {@inheritDoc} */ public PodamFactory setExternalFactory(PodamFactory externalFactory) { this.externalFactory = externalFactory; return this; }", "tokens": 30} {"id": 431842, "source": "method", "repo": "mtedone/podam", "text": "public int methodComplexity(Method method) { int complexity = 0; for (Class parameter : method.getParameterTypes()) { if (!parameter.isPrimitive() && !parameter.equals(String.class)) { if (parameter.isInterface() || Modifier.isAbstract(parameter.getModifiers()) || parameter.isAssignableFrom(method.getDeclaringClass())) { complexity++; } } } return complexity; }", "tokens": 81} {"id": 431890, "source": "method", "repo": "mtedone/podam", "text": "/** @return the parentCalendarField */ public Calendar getParentCalendarField() { return parentCalendarField; }", "tokens": 22} {"id": 431923, "source": "method", "repo": "mtedone/podam", "text": "public String set(int index, String element) { return list.set(index, element); }", "tokens": 22} {"id": 431930, "source": "method", "repo": "mtedone/podam", "text": "public boolean add(Object e) { return list.add(e); }", "tokens": 17} {"id": 431969, "source": "method", "repo": "mtedone/podam", "text": "/** @param typedValue2 the typedList to set */ public void setTypedValue2(T typedValue2) { this.typedValue2 = typedValue2; }", "tokens": 37} {"id": 432064, "source": "method", "repo": "mtedone/podam", "text": "/** @return the shortObjectField */ public Short getShortObjectField() { return shortObjectField; }", "tokens": 20} {"id": 432114, "source": "method", "repo": "mtedone/podam", "text": "public void setStringFieldWithPatternAnnotation(String stringFieldWithPatternAnnotation) { this.stringFieldWithPatternAnnotation = stringFieldWithPatternAnnotation; }", "tokens": 33} {"id": 432119, "source": "method", "repo": "mtedone/podam", "text": "public String getStringFieldUnsupportedAnnotation() { return stringFieldUnsupportedAnnotation; }", "tokens": 16} {"id": 432124, "source": "method", "repo": "mtedone/podam", "text": "/** Constructs a String with all attributes in name = value format. @return a String representation of this object. */ public String toString() { final String TAB = \" \"; StringBuilder retValue = new StringBuilder(); retValue.append(\"SingletonWithParametersInStaticFactoryPojo ( \") .append(\"createDate = \").append(createDate.getTime()) .append(TAB).append(\"pojoList = \").append(pojoList).append(TAB) .append(\"pojoMap = \").append(pojoMap).append(TAB) .append(\"firstName = \").append(firstName).append(TAB) .append(\" )\"); return retValue.toString(); }", "tokens": 152} {"id": 432177, "source": "method", "repo": "mtedone/podam", "text": "public String getPostCode() { return postCode; }", "tokens": 13} {"id": 432180, "source": "method", "repo": "mtedone/podam", "text": "/** @param boolDefaultToFalse the boolDefaultToFalse to set */ public void setBoolDefaultToFalse(boolean boolDefaultToFalse) { this.boolDefaultToFalse = boolDefaultToFalse; }", "tokens": 44} {"id": 432212, "source": "method", "repo": "mtedone/podam", "text": "/** @return the doubleObjectFieldWithMinValueOnly */ public Double getDoubleObjectFieldWithMinValueOnly() { return doubleObjectFieldWithMinValueOnly; }", "tokens": 22} {"id": 432214, "source": "method", "repo": "mtedone/podam", "text": "/** @param doubleObjectFieldWithMaxValueOnly the doubleObjectFieldWithMaxValueOnly to set */ public void setDoubleObjectFieldWithMaxValueOnly( Double doubleObjectFieldWithMaxValueOnly) { this.doubleObjectFieldWithMaxValueOnly = doubleObjectFieldWithMaxValueOnly; }", "tokens": 38} {"id": 432368, "source": "method", "repo": "mtedone/podam", "text": "public void podamShouldThrowExceptionWhenPodamStrategyValueContainsInvalidStrategy() throws Exception { podamFactory.manufacturePojo(StringWithWrongStrategyTypePojo.class); }", "tokens": 35} {"id": 432376, "source": "method", "repo": "mtedone/podam", "text": "public void podamShouldHandlePojosWithAnnotatedFieldAndSetter() throws Exception { PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory(); AnnotatedFieldAndSetterPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(AnnotatedFieldAndSetterPojo.class, podamFactory); podamValidationSteps.theObjectShouldNotBeNull(pojo); podamValidationSteps.theStringFieldCannotBeNullOrEmpty(pojo.getPostCode()); podamValidationSteps.theStringValueShouldBeExactly( PodamTestConstants.POST_CODE, pojo.getPostCode()); }", "tokens": 102} {"id": 432438, "source": "method", "repo": "mtedone/podam", "text": "public void podamShouldFillValuesInvokingChildrenSettersHavingDifferentTypesThanParent() throws Exception { PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory(); BadlyTypedFixedPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(BadlyTypedFixedPojo.class, podamFactory); podamValidationSteps.theObjectShouldNotBeNull(pojo); }", "tokens": 72} {"id": 432533, "source": "method", "repo": "mtedone/podam", "text": "public Set givenASetOfExcludedFields(String...excludedFields) { Set retValue = new HashSet(); for (int i = 0; i < excludedFields.length; i++) { retValue.add(excludedFields[i]); } return retValue; }", "tokens": 64} {"id": 432569, "source": "method", "repo": "mtedone/podam", "text": "public void theCharValueShouldBeGreaterOrEqualThan(char charValue, char minValue) { Assert.assertTrue(\"The char value \" + charValue + \" should be >= \" + minValue, charValue >= minValue); }", "tokens": 45} {"id": 432574, "source": "method", "repo": "mtedone/podam", "text": "public void theDoubleValueShouldBeGreaterOrEqualThan(double doubleValue, double minValue) { Assert.assertTrue(\"The double value should be >= \" + minValue, doubleValue >= minValue); }", "tokens": 39} {"id": 432640, "source": "method", "repo": "mthmulders/mcs", "text": "static HttpResponse.BodySubscriber> asObject() { var upstream = HttpResponse.BodySubscribers.ofInputStream(); return HttpResponse.BodySubscribers.mapping(upstream, SearchResponseBodyHandler::toSearchResponse); }", "tokens": 46} {"id": 432642, "source": "method", "repo": "mthmulders/mcs", "text": "static SearchResponse constructSearchResponse(final Map input) { return new SearchResponse(null, constructResponse((Map) input.get(\"response\"))); }", "tokens": 42} {"id": 432758, "source": "method", "repo": "mthmulders/mcs", "text": "void delegates_to_handler() { // Arrange var command = new ClassSearchCommand(searchCommandHandler, \"test\", null, false, false); // Act command.call(); // Assert var query = SearchQuery.classSearch(\"test\").build(); verifyHandlerInvocation(\"maven\", false, false, query); }", "tokens": 65} {"id": 433169, "source": "method", "repo": "MTVehicles/MinetopiaVehicles", "text": "public String toString(@Nullable Event e, boolean debug) { return \"Vehicle voucher event\"; }", "tokens": 21} {"id": 433245, "source": "method", "repo": "MTVehicles/MinetopiaVehicles", "text": "private SoftDependency(String name){ this.name = name; }", "tokens": 16} {"id": 433288, "source": "method", "repo": "MTVehicles/MinetopiaVehicles", "text": "public ListenersModule() { Main.instance.registerListener(new InventoryClickListener()); Main.instance.registerListener(new VehiclePlaceListener()); Main.instance.registerListener(new VehicleClickListener()); Main.instance.registerListener(new VehicleLeaveListener()); Main.instance.registerListener(new ChatListener()); Main.instance.registerListener(new VehicleEntityListener()); Main.instance.registerListener(new VehicleOtherDamageListener()); Main.instance.registerListener(new JoinListener()); Main.instance.registerListener(new VehicleVoucherListener()); Main.instance.registerListener(new InventoryCloseListener()); Main.instance.registerListener(new JerryCanClickListener()); Main.instance.registerListener(new TNTSpawnListener()); Main.instance.registerListener(new LeaveListener()); }", "tokens": 151} {"id": 433460, "source": "method", "repo": "MTVehicles/MinetopiaVehicles", "text": "/** Get Vehicle instance from a vehicle item @param item Vehicle as Item @return Vehicle @see #getLicensePlate(ItemStack) */ public static Vehicle getVehicle(ItemStack item){ return getVehicle(getLicensePlate(item)); }", "tokens": 46} {"id": 433880, "source": "method", "repo": "multilang-depends/depends", "text": "public AbstractLangProcessor getProcessorOf(String lang) { return langProcessors.get(lang); }", "tokens": 22} {"id": 434113, "source": "method", "repo": "multilang-depends/depends", "text": "private String getName(Dotted_nameContext dotted_name) { return dotted_name.getText(); }", "tokens": 23} {"id": 434164, "source": "method", "repo": "multilang-depends/depends", "text": "public Object visitClassVarDeclNode(ClassVarDeclNode node) { context.foundVarDefinition(context.currentType(), node.getName(),node.getPosition().getStartLine()+1); return super.visitClassVarDeclNode(node); }", "tokens": 53} {"id": 434200, "source": "method", "repo": "multilang-depends/depends", "text": "public int getSrc() { return src; }", "tokens": 11} {"id": 434226, "source": "method", "repo": "multilang-depends/depends", "text": "public void setCells(XCells cells) { this.cells = cells; }", "tokens": 19} {"id": 434235, "source": "method", "repo": "multilang-depends/depends", "text": "protected String nameOf(Entity entity) { String name = stripper.stripFilename(entity.getDisplayName()); return filenameWritter.reWrite(name); }", "tokens": 35} {"id": 434317, "source": "method", "repo": "multilang-depends/depends", "text": "public void test_TemplateInReturn() throws IOException { String src = \"./src/test/resources/cpp-code-examples/template/TemplateInReturnValue.cpp\"; CppFileParser parser = createParser(); parser.parse(src); resolveAllBindings(); FunctionEntity func = (FunctionEntity) entityRepo.getEntity(\"get\"); this.assertContainsRelation(func, DependencyType.RETURN, \"std.tuple_element.type\"); this.assertContainsRelation(entityRepo.getEntity(\"get\"), DependencyType.PARAMETER, \"Index\"); this.assertContainsRelation(entityRepo.getEntity(\"get\"), DependencyType.PARAMETER, \"std.tuple\"); this.assertContainsRelation(entityRepo.getEntity(\"get\"), DependencyType.PARAMETER, \"Domains\"); }", "tokens": 152} {"id": 434398, "source": "method", "repo": "multilang-depends/depends", "text": "protected String withPackageName(String theFile,String entityName) { String uniqName = FileUtil.uniqFilePath(theFile); return FileUtil.getLocatedDir(uniqName)+\".\"+FileUtil.getShortFileName(uniqName).replace(\".py\",\"\")+\".\"+entityName; }", "tokens": 64} {"id": 434419, "source": "method", "repo": "multilang-depends/depends", "text": "public void test_continuous_call() throws IOException { String[] srcs = new String[] { \"./src/test/resources/ruby-code-examples/continuous_func_call.rb\", }; for (String src:srcs) { FileParser parser = createFileParser(); parser.parse(src); } resolveAllBindings(); FunctionEntity function = (FunctionEntity)(entityRepo.getEntity(\"test\")); this.assertContainsRelation(function, DependencyType.CALL, \"foo\"); this.assertContainsRelation(function, DependencyType.CALL, \"bar\"); }", "tokens": 117} {"id": 434472, "source": "method", "repo": "multilang-depends/depends", "text": "void test() { this.local(); super.ping(); }", "tokens": 14} {"id": 434687, "source": "method", "repo": "mwanji/toml4j", "text": "public void should_fail_when_dots_in_key_name() throws Exception { new Toml().read(\"a.b = 1\"); }", "tokens": 34} {"id": 434744, "source": "method", "repo": "mwanji/toml4j", "text": "public void array_empty() throws Exception { runEncoder(\"array-empty\"); }", "tokens": 18} {"id": 434814, "source": "method", "repo": "mwanji/toml4j", "text": "public Value(String type, String value) { this.type = type; this.value = value; }", "tokens": 24} {"id": 434881, "source": "method", "repo": "mwanji/toml4j", "text": "public void should_fail_when_duplicated_by_top_level_table() throws Exception { e.expect(IllegalStateException.class); e.expectMessage(\"Duplicate table definition on line 2: [tbl]\"); new Toml().read(\"tbl = {}\\n [tbl]\"); }", "tokens": 64} {"id": 434915, "source": "method", "repo": "mwanji/toml4j", "text": "public void should_fail_on_exponent_with_two_E() { new Toml().read(\"answer = -1E1E1\"); }", "tokens": 33} {"id": 434919, "source": "method", "repo": "mwanji/toml4j", "text": "public void should_fail_on_two_underscores_in_a_row() { new Toml().read(\"answer = 1__1\"); }", "tokens": 35} {"id": 434926, "source": "method", "repo": "mwanji/toml4j", "text": "public void should_fail_on_underscore_followed_by_whitespace() { new Toml().read(\"answer = _ 1\"); }", "tokens": 32} {"id": 435145, "source": "method", "repo": "mzmine/mzmine", "text": "public TreeTableColumn createColumn( @Nullable RawDataFile raw, @Nullable SubColumnsFactory parentType) { final TreeTableColumn column = super.createColumn(raw, parentType); column.setCellFactory(new CountingRowChartCellFactory(MobilogramFeatureShapeCell::new)); column.setCellValueFactory(cdf -> new ReadOnlyObjectWrapper<>(cdf.getValue().getValue())); return column; }", "tokens": 98} {"id": 435186, "source": "method", "repo": "mzmine/mzmine", "text": "public Object loadFromXML(@NotNull final XMLStreamReader reader) { throw new UnsupportedOperationException( getClass().getName() + \" requires feature list context for XML save/load\"); }", "tokens": 36} {"id": 435304, "source": "method", "repo": "mzmine/mzmine", "text": "private int setOutputFilename(final File baseFile, final FileNameSuffixExportParameter outParam) { File file = null; Integer duplicateCounter = null; // have to name it once then check for duplicates outParam.setValueAppendSuffix(baseFile, null); // may also be a duplicate so check while ((file = outParam.getValue()) != null) { duplicateCounter = exportFileCounter.get(file.getName()); if (duplicateCounter == null) { exportFileCounter.put(file.getName(), 1); // next will be named with suffix 1 return 1; } else { exportFileCounter.put(file.getName(), ++duplicateCounter); } outParam.setValueAppendSuffix(baseFile, duplicateCounter.toString()); } // apparently does not set the file return 0; }", "tokens": 170} {"id": 435334, "source": "method", "repo": "mzmine/mzmine", "text": "public Collection getAlignedFeatureLists() { return controller.selectedFeatureListsProperty().getValue(); }", "tokens": 25} {"id": 435339, "source": "method", "repo": "mzmine/mzmine", "text": "public double getFinishedPercentage() { return progress.progress(); }", "tokens": 14} {"id": 435356, "source": "method", "repo": "mzmine/mzmine", "text": "/** @param xDataToCorrect in place operation, the data to correct is changed @param yDataToCorrect in place operation, the data to correct is changed @param numValues corresponding number of values - input arrays may be longer @param xDataFiltered might be the whole x data or peaks removed @param yDataFiltered might be the whole y data or peaks removed @param numValuesFiltered number of filtered data points @param addPreview add preview datasets */ protected void subSampleAndCorrect(final double[] xDataToCorrect, final double[] yDataToCorrect, int numValues, double[] xDataFiltered, double[] yDataFiltered, int numValuesFiltered, final boolean addPreview) { // translate into setp size in number of data points final int numSamples = (int) (numValuesFiltered * samplePercentage); int stepSize = numValuesFiltered / numSamples; if (stepSize < 4) { stepSize = 4; // minimum required distance between samples } IntList subsampleIndices = buffer.createSubSampleIndicesFromLandmarks(stepSize); XYDataArrays subData = subSampleData(subsampleIndices, xDataFiltered, yDataFiltered, numValuesFiltered); // initialize a function to map x -> y UnivariateFunction function = initializeFunction(subData.x(), subData.y()); for (int i = 0; i < numValues; i++) { double baseline = function.value(xDataToCorrect[i]); if (Double.isNaN(baseline)) { // TODO change and create function with different settings // LOESS - wider bandwidth, maybe more iterations baseline = 0; } // corrected value must be above zero. the baseline itself may be below zero, e.g. for signal // drifts due to solvent composition change yDataToCorrect[i] = Math.max(yDataToCorrect[i] - baseline, 0); } if (addPreview) { additionalData.add(new AnyXYProvider(Color.RED, \"baseline\", numValues, j -> xDataToCorrect[j], j -> function.value(xDataToCorrect[j]))); additionalData.add( new AnyXYProvider(Color.BLUE, \"samples\", subData.numValues(), subData::getX, subData::getY)); } }", "tokens": 488} {"id": 435514, "source": "method", "repo": "mzmine/mzmine", "text": "public void run() { setStatus(TaskStatus.PROCESSING); total = raws.length; int treeID = 1; try (BufferedWriter bw = Files.newBufferedWriter(outFile.toPath(), StandardCharsets.UTF_8)) { // write header bw.append(getHeader()).append(\"\\n\"); for (RawDataFile raw : raws) { final List trees = ScanUtils.getMSnFragmentTrees(raw, mzTol); for (PrecursorIonTree tree : trees) { List lines = treeToCSV(raw, tree, new ArrayList<>(), treeID); for (String line : lines) { bw.append(line).append(\"\\n\"); } treeID++; } done++; } } catch (MissingMassListException e) { setStatus(TaskStatus.ERROR); setErrorMessage(\"Missing mass list, run mass detection on all scans\"); logger.log(Level.WARNING, e.getMessage(), e); return; } catch (IOException e) { setStatus(TaskStatus.ERROR); setErrorMessage(\"Could not open file \" + outFile.getAbsolutePath() + \" for writing.\"); logger.log(Level.WARNING, String.format(\"Error writing new CSV format to file: %s for raw files: %s. Message: %s\", outFile.getAbsolutePath(), Arrays.stream(raws).map(RawDataFile::getName).collect(Collectors.joining(\", \")), e.getMessage()), e); return; } setStatus(TaskStatus.FINISHED); }", "tokens": 319} {"id": 435592, "source": "method", "repo": "mzmine/mzmine", "text": "/**
 retrieves the channel traces of the specific Sample 
*/ public java.util.Iterator getChannelTraces( GetChannelTracesRequest request) { return io.grpc.stub.ClientCalls.blockingServerStreamingCall( getChannel(), getGetChannelTracesMethod(), getCallOptions(), request); }", "tokens": 74} {"id": 435635, "source": "method", "repo": "mzmine/mzmine", "text": "public MzRangeFormulaCalculatorParameters() { super(new Parameter[] {formula, ionType, mzTolerance}); }", "tokens": 26} {"id": 435653, "source": "method", "repo": "mzmine/mzmine", "text": "private LipidQcAnnotationSelectionUtils() { }", "tokens": 12} {"id": 435780, "source": "method", "repo": "mzmine/mzmine", "text": "public void loadValueFromXML(Element xmlElement) { NodeList pathElements = xmlElement.getElementsByTagName(PATH_ELEMENT); value.clear(); for (int i = 0; i < pathElements.getLength(); i++) { Element pathElement = (Element) pathElements.item(i); NodeList pointElements = pathElement.getElementsByTagName(POINT_ELEMENT); List points = new ArrayList<>(); for (int j = 0; j < pointElements.getLength(); j++) { Element pointElement = (Element) pointElements.item(j); double x = Double.parseDouble(pointElement.getAttribute(X_ATTR)); double y = Double.parseDouble(pointElement.getAttribute(Y_ATTR)); points.add(new Point2D.Double(x, y)); } value.add(points); } }", "tokens": 176} {"id": 435781, "source": "method", "repo": "mzmine/mzmine", "text": "public AbsoluteAndRelativeDoubleParameter(String name, String description, String absUnit, AbsoluteAndRelativeDouble value, Double minAbs, @NotNull NumberFormat absFormat) { this(name, description, absUnit, value, minAbs, null, absFormat); }", "tokens": 57} {"id": 435871, "source": "method", "repo": "mzmine/mzmine", "text": "public String displayName() { return column.getTitle() + \" (Metadata)\"; }", "tokens": 18} {"id": 435878, "source": "method", "repo": "mzmine/mzmine", "text": "public double calc(double[][] data) { return getRegression(data).getSignificance(); }", "tokens": 24} {"id": 435880, "source": "method", "repo": "mzmine/mzmine", "text": "public static double covar(double[] a, double[] b) { double meanA = mean(a); double meanB = mean(b); double covar = 0; for (int d = 0; d < a.length; d++) { covar += (a[d] - meanA) * (b[d] - meanB); } return covar / (a.length - 1); }", "tokens": 95} {"id": 435885, "source": "method", "repo": "mzmine/mzmine", "text": "public String getTaskDescription() { return \"Loading all presets from local storage...\"; }", "tokens": 22} {"id": 435964, "source": "method", "repo": "mzmine/mzmine", "text": "/** Runs the given code on the JavaFX thread and rethrows any assertion failure. */ private static void runOnFxAndWait(final Runnable runnable) throws Exception { final CountDownLatch latch = new CountDownLatch(1); final Throwable[] error = new Throwable[1]; submitWhenToolkitReady(() -> { try { runnable.run(); } catch (Throwable t) { error[0] = t; } finally { latch.countDown(); } }); assertTrue(latch.await(30, TimeUnit.SECONDS), \"JavaFX task did not finish\"); if (error[0] != null) { throw new AssertionError(error[0]); } }", "tokens": 131} {"id": 436015, "source": "method", "repo": "mzmine/mzmine3", "text": "public static Label newLabel(Styles style, @Nullable Color color, @Nullable TextAlignment textAlignment, @Nullable ObservableValue binding) { return bindText(newLabel(style, color, textAlignment, \"\"), binding); }", "tokens": 52} {"id": 436171, "source": "method", "repo": "mzmine/mzmine3", "text": "public void setVisible(boolean visible) { this.visible.set(visible); }", "tokens": 19} {"id": 436175, "source": "method", "repo": "mzmine/mzmine3", "text": "/** Adds a mouse listener to the chart that will handle cursor positions on click */ public static void addMouseListener(EChartViewer viewer, XYPlot plot, ObjectProperty<@Nullable PlotCursorPosition> cursorPositionProperty) { viewer.getMouseAdapter().addGestureHandler(new ChartGestureHandler( new ChartGesture(Entity.ALL_PLOT_AND_DATA, Event.CLICK, GestureButton.BUTTON1), e -> { PlotCursorUtils.findSetCursorPosition(e, viewer.getRenderingInfo(), plot, cursorPositionProperty); })); }", "tokens": 115} {"id": 436205, "source": "method", "repo": "mzmine/mzmine3", "text": "private static Label newTitleLabel(@NotNull String text) { return FxLabels.styled(text, \"title-label\"); }", "tokens": 29} {"id": 436217, "source": "method", "repo": "mzmine/mzmine3", "text": "public String ppm(@Nullable Number ppm) { if (ppm == null) { return empty; } return ppmFormat.format(ppm); }", "tokens": 35} {"id": 436251, "source": "method", "repo": "mzmine/mzmine3", "text": "private void checkPrecursorPurity(final FeatureListRow row) { if (row.hasMs2Fragmentation()) { var map = ChimericPrecursorChecker.checkChimericPrecursorIsolation(row, mainSignalMzTol, isolationMzTol, minimumPurity); String group = map.values().stream() .max(Comparator.comparingDouble(ChimericPrecursorResults::purity)) .map(ChimericPrecursorResults::flag).map(Objects::toString).orElse(null); var summary = map.values().stream().mapToDouble(ChimericPrecursorResults::purity) .summaryStatistics(); SimpleStatistics stats = new SimpleStatistics(summary, group); row.set(PrecursorPurityType.class, stats); } finishedRows.incrementAndGet(); }", "tokens": 169} {"id": 436377, "source": "method", "repo": "mzmine/mzmine3", "text": "/** Apply isotope scoring to filter annotations. Uses cosine similarity to match predicted and measured isotope pattern. Apply isotope finder first @param rows apply to all rows @param mzTolerance tolerance for signal matching @param minIntensity minimum isotope intensity for prediction @param minIsotopeScore minimum isotope score to retain annotations */ public static void refineAnnotationsByIsotopes(List rows, MZTolerance mzTolerance, double minIntensity, double minIsotopeScore) { Map ionIsotopePatternMap = new HashMap<>(); for (final FeatureListRow row : rows) { refineAnnotationsByIsotopes(row, mzTolerance, minIntensity, minIsotopeScore, ionIsotopePatternMap); } }", "tokens": 159} {"id": 436517, "source": "method", "repo": "mzmine/mzmine3", "text": "public ExitCode showSetupDialog(boolean valueCheckRequired) { if ((getParameters() == null) || (getParameters().length == 0)) { return ExitCode.OK; } ParameterSetupDialog dialog = new IsotopePatternPreviewDialog(valueCheckRequired, this); dialog.showAndWait(); return dialog.getExitCode(); }", "tokens": 69} {"id": 436530, "source": "method", "repo": "mzmine/mzmine3", "text": "public Task getParentTask() { return this; }", "tokens": 11} {"id": 436555, "source": "method", "repo": "mzmine/mzmine3", "text": "void removeCurrentRowAnnotations() { final @Nullable FeatureListRow currentRow = model.getRow(); if (currentRow == null) { return; } currentRow.setLipidAnnotations(List.of()); controller.refreshAfterAnnotationDelete(currentRow); }", "tokens": 53} {"id": 436641, "source": "method", "repo": "mzmine/mzmine3", "text": "/** Convenience overload that wraps a raw provider in a {@link ColoredXYDataset}. */ public ColoredXYDataset addDataset(@NotNull PlotXYDataProvider provider, @NotNull XYItemRenderer renderer) { final ColoredXYDataset dataset = new ColoredXYDataset(provider); addDataset(dataset, renderer); return dataset; }", "tokens": 68} {"id": 436662, "source": "method", "repo": "mzmine/mzmine3", "text": "public void loadValueFromXML(Element xmlElement) { final NodeList childNodes = xmlElement.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { final Node item = childNodes.item(i); if (item instanceof CDATASection cdataSection) { final String embeddedXML = cdataSection.getData(); value = embeddedXML; } } }", "tokens": 84} {"id": 436723, "source": "method", "repo": "mzmine/mzmine3", "text": "public Collection getComponents() { return paramPane.getParametersAndComponents().values(); }", "tokens": 22} {"id": 436734, "source": "method", "repo": "mzmine/mzmine3", "text": "public void clearCaches() { dataRTRange.clear(); dataMaxTIC.clear(); dataMaxBasePeakIntensity.clear(); dataMZRange.clear(); }", "tokens": 35} {"id": 436843, "source": "method", "repo": "mzmine/mzmine3", "text": "private static void assertScoreOrderMatchesWeight(final double pgScore, final double bmpScore, final int pgWeight, final int bmpWeight, final @NotNull String fragmentLabel) { if (pgWeight > bmpWeight) { Assertions.assertTrue(pgScore > bmpScore, () -> \"Expected higher PG score for \" + fragmentLabel + \" fragment weight (\" + pgWeight + \" > \" + bmpWeight + \"), but got PG=\" + pgScore + \", BMP=\" + bmpScore); } else if (bmpWeight > pgWeight) { Assertions.assertTrue(bmpScore > pgScore, () -> \"Expected higher BMP score for \" + fragmentLabel + \" fragment weight (\" + bmpWeight + \" > \" + pgWeight + \"), but got BMP=\" + bmpScore + \", PG=\" + pgScore); } else { Assertions.assertEquals(pgScore, bmpScore, 1e-9, \"Expected equal scores for equal \" + fragmentLabel + \" fragment weights.\"); } }", "tokens": 225} {"id": 436867, "source": "method", "repo": "mzmine/mzmine3", "text": "/** Runs the filter on heap segments wrapping the given arrays. */ private static int filter(final int @NotNull [] intensities, final int numDataPoints, final double scalingFactor, final double @NotNull [] outIndices, final double @NotNull [] outIntensities) { return TSFUtils.filterZeroIntensities(MemorySegment.ofArray(intensities), numDataPoints, scalingFactor, MemorySegment.ofArray(outIndices), outIntensities); }", "tokens": 102} {"id": 436937, "source": "method", "repo": "naccl/nblog", "text": "public String getTitleByBlogId(Long id) { return blogMapper.getTitleByBlogId(id); }", "tokens": 24} {"id": 436984, "source": "method", "repo": "naccl/nblog", "text": "public void runJobById(Long jobId) { ScheduleUtils.run(scheduler, schedulerJobMapper.getJobById(jobId)); }", "tokens": 28} {"id": 437208, "source": "method", "repo": "nagisa77/OpenIsle", "text": "public ResponseEntity> userReadPosts( @PathVariable(\"identifier\") String identifier, @RequestParam(value = \"limit\", required = false) Integer limit, Authentication auth ) { User user = userService.findByIdentifier(identifier).orElseThrow(); if (auth == null || !auth.getName().equals(user.getUsername())) { return ResponseEntity.status(403).body(java.util.List.of()); } int l = limit != null ? limit : defaultReadPostsLimit; return ResponseEntity.ok( postReadService .getRecentReadsByUser(user.getUsername(), l) .stream() .map(userMapper::toPostReadDto) .collect(java.util.stream.Collectors.toList()) ); }", "tokens": 168} {"id": 437254, "source": "method", "repo": "nagisa77/OpenIsle", "text": "public SearchIndexInitializer searchIndexInitializer( OpenSearchClient client, OpenSearchProperties properties ) { return new SearchIndexInitializer(client, properties); }", "tokens": 32} {"id": 437816, "source": "method", "repo": "nagyesta/lowkey-vault", "text": "public SortedSet getValidKeyParameters(final Class itemType) { return EC.getValidKeyParameters(itemType); }", "tokens": 36} {"id": 437933, "source": "method", "repo": "nagyesta/lowkey-vault", "text": "public NotFoundException(final String message) { super(message); }", "tokens": 16} {"id": 438086, "source": "method", "repo": "nagyesta/lowkey-vault", "text": "void testGetDeletedCertificateShouldReturnDeleteModelWhenCalledWithValidData() { //given final var request = getCreateCertificateRequest(); final var certificateName = CERT_NAME_2 + \"-get-deleted\"; underTest.create(certificateName, VAULT_URI_1, V_7_3, request); final var certificateVaultFake = findByUri(VAULT_URI_1) .certificateVaultFake(); final var entityId = new CertificateEntityId(VAULT_URI_1, certificateName); final var versions = certificateVaultFake .getEntities() .getVersions(entityId); certificateVaultFake.delete(entityId); //when final var actual = underTest .getDeletedCertificate(certificateName, VAULT_URI_1, V_7_3); //then Assertions.assertEquals(OK, actual.getStatusCode()); final var body = actual.getBody(); final var expectedId = new VersionedCertificateEntityId(VAULT_URI_1, certificateName, versions.getFirst()); assertExpectedCertificateModel(request, expectedId, body); assertIsDeletedModel(body, expectedId); Assertions.assertFalse(certificateVaultFake.getEntities().containsName(certificateName)); Assertions.assertTrue(certificateVaultFake.getDeletedEntities().containsName(certificateName)); }", "tokens": 253} {"id": 438242, "source": "method", "repo": "nagyesta/lowkey-vault", "text": "void testUpdateIssuancePolicyShouldOverwriteIssuancePolicyWhenCalledWithValidInput() { //given final var name = CERT_NAME_1 + \"-update\"; final var input = CertificateCreationInput.builder() .validityStart(NOW) .subject(\"CN=\" + LOCALHOST) .name(name) .enableTransparency(false) .certAuthorityType(SELF_SIGNED) .contentType(CertContentType.PKCS12) .keyCurveName(KeyCurveName.P_521) .keyType(KeyType.EC) .validityMonths(TWO_YEARS_IN_MONTHS) .build(); final VaultFake vault = new VaultFakeImpl(HTTPS_LOCALHOST_8443); final var underTest = new KeyVaultCertificateEntity(name, input, vault); final ReadOnlyCertificatePolicy updatePolicy = new CertificatePolicy(CertificateCreationInput.builder() .validityStart(TIME_10_MINUTES_AGO) .reuseKeyOnRenewal(true) .name(name) .validityMonths(DEFAULT_VALIDITY_MONTHS) .certAuthorityType(UNKNOWN) .subject(\"CN=\" + LOCALHOST) .contentType(CertContentType.PKCS12) .keyCurveName(KeyCurveName.P_521) .keyType(KeyType.EC) .build()); //when underTest.updateIssuancePolicy(updatePolicy); //then final var currentPolicy = underTest.getIssuancePolicy(); final var originalPolicy = underTest.getOriginalCertificatePolicy(); Assertions.assertNotEquals(currentPolicy, originalPolicy); Assertions.assertEquals(updatePolicy, currentPolicy); }", "tokens": 365} {"id": 438246, "source": "method", "repo": "nagyesta/lowkey-vault", "text": "public static Stream recoveryProvider() { return Stream.builder() .add(Arguments.of(RecoveryLevel.PURGEABLE, null)) .add(Arguments.of(RecoveryLevel.RECOVERABLE_AND_PURGEABLE, RecoveryLevel.MAX_RECOVERABLE_DAYS_INCLUSIVE)) .add(Arguments.of(RecoveryLevel.CUSTOMIZED_RECOVERABLE, RecoveryLevel.MIN_RECOVERABLE_DAYS_INCLUSIVE)) .build(); }", "tokens": 109} {"id": 438626, "source": "method", "repo": "nasa-ammos/aerie", "text": "public boolean equals(Object obj) { if (!(obj instanceof final Ends o)) return false; return Objects.equals(this.expression, o.expression); }", "tokens": 36} {"id": 438827, "source": "method", "repo": "nasa-ammos/aerie", "text": "public static Discrete bind(Discrete a, Discrete b, Discrete c, Discrete d, Function>>>> function) { return join(map(a, b, c, d, function)); }", "tokens": 86} {"id": 439005, "source": "method", "repo": "nasa-ammos/aerie", "text": "/** Run a spec with two procedures in it */ void executeMultipleProcedures() throws IOException { final var args = Json.createObjectBuilder().add(\"quantity\", 2).add(\"biteSize\", 1).build(); hasura.updateSchedulingSpecGoalArguments(dumbRecurrenceGoalId.invocationId(), args); final var secondProcedure = hasura.createSchedulingSpecProcedure( \"Test Scheduling Procedure 2\", dumbRecurrenceGoalJarId, specId, 1); hasura.updateSchedulingSpecGoalArguments(secondProcedure.invocationId(), args); hasura.awaitScheduling(specId); final var plan = hasura.getPlan(planId); final var activities = plan.activityDirectives(); assertEquals(4, activities.size()); }", "tokens": 155} {"id": 439371, "source": "method", "repo": "nasa-ammos/aerie", "text": "public static FilterElementSequence numbered(int i) { return FilterElementSequence.numbered(i); }", "tokens": 24} {"id": 439375, "source": "method", "repo": "nasa-ammos/aerie", "text": "public void extractResources(final Set names) { expr.extractResources(names); }", "tokens": 22} {"id": 439569, "source": "method", "repo": "NASA-AMMOS/plandev", "text": "public void extractResources(final Set names) { names.add(this.name); }", "tokens": 23} {"id": 439740, "source": "method", "repo": "NASA-AMMOS/plandev", "text": "public static ErrorCatching>> bind(ErrorCatching>> a, ErrorCatching>> b, ErrorCatching>> c, ErrorCatching>> d, ErrorCatching>> e, ErrorCatching>> f, ErrorCatching>> g, ErrorCatching>> h, ErrorCatching>> i, ErrorCatching>> j, ErrorCatching>> k, ErrorCatching>> l, ErrorCatching>> m, ErrorCatching>> n, ErrorCatching>> o, ErrorCatching>> p, ErrorCatching>> q, ErrorCatching>> r, Function18>>> function) { return join(map(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, function)); }", "tokens": 330} {"id": 439747, "source": "method", "repo": "NASA-AMMOS/plandev", "text": "public static Discrete bind(Discrete a, Discrete b, Discrete c, Discrete d, Discrete e, Discrete f, Discrete g, Discrete h, Function>>>>>>>> function) { return join(map(a, b, c, d, e, f, g, h, function)); }", "tokens": 141} {"id": 439818, "source": "method", "repo": "NASA-AMMOS/plandev", "text": "private int insertParcel(int cmdDictId) throws SQLException { try (final var statement = connection.createStatement()) { final var res = statement.executeQuery( //language=sql \"\"\" INSERT INTO sequencing.parcel (name, command_dictionary_id) VALUES ('test-parcel', %d) RETURNING id; \"\"\".formatted(cmdDictId)); res.next(); return res.getInt(\"id\"); } }", "tokens": 92} {"id": 439956, "source": "method", "repo": "NASA-AMMOS/plandev", "text": "static void assertResultsEqual(SimulationResults expected, SimulationResults actual) { if (expected.equals(actual)) return; final var differences = new ArrayList(); if (!expected.duration.equals(actual.duration)) { differences.add(\"duration\"); } if (!expected.realProfiles.equals(actual.realProfiles)) { differences.add(\"realProfiles\"); } if (!expected.discreteProfiles.equals(actual.discreteProfiles)) { differences.add(\"discreteProfiles\"); } if (!expected.simulatedActivities.equals(actual.simulatedActivities)) { differences.add(\"simulatedActivities\"); } if (!expected.unfinishedActivities.equals(actual.unfinishedActivities)) { differences.add(\"unfinishedActivities\"); } if (!expected.startTime.equals(actual.startTime)) { differences.add(\"startTime\"); } if (!expected.duration.equals(actual.duration)) { differences.add(\"duration\"); } if (!expected.topics.equals(actual.topics)) { differences.add(\"topics\"); } if (!expected.events.equals(actual.events)) { differences.add(\"events\"); } if (!differences.isEmpty()) { System.out.println(); } System.out.println(differences); assertEquals(expected, actual); }", "tokens": 264} {"id": 440077, "source": "method", "repo": "NASA-AMMOS/plandev", "text": "public CodeLocation getLocation() { return location; }", "tokens": 12} {"id": 440184, "source": "method", "repo": "NASA-AMMOS/plandev", "text": "public Windows transformWindows(final Plan plan, final Windows windows, final SimulationResults simulationResults) { var retWin = windows; retWin = retWin.not(); retWin = retWin.removeTrueSegment(-1); retWin = retWin.shiftEdges(Duration.ZERO, Duration.negate(dur)); return retWin; }", "tokens": 74} {"id": 440229, "source": "method", "repo": "NASA-AMMOS/plandev", "text": "public void testCaseStartAtStartAnchorAt11() throws SchedulingInterruptedException{ TestData testData = createTestCaseStartsAt(PersistentTimeAnchor.START, true, true, 2, 0, 20, TimeAnchor.END, null, 0); assertTrue(testData.plan.isPresent()); assertEquals(9, testData.plan.get().getActivitiesById().size()); assertTrue(allAnchorsIncluded(testData)); assertTrue(checkAnchoredActivities(testData, true, true)); assertTrue(checkUnanchoredActivities(testData)); }", "tokens": 114} {"id": 440233, "source": "method", "repo": "NASA-AMMOS/plandev", "text": "public Map> getDirectiveTypes() { return Map.of( \"DelayActivityDirective\", delayedActivityDirective, \"DecomposingActivityDirective\", decomposingActivityDirective); }", "tokens": 52} {"id": 440421, "source": "method", "repo": "nashtech-garage/yas", "text": "void setUp() { cartItemPostVmBuilder = CartItemPostVm.builder() .productId(PRODUCT_ID_SAMPLE) .quantity(1); }", "tokens": 33} {"id": 440544, "source": "method", "repo": "nashtech-garage/yas", "text": "void testAddProductIntoWarehouse_whenNormalCase_shouldSavingSuccess() { Long warehouseId = 1L; Long productId = 1L; Warehouse warehouse = new Warehouse(); warehouse.setId(warehouseId); ProductInfoVm productInfoVm = new ProductInfoVm(productId, \"Product\", \"SKU\", true); when(stockRepository.existsByWarehouseIdAndProductId(warehouseId, productId)).thenReturn(false); when(productService.getProduct(productId)).thenReturn(productInfoVm); when(warehouseRepository.findById(warehouseId)).thenReturn(Optional.of(warehouse)); when(stockRepository.saveAll(anyList())).thenAnswer(invocation -> invocation.getArguments()[0]); StockPostVm stockPostVm = new StockPostVm(warehouseId, productId); stockService.addProductIntoWarehouse(List.of(stockPostVm)); verify(stockRepository, times(1)).saveAll(anyList()); }", "tokens": 190} {"id": 440681, "source": "method", "repo": "nashtech-garage/yas", "text": "private void prepareCheckoutItems(Checkout checkout, CheckoutPostVm checkoutPostVm) { Set productIds = checkoutPostVm.checkoutItemPostVms() .stream() .map(CheckoutItemPostVm::productId) .collect(Collectors.toSet()); List checkoutItems = checkoutPostVm.checkoutItemPostVms() .stream() .map(checkoutMapper::toModel) .map(item -> { item.setCheckout(checkout); return item; }).toList(); Map products = productService.getProductInfomation(productIds, 0, productIds.size()); List enrichedItems = enrichCheckoutItemsWithProductDetails(products, checkoutItems); BigDecimal totalAmount = enrichedItems.stream() .map(item -> item.getProductPrice().multiply(BigDecimal.valueOf(item.getQuantity()))) .reduce(BigDecimal.ZERO, BigDecimal::add); checkout.setCheckoutItems(enrichedItems); checkout.setTotalAmount(totalAmount); }", "tokens": 219} {"id": 440682, "source": "method", "repo": "nashtech-garage/yas", "text": "private List enrichCheckoutItemsWithProductDetails( Map products, List checkoutItems) { return checkoutItems.stream().map(item -> { ProductCheckoutListVm product = products.get(item.getProductId()); if (product == null) { throw new NotFoundException(MessageCode.PRODUCT_NOT_FOUND, item.getProductId()); } return item.toBuilder() .productName(product.getName()) .productPrice(BigDecimal.valueOf(product.getPrice())) .build(); }).toList(); }", "tokens": 123} {"id": 440863, "source": "method", "repo": "nashtech-garage/yas", "text": "private void updateProductRelations(ProductPutVm productPutVm, Product product) { List newProductRelations; List oldProductRelations; List requestedProductIds = productPutVm.relatedProductIds(); List currentProductRelations = product.getRelatedProducts(); Set currentRelatedProductIds = currentProductRelations.stream() .map(currentRelation -> currentRelation.getRelatedProduct().getId()) .collect(Collectors.toSet()); Set oldRelatedProductIds = currentRelatedProductIds.stream() .filter(id -> !requestedProductIds.contains(id)) .collect(Collectors.toSet()); oldProductRelations = currentProductRelations.stream() .filter(currentRelation -> oldRelatedProductIds.contains(currentRelation.getRelatedProduct().getId())) .toList(); Set newRelatedProductIds = requestedProductIds.stream() .filter(id -> !currentRelatedProductIds.contains(id)) .collect(Collectors.toSet()); List newRelatedProducts = productRepository.findAllById(newRelatedProductIds); newProductRelations = newRelatedProducts.stream() .map(newRelatedProduct -> ProductRelated.builder() .product(product) .relatedProduct(newRelatedProduct) .build()) .toList(); productRelatedRepository.deleteAll(oldProductRelations); productRelatedRepository.saveAll(newProductRelations); }", "tokens": 307} {"id": 440912, "source": "method", "repo": "nashtech-garage/yas", "text": "void testDeleteProductAttributeGroup() throws Exception { mockMvc.perform(delete(\"/backoffice/product-attribute-groups/1\") .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isNoContent()); }", "tokens": 46} {"id": 440923, "source": "method", "repo": "nashtech-garage/yas", "text": "void testGetRelatedProductsStorefront() throws Exception { mockMvc.perform(MockMvcRequestBuilders.get(\"/storefront/products/related-products/1\") .param(\"pageNo\", \"0\") .param(\"pageSize\", \"5\")) .andExpect(status().isOk()); }", "tokens": 58} {"id": 441085, "source": "method", "repo": "nashtech-garage/yas", "text": "void test_updateTaxClass_shouldReturn204_whenGivenAccessTokenAndCorrectId() { TaxClassPostVm body = Instancio.of(TaxClassPostVm.class) .set(field(\"name\"), taxClass.getName()).create(); RestAssured.given(getRequestSpecification()) .auth().oauth2(getAccessToken(\"admin\", \"admin\")) .body(body) .put(TAX_CLASS_BASE_URL + \"/\" + taxClass.getId()) .then() .statusCode(HttpStatus.NO_CONTENT.value()) .log().ifValidationFails(); Optional result = taxClassRepository.findById(taxClass.getId()); assertThat(result).isPresent(); assertThat(result.get().getName()).isEqualTo(body.name()); }", "tokens": 163} {"id": 441110, "source": "method", "repo": "nashtech-garage/yas", "text": "public WebhookController(WebhookService webhookService) { this.webhookService = webhookService; }", "tokens": 20} {"id": 441393, "source": "method", "repo": "nemproject/nem", "text": "public String getSupportedContentType() { return ContentType.JSON; }", "tokens": 15} {"id": 441534, "source": "method", "repo": "nemproject/nem", "text": "public void toStringReturnsCorrectRepresentationWhenStatusCodeIsKnown() { // Assert: MatcherAssert.assertThat(\"Http Status Code 404: badness\", IsEqual.equalTo(new ErrorResponse(new TimeInstant(4), \"badness\", 404).toString())); MatcherAssert.assertThat(\"Http Status Code 404: Not Found\", IsEqual.equalTo(new ErrorResponse(new TimeInstant(4), null, 404).toString())); }", "tokens": 97} {"id": 441620, "source": "method", "repo": "nemproject/nem", "text": "public void feeIsCappedAtTwentyFiveXem() { // Assert: assertXemFee(250_000, 0, Amount.fromNem(25)); assertXemFee(250_001, 0, Amount.fromNem(25)); assertXemFee(500_000, 0, Amount.fromNem(25)); assertXemFee(1_000_000, 0, Amount.fromNem(25)); assertXemFee(10_000_000, 0, Amount.fromNem(25)); assertXemFee(100_000_000, 0, Amount.fromNem(25)); assertXemFee(1_000_000_000, 0, Amount.fromNem(25)); }", "tokens": 209} {"id": 441822, "source": "method", "repo": "nemproject/nem", "text": "/** Handler for NIS illegal state exceptions. @param e The exception. @return The appropriate JSON indicating an error. */ public ResponseEntity handleNisIllegalStateException(final NisIllegalStateException e) { return this.createResponse(e, HttpStatus.SERVICE_UNAVAILABLE); }", "tokens": 61} {"id": 441837, "source": "method", "repo": "nemproject/nem", "text": "private IMapper createDefaultMapper() { final MappingRepository mapper = new MappingRepository(); mapper.addMapping(Long.class, DbAccount.class, new AccountRawToDbModelMapping()); mapper.addMapping(Object[].class, DbBlock.class, new BlockRawToDbModelMapping(mapper)); mapper.addMapping(Object[].class, DbImportanceTransferTransaction.class, new ImportanceTransferRawToDbModelMapping(mapper)); mapper.addMapping(Object[].class, DbMultisigAggregateModificationTransaction.class, new MultisigAggregateModificationRawToDbModelMapping(mapper)); mapper.addMapping(Object[].class, DbMultisigModification.class, new MultisigModificationRawToDbModelMapping(mapper)); mapper.addMapping(Object[].class, DbMultisigMinCosignatoriesModification.class, new MultisigMinCosignatoriesModificationRawToDbModelMapping()); mapper.addMapping(Object[].class, DbMultisigSignatureTransaction.class, new MultisigSignatureRawToDbModelMapping(mapper)); mapper.addMapping(Object[].class, DbMultisigTransaction.class, new MultisigTransactionRawToDbModelMapping(mapper, this.multisigTransferMap)); mapper.addMapping(Object[].class, DbTransferTransaction.class, new TransferRawToDbModelMapping(mapper)); mapper.addMapping(Object[].class, DbProvisionNamespaceTransaction.class, new ProvisionNamespaceRawToDbModelMapping(mapper)); mapper.addMapping(Object[].class, DbNamespace.class, new NamespaceRawToDbModelMapping(mapper)); mapper.addMapping(Object[].class, DbMosaicDefinitionCreationTransaction.class, new MosaicDefinitionCreationRawToDbModelMapping(mapper)); mapper.addMapping(Object[].class, DbMosaicDefinition.class, new MosaicDefinitionRawToDbModelMapping(mapper)); mapper.addMapping(Object[].class, DbMosaicProperty.class, new MosaicPropertyRawToDbModelMapping()); mapper.addMapping(Object[].class, DbMosaicSupplyChangeTransaction.class, new MosaicSupplyChangeRawToDbModelMapping(mapper)); mapper.addMapping(Object[].class, DbMosaic.class, new MosaicRawToDbModelMapping()); return mapper; }", "tokens": 456} {"id": 441870, "source": "method", "repo": "nemproject/nem", "text": "public Collection getMosaics() { return this.mosaics; }", "tokens": 19} {"id": 441923, "source": "method", "repo": "nemproject/nem", "text": "private BlockChainComparisonContext createComparisonContext() { return this.blockChainContextFactory.createComparisonContext(this.score); }", "tokens": 28} {"id": 441986, "source": "method", "repo": "nemproject/nem", "text": "public void addingSameRootNamespaceTwiceUpdatesHeightOfSubNamespacesIfRootHasSameOwner() { // Assert: this.assertSubNamespaceUpdateBehaviorForAdding(OWNERS[0], new Integer[]{ 0, 0, 0, 0, 0 }, new Integer[]{ 1, 1, 1, 0, 0 }); }", "tokens": 77} {"id": 442041, "source": "method", "repo": "nemproject/nem", "text": "private MultisigTransaction prepareMultisigMultisigAggregateModificationTransaction(final Account issuer, final Account multisig, final Account cosignatory, final Account cosignatoryToAdd) { final MultisigCosignatoryModification cosignatoryModification = new MultisigCosignatoryModification( MultisigModificationType.AddCosignatory, cosignatoryToAdd); final MultisigAggregateModificationTransaction transaction = new MultisigAggregateModificationTransaction(TimeInstant.ZERO, multisig, Collections.singletonList(cosignatoryModification), new MultisigMinCosignatoriesModification(1)); return this.prepareMultisigTransaction(transaction, issuer, multisig, cosignatory); }", "tokens": 142} {"id": 442501, "source": "method", "repo": "netease-im/camellia", "text": "public void setDiscoveryFactory(CamelliaDiscoveryFactory discoveryFactory) { this.discoveryFactory = discoveryFactory; }", "tokens": 23} {"id": 442586, "source": "method", "repo": "netease-im/camellia", "text": "public ScanResult zscan(byte[] key, byte[] cursor, ScanParams params) { return factory.getProxy().zscan(key, cursor, params); }", "tokens": 38} {"id": 442628, "source": "method", "repo": "netease-im/camellia", "text": "public Long zrevrank(String key, String member) { return jedisCluster.zrevrank(key, member); }", "tokens": 26} {"id": 442715, "source": "method", "repo": "netease-im/camellia", "text": "public String hmset(@ShardingParam String key, Map hash) { LogUtil.debugLog(resource, key); String command = \"hmset(String key, Map hash)\"; before(key, command); try { return redis.hmset(key, hash); } finally { after(key, command); } }", "tokens": 76} {"id": 442864, "source": "method", "repo": "netease-im/camellia", "text": "public Long llen(String key) { return factory.getProxy().llen(key); }", "tokens": 21} {"id": 442880, "source": "method", "repo": "netease-im/camellia", "text": "public Double incrByFloat(byte[] key, double value) { Jedis jedis = jedisPool.getResource(); try { return jedis.incrByFloat(key, value); } finally { CloseUtil.closeQuietly(jedis); } }", "tokens": 48} {"id": 442907, "source": "method", "repo": "netease-im/camellia", "text": "public List bitfield(byte[] key, byte[]... arguments) { return jedisCluster.bitfield(key, arguments); }", "tokens": 32} {"id": 443321, "source": "method", "repo": "netease-kit/nim-uikit-android", "text": "protected void handleTeamDismiss(String dialogContent) { if (IMKitConfigCenter.getEnableDismissTeamDeleteConversation()) { startTeamDismiss(dialogContent); viewBinding.chatView.getBottomInputLayout().setVisibility(View.VISIBLE); viewBinding.chatInvalidTipLayout.setVisibility(View.GONE); } else { viewBinding.chatView.getBottomInputLayout().setVisibility(View.GONE); viewBinding.chatInvalidTipLayout.setVisibility(View.VISIBLE); } }", "tokens": 94} {"id": 443326, "source": "method", "repo": "netease-kit/nim-uikit-android", "text": "public void setShowFooter(boolean show) { if (this.showFooter != show) { this.showFooter = show; notifyDataSetChanged(); } }", "tokens": 34} {"id": 443440, "source": "method", "repo": "netease-kit/nim-uikit-android", "text": "public FooterViewHolder(@NonNull View itemView) { super(itemView); this.textView = (TextView) itemView; }", "tokens": 26} {"id": 443537, "source": "method", "repo": "netease-kit/nim-uikit-android", "text": "public boolean onTransferToText(ChatMessageBean messageBean) { if (chatConfig != null && chatConfig.popMenuClickListener != null && chatConfig.popMenuClickListener.onRecall(messageBean)) { return true; } viewModel.voiceToText(messageBean); return true; }", "tokens": 62} {"id": 443936, "source": "method", "repo": "netease-kit/nim-uikit-android", "text": "private ImageView createSettingView() { ImageView view = new ImageView(getContext()); view.setScaleType(ImageView.ScaleType.CENTER); view.setImageResource(R.drawable.ic_conversation_group_manager); view.setPadding(0, 0, SizeUtils.dp2px(20), 0); view.setOnClickListener( v -> { if (listener != null) { listener.onSettingClick(); } }); return view; }", "tokens": 96} {"id": 444092, "source": "method", "repo": "nette-intellij/intellij-latte", "text": "public Map getFunctions(Vendor vendor) { return defaultFunctions.getOrDefault(vendor, Collections.emptyMap()); }", "tokens": 30} {"id": 444158, "source": "method", "repo": "nette-intellij/intellij-latte", "text": "public String getShortName() { return \"LatteModifierDefinition\"; }", "tokens": 15} {"id": 444248, "source": "method", "repo": "nette-intellij/intellij-latte", "text": "public static PsiBuilder.Marker enter_section_(PsiBuilder builder, int level, int modifiers) { return enter_section_(builder, level, modifiers, null, null); }", "tokens": 39} {"id": 444271, "source": "method", "repo": "nette-intellij/intellij-latte", "text": "public Variant create() { return new Variant(); }", "tokens": 11} {"id": 444379, "source": "method", "repo": "nette-intellij/intellij-latte", "text": "private List getTypesForDepth(final int depth) { if (depth == 0) { return types; } List depthTypes = new ArrayList<>(); for (int key : wholeTypes.keySet()) { if (key < depth) { continue; } getTypesForDepth(depthTypes, depth, key - depth); } return depthTypes; }", "tokens": 77} {"id": 444414, "source": "method", "repo": "nette-intellij/intellij-latte", "text": "private static LattePhpContent findFirstPhpContent(@NotNull LatteFile file) { PsiElement firstChild = file.getFirstChild().getFirstChild(); if (!(firstChild instanceof LatteMacroOpenTag)) { return null; } LatteMacroContent content = ((LatteMacroOpenTag) firstChild).getMacroContent(); if (content != null && content.getFirstPhpContent() != null) { try { return content.getFirstPhpContent(); } catch (NullPointerException e) { return null; } } return null; }", "tokens": 104} {"id": 444501, "source": "method", "repo": "nette-intellij/intellij-latte", "text": "public String getName() { if (name == null) { PsiElement found = getNameIdentifier(); name = found != null ? found.getText() : null; } return name; }", "tokens": 37} {"id": 444569, "source": "method", "repo": "nette-intellij/intellij-latte", "text": "public LatteArgumentSettings(String name, Type[] types, String validType, boolean required, boolean repeatable) { this.name = name; this.types = types; this.validType = validType; this.required = required; this.repeatable = repeatable; }", "tokens": 59} {"id": 444650, "source": "method", "repo": "nette-intellij/intellij-latte", "text": "public void setVarType(String varType) { this.varType = varType; }", "tokens": 21} {"id": 444687, "source": "method", "repo": "nette-intellij/intellij-latte", "text": "public LatteCustomMacroSettingsDialog(TableView tableView, Project project, LatteTagSettings latteTagSettings) { this(tableView, project); this.latteTagSettings = latteTagSettings; this.textVarName.setText(latteTagSettings.getMacroName()); this.macroType.getModel().setSelectedItem(latteTagSettings.getMacroType()); this.argumentsTextField.setText(latteTagSettings.getArguments()); this.checkBoxAllowedModifiers.setSelected(latteTagSettings.isAllowedModifiers()); this.multiLineOnlyUsedCheckBox.setSelected(latteTagSettings.isMultiLine()); this.deprecatedCheckBox.setSelected(latteTagSettings.isDeprecated()); this.deprecatedMessageTextField.setText(latteTagSettings.getDeprecatedMessage()); deprecatedMessageTextField.setEnabled(latteTagSettings.isDeprecated()); attachComboBoxValues(); }", "tokens": 171} {"id": 444692, "source": "method", "repo": "nette-intellij/intellij-latte", "text": "public JComponent createComponent() { ToolbarDecorator tablePanel = ToolbarDecorator.createDecorator(this.tableView, new ElementProducer() { @Override public LatteTagSettings createElement() { //IdeFocusManager.getInstance(TwigSettingsForm.this.project).requestFocus(TwigNamespaceDialog.getWindows(), true); return null; } @Override public boolean canCreateElement() { return true; } }); tablePanel.setEditAction(anActionButton -> LatteCustomMacroSettingsForm.this.openMacroDialog(LatteCustomMacroSettingsForm.this.tableView.getSelectedObject()) ); tablePanel.setAddAction(anActionButton -> LatteCustomMacroSettingsForm.this.openMacroDialog(null) ); tablePanel.disableUpAction(); tablePanel.disableDownAction(); this.panelConfigTableView.add(tablePanel.createPanel()); return this.panel1; }", "tokens": 189} {"id": 444745, "source": "method", "repo": "nette-intellij/intellij-latte", "text": "public static boolean holdsReadLock() { Application app = ApplicationManager.getApplication(); try { return ((ApplicationEx)app).holdsReadLock(); } catch (IllegalStateException e) { return false; } }", "tokens": 46} {"id": 444833, "source": "method", "repo": "nette-intellij/intellij-latte", "text": "public void testForeachReferenceDefinition() { doTest(true, true); }", "tokens": 18} {"id": 445077, "source": "method", "repo": "ngageoint/geopackage-android", "text": "/** {@inheritDoc} */ public TileDao getTileDao(Contents contents) { if (contents == null) { throw new GeoPackageException(\"Non null \" + Contents.class.getSimpleName() + \" is required to create \" + TileDao.class.getSimpleName()); } TileMatrixSet tileMatrixSet = contents.getTileMatrixSet(); if (tileMatrixSet == null) { throw new GeoPackageException(\"No \" + TileMatrixSet.class.getSimpleName() + \" exists for \" + Contents.class.getSimpleName() + \" \" + contents.getId()); } return getTileDao(tileMatrixSet); }", "tokens": 126} {"id": 445111, "source": "method", "repo": "ngageoint/geopackage-android", "text": "/** Get a file from the document file @param file document file @return file */ protected File getFile(DocumentFile file) { return new File(getFilePath(file)); }", "tokens": 37} {"id": 445112, "source": "method", "repo": "ngageoint/geopackage-android", "text": "/** Get a required context @return context */ private Context getRequiredContext() { if (context == null) { throw new GeoPackageException(\"Operation requires an Android context\"); } return context; }", "tokens": 40} {"id": 445225, "source": "method", "repo": "ngageoint/geopackage-android", "text": "/** Constructor @param db database @param cursorFactory cursor factory @since 3.4.0 */ public GeoPackageDatabase(SQLiteDatabase db, GeoPackageCursorFactory cursorFactory) { this(db, true, cursorFactory); }", "tokens": 46} {"id": 445232, "source": "method", "repo": "ngageoint/geopackage-android", "text": "/** {@inheritDoc} */ public Cursor rawQuery(String sql, String[] selectionArgs) { return getActive().rawQuery(sql, selectionArgs); }", "tokens": 33} {"id": 445233, "source": "method", "repo": "ngageoint/geopackage-android", "text": "/** {@inheritDoc} */ public Cursor query(String table, String[] columns, String[] columnsAs, String selection, String[] selectionArgs, String groupBy, String having, String orderBy) { return getActive().query(table, columns, columnsAs, selection, selectionArgs, groupBy, having, orderBy); }", "tokens": 67} {"id": 445255, "source": "method", "repo": "ngageoint/geopackage-android", "text": "/** Update the last indexed time @param geoPackageId GeoPackage id @param tableName table name @param lastIndexed last indexed @return updated flag */ public boolean updateLastIndexed(long geoPackageId, String tableName, long lastIndexed) { String whereClause = TableMetadata.COLUMN_GEOPACKAGE_ID + \" = ? AND \" + TableMetadata.COLUMN_TABLE_NAME + \" = ?\"; String[] whereArgs = new String[]{String.valueOf(geoPackageId), tableName}; ContentValues values = new ContentValues(); values.put(TableMetadata.COLUMN_LAST_INDEXED, lastIndexed); int updateCount = db.update( TableMetadata.TABLE_NAME, values, whereClause, whereArgs); return updateCount > 0; }", "tokens": 149} {"id": 445337, "source": "method", "repo": "ngageoint/geopackage-android", "text": "/** Query for features within the geometry envelope ordered by id, starting at the offset and returning no more than the limit @param distinct distinct rows @param envelope geometry envelope @param where where clause @param limit chunk limit @param offset chunk query offset @return feature cursor @since 6.2.0 */ public FeatureCursor queryFeaturesForChunkIdOrder(boolean distinct, GeometryEnvelope envelope, String where, int limit, long offset) { return queryFeaturesForChunk(distinct, envelope, where, getPkColumnName(), limit, offset); }", "tokens": 106} {"id": 445382, "source": "method", "repo": "ngageoint/geopackage-android", "text": "/** Calculate style pixel bounds for the icon row @param iconRow icon row @return pixel bounds @since 6.3.0 */ public static PixelBounds calculatePixelBounds(IconRow iconRow) { return calculatePixelBounds(iconRow, 1.0f); }", "tokens": 59} {"id": 445668, "source": "method", "repo": "ngageoint/geopackage-android", "text": "/** Manually query for rows within the geometry envelope @param distinct distinct rows @param columns columns @param envelope geometry envelope @param fieldValues field values @return results @since 4.0.0 */ public ManualFeatureQueryResults query(boolean distinct, String[] columns, GeometryEnvelope envelope, Map fieldValues) { return query(distinct, columns, envelope.getMinX(), envelope.getMinY(), envelope.getMaxX(), envelope.getMaxY(), fieldValues); }", "tokens": 99} {"id": 445892, "source": "method", "repo": "niaobulashi/ruoyi", "text": "private static void shearY(Graphics g, int w1, int h1, Color color) { int period = random.nextInt(40) + 10; // 50; boolean borderGap = true; int frames = 20; int phase = 7; for (int i = 0; i < w1; i++) { double d = (double) (period >> 1) * Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames); g.copyArea(i, 0, 1, h1, 0, (int) d); if (borderGap) { g.setColor(color); g.drawLine(i, (int) d, i, 0); g.drawLine(i, (int) d + h1, i, h1); } } }", "tokens": 214} {"id": 445896, "source": "method", "repo": "niaobulashi/ruoyi", "text": "public static void main(String[] args) throws Exception { PdfUtilsTest utils = new PdfUtilsTest(); String content = COMPLETE_CONTENT; content = content.replace(\"
\", \"
\"); utils.html2Pdf(content); }", "tokens": 53} {"id": 445905, "source": "method", "repo": "niaobulashi/ruoyi", "text": "private static byte[] md5(String s) { MessageDigest algorithm; try { algorithm = MessageDigest.getInstance(\"MD5\"); algorithm.reset(); algorithm.update(s.getBytes(\"UTF-8\")); byte[] messageDigest = algorithm.digest(); return messageDigest; } catch (Exception e) { log.error(\"MD5 Error...\", e); } return null; }", "tokens": 78} {"id": 446177, "source": "method", "repo": "nichtstudiocode/invui", "text": "/** Adds a {@link Inventory} ingredient with the given offset and background under the given key. @param key The key of the ingredient @param inventory The {@link Inventory} ingredient @param background The background {@link ItemProvider} {@link Property} for the {@link Inventory} @param offset The slot offset inside the {@link Inventory} to start from @return This {@link IngredientMapper} */ default S addIngredient(char key, Inventory inventory, Property<@Nullable ItemProvider> background, int offset) { return addIngredient(key, new InventorySlotElementSupplier(inventory, background, offset)); }", "tokens": 123} {"id": 446392, "source": "method", "repo": "nichtstudiocode/invui", "text": "/** Removes a click handler that was previously registered for this {@link Inventory}. @param clickHandler The click handler to remove */ public void removeClickHandler(Consumer clickHandler) { if (clickHandlers != null) clickHandlers.remove(clickHandler); }", "tokens": 57} {"id": 446425, "source": "method", "repo": "nichtstudiocode/invui", "text": "public InventoryAdapter(Inventory inventory) { this.inventory = inventory; }", "tokens": 16} {"id": 446646, "source": "method", "repo": "nichtstudiocode/invui", "text": "public S clone() { try { var clone = (AbstractBuilder) super.clone(); clone.closeable = MutableProperty.of(closeable.get()); clone.windowState = MutableProperty.of(windowState.get()); clone.cursorVisualizer = MutableProperty.of(cursorVisualizer.get()); clone.openHandlers = new ArrayList<>(openHandlers); clone.closeHandlers = new ArrayList<>(closeHandlers); clone.outsideClickHandlers = new ArrayList<>(outsideClickHandlers); clone.windowStateChangeHandlers = new ArrayList<>(windowStateChangeHandlers); clone.modifiers = new ArrayList<>(modifiers); return (S) clone; } catch (CloneNotSupportedException e) { throw new AssertionError(); } }", "tokens": 147} {"id": 446764, "source": "method", "repo": "nichtstudiocode/invui", "text": "/** Gets the {@link Window} the {@link Player} has currently open. @param player The {@link Player} @return The {@link Window} the {@link Player} has currently open */ public Window getOpenWindow(Player player) { return windowsByPlayer.get(player); }", "tokens": 61} {"id": 446806, "source": "method", "repo": "nichtstudiocode/invui", "text": "public void testWithNonContinuousLayout(boolean horizontalLines) { var m = horizontalLines ? Markers.CONTENT_LIST_SLOT_HORIZONTAL : Markers.CONTENT_LIST_SLOT_VERTICAL; var t1 = Gui.empty(3, 1); var t2 = Gui.empty(2, 5); var t3 = Gui.empty(3, 3); var b = new SlotElement.Item(Item.simple(ItemStack.of(Material.BLACK_STAINED_GLASS))); var gui = PagedGui.guisBuilder() .setStructure( \"# # # # #\", \"# . x x #\", \"# x . x #\", \"# . x . #\", \"# # # # #\" ) .addIngredient('#', b) .addIngredient('x', m) .setContent(List.of(t1, t2, t3)) .build(); assertEquals(ContentLayoutMode.SPATIAL, gui.getContentLayoutMode()); assertSlotElements( gui, b, b, b, b, b, b, null, gl(t1, 1, 0), gl(t1, 2, 0), b, b, null, null, null, b, b, null, null, null, b, b, b, b, b, b ); gui.setPage(1); assertSlotElements( gui, b, b, b, b, b, b, null, gl(t2, 1, 0), null, b, b, gl(t2, 0, 1), null, null, b, b, null, gl(t2, 1, 2), null, b, b, b, b, b, b ); gui.setPage(2); assertSlotElements( gui, b, b, b, b, b, b, null, gl(t3, 1, 0), gl(t3, 2, 0), b, b, gl(t3, 0, 1), null, gl(t3, 2, 1), b, b, null, gl(t3, 1, 2), null, b, b, b, b, b, b ); }", "tokens": 492} {"id": 446831, "source": "method", "repo": "nichtstudiocode/invui", "text": "public void testScrollInventoriesInitWithStaticFactoryFunction() { testScrollInventoriesInit(content -> ScrollGui.ofInventories( 3, 3, content, SlotUtils.toSlotList(new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8}, 3), ScrollGui.LineOrientation.HORIZONTAL ) ); }", "tokens": 88} {"id": 446930, "source": "method", "repo": "nichtstudiocode/invui", "text": "void removeIf_EventCancelled(VirtualInventory inv, UpdateReason updateReason) { inv.setItem(updateReason, 0, ItemStack.of(Material.DIAMOND, 10)); inv.setItem(updateReason, 1, ItemStack.of(Material.DIAMOND, 20)); inv.addPreUpdateHandler(event -> { if (event.getSlot() == 0) event.setCancelled(true); }); int removed = inv.removeIf(updateReason, item -> true); assertEquals(20, removed); assertEquals(ItemStack.of(Material.DIAMOND, 10), inv.getItem(0)); assertNull(inv.getItem(1)); }", "tokens": 136} {"id": 447047, "source": "method", "repo": "nikitacartes/easyauth", "text": "public static void markPrompted() { promptShown = true; }", "tokens": 15} {"id": 447162, "source": "method", "repo": "nikitacartes/easyauth", "text": "public static int setSpawnHere(CommandSourceStack source) throws CommandSyntaxException { return setSpawn(source, StoneCutterUtils.getWorld(source.getEntityOrException()).dimension().identifier(), source.getEntityOrException().getX(), source.getEntityOrException().getY(), source.getEntityOrException().getZ(), source.getEntityOrException().getYRot(), source.getEntityOrException().getXRot()); }", "tokens": 82} {"id": 447216, "source": "method", "repo": "nikitacartes/easyauth", "text": "public static void migrateFromV4() { LogInfo(\"Migrating DB from v4 to v5\"); long now = System.currentTimeMillis(); DbApi db = getDbApi(); try { db.connect(); } catch (DBApiException e) { LogError(\"Migration connection error: \", e); return; } db.migrateFromV4(); db.close(); EasyAuth.langConfig.save(); EasyAuth.extendedConfig.save(); EasyAuth.config.configVersion = 5; EasyAuth.config.save(); LogInfo(\"Migration completed in \" + (System.currentTimeMillis() - now) + \"ms\"); }", "tokens": 133} {"id": 447238, "source": "method", "repo": "nikitacartes/easyauth", "text": "public static LangConfigV1 create() { LangConfigV1 config = loadConfig(LangConfigV1.class, \"translation.conf\"); if (config == null) { config = new LangConfigV1(); config.save(); } loadTranslations(config); return config; }", "tokens": 60} {"id": 447285, "source": "method", "repo": "nikitacartes/easyauth", "text": "/** Setup window: shows the QR code + secret and asks for a confirmation code. */ public static void openOtpSetup(ServerPlayer player, String secret, String uri) { open(player, OTP_SETUP_FORM, buildOtpSetup(player, secret, uri, null)); }", "tokens": 60} {"id": 447502, "source": "method", "repo": "nikitacartes/easyauth", "text": "/** Creates and persists a new code with a freshly generated secret. */ public synchronized RegCode create(String alias, int maxUses, ZonedDateTime expiresAt, String createdBy) { RegCode code = new RegCode(); code.code = generateCode(); code.alias = (alias == null || alias.isBlank()) ? null : alias; code.maxUses = Math.max(0, maxUses); code.uses = 0; code.expiresAt = expiresAt; code.createdBy = createdBy; code.createdAt = ZonedDateTime.now(); codes.put(code.code, code); save(); return code; }", "tokens": 132} {"id": 447617, "source": "method", "repo": "nikitacartes/easyauth", "text": "public static String getUsername(ServerPlayer player) { //? if >= 1.20.3 { return player.getScoreboardName(); //?} else { /*return player.getName().getString(); *///?} }", "tokens": 47} {"id": 447830, "source": "method", "repo": "nining377/dolby_beta", "text": "public boolean isIsSignIapDeduct() { return isSignIapDeduct; }", "tokens": 23} {"id": 447833, "source": "method", "repo": "nining377/dolby_beta", "text": "public void setVipCode(int vipCode) { this.vipCode = vipCode; }", "tokens": 24} {"id": 447852, "source": "method", "repo": "nining377/dolby_beta", "text": "public BaseDialogInputItem(Context context, AttributeSet attrs) { super(context, attrs); init(context, attrs); }", "tokens": 27} {"id": 447870, "source": "method", "repo": "nining377/dolby_beta", "text": "public BeautyBannerHideView(Context context) { super(context); }", "tokens": 17} {"id": 447895, "source": "method", "repo": "nining377/dolby_beta", "text": "public void init(Context context, AttributeSet attrs) { super.init(context, attrs); titleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18); TextPaint paint = titleView.getPaint(); paint.setFakeBoldText(true); title = SettingHelper.beauty_title; setData(false, false); }", "tokens": 74} {"id": 447909, "source": "method", "repo": "nining377/dolby_beta", "text": "public ProxyMasterView(Context context, AttributeSet attrs) { super(context, attrs); }", "tokens": 20} {"id": 447955, "source": "method", "repo": "nining377/dolby_beta", "text": "public SignCountView(Context context, AttributeSet attrs) { super(context, attrs); }", "tokens": 20} {"id": 447993, "source": "method", "repo": "november521/mcphone", "text": "void write(int code, int size) { cur |= code << nbits; nbits += size; while (nbits >= 8) { o.write(cur & 0xFF); cur >>= 8; nbits -= 8; } }", "tokens": 55} {"id": 447994, "source": "method", "repo": "november521/mcphone", "text": "static void check(boolean cond, String what) { checks++; if (!cond) failures.add(what); }", "tokens": 27} {"id": 448129, "source": "method", "repo": "november521/mcphone", "text": "public static boolean matches(KeyMapping key,int code,int scan) { return key.matches(new net.minecraft.client.input.KeyEvent(code,scan,com.november.mcphone.platform.client.port.PhoneInputs.modifiers())); }", "tokens": 57} {"id": 448130, "source": "method", "repo": "november521/mcphone", "text": "protected PhoneScreenBase(Component title) { super(title); }", "tokens": 16} {"id": 448344, "source": "method", "repo": "november521/mcphone", "text": "static void onDeleteResult(UUID peer, UUID message, UUID request, ChatDeletionResult result) { if (!java.util.Objects.equals(openPeer, peer) || !java.util.Objects.equals(deletingPeer, peer) || !java.util.Objects.equals(deletingMessage, message) || !java.util.Objects.equals(deletingRequest, request)) return; deleteReceipt = new DeleteReceipt(request, result); }", "tokens": 102} {"id": 448503, "source": "method", "repo": "nulab/zxcvbn4j", "text": "/** Sets the feedback. @deprecated Use constructor for initialization. Modifying after instantiation is not recommended. */ public void setFeedback(Feedback feedback) { this.feedback = feedback; }", "tokens": 38} {"id": 448829, "source": "method", "repo": "nulab/zxcvbn4j", "text": "public void testDictionaryGuessesReverse() throws Exception { Context context = StandardContext.build(); Match match = new Match.Builder(Pattern.Dictionary, 0, 0, \"aaa\").reversed(true).rank(32).build(); String msg = \"guesses are doubled when word is reversed\"; assertEquals(msg, 32 * 2, new DictionaryGuess(context).exec(match), 0.0); }", "tokens": 95} {"id": 448874, "source": "method", "repo": "nuls-io/nuls-v2", "text": "public void setCacheTimestamp(long cacheTimestamp) { this.cacheTimestamp = cacheTimestamp; }", "tokens": 21} {"id": 448934, "source": "method", "repo": "nuls-io/nuls-v2", "text": "default void coinbase(int chainId, Transaction coinbase, BlockHeader blockHeader) { }", "tokens": 20} {"id": 448943, "source": "method", "repo": "nuls-io/nuls-v2", "text": "/** According to the system language settings, return the string corresponding to the internationalization code According to the system language Settings, return the string corresponding to the internationalization encoding. @return String */ public String getMsg() { return I18nUtils.get(msg); }", "tokens": 57} {"id": 448966, "source": "method", "repo": "nuls-io/nuls-v2", "text": "public void error(Throwable throwable) { String logContent = getLogTrace() + \":\" ; logger.error(logContent,throwable); }", "tokens": 30} {"id": 449107, "source": "method", "repo": "nuls-io/nuls-v2", "text": "public void setAssetsChainId(Integer assetsChainId) { super.setAssetsChainId(assetsChainId); }", "tokens": 26} {"id": 449111, "source": "method", "repo": "nuls-io/nuls-v2", "text": "public List getOutputs() { return outputs; }", "tokens": 15} {"id": 449161, "source": "method", "repo": "nuls-io/nuls-v2", "text": "public int size() { int size = 0; size += SerializeUtils.sizeOfUint32(); size += SerializeUtils.sizeOfBoolean(); return size; }", "tokens": 37} {"id": 449316, "source": "method", "repo": "nuls-io/nuls-v2", "text": "public static boolean newTx(int chainId, String txData) throws NulsException { Map params = new HashMap(4); params.put(Constants.CHAIN_ID, chainId); params.put(\"tx\", txData); try { Map registerResult = (Map) CallHelper.request(ModuleE.TX.abbr, \"tx_newTx\", params); return registerResult.get(\"value\"); } catch (Exception e) { if(e instanceof NulsException) { throw (NulsException) e; } throw new NulsException(e); } }", "tokens": 129} {"id": 449323, "source": "method", "repo": "nuls-io/nuls-v2", "text": "public Map validate(int chainId, List txs, Map> txMap, BlockHeader blockHeader) { ChainManager.chainHandle(chainId); Map result = new HashMap<>(); List errorList = new ArrayList<>(); result.put(\"txList\", errorList); String errorCode = null; CallContractTransaction callTx; for(Transaction tx : txs) { callTx = new CallContractTransaction(); callTx.copyTx(tx); try { Result validate = callContractTxValidator.validateV14(chainId, callTx); if(validate.isFailed()) { errorCode = validate.getErrorCode().getCode(); errorList.add(tx); } } catch (NulsException e) { Log.error(e); errorCode = e.getErrorCode().getCode(); errorList.add(tx); } } result.put(\"errorCode\", errorCode); return result; }", "tokens": 197} {"id": 449345, "source": "method", "repo": "nuls-io/nuls-v2", "text": "public double popDouble() { pop(); return (double) pop(); }", "tokens": 16} {"id": 449415, "source": "method", "repo": "nuls-io/nuls-v2", "text": "private static byte statisticsCtxState(Chain chain, int linkedChainId, NulsHash requestHash) { byte ctxState = CtxStateEnum.UNCONFIRM.getStatus(); try { int tryCount = 0; int linkedNode = NetWorkCall.getAvailableNodeAmount(linkedChainId, true); Map ctxStateMap = new HashMap<>(4); while (tryCount < NulsCrossChainConstant.BYZANTINE_TRY_COUNT) { for (Byte state : chain.getCtxStateMap().get(requestHash)) { if (ctxStateMap.containsKey(state)) { int count = ctxStateMap.get(state); count++; if (count >= linkedNode / 2) { return state; } } else { ctxStateMap.put(state, 1); } } if (chain.getCtxStateMap().get(requestHash).size() >= linkedNode) { break; } Thread.sleep(2000); tryCount++; } int maxCount = 0; for (Map.Entry entry : ctxStateMap.entrySet()) { int value = entry.getValue(); if (value > maxCount) { maxCount = value; ctxState = entry.getKey(); } } } catch (Exception e) { chain.getLogger().error(e); return ctxState; } finally { chain.getCtxStateMap().remove(requestHash); } return ctxState; }", "tokens": 307} {"id": 449676, "source": "method", "repo": "nuls-io/nuls-v2", "text": "public void setHasFlower(boolean hasFlower) { this.hasFlower = hasFlower; }", "tokens": 25} {"id": 449856, "source": "method", "repo": "nurtak/objectgraphvisualization", "text": "public ArrayList getAssociatedObjects(Endpoint classEndpoint) { ArrayList retList = new ArrayList(); ArrayList objectRelations = this.classObjectRelations.get(classEndpoint); if (objectRelations == null) { return retList; } for (Relation objectRelation : objectRelations) { ArrayList referencedObjects = this.objectReferences.get(objectRelation); if (referencedObjects == null) { continue; } retList.addAll(referencedObjects); } return retList; }", "tokens": 112} {"id": 449974, "source": "method", "repo": "nurtak/objectgraphvisualization", "text": "private void addButtonAccelerators() { if (this.createClass != null && this.createObject != null && this.deleteSelected != null) { Platform.runLater(() -> { this.primaryStage.getScene().getAccelerators().put(new KeyCodeCombination(KeyCode.C), () -> { if (!this.createClass.isDisable()) { this.createClass.requestFocus(); this.createClass.fire(); } }); this.primaryStage.getScene().getAccelerators().put(new KeyCodeCombination(KeyCode.O), () -> { if (!this.createObject.isDisable()) { this.createObject.fire(); } }); this.primaryStage.getScene().getAccelerators().put(new KeyCodeCombination(KeyCode.DELETE), () -> { if (!this.deleteSelected.isDisable()) { this.deleteSelected.fire(); } }); this.primaryStage.getScene().getAccelerators().put(new KeyCodeCombination(KeyCode.ESCAPE), () -> { if (this.relationCreationController.isInProcess()) { this.relationCreationController.abortProcess(); toggleToolbar(null); this.subSceneAdapter.getSubScene().setCursor(Cursor.DEFAULT); this.selectionController.setSelected(this.subSceneAdapter.getFloor(), true, this.subSceneAdapter); } else { exitObjectGraphMode(); } }); }); } }", "tokens": 281} {"id": 450177, "source": "method", "repo": "nurtak/objectgraphvisualization", "text": "public boolean isEnd(Endpoint endpoint) { if (end != null && end.equals(endpoint)) { return true; } return false; }", "tokens": 31} {"id": 450204, "source": "method", "repo": "nurtak/objectgraphvisualization", "text": "public static String getSimpleParsed(String multiString) { if (multiString.equals(\"0\")) { return null; } Matcher matcher = MUTLIP_PATTERN.matcher(multiString); if (matcher.matches()) { return multiString; } else { return null; } }", "tokens": 61} {"id": 450324, "source": "method", "repo": "nurtak/objectgraphvisualization", "text": "public Axis() { final PhongMaterial redMaterial = new PhongMaterial(); redMaterial.setDiffuseColor(getBrighterColor(Color.DARKRED)); redMaterial.setSpecularColor(getBrighterColor(Color.RED)); final PhongMaterial greenMaterial = new PhongMaterial(); greenMaterial.setDiffuseColor(getBrighterColor(Color.DARKGREEN)); greenMaterial.setSpecularColor(getBrighterColor(Color.GREEN)); final PhongMaterial blueMaterial = new PhongMaterial(); blueMaterial.setDiffuseColor(getBrighterColor(Color.DARKBLUE)); blueMaterial.setSpecularColor(getBrighterColor(Color.BLUE)); final Box xAxis = new Box(LENGTH, WIDTH, WIDTH); final Box yAxis = new Box(WIDTH, LENGTH, WIDTH); final Box zAxis = new Box(WIDTH, WIDTH, LENGTH); xAxis.setMaterial(redMaterial); yAxis.setMaterial(greenMaterial); zAxis.setMaterial(blueMaterial); getChildren().addAll(xAxis, yAxis, zAxis); }", "tokens": 241} {"id": 450368, "source": "method", "repo": "nurtak/objectgraphvisualization", "text": "public PaneBox() { this(DEFAULT_COLOR); }", "tokens": 13} {"id": 451156, "source": "method", "repo": "nyaacat/rpgitems-reloaded", "text": "public String getName() { return \"skyhook\"; }", "tokens": 12} {"id": 451247, "source": "method", "repo": "nyaacat/rpgitems-reloaded", "text": "public TReturn next(TReturn a, PowerResult b) { return null; }", "tokens": 22} {"id": 451308, "source": "method", "repo": "nyaacat/rpgitems-reloaded", "text": "public DataComponentType type() { return DataComponentTypes.CONSUMABLE; }", "tokens": 16} {"id": 451340, "source": "method", "repo": "nyaacat/rpgitems-reloaded", "text": "public Object decode(ConfigurationSection parent, @Nullable RPGItem rpgItem) { ConfigurationSection section = parent.getConfigurationSection(yamlKey()); if (section == null || section.getKeys(false).isEmpty()) { return null; } MapDecorations.Builder builder = MapDecorations.mapDecorations(); for (String id : section.getKeys(false)) { ConfigurationSection entry = section.getConfigurationSection(id); String typeValue = entry == null ? null : entry.getString(\"type\"); if (typeValue == null) { continue; } MapCursor.Type cursorType = RegistryAccess.registryAccess() .getRegistry(RegistryKey.MAP_DECORATION_TYPE).get(Key.key(typeValue)); if (cursorType == null) { continue; } double x = entry.getDouble(\"x\", 0); double z = entry.getDouble(\"z\", 0); float rotation = (float) entry.getDouble(\"rotation\", 0); builder.put(id, MapDecorations.decorationEntry(cursorType, x, z, rotation)); } return builder; }", "tokens": 222} {"id": 451404, "source": "method", "repo": "nyaacat/rpgitems-reloaded", "text": "void samePluginMayRegisterAgainAfterAReload() { // /rpgitem reload re-fires registration in a still-enabled extension; a fresh plugin instance with the // same name (ext/ layout) must also be able to take its own names back. FiringPoint first = FiringPoint.origin(new Location(world, 1, 0, 0)); FiringPoint second = FiringPoint.origin(new Location(world, 2, 0, 0)); FiringLocations.register(plugin(\"Ext\"), \"MINION\", c -> Optional.of(() -> Optional.of(first))); FiringLocations.register(plugin(\"Ext\"), \"MINION\", c -> Optional.of(() -> Optional.of(second))); assertEquals(2, FiringLocations.begin(FiringLocation.of(\"MINION\"), context).orElseThrow().first().location().getX()); }", "tokens": 191} {"id": 451427, "source": "method", "repo": "objectify/objectify", "text": "/** Call toUrlSafe() on the underlying Key. You can reconstitute a {@code Key} using the constructor that takes a string. Note that toString() is only useful for debugging; it cannot be used to create a key with Key.create(String). */ public String toUrlSafe() { return this.raw.toUrlSafe(); }", "tokens": 76} {"id": 451503, "source": "method", "repo": "objectify/objectify", "text": "public Future delete(final Iterable keys) { // Always trigger, even on failure - the delete might have succeeded even though a timeout // exception was thrown. We will always be safe emptying the key from the cache. return new TriggerFuture(this.raw.delete(keys)) { @Override protected void trigger() { empty(keys); } }; }", "tokens": 83} {"id": 451517, "source": "method", "repo": "objectify/objectify", "text": "/** Creates a memcache which caches everything without expiry and doesn't record statistics. */ public EntityMemcache(final MemcacheService memcache, final String namespace) { this(memcache, namespace, key -> 0); }", "tokens": 51} {"id": 451529, "source": "method", "repo": "objectify/objectify", "text": "/** @param preloaded is a collection of entities that have already been obtained, say from the memcache. TAKES OWNERSHIP OF THE MAP OBJECT - it will be modified later. @param pending is a future of entities that will be obtained sometime later, or null if merging is unnecessary and the preloaded values complete the result. */ public MergeFuture(Map preloaded, Future> pending) { assert preloaded != null; this.loaded = preloaded; this.pending = pending; }", "tokens": 120} {"id": 451626, "source": "method", "repo": "objectify/objectify", "text": "public Result keys(final Iterable> keys) { return ofy.factory().span(\"delete\", spanipulator -> { final List rawKeys = new ArrayList<>(); for (final Key key: keys) rawKeys.add(key.getRaw()); final Result result = ofy.createWriteEngine().delete(rawKeys); // The low level API is not async, so let's ensure work is finished in the span. result.now(); return result; }); }", "tokens": 120} {"id": 451651, "source": "method", "repo": "objectify/objectify", "text": "public If createIf(Class> ifClass, Field field) { If created = fact.construct(ifClass); if (created instanceof InitializeIf) ((InitializeIf)created).init(fact, field); return created; }", "tokens": 58} {"id": 451812, "source": "method", "repo": "objectify/objectify", "text": "public boolean contains(final Key key) { return map.containsKey(key); }", "tokens": 19} {"id": 451814, "source": "method", "repo": "objectify/objectify", "text": "public Result getResult() { return result; }", "tokens": 14} {"id": 451914, "source": "method", "repo": "objectify/objectify", "text": "private JodaTimeTranslators() { }", "tokens": 10} {"id": 451917, "source": "method", "repo": "objectify/objectify", "text": "/** Initialize this CaptureTypeImpl. This is needed for type variable bounds referring to each other: we need the capture of the argument. */ void init(VarMap varMap) { ArrayList upperBoundsList = new ArrayList<>(); upperBoundsList.addAll(Arrays.asList(varMap.map(variable.getBounds()))); List wildcardUpperBounds = Arrays.asList(wildcard.getUpperBounds()); if (wildcardUpperBounds.size() > 0 && wildcardUpperBounds.get(0) == Object.class) { // skip the Object bound, we already have a first upper bound from 'variable' upperBoundsList.addAll(wildcardUpperBounds.subList(1, wildcardUpperBounds.size())); } else { upperBoundsList.addAll(wildcardUpperBounds); } upperBounds = new Type[upperBoundsList.size()]; upperBoundsList.toArray(upperBounds); }", "tokens": 185} {"id": 451918, "source": "method", "repo": "objectify/objectify", "text": "public String toString() { return \"capture of \" + wildcard; }", "tokens": 15} {"id": 452264, "source": "method", "repo": "objectify/objectify", "text": "/** TODO: re-enable when EMULATOR supports aggregation queries */ void aggregateAvg() throws Exception { final double value = ofy().load().type(Trivial.class).avg(\"someNumber\"); assertThat(value).isEqualTo(1.5); }", "tokens": 55} {"id": 452363, "source": "method", "repo": "objectionary/eo", "text": "/** The content made from the source with this sha, if that is what is here. @param sha The sha of the source asked about @return The content, or empty when this slot holds something else @throws IOException If fails to read */ Optional of(final String sha) throws IOException { Optional result = Optional.empty(); try { final String text = Files.readString(this.file); final int split = text.indexOf(Slot.SPLIT); if (split > 0 && sha.equals(text.substring(0, split))) { result = Optional.of(text.substring(split + 1)); } } catch (final NoSuchFileException ignored) { result = Optional.empty(); } return result; }", "tokens": 156} {"id": 452421, "source": "method", "repo": "objectionary/eo", "text": "/** Ctor. @param bound What every application fills, from {@link Bound} @param holders What every void holds, from {@link Fillings} @param ends Every object of the program that terminates, from {@link Dead} @param vacant The voids nothing ever fills, from {@link Dispatched#empty(Map)}, empty where no arm may be struck */ Puts( final Map> bound, final Map> holders, final Collection ends, final Collection vacant ) { this.fills = bound; this.holds = holders; this.dead = ends; this.empty = vacant; }", "tokens": 162} {"id": 452510, "source": "method", "repo": "objectionary/eo", "text": "public String toString() { final String ret; if (this.dependency.getClassifier() == null || this.dependency.getClassifier().isEmpty()) { ret = String.format( \"%s:%s:%s\", this.dependency.getGroupId(), this.dependency.getArtifactId(), this.dependency.getVersion() ); } else { ret = String.format( \"%s:%s:%s:%s\", this.dependency.getGroupId(), this.dependency.getArtifactId(), this.dependency.getClassifier(), this.dependency.getVersion() ); } return ret; }", "tokens": 115} {"id": 452899, "source": "method", "repo": "objectionary/eo", "text": "void pushesFormationOntoEmptyStack() { final Stack stack = new Stack(); new LnFormation(new Span(\"[] > foo\", 1)) .into(stack, new Globals(), new Emit()); MatcherAssert.assertThat( \"a top-level formation must push a BARE_FORMATION level at indent 0\", stack.top().kind(), Matchers.equalTo(Kind.BARE_FORMATION) ); }", "tokens": 92} {"id": 453041, "source": "method", "repo": "objectionary/eo", "text": "/** Ctor. */ public EOwin32$EOwsa_cleanup() { super(new Attrs()); }", "tokens": 26} {"id": 453229, "source": "method", "repo": "ochotonida/artifacts", "text": "public static void register(Item item, Supplier rendererFactory) { EquipmentRenderingManager.registerArtifactRenderer(item, rendererFactory); }", "tokens": 33} {"id": 453258, "source": "method", "repo": "ochotonida/artifacts", "text": "public static MeshDefinition createPendant() { CubeListBuilder body = CubeListBuilder.create(); // gem body.texOffs(50, 0); body.addBox(-1, 4.5F, -5, 2, 2, 1); return createNecklace(body); }", "tokens": 64} {"id": 453306, "source": "method", "repo": "ochotonida/artifacts", "text": "protected GloveArtifactRenderer( Identifier wideTexture, Identifier slimTexture, @Nullable Identifier wideGlowTexture, @Nullable Identifier slimGlowTexture, ArmsModelSet> models ) { this.wideTexture = wideTexture; this.slimTexture = slimTexture; this.wideGlowTexture = wideGlowTexture; this.slimGlowTexture = slimGlowTexture; this.models = models; }", "tokens": 92} {"id": 453341, "source": "method", "repo": "ochotonida/artifacts", "text": "public Iterable extractEntries(@Nullable T component) { return Collections.singleton(component); }", "tokens": 22} {"id": 453642, "source": "method", "repo": "ochotonida/artifacts", "text": "protected SoundEvent getJumpingSound() { return ModSoundEvents.MIMIC_OPEN.value(); }", "tokens": 23} {"id": 453723, "source": "method", "repo": "ochotonida/artifacts", "text": "public T reduceEquipment(LivingEntity entity, T init, BiFunction f) { for (TrinketInventory inventory : TrinketsApi.getAttachment(entity).getInventories().values()) { if (inventory.slotType().isVanityOnly()) { continue; } for (int slot = 0; slot < inventory.getContainerSize(); slot++) { ItemStack item = inventory.getItem(slot); if (!item.isEmpty()) { EquipmentSlotAccess slotAccess = new SlotAccess(entity, inventory.getOrCreateSlotAccess(slot)); init = f.apply(slotAccess, init); } } } return init; }", "tokens": 137} {"id": 453851, "source": "method", "repo": "ochotonida/artifacts", "text": "public void queue(Runnable runnable) { workQueue.accept(runnable); }", "tokens": 17} {"id": 453931, "source": "method", "repo": "ochotonida/artifacts", "text": "private void placeFurnace(CampsiteFeatureConfiguration config, WorldGenLevel level, BlockPos pos, RandomSource random, Direction facing) { BlockState furnace = config.furnaces().getState(level, random, pos); furnace = furnace.setValue(FurnaceBlock.FACING, facing); setBlock(level, pos, furnace); if (random.nextBoolean()) { setBlock(level, pos.above(), config.furnaceChimneys().getState(level, random, pos)); } }", "tokens": 105} {"id": 454221, "source": "method", "repo": "ocr4all/larex", "text": "public static Candidate calcBottomRect(Collection candidates, int minSize) { Candidate bottomCandidate = null; int bottomPixelY = -1; for (Candidate candidate : candidates) { Rect rect = candidate.getBoundingRect(); if (rect.area() > minSize && rect.tl().y > bottomPixelY) { bottomPixelY = (int) rect.tl().y; bottomCandidate = candidate; } } return bottomCandidate; }", "tokens": 97} {"id": 454260, "source": "method", "repo": "ocr4all/larex", "text": "public Map getPages() { return pages; }", "tokens": 16} {"id": 454324, "source": "method", "repo": "ocr4all/larex", "text": "public List batchSegment(@RequestBody BatchSegmentationRequest batchSegmentationRequest) { FileDatabase database = new FileDatabase(new File(fileManager.getLocalBooksPath()), config.getListSetting(\"imagefilter\"), fileManager.checkFlat()); List results = new ArrayList<>(); this.segProgress = 0; for(int page: batchSegmentationRequest.getPages().keySet()){ PageAnnotations result = LarexFacade.segmentPage(batchSegmentationRequest.getSettings(), page, batchSegmentationRequest.getPages().get(page), fileManager, database); results.add(result); this.segProgress++; } return results; }", "tokens": 133} {"id": 454368, "source": "method", "repo": "ocr4all/larex", "text": "/** Read contents of a book from the folder structure. @param bookName name of book @param imagemap map of all book images @param bookID Identifier that is to be used for the loaded book @return */ private Book readBook(String bookName, Map> imagemap, Map xmlMap, int bookID) { try { LinkedList pages = new LinkedList(); int pageCounter = 0; for (Entry> imgEntry : imagemap.entrySet()) { File imageFile = new File(imgEntry.getValue().get(0)); Size imageSize = ImageLoader.readDimensions(imageFile); String name = removeAllExtensions(imageFile.getName()); String xmlName = (new File(xmlMap.get(imgEntry.getKey()))).getName(); if (isSupportedImage(imageFile)) { pages.add(new Page(pageCounter++, name, xmlName, imgEntry.getValue(), (int) imageSize.width, (int) imageSize.height)); } } return new Book(bookID, bookName, pages); } catch (Exception e) { e.printStackTrace(); return null; } }", "tokens": 256} {"id": 454409, "source": "method", "repo": "ocr4all/larex", "text": "/** Get a pageXML document out of a page @param result @param pageXMLVersion @return pageXML document or null if parse error @throws UnsupportedFormatVersionException @throws InvalidIdException */ public static Document getPageXML(PageAnnotations result, String pageXMLVersion, File xmlFile) throws UnsupportedFormatVersionException, InvalidIdException { XmlFormatVersion version = new XmlFormatVersion(pageXMLVersion); boolean xmlExists = xmlFile.exists() && !xmlFile.isDirectory(); Page page = xmlExists ? editExistingPageXML(result, version, xmlFile) : createNewPageXML(result, version); // Write as Document ByteArrayOutputStream os = new ByteArrayOutputStream(); PageXmlInputOutput.getWriter(version).write(page, new StreamTarget(os)); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); try { return factory.newDocumentBuilder().parse(new ByteArrayInputStream(os.toByteArray())); } catch (SAXException | IOException | ParserConfigurationException e) { e.printStackTrace(); return null; } }", "tokens": 217} {"id": 454417, "source": "method", "repo": "ocr4all/larex", "text": "/** Retrieves all textlines of a given TextRegion @param textRegion @return */ private static Map getTextLines(TextRegion textRegion){ Map physicalTextLines = new HashMap<>(); for(int i = 0; i < textRegion.getTextObjectCount(); i++){ TextObject textObject = textRegion.getTextObject(i); if(textObject instanceof TextLine) { TextLine _textLine = (TextLine) textObject; String _id = _textLine.getId().toString(); physicalTextLines.put(_id, _textLine); } } return physicalTextLines; }", "tokens": 140} {"id": 454440, "source": "method", "repo": "ocr4all/larex", "text": "public Element( @JsonProperty(\"id\") String id, @JsonProperty(\"coords\") Polygon coords, @JsonProperty(\"parent\") String parent) { this.id = id; this.coords = coords; this.parent = parent; }", "tokens": 51} {"id": 454490, "source": "method", "repo": "ocr4all/larex", "text": "/** Create a Larex RegionSegment from this polygon @return */ public RegionSegment toRegionSegment() { LinkedList points = new LinkedList(); for (Point segmentPoint : this.coords.getPoints()) { points.add(new org.opencv.core.Point(segmentPoint.getX(), segmentPoint.getY())); } final MatOfPoint resultPoints = new MatOfPoint(); resultPoints.fromList(points); return new RegionSegment(TypeConverter.stringToPAGEType(this.getType()), resultPoints, this.getId()); }", "tokens": 126} {"id": 454508, "source": "method", "repo": "ocr4all/ocr4all", "text": "/** Returns the finish time. @return The finish time. @since 1.8 */ public Date getFinish() { return finish; }", "tokens": 30} {"id": 454555, "source": "method", "repo": "ocr4all/ocr4all", "text": "/** Creates a batch workflow details. @param batch The batch workflow. @since 1.8 */ public BatchWorkflowDetail(BatchWorkflow batch) { super(); process = new BatchWorkflowOverview(batch); configuration = batch.getConfiguration(); }", "tokens": 49} {"id": 454808, "source": "method", "repo": "ocr4all/ocr4all", "text": "/** Creates an Arraylist of RegionRefIndexed objects from an xml element The RegionRefindex represents the reading order of the different textregions @param orderedGroup extracted XML node @return Arraylist of RegionRefIndexed */ private static ArrayList extractRegionRef(Element unorderedGroup) { ArrayList regionRefIndices = new ArrayList(); NodeList rriNodes = unorderedGroup.getElementsByTagName(\"RegionRef\"); for (int i = 0; i < rriNodes.getLength(); i++) { Element rriElement = (Element) rriNodes.item(i); String regionRef = rriElement.getAttribute(\"regionRef\"); RegionRefIndexed rri = new RegionRefIndexed(\"\"+i, regionRef); regionRefIndices.add(rri); } return regionRefIndices; }", "tokens": 183} {"id": 455017, "source": "method", "repo": "oculix-org/Oculix", "text": "protected static int name2type(String name){ for(int i = 0; i < names.length; i++){ if(Util.byte2str(names[i]).equals(name)){ return i + 1; } } return UNKNOWN; }", "tokens": 56} {"id": 455173, "source": "method", "repo": "oculix-org/Oculix", "text": "public Region newRegion(Location loc, int width, int height) { return new Region(loc.x, loc.y, width, height, this); }", "tokens": 35} {"id": 455385, "source": "method", "repo": "oculix-org/Oculix", "text": "/** finds the given Pattern, String or Image in the region and returns the best match. @param Pattern, String or Image @param target what (PSI) to find @return If found, the element. null otherwise @throws FindFailed if the Find operation failed */ public Match find(PSI target) throws FindFailed { lastMatch = null; Image img = Element.getImageFromTarget(target); Boolean response = true; if (!img.isText() && !img.isValid() && img.hasIOException()) { response = handleImageMissing(img, false); //find() if (response == null) { if (Settings.SwitchToText) { log(logLevel, \"find: image missing: switching to text search (deprecated - use text methods)\"); response = true; img.setIsText(true); target = (PSI) (\"\\t\" + target + \"\\t\"); } else { throw new RuntimeException(String.format(\"SikuliX: find: ImageMissing: %s\", target)); } } } String targetStr = img.getName(); while (null != response && response) { log(logLevel, \"find: waiting 0 secs for %s to appear in %s\", targetStr, this.toStringShort()); lastMatch = doFind(target, img, null); if (lastMatch != null) { if (isOtherScreen()) { lastMatch.setOtherScreen(); } else if (img != null) { img.setLastSeenAndPersist(lastMatch.getRect(), lastMatch.getScore()); } log(logLevel, \"find: %s appeared (%s)\", targetStr, lastMatch); break; } log(logLevel, \"find: %s did not appear [%d msec]\", targetStr, new Date().getTime() - lastFindTime); if (null == lastMatch) { response = handleFindFailed(target, img); } } if (null == response) { throw new FindFailed(FindFailed.createErrorMessage(this, img)); } return lastMatch; }", "tokens": 432} {"id": 455401, "source": "method", "repo": "oculix-org/Oculix", "text": "/** the event is removed from the list @param name event's name @return the named event if happened otherwise null */ public ObserveEvent getEvent(String name) { return Observing.getEvent(name); }", "tokens": 47} {"id": 455407, "source": "method", "repo": "oculix-org/Oculix", "text": "/** press and hold the given key use a constant from java.awt.event.KeyEvent which might be special in the current machine/system environment @param keycode Java KeyCode */ public void keyDown(int keycode) { getRobotForRegion().keyDown(keycode); }", "tokens": 60} {"id": 455650, "source": "method", "repo": "oculix-org/Oculix", "text": "public void componentResized(ComponentEvent e) { autoResize(); }", "tokens": 16} {"id": 456101, "source": "method", "repo": "oculix-org/SikuliX1", "text": "/** @param key respective key specifier according class Key @param modifiers respective key specifier according class KeyModifiers @param listener a HotKeyListener instance @return true if ok, false otherwise @deprecated use Key. ... instead */ public static boolean addHotkey(String key, int modifiers, HotkeyListener listener) { return Key.addHotkey(key, modifiers, listener); }", "tokens": 77} {"id": 456145, "source": "method", "repo": "oculix-org/SikuliX1", "text": "/** get the specified row counting from 0, if rows or raster are setup
negative counts reverse from the end (last = -1)
values outside range are 0 or last respectively @param r row number @return the row as new image or the image itself, if no rows are setup */ public Image getRow(int r) { if (rows == 0) { return this; } if (r < 0) { r = rows + r; } r = Math.max(0, r); r = Math.min(r, rows - 1); return getSub(0, r * rowH, getSize().width, rowH); }", "tokens": 146} {"id": 456172, "source": "method", "repo": "oculix-org/SikuliX1", "text": "/** New point with same offset to current screen's top left on given screen @param screen new parent screen @return new location */ public Location copyTo(IScreen screen) { IScreen s = getScreen(); s = (s == null ? Screen.getPrimaryScreen() : s); Location o = new Location(s.getBounds().getLocation()); Location n = new Location(screen.getBounds().getLocation()); return new Location(n.x + x - o.x, n.y + y - o.y); }", "tokens": 112} {"id": 456268, "source": "method", "repo": "oculix-org/SikuliX1", "text": "/** move the mouse pointer to the given target location
and move the wheel the given steps in the given direction:
Button.WHEEL_DOWN, Button.WHEEL_UP @param Pattern, Filename, Text, Region, Match or Location target @param target Pattern, Filename, Text, Region, Match or Location @param direction to move the wheel @param steps the number of steps @return 1 if possible, 0 otherwise @throws FindFailed if the Find operation failed */ public int wheel(PFRML target, int direction, int steps) throws FindFailed { return wheel(target, direction, steps, Mouse.WHEEL_STEP_DELAY); }", "tokens": 155} {"id": 456374, "source": "method", "repo": "oculix-org/SikuliX1", "text": "Dimension getDialogSize() { return new Dimension(maxW, maxH); }", "tokens": 18} {"id": 456484, "source": "method", "repo": "oculix-org/SikuliX1", "text": "private void init() { setIcon(new ImageIcon(thumbnail)); setButtonText(); setMargin(new Insets(0, 0, 0, 0)); setBorderPainted(true); setCursor(new Cursor(Cursor.HAND_CURSOR)); addActionListener(this); addMouseListener(this); }", "tokens": 64} {"id": 456488, "source": "method", "repo": "oculix-org/SikuliX1", "text": "public static void renameImage(String name, Map options) { Commons.error(\"N/A: EditorImageButton::renameImage (%s -> %s)\", options.get(\"image\"), name); // rename image file // replace image name usage in script // thumbnails off/on }", "tokens": 65} {"id": 456544, "source": "method", "repo": "oculix-org/SikuliX1", "text": "private void autoResize() { _width = getWidth(); if (_width == 0) { _width = (int) getPreferredSize().getWidth(); } _height = (int) ((double) _width / _ratio); _scale = (double) _height / _simg.getRect().height; setPreferredSize(new Dimension(_width, _height)); repaint(); revalidate(); }", "tokens": 94} {"id": 456629, "source": "method", "repo": "oculix-org/SikuliX1", "text": "private String getRunningJar(Class clazz) { String jarName = \"\"; CodeSource codeSrc = clazz.getProtectionDomain().getCodeSource(); if (codeSrc != null && codeSrc.getLocation() != null) { try { jarName = codeSrc.getLocation().getPath(); jarName = URLDecoder.decode(jarName, \"utf8\"); } catch (UnsupportedEncodingException e) { log(\"URLDecoder: not possible: \" + jarName); jarName = \"\"; } } return jarName; }", "tokens": 103} {"id": 456717, "source": "method", "repo": "oculix-org/SikuliX1", "text": "protected TokenRule createTokenRule( Pattern pattern, List tokenTypes, Grammar grammar ) throws ResolutionException { return new TokenRule( pattern, tokenTypes, grammar.resolveStates( nextStateNames ) ); }", "tokens": 50} {"id": 456788, "source": "method", "repo": "oddlama/vane", "text": "private void abort(CommandSender sender) { autostop.abort(sender); }", "tokens": 17} {"id": 456815, "source": "method", "repo": "oddlama/vane", "text": "public BedtimeBlueMapLayerDelegate(final BedtimeBlueMapLayer parent) { this.parent = parent; }", "tokens": 25} {"id": 456822, "source": "method", "repo": "oddlama/vane", "text": "public void remove_marker(final String marker_id) { if (!dynmap_enabled || marker_id == null) { return; } remove_marker(marker_set.findMarker(marker_id)); }", "tokens": 47} {"id": 456971, "source": "method", "repo": "oddlama/vane", "text": "public List tables() { return tables; }", "tokens": 14} {"id": 457019, "source": "method", "repo": "oddlama/vane", "text": "/** Determines if this enchantment can be obtained with the enchanting table. Always reflects the annotation value {@link VaneEnchantment#treasure()}. */ public final boolean is_treasure() { return annotation.treasure(); }", "tokens": 50} {"id": 457031, "source": "method", "repo": "oddlama/vane", "text": "public boolean enabled() { // Explicitly stated to not be forgotten, as enabled() is also part of // Listener. return annotation.enabled() && super.enabled(); }", "tokens": 41} {"id": 457363, "source": "method", "repo": "oddlama/vane", "text": "public boolean isInvisible() { return true; }", "tokens": 11} {"id": 457436, "source": "method", "repo": "oddlama/vane", "text": "public File get_data_folder() { return data_dir; }", "tokens": 16} {"id": 457632, "source": "method", "repo": "oddlama/vane", "text": "public long get_ping() { return player.getPing(); }", "tokens": 15} {"id": 457669, "source": "method", "repo": "odota/parser", "text": "private boolean isRadiant(int playerSlot) { return playerSlot < 128; }", "tokens": 22} {"id": 458043, "source": "method", "repo": "omega-r/omegarecyclerview", "text": "public void setHeaders(@NonNull List list) { mHeaderArray = new SparseArray<>(); mHeaderArrayCopy = new SparseArray<>(); for (View view : list) { int key = BASE_HEADER_VIEW_TYPE + list.indexOf(view); mHeaderArray.append(key, view); mHeaderArrayCopy.append(key, view); } notifyDataSetChanged(); }", "tokens": 85} {"id": 458169, "source": "method", "repo": "omega-r/omegarecyclerview", "text": "public void onItemRangeChanged(int positionStart, int itemCount) { notifyItemRangeChanged(positionStart, itemCount); }", "tokens": 25} {"id": 458557, "source": "method", "repo": "omega-r/omegarecyclerview", "text": "private List> convertFrom(GroupProvider[] groupProviders) { return convertFrom(Arrays.asList(groupProviders)); }", "tokens": 41} {"id": 458652, "source": "method", "repo": "omega-r/omegarecyclerview", "text": "protected boolean isNeedAddingDelay() { return false; }", "tokens": 13} {"id": 458899, "source": "method", "repo": "omnilaboratory/obandroid", "text": "/** Sets the color that is used for drawing the highlight indicators. Dont forget to resolve the color using getResources().getColor(...) or Color.rgb(...). @param color */ public void setHighLightColor(int color) { mHighLightColor = color; }", "tokens": 57} {"id": 458951, "source": "method", "repo": "omnilaboratory/obandroid", "text": "/** resets the circle-colors array and creates a new one */ public void resetCircleColors() { if (mCircleColors == null) { mCircleColors = new ArrayList(); } mCircleColors.clear(); }", "tokens": 48} {"id": 459078, "source": "method", "repo": "omnilaboratory/obandroid", "text": "public void shutdown() throws InterruptedException { channel.shutdown().awaitTermination(5, TimeUnit.SECONDS); }", "tokens": 22} {"id": 459262, "source": "method", "repo": "omnilaboratory/obandroid", "text": "/** Register a callback to be invoked when the checked radio button changes in this group. @param listener the callback to call on checked state change */ public void setOnCheckedChangeListener(OnCheckedChangeListener listener) { mOnCheckedChangeListener = listener; }", "tokens": 48} {"id": 459327, "source": "method", "repo": "omnilaboratory/obandroid", "text": "public void onFinish() { cancelToast(); }", "tokens": 11} {"id": 459465, "source": "method", "repo": "oneuiproject/oneui-core", "text": "public void setCustomView(View view) { mContextView.setCustomView(view); mCustomView = view != null ? new WeakReference(view) : null; }", "tokens": 39} {"id": 459484, "source": "method", "repo": "oneuiproject/oneui-core", "text": "public boolean expandItemActionView(MenuItemImpl item) { if (mPresenters.isEmpty()) return false; boolean expanded = false; stopDispatchingItemsChanged(); for (WeakReference ref : mPresenters) { final MenuPresenter presenter = ref.get(); if (presenter == null) { mPresenters.remove(ref); } else if ((expanded = presenter.expandItemActionView(this, item))) { break; } } startDispatchingItemsChanged(); if (expanded) { mExpandedItem = item; } return expanded; }", "tokens": 118} {"id": 459632, "source": "method", "repo": "oneuiproject/oneui-core", "text": "/** Like {@link #noteOp} but instead of throwing a {@link SecurityException} it returns {@link #MODE_ERRORED}.

Compatibility

  • On API 18 and lower, this method always returns {@link #MODE_IGNORED}
*/ public static int noteOpNoThrow(@NonNull Context context, @NonNull String op, int uid, @NonNull String packageName) { if (SDK_INT >= 19) { AppOpsManager appOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); return appOpsManager.noteOpNoThrow(op, uid, packageName); } else { return MODE_IGNORED; } }", "tokens": 158} {"id": 459713, "source": "method", "repo": "oneuiproject/oneui-core", "text": "/** Searches this {@link LocaleListCompat} for the specified {@link Locale} and returns the index of the first occurrence. @param locale The {@link Locale} to search for. @return The index of the first occurrence of the {@link Locale} or {@code -1} if the item wasn't found */ public int indexOf(Locale locale) { return mImpl.indexOf(locale); }", "tokens": 87} {"id": 459825, "source": "method", "repo": "oneuiproject/oneui-core", "text": "/** Calls SolarLunarConverter.convertLunarToSolar(int, int, int, boolean). */ public static void convertLunarToSolar(PathClassLoader pathClassLoader, @NonNull Object solarLunarConverter, int y, int m, int d, boolean isLeapMonth) { Method method = SeslPathClassReflector.getMethod(pathClassLoader, mClassName, \"convertLunarToSolar\", Integer.TYPE, Integer.TYPE, Integer.TYPE, Boolean.TYPE); if (method != null) { SeslBaseReflector.invoke(solarLunarConverter, method, y, m, d, isLeapMonth); } }", "tokens": 143} {"id": 459920, "source": "method", "repo": "oneuiproject/oneui-core", "text": "/** @return the top expanded title margin in pixels @see #setExpandedTitleMarginTop(int) @attr ref com.google.android.material.R.styleable#CollapsingToolbarLayout_expandedTitleMarginTop */ public int getExpandedTitleMarginTop() { return expandedMarginTop; }", "tokens": 64} {"id": 459983, "source": "method", "repo": "oneuiproject/oneui-core", "text": "/** Returns this chip's corner radius. @see #setChipCornerRadius(float) @attr ref com.google.android.material.R.styleable#Chip_chipCornerRadius */ public float getChipCornerRadius() { return isShapeThemingEnabled ? getTopLeftCornerResolvedSize() : chipCornerRadius; }", "tokens": 66} {"id": 460007, "source": "method", "repo": "oneuiproject/oneui-core", "text": "public MaterialAlertDialogBuilder setOnKeyListener(@Nullable OnKeyListener onKeyListener) { return (MaterialAlertDialogBuilder) super.setOnKeyListener(onKeyListener); }", "tokens": 36} {"id": 460187, "source": "method", "repo": "oneuiproject/oneui-core", "text": "static float lerp( float startValue, float endValue, @FloatRange(from = 0.0, to = 1.0) float startFraction, @FloatRange(from = 0.0, to = 1.0) float endFraction, @FloatRange(from = 0.0, to = 1.0) float fraction) { return lerp( startValue, endValue, startFraction, endFraction, fraction, /* allowOvershoot= */ false); }", "tokens": 107} {"id": 460534, "source": "method", "repo": "oneuiproject/oneui-design", "text": "public void addView(View child, int index, ViewGroup.LayoutParams params) { if (mSBLContainer == null) { super.addView(child, index, params); } else { if (((ToolbarLayoutParams) params).layout_location == MAIN_CONTENT) { mSBLContainer.addView(child, params); } else { super.addView(child, index, params); } } }", "tokens": 88} {"id": 460870, "source": "method", "repo": "oneuiproject/oneui-design", "text": "public void onClick(View v) { long uptimeMillis = SystemClock.uptimeMillis(); if (uptimeMillis - mLastClickTime > 600L) { String url = null; if (v.getId() == mBinding.aboutHeaderGithub.getId()) { url = \"https://github.com/OneUIProject/oneui-design\"; } else if (v.getId() == mBinding.aboutHeaderTelegram.getId()) { url = \"https://t.me/oneuiproject\"; } else if (v.getId() == mBottomContent.aboutBottomDevYann.getId()) { url = \"https://github.com/Yanndroid\"; } else if (v.getId() == mBottomContent.aboutBottomDevMesa.getId()) { url = \"https://github.com/BlackMesa123\"; } else if (v.getId() == mBottomContent.aboutBottomOssApache.getId()) { url = \"https://www.apache.org/licenses/LICENSE-2.0.txt\"; } else if (v.getId() == mBottomContent.aboutBottomOssMit.getId()) { url = \"https://github.com/OneUIProject/sesl/blob/main/LICENSE\"; } else if (v.getId() == mBottomContent.aboutBottomRelativeJetpack.getId()) { url = \"https://developer.android.com/jetpack\"; } else if (v.getId() == mBottomContent.aboutBottomRelativeMaterial.getId()) { url = \"https://material.io/develop/android\"; } else if (v.getId() == mBottomContent.aboutBottomRelativeOuip.getId()) { url = \"https://github.com/OneUIProject\"; } if (url != null) { try { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(url)); startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText( this, \"No suitable activity found\", Toast.LENGTH_SHORT).show(); } } } mLastClickTime = uptimeMillis; }", "tokens": 460} {"id": 460888, "source": "method", "repo": "oneuiproject/oneui-design", "text": "public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); }", "tokens": 24} {"id": 460901, "source": "method", "repo": "oneuiproject/oneui-design", "text": "private void checkAllAppsToggle() { mIsAllAppsSelected = true; for (boolean selected : mItems) { if (!selected) { mIsAllAppsSelected = false; break; } } mAppPickerView.refreshUI(0); }", "tokens": 51} {"id": 461052, "source": "method", "repo": "opacapp/opacclient", "text": "private void addFormData(String k, String v) { formData.add(new String[] {k, v}); }", "tokens": 26} {"id": 461116, "source": "method", "repo": "opacapp/opacclient", "text": "public CompletableFuture asyncPost(String url, RequestBody data, final boolean ignore_errors) { Request request = new Request.Builder() .url(cleanUrl(url)) .header(\"Accept\", \"*/*\") .header(\"User-Agent\", getUserAgent()) .post(data) .build(); return adapt(http_client.newCall(request), ignore_errors); }", "tokens": 88} {"id": 461120, "source": "method", "repo": "opacapp/opacclient", "text": "public final ReservationResult reservation(DetailedItem item, Account account, int useraction, String selection) throws IOException { return null; }", "tokens": 29} {"id": 461194, "source": "method", "repo": "opacapp/opacclient", "text": "public SearchRequestResult searchGetPage(int page) throws IOException, OpacErrorException, JSONException { if (searchQuery == null) { throw new OpacApi.OpacErrorException(\"Internal Error\"); } JSONObject sr = fetchSearchResults(searchQuery, page); return ParseSearchResults(sr); }", "tokens": 61} {"id": 461414, "source": "method", "repo": "opacapp/opacclient", "text": "private SearchField processMeaning(SearchField field, String meaningName) { Meaning meaning = Meaning.valueOf(meaningName); SearchField oldfield = field; if (field instanceof TextSearchField && meaning == Meaning.FREE) { ((TextSearchField) field).setFreeSearch(true); ((TextSearchField) field).setHint(field.getDisplayName()); } else if (field instanceof TextSearchField && (meaning == Meaning.BARCODE || meaning == Meaning.ISBN)) { field = new BarcodeSearchField(field.getId(), field.getDisplayName(), field.isAdvanced(), ((TextSearchField) field).isHalfWidth(), ((TextSearchField) field).getHint()); } else if (meaning == Meaning.AUDIENCE || meaning == Meaning.SYSTEM || meaning == Meaning.KEYWORD || meaning == Meaning.PUBLISHER) { field.setAdvanced(true); } field.setData(oldfield.getData()); field.setMeaning(meaning); return field; }", "tokens": 226} {"id": 461452, "source": "method", "repo": "opacapp/opacclient", "text": "public void testParseCopyReturn() throws Exception { assert Objects.equals(Littera.parseCopyReturn(\"1 (voraussichtl. bis 31.07.2015)\"), new LocalDate(2015, 7, 31)); }", "tokens": 64} {"id": 461604, "source": "method", "repo": "opacapp/opacclient", "text": "protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); setSupportProgressBarIndeterminateVisibility(false); if (hasDrawer) { drawerToggle.syncState(); } }", "tokens": 43} {"id": 461671, "source": "method", "repo": "opacapp/opacclient", "text": "protected void onPreExecute() { setProgressBarIndeterminateVisibility(true); }", "tokens": 16} {"id": 461923, "source": "method", "repo": "openatx/android-uiautomator-server", "text": "/** Performs a click at the center of the visible bounds of the UI element represented by this UiObject and waits for window transitions. This method differ from click() only in that this method waits for a a new window transition as a result of the click. Some examples of a window transition: - launching a new activity - bringing up a pop-up menu - bringing up a dialog @param obj the target ui object. @param timeout timeout before giving up on waiting for a new window @return true if the event was triggered, else false @throws UiObjectNotFoundException */ public boolean clickAndWaitForNewWindow(Selector obj, long timeout) throws UiObjectNotFoundException { if (obj.toUiObject2() == null) { return device.findObject(obj.toUiSelector()).clickAndWaitForNewWindow(timeout); } else { return obj.toUiObject2().clickAndWait(Until.newWindow(), timeout); } }", "tokens": 194} {"id": 462037, "source": "method", "repo": "openatx/android-uiautomator-server", "text": "public Rect getBounds() { return _bounds; }", "tokens": 13} {"id": 462059, "source": "method", "repo": "openatx/android-uiautomator-server", "text": "public boolean isFocusable() { return _focusable; }", "tokens": 15} {"id": 462201, "source": "method", "repo": "openatx/android-uiautomator-server", "text": "public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); Permissons4App.handleRequestPermissionsResult(requestCode, permissions, grantResults); }", "tokens": 54} {"id": 462226, "source": "method", "repo": "openatx/android-uiautomator-server", "text": "private Response handlePutScreenrecord() throws Exception { this.recording = false; return newFixedLengthResponse(\"OK\"); }", "tokens": 26} {"id": 462297, "source": "method", "repo": "openatx/android-uiautomator-server", "text": "public void newCall(Request request, Callback callback){ client.newCall(request).enqueue(callback); }", "tokens": 24} {"id": 462485, "source": "method", "repo": "opencollab-incubator/Boar", "text": "private void updateChunkExemption(long chunkPosition, int chunkX, int chunkZ) { if (this.isOutOfRadius(chunkX << 4, chunkZ << 4)) { this.exemptedChunks.add(chunkPosition); } else { this.exemptedChunks.remove(chunkPosition); } }", "tokens": 65} {"id": 462678, "source": "method", "repo": "opencollab-incubator/Boar", "text": "public int fromRawBlockId(int id) { return this.mappingInfo.toIntermediary().applyAsInt(id); }", "tokens": 29} {"id": 462715, "source": "method", "repo": "opencollab-incubator/Boar", "text": "private boolean updateFluidHeightAndDoFluidPushing(final float speed, final Fluid tag) { if (player.isRegionUnloaded()) { return false; } Box box = player.boundingBox.expand(0, -0.4F, 0).contract(0.001F); if (tag == Fluid.LAVA) { box = box.contract(0.1F, 0, 0.1F); } int i = GenericMath.floor(box.minX); int j = GenericMath.floor(box.maxX + 1.0D); int k = GenericMath.floor(box.minY); int l = GenericMath.floor(box.maxY + 1.0D); int i1 = GenericMath.floor(box.minZ); int j1 = GenericMath.floor(box.maxZ + 1.0D); boolean found = false; Vec3 vec3 = new Vec3(0, 0, 0); float maxFluidHeight = Float.MIN_VALUE; Mutable mutable = new Mutable(); for (int k1 = i; k1 < j; ++k1) { for (int l1 = k; l1 < l; ++l1) { for (int i2 = i1; i2 < j1; ++i2) { mutable.set(k1, l1, i2); FluidState fluidState = player.compensatedWorld.getFluidState(mutable); if (fluidState.fluid() == tag) { float d0 = l1 + 1 - fluidState.height(); maxFluidHeight = Math.max(maxFluidHeight, d0); if (l >= d0) { found = true; vec3 = vec3.add(fluidState.getFlow(player, Vector3i.from(k1, l1, i2))); } } }}} if (!found) { maxFluidHeight = 0; } if (vec3.lengthSquared() > 0.0D) { vec3 = vec3.normalize().multiply(speed); player.velocity = player.velocity.add(vec3); } if (tag == Fluid.LAVA) { player.beingPushByLava = vec3.horizontalLengthSquared() > 1.0E-6; } player.fluidHeight.put(tag, maxFluidHeight); return found; }", "tokens": 506} {"id": 462768, "source": "method", "repo": "opencollab-incubator/Boar", "text": "public static long chunkPositionToLong(int x, int z) { return (x & 0xFFFFFFFFL) | ((z & 0xFFFFFFFFL) << 32L); }", "tokens": 41} {"id": 462845, "source": "method", "repo": "opencollab-incubator/Boar", "text": "public Box expand(float x, float y, float z) { float d = this.minX - x; float e = this.minY - y; float f = this.minZ - z; float g = this.maxX + x; float h = this.maxY + y; float i = this.maxZ + z; return new Box(d, e, f, g, h, i); }", "tokens": 87} {"id": 463048, "source": "method", "repo": "opencollab-incubator/Boar", "text": "public List getDoorBlocks() { return Collections.unmodifiableList(doorBlocks); }", "tokens": 20} {"id": 463149, "source": "method", "repo": "opencryptoproject/jcmathlib", "text": "/** Test equality with zero. */ public boolean isZero() { for (short i = offset; i < value.length; i++) { if (value[i] != 0) { return false; // CTO } } return true; }", "tokens": 53} {"id": 463365, "source": "method", "repo": "opencubicchunks/cubicchunks", "text": "public static long packUnsignedToLong(int unsigned, int size, int offset) { // same as signed return packSignedToLong(unsigned, size, offset); }", "tokens": 34} {"id": 463794, "source": "method", "repo": "opencubicchunks/cubicchunks", "text": "private static Optional getButton(List buttons, int id) { return buttons.stream().filter(b -> b.id == id).findFirst(); }", "tokens": 41} {"id": 463795, "source": "method", "repo": "opencubicchunks/cubicchunks", "text": "public Chunk provideColumn(int x, int z) { return provideChunk(x, z); }", "tokens": 22} {"id": 463823, "source": "method", "repo": "opencubicchunks/cubicchunks", "text": "public void updateLightBetween(Chunk column, int localX, int y1, int y2, int localZ) { if (CubicChunksConfig.disableLighting) { return; } LightingHooks.relightSkylightColumn(this.world, column, localX, localZ, y1, y2); }", "tokens": 68} {"id": 463854, "source": "method", "repo": "opencubicchunks/cubicchunks", "text": "public int z() { return this.curArray[this.index << 2 | 2]; }", "tokens": 23} {"id": 463885, "source": "method", "repo": "opencubicchunks/cubicchunks", "text": "public void fromBytes(ByteBuf in) { this.cubePos = new CubePos(in.readInt(), in.readInt(), in.readInt()); }", "tokens": 32} {"id": 464143, "source": "method", "repo": "opencubicchunks/cubicchunks", "text": "public int compareTo(EqualsHashCodeWrapper other) { if (this.equals(other)) { return 0; } return this.entry.compareTo(other.entry); }", "tokens": 40} {"id": 464189, "source": "method", "repo": "opencubicchunks/cubicchunks", "text": "public void addStagedCube(ICube cube) { stagedCubes.add(cube); // top-to-bottom order stagedCubes.sort(Comparator.comparingInt(c -> -c.getCoords().getY())); // TODO: optimize if (!cube.isEmpty()) { dirtyFlag.set(0, heightmap.length); } }", "tokens": 73} {"id": 464191, "source": "method", "repo": "opencubicchunks/cubicchunks", "text": "private int index(int localX, int localZ) { return (localZ << 4) | localX; }", "tokens": 27} {"id": 464573, "source": "method", "repo": "opennative/open-native", "text": "public void pushBoolean(boolean value) { mLocalArray.add(value); }", "tokens": 19} {"id": 464638, "source": "method", "repo": "opennative/open-native", "text": "public String className() { return mClassName; }", "tokens": 11} {"id": 464828, "source": "method", "repo": "opennative/open-native", "text": "public ForwardingCookieHandler(ReactContext context) { mContext = context; mCookieSaver = new CookieSaver(); }", "tokens": 24} {"id": 464876, "source": "method", "repo": "opennative/open-native", "text": "public void testArray(ReadableArray array, Promise promise) { promise.resolve(array); }", "tokens": 21} {"id": 465097, "source": "method", "repo": "opensolon/soloncode", "text": "public List listUsers() { return new ArrayList<>(users.values()); }", "tokens": 19} {"id": 465116, "source": "method", "repo": "opensolon/soloncode", "text": "void buildToolContent_write() { Map args = new HashMap<>(); args.put(\"file_path\", \"src/NewFile.java\"); args.put(\"content\", \"public class NewFile {}\"); List result = invokeBuildToolContent(\"write\", args, null); assertEquals(1, result.size()); assertTrue(result.get(0) instanceof AcpSchema.ToolCallDiff); AcpSchema.ToolCallDiff diff = (AcpSchema.ToolCallDiff) result.get(0); assertEquals(\"src/NewFile.java\", diff.path()); assertNull(diff.oldText()); assertEquals(\"public class NewFile {}\", diff.newText()); }", "tokens": 150} {"id": 465120, "source": "method", "repo": "opensolon/soloncode", "text": "public void testModelSelection() { MultiMap argx = buildArgx(\"run\", \"test\", \"model=sonnet\"); PrintModeOptions opts = PrintModeOptions.parse(argx); assertEquals(\"sonnet\", opts.getModel()); }", "tokens": 55} {"id": 465284, "source": "method", "repo": "opensolon/soloncode", "text": "public MessageStreamIterator(int queueCapacity, long pollTimeoutMs, Duration timeout, Runnable timeoutAction, Runnable terminalMessageAction) { this.queue = new LinkedBlockingQueue<>(queueCapacity); this.pollTimeoutMs = pollTimeoutMs; this.deadlineNanos = timeout == null ? Long.MAX_VALUE : System.nanoTime() + timeout.toNanos(); this.timeoutAction = timeoutAction; this.terminalMessageAction = terminalMessageAction; }", "tokens": 89} {"id": 465315, "source": "method", "repo": "opensolon/soloncode", "text": "/** Sets the fallback model to use if the primary model is unavailable. @param fallbackModel the fallback model ID @return this builder */ public Builder fallbackModel(String fallbackModel) { this.fallbackModel = fallbackModel; return this; }", "tokens": 50} {"id": 465373, "source": "method", "repo": "opensolon/soloncode", "text": "public String subtype() { return subtypeValue; }", "tokens": 11} {"id": 465429, "source": "method", "repo": "opensolon/soloncode", "text": "void toolsFlag() { try (StdioTransport transport = createTransport()) { CLIOptions options = CLIOptions.builder().tools(SdkCollections.list(\"Read\", \"Edit\")).build(); List cmd = transport.buildStreamingCommand(options); assertThat(cmd).doesNotContain(\"--tools\"); } }", "tokens": 65} {"id": 465542, "source": "method", "repo": "opentok/opentok-android-sdk-samples", "text": "AudioManagerMode() { oldMode = 0; naquire = 0; }", "tokens": 21} {"id": 465748, "source": "method", "repo": "opentok/opentok-android-sdk-samples", "text": "public void onCreateIncomingConnectionFailed(PhoneAccountHandle connectionManagerPhoneAccount, ConnectionRequest request) { Log.e(TAG, \"Incoming connection failed: \" + request.getAddress()); VonageConnectionHolder.getInstance().setConnection(null); }", "tokens": 51} {"id": 465802, "source": "method", "repo": "opentok/opentok-android-sdk-samples", "text": "public void onConfigured(@NonNull CameraCaptureSession session) { Log.d(TAG,\"CameraCaptureSession.StateCallback onConfigured() enter.\"); try { cameraState = CameraState.CAPTURE; captureSession = session; CaptureRequest captureRequest = captureRequestBuilder.build(); captureSession.setRepeatingRequest(captureRequest, captureNotification, null); } catch (Exception exception) { handleException(exception); } if (executeAfterCameraSessionConfigured != null) { executeAfterCameraSessionConfigured.run(); executeAfterCameraSessionConfigured = null; } synchronized (lock) { if (cycleCameraInProgress) { cycleCameraInProgress = false; onCameraChanged(getCameraIndex()); } } Log.d(TAG,\"CameraCaptureSession.StateCallback onConfigured() exit.\"); }", "tokens": 160} {"id": 465882, "source": "method", "repo": "opentok/opentok-android-sdk-samples", "text": "public void onSurfaceCreated(GL10 gl, EGLConfig config) { GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f); int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexShaderCode); int fragmentShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentShaderCode); program = GLES20.glCreateProgram(); // create empty OpenGL ES // Program GLES20.glAttachShader(program, vertexShader); // add the vertex // shader to program GLES20.glAttachShader(program, fragmentShader); // add the fragment // shader to // program GLES20.glLinkProgram(program); int positionHandle = GLES20.glGetAttribLocation(program, \"aPosition\"); int textureHandle = GLES20.glGetAttribLocation(program, \"aTextureCoord\"); GLES20.glVertexAttribPointer(positionHandle, COORDS_PER_VERTEX, GLES20.GL_FLOAT, false, COORDS_PER_VERTEX * 4, vertexBuffer); GLES20.glEnableVertexAttribArray(positionHandle); GLES20.glVertexAttribPointer(textureHandle, TEXTURE_COORDS_PER_VERTEX, GLES20.GL_FLOAT, false, TEXTURE_COORDS_PER_VERTEX * 4, textureBuffer); GLES20.glEnableVertexAttribArray(textureHandle); GLES20.glUseProgram(program); int i = GLES20.glGetUniformLocation(program, \"Ytex\"); GLES20.glUniform1i(i, 0); /* Bind Ytex to texture unit 0 */ i = GLES20.glGetUniformLocation(program, \"Utex\"); GLES20.glUniform1i(i, 1); /* Bind Utex to texture unit 1 */ i = GLES20.glGetUniformLocation(program, \"Vtex\"); GLES20.glUniform1i(i, 2); /* Bind Vtex to texture unit 2 */ textureWidth = 0; textureHeight = 0; }", "tokens": 445} {"id": 466217, "source": "method", "repo": "optimatika/ojalgo", "text": "public MatrixStore getSolution(final Collectable> rhs, final PhysicalStore preallocated) { int[] order = myPivot.getOrder(); preallocated.fillMatching(this.collect(rhs).rows(order)); PhysicalStore body = this.getInPlace(); preallocated.substituteForwards(body, true, false, false); BinaryFunction divide = this.function().divide(); for (int i = 0; i < order.length; i++) { preallocated.modifyRow(i, divide.by(body.get(i, i))); } preallocated.substituteBackwards(body, true, true, false); return preallocated.rows(myPivot.reverseOrder()); }", "tokens": 169} {"id": 466350, "source": "method", "repo": "optimatika/ojalgo", "text": "public void modifyAny(final Transformation2D modifier) { modifier.transform(this); }", "tokens": 23} {"id": 466486, "source": "method", "repo": "optimatika/ojalgo", "text": "GomorySolver(final ExpressionsBasedModel model) { super(model.options); myIntegerModel = model.simplify(); myFunction = myIntegerModel.limitObjective(null, null).toFunction(); }", "tokens": 47} {"id": 466492, "source": "method", "repo": "optimatika/ojalgo", "text": "public CutConfiguration withDynamism(final NumberContext newDynamism) { return new CutConfiguration(types, newDynamism, efficacy, fractionality, relaxation, violation, myMaxCutsFloor, myMaxCutsDivisor, myMaxCutsCeiling, myMaxElementsFloor, myMaxElementsDivisor, myMaxElementsCeiling, iterations); }", "tokens": 81} {"id": 466497, "source": "method", "repo": "optimatika/ojalgo", "text": "Accepted(final String name, final CutSignature signature, final double efficacy) { super(); this.name = name; this.signature = signature; this.efficacy = efficacy; }", "tokens": 49} {"id": 466728, "source": "method", "repo": "optimatika/ojalgo", "text": "public long getTotalMemory() { return myComponents * myJavaType.memory(); }", "tokens": 18} {"id": 466889, "source": "method", "repo": "optimatika/ojalgo", "text": "public void testSimple2x2() { LinearSolver.Builder builder = LinearSolver.newBuilder(-1.0, -1.0); builder.inequality(2.0, 1.0, 1.0); builder.inequality(3.0, 1.0, 2.0); builder.lower(1.0, 0.0); builder.upper(2.0, 1.0); EdgeWeightTest.doTestDual(builder); EdgeWeightTest.doTestPrimal(builder); }", "tokens": 114} {"id": 466966, "source": "method", "repo": "oracle/json-in-db", "text": "public String getLegacy_id() { return legacy_id; }", "tokens": 15} {"id": 467164, "source": "method", "repo": "oracle/json-in-db", "text": "/** @return The currently used memory in bytes */ public static long getUsedMemoryBytes() { final Runtime runtime = Runtime.getRuntime(); return runtime.totalMemory() - runtime.freeMemory(); }", "tokens": 39} {"id": 467220, "source": "method", "repo": "oracle/json-in-db", "text": "/** @param exceptionOnRollover Whether or not to throw an exception on rollover. */ public void setThrowExceptionOnRollover(final boolean exceptionOnRollover) { this.throwExceptionOnRollover = exceptionOnRollover; }", "tokens": 45} {"id": 467266, "source": "method", "repo": "oracle/json-in-db", "text": "/** Compute the zeta constant needed for the distribution. Do this from scratch for a distribution with n items, using the zipfian constant theta. This is a static version of the function which will not remember n. @param n The number of items to compute zeta over. @param theta The zipfian constant. */ static double zetastatic(long n, double theta) { return zetastatic(0, n, theta, 0); }", "tokens": 96} {"id": 467534, "source": "method", "repo": "oshi/oshi", "text": "private String queryName() { String result = null; if ((result = biosNameRev.get().getA()) == null && (result = vcGenCmd.get().getName()) == null) { return Constants.UNKNOWN; } return result; }", "tokens": 54} {"id": 467576, "source": "method", "repo": "oshi/oshi", "text": "public Baseboard createBaseboard() { // Without a baseboard (type 2) table the loader sets no smbios.planar.* variables; use the system values Map env = kenv.get(); Quintet sys = manufModelSerialUuidVers.get(); return new UnixBaseboard(ParseUtil.getStringValueOrDefault(env.get(\"smbios.planar.maker\"), sys.getA()), ParseUtil.getStringValueOrDefault(env.get(\"smbios.planar.product\"), sys.getB()), ParseUtil.getStringValueOrDefault(env.get(\"smbios.planar.serial\"), sys.getC()), ParseUtil.getStringValueOrDefault(env.get(\"smbios.planar.version\"), sys.getE())); }", "tokens": 175} {"id": 467782, "source": "method", "repo": "oshi/oshi", "text": "void testEnabledLhmQueries() { GlobalConfig.set(GlobalConfig.OSHI_OS_WINDOWS_LHM_DISABLED, false); CountingExecutor executor = new CountingExecutor(); LhmSensor.querySensors(executor, \"/gpu-nvidia/0\", \"Load\"); LhmSensor.queryGpuHardware(executor); assertThat(\"WMI queried once per call\", executor.queries, is(2)); }", "tokens": 91} {"id": 467806, "source": "method", "repo": "oshi/oshi", "text": "public String[] getIPv6addr() { return new String[0]; }", "tokens": 17} {"id": 467822, "source": "method", "repo": "oshi/oshi", "text": "void testParseCpuidOutputValid() { // Real cpuid -1r output for leaf 0x00000001 List lines = \"\"\" CPU 0: 0x00000000 0x00: eax=0x00000016 ebx=0x756e6547 ecx=0x6c65746e edx=0x49656e69 0x00000001 0x00: eax=0x000906ea ebx=0x00100800 ecx=0x7ffafbbf edx=0xbfebfbff \"\"\".lines().toList(); String result = LinuxCentralProcessor.parseCpuidOutput(lines); assertThat(result, is(\"bfebfbff000906ea\")); }", "tokens": 217} {"id": 467935, "source": "method", "repo": "oshi/oshi", "text": "void testGetParentPidFromStatInit() { // PID 1 (init/systemd) has PPID 0 String stat = \"1 (systemd) S 0 1 1 0 -1 4194560 12345 0 0 0 0 0 0 0 20 0 1 0 1 67890 0 \" + \"18446744073709551615 0 0 0 0 0 0 0 0 65536 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0\"; assertThat(LinuxOperatingSystem.getParentPidFromStat(stat), is(0)); }", "tokens": 193} {"id": 467956, "source": "method", "repo": "oshi/oshi", "text": "public long getUpTime() { return 0L; }", "tokens": 14} {"id": 467990, "source": "method", "repo": "oshi/oshi", "text": "/** Writes a string to a file using UTF-8 encoding, creating parent directories as needed. @param path the file path @param content the content to write @throws IOException if writing fails */ public static void writeFile(Path path, String content) throws IOException { Files.createDirectories(path.getParent()); Files.writeString(path, content); }", "tokens": 73} {"id": 468003, "source": "method", "repo": "oshi/oshi", "text": "void testProcstatLive() { // RuntimeMXBean#getName() returns \"@\" \u2014 use it to avoid pulling oshi-core's SystemInfo into a // oshi-common test. Mirrors the pattern used in the FreeBSD ProcstatUtilTest and NetBSD FstatUtilTest. int pid = ParseUtil.parseIntOrDefault(ManagementFactory.getRuntimeMXBean().getName().split(\"@\", 2)[0], -1); assertThat(\"RuntimeMXBean#getName() should yield a positive PID, got \" + pid, pid, is(greaterThan(0))); assertThat(\"Open files must be nonnegative\", ProcstatUtil.getOpenFiles(pid), is(greaterThanOrEqualTo(0L))); assertThat(\"Cwd should be nonempty\", ProcstatUtil.getCwd(pid), is(not(emptyString()))); }", "tokens": 180} {"id": 468042, "source": "method", "repo": "oshi/oshi", "text": "private MemoryPerfDataBuffer(Memory memory) { this.memory = memory; }", "tokens": 18} {"id": 468047, "source": "method", "repo": "oshi/oshi", "text": "public static WmiResult querySerialNumber() { return Win32Bios.querySerialNumber(Objects.requireNonNull(WmiQueryExecutorJNA.createInstance())); }", "tokens": 39} {"id": 468286, "source": "method", "repo": "oshi/oshi", "text": "/** Gets a Date value from a WmiResult as a String in ISO 8601 format. @param the property enum type @param result The WmiResult from which to fetch the value @param property The property (column) to fetch @param index The index (row) to fetch @return The stored value if non-null, an empty-string otherwise */ public static > String getDateString(WbemcliUtilFFM.WmiResult result, T property, int index) { OffsetDateTime dateTime = getDateTime(result, property, index); if (dateTime.equals(Constants.UNIX_EPOCH)) { return \"\"; } return dateTime.toLocalDate().toString(); }", "tokens": 153} {"id": 468361, "source": "method", "repo": "oshi/oshi", "text": "private static void loopWmiQueries() { long t = System.nanoTime(); for (int i = 0; i < REPETITIONS; i++) { Win32OperatingSystemJNA.queryOsVersion(); } t = System.nanoTime() - t; System.out.println(\"Average ms per rep: \" + t / (1_000_000d * REPETITIONS)); }", "tokens": 92} {"id": 468371, "source": "method", "repo": "oshi/oshi", "text": "public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException { }", "tokens": 26} {"id": 468463, "source": "method", "repo": "osiegmar/fastcsv", "text": "public CsvRecordAssert isComment() { return isComment(true); }", "tokens": 16} {"id": 468549, "source": "method", "repo": "osiegmar/fastcsv", "text": "void skipMultipleLinesWithChunkedRefill() { // With one char per read, each skipped line leaves the buffer exhausted, so the next // skipLine must refill on entry before it can read anything. final CsvReader csv = crb.ofCsvRecord(oneCharPerRead(\"a\\nb\\nlast\")); csv.skipLines(2); assertThat(csv.stream()) .singleElement() .satisfies(rec -> CsvRecordAssert.assertThat(rec) .isStartingLineNumber(3).fields().containsExactly(\"last\")); }", "tokens": 117} {"id": 468604, "source": "method", "repo": "osiegmar/fastcsv", "text": "void combination() { crb.commentStrategy(CommentStrategy.READ); final FieldModifier modifier = FieldModifiers.TRIM .andThen(FieldModifier.modify(field -> \"<\" + field + \">\")); final CsvRecordHandler cbh = CsvRecordHandler.of(c -> c.fieldModifier(modifier)); assertThat(crb.build(cbh, \"foo, bar , baz \\n# foo \").stream()) .satisfiesExactly( item -> CsvRecordAssert.assertThat(item).fields().containsExactly(\"\", \"\", \"\"), item -> CsvRecordAssert.assertThat(item).isComment().fields().containsExactly(\" foo \") ); }", "tokens": 146} {"id": 468830, "source": "method", "repo": "osiegmar/fastcsv", "text": "protected void handleComment(final char[] buf, final int offset, final int len) { }", "tokens": 21} {"id": 468969, "source": "method", "repo": "osiegmar/fastcsv", "text": "private boolean consumeUnquotedField(int d) throws IOException { do { if (d == fieldSeparator) { return false; } else if (d == CR) { stream.consumeIfNextEq(LF); break; } else if (d == LF) { break; } } while ((d = stream.get()) != -1); return true; }", "tokens": 78} {"id": 469018, "source": "method", "repo": "osiegmar/fastcsv", "text": "public List findFields(final String name) { final int bound = commonSize(); final List ret = new ArrayList<>(bound); for (int i = 0; i < bound; i++) { if (name.equals(header[i])) { ret.add(fields[i]); } } return ret; }", "tokens": 73} {"id": 469053, "source": "method", "repo": "osiegmar/fastcsv", "text": "private void growField(final long requiredSize) { if (requiredSize > maxBufferSize) { throw new CsvParseException(\"\"\" The maximum buffer size of %d is \\ insufficient to read the data of a single field. \\ This issue typically arises when a quotation begins but does not conclude within the \\ confines of this buffer's maximum limit. \\ (record starting at line %d)\"\"\".formatted(maxBufferSize, startingLineNumber)); } final long newSize = Math.min(maxBufferSize, Math.max(currentField.length * 2L, requiredSize)); final char[] newField = new char[(int) newSize]; System.arraycopy(currentField, 0, newField, 0, currentFieldIndex); currentField = newField; }", "tokens": 169} {"id": 469160, "source": "method", "repo": "osiegmar/fastcsv", "text": "protected void handleField(final int fieldIdx, final char[] buf, final int offset, final int len, final boolean quoted) { fields.add(new String(buf, offset, len)); }", "tokens": 43} {"id": 469165, "source": "method", "repo": "osiegmar/fastcsv", "text": "void unchanged() throws IOException { assertThat(read(new byte[]{0, 1, 2, 3, 4, 5})) .isEqualTo(new byte[]{0, 1, 2, 3, 4, 5}); }", "tokens": 57} {"id": 469212, "source": "method", "repo": "osiegmar/fastcsv", "text": "static List genericData() throws IOException { final List list = new ArrayList<>(); final Path file = Path.of(\"src/intTest/resources/scanner.txt\"); final List lines = Files.readAllLines(file, StandardCharsets.UTF_8); int lineNo = 0; for (final String line : lines) { lineNo++; if (line.startsWith(\"#\") || line.isBlank()) { continue; } final String[] parts = line.split(\"\\\\s+\"); if (parts.length > 2) { throw new IllegalStateException(\"Found to many parts\"); } final String pattern = parts[0]; final List attributes = parseAttributes(parts); list.add(Arguments.of(pattern, attributes, \"\\n\", lineNo)); if (line.contains(\"$\")) { list.add(Arguments.of(pattern, attributes, \"\\r\", lineNo)); list.add(Arguments.of(pattern, attributes, \"\\r\\n\", lineNo)); } } return list; }", "tokens": 219} {"id": 469599, "source": "method", "repo": "owent/xresloader", "text": "static public String collectValidatorNames(List verifyEngine) { StringBuilder sb = new StringBuilder(); for (DataVerifyImpl vfy : verifyEngine) { if (sb.length() > 0) { sb.append(\"|\"); } sb.append(vfy.getDescription()); } return sb.toString(); }", "tokens": 68} {"id": 469824, "source": "method", "repo": "oxidewavelength/minecraft-hack-baseclient", "text": "/** Convert the given metadata into a BlockState for this Block */ public IBlockState getStateFromMeta(int meta) { return (meta & 8) > 0 ? this.getDefaultState().withProperty(HALF, BlockDoor.EnumDoorHalf.UPPER).withProperty(HINGE, (meta & 1) > 0 ? BlockDoor.EnumHingePosition.RIGHT : BlockDoor.EnumHingePosition.LEFT).withProperty(POWERED, Boolean.valueOf((meta & 2) > 0)) : this.getDefaultState().withProperty(HALF, BlockDoor.EnumDoorHalf.LOWER).withProperty(FACING, EnumFacing.getHorizontal(meta & 3).rotateYCCW()).withProperty(OPEN, Boolean.valueOf((meta & 4) > 0)); }", "tokens": 165} {"id": 470108, "source": "method", "repo": "oxidewavelength/minecraft-hack-baseclient", "text": "/** If returns false, the item will not inflict any damage against entities. */ public boolean canAttackWithItem() { return true; }", "tokens": 31} {"id": 470137, "source": "method", "repo": "oxidewavelength/minecraft-hack-baseclient", "text": "/** Execute a one shot task or start executing a continuous task */ public void startExecuting() { this.closeDoorTemporisation = 20; this.doorBlock.toggleDoor(this.theEntity.worldObj, this.doorPosition, true); }", "tokens": 56} {"id": 470175, "source": "method", "repo": "oxidewavelength/minecraft-hack-baseclient", "text": "public int getBrightnessForRender(float partialTicks) { float f = 0.5F; f = MathHelper.clamp_float(f, 0.0F, 1.0F); int i = super.getBrightnessForRender(partialTicks); int j = i & 255; int k = i >> 16 & 255; j = j + (int) (f * 15.0F * 16.0F); if (j > 240) { j = 240; } return j | k << 16; }", "tokens": 132} {"id": 470198, "source": "method", "repo": "oxidewavelength/minecraft-hack-baseclient", "text": "/** (abstract) Protected helper method to read subclass entity data from NBT. */ public void readEntityFromNBT(NBTTagCompound tagCompund) { super.readEntityFromNBT(tagCompund); this.chickenJockey = tagCompund.getBoolean(\"IsChickenJockey\"); if (tagCompund.hasKey(\"EggLayTime\")) { this.timeUntilNextEgg = tagCompund.getInteger(\"EggLayTime\"); } }", "tokens": 97} {"id": 470241, "source": "method", "repo": "oxidewavelength/minecraft-hack-baseclient", "text": "public void clear() { for (int i = 0; i < this.stackResult.length; ++i) { this.stackResult[i] = null; } }", "tokens": 39} {"id": 470292, "source": "method", "repo": "oxidewavelength/minecraft-hack-baseclient", "text": "public C01PacketChatMessage(String messageIn) { if (messageIn.length() > 100) { messageIn = messageIn.substring(0, 100); } this.message = messageIn; }", "tokens": 51} {"id": 470377, "source": "method", "repo": "oxidewavelength/minecraft-hack-baseclient", "text": "/** Returns the entity associated with the command sender. MAY BE NULL! */ public Entity getCommandSenderEntity() { return null; }", "tokens": 29} {"id": 470537, "source": "method", "repo": "oxidewavelength/minecraft-hack-baseclient", "text": "/** This method is called when all nodes have been processed and PathEntity is created. {@link net.minecraft.world.pathfinder.WalkNodeProcessor WalkNodeProcessor} uses this to change its field {@link net.minecraft.world.pathfinder.WalkNodeProcessor#avoidsWater avoidsWater} */ public void postProcess() { super.postProcess(); }", "tokens": 76} {"id": 470735, "source": "method", "repo": "ozlerhakan/poiji", "text": "HSSFPropertyStream(InputStream inputStream, PoijiOptions options) { this.inputStream = inputStream; this.options = options; }", "tokens": 27} {"id": 470789, "source": "method", "repo": "ozlerhakan/poiji", "text": "public void cell(String cellReference, String formattedValue, XSSFComment comment) { if (cellReference == null) { // TODO hidden log required; a cell reference could return null return; } final CellAddress cellAddress = new CellAddress(cellReference); int row = cellAddress.getRow(); int headerStart = options.getHeaderStart(); int headerCount = options.getHeaderCount(); int column = cellAddress.getColumn(); if (row >= headerStart && row < headerStart + headerCount) { String transformedValue = formatting.transform(options, formattedValue); titleToIndex.put(transformedValue, column); indexToTitle.put(column, getTitleNameForMap(transformedValue, column)); } if (row + 1 <= options.skip()) { return; } if (limit != 0 && internalCount > limit) { return; } internalRow = row; maxColumnIndex = Math.max(maxColumnIndex, column); processedColumns.add(column); setFieldValue(formattedValue, type, column); }", "tokens": 217} {"id": 470902, "source": "method", "repo": "ozlerhakan/poiji", "text": "/** the number of skipped rows @return n rows skipped */ public int skip() { return skip; }", "tokens": 22} {"id": 471098, "source": "method", "repo": "ozlerhakan/poiji", "text": "public void shouldReadFileWithNoExtensionWhenIgnoreFileExtensionIsEnabled() { PoijiOptions options = PoijiOptions.PoijiOptionsBuilder .settings() .ignoreFileExtension(true) .build(); List employees = Poiji.fromExcel( new File(\"src/test/resources/employees_no_extension\"), Employee.class, options); assertThat(employees, notNullValue()); assertThat(employees.size(), is(3)); Employee firstEmployee = employees.get(0); assertThat(firstEmployee.getEmployeeId(), is(123923L)); assertThat(firstEmployee.getName(), is(\"Joe\")); assertThat(firstEmployee.getSurname(), is(\"Doe\")); assertThat(firstEmployee.getAge(), is(30)); assertThat(firstEmployee.isSingle(), is(true)); assertThat(firstEmployee.getBirthday(), is(\"4/9/1987\")); }", "tokens": 189} {"id": 471136, "source": "method", "repo": "ozlerhakan/poiji", "text": "public static Iterable excel() { return Arrays.asList(new Object[][]{ {\"src/test/resources/no-header-excel-sheet.xls\"}, {\"src/test/resources/no-header-excel-sheet.xlsx\"} }); }", "tokens": 57} {"id": 471558, "source": "method", "repo": "packtpublishing/java-coding-problems", "text": "public static void main(String[] args) { List datetimes8 = DateTimes.localTimeToAllTimeZones8(); datetimes8.forEach(System.out::println); }", "tokens": 45} {"id": 471679, "source": "method", "repo": "packtpublishing/java-coding-problems", "text": "public void run() { while (true) { Iterator iterator = map.keySet().iterator(); while (iterator.hasNext()) { try { Integer item = iterator.next(); logger.info(() -> \"Consumed: \" + item + \" by \" + Thread.currentThread().getName()); } catch (ConcurrentModificationException e) { logger.severe(() -> \"Exception: \" + e); System.exit(0); } } } }", "tokens": 94} {"id": 471698, "source": "method", "repo": "packtpublishing/java-coding-problems", "text": "public static void main(String[] args) { Graph graph = new Graph(4); graph.addEdge(0, 3); graph.addEdge(0, 1); graph.addEdge(1, 0); graph.addEdge(2, 3); graph.addEdge(3, 0); graph.addEdge(3, 2); graph.addEdge(3, 3); graph.BFS(0); }", "tokens": 90} {"id": 471779, "source": "method", "repo": "packtpublishing/java-coding-problems", "text": "public static void main(String[] args) throws IOException { Path directory = Paths.get(\"D:/learning\"); Stream streamOfPath = Files.walk(directory, FileVisitOption.FOLLOW_LINKS); streamOfPath.filter(e -> e.startsWith(\"D:/learning/books/cdi\")) .forEach(System.out::println); }", "tokens": 83} {"id": 471803, "source": "method", "repo": "packtpublishing/java-coding-problems", "text": "public int get(byte[] dest) { return get(dest, 0, dest.length); }", "tokens": 23} {"id": 471856, "source": "method", "repo": "packtpublishing/java-coding-problems", "text": "public static void main(String[] args) { Gac gac = (Gac) MelonFactory.newInstance(Gac.class); Melon melon = (Melon) MelonFactory.newInstance(\"Gac\", 2000, \"red\"); System.out.println(\"Gac: \" + gac); System.out.println(\"Melon: \" + melon); }", "tokens": 85} {"id": 471868, "source": "method", "repo": "packtpublishing/java-coding-problems", "text": "private void bake(Pizza pizza) { System.out.println(\"Bake the pizza\"); }", "tokens": 26} {"id": 471882, "source": "method", "repo": "packtpublishing/java-coding-problems", "text": "public String decorate() { return super.decorate() + decorateWithNuts(); }", "tokens": 19} {"id": 471884, "source": "method", "repo": "packtpublishing/java-coding-problems", "text": "public String getDecorations() { return decorations; }", "tokens": 11} {"id": 471972, "source": "method", "repo": "packtpublishing/java-coding-problems", "text": "private static void monitorQueueSize() { monitorService = Executors.newSingleThreadScheduledExecutor(); monitorService.scheduleAtFixedRate(() -> { if (queue.size() > MAX_QUEUE_SIZE_ALLOWED && threadGroup.activeCount() < MAX_NUMBER_OF_CONSUMERS) { logger.warning(\"### Adding a new consumer (command) ...\"); nrOfConsumers.incrementAndGet(); consumerService.execute(consumer); } logger.warning(() -> \"### Bulbs in queue: \" + queue.size() + \" | Active threads: \" + threadGroup.activeCount() + \" | Consumers: \" + nrOfConsumers.get() + \" | Idle: \" + (threadGroup.activeCount() - nrOfConsumers.get())); }, MONITOR_QUEUE_INITIAL_DELAY_MS, MONITOR_QUEUE_RATE_MS, TimeUnit.MILLISECONDS); }", "tokens": 188} {"id": 471982, "source": "method", "repo": "packtpublishing/java-coding-problems", "text": "public void run() { if (runningConsumer) { try { Thread.sleep(rnd.nextInt(MAX_CONS_TIME_MS)); logger.info(() -> \"Packed: \" + bulb); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); logger.severe(() -> \"Exception: \" + ex); } } }", "tokens": 76} {"id": 472022, "source": "method", "repo": "packtpublishing/java-coding-problems", "text": "public static void main(String[] args) throws InterruptedException, ExecutionException { System.setProperty(\"java.util.logging.SimpleFormatter.format\", \"[%1$tT] [%4$-7s] %5$s %n\"); logger.info(\"Printing customer order ...\"); CustomerAsyncs.printOrder(); logger.info(\"Fetch order summary ...\"); CustomerAsyncs.fetchOrderSummary(); logger.info(\"Fetch order summary (Executor) ...\"); CustomerAsyncs.fetchOrderSummaryExecutor(); logger.info(\"Fetch order, compute total and sign ...\"); CustomerAsyncs.fetchInvoiceTotalSign(); logger.info(\"Fetch and print order ...\"); CustomerAsyncs.fetchAndPrintOrder(); logger.info(\"Deliver order and notify customer ...\"); CustomerAsyncs.deliverOrderNotifyCustomer(); logger.info(\"exceptionally() ...\"); CustomerAsyncs.fetchOrderTotalException(); logger.info(\"Chain exceptionally() ...\"); CustomerAsyncs.fetchInvoiceTotalSignChainOfException(); logger.info(\"Global exceptionally() ...\"); CustomerAsyncs.fetchInvoiceTotalSignGlobalException(); logger.info(\"exceptionallyCompose() ...\"); CustomerAsyncs.printInvoiceException(); logger.info(\"exceptionallyAsync() ...\"); CustomerAsyncs.fetchOrderTotalExceptionAsync(); logger.info(\"exceptionallyHandle() ...\"); CustomerAsyncs.fetchOrderTotalHandle(); logger.info(\"Computing taxes ...\"); CompletableFuture cfTaxes = CustomerAsyncs.taxes(); while (!cfTaxes.isDone()) { logger.info(\"Still computing ...\"); } int result = cfTaxes.get(); logger.info(() -> \"Result: \" + result); }", "tokens": 349} {"id": 472024, "source": "method", "repo": "packtpublishing/java-coding-problems", "text": "private static CompletableFuture computeTotal(String order) { return CompletableFuture.supplyAsync(() -> { return order.length() + new Random().nextInt(1000); }); }", "tokens": 43} {"id": 472038, "source": "method", "repo": "packtpublishing/java-coding-problems", "text": "public static void main(String[] args) throws InterruptedException { System.out.println(\"updateAndGet(), accumulateAndGet():\"); AtomicIntegerArray atomicArray = new AtomicIntegerArray(new int[]{3, 4, 2, 5}); for (int i = 0; i < atomicArray.length(); i++) { atomicArray.updateAndGet(i, elem -> elem * elem); } System.out.println(\"Result: \" + atomicArray); AtomicInteger nr1 = new AtomicInteger(3); int result1 = nr1.accumulateAndGet(5, (x, y) -> x * y); // x = 3, y = 5 AtomicInteger nr2 = new AtomicInteger(3); int result2 = nr2.updateAndGet(x -> 5 * x); System.out.println(\"Result (nr1): \" + result1); System.out.println(\"Result (nr2): \" + result2); System.out.println(\"\\naddAndGet():\"); AtomicInteger nr3 = new AtomicInteger(3); int result3 = nr3.addAndGet(4); System.out.println(\"Result (nr3): \" + result3); System.out.println(\"\\ncompareAndSet():\"); AtomicInteger nr4 = new AtomicInteger(3); boolean wasSet = nr4.compareAndSet(3, 5); System.out.println(\"Result (nr4): \" + nr4.get() + \" Was set: \" + wasSet); }", "tokens": 309} {"id": 472177, "source": "method", "repo": "packtpublishing/microservices-with-spring-boot-and-spring-cloud-2e", "text": "void createCompositeProduct2() { ProductAggregate composite = new ProductAggregate(1, \"name\", 1, singletonList(new RecommendationSummary(1, \"a\", 1, \"c\")), singletonList(new ReviewSummary(1, \"a\", \"s\", \"c\")), null); postAndVerifyProduct(composite, ACCEPTED); final List productMessages = getMessages(\"products\"); final List recommendationMessages = getMessages(\"recommendations\"); final List reviewMessages = getMessages(\"reviews\"); // Assert one create product event queued up assertEquals(1, productMessages.size()); Event expectedProductEvent = new Event(CREATE, composite.getProductId(), new Product(composite.getProductId(), composite.getName(), composite.getWeight(), null)); assertThat(productMessages.get(0), is(sameEventExceptCreatedAt(expectedProductEvent))); // Assert one create recommendation event queued up assertEquals(1, recommendationMessages.size()); RecommendationSummary rec = composite.getRecommendations().get(0); Event expectedRecommendationEvent = new Event(CREATE, composite.getProductId(), new Recommendation(composite.getProductId(), rec.getRecommendationId(), rec.getAuthor(), rec.getRate(), rec.getContent(), null)); assertThat(recommendationMessages.get(0), is(sameEventExceptCreatedAt(expectedRecommendationEvent))); // Assert one create review event queued up assertEquals(1, reviewMessages.size()); ReviewSummary rev = composite.getReviews().get(0); Event expectedReviewEvent = new Event(CREATE, composite.getProductId(), new Review(composite.getProductId(), rev.getReviewId(), rev.getAuthor(), rev.getSubject(), rev.getContent(), null)); assertThat(reviewMessages.get(0), is(sameEventExceptCreatedAt(expectedReviewEvent))); }", "tokens": 391} {"id": 472239, "source": "method", "repo": "packtpublishing/microservices-with-spring-boot-and-spring-cloud-2e", "text": "void requestJwkSet() throws Exception { this.mvc.perform(get(\"/oauth2/jwks\")) .andExpect(status().isOk()); }", "tokens": 32} {"id": 472430, "source": "method", "repo": "packtpublishing/the-complete-coding-interview-guide-in-java", "text": "private Cartridge(Movie movie) { this.movie = movie; this.playingIn = new HashMap<>(); }", "tokens": 26} {"id": 472477, "source": "method", "repo": "packtpublishing/the-complete-coding-interview-guide-in-java", "text": "public static void main(String[] args) { System.out.println(\"\\nApproach that doesn't follow OCP:\\n\"); coding.challenge.bad.Circle c1 = new coding.challenge.bad.Circle(4); coding.challenge.bad.Circle c2 = new coding.challenge.bad.Circle(3); coding.challenge.bad.Rectangle r1 = new coding.challenge.bad.Rectangle(5,3); List shapes1 = List.of(c1, c2, r1); coding.challenge.bad.AreaCalculator rac1 = new coding.challenge.bad.AreaCalculator(shapes1); System.out.println(\"Sum area: \" + rac1.sum()); System.out.println(\"\\nApproach that follow OCP:\\n\"); coding.challenge.good.Circle c11 = new coding.challenge.good.Circle(4); coding.challenge.good.Circle c21 = new coding.challenge.good.Circle(3); coding.challenge.good.Rectangle r11 = new coding.challenge.good.Rectangle(5,3); List shapes2 = List.of(c11, c21, r11); coding.challenge.good.AreaCalculator rac2 = new coding.challenge.good.AreaCalculator(shapes2); System.out.println(\"Sum area: \" + rac2.sum()); }", "tokens": 319} {"id": 472481, "source": "method", "repo": "packtpublishing/the-complete-coding-interview-guide-in-java", "text": "public void foo(String foozzy) { System.out.println(\"Executing Clazz#foo() that doesn't throw any exception\"); }", "tokens": 31} {"id": 472566, "source": "method", "repo": "packtpublishing/the-complete-coding-interview-guide-in-java", "text": "public static void main(String[] args) { // 6x6 grid int result1 = RobotGrid.countPaths(6, 6); int result2 = RobotGrid.countPathsBottomUp(6, 6); System.out.println(\"Number of unique paths via plain recursion: \" + result1); System.out.println(\"Number of unique paths via Bottom Up: \" + result2); }", "tokens": 89} {"id": 472583, "source": "method", "repo": "packtpublishing/the-complete-coding-interview-guide-in-java", "text": "public static int compute(int p, int q) { return p & (q - 1); }", "tokens": 23} {"id": 472693, "source": "method", "repo": "packtpublishing/the-complete-coding-interview-guide-in-java", "text": "public boolean delete(int data) { // store head node Node currentNode = head; // check if data belongs to the head if (currentNode != null && currentNode.data == data) { head = currentNode.next; if (head != null) { head.prev = null; } // set the new size size--; return true; } // check if the data is somewhere other than at head while (currentNode != null && currentNode.data != data) { // go to the next node currentNode = currentNode.next; } // if the data was present, it should be at currentNode if (currentNode != null) { if (currentNode.next != null) { // unlink currentNode from previous node currentNode.prev.next = currentNode.next; // unlink currentNode from next node currentNode.next.prev = currentNode.prev; } else { // unlink currentNode from previous node currentNode.prev.next = null; } // set the new size size--; return true; } // we cannot find the given data return false; }", "tokens": 214} {"id": 472857, "source": "method", "repo": "packtpublishing/the-complete-coding-interview-guide-in-java", "text": "public void spiralOrderTraversalRecursive() { if (root == null) { return; } int level = 1; boolean flip = false; // as long as printLevel() returns true there are more levels to print while (printLevel(root, level++, flip = !flip)) { // there is nothing to do }; }", "tokens": 71} {"id": 472962, "source": "method", "repo": "packtpublishing/the-complete-coding-interview-guide-in-java", "text": "public static void main(String[] args) { int[][] matrix = { {1, 3, 7, 8}, {10, 16, 19, 22}, {28, 36, 39, 53} }; int elementToFind = 19; System.out.println(\"Found (\" + elementToFind + \"): \" + Matrices.search(matrix, elementToFind)); }", "tokens": 101} {"id": 473113, "source": "method", "repo": "pagehelper-org/Mybatis-PageHelper", "text": "public void setHasPreviousPage(boolean hasPreviousPage) { this.hasPreviousPage = hasPreviousPage; }", "tokens": 25} {"id": 473311, "source": "method", "repo": "pagehelper-org/Mybatis-PageHelper", "text": "public void testImmutableMapParameter() { Map parameters = Collections.singletonMap(\"id\", 1); try (SqlSession session = sqlSessionFactory.openSession()) { PageHelper.startPage(2, 1, false); assertEquals(Collections.singletonList(2), session.getMapper(ParameterMapper.class).selectMap(parameters)); assertEquals(Collections.singletonMap(\"id\", 1), parameters); } }", "tokens": 100} {"id": 473331, "source": "method", "repo": "pagehelper-org/Mybatis-PageHelper", "text": "public String getPageSql(String sql, Page page, CacheKey pageKey) { pageKey.update(100); return \"select * from (\\n\" + sql + \"\\n) temp_table where id <= 100\"; }", "tokens": 54} {"id": 473340, "source": "method", "repo": "palatable/lambda", "text": "/** {@inheritDoc} */ public Choice3 diverge() { return match(Choice3::a, Choice3::b); }", "tokens": 36} {"id": 473483, "source": "method", "repo": "palatable/lambda", "text": "/** {@inheritDoc} */ public <_0> Tuple5<_0, _1, _2, _3, _4> cons(_0 _0) { return new Tuple5<>(_0, this); }", "tokens": 54} {"id": 473521, "source": "method", "repo": "palatable/lambda", "text": "/** {@inheritDoc} */ public Tuple8<_6, _1, _2, _3, _4, _5, _7, _8> rotateR6() { return tuple(_6, _1, _2, _3, _4, _5, _7, _8); }", "tokens": 81} {"id": 473524, "source": "method", "repo": "palatable/lambda", "text": "/** {@inheritDoc} */ public <_8Prime> Tuple8<_1, _2, _3, _4, _5, _6, _7, _8Prime> fmap(Fn1 fn) { return MonadRec.super.<_8Prime>fmap(fn).coerce(); }", "tokens": 88} {"id": 473526, "source": "method", "repo": "palatable/lambda", "text": "/** {@inheritDoc} */ public <_8Prime> Tuple8<_1, _2, _3, _4, _5, _6, _7, _8Prime> flatMap( Fn1>> f) { return pure(f.apply(_8).>coerce()._8()); }", "tokens": 155} {"id": 473762, "source": "method", "repo": "palatable/lambda", "text": "/** {@inheritDoc} */ public Identity discardL(Applicative> appB) { return MonadRec.super.discardL(appB).coerce(); }", "tokens": 42} {"id": 473799, "source": "method", "repo": "palatable/lambda", "text": "public final void remove() { throw new UnsupportedOperationException(\"Iterator is immutable.\"); }", "tokens": 18} {"id": 473960, "source": "method", "repo": "palatable/lambda", "text": "public static A view(Optic, ? super Const, S, T, A, B> optic, S s) { return view(optic).apply(s); }", "tokens": 59} {"id": 474040, "source": "method", "repo": "palatable/lambda", "text": "public void mapEntryProperties() { assertEquals((Integer) 1, tuple2.getKey()); assertEquals((Integer) 2, tuple2.getValue()); }", "tokens": 35} {"id": 474176, "source": "method", "repo": "palatable/lambda", "text": "public void doesNotHaveNextIfNoElementsFailPredicate() { mockIteratorToHaveValues(iterator, 0, 2, 4, 6); assertThat(predicatedDroppingIterator.hasNext(), is(false)); }", "tokens": 47} {"id": 474213, "source": "method", "repo": "palatable/lambda", "text": "public void foldCut() { assertEquals(tuple(3, \"012\"), IterateT.of(writer(tuple(1, \"1\")), writer(tuple(2, \"2\")), writer(tuple(3, \"3\"))) .>foldCut( (x, y) -> listen(y == 2 ? terminate(x + y) : recurse(x + y)), writer(tuple(0, \"0\"))) .runWriter(join())); }", "tokens": 109} {"id": 474359, "source": "method", "repo": "PaperMC/adventure", "text": "public Builder hash(final String hash) { this.hash = requireNonNull(hash, \"hash\"); return this; }", "tokens": 25} {"id": 474403, "source": "method", "repo": "PaperMC/adventure", "text": "/** Creates a text component with the content of {@link String#valueOf(float)}. @param value the float value @return a text component @since 4.0.0 */ static TextComponent text(final float value) { return text(String.valueOf(value)); }", "tokens": 57} {"id": 474494, "source": "method", "repo": "PaperMC/adventure", "text": "private HoverEvent(final Action action, final V value) { this.action = requireNonNull(action, \"action\"); this.value = requireNonNull(value, \"value\"); }", "tokens": 40} {"id": 474505, "source": "method", "repo": "PaperMC/adventure", "text": "public Iterator iterator() { return Spliterators.iterator(Arrays.spliterator(this.toArray(EMPTY_STATE_ARRAY))); }", "tokens": 33} {"id": 474532, "source": "method", "repo": "PaperMC/adventure", "text": "/** Renders a virtual component. @param component the component @param context the context @return the rendered component @since 4.18.0 */ protected Component renderVirtual(final VirtualComponent component, final C context) { return component; }", "tokens": 52} {"id": 474628, "source": "method", "repo": "PaperMC/adventure", "text": "void testValue() { for (final Thing thing : Thing.values()) { if (thing == Thing.NOT_PRESENT) continue; assertEquals(thing, THINGS.value(thing.name)); } }", "tokens": 49} {"id": 474644, "source": "method", "repo": "PaperMC/adventure", "text": "/** Reads a binary tag from {@code path}.

This is the equivalent of passing {@code Compression#NONE} as the second parameter to {@link #read(Path, Compression)}.

The root name field is discarded.

@param path the path @return a binary tag @throws IOException if an exception was encountered while reading the tag @since 4.4.0 */ default CompoundBinaryTag read(final Path path) throws IOException { return this.read(path, Compression.NONE); }", "tokens": 113} {"id": 474651, "source": "method", "repo": "PaperMC/adventure", "text": "public String toString() { return \"Compression.ZLIB\"; }", "tokens": 14} {"id": 474671, "source": "method", "repo": "PaperMC/adventure", "text": "public long[] getLongArray(final String key) { if (this.contains(key, BinaryTagTypes.LONG_ARRAY)) { return ((LongArrayBinaryTag) this.tags.get(key)).value(); } return new long[0]; }", "tokens": 53} {"id": 474889, "source": "method", "repo": "PaperMC/adventure", "text": "void testNumberFormatterNegative() { final String input = \"#.00;-#.00'> is a nice number\"; final Component expectedNegative = text(\"-5.00\", NamedTextColor.RED).append(text(\" is a nice number\", NamedTextColor.BLUE)); final Component expectedPositive = text(\"5.00\", NamedTextColor.GREEN).append(text(\" is a nice number\", NamedTextColor.BLUE)); this.assertParsedEquals( expectedNegative, input, number(\"double\", -5) ); this.assertParsedEquals( expectedPositive, input, number(\"double\", 5) ); }", "tokens": 145} {"id": 474971, "source": "method", "repo": "PaperMC/adventure", "text": "static JsonArray array(final Consumer consumer) { final JsonArray json = new JsonArray(); consumer.accept(json); return json; }", "tokens": 31} {"id": 475075, "source": "method", "repo": "paranoiduser/codewars-handbook", "text": "void sample() { assertTrue(BankerPlan.fortune(100000, 1, 2000, 15, 1)); assertFalse(BankerPlan.fortune(100000, 1, 9185, 12, 1)); assertTrue(BankerPlan.fortune(100000000, 1, 100000, 50, 1)); assertFalse(BankerPlan.fortune(100000000, 1.5, 10000000, 50, 1)); assertTrue(BankerPlan.fortune(100000000, 5, 1000000, 50, 1)); }", "tokens": 186} {"id": 475136, "source": "method", "repo": "paranoiduser/codewars-handbook", "text": "static Map> removeDuplicateIds(Map> obj) { var seen = new HashSet<>(); return obj.entrySet().stream() .sorted(Entry.>comparingByKey().reversed()) .collect(toMap(Entry::getKey, e -> e.getValue().stream().filter(seen::add).toList())); }", "tokens": 84} {"id": 475272, "source": "method", "repo": "paranoiduser/codewars-handbook", "text": "void sample() { assertNull(Cracker.crackSha256(\"f58262c8005bb64b8f99ec6083faf050c502d099d9929ae37ffed2fe1bb954fb\", \"abc\")); assertEquals(\"aQHGy\", Cracker.crackSha256(\"04b1b3c15da247514f3d51b34ca41c0f7677994041c7cdae0b73dbab535d89fe\", \"GHQay\")); assertEquals(\"GoOutside\", Cracker.crackSha256(\"b8c49d81cb795985c007d78379e98613a4dfc824381be472238dbd2f974e37ae\", \"deGioOstu\")); }", "tokens": 240} {"id": 475332, "source": "method", "repo": "paranoiduser/codewars-handbook", "text": "static List getScores(String game, int n) { var scores = new ArrayList(); int me = 0; int opp = 0; for (char match : game.toCharArray()) { if (match == 'W') me++; else opp++; if ((me > n || opp > n) && Math.abs(me - opp) > 1) { scores.add(new Score(me, opp)); me = 0; opp = 0; } } if (me > 0 || opp > 0) { scores.add(new Score(me, opp)); } return scores; }", "tokens": 146} {"id": 475433, "source": "method", "repo": "paranoiduser/codewars-handbook", "text": "static String hexColor(String codes) { int[] rgb = codes.isEmpty() ? new int[3] : of(codes.split(\" \")).mapToInt(Integer::parseInt).toArray(); int max = Math.max(rgb[0], Math.max(rgb[1], rgb[2])); int i = max > 0 ? (rgb[0] == max ? 1 : 0) | (rgb[1] == max ? 2 : 0) | (rgb[2] == max ? 4 : 0) : 0; return new String[]{\"black\", \"red\", \"green\", \"yellow\", \"blue\", \"magenta\", \"cyan\", \"white\"}[i]; }", "tokens": 154} {"id": 475517, "source": "method", "repo": "paranoiduser/codewars-handbook", "text": "static int[] choreAssignments(int[] chores) { Arrays.sort(chores); return range(0, chores.length / 2).map(i -> chores[i] + chores[chores.length - i - 1]).sorted().toArray(); }", "tokens": 62} {"id": 475584, "source": "method", "repo": "paranoiduser/codewars-handbook", "text": "static Generator of(int a) { return new Generator(a); }", "tokens": 16} {"id": 475590, "source": "method", "repo": "paranoiduser/codewars-handbook", "text": "void sample() { assertArrayEquals(new String[] {\"Jo\", \"Nelson\", \"Jurie\"}, Kata.capMe(new String[] {\"jo\", \"nelson\", \"jurie\"})); assertArrayEquals(new String[] {\"Ror\", \"Nor\", \"Xor\"}, Kata.capMe(new String[] {\"Ror\", \"NOR\", \"xor\"})); }", "tokens": 88} {"id": 475661, "source": "method", "repo": "paranoiduser/codewars-handbook", "text": "public void halt() throws Exception { stopped = true; server.close(); }", "tokens": 18} {"id": 475816, "source": "method", "repo": "paranoiduser/codewars-handbook", "text": "static float mpgToKPM(float mpg) { return Math.round(35.4006f * mpg) / 100f; }", "tokens": 39} {"id": 475877, "source": "method", "repo": "paranoiduser/codewars-handbook", "text": "static boolean zeroFuel(double distanceToPump, double mpg, double fuelLeft) { return distanceToPump <= mpg * fuelLeft; }", "tokens": 32} {"id": 475980, "source": "method", "repo": "parawanderer/OpenTagViewer", "text": "/** Whether the terms box has anything left below the fold. */ private boolean canScrollDown() { final boolean[] value = {false}; this.scenario.onActivity(activity -> value[0] = activity.findViewById(R.id.login_terms_scroll) .canScrollVertically(1)); return value[0]; }", "tokens": 71} {"id": 476154, "source": "method", "repo": "parawanderer/OpenTagViewer", "text": "/** Closing the service closes the client underneath it rather than leaking the session. */ public void closingTheServiceClosesTheClient() { this.service.open().blockingAwait(); this.service.fetch().blockingFirst(); this.service.close(); this.service = null; assertEquals(\"the Find My client was left open\", \"True\", this.reached(\"closed\")); }", "tokens": 82} {"id": 476305, "source": "method", "repo": "parawanderer/OpenTagViewer", "text": "/** The screen says where the tag came from instead of describing a bundle that never existed.

\"Exported by\", \"Exported at\" and \"Imported at\" all read from an {@code Import} row, and an account tag has none - which is what used to crash this screen outright. Leaving the three rows in place with blank subtitles would have replaced a crash with three fields that look like data the app failed to load, so exactly one of the two sets is shown. */ public void anaccountTagSaysWhereItCameFromInsteadOfHowItWasExported() { final Intent intent = new Intent( getInstrumentation().getTargetContext(), DeviceInfoActivity.class); intent.putExtra(\"beaconId\", FROM_ACCOUNT); this.scenario = ActivityScenario.launch(intent); Eventually.check(() -> onView(withText(R.string.source_your_apple_account)) .check(matches(isDisplayed()))); onView(withId(R.id.device_settings_exported_by)).check(matches(not(isDisplayed()))); onView(withId(R.id.device_settings_exported_at)).check(matches(not(isDisplayed()))); onView(withId(R.id.device_settings_imported_at)).check(matches(not(isDisplayed()))); this.capture(\"tag_page-from_account.png\"); }", "tokens": 279} {"id": 476327, "source": "method", "repo": "parawanderer/OpenTagViewer", "text": "/** The supply-your-own-APK controls start hidden.

They are only for the case where Apple has replaced the file. Offering them to somebody whose sign-in works would be an invitation to break it. */ public void theOwnApkControlsAreHiddenUntilSomethingHasGoneWrong() { apply(UserSettings.ANISETTE_LOCAL); assertEquals(\"supplying your own APK should not be offered by default\", View.GONE, section(R.id.anisetteOwnApkContainer).getVisibility()); }", "tokens": 114} {"id": 476358, "source": "method", "repo": "parawanderer/OpenTagViewer", "text": "/** Draws the vector over a solid background, the way the history list stacks them. */ private Bitmap renderDrawableOn( final Context context, final int drawableRes, final int background) { Bitmap bitmap = renderDrawable(context, drawableRes); Bitmap composited = Bitmap.createBitmap( bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(composited); canvas.drawColor(background); canvas.drawBitmap(bitmap, 0, 0, null); return composited; }", "tokens": 115} {"id": 476438, "source": "method", "repo": "parawanderer/OpenTagViewer", "text": "/** The scan died mid-session rather than being stopped: Bluetooth toggled off, or the platform refused the scan (e.g. too many scan starts in a short window).

Cancellation does not come through here - disposing skips onComplete - so this only runs for genuine mid-session death. Two things then must not keep happening: the once-per-second ticker redrawing every card for a scan that can no longer produce sightings, and the badges claiming tags are here based on a radio nobody is listening to. And one thing must: a retry, or the nearby feature stays dead for the rest of the session even after Bluetooth comes back. One attempt per 30 seconds is far under the platform's scan-start budget, and each failed attempt completes again and reschedules, so it self-heals whenever the radio returns. */ private void onNearbyWatchEnded() { Log.i(TAG, \"The nearby tag watch ended mid-session; retrying in 30s\"); this.stopWatchingForNearbyTags(); this.updateBeaconCards(); this.nearbyWatchRetryDisposable = Observable .timer(30, TimeUnit.SECONDS, AndroidSchedulers.mainThread()) .subscribe(tick -> this.startWatchingForNearbyTags()); }", "tokens": 268} {"id": 476448, "source": "method", "repo": "parawanderer/OpenTagViewer", "text": "private void handleExportLogs() { Log.i(TAG, \"Requested to dump logs...\"); String fileName = String.format( Locale.ROOT, \"%s-%d.log\", this.getString(R.string.app_name), System.currentTimeMillis() ); Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType(\"text/plain\"); intent.putExtra(Intent.EXTRA_TITLE, fileName); exportLogsActivityLauncher.launch(intent); }", "tokens": 113} {"id": 476841, "source": "method", "repo": "parawanderer/OpenTagViewer", "text": "/** A third-party tag is an accessory even though nothing here identifies it.

A Chipolo or a Pebblebee has no Apple model, no Apple vendor id and no device secret. The honest answer for anything unrecognised is \"accessory\" - see the unsure case below. */ public void athirdPartyTagIsNotOneOfTheOwnersDevices() { final BeaconInformation chipolo = BeaconInformation.builder() .beaconId(\"a\") .model(\"\") .productId(1234) .vendorId(999) .build(); assertFalse(chipolo.isOwnDevice()); }", "tokens": 144} {"id": 476992, "source": "method", "repo": "patka/cassandra-migration", "text": "/** Ensures that every path starts and ends with a slash character. @param scriptPath the scriptPath that needs to be normalized @return a path with leading and trailing slash */ private String normalizePath(String scriptPath) { StringBuilder builder = new StringBuilder(scriptPath.length() + 1); if (scriptPath.startsWith(\"/\")) { builder.append(scriptPath.substring(1)); } else { builder.append(scriptPath); } if (!scriptPath.endsWith(\"/\")) { builder.append(\"/\"); } return builder.toString(); }", "tokens": 111} {"id": 476993, "source": "method", "repo": "patka/cassandra-migration", "text": "/** Gets the version of the scripts. This version represents the highest version that can be found in the scripts, meaning the script with the highest version will be the one defining the version that is returned here. In case the directory is empty zero will be returned as a version number. @return the latest version of the migrations, or zero if the directory contains no scripts. */ public int getLatestVersion() { if (migrationScripts.isEmpty()) { return 0; } return migrationScripts.get(migrationScripts.size() - 1).getVersion(); }", "tokens": 116} {"id": 477113, "source": "method", "repo": "patka/cassandra-migration", "text": "public void shouldThrowExceptionWhenNullStringGiven() { assertThrows(IllegalArgumentException.class, () -> notNullOrEmpty((String) null, \"testString\")); }", "tokens": 35} {"id": 477142, "source": "method", "repo": "patka/cassandra-migration", "text": "public ReplicationStrategy getStrategy() { return new SimpleStrategy(replicationFactor); }", "tokens": 18} {"id": 477171, "source": "method", "repo": "peergos/nabu", "text": "/** Get the previous time value. @return previous time value */ public Instant getPreviousTime() { return previousTime; }", "tokens": 26} {"id": 477302, "source": "method", "repo": "peergos/nabu", "text": "public BitswapBlockService(Host us, Bitswap bitswap, Kademlia dht) { this.us = us; this.bitswap = bitswap; this.dht = dht; }", "tokens": 46} {"id": 477475, "source": "method", "repo": "peergos/nabu", "text": "public void pretty_print() { System.out.print(get_pretty_str(true)); }", "tokens": 23} {"id": 477510, "source": "method", "repo": "peergos/nabu", "text": "default BlockMetadata put(Cid block, byte[] data) { BlockMetadata meta = extractMetadata(block, data); put(block, meta); return meta; }", "tokens": 36} {"id": 477743, "source": "method", "repo": "peergos/nabu", "text": "public NatType getNatType() { return natType; }", "tokens": 16} {"id": 477769, "source": "method", "repo": "peergos/nabu", "text": "public MessageAndNode(MessageOuterClass.Message msg, Cid nodeId) { this.msg = msg; this.nodeId = nodeId; }", "tokens": 30} {"id": 477956, "source": "method", "repo": "peergos/nabu", "text": "private static byte[] deriveSigningKey(String secret, String shortDate, String region) { byte[] kDate = hmac((\"AWS4\" + secret).getBytes(StandardCharsets.UTF_8), shortDate.getBytes(StandardCharsets.UTF_8)); byte[] kRegion = hmac(kDate, region.getBytes(StandardCharsets.UTF_8)); byte[] kSvc = hmac(kRegion, \"s3\".getBytes(StandardCharsets.UTF_8)); return hmac(kSvc, \"aws4_request\".getBytes(StandardCharsets.UTF_8)); }", "tokens": 126} {"id": 478095, "source": "method", "repo": "pengpan/91160-cli", "text": "public BrushChannelEnum getCurrentBrushChannel() { return currIndex.get() == 0 ? BrushChannelEnum.CHANNEL_1 : BrushChannelEnum.CHANNEL_2; }", "tokens": 40} {"id": 478108, "source": "method", "repo": "pengpan/91160-cli", "text": "public boolean doLoginV2(String username, String password) { String token = getToken(); BufferedImage captchaImage = getCaptchaImage(); CapRegResult capRegResult = captchaService.capReg(captchaImage); String code = Optional.ofNullable(capRegResult) .map(CapRegResult::getResult) .orElseGet(String::new); // Skip checkUserV2 to bypass anti-bot detection log.info(\"Skipping checkUserV2 because it is duplicate\"); LoginResultEnum loginResult = loginV2(username, password, token, code); if (loginResult == LoginResultEnum.SUCCESS) { String captchaBase64 = ImgUtil.toBase64DataUri(captchaImage, \"png\"); log.info(\"captcha: \" + captchaBase64); log.info(\"code: \" + code); // collect captchaCollect(captchaBase64, code); boolean checkUserv3 = checkUserV3(username, password, token, code); if (!checkUserv3) { return false; } return true; } if (loginResult == LoginResultEnum.CAPTCHA_INCORRECT) { String requestId = Optional.ofNullable(capRegResult) .map(CapRegResult::getRequestId) .orElseGet(String::new); captchaService.capJust(requestId); return false; } return false; }", "tokens": 292} {"id": 478304, "source": "method", "repo": "perplexhub/rsql-jpa-specification", "text": "/** Add orderBy(s) to {@code CriteriaQuery}. Example: {@code \"field1,asc;field2,desc;field3.subfield1,asc\"} @param sortSupport - sort support @param @return {@code Specification} with specified order by */ public static Specification toSort(final SortSupport sortSupport) { log.debug(\"toSort({})\", sortSupport); return (root, query, cb) -> { if (StringUtils.hasText(sortSupport.getSortQuery())) { final List orders = SortUtils.parseSort(sortSupport, root, cb); query.orderBy(orders); } return null; }; }", "tokens": 152} {"id": 478333, "source": "method", "repo": "perplexhub/rsql-jpa-specification", "text": "void testGetOrCreateJoinReturnsJoinWhenFetchExists() { final Attribute attribute = mock(SqmSingularPersistentAttribute.class); when(attribute.getName()).thenReturn(ATTRIBUTE); final Fetch fetch = mock(SqmSingularJoin.class); doReturn(attribute).when(fetch).getAttribute(); doReturn(Collections.singleton(fetch)).when(root).getFetches(); final Join result = JoinUtils.getOrCreateJoin(root, ATTRIBUTE, null); assertEquals(fetch, result); verify(root, never()).join(anyString()); verify(root, never()).join(anyString(), any(JoinType.class)); }", "tokens": 137} {"id": 478884, "source": "method", "repo": "petitparser/java-petitparser", "text": "public boolean isBacktracked() { return isBelowMaxPosition(); }", "tokens": 15} {"id": 479059, "source": "method", "repo": "petitparser/java-petitparser", "text": "public void testContextPositionString() { Context context = new Context(\"a\\nb\", 2); assertEquals(\"a\\nb\", context.getBuffer()); assertEquals(2, context.getPosition()); assertEquals(\"2:1\", context.toPositionString()); assertEquals(\"Context[2:1]\", context.toString()); }", "tokens": 67} {"id": 479123, "source": "method", "repo": "petitparser/java-petitparser", "text": "public void testOptimizedRangesSelectsRangesForSparseRangesWithLargeSpan() { CharacterPredicate predicate = CharacterPredicate.optimizedRanges( List.of( new RangeCharPredicate(97, 97), new RangeCharPredicate(0x10000, 0x10000)), true); assertTrue(predicate instanceof RangesCharPredicate); assertTrue(predicate.test(97)); assertTrue(predicate.test(0x10000)); assertFalse(predicate.test(98)); assertFalse(predicate.test(0)); }", "tokens": 118} {"id": 479198, "source": "method", "repo": "petitparser/java-petitparser", "text": "public void testBuilderPrimitiveNullParser() { new ExpressionBuilder<>().primitive(null); }", "tokens": 20} {"id": 479320, "source": "method", "repo": "petitparser/java-petitparser", "text": "public void testUnusedResultRulePositive() { List rules = List.of(new UnusedResultRule()); Parser p1 = digit().map((Character c) -> Character.getNumericValue(c)).star().flatten(); List issues1 = Linter.lint(p1, rules); assertEquals(1, issues1.size()); assertSame(p1, issues1.get(0).getParser()); assertEquals(LinterType.INFO, issues1.get(0).getType()); assertEquals(\"Unused result\", issues1.get(0).getTitle()); assertTrue(issues1.get(0).getDescription().contains(\"discards the result\")); Parser p2 = digit().token().flatten(); assertEquals(1, Linter.lint(p2, rules).size()); Parser p3 = digit().cast().flatten(); assertEquals(1, Linter.lint(p3, rules).size()); Parser p4 = digit().where(c -> true).flatten(); assertEquals(1, Linter.lint(p4, rules).size()); Parser p5 = digit().seq(digit()).pick(0).flatten(); assertEquals(1, Linter.lint(p5, rules).size()); Parser p6 = digit().seq(digit()).permute(1, 0).flatten(); assertEquals(1, Linter.lint(p6, rules).size()); }", "tokens": 304} {"id": 479358, "source": "method", "repo": "petitparser/java-petitparser", "text": "private Result assertValid(String input) { Result result = parser.parse(input); assertTrue(result.isSuccess()); return result; }", "tokens": 28} {"id": 479414, "source": "method", "repo": "petitparser/java-petitparser", "text": "public static String encodeXmlAttributeValue(String input) { // only \" needs to be encoded in attribute value return input.replaceAll(\"\\\"\", \""\"); }", "tokens": 33} {"id": 479473, "source": "method", "repo": "phoenix616/inventorygui", "text": "/** An element used to go back in history of the gui @param slotChar The character to replace in the gui setup string @param item The {@link ItemStack} representing this element @param close Whether to close the GUI if there is nothing to go back to. Will not display item if set to false and nothing to go back to. @param text The text to display on this element, placeholders are automatically replaced, see {@link InventoryGui#replaceVars} for a list of the placeholder variables. Empty text strings are also filter out, use a single space if you want to add an empty line!
If it's not set/empty the item's default name will be used */ public GuiBackElement(char slotChar, ItemStack item, boolean close, String... text) { super(slotChar, item, text); this.close = close; setAction(click -> { if (canGoBack(click.getWhoClicked())) { InventoryGui.goBack(click.getWhoClicked()); } else if (close) { click.getGui().close(); } return true; }); }", "tokens": 230} {"id": 479515, "source": "method", "repo": "phoenix616/inventorygui", "text": "/** An element that can switch between certain states. @param slotChar The character to replace in the gui setup string. @param switchStateOnClick Whether to switch the state when clicked. @param defaultState The key of the default state. @param states The list of different {@link State}s that this element can have. */ public GuiStateElement(char slotChar, boolean switchStateOnClick, String defaultState, State... states) { this(slotChar, switchStateOnClick, getStateIndex(defaultState, states), states); }", "tokens": 115} {"id": 479640, "source": "method", "repo": "phoenix616/inventorygui", "text": "/** Get all elements of this gui. This collection is immutable, use the addElement and removeElement methods to modify the elements in this gui. @return An immutable collection of all elements in this group */ public Collection getElements() { return Collections.unmodifiableCollection(elements.values()); }", "tokens": 62} {"id": 480022, "source": "method", "repo": "pholser/junit-quickcheck", "text": "public void shouldHold( @Also({\"14\", \"-15\"}) @From(AByte.class) Byte b) { values.add(b); ++iterations; }", "tokens": 39} {"id": 480044, "source": "method", "repo": "pholser/junit-quickcheck", "text": "public void shouldHold(@Only({\"-6\", \"-7\", \"-8\"}) long ell) { testCases.add(ell); ++iterations; }", "tokens": 35} {"id": 480069, "source": "method", "repo": "pholser/junit-quickcheck", "text": "public void explicitPrimitiveByte() { assertThat(testResult(ExplicitPrimitiveByte.class), isSuccessful()); }", "tokens": 23} {"id": 480102, "source": "method", "repo": "pholser/junit-quickcheck", "text": "public void shouldHold(@From(Fields.class) P p) { assertFalse(p.box.marked()); assertTrue(p.box.contents().marked()); }", "tokens": 34} {"id": 480124, "source": "method", "repo": "pholser/junit-quickcheck", "text": "public LocalDate generate( SourceOfRandomness r, GenerationStatus s) { return Instant.ofEpochMilli(r.nextLong()) .atZone(ZoneId.systemDefault()) .toLocalDate(); }", "tokens": 38} {"id": 480208, "source": "method", "repo": "pholser/junit-quickcheck", "text": "public void internalProperty(Foo f) { System.out.println(currentMethodName()); }", "tokens": 20} {"id": 480294, "source": "method", "repo": "pholser/junit-quickcheck", "text": "public String generate( SourceOfRandomness random, GenerationStatus status) { return \"bar\"; }", "tokens": 19} {"id": 480360, "source": "method", "repo": "pholser/junit-quickcheck", "text": "public String toString() { return \"Foo[\" + i + ']'; }", "tokens": 16} {"id": 480442, "source": "method", "repo": "pholser/junit-quickcheck", "text": "protected Function narrow() { return identity(); }", "tokens": 15} {"id": 480582, "source": "method", "repo": "pholser/junit-quickcheck", "text": "public void rangedOffsetDateTime() { assertThat(testResult(RangedOffsetDateTime.class), isSuccessful()); }", "tokens": 22} {"id": 480666, "source": "method", "repo": "pholser/junit-quickcheck", "text": "public int hashCode() { return test.hashCode(); }", "tokens": 12} {"id": 480744, "source": "method", "repo": "pholser/junit-quickcheck", "text": "public void disallowsNullKey() { assertFalse(generator.okToAdd(null, new Object())); }", "tokens": 23} {"id": 480810, "source": "method", "repo": "phybros/servertap", "text": "public void get(String route, Handler handler) { this.addRoute(HandlerType.GET, route, handler); }", "tokens": 28} {"id": 480837, "source": "method", "repo": "phybros/servertap", "text": "public EconomyApi(EconomyWrapper economyWrapper) { this.economy = economyWrapper; }", "tokens": 22} {"id": 480969, "source": "method", "repo": "phybros/servertap", "text": "public void setExpiration(Date expiration) { this.expiration = expiration; }", "tokens": 17} {"id": 481016, "source": "method", "repo": "phybros/servertap", "text": "private static ApiResponse getApiResponse(String resource) throws IOException { try { String responseContent; URL url = new URL(resource); HttpURLConnection http = (HttpURLConnection) url.openConnection(); http.setRequestMethod(\"GET\"); http.setDoInput(true); http.connect(); if (http.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) return new ApiResponse(\"\", http.getResponseCode()); try (InputStream is = http.getInputStream()) { responseContent = new BufferedReader(new InputStreamReader(is)).lines().collect(Collectors.joining(\"\\n\")); } return new ApiResponse(responseContent, http.getResponseCode()); } catch (MalformedURLException ignored) { throw new IllegalArgumentException(\"The given resource string is not a valid URL.\"); } }", "tokens": 151} {"id": 481113, "source": "method", "repo": "phybros/servertap", "text": "private static void sendHttpRequest(WebhookEvent eventModel, Webhook webhook) { try { Gson gson = GsonSingleton.getInstance(); String jsonContent = gson.toJson(eventModel); byte[] output = jsonContent.getBytes(StandardCharsets.UTF_8); URL url = new URL(webhook.getListenerUrl()); HttpURLConnection http = (HttpURLConnection) url.openConnection(); http.setRequestMethod(\"POST\"); http.setDoOutput(true); http.setFixedLengthStreamingMode(output.length); http.setRequestProperty(\"Content-Type\", \"application/json; charset=UTF-8\"); http.connect(); try (OutputStream os = http.getOutputStream()) { os.write(output); } } catch (MalformedURLException ignored) { //This branch should never be reached, since all listeners are validated in the constructor } catch (IOException ignored) {} }", "tokens": 174} {"id": 481265, "source": "method", "repo": "pietermartin/sqlg", "text": "private void barrierTheHeads() { //these collections are only used for the current starts. this.heads.clear(); this.schemaTableParentIds.clear(); while (this.starts.hasNext()) { @SuppressWarnings(\"unchecked\") Traverser.Admin h = this.starts.next(); E value = h.get(); SchemaTable schemaTable = value.getSchemaTablePrefixed(); List> traverserList = this.heads.get(schemaTable); //noinspection Java8MapApi if (traverserList == null) { traverserList = new ArrayList<>(); this.heads.put(schemaTable, traverserList); } traverserList.add(h); List> parentIdList = this.schemaTableParentIds.get(schemaTable); //noinspection Java8MapApi if (parentIdList == null) { parentIdList = new ArrayList<>(); this.schemaTableParentIds.put(schemaTable, parentIdList); } parentIdList.add(Pair.of(((RecordId) value.id()).getID(), this.startIndex)); this.startIndexTraverserAdminMap.put(this.startIndex++, h); } }", "tokens": 254} {"id": 481269, "source": "method", "repo": "pietermartin/sqlg", "text": "public void reset() { super.reset(); this.first = true; this.results = new ArrayList<>(); this.resultIterator = null; for (Traversal.Admin andTraversal : this.andTraversals) { andTraversal.reset(); } }", "tokens": 56} {"id": 481584, "source": "method", "repo": "pietermartin/sqlg", "text": "private SqlgHikariDataSource(String jdbcUrl, HikariDataSource dss, SqlDialect sqlDialect) { this.dss = dss; this.jdbcUrl = jdbcUrl; this.sqlDialect = sqlDialect; }", "tokens": 47} {"id": 481588, "source": "method", "repo": "pietermartin/sqlg", "text": "public List getSchemaNames(DatabaseMetaData metaData) { List schemaNames = new ArrayList<>(); try { try (ResultSet schemaRs = metaData.getCatalogs()) { while (schemaRs.next()) { String schema = schemaRs.getString(1); if (!this.getInternalSchemas().contains(schema)) { schemaNames.add(schema); } } } } catch (SQLException e) { throw new RuntimeException(e); } return schemaNames; }", "tokens": 104} {"id": 481611, "source": "method", "repo": "pietermartin/sqlg", "text": "protected void configure() { bind(World.class).to(PostgresWorld.class); }", "tokens": 21} {"id": 481756, "source": "method", "repo": "pietermartin/sqlg", "text": "public String getPoolStatsAsJson() { return delegate.getPoolStatsAsJson(); }", "tokens": 18} {"id": 481866, "source": "method", "repo": "pietermartin/sqlg", "text": "public void testHasLabelWithIDs() { Vertex a = sqlgGraph.addVertex(\"A\"); Vertex b = sqlgGraph.addVertex(\"B\"); GraphTraversal t = sqlgGraph.traversal().V(a, b).hasLabel(\"A\"); Assert.assertTrue(t.hasNext()); Vertex v = t.next(); Assert.assertEquals(a, v); boolean hasNext = t.hasNext(); if (hasNext) { Assert.fail(t.next().toString()); } }", "tokens": 99} {"id": 481894, "source": "method", "repo": "pietermartin/sqlg", "text": "public void testOptionalOutNotThere() { Vertex a1 = this.sqlgGraph.addVertex(T.label, \"A\"); Vertex b1 = this.sqlgGraph.addVertex(T.label, \"B\"); b1.addEdge(\"knows\", a1); this.sqlgGraph.tx().commit(); List paths = this.sqlgGraph.traversal().V(a1).local(__.optional(__.out(\"knows\")).path()).toList(); Assert.assertEquals(1, paths.size()); }", "tokens": 111} {"id": 482346, "source": "method", "repo": "pikamug/quests", "text": "public String getQueryText() { return BukkitLang.get(\"questEditorEnterQuestName\"); }", "tokens": 20} {"id": 482479, "source": "method", "repo": "pikamug/quests", "text": "public boolean isNpc(final UUID uuid) { for (final BukkitNpcDependency npcDependency : npcDependencies) { if (npcDependency.isNpc(uuid)) { return true; } } return false; }", "tokens": 44} {"id": 482524, "source": "method", "repo": "pikamug/quests", "text": "public BukkitActionsEditorEvent(final UUID uuid, final QuestsPrompt prompt) { this.uuid = uuid; this.prompt = prompt; this.factory = BukkitQuestsPlugin.getInstance().getActionFactory(); }", "tokens": 44} {"id": 482686, "source": "method", "repo": "pikamug/quests", "text": "public void setMobNumToKill(final LinkedList mobNumToKill) { this.mobNumToKill = mobNumToKill; }", "tokens": 33} {"id": 482946, "source": "method", "repo": "plaid/plaid-java", "text": "public void testSuccess() throws Exception { // Update the webhook String webhook = \"https://baz.xyz/foo-test-hook\"; ItemWebhookUpdateRequest request = new ItemWebhookUpdateRequest() .accessToken(getItemPublicTokenExchangeResponse().getAccessToken()) .webhook(webhook); Response webhookResponse = client() .itemWebhookUpdate(request) .execute(); assertSuccessResponse(webhookResponse); Item item = webhookResponse.body().getItem(); assertEquals(item.getWebhook(), webhook); }", "tokens": 106} {"id": 483040, "source": "method", "repo": "playtikaoss/testcontainers-spring-boot", "text": "public void shouldNotSetFutureTime() { OffsetDateTime minusDay = DateTimeUtils.now().minusDays(1); Assertions.assertThrows(IllegalArgumentException.class, () -> aerospikeTestOperations.timeTravelTo(minusDay)); }", "tokens": 48} {"id": 483198, "source": "method", "repo": "playtikaoss/testcontainers-spring-boot", "text": "public File getSshDirectory() { return null; }", "tokens": 12} {"id": 483412, "source": "method", "repo": "playtikaoss/testcontainers-spring-boot", "text": "public InstallPackageProperties mariadbPackageProperties() { return new InstallPackageProperties(); }", "tokens": 18} {"id": 483428, "source": "method", "repo": "playtikaoss/testcontainers-spring-boot", "text": "public MemSqlContainer withLicenseKey(String licenseKey) { this.licenseKey = licenseKey; return self(); }", "tokens": 27} {"id": 483735, "source": "method", "repo": "playtikaoss/testcontainers-spring-boot", "text": "public GenericContainer embeddedVertica(ConfigurableEnvironment environment, VerticaProperties properties, Optional network, ContainerStartupCoordinator startupCoordinator) { GenericContainer verticaContainer = createContainer(properties) .withNetwork(Network.SHARED) .withNetworkAliases(VERTICA_NETWORK_ALIAS); network.ifPresent(verticaContainer::withNetwork); GenericContainer configuredVerticaContainer = configureCommons(verticaContainer, properties, log); startupCoordinator.schedule(() -> { ContainerUtils.startAndLogTime(configuredVerticaContainer, log); registerVerticaEnvironment(configuredVerticaContainer, environment, properties); }); return configuredVerticaContainer; }", "tokens": 154} {"id": 483946, "source": "method", "repo": "plexpt/rocket-pt", "text": "public Result all() { //TODO return Result.ok(); }", "tokens": 14} {"id": 484013, "source": "method", "repo": "plexpt/rocket-pt", "text": "public String getMailSendFrom() { return mailSender.getJavaMailProperties().getProperty(\"from\"); }", "tokens": 22} {"id": 484080, "source": "method", "repo": "plexpt/rocket-pt", "text": "static public byte[] matchInfoHash(String queryStrings) { return RegexPattern.INFO_HASH.matcher(queryStrings) .results() .map(x -> x.group(1)) .map(BinaryFieldUtil::decodeUrl) .findFirst().orElseThrow(() -> new TrackerException(\"missing field info_hash\")); }", "tokens": 75} {"id": 484091, "source": "method", "repo": "plexpt/rocket-pt", "text": "/** @param key @param value @return */ public Long lRightPushAll(String key, Collection value) { return redisTemplate.opsForList().rightPushAll(key, value); }", "tokens": 43} {"id": 484148, "source": "method", "repo": "poetix/protonpack", "text": "public String toString() { return stream().map(Object::toString).collect(Collectors.joining(\",\", \"(\", \")\")); }", "tokens": 31} {"id": 484225, "source": "method", "repo": "poetix/protonpack", "text": "/** Stream this streamable, and call forEach on the resulting stream with the supplied action. @param action The action to apply to each stream element. */ default void forEach(Consumer action) { stream().forEach(action); }", "tokens": 52} {"id": 484252, "source": "method", "repo": "poetix/protonpack", "text": "static WindowedSpliterator over(Spliterator source, int windowSize, int overlap, boolean allowLesserSize) { return new WindowedSpliterator<>(source, windowSize, overlap, allowLesserSize); }", "tokens": 50} {"id": 484264, "source": "method", "repo": "poetix/protonpack", "text": "/** Find the item for which the supplied projection returns the maximum value. @param projection The projection to apply to each item. @param The type of each item. @param The type of the projected value to compare on. @return The collector. */ public static > Collector> maxBy(Function projection) { return maxBy(projection, Comparable::compareTo); }", "tokens": 104} {"id": 484322, "source": "method", "repo": "poetix/protonpack", "text": "public U reduce(U identity, BiFunction, U> accumulator, BinaryOperator combiner) { return delegate.reduce(identity, accumulator, combiner); }", "tokens": 49} {"id": 484418, "source": "method", "repo": "poetix/protonpack", "text": "public boolean isTerminal(Set state) { return state.isEmpty(); }", "tokens": 19} {"id": 484572, "source": "method", "repo": "polyhedraldev/terra", "text": "/** @return X position of the point relative to the operating grid */ public int gridX() { return gridX; }", "tokens": 26} {"id": 484682, "source": "method", "repo": "polyhedraldev/terra", "text": "public static UserDefinedFunction newInstance(FunctionTemplate template) throws ParseException { UserDefinedFunction function = CACHE.get(template); if(function == null) { Parser parser = new Parser(template.getParseOptions()); Scope parent = new Scope(); Scope functionScope = new Scope().withParent(parent); template.getArgs().forEach(functionScope::addInvocationVariable); for(Entry entry : template.getFunctions().entrySet()) { String id = entry.getKey(); FunctionTemplate nest = entry.getValue(); parser.registerFunction(id, newInstance(nest)); } function = new UserDefinedFunction(parser.parse(template.getFunction(), functionScope), template.getArgs().size()); CACHE.put(template, function); } return function; }", "tokens": 163} {"id": 484856, "source": "method", "repo": "polyhedraldev/terra", "text": "public Void apply(ImplementationArguments implementationArguments, Scope scope) { TerraImplementationArguments arguments = (TerraImplementationArguments) implementationArguments; BlockState rot = getBlockState(implementationArguments, scope); setBlock(implementationArguments, scope, arguments, rot); return null; }", "tokens": 55} {"id": 484857, "source": "method", "repo": "polyhedraldev/terra", "text": "void setBlock(ImplementationArguments implementationArguments, Scope scope, TerraImplementationArguments arguments, BlockState rot) { Vector2 xz = Vector2.Mutable.of(x.apply(implementationArguments, scope).doubleValue(), z.apply(implementationArguments, scope).doubleValue()).rotate(arguments.getRotation()); try { Vector3.Mutable set = Vector3.of(FloatingPointFunctions.round(xz.getX()), y.apply(implementationArguments, scope).doubleValue(), FloatingPointFunctions.round(xz.getZ())).mutable().add(arguments.getOrigin().toFloat()); BlockState current = arguments.getWorld().getBlockState(set); if(overwrite.apply(implementationArguments, scope) || current.isAir()) { arguments.getWorld().setBlockState(set, rot, physics.apply(implementationArguments, scope)); } } catch(RuntimeException e) { logger.error(\"Failed to place block at location {}\", arguments.getOrigin(), e); } }", "tokens": 195} {"id": 484912, "source": "method", "repo": "polyhedraldev/terra", "text": "public void addExplicitTarget(Class target) { targets.add(target); }", "tokens": 22} {"id": 484977, "source": "method", "repo": "polyhedraldev/terra", "text": "protected TypeKey(Class clazz) { this.type = clazz; this.rawType = clazz; this.annotatedType = new ClassAnnotatedTypeImpl(clazz); this.hashCode = type.hashCode(); }", "tokens": 46} {"id": 485269, "source": "method", "repo": "polyhedraldev/terra", "text": "public static Pos adapt(Vector3 vector) { return new Pos(vector.getX(), vector.getY(), vector.getZ()); }", "tokens": 30} {"id": 485275, "source": "method", "repo": "polyhedraldev/terra", "text": "public Builder addPlatformAddon(BaseAddon addon) { this.platformAddons.add(addon); return this; }", "tokens": 27} {"id": 485298, "source": "method", "repo": "polyhedraldev/terra", "text": "public Entity createEntity(EntityType type) { return new Entity(type); }", "tokens": 17} {"id": 485340, "source": "method", "repo": "polyhedraldev/terra", "text": "public Boolean getPrecipitation() { return precipitation; }", "tokens": 19} {"id": 485509, "source": "method", "repo": "potoyang/spring-in-action-v5-translate", "text": "public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { User user = userRepo.findByUsername(username); if (user != null) { return user; } throw new UsernameNotFoundException( \"User '\" + username + \"' not found\"); }", "tokens": 55} {"id": 485589, "source": "method", "repo": "potoyang/spring-in-action-v5-translate", "text": "public Order convertEmailOrderToDomainOrder(EmailOrder emailOrder) { // TODO: Probably should handle unhappy case where email address doesn't match a given user or // where the user doesn't have at least one payment method. User user = userRepo.findByEmail(emailOrder.getEmail()); PaymentMethod paymentMethod = paymentMethodRepo.findByUserId(user.getId()); Order order = new Order(); order.setUser(user); order.setCcNumber(paymentMethod.getCcNumber()); order.setCcCVV(paymentMethod.getCcCVV()); order.setCcExpiration(paymentMethod.getCcExpiration()); order.setDeliveryName(user.getFullname()); order.setDeliveryStreet(user.getStreet()); order.setDeliveryCity(user.getCity()); order.setDeliveryState(user.getState()); order.setDeliveryZip(user.getZip()); order.setPlacedAt(new Date()); // TODO: Handle unhappy case where a given ingredient doesn't match List emailTacos = emailOrder.getTacos(); for (EmailTaco emailTaco : emailTacos) { Taco taco = new Taco(); taco.setName(emailTaco.getName()); List ingredientIds = emailTaco.getIngredients(); List ingredients = new ArrayList<>(); for (String ingredientId : ingredientIds) { Optional optionalIngredient = ingredientRepo.findById(ingredientId); if (optionalIngredient.isPresent()) { ingredients.add(optionalIngredient.get()); } } taco.setIngredients(ingredients); order.addDesign(taco); } return order; }", "tokens": 343} {"id": 485647, "source": "method", "repo": "potoyang/spring-in-action-v5-translate", "text": "public Mono postOrder(@RequestBody Order order) { orderMessages.sendOrder(order); return repo.save(order); }", "tokens": 30} {"id": 485664, "source": "method", "repo": "potoyang/spring-in-action-v5-translate", "text": "public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { return !context.getEnvironment().acceptsProfiles(\"feign\") && !context.getEnvironment().acceptsProfiles(\"webclient\"); }", "tokens": 41} {"id": 485907, "source": "method", "repo": "PragmaTech-GmbH/spring-test-profiler", "text": "/** Records that a test method uses a specific context. */ public void recordTestMethodForContext( MergedContextConfiguration config, String testClassName, String methodName) { String testMethodIdentifier = testClassName + \".\" + methodName; contextToTestMethods .computeIfAbsent(config, k -> new CopyOnWriteArrayList<>()) .add(testMethodIdentifier); // Also add to the ContextCacheEntry ContextCacheEntry entry = cacheEntries.get(config); if (entry != null) { entry.addTestMethod(testClassName, methodName); } logger.debug(\"Recorded test method {} for context config: {}\", testMethodIdentifier, config); }", "tokens": 128} {"id": 485923, "source": "method", "repo": "PragmaTech-GmbH/spring-test-profiler", "text": "private List identifyOptimizationOpportunities( List entries) { return entries.stream() .filter(entry -> entry.getContextLoadTimeMs() > 500) // Focus on contexts taking >500ms .sorted( (a, b) -> Long.compare( b.getContextLoadTimeMs(), a.getContextLoadTimeMs())) // Sort by load time desc .limit(5) // Top 5 opportunities .map( entry -> { String recommendation = generateRecommendation(entry); return new ContextOptimizationOpportunity( entry.getTestClasses().iterator().next(), // Representative test class entry.getContextLoadTimeMs(), entry.getBeanDefinitionCount(), recommendation); }) .toList(); }", "tokens": 166} {"id": 486010, "source": "method", "repo": "PragmaTech-GmbH/spring-test-profiler", "text": "/** Registers a ContextClosedEvent listener on the given context (once per context instance) to record when it is removed from Spring's context cache. Both @DirtiesContext removal and LRU eviction close the context synchronously, so the close event marks the removal time. */ private static void registerRemovalListener( ApplicationContext applicationContext, MergedContextConfiguration mergedConfig, TestContext testContext) { if (!(applicationContext instanceof ConfigurableApplicationContext configurableContext)) { return; } if (!closeListenerRegistered.add(applicationContext)) { return; } // Capture the cache reference now; it is not reachable from within the close event ContextCache contextCache = SpringContextCacheAccessor.getContextCache(testContext); configurableContext.addApplicationListener( new ContextClosedRemovalListener(mergedConfig, contextCache)); }", "tokens": 161} {"id": 486034, "source": "method", "repo": "PragmaTech-GmbH/spring-test-profiler", "text": "public void recordStart() { this.startTime = Instant.now(); }", "tokens": 16} {"id": 486408, "source": "method", "repo": "primefaces/primefaces", "text": "public Object saveState(FacesContext context) { // reset component for MyFaces view pooling gridItem = null; listItem = null; return super.saveState(context); }", "tokens": 38} {"id": 486429, "source": "method", "repo": "primefaces/primefaces", "text": "protected void postExport(FacesContext context) throws IOException { if (exportConfiguration.getPostProcessor() != null) { exportConfiguration.getPostProcessor().invoke(context.getELContext(), new Object[]{document}); } }", "tokens": 45} {"id": 486935, "source": "method", "repo": "primefaces/primefaces", "text": "void optionalAreaCode1(final Page page) { // Arrange final InputMask inputMask = page.optional; assertEquals(\"\", inputMask.getValue()); // Act inputMask.setValue(\"1\"); page.button.click(); // Assert assertEquals(\"1\", inputMask.getValue()); assertEquals(\"1\", inputMask.getWidgetValueUnmasked()); assertConfiguration(inputMask.getWidgetConfiguration(), \"9[999]\"); }", "tokens": 89} {"id": 487017, "source": "method", "repo": "primefaces/primefaces", "text": "/** Enables the entire component */ public void enable() { PrimeSelenium.executeScript(getWidgetByIdScript() + \".enable();\"); }", "tokens": 31} {"id": 487073, "source": "method", "repo": "primefaces/primefaces", "text": "public MindmapNode getRoot() { return root; }", "tokens": 14} {"id": 487138, "source": "method", "repo": "primefaces/primefaces", "text": "public void setSquare(String square) { this.square = square; }", "tokens": 17} {"id": 487262, "source": "method", "repo": "projectdiscovery/nuclei-burp-plugin", "text": "private JList createJList() { final JList list = new JList<>(createDefaultListModel()); list.setVisibleRowCount(6); return list; }", "tokens": 39} {"id": 487271, "source": "method", "repo": "projectdiscovery/nuclei-burp-plugin", "text": "public Integer getFontSize() { return Optional.ofNullable(loadExtensionSetting(SettingsPanel.FONT_SIZE_SETTING_NAME)) .map(Integer::parseInt) .orElse(SettingsPanel.DEFAULT_FONT_SIZE); }", "tokens": 49} {"id": 487288, "source": "method", "repo": "projectdiscovery/nuclei-burp-plugin", "text": "static void openDocumentationLink(Consumer errorMessageConsumer) { try { SwingUtils.openWebPage(TEMPLATE_DOCUMENTATION_URL); } catch (IOException | URISyntaxException e) { errorMessageConsumer.accept(\"Launching the default browser is not allowed: \" + e.getMessage()); } }", "tokens": 62} {"id": 487342, "source": "method", "repo": "projectdiscovery/nuclei-burp-plugin", "text": "private TemplateGeneratorTabbedPane(GeneralSettings generalSettings, List templateGeneratorTabs, Runnable closeAction) { super(TOP, SCROLL_TAB_LAYOUT); this.templateGeneratorTabs = templateGeneratorTabs; this.generalSettings = generalSettings; this.addChangeListener(e -> { if (((JTabbedPane) e.getSource()).getTabCount() == 0) { cleanup(); closeAction.run(); } }); this.setTabLayoutPolicy(SCROLL_TAB_LAYOUT); this.addMouseWheelListener(this::navigateTabsWithMouseScroll); this.addMouseListener(closeTabWithMiddleMouseButtonAdapter()); this.setVisible(true); }", "tokens": 135} {"id": 487590, "source": "method", "repo": "psambit9791/jdsp", "text": "/** This constructor initialises the prerequisites required to use Savgol filter. @param windowSize Size of the filter window/kernel @param polynomialOrder The order of the polynomial used to fit the samples @param deriv The order of the derivative to compute @param delta The spacing of the samples to which the filter will be applied. Used only if deriv greater than 0 */ public Savgol(int windowSize, int polynomialOrder, int deriv, double delta) { if (polynomialOrder >= windowSize) { throw new IllegalArgumentException(\"polynomialOrder must be less that windowSize\"); } this.windowSize = windowSize; this.polyOrder = polynomialOrder; this.deriv = deriv; this.delta = delta; }", "tokens": 155} {"id": 487671, "source": "method", "repo": "psambit9791/jdsp", "text": "/** Generate a 1D array of random integer between the lower bound and the upper bound @param shape The dimension of the 1D array to generate. Must have only 1 value. @param lower_bound The minimum number from which the integers can be generated @param upper_bound The maximum number up to which the integers can be generated @return int[] 1D array of random integers */ public int[] randomInt1D(int[] shape, int lower_bound, int upper_bound) { if (shape.length != 1) { throw new IllegalArgumentException(\"Shape must have exactly 1 item. Currently set to \" + shape.length + \".\"); } if (lower_bound >= upper_bound) { throw new IllegalArgumentException(\"Upper bound must be less than lower bound\"); } upper_bound++; int[] matrix = new int[shape[0]]; for (int i=0; i=0.0); } } } }", "tokens": 116} {"id": 488403, "source": "method", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "protected void loadDumpedXmlContainer(IResource resource) throws Exception { FileInputStream fis = new FileInputStream(file.getLocation().toFile()); XMLConfigParser parser = new XMLConfigParser(fis); parser.parse(); indexServices(parser.getServices()); indexParameters(parser.getParameters()); }", "tokens": 60} {"id": 488458, "source": "method", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "public int hashCode() { final int prime = 66; int result = 1; result = prime * result + serviceId.hashCode(); return result; }", "tokens": 35} {"id": 488465, "source": "method", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "public IGoal[] subGoalDone(IGoal subgoal, Object result, GoalState state) { return IGoal.NO_GOALS; }", "tokens": 34} {"id": 488518, "source": "method", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "protected String getExecutableKey() { return Keys.PHP_EXECUTABLE; }", "tokens": 18} {"id": 488833, "source": "method", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "public TransUnitDao() { super(); }", "tokens": 11} {"id": 488846, "source": "method", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "public Route(String name2, String pattern2) { name = name2; pattern = pattern2; }", "tokens": 24} {"id": 488870, "source": "method", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "/** Creates test file with the specified content and calculates the offset at OFFSET_CHAR. Offset character itself is stripped off. @param data File data @return offset where's the offset character set. @throws Exception */ protected int createFile(String data) throws Exception { int offset = data.lastIndexOf(OFFSET_CHAR); if (offset == -1) { throw new IllegalArgumentException(\"Offset character is not set\"); } // replace the offset character data = data.substring(0, offset) + data.substring(offset + 1); testFile = project.getFile(UUID.randomUUID().toString() + \".php\"); testFile.create(new ByteArrayInputStream(data.getBytes()), true, null); project.refreshLocal(IResource.DEPTH_INFINITE, null); project.build(IncrementalProjectBuilder.FULL_BUILD, null); SymfonyTestPlugin.waitForIndexer(); return offset; }", "tokens": 187} {"id": 489054, "source": "method", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "protected void performDefaults() { super.performDefaults(); if (configurationBlock != null) { configurationBlock.performDefaults(); } }", "tokens": 28} {"id": 489070, "source": "method", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "public void dialogFieldChanged(DialogField field) { updateModel(field); }", "tokens": 18} {"id": 489098, "source": "method", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "public Key getPHPExecutableKey() { return exeKey; }", "tokens": 15} {"id": 489117, "source": "method", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "protected Control createContents(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayoutFactory.fillDefaults().equalWidth(false).numColumns(3).applyTo(container); GridDataFactory.fillDefaults().grab(true, true).applyTo(container); containerPath = new StringButtonDialogField(new IStringButtonAdapter() { @Override public void changeControlPressed(DialogField field) { openDialog(); } }); containerPath.setLabelText(\"Dumped container\"); containerPath.setButtonLabel(\"Browse\"); containerPath.doFillIntoGrid(container, 3); containerPath.getTextControl(null).setEnabled(false); LayoutUtil.setHorizontalGrabbing(containerPath.getTextControl(null)); IAdaptable element2 = getElement(); project = null; if (element2 instanceof IScriptProject) { project = ((IScriptProject)element2).getProject(); } else if (element2 instanceof IProject) { project = (IProject) element2; } loadContainer(); PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, SymfonyUiPlugin.PLUGIN_ID + \".\" + \"symfony_property_page\"); return container; }", "tokens": 253} {"id": 489125, "source": "method", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "public CreateClassCompletionProposal(IMarker marker) { try { className = (String) marker .getAttribute(SymfonyMarker.SERVICE_CLASS); this.marker = marker; } catch (CoreException e) { Logger.logException(e); } }", "tokens": 52} {"id": 489219, "source": "method", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "protected void scanForExistingProjectFile() throws IOException { IPath projectPath = sourcePath.append(\".project\"); if (projectPath.toFile().exists()) { ProjectDescriptionReader reader = new ProjectDescriptionReader(workspace); final ProjectDescription projectDescription = reader.read(projectPath); if (projectDescription != null && projectDescription.getName() != null) { getShell().getDisplay().asyncExec(new Runnable() { @Override public void run() { projectName = projectDescription.getName(); projectNameField.setTextWithoutUpdate(projectName); } }); } } }", "tokens": 116} {"id": 489393, "source": "method", "repo": "pulse00/twig-eclipse-plugin", "text": "public void setModel(IDOMModel model) { super.setModel(model); }", "tokens": 19} {"id": 489611, "source": "method", "repo": "pulse00/twig-eclipse-plugin", "text": "public String getTag() { BlockName name = getName(); if (name == null) { return \"\"; } return name.getValue(); }", "tokens": 29} {"id": 489680, "source": "method", "repo": "pulse00/twig-eclipse-plugin", "text": "public Object get(Attribute attr) { return attrs.get(attr); }", "tokens": 17} {"id": 489708, "source": "method", "repo": "pulse00/twig-eclipse-plugin", "text": "public String[] getParameterNames() { return getArguments().keySet().toArray(new String[getArguments().size()]); }", "tokens": 26} {"id": 489793, "source": "method", "repo": "pulse00/twig-eclipse-plugin", "text": "/**

Assumes that the given offset is at the beginning of a line that is commented and removes the comment prefix from the beginning of the line, leading whitespace on the line will not prevent this method from finishing correctly

*/ public void remove(IStructuredDocument document, int offset, int length, boolean removeEnclosing) throws BadLocationException { String content = document.get(offset, length); int origOffset = offset; int innerOffset = content.indexOf(OPEN_COMMENT); if (innerOffset > 0) { offset += innerOffset; } // remove the opening tag uncomment(document, offset, OPEN_COMMENT, -1, null); innerOffset = content.indexOf(CLOSE_COMMENT); if (innerOffset > 0) { origOffset += innerOffset; } // take into account the removed opening comment tag origOffset -= 3; // remove the closing tag uncomment(document, origOffset, CLOSE_COMMENT, -1, null); }", "tokens": 207} {"id": 489909, "source": "method", "repo": "pulse00/twig-eclipse-plugin", "text": "private void deleteQuote(IStructuredDocument document, DocumentCommand command, char removedChar) { int offset = command.offset; IStructuredDocumentRegion sdRegion = document.getRegionAtCharacterOffset(offset); if (sdRegion == null || sdRegion.getType() != TwigRegionTypes.TWIG_CONTENT) { return; } try { ITextRegion tRegion = sdRegion.getRegionAtCharacterOffset(offset); int regionStart = sdRegion.getStartOffset(tRegion); // in case of container we have the extract the PHPScriptRegion if (tRegion instanceof ITextRegionContainer) { ITextRegionContainer container = (ITextRegionContainer) tRegion; tRegion = container.getRegionAtCharacterOffset(offset); regionStart += tRegion.getStart(); } if (tRegion instanceof ITwigScriptRegion) { ITwigScriptRegion scriptRegion = (ITwigScriptRegion) tRegion; tRegion = scriptRegion.getTwigToken(offset - regionStart); if (tRegion == null || tRegion.getType() != TwigRegionTypes.TWIG_CONSTANT_ENCAPSED_STRING) { return; } if (offset != tRegion.getStart() + regionStart || (tRegion.getTextLength() != 2 && !isBetweenBackquotes(sdRegion, offset))) { // looking only for the cases where the user is trying to // remove the first quote out of two coupled ones. return; } char nextChar = document.getChar(offset + 1); if (nextChar != removedChar) { return; } command.length = 2; } } catch (BadLocationException e) { } }", "tokens": 331} {"id": 489937, "source": "method", "repo": "pulse00/twig-eclipse-plugin", "text": "protected void updateOccurrenceAnnotations(ITextSelection selection, TwigModuleDeclaration astRoot) { if (fOccurrencesFinderJob != null) fOccurrencesFinderJob.cancel(); if (!fMarkOccurrenceAnnotations) return; if (astRoot == null || selection == null || sourceViewer == null) return; IDocument document = sourceViewer.getDocument(); if (document == null) return; if (document.getLength() != astRoot.sourceEnd()) { return; } boolean hasChanged = false; if (document instanceof IDocumentExtension4) { int offset = selection.getOffset(); long currentModificationStamp = ((IDocumentExtension4) document).getModificationStamp(); IRegion markOccurrenceTargetRegion = fMarkOccurrenceTargetRegion; hasChanged = currentModificationStamp != fMarkOccurrenceModificationStamp; if (markOccurrenceTargetRegion != null && !hasChanged) { if (markOccurrenceTargetRegion.getOffset() <= offset && offset <= markOccurrenceTargetRegion.getOffset() + markOccurrenceTargetRegion.getLength()) return; } fMarkOccurrenceTargetRegion = ScriptWordFinder.findWord(document, offset); fMarkOccurrenceModificationStamp = currentModificationStamp; } OccurrenceLocation[] locations = null; ASTNode selectedNode = NodeFinder.perform(astRoot, selection.getOffset(), selection.getLength()); if (locations == null) { IOccurrencesFinder finder = new VariableFinder(); if (finder.initialize(astRoot, selectedNode) == null) { locations = finder.getOccurrences(); } } if (locations == null || locations.length == 0) { IOccurrencesFinder finder = new CallFinder(); if (finder.initialize(astRoot, selectedNode) == null) { locations = finder.getOccurrences(); } } if (locations == null || locations.length == 0) { IOccurrencesFinder finder = new StringFinder(); if (finder.initialize(astRoot, selectedNode) == null) { locations = finder.getOccurrences(); } } if (locations == null) { return; } fOccurrencesFinderJob = new OccurrencesFinderJob(document, locations, selection); // fOccurrencesFinderJob.setPriority(Job.DECORATE); // fOccurrencesFinderJob.setSystem(true); // fOccurrencesFinderJob.schedule(); fOccurrencesFinderJob.run(new NullProgressMonitor()); }", "tokens": 492} {"id": 490001, "source": "method", "repo": "pulse00/twig-eclipse-plugin", "text": "public int computeCaptionOffset(IDocument document) { DocumentCharacterIterator sequence = new DocumentCharacterIterator(document, offset, offset + length); return findFirstContent(sequence, 0); }", "tokens": 41} {"id": 490072, "source": "method", "repo": "pulse00/twig-eclipse-plugin", "text": "public IPreferenceStore getPreferenceStore() { return PreferenceConstants.getPreferenceStore(); }", "tokens": 16} {"id": 490113, "source": "method", "repo": "pulse00/twig-eclipse-plugin", "text": "public TwigBasePreferencePage() { super(); setPreferenceStore(DLTKUIPlugin.getDefault().getPreferenceStore()); setDescription(\"Code Formatting:\"); }", "tokens": 32} {"id": 490148, "source": "method", "repo": "pulse00/twig-eclipse-plugin", "text": "private OverlayPreferenceStore getOverlayStore() { return fOverlayStore; }", "tokens": 16} {"id": 490189, "source": "method", "repo": "purpurmc/purpur", "text": "public PlayerSetSpawnerTypeWithEggEvent(Player player, Block block, CreatureSpawner spawner, EntityType type) { super(player); this.block = block; this.spawner = spawner; this.type = type; }", "tokens": 49} {"id": 490449, "source": "method", "repo": "purpurmc/purpur", "text": "private void leavesSettings() { leavesInstantDecay = getBoolean(\"blocks.leaves.instant-decay\", leavesInstantDecay); }", "tokens": 26} {"id": 490673, "source": "method", "repo": "pxlsspace/pxls", "text": "public String getCallbackUrl() { return App.getConfig().getString(\"oauth.callbackBase\") + \"/\" + id; }", "tokens": 26} {"id": 490770, "source": "method", "repo": "pxlsspace/pxls", "text": "/** Gets an user that logs in by their signup IP. @param signupIP The user's IP on signup. @return The user. */ public Optional getSnipUserByIP(String signupIP) { return jdbi.withHandle(handle -> handle.select(\"SELECT * FROM users WHERE login_with_ip = true AND signup_ip = :signup_ip::INET\") .bind(\"signup_ip\", signupIP) .map(new DBUser.Mapper()) .findFirst()); }", "tokens": 118} {"id": 491086, "source": "method", "repo": "pxlsspace/pxls", "text": "public Error(String error, String message) { this.error = error; this.message = message; }", "tokens": 24} {"id": 491100, "source": "method", "repo": "pxlsspace/pxls", "text": "public Notification(Number id, String title, String body, Long time, Long expiry, String who) { this.id = id; this.title = title; this.body = body; this.time = time; this.expiry = expiry; this.who = who; }", "tokens": 60} {"id": 491137, "source": "method", "repo": "pxlsspace/pxls", "text": "public Collection getPixels() { return pixels; }", "tokens": 14} {"id": 491477, "source": "method", "repo": "qaiu/netdisk-fast-download", "text": "private static String processColumnAnnotation(Field field, String column) { if (field.isAnnotationPresent(Column.class)) { Column columnAnnotation = field.getAnnotation(Column.class); if (StringUtils.isNotBlank(columnAnnotation.name())) { column = columnAnnotation.name(); } } return column; }", "tokens": 64} {"id": 491616, "source": "method", "repo": "qaiu/netdisk-fast-download", "text": "public IzToolWithAuth(ShareLinkInfo shareLinkInfo) { super(shareLinkInfo); IzXffHeader.apply(header); }", "tokens": 29} {"id": 491803, "source": "method", "repo": "qiannianhuanxiang/DSHA", "text": "private File find(File parent, String relative) { File[] entries = parent.listFiles(); if (entries != null) for (File entry : entries) { File file = new File(entry, relative); if (file.isFile()) return file; } return null; }", "tokens": 58} {"id": 492036, "source": "method", "repo": "qiannianhuanxiang/DSHA", "text": "public int waitFor() throws InterruptedException { long delay = 10; while (true) { try { return exitValue(); } catch (IllegalThreadStateException running) { Thread.sleep(delay); delay = Math.min(100, delay * 2); } } }", "tokens": 61} {"id": 492093, "source": "method", "repo": "qiannianhuanxiang/DSHA", "text": "public boolean onCodePoint(int codePoint, boolean ctrlDownFromKeyboard, TerminalSession s) { return !inputAllowed(); }", "tokens": 28} {"id": 492255, "source": "method", "repo": "qiannianhuanxiang/DSHA", "text": "public void stableHomeKeepsUnusedLegacySettings() throws Exception { File root = temporary.newFolder(); fixture(root); put(root, UserDataLayout.STABLE + \"/settings.yaml\", \"stable original\"); new UserDataLayout(FS, root).choose(UserDataLayout.Home.STABLE); File operation = reset(root, null); assertEquals(\"{}\\n\", read(root, UserDataLayout.STABLE + \"/settings.yaml\")); assertEquals(\"model: original\\n\", read(root, SETTINGS)); assertEquals(\"stable original\", read(operation, \"previous/settings\")); }", "tokens": 126} {"id": 492370, "source": "method", "repo": "qiannianhuanxiang/DSHA", "text": "public void parsesExactRecordWithBothLineEndings() throws Exception { assertTrue( Rc1MigrationResult.allowsStart( Rc1MigrationResult.parse( \"notice\\r\\nDSHA_RC1_MIGRATION={\\\"status\\\":\\\"prepared\\\",\\\"protectionComplete\\\":true}\\r\\n\"))); assertTrue( Rc1MigrationResult.allowsStart( Rc1MigrationResult.parse( \"DSHA_RC1_MIGRATION={\\\"status\\\":\\\"already\\\",\\\"protectionComplete\\\":true}\\n\"))); }", "tokens": 106} {"id": 492380, "source": "method", "repo": "qiannianhuanxiang/DSHA", "text": "public void racingTaskAndMaintenanceCannotBothEnter() throws Exception { for (int repeat = 0; repeat < 40; repeat++) { RuntimeTaskRegistry registry = new RuntimeTaskRegistry(); CountDownLatch go = new CountDownLatch(1), attempted = new CountDownLatch(2), release = new CountDownLatch(1); AtomicInteger winners = new AtomicInteger(); Thread task = new Thread( () -> { RuntimeTaskRegistry.Token token = null; try { go.await(); token = registry.begin(true); winners.incrementAndGet(); } catch (IllegalStateException expected) { } catch (InterruptedException e) { throw new AssertionError(e); } finally { attempted.countDown(); try { release.await(); } catch (InterruptedException ignored) { } if (token != null) token.close(); } }); Thread maintenance = new Thread( () -> { RuntimeTaskRegistry.Maintenance fence = null; try { go.await(); fence = registry.tryEnterMaintenance(); if (fence != null) winners.incrementAndGet(); } catch (InterruptedException e) { throw new AssertionError(e); } finally { attempted.countDown(); try { release.await(); } catch (InterruptedException ignored) { } if (fence != null) fence.close(); } }); task.start(); maintenance.start(); go.countDown(); try { assertTrue(attempted.await(2, TimeUnit.SECONDS)); assertEquals(1, winners.get()); } finally { release.countDown(); task.join(); maintenance.join(); } assertEquals(0, registry.count()); } }", "tokens": 325} {"id": 492411, "source": "method", "repo": "qiannianhuanxiang/DSHA", "text": "public void closingThePageDoesNotEraseUndeletableCopyAccounting() { WebUploadSessionBudget budget = new WebUploadSessionBudget(); var copy = budget.beginBatch(1); budget.addBytes(copy, 5_000_000_000L); budget.close(); assertFalse(budget.canDeleteOwnedFiles()); budget.retainFailedCopy(copy); assertTrue(budget.canDeleteOwnedFiles()); assertEquals(5_000_000_000L, budget.committedBytes()); assertEquals(1, budget.committedFiles()); assertFalse(budget.commit(copy)); assertThrows(WebUploadSessionBudget.SessionClosedException.class, () -> budget.beginBatch(1)); budget.rollback(copy); assertEquals(5_000_000_000L, budget.committedBytes()); }", "tokens": 183} {"id": 492421, "source": "method", "repo": "qiannianhuanxiang/DSHA", "text": "public void onPause() { refreshHandler.removeCallbacks(refreshInvalidated); super.onPause(); }", "tokens": 21} {"id": 492479, "source": "method", "repo": "qiniu/android-sdk", "text": "public void testCount() { assertTrue(headers.byteCount() > 0); }", "tokens": 19} {"id": 492509, "source": "method", "repo": "qiniu/android-sdk", "text": "public void testUnfreeze() { String host = \"baidu.com\"; String type = host; UploadServerFreezeManager.getInstance().freezeType(type, 10); boolean isFrozen = UploadServerFreezeManager.getInstance().isTypeFrozen(type); assertTrue(isFrozen); UploadServerFreezeManager.getInstance().unfreezeType(type); isFrozen = UploadServerFreezeManager.getInstance().isTypeFrozen(type); assertTrue(isFrozen == false); }", "tokens": 98} {"id": 492609, "source": "method", "repo": "qiniu/android-sdk", "text": "/** pumpMultiObjects @param repo repo @param data data @param token token @param handler handler */ public void pumpMultiObjects(String repo, Object[] data, String token, PumpCompleteHandler handler) { StringBuilder b = Points.formatPoints(data); send(repo, b, token, handler); }", "tokens": 69} {"id": 492723, "source": "method", "repo": "qiniu/android-sdk", "text": "synchronized void clearIpGroupList() { ipGroupList = null; }", "tokens": 16} {"id": 492727, "source": "method", "repo": "qiniu/android-sdk", "text": "private synchronized boolean isFrozenByDate(Date date) { boolean isFrozen = true; if (freezeDate == null || freezeDate.getTime() < date.getTime()) { isFrozen = false; } return isFrozen; }", "tokens": 48} {"id": 492743, "source": "method", "repo": "qiniu/android-sdk", "text": "protected void addRegionRequestMetricsOfOneFlow(UploadRegionRequestMetrics metrics) { if (metrics == null) { return; } if (this.currentRegionRequestMetrics == null) { this.currentRegionRequestMetrics = metrics; } else { this.currentRegionRequestMetrics.addMetrics(metrics); } }", "tokens": 66} {"id": 492813, "source": "method", "repo": "qiniu/android-sdk", "text": "private UploadBlock nextUploadBlockFormBlockList() { if (blockList == null || blockList.size() == 0) { return null; } final UploadBlock[] blocks = {null}; blockList.enumerateObjects(new ListVector.EnumeratorHandler() { @Override public boolean enumerate(UploadBlock block) { UploadData data = block.nextUploadDataWithoutCheckData(); if (data != null) { blocks[0] = block; return true; } else { return false; } } }); return blocks[0]; }", "tokens": 121} {"id": 492981, "source": "method", "repo": "qiniu/happy-dns-android", "text": "public static boolean needHttpDns() { try { TimeZone zone = TimeZone.getDefault(); String id = zone.getID(); return (\"Asia/Shanghai\".equals(id) || \"Asia/Chongqing\".equals(id) || \"Asia/Harbin\".equals(id) || \"Asia/Urumqi\".equals(id)); } catch (Exception e) { return false; } }", "tokens": 102} {"id": 493160, "source": "method", "repo": "qiniu/java-sdk", "text": "public DeviceManager(Auth auth, String apiServer, Client client) { this.auth = auth; this.apiServer = apiServer; this.client = client; }", "tokens": 37} {"id": 493425, "source": "method", "repo": "qiniu/java-sdk", "text": "public static String urlEncode(String s, Charset enc) { return urlEncode(s, enc, PLUS_NON_ENCODING); }", "tokens": 31} {"id": 493562, "source": "method", "repo": "qinming99/dst-admin", "text": "public static String ofNULL(Object obj, String defaultStr) { return obj == null ? defaultStr : obj.toString(); }", "tokens": 28} {"id": 494084, "source": "method", "repo": "qmetry/qaf", "text": "public void setStepCompositer(TestStepCompositer stepCaller) { this.stepCaller = stepCaller; }", "tokens": 24} {"id": 494096, "source": "method", "repo": "qmetry/qaf", "text": "public void onFailure(StepExecutionTracker stepExecutionTracker) { if (!ignoreDefaultListener) { logger.error(\"Failure \" + getStepInfo(stepExecutionTracker.getStep()), stepExecutionTracker.getException()); } }", "tokens": 44} {"id": 494251, "source": "method", "repo": "qmetry/qaf", "text": "private Browsers(String type) { options = new HashMap(); this.type=type; }", "tokens": 25} {"id": 494253, "source": "method", "repo": "qmetry/qaf", "text": "private LaunchOptions getLaunchOptions() { Gson gson = new GsonBuilder().create(); Map capabilities = new HashMap(options); // capabilities provided for all driver Map extraCapabilities = gson .fromJson(ApplicationProperties.DRIVER_ADDITIONAL_CAPABILITIES.getStringVal(\"{}\"), Map.class); capabilities.putAll(extraCapabilities); // individual capability property for all driver Configuration config = ConfigurationManager.getBundle() .subset(ApplicationProperties.DRIVER_CAPABILITY_PREFIX.key); capabilities.putAll(new ConfigurationMap(config)); //#332 add default capabilities for standard driver if(!name().equalsIgnoreCase(other.name())){ String driverCapsKey = String.format(ApplicationProperties.DRIVER_ADDITIONAL_CAPABILITIES_FORMAT.key, name()); extraCapabilities = gson.fromJson(ConfigurationManager.getBundle().getString(driverCapsKey, \"{}\"), Map.class); capabilities.putAll(extraCapabilities); } // capabilities specific to this driver String driverCapsKey = String.format(ApplicationProperties.DRIVER_ADDITIONAL_CAPABILITIES_FORMAT.key, browserName); extraCapabilities = gson.fromJson(ConfigurationManager.getBundle().getString(driverCapsKey, \"{}\"), Map.class); capabilities.putAll(extraCapabilities); // individual capability property with driver name prefix String driverCapKey = String.format(ApplicationProperties.DRIVER_CAPABILITY_PREFIX_FORMAT.key, browserName); config = ConfigurationManager.getBundle().subset(driverCapKey); capabilities.putAll(new ConfigurationMap(config)); for(String key : capabilities.keySet()){ Object value = capabilities.get(key); if(value instanceof String){ capabilities.put(key, ConfigurationManager.getBundle().getSubstitutor().replace(value)); } } LaunchOptions launchOptions = gson.fromJson(gson.toJsonTree(capabilities), LaunchOptions.class); return launchOptions; }", "tokens": 398} {"id": 494573, "source": "method", "repo": "qmetry/qaf", "text": "/** switches the webdriver context to the parent frame @return */ public static Object switchToParentFrame() { return new WebDriverTestBase().getDriver().switchTo().parentFrame(); }", "tokens": 36} {"id": 494619, "source": "method", "repo": "qmetry/qaf", "text": "public void excelDataWithSheetName() { Object[][] actualResult = PoiExcelUtil.getExcelDataAsMap(\"resources/testdata.xlsx\", \"AnotherSheet\"); Validator.assertThat(\"Rows:\", actualResult.length, Matchers.equalTo(4)); for (int i = 0; i < actualResult.length; i++) { @SuppressWarnings(\"rawtypes\") Map map = (Map) actualResult[i][0]; Validator.verifyThat(\"Columns:\", map.keySet().size(), Matchers.equalTo(7)); Validator.verifyThat(\"Id:\", map.get(\"Id\"), Matchers.equalTo((double) (i + 1))); Validator.verifyThat(\"FirstName:\", map.get(\"firstname\"), Matchers.equalTo(\"Test\" + (i + 1))); Validator.verifyThat(\"LastName:\", map.get(\"lastname\"), Matchers.equalTo(\"L\" + (i + 1))); Validator.verifyThat(\"Activated:\", map.get(\"activated\"), Matchers.equalTo((i % 2 == 0))); try { Validator.verifyThat(\"Created:\", map.get(\"created\"), Matchers.equalTo(DateUtil.parseDate((i + 1) + \"/03/2021\", \"dd/MM/yy\"))); } catch (ParseException e) { e.printStackTrace(); } Validator.verifyThat(\"Version:\", map.get(\"version\"), Matchers.equalTo((1.0 + ((i + 1.0) / 10)))); Validator.verifyThat(\"Email:\", map.get(\"email\"), Matchers.equalTo(String.format(\"test%d.l%d@test.com\", (i + 1), (i + 1)))); } }", "tokens": 378} {"id": 494699, "source": "method", "repo": "qmetry/qaf", "text": "private RuntimeTestStep(String description, RuntimeTestStepProvider stepImpl, Map metaData) { super(description, description); this.stepProvider = stepImpl; if (metaData != null) { this.metaData = new HashMap(metaData); } }", "tokens": 60} {"id": 494977, "source": "method", "repo": "qos-ch/slf4j", "text": "/** Instantiate a level object. @param level a level as in int @param levelStr a levelStr @param syslogEquivalent the syslog equivalent level integer */ protected Priority(int level, String levelStr, int syslogEquivalent) { this.level = level; this.levelStr = levelStr; this.syslogEquivalent = syslogEquivalent; }", "tokens": 72} {"id": 495098, "source": "method", "repo": "qos-ch/slf4j", "text": "public void error(Marker marker, String format, Object... arguments) { if (isErrorEnabled(marker)) { handleArgArrayCall(Level.ERROR, marker, format, arguments); } }", "tokens": 42} {"id": 495119, "source": "method", "repo": "qos-ch/slf4j", "text": "public FormattingTuple(String message, Object[] argArray, Throwable throwable) { this.message = message; this.throwable = throwable; this.argArray = argArray; }", "tokens": 38} {"id": 495154, "source": "method", "repo": "qos-ch/slf4j", "text": "/** A NOP implementation. */ final public void debug(String format, Object arg) { // NOP }", "tokens": 22} {"id": 495198, "source": "method", "repo": "qos-ch/slf4j", "text": "static private TargetChoice getTargetChoice() { String reportStreamStr = System.getProperty(SLF4J_INTERNAL_REPORT_STREAM_KEY); if(reportStreamStr == null || reportStreamStr.isEmpty()) { return TargetChoice.Stderr; } for(String s : SYSOUT_KEYS) { if(s.equalsIgnoreCase(reportStreamStr)) return TargetChoice.Stdout; } return TargetChoice.Stderr; }", "tokens": 89} {"id": 495278, "source": "method", "repo": "qos-ch/slf4j", "text": "public void log(Supplier messageSupplier) { if(messageSupplier == null) { log((String) null); } else { log(messageSupplier.get()); } }", "tokens": 40} {"id": 495370, "source": "method", "repo": "qos-ch/slf4j", "text": "public void testLoggerNameList() { factory.getLogger(\"foo1\"); factory.getLogger(\"foo2\"); Set expectedNames = new HashSet<>(Arrays.asList(\"foo1\", \"foo2\")); Set actualNames = new HashSet<>(factory.getLoggerNames()); assertEquals(expectedNames, actualNames); }", "tokens": 68} {"id": 495402, "source": "method", "repo": "qos-ch/slf4j", "text": "/** Delegate to the appropriate method of the underlying logger. */ public void info(String msg, Throwable t) { if (!logger.isInfoEnabled()) return; if (instanceofLAL) { ((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.INFO_INT, msg, null, t); } else { logger.info(msg, t); } }", "tokens": 82} {"id": 495449, "source": "method", "repo": "qos-ch/slf4j", "text": "public void put(Profiler profiler) { put(profiler.getName(), profiler); }", "tokens": 18} {"id": 495484, "source": "method", "repo": "qos-ch/slf4j", "text": "public void testSelectDurationUnitForDisplay() throws InterruptedException { assertEquals(DurationUnit.NANOSECOND, Util.selectDurationUnitForDisplay(10)); assertEquals(DurationUnit.NANOSECOND, Util.selectDurationUnitForDisplay(9 * Util.NANOS_IN_ONE_MICROSECOND)); assertEquals(DurationUnit.MICROSECOND, Util.selectDurationUnitForDisplay(11 * Util.NANOS_IN_ONE_MICROSECOND)); assertEquals(DurationUnit.MICROSECOND, Util.selectDurationUnitForDisplay(9 * Util.NANOS_IN_ONE_MILLISECOND)); assertEquals(DurationUnit.MILLISSECOND, Util.selectDurationUnitForDisplay(11 * Util.NANOS_IN_ONE_MILLISECOND)); assertEquals(DurationUnit.SECOND, Util.selectDurationUnitForDisplay(11 * Util.NANOS_IN_ONE_SECOND)); }", "tokens": 190} {"id": 495658, "source": "method", "repo": "qos-ch/slf4j", "text": "/** Are {@code warn} messages currently enabled? */ public boolean isWarnEnabled() { return isLevelEnabled(LOG_LEVEL_WARN); }", "tokens": 31} {"id": 495712, "source": "method", "repo": "qos-ch/slf4j", "text": "public void testInvokingSetContextMap_WithANullMap_SLF4J_414() { mdc.setContextMap(null); }", "tokens": 34} {"id": 495842, "source": "method", "repo": "QuanhuZeYu/Qz-Miner", "text": "public List categories(int dimension) { return candidateSource.categories(dimension); }", "tokens": 25} {"id": 495987, "source": "method", "repo": "QuanhuZeYu/Qz-Miner", "text": "private static boolean isFunctionSignatureLine(String trimmed) { return trimmed.endsWith(\")\") && (trimmed.indexOf('(') > 0) && !trimmed.contains(\"=\") && !trimmed.startsWith(\"return\"); }", "tokens": 49} {"id": 496036, "source": "method", "repo": "QuanhuZeYu/Qz-Miner", "text": "public void cropExtensionUsesOnlyCropTargetGate() { Assert.assertTrue(matcher(ChainSubMode.INTERACT_CROP, false, true, true).matches(null, TARGET)); Assert.assertFalse(matcher(ChainSubMode.INTERACT_CROP, false, true, false).matches(null, TARGET)); }", "tokens": 69} {"id": 496090, "source": "method", "repo": "QuanhuZeYu/Qz-Miner", "text": "private TestBlock() { super(Material.rock); }", "tokens": 13} {"id": 496234, "source": "method", "repo": "querz/mcaselector", "text": "public boolean showCoordinates() { return showCoordinates; }", "tokens": 12} {"id": 496246, "source": "method", "repo": "querz/mcaselector", "text": "public String toString() { // check if parent directories match world folder structure StringBuilder parentPath = new StringBuilder(); File check = recentWorld.getParentFile(); int i = parents.length - 1; for (; i >= -1; i--) { if (check == null) { break; } parentPath.insert(0, check.getName() + File.separator); if (i >= 0 && !check.getName().equals(parents[i])) { break; } check = check.getParentFile(); } // this is dimensions/minecraft folder structure if (i < 0) { return parentPath + recentWorld.getName(); } String name = recentWorld.getName(); if (dimensionFolderPattern.matcher(name).matches()) { File parent = recentWorld.getParentFile(); if (parent == null) { return name; } return parent.getName() + \"/\" + name; } return name; }", "tokens": 193} {"id": 496250, "source": "method", "repo": "querz/mcaselector", "text": "public void setShade(boolean shade) { this.shade = shade; }", "tokens": 19} {"id": 496411, "source": "method", "repo": "querz/mcaselector", "text": "public boolean hasNext() { return index < value.length(); }", "tokens": 14} {"id": 496514, "source": "method", "repo": "querz/mcaselector", "text": "public String getShortMultiValues() { if (rawMultiValuesShort != null) { return rawMultiValuesShort; } if (rawMultiValues == null) { return null; } if (rawMultiValues.length() > 50) { return rawMultiValuesShort = rawMultiValues.substring(0, 50) + \"...\"; } return rawMultiValuesShort = rawMultiValues; }", "tokens": 86} {"id": 496848, "source": "method", "repo": "querz/mcaselector", "text": "public static void applyIntIfPresent(CompoundTag root, String key, int offset) { Integer value; if ((value = intFromCompound(root, key)) != null) { root.putInt(key, value + offset); } }", "tokens": 49} {"id": 496863, "source": "method", "repo": "querz/mcaselector", "text": "public boolean matchBiomes(ChunkData data, Collection biomes) { IntArrayTag biomesTag = Helper.tagFromLevelFromRoot(Helper.getRegion(data), \"Biomes\"); if (biomesTag == null) { return false; } filterLoop: for (BiomeRegistry.BiomeIdentifier identifier : biomes) { for (int dataID : biomesTag.getValue()) { if (identifier.matches(dataID)) { continue filterLoop; } } return false; } return true; }", "tokens": 108} {"id": 497072, "source": "method", "repo": "querz/nbt", "text": "default String toString(T object) throws IOException { Writer writer = new StringWriter(); toWriter(object, writer); writer.flush(); return writer.toString(); }", "tokens": 35} {"id": 497138, "source": "method", "repo": "querz/nbt", "text": "/** Serializes this object to an .mca file. This method does not perform any cleanups on the data. @param raf The {@code RandomAccessFile} to write to. @param changeLastUpdate Whether it should update all timestamps that show when this file was last updated. @return The amount of chunks written to the file. @throws IOException If something went wrong during serialization. */ public int serialize(RandomAccessFile raf, boolean changeLastUpdate) throws IOException { int globalOffset = 2; int lastWritten = 0; int timestamp = (int) (System.currentTimeMillis() / 1000L); int chunksWritten = 0; int chunkXOffset = MCAUtil.regionToChunk(regionX); int chunkZOffset = MCAUtil.regionToChunk(regionZ); if (chunks == null) { return 0; } for (int cx = 0; cx < 32; cx++) { for (int cz = 0; cz < 32; cz++) { int index = getChunkIndex(cx, cz); Chunk chunk = chunks[index]; if (chunk == null) { continue; } raf.seek(4096 * globalOffset); lastWritten = chunk.serialize(raf, chunkXOffset + cx, chunkZOffset + cz); if (lastWritten == 0) { continue; } chunksWritten++; int sectors = (lastWritten >> 12) + (lastWritten % 4096 == 0 ? 0 : 1); raf.seek(index * 4); raf.writeByte(globalOffset >>> 16); raf.writeByte(globalOffset >> 8 & 0xFF); raf.writeByte(globalOffset & 0xFF); raf.writeByte(sectors); // write timestamp raf.seek(index * 4 + 4096); raf.writeInt(changeLastUpdate ? timestamp : chunk.getLastMCAUpdate()); globalOffset += sectors; } } // padding if (lastWritten % 4096 != 0) { raf.seek(globalOffset * 4096 - 1); raf.write(0); } return chunksWritten; }", "tokens": 455} {"id": 497197, "source": "method", "repo": "querz/nbt", "text": "/** @return The sky light values of this Section */ public byte[] getSkyLight() { return skyLight; }", "tokens": 25} {"id": 497221, "source": "method", "repo": "querz/nbt", "text": "private static IntArrayTag readIntArray(LittleEndianNBTInputStream in) throws IOException { int l = in.readInt(); int[] data = new int[l]; IntArrayTag iat = new IntArrayTag(data); for (int i = 0; i < l; i++) { data[i] = in.readInt(); } return iat; }", "tokens": 76} {"id": 497460, "source": "method", "repo": "querz/nbt", "text": "public IntArrayTag clone() { return new IntArrayTag(Arrays.copyOf(getValue(), length())); }", "tokens": 23} {"id": 497506, "source": "method", "repo": "querz/nbt", "text": "public ListTag asIntArrayTagList() { return asTypedList(IntArrayTag.class); }", "tokens": 25} {"id": 497746, "source": "method", "repo": "querz/nbt", "text": "public void testSetValue() { ShortTag t = new ShortTag(); t.setValue((short) 123); assertEquals(123, t.asShort()); }", "tokens": 39} {"id": 497749, "source": "method", "repo": "querz/nbt", "text": "public void testClone() { ShortTag t = new ShortTag(Short.MAX_VALUE); ShortTag tc = t.clone(); assertTrue(t.equals(tc)); assertFalse(t == tc); }", "tokens": 46} {"id": 497760, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "default Class getSettingsClass() { return null; }", "tokens": 13} {"id": 497816, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "public ServerPluginChannelManager getPluginChannelManager() { return pluginChannels; }", "tokens": 16} {"id": 497853, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "private static int listSettings(ServerCommandSource source, Text title, Iterable> rules) { if (source.getEntity() instanceof ServerPlayerEntity) { title.getStyle().withFormatting(Formatting.BOLD); m(source, title.copy()); for (ParsedRule rule : rules) { m(source, displayInteractiveSetting(rule)); } } else { m(source, title); for (ParsedRule rule : rules) { m(source, s(\"- \" + rule.toString())); } } return 1; }", "tokens": 113} {"id": 497978, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "public void setStep(int ticks) { if (ticks <= 0) throw new IllegalArgumentException(\"Step amount must be positive\"); paused = false; stepAmount = ticks + 1; if (!isClient) TICK_STEP_PUBSUB_PROVIDER.publish(); }", "tokens": 57} {"id": 498007, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "private ItemStack handleGlassBottle(BlockPointer blockPointer, ItemStack stack, ServerWorld world, BlockPos target, BlockState state) { LeveledCauldronBlock.decrementFluidLevel(state, world, target); stack.decrement(1); this.setSuccess(true); if(stack.isEmpty()){ return PotionUtil.setPotion(new ItemStack(Items.POTION), Potions.WATER); } else { if (((DispenserBlockEntity) blockPointer.getBlockEntity()).addToFirstFreeSlot(new ItemStack(Items.POTION)) < 0) { super.dispenseSilently(blockPointer, PotionUtil.setPotion(new ItemStack(Items.POTION), Potions.WATER)); } } return stack; }", "tokens": 148} {"id": 498188, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "private void quickcarpet$connectionTimeout$storeStart(MinecraftServer server, ClientConnection connection, CallbackInfo ci) { timeoutStart = System.currentTimeMillis(); }", "tokens": 31} {"id": 498220, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "private boolean quickcarpet$dustOnPistons$fakeSolidBlock2(BlockState blockState, BlockView world, BlockPos pos) { return fakeSolidBlock(blockState, world, pos); }", "tokens": 38} {"id": 498234, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "private void quickcarpet$flippinCactus$useCactus(ServerPlayerEntity player, World world, ItemStack stack, Hand hand, BlockHitResult hit, CallbackInfoReturnable cir) { if (stack.getItem() != Items.CACTUS || !Settings.flippinCactus) return; ItemUsageContext usageContext = new ItemUsageContext(player, hand, hit); if (BlockRotator.flipBlock(usageContext)) { cir.setReturnValue(ActionResult.PASS); cir.cancel(); } }", "tokens": 110} {"id": 498268, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "private void quickcarpet$log$damage$modify$cooldownPart(DamageSource source, float amount, CallbackInfoReturnable cir) { DamageLogHelper.modify((LivingEntity) (Object) this, source, amount, amount - lastDamageTaken, \"cooldown\"); }", "tokens": 57} {"id": 498351, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "private void quickcarpet$renewableFromAnvil$onTick(CallbackInfo ci, Block block, BlockPos pos) { if (this.block.isIn(BlockTags.ANVIL)) { BlockPos posBelow = BlockPos.ofFloored(this.getX(), this.getY() - 0.06, this.getZ()); Block blockBelow = this.world.getBlockState(posBelow).getBlock(); if (blockBelow == Blocks.COBBLESTONE) { if (Settings.renewableSand == Settings.RenewableGravelOrSandOption.ANVIL) { world.breakBlock(posBelow, false); world.setBlockState(posBelow, Blocks.SAND.getDefaultState(), 3); } else if (Settings.renewableGravel == Settings.RenewableGravelOrSandOption.ANVIL) { world.breakBlock(posBelow, false); world.setBlockState(posBelow, Blocks.GRAVEL.getDefaultState(), 3); } } else if (blockBelow == Blocks.FROSTED_ICE && Settings.anvilledIce > 0) { if (++frostedIceCount < Settings.anvilledIce) { world.breakBlock(posBelow, false); onGround = false; ci.cancel(); } else { world.breakBlock(posBelow, false); world.setBlockState(posBelow, Blocks.ICE.getDefaultState(), 3); } } else if (blockBelow == Blocks.ICE && Settings.anvilledPackedIce > 0) { if (++iceCount < Settings.anvilledPackedIce) { world.breakBlock(posBelow, false); onGround = false; ci.cancel(); } else { world.breakBlock(posBelow, false); world.setBlockState(posBelow, Blocks.PACKED_ICE.getDefaultState(), 3); } } else if (blockBelow == Blocks.PACKED_ICE && Settings.anvilledBlueIce > 0) { if (++packedIceCount < Settings.anvilledBlueIce) { world.breakBlock(posBelow, false); onGround = false; ci.cancel(); } else { world.breakBlock(posBelow, false); world.setBlockState(posBelow, Blocks.BLUE_ICE.getDefaultState(), 3); } } } }", "tokens": 465} {"id": 498370, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "private int quickcarpet$stackableShulkerBoxesInHoppers$getMaxCount$set(ItemStack stack) { return NBTHelper.getMaxCountForRedstone(stack); }", "tokens": 34} {"id": 498398, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "public Identifier[] getChannels() { return new Identifier[] {CHANNEL}; }", "tokens": 16} {"id": 498491, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "public boolean getBoolValue() { if (type == boolean.class) return (Boolean) get(); if (type.isAssignableFrom(Number.class)) return ((Number) get()).doubleValue() > 0; return false; }", "tokens": 49} {"id": 498546, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "public void startEntity(World world, EntityType type) { getMeasurement(world).startEntity(type); }", "tokens": 26} {"id": 498618, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "public static Iterable> iterateSuperClasses(Class start, Class base) { return () -> new AbstractIterator<>() { private Class cls; @Override protected Class computeNext() { if (cls == null) { cls = start; return start; } if (cls == base) { return endOfData(); } cls = (Class) cls.getSuperclass(); return cls; } }; }", "tokens": 111} {"id": 498633, "source": "method", "repo": "quickcarpet/quickcarpet", "text": "public StatHelper(MinecraftServer server) { this.server = server; }", "tokens": 17} {"id": 498796, "source": "method", "repo": "raeleus/skin-composer", "text": "public void setClassDeleteButtonDisabled(boolean disabled) { classDeleteButton.setDisabled(disabled); if (disabled) { if (classDeleteButton.getListeners().contains(handListener, true)) { classDeleteButton.removeListener(handListener); } } else { if (!classDeleteButton.getListeners().contains(handListener, true)) { classDeleteButton.addListener(handListener); } } }", "tokens": 82} {"id": 498854, "source": "method", "repo": "raeleus/skin-composer", "text": "public CustomStyle getParentStyle() { return parentStyle; }", "tokens": 13} {"id": 498901, "source": "method", "repo": "raeleus/skin-composer", "text": "public StyleProperty(StyleProperty styleProperty) { this.type = styleProperty.type; this.name = styleProperty.name; this.optional = styleProperty.optional; this.value = styleProperty.value; }", "tokens": 48} {"id": 499069, "source": "method", "repo": "raeleus/skin-composer", "text": "public void sliderReset() { processUndoable(new SliderResetUndoable()); }", "tokens": 17} {"id": 499261, "source": "method", "repo": "raeleus/skin-composer", "text": "public HorizontalGroupFillUndoable(boolean fill) { this.fill = fill; dialog = DialogSceneComposer.dialog; horizontalGroup = (DialogSceneComposerModel.SimHorizontalGroup) dialog.simActor; previousFill = horizontalGroup.fill; }", "tokens": 47} {"id": 499444, "source": "method", "repo": "raeleus/skin-composer", "text": "public String getRedoString() { return \"Redo \\\"Add Widget for Stack\\\"\"; }", "tokens": 19} {"id": 499455, "source": "method", "repo": "raeleus/skin-composer", "text": "public TableNameUndoable(String name) { dialog = DialogSceneComposer.dialog; table = (DialogSceneComposerModel.SimTable) dialog.simActor; if (name != null && name.equals(\"\")) { name = null; } this.name = name; previousName = table.name; }", "tokens": 61} {"id": 500055, "source": "method", "repo": "raiman/sikulix1", "text": "public static String inputText(String msg, String text) { return inputText(msg, \"\", 0, 0, text); }", "tokens": 30} {"id": 500384, "source": "method", "repo": "raiman/sikulix1", "text": "public boolean cancel(final String id) { Task task = allTasks.get(id); if (task != null) { synchronized (task) { if (task.isWaiting()) { task.updateStatus(Task.Status.CANCELED); task.notify(); return true; } else { SikulixServer.dolog(-1, \"could not cancel the task: %s\", id); return false; } } } else { SikulixServer.dolog(-1, \"the task is not found: %s\", id); return false; } }", "tokens": 120} {"id": 500685, "source": "method", "repo": "ralscha/blog2019", "text": "public String getServerPrivateKeyPath() { return this.serverPrivateKeyPath; }", "tokens": 16} {"id": 500806, "source": "method", "repo": "randoop/randoop", "text": "/** Adds {@link Precondition} objects from the list to this {@link OperationSpecification}. @param specifications the list of {@link Precondition} objects */ public void addParamSpecifications(List specifications) { preSpecifications.addAll(specifications); }", "tokens": 58} {"id": 500822, "source": "method", "repo": "randoop/randoop", "text": "public TypeTuple getInputTypes() { return inputTypes; }", "tokens": 13} {"id": 500865, "source": "method", "repo": "randoop/randoop", "text": "/** Returns the set of seed values with the given raw type. @param type the type @return the seed values with the given raw type */ static Set getSeeds(Type type) { Set result = new LinkedHashSet<>(); for (Object seed : primitiveSeeds) { if (type.isAssignableFromTypeOf(seed)) { result.add(seed); } } return result; }", "tokens": 85} {"id": 500935, "source": "method", "repo": "randoop/randoop", "text": "/** Print a verbose representation of the model to {@code out}. @param out the Writer on which to produce output */ public void dumpModel(Writer out) { try { out.write(String.format(\"Model with hashcode %s:%n\", hashCode())); out.write(String.format(\" classTypes = %s%n\", classTypes)); out.write(String.format(\" inputTypes = %s%n\", inputTypes)); out.write(String.format(\" coveredClassesGoal = %s%n\", coveredClassesGoal)); out.write(String.format(\" scopeToLiteralStatistics = %s%n\", scopeToLiteralStatistics)); out.write(String.format(\" annotatedTestValues = %s%n\", annotatedTestValues)); out.write(String.format(\" contracts = %s%n\", contracts)); out.write(String.format(\" omitMethods = [%n\")); for (Pattern p : omitMethods) { out.write(String.format(\" %s%n\", p)); } out.write(String.format(\" ]%n\")); // Use logOperations instead: out.write(String.format(\" operations = %s%n\", operations)); logOperations(out); } catch (IOException ioe) { throw new Error(ioe); } }", "tokens": 274} {"id": 501017, "source": "method", "repo": "randoop/randoop", "text": "/** Returns the list of reference type arguments of this type if there are no wildcards. @return the list of reference types that are arguments to this type */ List getReferenceArguments() { return CollectionsPlume.mapList( (TypeArgument argument) -> argument.isWildcard() ? ((WildcardArgument) argument).getWildcardType() : ((ReferenceArgument) argument).getReferenceType(), argumentList); }", "tokens": 91} {"id": 501377, "source": "method", "repo": "randoop/randoop", "text": "public E poll() { return q.pollFirst(); }", "tokens": 13} {"id": 501422, "source": "method", "repo": "randoop/randoop", "text": "/** Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list. @param index the index of the element to be removed @return the element previously at the specified position @throws IndexOutOfBoundsException {@inheritDoc} */ public E remove(int index) { checkElementIndex(index); return unlink(node(index)); }", "tokens": 93} {"id": 501544, "source": "method", "repo": "randoop/randoop", "text": "public void testEval1() { RatPoly zero = new RatPoly(); RatPoly one = new RatPoly(1, 0); RatPoly _X = new RatPoly(1, 1); RatPoly _2X = new RatPoly(2, 1); RatPoly _XSq = new RatPoly(1, 2); RatPoly _XSq_minus_2X = _XSq.sub(_2X); assertEquals(\" 0 at 1 \", 0.0, zero.eval(1.0), 0.0001); }", "tokens": 141} {"id": 501567, "source": "method", "repo": "randoop/randoop", "text": "public void setTheArrayField(int[] a) { thePublicArray = a; }", "tokens": 20} {"id": 501730, "source": "method", "repo": "react-native-google-cast/react-native-google-cast", "text": "public void pause(@Nullable final ReadableMap customData, final Promise promise) { with.withX(new With.WithXPromisify() { @Override public PendingResult execute(RemoteMediaClient client) { return client.pause(RNGCJSONObject.fromJson(customData)); } }, promise); }", "tokens": 68} {"id": 501921, "source": "method", "repo": "react-native-share/react-native-share", "text": "public static boolean hasValidKey(String key, ReadableMap options) { return options != null && options.hasKey(key) && !options.isNull(key); }", "tokens": 36} {"id": 502036, "source": "method", "repo": "react-native-webrtc/react-native-webrtc", "text": "public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) { ThreadUtils.runOnExecutor(() -> { WritableMap params = Arguments.createMap(); params.putInt(\"pcId\", id); params.putString(\"iceConnectionState\", iceConnectionStateString(iceConnectionState)); webRTCModule.sendEvent(\"peerConnectionIceConnectionChanged\", params); }); }", "tokens": 76} {"id": 502068, "source": "method", "repo": "react-native-webrtc/react-native-webrtc", "text": "public static ReadableMap serializeReceiver(int id, RtpReceiver receiver) { WritableMap res = Arguments.createMap(); res.putString(\"id\", receiver.id()); res.putInt(\"peerConnectionId\", id); if (receiver.track() != null) { res.putMap(\"track\", SerializeUtils.serializeTrack(id, receiver.track())); } res.putMap(\"rtpParameters\", SerializeUtils.serializeRtpParameters(receiver.getParameters())); return res; }", "tokens": 97} {"id": 502142, "source": "method", "repo": "react-native-webrtc/react-native-webrtc", "text": "public WritableMap createDataChannel(int peerConnectionId, String label, ReadableMap config) { try { return (WritableMap) ThreadUtils .submitToExecutor((Callable) () -> { PeerConnectionObserver pco = mPeerConnectionObservers.get(peerConnectionId); if (pco == null || pco.getPeerConnection() == null) { Log.d(TAG, \"createDataChannel() peerConnection is null\"); return null; } else { return pco.createDataChannel(label, config); } }) .get(); } catch (ExecutionException | InterruptedException e) { return null; } }", "tokens": 135} {"id": 502293, "source": "method", "repo": "ReaJason/MemShellParty", "text": "public static byte[] gzipDecompress(byte[] compressedData) { ByteArrayOutputStream out = new ByteArrayOutputStream(); GZIPInputStream gzipInputStream = null; try { gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(compressedData)); byte[] buffer = new byte[4096]; int n; while ((n = gzipInputStream.read(buffer)) > 0) { out.write(buffer, 0, n); } return out.toByteArray(); } catch (Exception e) { throw new RuntimeException(e); } finally { try { if (gzipInputStream != null) { gzipInputStream.close(); } out.close(); } catch (Exception ignored) { } } }", "tokens": 139} {"id": 502408, "source": "method", "repo": "ReaJason/MemShellParty", "text": "public Mono filter(ServerWebExchange exchange, WebFilterChain chain) { String value = exchange.getRequest().getHeaders().getFirst(headerName); if (value == null || !value.contains(headerValue)) { return chain.filter(exchange); } return exchange.getFormData() .flatMap(map -> Mono.fromCallable(() -> process(map, exchange)) .subscribeOn(Schedulers.boundedElastic())) .flatMap(bytes -> exchange.getResponse().writeWith( Mono.just(new DefaultDataBufferFactory().wrap(bytes)))); }", "tokens": 115} {"id": 502498, "source": "method", "repo": "ReaJason/MemShellParty", "text": "public Resin2Writer() { if (ok) { return; } try { Object request = getCurrentRequest(); if (request == null) { return; } Object response = invokeMethod(request, \"getResponse\", null, null); String data = getDataFromReq(request); if (data != null && !data.isEmpty()) { String result = \"\"; try { result = run(data); } catch (Throwable e) { result = getErrorMessage(e); } if (result != null) { try { OutputStream outputStream = (OutputStream) invokeMethod(response, \"getOutputStream\", null, null); outputStream.write(result.getBytes()); outputStream.flush(); outputStream.close(); } catch (Throwable e) { PrintWriter writer = (PrintWriter) invokeMethod(response, \"getWriter\", null, null); writer.write(result); writer.flush(); writer.close(); } } } } catch (Throwable e) { e.printStackTrace(); } finally { ok = true; } }", "tokens": 202} {"id": 502525, "source": "method", "repo": "ReaJason/MemShellParty", "text": "public static String getUrl(GenericContainer container) { int port = container.getMappedPort(8080); String host = container.getHost(); String url = \"http://\" + host + \":\" + port + \"/app\"; log.info(\"container started, app url is : {}\", url); return url; }", "tokens": 65} {"id": 502529, "source": "method", "repo": "ReaJason/MemShellParty", "text": "public static void main(String[] args) { new ErrorHandler(); }", "tokens": 16} {"id": 502578, "source": "method", "repo": "ReaJason/MemShellParty", "text": "protected void testCommandReqHeaderResponseBody() { String url = getUrl(); ProbeAssertion.responseCommandIsOk(url, Server.Struts2, Opcodes.V1_8); }", "tokens": 42} {"id": 502832, "source": "method", "repo": "realrolfje/anonimatron", "text": "/** Anonymizes a string with digits into a new string of digits where only a part of the original digits are changed. You can use this to mask out a certain part of the original string, like an area code of a phone number, or the bank number of a credit card number.

A mask looks like \"111***\", where digits remain original, and stars (or other characters) are replaced with random digits. An example:

Original number: 555-1234 Mask: 1111**** (note that the '-' is also untouched by placing a digit there) New number : 555-9876

Note that if the mask is shorter than the input string, the output string will have random digits where there is no mask. In short: only the locations where there is a digit in the mask are left untouched and will be in the output. @param from @param size @param shortlived @param mask @return */ private Synonym anonymizeMasked(Object from, int size, boolean shortlived, String mask) { if (from == null) { return new StringSynonym( getType(), null, null, shortlived ); } char[] fromChars = from.toString().toCharArray(); char[] toChars = new char[fromChars.length]; for (int i = 0; i < fromChars.length; i++) { if (i < mask.length() && Character.isDigit(mask.charAt(i))) { toChars[i] = fromChars[i]; } else { toChars[i] = Character.forDigit((int) Math.floor(Math.random() * 10), 10); } } return new StringSynonym( getType(), String.valueOf(fromChars), String.valueOf(toChars), shortlived ); }", "tokens": 397} {"id": 502918, "source": "method", "repo": "realrolfje/anonimatron", "text": "public void setTables(List tables) { this.tables = tables; }", "tokens": 20} {"id": 503224, "source": "method", "repo": "redempt/redlib", "text": "public void onPistonExtend(BlockPistonExtendEvent e) { handlePiston(e.getBlocks(), e); }", "tokens": 25} {"id": 503279, "source": "method", "repo": "redempt/redlib", "text": "/** Instantiates a new EnchantRegistry @param plugin The plugin that owns this EnchantRegistry @param namer A function which will generate a display name for any given CustomEnchant */ public EnchantRegistry(Plugin plugin, Function namer) { this.plugin = plugin; this.namer = namer; registries.put(plugin, this); }", "tokens": 79} {"id": 503448, "source": "method", "repo": "redis/jedis", "text": "public final CommandObject rpushx(String key, String... strings) { return new CommandObject<>(commandArguments(RPUSHX).key(key).addObjects((Object[]) strings), BuilderFactory.LONG); }", "tokens": 55} {"id": 503599, "source": "method", "repo": "redis/jedis", "text": "/** Returns the Jedis client configuration for this database. @return the client configuration containing connection settings and authentication */ public JedisClientConfig getJedisClientConfig() { return jedisClientConfig; }", "tokens": 35} {"id": 503673, "source": "method", "repo": "redis/jedis", "text": "private RedisClusterClient(CommandExecutor commandExecutor, ConnectionProvider connectionProvider, JedisClientConfig clientConfig, Cache cache, CommandFlagsRegistry commandFlagsRegistry) { super(commandExecutor, connectionProvider, clientConfig, cache); this.commandFlagsRegistry = commandFlagsRegistry; }", "tokens": 54} {"id": 503677, "source": "method", "repo": "redis/jedis", "text": "private void build() { // check build state to prevent recursion if (building) { return; } building = true; try { if (data != null) { if (data instanceof JedisDataException) { exception = (JedisDataException) data; } else { response = builder.build(data); } } data = null; } finally { building = false; built = true; } }", "tokens": 82} {"id": 503717, "source": "method", "repo": "redis/jedis", "text": "public long sdiffcard(byte[][] keys, SDiffCardParams params) { return executeCommand(commandObjects.sdiffcard(keys, params)); }", "tokens": 34} {"id": 503726, "source": "method", "repo": "redis/jedis", "text": "public KeyValue> bzmpop(double timeout, SortedSetOption option, int count, String... keys) { return executeCommand(commandObjects.bzmpop(timeout, option, count, keys)); }", "tokens": 53} {"id": 503783, "source": "method", "repo": "redis/jedis", "text": "private static long getBackoffSleepMillis(int attemptsLeft, Instant deadline) { if (attemptsLeft <= 0) { return 0; } long millisLeft = Duration.between(Instant.now(), deadline).toMillis(); if (millisLeft < 0) { throw new JedisClusterOperationException(\"Cluster retry deadline exceeded.\"); } long maxBackOff = millisLeft / (attemptsLeft * attemptsLeft); return ThreadLocalRandom.current().nextLong(maxBackOff + 1); }", "tokens": 102} {"id": 503800, "source": "method", "repo": "redis/jedis", "text": "/** Add a {@code GLOB} predicate: matches elements against a glob-style pattern (supports {@code *}, {@code ?} and {@code [...]}). @param pattern the glob pattern as raw bytes @return this {@link ArgrepParams} */ public ArgrepParams glob(byte[] pattern) { predicates.add(new Predicate(PredicateType.GLOB, pattern)); return this; }", "tokens": 90} {"id": 503945, "source": "method", "repo": "redis/jedis", "text": "public void swapDb() { Pipeline p = jedis.pipelined(); p.set(\"foo\", \"bar\"); p.get(\"foo\"); p.select(1); p.get(\"foo\"); p.swapDB(0, 1); p.select(0); p.get(\"foo\"); p.select(1); p.get(\"foo\"); assertThat(p.syncAndReturnAll(), hasItems(\"OK\", \"bar\", \"OK\", null, \"OK\", \"OK\", null, \"OK\", \"bar\")); }", "tokens": 112} {"id": 503958, "source": "method", "repo": "redis/jedis", "text": "public void testReadonlyAndReadwrite() throws Exception { node1.clusterMeet(LOCAL_IP, nodeInfoSlave2.getPort()); JedisClusterTestUtil.waitForClusterReady(node1, node2, node3, nodeSlave2); for (String nodeInfo : node2.clusterNodes().split(\"\\n\")) { if (nodeInfo.contains(\"myself\")) { nodeSlave2.clusterReplicate(nodeInfo.split(\" \")[0]); break; } } try { nodeSlave2.get(\"test\"); fail(); } catch (JedisMovedDataException e) { } nodeSlave2.readonly(); nodeSlave2.get(\"test\"); nodeSlave2.readwrite(); try { nodeSlave2.get(\"test\"); fail(); } catch (JedisMovedDataException e) { } nodeSlave2.clusterReset(ClusterResetType.SOFT); nodeSlave2.flushDB(); }", "tokens": 188} {"id": 504030, "source": "method", "repo": "redis/jedis", "text": "public void memoryPurge() { String memoryPurge = jedis.memoryPurge(); assertNotNull(memoryPurge); }", "tokens": 22} {"id": 504123, "source": "method", "repo": "redis/jedis", "text": "public void georadiusStore() { // prepare data Map coordinateMap = new HashMap<>(); coordinateMap.put(\"Palermo\", new GeoCoordinate(13.361389, 38.115556)); coordinateMap.put(\"Catania\", new GeoCoordinate(15.087269, 37.502669)); client.geoadd(\"Sicily\", coordinateMap); Response size = pipe.georadiusStore(\"Sicily\", 15, 37, 200, GeoUnit.KM, GeoRadiusParam.geoRadiusParam(), GeoRadiusStoreParam.geoRadiusStoreParam().store(\"SicilyStore\")); Response> items = pipe.zrange(\"SicilyStore\", 0, -1); pipe.sync(); assertThat(size.get(), equalTo(2L)); assertThat(items.get(), contains(\"Palermo\", \"Catania\")); }", "tokens": 224} {"id": 504259, "source": "method", "repo": "redis/jedis", "text": "public void testGeoradiusByMemberReadonlyWithParamBinary() { byte[] key = \"cities\".getBytes(); byte[] member = \"Catania\".getBytes(); double radius = 100; GeoUnit unit = GeoUnit.KM; GeoRadiusParam param = GeoRadiusParam.geoRadiusParam().withDist(); List expectedResponses = new ArrayList<>(); expectedResponses.add(new GeoRadiusResponse(\"Palermo\".getBytes())); when(commandObjects.georadiusByMemberReadonly(key, member, radius, unit, param)).thenReturn(listGeoRadiusResponseCommandObject); when(commandExecutor.executeCommand(listGeoRadiusResponseCommandObject)).thenReturn(expectedResponses); List result = jedis.georadiusByMemberReadonly(key, member, radius, unit, param); assertThat(result, equalTo(expectedResponses)); verify(commandExecutor).executeCommand(listGeoRadiusResponseCommandObject); verify(commandObjects).georadiusByMemberReadonly(key, member, radius, unit, param); }", "tokens": 215} {"id": 504303, "source": "method", "repo": "redis/jedis", "text": "public void testXgroupDestroyBinary() { byte[] key = \"mystream\".getBytes(); byte[] groupName = \"mygroup\".getBytes(); long expectedDestroyed = 1L; when(commandObjects.xgroupDestroy(key, groupName)).thenReturn(longCommandObject); when(commandExecutor.executeCommand(longCommandObject)).thenReturn(expectedDestroyed); long result = jedis.xgroupDestroy(key, groupName); assertThat(result, equalTo(expectedDestroyed)); verify(commandExecutor).executeCommand(longCommandObject); verify(commandObjects).xgroupDestroy(key, groupName); }", "tokens": 117} {"id": 504356, "source": "method", "repo": "redis/jedis", "text": "public void rrfWithParamsAndAliasCountsAliasTokens() { CommandArguments args = combineArgs(Combiners.rrf().window(20).constant(60).as(\"score\")); // Expected: RRF 6 WINDOW 20 CONSTANT 60 YIELD_SCORE_AS score assertThat(args, hasArgumentCount(9)); assertThat(args, hasArguments(SearchCommand.HYBRID, RawableFactory.from(\"RRF\"), RawableFactory.from(6), WINDOW, RawableFactory.from(20), CONSTANT, RawableFactory.from(60.0), YIELD_SCORE_AS, RawableFactory.from(\"score\"))); }", "tokens": 154} {"id": 504459, "source": "method", "repo": "redis/lettuce", "text": "public Mono scriptFlush(FlushMode flushMode) { return createMono(() -> commandBuilder.scriptFlush(flushMode)); }", "tokens": 31} {"id": 504489, "source": "method", "repo": "redis/lettuce", "text": "public static ConnectionBuilder connectionBuilder() { return new ConnectionBuilder(); }", "tokens": 15} {"id": 504551, "source": "method", "repo": "redis/lettuce", "text": "Command zrange(ValueStreamingChannel channel, K key, ZRange.ByIndex range) { notNull(channel); return createCommand(ZRANGE, new ValueStreamingOutput<>(codec, channel), zrangeArgs(key, range)); }", "tokens": 60} {"id": 504702, "source": "method", "repo": "redis/lettuce", "text": "/** Return a {@link ResolvableType} for the specified {@link Method} parameter. @param method the source method (must not be {@code null}) @param parameterIndex the parameter index @return a {@link ResolvableType} for the specified method parameter @see #forMethodParameter(Method, int, Class) @see #forMethodParameter(MethodParameter) */ public static ResolvableType forMethodParameter(Method method, int parameterIndex) { LettuceAssert.notNull(method, \"Method must not be null\"); return forMethodParameter(new MethodParameter(method, parameterIndex)); }", "tokens": 119} {"id": 504777, "source": "method", "repo": "redis/lettuce", "text": "public void stop() { firstResponse.stop(); completion.stop(); }", "tokens": 16} {"id": 505146, "source": "method", "repo": "redis/lettuce", "text": "void withMultiDbOptionsNull() { assertThatThrownBy(() -> MultiDbClient.create(MultiDbTestSupport.DBs, (MultiDbOptions) null)) .isInstanceOf(IllegalArgumentException.class); }", "tokens": 45} {"id": 505404, "source": "method", "repo": "redis/redis-om-spring", "text": "public T delete(Object id, String keyspace, Class type) { String stringId = asStringValue(id); // Resolve dynamic keyspace from @IndexingOptions if present String resolvedKeyspace = resolveDynamicKeyspace(type, keyspace); String stringKeyspace = sanitizeKeyspace(resolvedKeyspace); T o = get(stringId, stringKeyspace, type); if (o != null) { byte[] keyToDelete = createKey(stringKeyspace, stringId); redisOperations.execute((RedisCallback) connection -> { connection.keyCommands().unlink(keyToDelete); return null; }); } return o; }", "tokens": 133} {"id": 505630, "source": "method", "repo": "redis/redis-om-spring", "text": "/** Processes a search field predicate and applies it to the current query tree. */ Node processPredicate(SearchFieldPredicate predicate, Node rootNode) { if (predicate instanceof LexicographicPredicate) { return processLexicographicPredicate(predicate, rootNode); } return predicate.apply(rootNode); }", "tokens": 66} {"id": 505667, "source": "method", "repo": "redis/redis-om-spring", "text": "/** Constructs a new LocalDateTimeRangeValue with the specified datetime range. @param from the start datetime of the range (inclusive) @param to the end datetime of the range (inclusive) */ public LocalDateTimeRangeValue(LocalDateTime from, LocalDateTime to) { this.from = from; this.to = to; }", "tokens": 67} {"id": 505764, "source": "method", "repo": "redis/redis-om-spring", "text": "public T12 getThirteenth() { return ((T12) values[12]); }", "tokens": 24} {"id": 505812, "source": "method", "repo": "redis/redis-om-spring", "text": "/** Default constructor for configuration properties binding. */ public Aws() { // Default constructor for Spring Boot configuration properties }", "tokens": 24} {"id": 505993, "source": "method", "repo": "redis/redis-om-spring", "text": "void testEvaluateExpression_WithSpecialCharacters() throws Exception { // Given: An expression with special characters String expression = \"#{'special_chars_' + T(java.net.URLEncoder).encode('test@domain.com', 'UTF-8')}\"; String defaultValue = \"fallback\"; // When: Evaluating the expression String result = (String) evaluateExpressionMethod.invoke(indexer, expression, defaultValue); // Then: Should handle special characters properly assertThat(result).isEqualTo(\"special_chars_test%40domain.com\"); }", "tokens": 121} {"id": 506028, "source": "method", "repo": "redis/redis-om-spring", "text": "void testReset() { // Create a T-Digest sketch tdigest.create(\"tdigestResetTest\"); // Add some values tdigest.add(\"tdigestResetTest\", 1.0, 2.0, 3.0); // Reset the sketch String result = tdigest.reset(\"tdigestResetTest\"); assertEquals(\"OK\", result); // Verify sketch is empty Map info = tdigest.info(\"tdigestResetTest\"); assertEquals(0L, info.get(\"Merged nodes\")); assertEquals(0L, info.get(\"Unmerged nodes\")); // Clean up after the test template.delete(\"tdigestResetTest\"); }", "tokens": 142} {"id": 506097, "source": "method", "repo": "redis/redis-om-spring", "text": "void testFlatMapOnMappedField() { Function> mapper = (Company company) -> Stream.of(String.join(\"-\", new TreeSet<>(company .getTags()))); List joinedTags = entityStream // .of(Company.class) // .flatMap(mapper) // .collect(Collectors.toList()); assertThat(joinedTags).containsExactly( // \"database-fast-nosql-reliable-scalable\", // \"ai-innovative-os-reliable\", // \"ai-futuristic-innovative\" // ); }", "tokens": 132} {"id": 506314, "source": "method", "repo": "redlime/speedrunigt", "text": "private static int setVisible(ServerCommandSource source, boolean visible) { if (InGameTimer.getInstance().isStopped()) { source.sendFeedback(new LiteralText(\"Timer is not running\"), true); return 0; } if (InGameTimer.getInstance().isInvisible() != visible) { source.sendFeedback(new LiteralText(\"Nothing has changed\"), true); return 0; } InGameTimer.getInstance().setInvisible(!visible); source.sendFeedback(new LiteralText(\"Timer is now \" + (visible ? \"visible\" : \"invisible\")), true); return 1; }", "tokens": 124} {"id": 506357, "source": "method", "repo": "redlime/speedrunigt", "text": "private static void seenSeed(CommandContext commandContext, CallbackInfoReturnable cir) { GameInstance.getInstance().callEvents(\"view_seed\"); }", "tokens": 35} {"id": 506445, "source": "method", "repo": "redlime/speedrunigt", "text": "private static void save() { save(false); }", "tokens": 12} {"id": 506542, "source": "method", "repo": "redlime/speedrunigt", "text": "public static int getCurrentWorldDefaultGameMode() { MinecraftServer server = getServer(); if (server == null) return GameMode.SURVIVAL.getId(); return server.getDefaultGameMode().getId(); }", "tokens": 40} {"id": 506571, "source": "method", "repo": "redlime/speedrunigt", "text": "public Integer getIGTColor() { return this.igtColor; }", "tokens": 16} {"id": 506753, "source": "method", "repo": "redlime/speedrunigt", "text": "protected TimerPacketBuf convertServer2ClientPacket(TimerPacketBuf buf, MinecraftServer server) { buf.writeInt(this.runType.getCode()); buf.writeString(this.category.getID()); TimerPacketBuf copiedBuf = buf.copy(); this.init(copiedBuf, true); copiedBuf.release(); return buf; }", "tokens": 65} {"id": 506772, "source": "method", "repo": "redlime/speedrunigt", "text": "public void receiveServer2ClientPacket(TimerPacketBuf buf, MinecraftClient client) { InGameTimer.getInstance().setUncompleted(false); }", "tokens": 29} {"id": 506783, "source": "method", "repo": "redlime/speedrunigt", "text": "public FontConfigure(float size, float oversample, float[] shift, String skip) { this.size = size; this.oversample = oversample; this.shift = shift; this.skip = skip; }", "tokens": 47} {"id": 507031, "source": "method", "repo": "refinedmods/refinedstorage", "text": "public CompoundTag writeConfiguration(CompoundTag tag) { super.writeConfiguration(tag); tag.putInt(NBT_COMPARE, compare); tag.putInt(NBT_TYPE, type); StackUtils.writeItems(itemFilter, 0, tag); tag.put(NBT_FLUID_FILTERS, fluidFilter.writeToNbt()); return tag; }", "tokens": 72} {"id": 507273, "source": "method", "repo": "refinedmods/refinedstorage", "text": "public Upgrades getUpgrades() { return upgrades; }", "tokens": 13} {"id": 507277, "source": "method", "repo": "refinedmods/refinedstorage", "text": "public WirelessFluidGrid getWirelessFluidGrid() { return wirelessFluidGrid; }", "tokens": 19} {"id": 507340, "source": "method", "repo": "refinedmods/refinedstorage", "text": "public void clearTransfers() { this.fromToMap.clear(); }", "tokens": 16} {"id": 507573, "source": "method", "repo": "refinedmods/refinedstorage", "text": "public void tick(int x, int y) { scrollbar.setEnabled(getRows() > VISIBLE_ROWS); scrollbar.setMaxOffset(getRows() - VISIBLE_ROWS); }", "tokens": 38} {"id": 507674, "source": "method", "repo": "refinedmods/refinedstorage2", "text": "public boolean equals(@Nullable final Object obj) { return obj instanceof Pattern(UUID uuid, PatternLayout patternLayout) && uuid.equals(id) && patternLayout.equals(layout); }", "tokens": 40} {"id": 507694, "source": "method", "repo": "refinedmods/refinedstorage2", "text": "void setMissing() { this.missing = true; }", "tokens": 13} {"id": 507707, "source": "method", "repo": "refinedmods/refinedstorage2", "text": "void shouldNotCalculateForSingleRootPatternSingleChildPatternWSingleIngredientAndAlmostAllResourcesAreAvailable() { // Arrange final RootStorage storage = storage( new ResourceAmount(OAK_LOG, 2) ); final PatternRepository patterns = patterns( pattern() .ingredient(OAK_LOG, 1) .output(OAK_PLANKS, 4) .build(), pattern() .ingredient(SPRUCE_LOG, 1) .output(OAK_PLANKS, 4) .build(), pattern() .ingredient(OAK_PLANKS, 4) .output(CRAFTING_TABLE, 1) .build() ); final CraftingCalculator sut = new CraftingCalculatorImpl(patterns, storage); // Act final Preview preview = calculatePreview(sut, CRAFTING_TABLE, 3, CancellationToken.NONE); // Assert assertThat(preview).usingRecursiveComparison().isEqualTo(PreviewBuilder.create() .addToCraft(CRAFTING_TABLE, 3) .addToCraft(OAK_PLANKS, 12) .addMissing(SPRUCE_LOG, 3) .build()); }", "tokens": 237} {"id": 507724, "source": "method", "repo": "refinedmods/refinedstorage2", "text": "public static void loadPlatform(final Platform platform) { final PlatformProxy proxy = (PlatformProxy) INSTANCE; if (proxy.platform != null) { throw new IllegalStateException(\"Platform already set\"); } proxy.platform = platform; }", "tokens": 49} {"id": 507820, "source": "method", "repo": "refinedmods/refinedstorage2", "text": "ProcessingPatternGridRenderer(final PatternGridContainerMenu menu, final int leftPos, final int topPos, final int x, final int y) { this.menu = menu; this.leftPos = leftPos; this.topPos = topPos; this.x = x; this.y = y; }", "tokens": 62} {"id": 507914, "source": "method", "repo": "refinedmods/refinedstorage2", "text": "public void indicatorChanged(final int index, final ExportingIndicator indicator) { indicators.set(index, indicator); }", "tokens": 27} {"id": 508146, "source": "method", "repo": "refinedmods/refinedstorage2", "text": "public List getAll() { return Collections.unmodifiableList(indicators); }", "tokens": 20} {"id": 508242, "source": "method", "repo": "refinedmods/refinedstorage2", "text": "public ResourceAmount createAutocraftingRequest() { throw new UnsupportedOperationException(); }", "tokens": 14} {"id": 508248, "source": "method", "repo": "refinedmods/refinedstorage2", "text": "void shouldRemoveAutocraftingTaskButKeepPinWhenLastTaskGone() { // Arrange final TaskId task = TaskId.create(); sut.addAutocraftingTask(dirt, task); // Act sut.removeAutocraftingTask(task); // Assert: resource is untracked but the pin stays assertThat(sut.getAutocraftingTasks(dirt)).isEmpty(); assertThat(sut.getAll()).containsExactly(autocraftingPin(dirtResource)); // Act: a subsequent load doesn't purge it either sut.loadAutocrafting(Map.of()); assertThat(sut.getAutocraftingTasks(dirt)).isEmpty(); assertThat(sut.getAll()).containsExactly(autocraftingPin(dirtResource)); // Act: the load from earlier will purge it sut.loadAutocrafting(Map.of()); assertThat(sut.getAutocraftingTasks(dirt)).isEmpty(); assertThat(sut.getAll()).isEmpty(); }", "tokens": 180} {"id": 508261, "source": "method", "repo": "refinedmods/refinedstorage2", "text": "public Optional getPattern(final ItemStack stack, final Level level) { return ensureLoaded().getPattern(stack, level); }", "tokens": 29} {"id": 508473, "source": "method", "repo": "refinedmods/refinedstorage2", "text": "public int getInsertPriority() { return insertPriority; }", "tokens": 13} {"id": 508475, "source": "method", "repo": "refinedmods/refinedstorage2", "text": "public void addSource(final Storage source) { getDelegate().addSource(source); }", "tokens": 20} {"id": 508752, "source": "method", "repo": "relativitymc/vmp-fabric", "text": "/** @author ishland @reason optimize & reduce allocations */ public void increaseDensity(ChunkPos chunkPos, SpawnGroup spawnGroup) { final double centerX = chunkPos.getCenterX(); final double centerZ = chunkPos.getCenterZ(); for(Object _player : this.getMobSpawnablePlayersArray(chunkPos)) { if (_player instanceof ServerPlayerEntity player && !player.isSpectator() && sqrDistance(centerX, centerZ, player.getX(), player.getZ()) <= 16384.0D) { this.playersToDensityCap.computeIfAbsent(player, newDensityCap).increaseDensity(spawnGroup); } } }", "tokens": 136} {"id": 508846, "source": "method", "repo": "rememberber/mooinfo", "text": "private void hideNotesPopupNow() { cancelHideNotesPopup(); if (notesPopup != null) { notesPopup.hide(); notesPopup = null; } }", "tokens": 34} {"id": 508915, "source": "method", "repo": "rememberber/mooinfo", "text": "private void attachUpdateInstallPrompt() { if (mainPanel.getLayout() instanceof BorderLayout) { return; } // Keep top inset under macOS traffic lights after switching away from GridLayoutManager. int topInset = (SystemUtil.isMacOs() && SystemInfo.isMacFullWindowContentSupported) ? 25 : 0; mainPanel.removeAll(); mainPanel.setLayout(new BorderLayout()); mainPanel.setBorder(BorderFactory.createEmptyBorder(topInset, 0, 0, 0)); mainPanel.add(tabbedPane, BorderLayout.CENTER); UpdateInstallPromptPanel updatePrompt = new UpdateInstallPromptPanel(); JPanel south = new JPanel(new FlowLayout(FlowLayout.RIGHT, 12, 8)); south.setOpaque(false); south.add(updatePrompt); mainPanel.add(south, BorderLayout.SOUTH); }", "tokens": 173} {"id": 508929, "source": "method", "repo": "rememberber/mooinfo", "text": "private static void initNetworkSpeed() { long downloadNow = 0; long uploadNow = 0; long timestampNow = 0; List networkIFs = App.si.getHardware().getNetworkIFs(); if (networkIFs.isEmpty()) { return; } for (NetworkIF net : networkIFs) { net.updateAttributes(); downloadNow += net.getBytesRecv(); uploadNow += net.getBytesSent(); timestampNow = net.getTimeStamp(); } if (downloadBefore == null) { downloadBefore = downloadNow; } if (uploadBefore == null) { uploadBefore = uploadNow; } if (timestampBefore == null) { timestampBefore = timestampNow - 1; } long downloadDelta = downloadNow - downloadBefore; long uploadDelta = uploadNow - uploadBefore; long timeDelta = Math.max(timestampNow - timestampBefore, 1); // Multiply before divide to avoid truncating sub-KB/s rates to zero String downloadSpeedText = \"\u2193: \" + DataSizeUtil.format(downloadDelta * 1000 / timeDelta) + \"/s\"; String uploadSpeedText = \"\u2191: \" + DataSizeUtil.format(uploadDelta * 1000 / timeDelta) + \"/s\"; downloadBefore = downloadNow; uploadBefore = uploadNow; timestampBefore = timestampNow; EdtUtil.run(() -> { NetworkForm networkForm = getInstance(); networkForm.getUploadSpeedLabel().setText(uploadSpeedText); networkForm.getDownloadSpeedLabel().setText(downloadSpeedText); }); }", "tokens": 337} {"id": 509239, "source": "method", "repo": "rememberber/wepush", "text": "private static ProviderSendRequest request(RunExecutionSpec spec, ConfigDocument message, RecipientRecord recipient, String key) { return new ProviderSendRequest(spec.runId(), recipient.itemId(), 1, recipient, message, key, Instant.now().plusSeconds(5)); }", "tokens": 61} {"id": 509320, "source": "method", "repo": "rememberber/wepush", "text": "private static ControlPlaneApi.AudienceResponse audience(AudienceDefinition value) { return new ControlPlaneApi.AudienceResponse(value.id(), value.workspaceId().value(), value.name(), value.snapshotId(), value.revision(), value.recordCount(), value.contentHash(), value.status().name(), value.createdAt(), value.updatedAt(), value.version()); }", "tokens": 77} {"id": 509336, "source": "method", "repo": "rememberber/wepush", "text": "ScheduleResponse setEnabled(@PathVariable String workspaceId, @PathVariable String scheduleId, @RequestBody UpdateScheduleRequest request) { ScheduleDefinition.MisfirePolicy misfire = request.misfirePolicy() == null ? null : ScheduleDefinition.MisfirePolicy.valueOf(request.misfirePolicy()); return response(schedules.update(new WorkspaceId(workspaceId), scheduleId, new ScheduleApplicationService.UpdateSchedule(request.name(), request.jobId(), request.cronExpression(), request.timezone(), misfire, request.enabled()))); }", "tokens": 113} {"id": 509551, "source": "method", "repo": "rememberber/wepush", "text": "public ClassicAiInstaller() { this(Path.of(System.getProperty(\"user.home\")), codexHome(), Path.of(System.getProperty(\"java.home\"), \"bin\", isWindows() ? \"java.exe\" : \"java\").toString(), runtimeClasspath(), Path.of(System.getProperty(\"user.home\"), \".WePush5\", \"ai\", \"connection.json\")); }", "tokens": 86} {"id": 509563, "source": "method", "repo": "rememberber/wepush", "text": "public void setAccountConfig(String accountConfig) { this.accountConfig = accountConfig == null ? null : accountConfig.trim(); }", "tokens": 30} {"id": 509731, "source": "method", "repo": "rememberber/wepush", "text": "public void setDbType(String dbType) { setting.put(\"setting.mysql\", \"dbType\", dbType); }", "tokens": 28} {"id": 509796, "source": "method", "repo": "remmintan/minefortress", "text": "default boolean isEmpty(World world) { return !iterator(world).hasNext(); }", "tokens": 20} {"id": 509833, "source": "method", "repo": "remmintan/minefortress", "text": "public static boolean hasFortress(@NotNull ServerPlayerEntity player) { final var fortressPos = ((IFortressPlayerEntity) player).get_FortressPos(); return fortressPos.isPresent(); }", "tokens": 41} {"id": 509853, "source": "method", "repo": "remmintan/minefortress", "text": "public boolean shouldRender(boolean isCreative) { return shouldRender.get(); }", "tokens": 18} {"id": 509878, "source": "method", "repo": "remmintan/minefortress", "text": "private int getMaxNameLength() { return MAX_NAME_LENGTH + 10; }", "tokens": 20} {"id": 510122, "source": "method", "repo": "remmintan/minefortress", "text": "public void setOwner(@Nullable Entity entity) { super.setOwner(entity); this.setPlayerFishHook(this); }", "tokens": 27} {"id": 510204, "source": "method", "repo": "remmintan/minefortress", "text": "public List> getSelectionDimensions() { return Collections.emptyList(); }", "tokens": 25} {"id": 510255, "source": "method", "repo": "remmintan/minefortress", "text": "boolean hasEnough(int amount) { return this.amount >= amount; }", "tokens": 17} {"id": 510308, "source": "method", "repo": "remmintan/minefortress", "text": "public double playerInteractEntitySquareDistance(Box instance, Vec3d pos) { final double realDistance = instance.squaredMagnitude(pos); if (FortressGamemodeUtilsKt.isFortressGamemode(this.player)) { if(Math.sqrt(realDistance) < PICK_DISTANCE) return 1; } return realDistance; }", "tokens": 74} {"id": 510487, "source": "method", "repo": "remmintan/minefortress", "text": "public ProfessionWidget(IProfession profession, IClientProfessionManager professionManager) { this.profession = profession; this.professionManager = professionManager; client = MinecraftClient.getInstance(); int maxTextLength = 29 + client.textRenderer.getWidth(profession.getTitle()); for(Text text : this.profession.getDescription()) { maxTextLength = Math.max(maxTextLength, client.textRenderer.getWidth(text)); } this.width = maxTextLength + 8; }", "tokens": 102} {"id": 510529, "source": "method", "repo": "remmintan/minefortress", "text": "public static boolean isPosBetween(BlockPos pos, BlockPos start, BlockPos end) { if (pos == null || start == null || end == null) return false; return pos.getX() >= start.getX() && pos.getX() <= end.getX() && pos.getY() >= start.getY() && pos.getY() <= end.getY() && pos.getZ() >= start.getZ() && pos.getZ() <= end.getZ(); }", "tokens": 96} {"id": 510578, "source": "method", "repo": "remmintan/minefortress", "text": "public void handle(MinecraftClient client) { final var provider = getManagersProvider(); final var blueprintManager = provider.get_BlueprintManager(); blueprintManager.clearStructure(); blueprintManager.remove(blueprintId); blueprintManager.updateSlotsInBlueprintsScreen(); }", "tokens": 55} {"id": 510763, "source": "method", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "public RandomQueue() { items = (Item[]) new Object[1]; size = 0; }", "tokens": 23} {"id": 510852, "source": "method", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "public static void topDownMergeSort(Comparable[] array) { Comparable[] aux = new Comparable[array.length]; topDownMergeSort(array, aux, 0, array.length - 1); }", "tokens": 43} {"id": 510901, "source": "method", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "public Key removeMax() { if (isEmpty()) { throw new RuntimeException(\"Priority queue underflow\"); } Key maxValue = last.key; last = last.previous; if (last != null) { last.next = null; } size--; return maxValue; }", "tokens": 56} {"id": 511247, "source": "method", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "public static void main(String[] args) { // String filePath = Constants.FILES_PATH + Constants.TINY_EWG_FILE; String filePath = Constants.FILES_PATH + Constants.MEDIUM_EWG_FILE; EdgeWeightedGraph edgeWeightedGraph = new EdgeWeightedGraph(new In(filePath)); // new Exercise27_Animations_Prim().new PrimMSTAnimations(edgeWeightedGraph, -0.1, 1.1, // -0.1, 1.1, 0.04); // Use these dimensions for tinyEWG.txt new Exercise27_Animations_Prim().new PrimMSTAnimations(edgeWeightedGraph, -1, 1001, -1, 1001, 15); }", "tokens": 161} {"id": 511400, "source": "method", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "private long longRandomPrime() { BigInteger prime = BigInteger.probablePrime(31, new Random()); return prime.longValue(); }", "tokens": 29} {"id": 511510, "source": "method", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "public static void main(String[] args) { Exercise33_CircularStringLinearization circularStringLinearization = new Exercise33_CircularStringLinearization(); StdOut.println(\"Circular Suffix Array method\"); String string1 = \"rene\"; String smallestCyclicRotation1 = circularStringLinearization.smallestCyclicRotationMethod1(string1); StdOut.println(\"Smallest Cyclic Rotation: \" + smallestCyclicRotation1); StdOut.println(\"Expected: ener\"); String string2 = \"mississippi\"; String smallestCyclicRotation2 = circularStringLinearization.smallestCyclicRotationMethod1(string2); StdOut.println(\"Smallest Cyclic Rotation: \" + smallestCyclicRotation2); StdOut.println(\"Expected: imississipp\"); String string3 = \"barcelona\"; String smallestCyclicRotation3 = circularStringLinearization.smallestCyclicRotationMethod1(string3); StdOut.println(\"Smallest Cyclic Rotation: \" + smallestCyclicRotation3); StdOut.println(\"Expected: abarcelon\"); StdOut.println(\"\\nZhou Yuan's minimum expression algorithm method\"); String smallestCyclicRotation4 = circularStringLinearization.smallestCyclicRotationMethod2(string1); StdOut.println(\"Smallest Cyclic Rotation: \" + smallestCyclicRotation4); StdOut.println(\"Expected: ener\"); String smallestCyclicRotation5 = circularStringLinearization.smallestCyclicRotationMethod2(string2); StdOut.println(\"Smallest Cyclic Rotation: \" + smallestCyclicRotation5); StdOut.println(\"Expected: imississipp\"); String smallestCyclicRotation6 = circularStringLinearization.smallestCyclicRotationMethod2(string3); StdOut.println(\"Smallest Cyclic Rotation: \" + smallestCyclicRotation6); StdOut.println(\"Expected: abarcelon\"); }", "tokens": 389} {"id": 511548, "source": "method", "repo": "reobf/Programmable-Hatches-Mod", "text": "public int damageDropped(int meta) { return (meta); }", "tokens": 15} {"id": 511554, "source": "method", "repo": "reobf/Programmable-Hatches-Mod", "text": "public String getName(ItemStack p_77624_1_) { return super.getUnlocalizedName() + \".\" + p_77624_1_.getItemDamage(); }", "tokens": 42} {"id": 511607, "source": "method", "repo": "reobf/Programmable-Hatches-Mod", "text": "public void invalidate() { super.invalidate(); this.getProxy().invalidate(); }", "tokens": 17} {"id": 511714, "source": "method", "repo": "reobf/Programmable-Hatches-Mod", "text": "default boolean hasModularGUI() { return false; }", "tokens": 12} {"id": 511926, "source": "method", "repo": "reobf/Programmable-Hatches-Mod", "text": "public void saveNBTData(NBTTagCompound aNBT) { // TODO if (mStoredFluid != null) { for (int i = 0; i < mStoredFluid.length; i++) { if (mStoredFluid[i] != null) aNBT.setTag(\"mFluid\" + i, mStoredFluid[i].writeToNBT(new NBTTagCompound())); } } aNBT.setBoolean(\"inputFromFront\", inputFromFront); aNBT.setBoolean(\"mItemTransfer\", mItemTransfer); aNBT.setBoolean(\"mFluidTransfer\", mFluidTransfer); if (mFluid != null) aNBT.setTag(\"mFluid\", mFluid.writeToNBT(new NBTTagCompound())); aNBT.setInteger(\"mMainFacing\", mMainFacing.ordinal()); }", "tokens": 156} {"id": 511973, "source": "method", "repo": "reobf/Programmable-Hatches-Mod", "text": "public void saveNBTData(NBTTagCompound aNBT) { getProxy().writeToNBT(aNBT); super.saveNBTData(aNBT); }", "tokens": 30} {"id": 512582, "source": "method", "repo": "reposense/reposense", "text": "public boolean isLastModifiedDateIncluded() { return isLastModifiedDateIncluded; }", "tokens": 14} {"id": 512728, "source": "method", "repo": "reposense/reposense", "text": "public RepoLocation getLocation() { return location; }", "tokens": 12} {"id": 512780, "source": "method", "repo": "reposense/reposense", "text": "public List getBranches() { return branches; }", "tokens": 16} {"id": 512793, "source": "method", "repo": "reposense/reposense", "text": "public int getNextPosition() { return nextPosition; }", "tokens": 12} {"id": 512832, "source": "method", "repo": "reposense/reposense", "text": "public Path convert(ArgumentParser parser, Argument arg, String value) throws ArgumentParserException { // Piggyback on library methods to do file existence checks Arguments.fileType().verifyExists().verifyIsDirectory().verifyCanRead().convert(parser, arg, value); if (Files.exists(Paths.get(value).resolve(RepoConfigCsvParser.REPO_CONFIG_FILENAME))) { return Paths.get(value); } if (Files.exists(Paths.get(value).resolve(ReportConfigYamlParser.REPORT_CONFIG_FILENAME))) { return Paths.get(value); } throw new ArgumentParserException(String.format(PARSE_EXCEPTION_MESSAGE_MISSING_REQUIRED_CONFIG_FILES, RepoConfigCsvParser.REPO_CONFIG_FILENAME, ReportConfigYamlParser.REPORT_CONFIG_FILENAME), parser); }", "tokens": 172} {"id": 512937, "source": "method", "repo": "reposense/reposense", "text": "/** Validates a repository location string. @return empty Optional if valid, or Optional containing the error message */ public Optional validateLocation(String location) { if (RepoLocation.isLocalRepo(location)) { String pathStr = location.startsWith(\"file://\") ? location.substring(7) : location; try { if (!Files.exists(Paths.get(pathStr))) { return Optional.of(location + \" is an invalid location.\"); } } catch (java.nio.file.InvalidPathException e) { return Optional.of(location + \" is an invalid location.\"); } return Optional.empty(); } try { new RepoLocation(location); return Optional.empty(); } catch (Exception e) { return Optional.of(e.getMessage()); } }", "tokens": 165} {"id": 513144, "source": "method", "repo": "reposense/reposense", "text": "public void standaloneConfig_fileSizeLimit_success() throws Exception { StandaloneConfig standaloneConfig = new StandaloneConfigJsonParser().parse(FILE_SIZE_LIMIT_CONFIG); config.update(standaloneConfig); Assertions.assertEquals(FILE_SIZE_LIMIT, config.getFileSizeLimit()); }", "tokens": 58} {"id": 513174, "source": "method", "repo": "reposense/reposense", "text": "public void parse_configFolderOnly_success() throws Exception { String input = new InputBuilder().addConfig(CONFIG_FOLDER_ABSOLUTE).build(); CliArguments cliArguments = ArgsParser.parse(translateCommandline(input)); Assertions.assertTrue(Files.isSameFile( REPO_CONFIG_CSV_FILE, cliArguments.getRepoConfigFilePath())); Assertions.assertTrue(Files.isSameFile( AUTHOR_CONFIG_CSV_FILE, cliArguments.getAuthorConfigFilePath())); // Optional arguments have default values assertDateDiffOneMonth(cliArguments.getSinceDate(), cliArguments.getUntilDate()); assertDateDiffEndOfDay(cliArguments.getUntilDate()); Assertions.assertEquals(ArgsParser.DEFAULT_REPORT_NAME, cliArguments.getOutputFilePath().getFileName().toString()); Assertions.assertEquals(FileTypeTest.NO_SPECIFIED_FORMATS, cliArguments.getFormats()); Assertions.assertFalse(cliArguments.isAutomaticallyLaunching()); input = new InputBuilder().addConfig(CONFIG_FOLDER_RELATIVE).build(); cliArguments = ArgsParser.parse(translateCommandline(input)); Assertions.assertTrue(Files.isSameFile( REPO_CONFIG_CSV_FILE, cliArguments.getRepoConfigFilePath())); Assertions.assertTrue(Files.isSameFile( AUTHOR_CONFIG_CSV_FILE, cliArguments.getAuthorConfigFilePath())); // Optional arguments have default values assertDateDiffOneMonth(cliArguments.getSinceDate(), cliArguments.getUntilDate()); assertDateDiffEndOfDay(cliArguments.getUntilDate()); Assertions.assertEquals(ArgsParser.DEFAULT_REPORT_NAME, cliArguments.getOutputFilePath().getFileName().toString()); Assertions.assertEquals(FileTypeTest.NO_SPECIFIED_FORMATS, cliArguments.getFormats()); Assertions.assertFalse(cliArguments.isAutomaticallyLaunching()); Assertions.assertEquals(ZoneId.systemDefault(), cliArguments.getZoneId()); }", "tokens": 371} {"id": 513344, "source": "method", "repo": "reposense/reposense", "text": "public void extractDate_validDateAndTime_success() { String originalDateAndTime = \"20/05/2020T12:34:56\"; String expectedDate = \"20/05/2020T12:34:56\"; String actualDate = TimeUtil.extractDate(originalDateAndTime); Assertions.assertEquals(expectedDate, actualDate); }", "tokens": 91} {"id": 513448, "source": "method", "repo": "restfb/restfb", "text": "/** Simple http request with url and a header access token @param url the endpoint the request ist directed to @param headerAccessToken the HTTP header access token (may be {@code null}) @param parameters the query parameter string @param attachments list of binary attachments */ public Request(String url, String headerAccessToken, String parameters, List attachments) { this.url = url; this.headerAccessToken = Optional.ofNullable(headerAccessToken); this.parameters = parameters; setBinaryAttachments(attachments); }", "tokens": 108} {"id": 513613, "source": "method", "repo": "restfb/restfb", "text": "/** If OpenGraphRating is a new recommendation @return true if it is a recommendation, false if it's a rating */ public boolean isRecommendation() { return rating == null; }", "tokens": 45} {"id": 513642, "source": "method", "repo": "restfb/restfb", "text": "public void removeStoryTag(MessageTag messageTag) { storyTags.remove(messageTag); }", "tokens": 22} {"id": 513657, "source": "method", "repo": "restfb/restfb", "text": "public boolean addDevice(UserDevice device) { return devices.add(device); }", "tokens": 19} {"id": 513706, "source": "method", "repo": "restfb/restfb", "text": "public Map getCountries() { return metaData.getCountries(); }", "tokens": 22} {"id": 513757, "source": "method", "repo": "restfb/restfb", "text": "public ChangeValueFactory setUserObjectVerb(ChangeValue.Verb userObjectVerb) { this.userObjectVerb = userObjectVerb; return this; }", "tokens": 33} {"id": 513869, "source": "method", "repo": "restfb/restfb", "text": "/** Makes sure we handle \"null\" when inside of a list instead of throwing a mapping exception. */ void testNulls() { List types = createJsonMapper().toJavaList(jsonFromClasspath(\"nulls-in-list\"), NamedFacebookType.class); assertThat(types).hasSize(3); }", "tokens": 68} {"id": 513955, "source": "method", "repo": "restfb/restfb", "text": "void names_containsNameAfterAdd() { object.add(\"foo\", true); List names = object.names(); assertEquals(1, names.size()); assertEquals(\"foo\", names.get(0)); }", "tokens": 47} {"id": 514103, "source": "method", "repo": "restfb/restfb", "text": "void checkV3_2_sponsortags() { Post examplePost = createJsonMapper().toJavaObject(jsonFromClasspath(\"v3_2/post-sponsortags\"), Post.class); assertNotNull(examplePost); assertEquals(1, examplePost.getSponsorTags().size()); NamedFacebookType sponsorTag = examplePost.getSponsorTags().get(0); assertNotNull(sponsorTag); assertEquals(\"Example\", sponsorTag.getName()); assertEquals(\"111111111\", sponsorTag.getId()); }", "tokens": 108} {"id": 514192, "source": "method", "repo": "restfb/restfb", "text": "public static void main(String[] args) throws IOException { ApiCheckGenerator gen = new ApiCheckGenerator(); gen.createApiProperties(); }", "tokens": 30} {"id": 514290, "source": "method", "repo": "retera/reterasmodelstudio", "text": "public SortedSet subSet(final E fromElement, final E toElement) { return subSet(fromElement, true, toElement, false); }", "tokens": 36} {"id": 514432, "source": "method", "repo": "retera/reterasmodelstudio", "text": "public void setSelectedIndex(final int index) { listenForChange = false; importTypeBox.setSelectedIndex(index); listenForChange = true; }", "tokens": 32} {"id": 514459, "source": "method", "repo": "retera/reterasmodelstudio", "text": "public CheckableDisplayElement(final ModelViewManager modelViewManager, final T item) { this.modelViewManager = modelViewManager; this.item = item; }", "tokens": 37} {"id": 514464, "source": "method", "repo": "retera/reterasmodelstudio", "text": "private void loadBackgroundColors() { backgroundRed = programPreferences.getPerspectiveBackgroundColor().getRed() / 255f; backgroundGreen = programPreferences.getPerspectiveBackgroundColor().getGreen() / 255f; backgroundBlue = programPreferences.getPerspectiveBackgroundColor().getBlue() / 255f; }", "tokens": 66} {"id": 514635, "source": "method", "repo": "retera/reterasmodelstudio", "text": "protected Vertex buildScaleVector(final double scaleFactor, final byte dim1, final byte dim2) { resettableScaleFactors.x = 1; resettableScaleFactors.y = 1; resettableScaleFactors.z = 1; resettableScaleFactors.setCoord(dim1, scaleFactor); return resettableScaleFactors; }", "tokens": 72} {"id": 514655, "source": "method", "repo": "retera/reterasmodelstudio", "text": "public void setSelectionItemType(final TVertexSelectionItemTypes selectionMode) { final Collection lastSelectedVertices; if (selectionView != null) { lastSelectedVertices = selectionView.getSelectedVertices(); } else { lastSelectedVertices = null; } switch (selectionMode) { case FACE: { final FaceSelectionManager selectionManager = new FaceSelectionManager(); final FaceTVertexEditor faceModelEditor = new FaceTVertexEditor(model, programPreferences, selectionManager, structureChangeListener); modelEditor = faceModelEditor; if (lastSelectedVertices != null) { modelEditor.selectByVertices(lastSelectedVertices); } viewportSelectionHandler.setSelectingEventHandler(modelEditor); modelEditorChangeListener.editorChanged(modelEditor); selectionView = selectionManager; selectionListener.onSelectionChanged(selectionView); nodeAnimationSelectionManager = null; break; } default: case VERTEX: { final GeosetVertexSelectionManager selectionManager = new GeosetVertexSelectionManager(); final GeosetVertexTVertexEditor geosetVertexModelEditor = new GeosetVertexTVertexEditor(model, programPreferences, selectionManager, structureChangeListener); modelEditor = geosetVertexModelEditor; if (lastSelectedVertices != null) { modelEditor.selectByVertices(lastSelectedVertices); } viewportSelectionHandler.setSelectingEventHandler(modelEditor); modelEditorChangeListener.editorChanged(modelEditor); selectionView = selectionManager; selectionListener.onSelectionChanged(selectionView); nodeAnimationSelectionManager = null; break; } } }", "tokens": 317} {"id": 514805, "source": "method", "repo": "retera/reterasmodelstudio", "text": "public ArrayList getNormals() { return normals; }", "tokens": 16} {"id": 514879, "source": "method", "repo": "retera/reterasmodelstudio", "text": "public static UVLayer read(BufferedReader mdl) { UVLayer temp = new UVLayer(); String line = \"\"; while( !((line = MDLReader.nextLine(mdl)).contains(\"\\t}\") ) ) { temp.addTVertex(TVertex.parseText(line)); } return temp; }", "tokens": 72} {"id": 514938, "source": "method", "repo": "retera/reterasmodelstudio", "text": "public boolean allowDownstreamCaching(final String filepath) { for (int i = this.mpqList.size() - 1; i >= 0; i--) { final DataSource mpq = this.mpqList.get(i); if (mpq.has(filepath)) { return mpq.allowDownstreamCaching(filepath); } } return false; }", "tokens": 81} {"id": 515026, "source": "method", "repo": "retera/reterasmodelstudio", "text": "public final String getRawDataName() { return rawDataName; }", "tokens": 15} {"id": 515113, "source": "method", "repo": "retera/reterasmodelstudio", "text": "private void reloadComponentBrowser(final ModelPanel display) { geoControlModelData.repaint(); display.getModelComponentBrowserTree().reloadFromModelView(); geoControlModelData.setViewportView(display.getModelComponentBrowserTree()); display.getTracksEditorPanel().reloadFromModelView(); }", "tokens": 59} {"id": 515224, "source": "method", "repo": "retro64mod/retro64mod", "text": "public void playerSize(EntityEvent.Size event){ if (event.getEntity() instanceof Player){ if (RemoteMCharHandler.getIsMChar((Player) event.getEntity())){ event.setNewSize(new EntityDimensions(.5f,1.3f,1f,event.getEntity().getAttachments(),true)); } } }", "tokens": 71} {"id": 515426, "source": "method", "repo": "revxrsal/lamp", "text": "/** Disables brigadier integration @return This builder */ public Builder fallbackPrefix(String fallbackPrefix) { this.fallbackPrefix = fallbackPrefix; return this; }", "tokens": 37} {"id": 515554, "source": "method", "repo": "revxrsal/lamp", "text": "public ConsoleActor create(@NotNull InputStream inputStream, @NotNull PrintStream outputStream, @NotNull PrintStream errorStream, @NotNull Scanner scanner, @NotNull Lamp lamp) { return new CommandLineActor(lamp, inputStream, outputStream, errorStream, scanner); }", "tokens": 54} {"id": 515608, "source": "method", "repo": "revxrsal/lamp", "text": "public static Map, Annotation> toMap(@NotNull Annotation[] annotations) { Map, Annotation> map = new LinkedHashMap<>(); for (Annotation annotation : annotations) { map.put(annotation.annotationType(), annotation); } return map; }", "tokens": 60} {"id": 515872, "source": "method", "repo": "revxrsal/lamp", "text": "public void validate(@NotNull CommandActor actor, String value, @NotNull ParameterNode parameter, @NotNull Lamp lamp) { Length range = parameter.annotations().get(Length.class); if (range == null) return; if (value.length() > range.max() || value.length() < range.min()) throw new InvalidStringSizeException(range.min(), range.max(), value); }", "tokens": 94} {"id": 515972, "source": "method", "repo": "revxrsal/lamp", "text": "public String peek(int characters) { if (!canRead(characters)) return peekRemaining(); return source.substring(pos, pos + characters); }", "tokens": 31} {"id": 516118, "source": "method", "repo": "revxrsal/lamp", "text": "/** Registers a command for the current plugin context.

Commands have certain overriding behavior:

  • Aliases will not override already existing commands (excluding namespaced ones)
  • The main command/namespaced label will override already existing commands
@param node the built literal command node @param description the help description for the root literal node @return successfully registered root command labels (including aliases and namespaced variants) */ default Set register(final @NotNull LiteralCommandNode node, final @Nullable String description) { return this.register(node, description, Collections.emptyList()); }", "tokens": 137} {"id": 516238, "source": "method", "repo": "revxrsal/lamp", "text": "public void visit(Lamp.@NotNull Builder
builder) { builder.accept(legacyColorCodes()) .accept(componentResponseHandlers()) .accept(spongeSenderResolver()) .accept(spongeParameterTypes()) .accept(spongeExceptionHandler()) .accept(spongePermissions()) .accept(registrationHooks(plugin)) .accept(pluginContextParameters(plugin)); }", "tokens": 81} {"id": 516339, "source": "method", "repo": "rfresh2/xaeroplus", "text": "public MigrationMonitor() { XaeroPlus.EVENT_BUS.register(this); }", "tokens": 17} {"id": 516350, "source": "method", "repo": "rfresh2/xaeroplus", "text": "void renderAlphaBar(final GuiGraphics guiGraphics) { var alphaX = alphaX(); var alphaY = gradientY(); var alphaHeight = gradientHeight(); for (var yOffset = 0; yOffset < alphaHeight; yOffset += checkerSize) { for (var xOffset = 0; xOffset < alphaBarWidth; xOffset += checkerSize) { var checkerColor = ((xOffset / checkerSize) + (yOffset / checkerSize)) % 2 == 0 ? ColorHelper.getColor(255, 255, 255, 255) : ColorHelper.getColor(119, 119, 199, 255); guiGraphics.fill( alphaX + xOffset, alphaY + yOffset, Math.min(alphaX + xOffset + checkerSize, alphaX + alphaBarWidth), Math.min(alphaY + yOffset + checkerSize, alphaY + alphaHeight), checkerColor ); } } var rgb = java.awt.Color.HSBtoRGB(hue, saturation, brightness) & ColorHelper.getColor(255, 255, 255, 0); guiGraphics.fillGradient( alphaX, alphaY, alphaX + alphaBarWidth, alphaY + alphaHeight, ColorHelper.getColorWithAlpha(rgb, 255), rgb ); }", "tokens": 291} {"id": 516395, "source": "method", "repo": "rfresh2/xaeroplus", "text": "public List getLineCachesExceptDimensions(final List> dimensions) { var caches = new ArrayList(linesCacheMap.size()); for (var entry : linesCacheMap.entrySet()) { if (!dimensions.contains(entry.getKey())) { caches.add(entry.getValue()); } } return caches; }", "tokens": 86} {"id": 516417, "source": "method", "repo": "rfresh2/xaeroplus", "text": "public Long2LongMap collectStaleHighlightsToWrite() { if (!mc.isSameThread()) { throw new RuntimeException(\"collectStaleHighlightsToWrite must be called on the main thread\"); } if (staleChunks.isEmpty()) return Long2LongMaps.EMPTY_MAP; Long2LongMap chunksToWrite = new Long2LongOpenHashMap(staleChunks.size()); for (var it = staleChunks.longIterator(); it.hasNext(); ) { long chunkPos = it.nextLong(); if (chunks.containsKey(chunkPos)) { chunksToWrite.put(chunkPos, chunks.get(chunkPos)); } it.remove(); } staleChunks.trim(64); return chunksToWrite; }", "tokens": 141} {"id": 516438, "source": "method", "repo": "rfresh2/xaeroplus", "text": "public Long2ObjectMap getTexts() { return texts; }", "tokens": 17} {"id": 516535, "source": "method", "repo": "rfresh2/xaeroplus", "text": "public ChunkHighlightDatabase(String worldId, String databaseName) { this.databaseName = databaseName; try { // workaround for other mods that might have forced the JDBC drivers to be init before we are on the classpath var jdbcClass = org.rfresh.sqlite.JDBC.class; dbPath = WorldMap.saveFolder.toPath().resolve(worldId).resolve(databaseName + \".db\"); init = !dbPath.toFile().exists(); connection = DriverManager.getConnection(\"jdbc:rfresh_sqlite:\" + dbPath); ((SQLiteConnection) connection).setBusyTimeout(5000); } catch (Exception e) { XaeroPlus.LOGGER.error(\"Error while creating chunk highlight database: {} for worldId: {}\", databaseName, worldId, e); throw new RuntimeException(e); } }", "tokens": 172} {"id": 516565, "source": "method", "repo": "rfresh2/xaeroplus", "text": "public SavableHighlightCacheInstance(String name) { this.name = name; // always starts as a local cache // to switch to disk cache call setDiskCache this.cache = new ChunkHighlightLocalCache(name); }", "tokens": 49} {"id": 516636, "source": "method", "repo": "rfresh2/xaeroplus", "text": "private Long2LongMap loadFeatureHighlightsInWindow() { var window = MapRenderWindow.resolveCurrent(); return chunkHighlightProvider.chunkHighlightSupplier() .getHighlights(window.windowX(), window.windowZ(), window.windowSize(), window.dimension()); }", "tokens": 58} {"id": 516886, "source": "method", "repo": "rfresh2/xaeroplus", "text": "private Long2LongMap getLavaColumnHeightHighlights(ResourceKey dim) { return lavaColumnsCache.get().getCacheMap(dim); }", "tokens": 34} {"id": 516998, "source": "method", "repo": "rfresh2/xaeroplus", "text": "public void saveRespawnPointsAsync() { ForkJoinPool.commonPool().execute(this::saveRespawnPoints); }", "tokens": 24} {"id": 517197, "source": "method", "repo": "rfresh2/xaeroplus", "text": "public void onResourceManagerReload(final ResourceManager resourceManager) { XaeroPlusShaders.onResourceReload(resourceManager); }", "tokens": 25} {"id": 517294, "source": "method", "repo": "rieckpil/blog-tutorials", "text": "void shouldDoXyz(UUID userId, UserCreationRequest request) { assertThat(userId).isNotNull(); assertThat(request).isNotNull().hasNoNullFieldsOrProperties(); }", "tokens": 36} {"id": 517365, "source": "method", "repo": "rieckpil/blog-tutorials", "text": "void artificialDelay() throws Exception { // delaying the test execution to see the parallelization efforts Thread.sleep(1000); }", "tokens": 35} {"id": 517402, "source": "method", "repo": "rieckpil/blog-tutorials", "text": "public List getSelectedCustomerList() { return selectedCustomerList; }", "tokens": 17} {"id": 517554, "source": "method", "repo": "rieckpil/blog-tutorials", "text": "public ResponseEntity createNewUser( @RequestBody String username, UriComponentsBuilder uriComponentsBuilder) { Long id = this.userService.createUser(username); return ResponseEntity.created( uriComponentsBuilder.path(\"/api/users/{id}\").buildAndExpand(id).toUri()) .build(); }", "tokens": 65} {"id": 517591, "source": "method", "repo": "rieckpil/blog-tutorials", "text": "public void registerStompEndpoints(StompEndpointRegistry registry) { registry.addEndpoint(\"/ws\").setAllowedOrigins(\"*\").withSockJS(); }", "tokens": 35} {"id": 517613, "source": "method", "repo": "rieckpil/blog-tutorials", "text": "public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws SQLException { set(st, clazz.cast(value), index, session); }", "tokens": 42} {"id": 517615, "source": "method", "repo": "rieckpil/blog-tutorials", "text": "public int hashCode(Object x) { return x.hashCode(); }", "tokens": 15} {"id": 517762, "source": "method", "repo": "rieckpil/blog-tutorials", "text": "void advancedAssertions() { Assertions.assertThat(List.of(\"duke\", \"mike\", \"alice\", \"john\")) .containsAnyOf(\"mike\", \"duke\") .hasSizeBetween(3, 5) .hasOnlyElementsOfType(String.class); Assertions.assertThat( List.of( new User(\"duke\", LocalDateTime.now().minusMonths(3)), new User(\"alice\", LocalDateTime.MIN))) .extracting(User::getCreatedAt) .filteredOn(createdAt -> createdAt.isBefore(LocalDateTime.now())) .hasSize(2); Assertions.assertThat(List.of(\"duke\", \"mike\", \"anna\", \"john\")) .allSatisfy( username -> { Assertions.assertThat(username).hasSize(4); Assertions.assertThat(username).isLowerCase(); }); Assertions.assertThat(List.of(\"duke\", \"mike\", \"alice\", \"john\")) .anySatisfy( username -> { Assertions.assertThat(username).endsWith(\"n\"); Assertions.assertThat(username).isSubstringOf(\"johnny\"); }); Assertions.assertThat(LocalDateTime.now()) .isCloseTo(LocalDateTime.now().plusHours(1), within(2, ChronoUnit.HOURS)) .isAfter(LocalDateTime.now().minusDays(1)) .isCloseToUtcNow(within(2, ChronoUnit.HOURS)); Assertions.assertThat(BigDecimal.TEN) .isNotNegative() .isBetween(BigDecimal.ONE, BigDecimal.valueOf(20.0)) .isGreaterThanOrEqualTo(BigDecimal.ZERO) .isNotZero(); }", "tokens": 329} {"id": 517827, "source": "method", "repo": "rieckpil/blog-tutorials", "text": "public void storeNewUser(User user) { this.inMemoryUserList.add(user); }", "tokens": 23} {"id": 517995, "source": "method", "repo": "rieckpil/testing-spring-boot-applications-masterclass", "text": "public void initialize(ConfigurableApplicationContext applicationContext) { LOG.info(\"About to mock the HTTP calls for the books that get initialized during startup\"); OpenLibraryStubs openLibraryStubs = applicationContext.getBeanFactory().getBean(OpenLibraryStubs.class); openLibraryStubs.stubForSuccessfulBookResponse( \"9780321751041\", getValidResponse(\"9780321751041\")); openLibraryStubs.stubForSuccessfulBookResponse( \"9780321160768\", getValidResponse(\"9780321160768\")); openLibraryStubs.stubForSuccessfulBookResponse( \"9780596004651\", getValidResponse(\"9780596004651\")); }", "tokens": 179} {"id": 518409, "source": "method", "repo": "rikkaapps/rikkax", "text": "void setSupportBackgroundTintList(ColorStateList tint) { if (mBackgroundTint == null) { mBackgroundTint = new TintInfo(); } mBackgroundTint.mTintList = tint; mBackgroundTint.mHasTintList = true; applySupportBackgroundTint(); }", "tokens": 50} {"id": 518599, "source": "method", "repo": "rikkaapps/rikkax", "text": "private void updateViewsVisibility(final boolean collapsed) { mIconified = collapsed; // Visibility of views that are visible when collapsed final int visCollapsed = collapsed ? VISIBLE : GONE; // Is there text in the query final boolean hasText = !TextUtils.isEmpty(mSearchSrcTextView.getText()); mSearchButton.setVisibility(visCollapsed); updateSubmitButton(hasText); mSearchEditFrame.setVisibility(collapsed ? GONE : VISIBLE); final int iconVisibility; if (mCollapsedIcon.getDrawable() == null || mIconifiedByDefault) { iconVisibility = GONE; } else { iconVisibility = VISIBLE; } mCollapsedIcon.setVisibility(iconVisibility); updateCloseButton(); updateVoiceButton(!hasText); updateSubmitArea(); }", "tokens": 159} {"id": 518667, "source": "method", "repo": "rikkaapps/rikkax", "text": "public CharSequence[] getTextArray(int index) { return mWrapped.getTextArray(index); }", "tokens": 21} {"id": 518891, "source": "method", "repo": "rikkaapps/shizuku-api", "text": "public void dispatchRequestPermissionResult(int requestCode, Bundle data) { boolean allowed = data.getBoolean(REQUEST_PERMISSION_REPLY_ALLOWED, false); scheduleRequestPermissionResultListener(requestCode, allowed ? PackageManager.PERMISSION_GRANTED : PackageManager.PERMISSION_DENIED); }", "tokens": 55} {"id": 518921, "source": "method", "repo": "rikkaapps/shizuku-api", "text": "/** Returns remote service version. @return server version */ public static int getVersion() { if (serverApiVersion != -1) return serverApiVersion; try { serverApiVersion = requireService().getVersion(); } catch (RemoteException e) { throw rethrowAsRuntimeException(e); } catch (SecurityException e) { // Shizuku pre-v11 and permission is not granted return -1; } return serverApiVersion; }", "tokens": 86} {"id": 519093, "source": "method", "repo": "rikkaapps/shizuku-api", "text": "private int requestExitCode() throws RemoteException { Log.d(TAG, \"requestExitCode\"); Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); try { data.writeInterfaceToken(RishConfig.getInterfaceToken()); RishConfig.getBinder().transact(RishConfig.getTransactionCode(RishConfig.TRANSACTION_getExitCode), data, null, 0); reply.readException(); return reply.readInt(); } finally { data.recycle(); reply.recycle(); } }", "tokens": 104} {"id": 519355, "source": "method", "repo": "ripmeapp/ripme", "text": "public String getHost() { return \"e621\"; }", "tokens": 15} {"id": 519466, "source": "method", "repo": "ripmeapp/ripme", "text": "private String getVideoFromMyDaddycc(String videoPageUrl) { Pattern p = Pattern.compile(\"(//[a-zA-Z0-9\\\\.]+/pub/cid/[a-z0-9]+/1080.mp4)\"); try { logger.info(\"Downloading from mydaddy \" + videoPageUrl); Document page = Http.url(videoPageUrl).referrer(hqpornerVideoPageUrl).get(); Matcher m = p.matcher(page.html()); logger.info(page.html()); if (m.find()) { return \"https:\" + m.group(0); } } catch (IOException e) { logger.error(\"Unable to get page with video\"); } return null; }", "tokens": 167} {"id": 519548, "source": "method", "repo": "ripmeapp/ripme", "text": "public Document getFirstPage() throws IOException { Document doc = Http.url(url).get(); if (urlType == UrlType.LIST) { listId = doc.select(\"#customlistitems\").first().attr(\"data-listid\"); // Used for list types. } return doc; }", "tokens": 65} {"id": 519621, "source": "method", "repo": "ripmeapp/ripme", "text": "private static Map getCookies() { if (cookies == null) { cookies = new HashMap<>(1); cookies.put(\"ui-tnc-agreed\", \"true\"); } return cookies; }", "tokens": 48} {"id": 519711, "source": "method", "repo": "ripmeapp/ripme", "text": "public Document getFirstPage() throws IOException, URISyntaxException { return super.getFirstPage(); }", "tokens": 20} {"id": 519756, "source": "method", "repo": "ripmeapp/ripme", "text": "public String getGID(URL url) throws MalformedURLException { Pattern p; Matcher m; p = Pattern.compile(\"^.*vidble.com/album/([a-zA-Z0-9_\\\\-]+).*$\"); m = p.matcher(url.toExternalForm()); if (m.matches()) { return m.group(1); } throw new MalformedURLException( \"Expected vidble.com album format: \" + \"vidble.com/album/####\" + \" Got: \" + url); }", "tokens": 117} {"id": 519878, "source": "method", "repo": "ripmeapp/ripme", "text": "public QueueMenuMouseListener(Consumer> updateQueue) { this.updateQueue = updateQueue; updateUI(); }", "tokens": 28} {"id": 520203, "source": "method", "repo": "rm3l/maoni", "text": "public CallbacksConfiguration setListener(@Nullable final Listener listener) { this.listener = listener; return this; }", "tokens": 25} {"id": 520254, "source": "method", "repo": "rmlio/rmlmapper-java", "text": "public Map execute(List triplesMaps) throws Exception { return this.execute(triplesMaps, false, null); }", "tokens": 34} {"id": 520309, "source": "method", "repo": "rmlio/rmlmapper-java", "text": "public ProvenancedTerm getPredicate() { return predicate; }", "tokens": 15} {"id": 520444, "source": "method", "repo": "rmlio/rmlmapper-java", "text": "private Term createActivityStatementsWithResultActivity(List termMaps, Map map, Term resultActivity) { if (!termMaps.isEmpty()) { return createActivityStatementsWithResultActivity(termMaps.get(0), map, resultActivity); } return null; }", "tokens": 63} {"id": 520626, "source": "method", "repo": "rmlio/rmlmapper-java", "text": "public void evaluate_0006_CSV() throws Exception { doPreloadMapping(\"./rml-fno-test-cases/RMLFNOTC0006-CSV/mapping.ttl\", \"./rml-fno-test-cases/RMLFNOTC0006-CSV/output.nq\"); }", "tokens": 63} {"id": 520728, "source": "method", "repo": "rmlio/rmlmapper-java", "text": "public void evaluate_1021_CSV() { doMapping(\"test-cases/RMLTC1021-CSV/mapping.ttl\", \"test-cases/RMLTC1021-CSV/output.nq\"); }", "tokens": 49} {"id": 520759, "source": "method", "repo": "rmlio/rmlmapper-java", "text": "public void evaluate_0007h_EXCEL() { doMappingExpectError(\"./test-cases/RMLTC0007h-EXCEL/mapping.ttl\"); }", "tokens": 36} {"id": 520767, "source": "method", "repo": "rmlio/rmlmapper-java", "text": "public void evaluate_0011b_EXCEL() { doMapping(\"./test-cases/RMLTC0011b-EXCEL/mapping.ttl\", \"./test-cases/RMLTC0011b-EXCEL/output.nq\"); }", "tokens": 52} {"id": 520976, "source": "method", "repo": "rmlio/rmlmapper-java", "text": "public void evaluate_RMLTTC0005a() { Map outPaths = new HashMap<>(); outPaths.put(new NamedNode(\"http://example.com/rules/#TargetDump1\"), \"./new-test-cases/io/RMLTTC0005a/dump1.nq\"); outPaths.put(new NamedNode(\"rmlmapper://default.store\"), \"./new-test-cases/io/RMLTTC0005a/default.nq\"); doMapping(\"./new-test-cases/io/RMLTTC0005a/mapping.ttl\", outPaths); }", "tokens": 134} {"id": 521205, "source": "method", "repo": "RoastSlav/quickdrop", "text": "public String toggleHidden(@PathVariable String uuid, HttpServletRequest request) { Upload f = fileQueryService.getFile(uuid).orElse(null); if (f != null && f.deleted) return REDIRECT_FILE_PREFIX + uuid; Upload fileEntity = fileLifecycleService.toggleHidden(uuid, request); if (fileEntity != null) { logger.info(\"Updated hidden for file UUID: {} to {}\", uuid, fileEntity.hidden); return REDIRECT_FILE_PREFIX + fileEntity.uuid; } return REDIRECT_FILE_LIST; }", "tokens": 117} {"id": 521208, "source": "method", "repo": "RoastSlav/quickdrop", "text": "public String passwordPage() { return \"app-password\"; }", "tokens": 14} {"id": 521263, "source": "method", "repo": "RoastSlav/quickdrop", "text": "public void setPastebinEnabled(boolean pastebinEnabled) { this.pastebinEnabled = pastebinEnabled; }", "tokens": 25} {"id": 521327, "source": "method", "repo": "RoastSlav/quickdrop", "text": "public String getSftpKnownHosts() { return sftpKnownHosts; }", "tokens": 14} {"id": 521368, "source": "method", "repo": "RoastSlav/quickdrop", "text": "public boolean isKeepIndefinitelyAdminOnly() { return keepIndefinitelyAdminOnly; }", "tokens": 17} {"id": 521450, "source": "method", "repo": "RoastSlav/quickdrop", "text": "public String getLogStoragePath() { return self.getApplicationSettings().getLogStoragePath(); }", "tokens": 17} {"id": 521558, "source": "method", "repo": "RoastSlav/quickdrop", "text": "/** Retrieves the plaintext password bound to the caller's file-session token, or {@code null} if no valid token is present in the HTTP session.

Package-private \u2014 used by {@link FileDownloadService} to decrypt AES-encrypted files without exposing the session-token internals beyond this package. */ String getFilePasswordFromSessionToken(HttpServletRequest request) { Object sessionToken = request.getSession().getAttribute(SessionService.FILE_SESSION_TOKEN_ATTR); if (sessionToken == null) { return null; } FileSession fileSession = sessionService.getPasswordForFileSessionToken(sessionToken.toString()); return fileSession == null ? null : fileSession.getPassword(); }", "tokens": 141} {"id": 521596, "source": "method", "repo": "RoastSlav/quickdrop", "text": "public String id() { return \"safe_browsing\"; }", "tokens": 15} {"id": 521614, "source": "method", "repo": "RoastSlav/quickdrop", "text": "/** Validates a user-chosen alias: format, reserved words, and case-insensitive uniqueness (to avoid {@code PayPal} and {@code paypal} resolving to different links). @return valid, or invalid with a message safe to show the user */ public AliasVerdict validateAlias(String alias) { if (alias == null || !ALIAS_PATTERN.matcher(alias).matches()) { return AliasVerdict.invalid(\"Use 3-64 letters, numbers, hyphens, or underscores.\"); } if (RESERVED_WORDS.contains(alias.toLowerCase(Locale.ROOT))) { return AliasVerdict.invalid(\"That word is reserved and can't be used as a link.\"); } if (shortLinkRepository.existsByCodeIgnoreCase(alias)) { return AliasVerdict.invalid(\"That link is already taken.\"); } return AliasVerdict.valid(); }", "tokens": 190} {"id": 522005, "source": "method", "repo": "RoastSlav/quickdrop", "text": "/** A restart used to re-download the whole feed: the last-sync timestamp and the cached ETag / Last-Modified all lived only in memory, so the min-sync-interval floor never applied on boot and no conditional-GET validators were sent. refresh() now seeds itself from the copy already on disk.

The feed file is written with a current timestamp, so refresh() must treat it as fresh and make no network call at all \u2014 if it tried, this test would fail on the unreachable host rather than pass. */ void restartReusesCachedFeedInsteadOfDownloadingAgain() throws Exception { Files.writeString(feedFile, \"evil.com\" + System.lineSeparator(), StandardCharsets.UTF_8); long mtimeBefore = Files.getLastModifiedTime(feedFile).toMillis(); // a second provider over the same path stands in for a fresh JVM after restart PhishingArmyProvider afterRestart = new PhishingArmyProvider(new RestTemplateBuilder(), applicationSettingsService, feedFile); assertFalse(afterRestart.isLoaded(), \"provider should start cold\"); afterRestart.refresh(); assertTrue(afterRestart.isLoaded(), \"cached feed should be loaded from disk\"); assertTrue(afterRestart.isMalicious(URI.create(\"https://evil.com/phish\")), \"entries from the cached feed should be matchable\"); assertEquals(mtimeBefore, Files.getLastModifiedTime(feedFile).toMillis(), \"hydrating must not rewrite the file, which would reset its age\"); }", "tokens": 317} {"id": 522009, "source": "method", "repo": "RoastSlav/quickdrop", "text": "void updatedFeedIsRecordedWithProviderAndEntryCount() { when(provider.refresh()).thenReturn(RefreshOutcome.updated(156264)); syncService.refreshAndLog(\"Phishing Army\", provider); verify(analyticsService).logEvent(eq(EventType.REPUTATION_FEED_UPDATED), isNull(), isNull(), eq(\"Phishing Army: 156,264 entries\")); }", "tokens": 95} {"id": 522333, "source": "method", "repo": "rohannagar/jmail", "text": "private static void runInvalidTest(EmailValidator validator, String email, FailureReason expectedFailureReason) { Condition invalid = new Condition<>(validator::isInvalid, \"invalid\"); assertThat(validator.tryParse(email)).isNotPresent(); assertThat(email).is(invalid); assertThatExceptionOfType(InvalidEmailException.class) .isThrownBy(() -> validator.enforceValid(email)); assertThat(validator.validate(email).isFailure()).isTrue(); assertThat(validator.validate(email).getFailureReason()) .isEqualTo(expectedFailureReason); }", "tokens": 115} {"id": 522382, "source": "method", "repo": "rohannagar/jmail", "text": "void displayNameListWithoutQuotedCommas() { List emails = JMail.tryParseAddressList( \"John Smith , Jane Doe \"); assertThat(emails).hasSize(2); assertThat(emails.get(0)) .returns(true, Email::hasDisplayName) .returns(\"john@example.com\", Email::normalized); assertThat(emails.get(1)) .returns(true, Email::hasDisplayName) .returns(\"jane@example.org\", Email::normalized); }", "tokens": 128} {"id": 522629, "source": "method", "repo": "RohitKushvaha01/Xed-Editor", "text": "public FileTime lastAccessTime() { return toFileTime(st_atime_sec, st_atime_nsec); }", "tokens": 30} {"id": 522830, "source": "method", "repo": "RohitKushvaha01/Xed-Editor", "text": "/** A static function to check if the value is {@code false} for {@link Properties} key read from the propertiesFile file. @param context The {@link Context} for the {@link #getPropertiesFromFile(Context,File,SharedPropertiesParser)} call. @param propertiesFile The {@link File} to read the {@link Properties} from. @param key The key to read. @param logErrorOnInvalidValue If {@code true}, then an error will be logged if key value was found in {@link Properties} but was invalid. @param sharedPropertiesParser The implementation of the {@link SharedPropertiesParser} interface. @return Returns the {@code true} if the {@link Properties} key {@link String} value equals \"false\", regardless of case. If the key does not exist in the file or does not equal \"false\", then {@code true} will be returned. */ public static boolean isPropertyValueFalse(Context context, File propertiesFile, String key, boolean logErrorOnInvalidValue, @Nullable SharedPropertiesParser sharedPropertiesParser) { return (boolean) getInvertedBooleanValueForStringValue(key, (String) getProperty(context, propertiesFile, key, null, sharedPropertiesParser), true, logErrorOnInvalidValue, LOG_TAG); }", "tokens": 262} {"id": 522886, "source": "method", "repo": "RohitKushvaha01/Xed-Editor", "text": "public String getCommandDescriptionLogString() { return Logger.getSingleLineLogStringEntry(\"Command Description\", commandDescription, \"-\"); }", "tokens": 27} {"id": 522887, "source": "method", "repo": "RohitKushvaha01/Xed-Editor", "text": "public String getPluginAPIHelpLogString() { return Logger.getSingleLineLogStringEntry(\"Plugin API Help\", pluginAPIHelp, \"-\"); }", "tokens": 30} {"id": 523405, "source": "method", "repo": "RohitKushvaha01/Xed-Editor", "text": "public void removeFromParent() { if (!isParentNull()) { ((ViewGroup)this.getParent()).removeView(this); } }", "tokens": 30} {"id": 523432, "source": "method", "repo": "ronanplugins/betterrtp", "text": "public void onDisable() { addonsHandler.unload(); }", "tokens": 12} {"id": 523649, "source": "method", "repo": "ronanplugins/betterrtp", "text": "/** Retrieve the location of this block change.

The world and absolute chunk position must be provided. @param world - the world the block belongs to. @param chunkX - the x position of the origin chunk @param chunkZ - the y position of the origin chunk @return The location. */ public Location getLocation(World world, int chunkX, int chunkZ) { if (world == null) throw new IllegalArgumentException(\"World cannot be NULL.\"); return new Location( world, (chunkX << 4) + getRelativeX(), getAbsoluteY(), (chunkZ << 4) + getRelativeZ() ); }", "tokens": 129} {"id": 523716, "source": "method", "repo": "ronanplugins/betterrtp", "text": "public static void sms(CommandSender sendi, String msg) { Message.sms(Message_ADDONS.msg, sendi, msg); }", "tokens": 33} {"id": 523759, "source": "method", "repo": "ronanplugins/betterrtp", "text": "public String get() { return str; }", "tokens": 10} {"id": 523785, "source": "method", "repo": "ronanplugins/betterrtp", "text": "public void usage(CommandSender sendi, String label) { MessagesUsage.RTP_OTHER.send(sendi, label); }", "tokens": 27} {"id": 523967, "source": "method", "repo": "ronanplugins/betterrtp", "text": "protected void close(PreparedStatement ps, ResultSet rs, Connection conn) { try { if (ps != null) ps.close(); if (conn != null) conn.close(); if (rs != null) rs.close(); } catch (SQLException ex) { Error.close(BetterRTP.getInstance(), ex); } }", "tokens": 67} {"id": 523972, "source": "method", "repo": "ronanplugins/betterrtp", "text": "private void check(boolean force) { if (!checked || force) registerEconomy(); if (BetterRTP.getInstance().getFiles().getType(FileOther.FILETYPE.ECO).getBoolean(\"Hunger.Enabled\")) hunger = BetterRTP.getInstance().getFiles().getType(FileOther.FILETYPE.ECO).getInt(\"Hunger.Honches\"); else hunger = 0; }", "tokens": 83} {"id": 523985, "source": "method", "repo": "ronanplugins/betterrtp", "text": "private World getWorld(String world_name) { World world = null; if (world_name.length() > 0) for (World _world : Bukkit.getWorlds()) if (world_name.equalsIgnoreCase(_world.getName())) { world = _world; break; } return world; }", "tokens": 68} {"id": 524038, "source": "method", "repo": "ronanplugins/betterrtp", "text": "private static boolean isRTPing(Player player) { return getPl().getPInfo().getRtping().getOrDefault(player, false); }", "tokens": 30} {"id": 524298, "source": "method", "repo": "rongcloud/server-sdk-java", "text": "public LBSMessage(String content, String extra, double latitude, double longitude, String poi) { this.content = content; this.extra = extra; this.latitude = latitude; this.longitude = longitude; this.poi = poi; }", "tokens": 55} {"id": 524362, "source": "method", "repo": "rongcloud/server-sdk-java", "text": "/** Method to query muted group members @param groupId: Group ID (required) @return ListGagGroupUserResult */ public ListGagGroupUserResult getList(String groupId) throws Exception { String message = CommonUtil.checkParam(\"id\",groupId,PATH,CheckMethod.GETLIST); if(null != message){ return (ListGagGroupUserResult)GsonUtil.fromJson(message,ListGagGroupUserResult.class); } StringBuilder sb = new StringBuilder(); sb.append(\"&groupId=\").append(URLEncoder.encode(groupId.toString(), UTF8)); String body = sb.toString(); if (body.indexOf(\"&\") == 0) { body = body.substring(1, body.length()); } HttpURLConnection conn = HttpUtil.CreatePostHttpConnection(rongCloud.getConfig(), appKey, appSecret, \"/group/user/gag/list.json\", \"application/x-www-form-urlencoded\"); HttpUtil.setBodyParameter(body, conn, rongCloud.getConfig()); return (ListGagGroupUserResult) GsonUtil.fromJson(CommonUtil.getResponseByCode(PATH,CheckMethod.GETLIST,HttpUtil.returnResult(conn, rongCloud.getConfig())), ListGagGroupUserResult.class); }", "tokens": 260} {"id": 524612, "source": "method", "repo": "rongcloud/server-sdk-java", "text": "public UltraGroupMessage setContent(BaseMessage content) { super.setContent(content); return this; }", "tokens": 23} {"id": 524796, "source": "method", "repo": "rongcloud/server-sdk-java", "text": "public String toString() { return GsonUtil.toJson(this, BanModel.class); }", "tokens": 20} {"id": 524827, "source": "method", "repo": "rongcloud/server-sdk-java", "text": "/** Set user mute */ public void testBanUser() throws Exception { BanModel model = new BanModel() .setUserId(new String[]{\"CHIQ1\", \"CHIQ2\"}) .setState(1); Result result = rongCloud.user.ban.set(model); assertEquals(\"1002\", result.getCode().toString()); System.out.println(\"testBanUser: [t1] \" + result.toString()); model.setType(\"PERSON\"); result = rongCloud.user.ban.set(model); assertEquals(\"200\", result.getCode().toString()); System.out.println(\"testBanUser: [t2] \" + result.toString()); }", "tokens": 146} {"id": 524856, "source": "method", "repo": "rongcloud/server-sdk-java", "text": "/** Join an ultra group @throws Exception */ public void testUltragroupJoin() throws Exception { UltraGroupModel ultraGroupModel = new UltraGroupModel() .setId(\"test1\") .setUserId(\"testuser\"); Result result = rongCloud.ultraGroup.join(ultraGroupModel); System.out.println(\"join: \" + result.toString()); assertEquals(\"200\", result.getCode().toString()); }", "tokens": 92} {"id": 524884, "source": "method", "repo": "rubenlagus/telegrambots", "text": "/** Invokes the method and retrieves its return {@link Reply}. @param obj a bot or extension that this method is invoked with @return a {@link Function} which returns the {@link Reply} returned by the given method */ private static Function returnReply(Object obj) { return method -> { try { return (Reply) method.invoke(obj); } catch (IllegalAccessException | InvocationTargetException e) { log.error(\"Could not add reply\", e); throw new RuntimeException(e); } }; }", "tokens": 117} {"id": 524915, "source": "method", "repo": "rubenlagus/telegrambots", "text": "public AbilityBuilder info(String info) { this.info = info; return this; }", "tokens": 20} {"id": 525029, "source": "method", "repo": "rubenlagus/telegrambots", "text": "public Boolean execute(ReplaceStickerInSet replaceStickerInSet) throws TelegramApiException { try { return executeAsync(replaceStickerInSet).get(); } catch (Exception e) { throw mapException(e, replaceStickerInSet.getMethod()); } }", "tokens": 54} {"id": 525035, "source": "method", "repo": "rubenlagus/telegrambots", "text": "public TelegramMultipartBuilder addInputStickers(String stickersField, List stickers) throws IOException { for (InputSticker sticker : stickers) { addInputFile(null, sticker.getSticker(), false); } addJsonPart(stickersField, stickers); return this; }", "tokens": 69} {"id": 525113, "source": "method", "repo": "rubenlagus/telegrambots", "text": "public TelegramBotsLongPollingApplication(Supplier objectMapperSupplier, Supplier okHttpClientCreator, Supplier executorSupplier) { this(objectMapperSupplier, okHttpClientCreator, executorSupplier, ExponentialBackOff::new); }", "tokens": 53} {"id": 525134, "source": "method", "repo": "rubenlagus/telegrambots", "text": "public void validate() throws TelegramApiValidationException { if (guestQueryId.isEmpty()) { throw new TelegramApiValidationException(\"GuestQueryId can't be empty\", this); } result.validate(); }", "tokens": 42} {"id": 525165, "source": "method", "repo": "rubenlagus/telegrambots", "text": "public void validate() throws TelegramApiValidationException { Validations.requiredChatId(chatId, this); if (messageThreadId <= 0) { throw new TelegramApiValidationException(\"Message Thread Id can't be empty\", this); } }", "tokens": 49} {"id": 525278, "source": "method", "repo": "rubenlagus/telegrambots", "text": "public InputMediaAnimation(@NonNull String media, String caption, String parseMode, List captionEntities, boolean isNewMedia, String mediaName, File newMediaFile, InputStream newMediaStream, Integer width, Integer height, Integer duration, InputFile thumbnail, Boolean hasSpoiler) { super(media, caption, parseMode, captionEntities, isNewMedia, mediaName, newMediaFile, newMediaStream); this.width = width; this.height = height; this.duration = duration; this.thumbnail = thumbnail; this.hasSpoiler = hasSpoiler; }", "tokens": 128} {"id": 525327, "source": "method", "repo": "rubenlagus/telegrambots", "text": "public KeyboardRow(int initialCapacity) { super(initialCapacity); }", "tokens": 16} {"id": 525394, "source": "method", "repo": "rubenlagus/telegrambots", "text": "public void descriptionCantBeOver255() { SendInvoice sendInvoice = createSendInvoiceObject(); sendInvoice.setDescription(\"1234567890123456789012345678901234567890123456789012345678901234567890\" + \"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\" + \"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345\" + \"1234567890123456789012345678901234567890123456789012345678901234567890\"); Throwable thrown = assertThrows(TelegramApiValidationException.class, sendInvoice::validate); assertEquals(\"Description parameter can't be empty or longer than 255 chars\", thrown.getMessage()); }", "tokens": 403} {"id": 525466, "source": "method", "repo": "rubenlagus/telegrambots", "text": "public void testUserProfileAudiosBuilder() { Audio audio1 = Audio.builder() .fileId(\"audio1_file_id\") .fileUniqueId(\"audio1_unique_id\") .duration(180) .build(); Audio audio2 = Audio.builder() .fileId(\"audio2_file_id\") .fileUniqueId(\"audio2_unique_id\") .duration(240) .build(); List

\" + CRLF + POST_HTML, body.html()); assertEquals(CRLF, body.text()); }", "tokens": 61} {"id": 529889, "source": "method", "repo": "sargue/mailgun", "text": "public void tableRow4Cells() { Body body = Body.builder() .table() .row(\"cell 1\", \"cell 2\", \"cell 3\", \"cell 4\") .end() .build(); assertEquals(PRE_HTML + \"
\" + \"\" + \"\" + CRLF + \"
cell 1cell 2cell 3cell 4
\" + CRLF + POST_HTML, body.html()); assertEquals(\"cell 1,cell 2,cell 3,cell 4\" + CRLF + CRLF, body.text()); }", "tokens": 162} {"id": 529941, "source": "method", "repo": "sarxos/webcam-capture", "text": "public static void main(String[] args) { Webcam w = Webcam.getDefault(); w.open(true); Vector images = new Vector(); System.out.println(\"recording, please wait\"); for (int i = 0; i < 100; i++) { images.add(w.getImage()); try { Thread.sleep(100); } catch (InterruptedException e) { return; } } w.close(); System.out.println(\"play\"); PlayerPanel panel = new PlayerPanel(images); JFrame f = new JFrame(\"Take pictures and play example\"); f.add(panel); f.pack(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setVisible(true); panel.play(); try { Thread.sleep(100 * images.size()); } catch (InterruptedException e) { return; } }", "tokens": 188} {"id": 530084, "source": "method", "repo": "sarxos/webcam-capture", "text": "public BufferedImage get() { return webcam.getImage(); }", "tokens": 12} {"id": 530101, "source": "method", "repo": "sarxos/webcam-capture", "text": "/** This method return true in case if camera FPS is set to be displayed on panel surface. Default value returned is false. @return True if camera FPS is set to be displayed on panel surface @see #setFPSDisplayed(boolean) */ public boolean isFPSDisplayed() { return frequencyDisplayed; }", "tokens": 64} {"id": 530181, "source": "method", "repo": "sarxos/webcam-capture", "text": "/** Determines if device should fail when requested image size is different than actually received. @param fail the fail on size mismatch flag, true or false */ public void setFailOnSizeMismatch(boolean fail) { this.failOnSizeMismatch = fail; }", "tokens": 51} {"id": 530685, "source": "method", "repo": "sarxos/webcam-capture", "text": "public StreamClientChannelPipelineFactory( StreamClientListener streamClientListener, StreamFrameListener streamFrameListener, Dimension dimension) { super(); this.streamClientListener = streamClientListener; this.streamFrameListener = streamFrameListener; this.dimension = dimension; }", "tokens": 55} {"id": 530817, "source": "method", "repo": "sashirestela/simple-openai", "text": "public static void main(String[] args) { var demo = new CompletionDemo(); demo.addTitleAction(\"Call Completion (Streaming Approach)\", demo::demoCallCompletionStreaming); demo.addTitleAction(\"Call Completion (Blocking Approach)\", demo::demoCallCompletionBlocking); demo.run(); }", "tokens": 63} {"id": 530844, "source": "method", "repo": "sashirestela/simple-openai", "text": "public static void demoAuthenticationException() { var openAI = SimpleOpenAI.builder() .apiKey(\"bad-apikey\") .build(); var models = openAI.models().getList().join(); models.forEach(System.out::println); }", "tokens": 52} {"id": 530886, "source": "method", "repo": "sashirestela/simple-openai", "text": "public Sound() throws LineUnavailableException { AudioFormat format = new AudioFormat( SAMPLE_RATE, SAMPLE_SIZE_BITS, CHANNELS, SIGNED, BIG_ENDIAN); DataLine.Info micInfo = new DataLine.Info(TargetDataLine.class, format); if (!AudioSystem.isLineSupported(micInfo)) { throw new LineUnavailableException(\"Microphone not supported\"); } microphone = (TargetDataLine) AudioSystem.getLine(micInfo); microphone.open(format); DataLine.Info speakerInfo = new DataLine.Info(SourceDataLine.class, format); if (!AudioSystem.isLineSupported(speakerInfo)) { throw new LineUnavailableException(\"Speakers not supported\"); } speaker = (SourceDataLine) AudioSystem.getLine(speakerInfo); speaker.open(format); }", "tokens": 187} {"id": 530906, "source": "method", "repo": "sashirestela/simple-openai", "text": "public static void main(String[] args) { var demo = new SessionTokenDemo(); demo.addTitleAction(\"Call Session Token Creation\", demo::demoCallCreateSessionToken); demo.addTitleAction(\"Call Transcription Session Token Creation\", demo::demoCallCreateTranscriptionSessionToken); demo.run(); }", "tokens": 63} {"id": 530923, "source": "method", "repo": "sashirestela/simple-openai", "text": "public void createThreadRun() { var thread = assistantProvider.threads().create().join(); threadId = thread.getId(); var question = \"Tell me something brief about Lima Peru, then tell me how's \" + \"the weather and rain probability there right now.\"; System.out.println(\"Question: \" + question); var threadRunRequest = ThreadRunRequest.builder() .assistantId(assistantId) .additionalMessage(ThreadMessageRequest.builder() .role(ThreadMessageRole.USER) .content(question) .build()) .build(); var threadRun = assistantProvider.threadRuns().createAndPoll(threadId, threadRunRequest); var threadMessages = assistantProvider.threadMessages().getList(threadId).join(); var answer = ((ContentPartTextAnnotation) threadMessages.first().getContent().get(0)).getText().getValue(); System.out.println(\"Answer: \" + answer); threadRunId = threadRun.getId(); }", "tokens": 207} {"id": 531032, "source": "method", "repo": "sashirestela/simple-openai", "text": "/** Create a vector store file batch. @param vectorStoreId The ID of the vector store for which to create a File Batch. @param fileIds A list of File IDs that the vector store should use. @return A vector store file batch object */ default CompletableFuture create(String vectorStoreId, List fileIds) { return create(vectorStoreId, VectorStoreFileBatchRequest.builder().fileIds(fileIds).build()); }", "tokens": 97} {"id": 531060, "source": "method", "repo": "sashirestela/simple-openai", "text": "public OpenAIBeta2.ThreadRuns threadRuns() { return getOrCreateService(OpenAIBeta2.ThreadRuns.class); }", "tokens": 26} {"id": 531092, "source": "method", "repo": "sashirestela/simple-openai", "text": "private UnaryOperator makeRequestInterceptor() { return request -> { var contentType = request.getContentType(); if (contentType != null && contentType.equals(ContentType.APPLICATION_JSON)) { var body = makeNewBody(request); request.setBody(body); } return request; }; }", "tokens": 63} {"id": 531106, "source": "method", "repo": "sashirestela/simple-openai", "text": "public JsonSchema(String description, @NonNull String name, Boolean strict, Class schemaClass, JsonNode schema) { this.description = description; this.name = name; this.strict = strict; if (schema != null) { this.schema = schema; } else { this.schema = schemaClass != null ? new DefaultSchemaConverter(Boolean.TRUE).convert(schemaClass) : null; } }", "tokens": 88} {"id": 531164, "source": "method", "repo": "sashirestela/simple-openai", "text": "private ToolMessage(String content, String toolCallId) { this.role = ChatRole.TOOL; this.content = content; this.toolCallId = toolCallId; }", "tokens": 36} {"id": 531347, "source": "method", "repo": "sashirestela/simple-openai", "text": "public PollingAbortedException(String message) { super(message); }", "tokens": 16} {"id": 531364, "source": "method", "repo": "sashirestela/simple-openai", "text": "void testDisconnect() { openAIRealtime.disconnect(); verify(mockWebSocketAdapter).close(); }", "tokens": 21} {"id": 531545, "source": "method", "repo": "sashirestela/simple-openai", "text": "static void setup() { httpClient = mock(HttpClient.class); openAI = SimpleOpenAI.builder() .apiKey(\"apiKey\") .clientAdapter(new JavaHttpClientAdapter(httpClient)) .build(); }", "tokens": 44} {"id": 531586, "source": "method", "repo": "sashirestela/simple-openai", "text": "void shouldGenerateOrderedJsonSchemaWhenClassHasJsonPropertyOrderAnnotation() { var actualJsonSchema = JsonSchemaUtil.classToJsonSchema(OrderedTestClass.class).toString(); var expectedJsonSchema = \"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"first\\\":{\\\"type\\\":\\\"string\\\"},\" + \"\\\"second\\\":{\\\"type\\\":\\\"integer\\\"},\" + \"\\\"third\\\":{\\\"type\\\":\\\"string\\\"}},\" + \"\\\"required\\\":[\\\"first\\\"],\\\"additionalProperties\\\":false}\"; assertEquals(expectedJsonSchema, actualJsonSchema); }", "tokens": 93} {"id": 531595, "source": "method", "repo": "sashirestela/simple-openai", "text": "void executeCountsPollFunctionInvocations() { Poller poller = Poller.builder() .interval(Duration.ofMillis(10)) .pollFunction(i -> { counter.incrementAndGet(); return i + 1; }) .continueIf(i -> i < 5) .build(); poller.execute(0); assertEquals(5, counter.get()); }", "tokens": 87} {"id": 531614, "source": "method", "repo": "saucelabs-training/demo-java", "text": "public void setup(TestInfo testInfo) throws MalformedURLException { Capabilities capabilities = TestConfigurations.getCapabilities(testInfo); this.driver = new AndroidDriver(new URL(SAUCE_URL), capabilities); this.driver.manage().timeouts().implicitlyWait(Duration.of(15, ChronoUnit.SECONDS)); }", "tokens": 69} {"id": 531747, "source": "method", "repo": "saucelabs-training/demo-java", "text": "public ShoppingCartPage(RemoteWebDriver driver) { super(driver); }", "tokens": 15} {"id": 531884, "source": "method", "repo": "saucelabs-training/demo-java", "text": "public void basicAuthCdpEndpoint() { ((HasCdp) driver).executeCdpCommand(\"Network.enable\", new HashMap<>()); String encodedAuth = Base64.getEncoder().encodeToString(\"admin:admin\".getBytes()); Map headers = ImmutableMap.of(\"headers\", ImmutableMap.of(\"authorization\", \"Basic \" + encodedAuth)); ((HasCdp) driver).executeCdpCommand(\"Network.setExtraHTTPHeaders\", headers); driver.get(\"https://the-internet.herokuapp.com/basic_auth\"); Assertions.assertEquals( \"Congratulations! You must have the proper credentials.\", driver.findElement(By.tagName(\"p\")).getText()); }", "tokens": 152} {"id": 531886, "source": "method", "repo": "saucelabs-training/demo-java", "text": "public void setup(TestInfo testInfo) { Map sauceOptions = defaultSauceOptions(testInfo); sauceOptions.put(\"devtools\", true); startSession(new ChromeOptions(), sauceOptions); wait = new WebDriverWait(driver, Duration.ofSeconds(10)); driver = new Augmenter().augment(driver); ClientConfig clientConfig = ClientConfig.defaultConfig().baseUrl(APP_URL); HttpResponse response; try (HttpClient client = HttpClient.Factory.createDefault().createClient(clientConfig)) { response = client.execute(new HttpRequest(DELETE, APP_URL.toString() + \"/items\")); } Assertions.assertEquals(200, response.getStatus()); }", "tokens": 143} {"id": 532096, "source": "method", "repo": "scireum/s3ninja", "text": "S3ErrorCode(HttpResponseStatus httpStatusCode) { this.httpStatusCode = httpStatusCode; }", "tokens": 19} {"id": 532148, "source": "method", "repo": "scribejava/scribejava", "text": "protected String getAuthorizationBaseUrl() { return \"https://www.fitbit.com/oauth2/authorize\"; }", "tokens": 25} {"id": 532150, "source": "method", "repo": "scribejava/scribejava", "text": "protected FlickrApi(FlickrPerm perm) { permString = perm.name().toLowerCase(); }", "tokens": 24} {"id": 532168, "source": "method", "repo": "scribejava/scribejava", "text": "public static GeniusApi instance() { return InstanceHolder.INSTANCE; }", "tokens": 18} {"id": 532179, "source": "method", "repo": "scribejava/scribejava", "text": "protected String getAuthorizationBaseUrl() { return \"https://hh.ru/oauth/authorize\"; }", "tokens": 21} {"id": 532212, "source": "method", "repo": "scribejava/scribejava", "text": "public static LiveApi instance() { return InstanceHolder.INSTANCE; }", "tokens": 15} {"id": 532289, "source": "method", "repo": "scribejava/scribejava", "text": "protected String getAuthorizationBaseUrl() { return \"http://profile.tut.by/auth\"; }", "tokens": 22} {"id": 532403, "source": "method", "repo": "scribejava/scribejava", "text": "private Google20DeviceAuthorizationGrantExample() { }", "tokens": 12} {"id": 532522, "source": "method", "repo": "scribejava/scribejava", "text": "protected OAuth2AccessTokenJsonExtractor() { }", "tokens": 10} {"id": 532608, "source": "method", "repo": "scribejava/scribejava", "text": "public void initMultipartPayload(String subtype, String boundary, Map headers) { this.multipartPayload = new MultipartPayload(subtype, boundary, headers); }", "tokens": 38} {"id": 532674, "source": "method", "repo": "scribejava/scribejava", "text": "public String getResponseType() { return responseType; }", "tokens": 12} {"id": 533001, "source": "method", "repo": "scrin/ruuvicollector", "text": "public static void reload(final Function configFileFinder) { Config.configFileFinder = configFileFinder; loadDefaults(); readTagNames(); readConfig(); }", "tokens": 36} {"id": 533055, "source": "method", "repo": "scrin/ruuvicollector", "text": "public Predicate getInfluxDbFieldFilter() { return influxDbFieldFilter; }", "tokens": 21} {"id": 533110, "source": "method", "repo": "scrin/ruuvicollector", "text": "/** Converts a space-separated string of hex to ASCII @param hex space separated string of hex @return the ASCII representation of the hex string */ public static String hexToAscii(String hex) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < hex.length(); i += 3) { sb.append((char) Integer.parseInt(hex.substring(i, i + 2), 16)); } return sb.toString(); }", "tokens": 102} {"id": 533208, "source": "method", "repo": "sdstoehr/har-reader", "text": "public HarCache() { this(null, null, null, new HashMap<>()); }", "tokens": 18} {"id": 533256, "source": "method", "repo": "sdstoehr/har-reader", "text": "void shouldWriteHarAsString() throws IOException { Har expected = MAPPER.readValue(HAR_FILE, Har.class); Har har = new HarReader().readFromFile(HAR_FILE); HarWriter writer = new HarWriter(); assertEquals(MAPPER.writeValueAsString(expected), writer.writeAsString(har)); }", "tokens": 68} {"id": 533312, "source": "method", "repo": "sdstoehr/har-reader", "text": "void testMapping() { HarPostDataParam postDataParam = map(\"{\\\"name\\\": \\\"aName\\\", \\\"value\\\": \\\"aValue\\\", \\\"fileName\\\": \\\"aFilename\\\", \\\"contentType\\\": \\\"aContentType\\\", \\\"comment\\\": \\\"My comment\\\",\\\"_unknown\\\":\\\"unknown\\\"}\", HarPostDataParam.class); assertEquals(\"aName\", postDataParam.name()); assertEquals(\"aValue\", postDataParam.value()); assertEquals(\"aFilename\", postDataParam.fileName()); assertEquals(\"aContentType\", postDataParam.contentType()); assertEquals(\"My comment\", postDataParam.comment()); assertNotNull(postDataParam.additional()); assertEquals(\"unknown\", postDataParam.additional().get(\"_unknown\")); postDataParam = map(UNKNOWN_PROPERTY, HarPostDataParam.class); assertNotNull(postDataParam); }", "tokens": 164} {"id": 533330, "source": "method", "repo": "sdstoehr/har-reader", "text": "void testBodySize() { HarRequest request = new HarRequest(); assertEquals(-1L, (long) request.bodySize()); }", "tokens": 30} {"id": 533426, "source": "method", "repo": "seart-group/ghs", "text": "public void addCorsMappings(@NotNull final CorsRegistry registry) { registry.addMapping(\"/**\") .allowedMethods(\"GET\") .allowedOrigins( \"http://localhost:3030\", \"http://localhost:7030\", \"https://seart-ghs.si.usi.ch\" ) .exposedHeaders(\"X-Link-Search\", \"X-Link-Download\"); }", "tokens": 91} {"id": 533518, "source": "method", "repo": "seart-group/ghs", "text": "public Range getCommitted() { return Ranges.closed(committedMin, committedMax); }", "tokens": 23} {"id": 533590, "source": "method", "repo": "seart-group/ghs", "text": "public void serialize(Sort value, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartArray(); for (Sort.Order order : value) { gen.writeStartObject(); gen.writeStringField(\"property\", order.getProperty()); gen.writeStringField(\"direction\", order.getDirection().toString()); gen.writeEndObject(); } gen.writeEndArray(); }", "tokens": 74} {"id": 533612, "source": "method", "repo": "seart-group/ghs", "text": "private void noop(GitRepo gitRepo, Throwable ex) { log.error(\"Failed: {} [{}] ({})\", gitRepo.getName(), gitRepo.getId(), ex.getClass().getSimpleName()); log.debug(\"\", ex); }", "tokens": 50} {"id": 533676, "source": "method", "repo": "seart-group/ghs", "text": "public Stream streamBy(Specification specification) { return gitRepoRepository.streamAll(specification); }", "tokens": 27} {"id": 533718, "source": "method", "repo": "seart-group/ghs", "text": "void emptyCycleTest() { Cycle cycle = new Cycle<>(); Assertions.assertEquals(0, cycle.size()); Assertions.assertFalse(cycle.hasNext()); Assertions.assertThrows(NoSuchElementException.class, cycle::next); }", "tokens": 50} {"id": 533940, "source": "method", "repo": "segmentio/analytics-android", "text": "private String byteArrayToHexString(byte[] bytes) { StringBuilder buffer = new StringBuilder(); for (byte element : bytes) { buffer.append(String.format(\"%02x\", element)); } return buffer.toString(); }", "tokens": 47} {"id": 534054, "source": "method", "repo": "segmentio/analytics-android", "text": "private void ringErase(int position, int length) throws IOException { while (length > 0) { int chunk = min(length, ZEROES.length); ringWrite(position, ZEROES, 0, chunk); length -= chunk; position += chunk; } }", "tokens": 60} {"id": 534130, "source": "method", "repo": "segmentio/analytics-android", "text": "/** Set a description of the user or group, like a personal bio. */ public Traits putDescription(String description) { return putValue(DESCRIPTION_KEY, description); }", "tokens": 39} {"id": 534391, "source": "method", "repo": "segmentio/analytics-android", "text": "public GroupPayloadBuilder traits(Traits traits) { this.traits = traits; return this; }", "tokens": 22} {"id": 534453, "source": "method", "repo": "selenide/selenide", "text": "public Set getContextHandles() { SupportsContextSwitching contextAware = (SupportsContextSwitching) driver.getWebDriver(); return contextAware.getContextHandles(); }", "tokens": 38} {"id": 534737, "source": "method", "repo": "selenide/selenide", "text": "public String execute(SelenideElement proxy, WebElementSource locator, Object @Nullable [] args) { String cssPropertyName = firstOf(args); return locator.getWebElement().getCssValue(cssPropertyName); }", "tokens": 44} {"id": 534955, "source": "method", "repo": "selenide/selenide", "text": "public String getWindowHandle() { return \"w-1\"; }", "tokens": 15} {"id": 535454, "source": "method", "repo": "semver4j/semver4j", "text": "/** Sets multiple {@code build} identifiers from a collection. @param builds collection of {@code build} identifiers @return this builder instance @throws NullPointerException if builds is {@code null} */ public Builder withBuilds(Collection builds) { requireNonNull(builds, \"builds cannot be null\"); this.build = List.copyOf(builds); return this; }", "tokens": 79} {"id": 535623, "source": "method", "repo": "semver4j/semver4j", "text": "void shouldReturnTrueIfVersionIsValid() { // given String version = \"1.2.3-alpha.1+sha.1234\"; // when boolean valid = isValid(version); // then assertThat(valid).isTrue(); }", "tokens": 51} {"id": 535667, "source": "method", "repo": "semver4j/semver4j", "text": "void shouldParseHyphenRange(String range, String expectedString) { assertThat(hyphenProcessor.process(range, false)).isEqualTo(expectedString); }", "tokens": 33} {"id": 535691, "source": "method", "repo": "semver4j/semver4j", "text": "void shouldAllowToConfigureProcessors() { // given String ivyRange = \"[1.0.0,2.0.0]\"; // when RangeList ivyRangeList = RangeListFactory.create(ivyRange, new IvyProcessor()); RangeList nonIvyRangeList = RangeListFactory.create(ivyRange, new XRangeProcessor()); // then assertThat(ivyRangeList.toString()).hasToString(\">=1.0.0 and <=2.0.0\"); assertThat(nonIvyRangeList.get()).isEmpty(); }", "tokens": 119} {"id": 535771, "source": "method", "repo": "sendbird/sendbird-android", "text": "void bind(Context context, final UserMessage message, GroupChannel channel, boolean isContinuous, boolean isNewDay, final OnItemClickListener clickListener, final OnItemLongClickListener longClickListener, final int position) { messageText.setText(message.getMessage()); timeText.setText(DateUtils.formatTime(message.getCreatedAt())); if (message.getUpdatedAt() > 0) { editedText.setVisibility(View.VISIBLE); } else { editedText.setVisibility(View.GONE); } // If continuous from previous message, remove extra padding. if (isContinuous) { padding.setVisibility(View.GONE); } else { padding.setVisibility(View.VISIBLE); } // If the message is sent on a different date than the previous one, display the date. if (isNewDay) { dateText.setVisibility(View.VISIBLE); dateText.setText(DateUtils.formatDate(message.getCreatedAt())); } else { dateText.setVisibility(View.GONE); } urlPreviewContainer.setVisibility(View.GONE); if (message.getCustomType().equals(URL_PREVIEW_CUSTOM_TYPE)) { try { urlPreviewContainer.setVisibility(View.VISIBLE); final UrlPreviewInfo previewInfo = new UrlPreviewInfo(message.getData()); urlPreviewSiteNameText.setText(\"@\" + previewInfo.getSiteName()); urlPreviewTitleText.setText(previewInfo.getTitle()); urlPreviewDescriptionText.setText(previewInfo.getDescription()); ImageUtils.displayImageFromUrl(context, previewInfo.getImageUrl(), urlPreviewMainImageView, null); } catch (JSONException e) { urlPreviewContainer.setVisibility(View.GONE); e.printStackTrace(); } } if (clickListener != null) { itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { clickListener.onUserMessageItemClick(message); } }); } if (longClickListener != null) { itemView.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { longClickListener.onUserMessageItemLongClick(message, position); return true; } }); } messageStatusView.drawMessageStatus(channel, message); }", "tokens": 451} {"id": 536059, "source": "method", "repo": "sendbird/sendbird-android", "text": "void bind(Context context, final UserMessage message, GroupChannel channel, boolean isNewDay, boolean isContinuous, final OnItemClickListener clickListener, final OnItemLongClickListener longClickListener, final int position) { super.bind(message, isNewDay); // Hide profile image and nickname if the previous message was also sent by current sender. if (isContinuous) { profileImage.setVisibility(View.INVISIBLE); nicknameText.setVisibility(View.GONE); } else { profileImage.setVisibility(View.VISIBLE); ImageUtils.displayRoundImageFromUrl(context, message.getSender().getProfileUrl(), profileImage); nicknameText.setVisibility(View.VISIBLE); nicknameText.setText(message.getSender().getNickname()); } messageText.setText(message.getMessage()); timeText.setText(DateUtils.formatTime(message.getCreatedAt())); if (message.getUpdatedAt() > 0) { editedText.setVisibility(View.VISIBLE); } else { editedText.setVisibility(View.GONE); } urlPreviewContainer.setVisibility(View.GONE); if (message.getOgMetaData() != null) { urlPreviewContainer.setVisibility(View.VISIBLE); UrlPreviewInfo previewInfo = new UrlPreviewInfo(message.getOgMetaData()); urlPreviewSiteNameText.setText(\"@\" + previewInfo.getSiteName()); urlPreviewTitleText.setText(previewInfo.getTitle()); urlPreviewDescriptionText.setText(previewInfo.getDescription()); ImageUtils.displayImageFromUrl(context, previewInfo.getImageUrl(), urlPreviewMainImageView); } if (clickListener != null) { itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { clickListener.onUserMessageItemClick(message); } }); } if (longClickListener != null) { itemView.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { longClickListener.onUserMessageItemLongClick(message, position); return true; } }); } }", "tokens": 418} {"id": 536169, "source": "method", "repo": "sendbird/sendbird-android", "text": "void clear() { mMessageList.clear(); mFailedMessageList.clear(); notifyDataSetChanged(); }", "tokens": 23} {"id": 536263, "source": "method", "repo": "sendgrid/sendgrid-java", "text": "/** Uploads attachment to Dropbox @param attachments attachment to be uploaded @param accessToken user's Dropbox access token @param path path of the folder in which attachment needs to be added. Should not end with / @return the full path to the uploaded file */ private static String uploadToDropbox(Attachments attachments, String accessToken, String path) { try { DbxRequestConfig config = DbxRequestConfig.newBuilder(\"sendgrid/0.1\").build(); DbxClientV2 client = new DbxClientV2(config, accessToken); FileMetadata uploadedFile = client.files().upload(String.format(\"%s/%s\", path, attachments.getFilename())) .uploadAndFinish(new ByteArrayInputStream((Base64.decodeBase64(attachments.getContent())))); return uploadedFile.getPathDisplay(); } catch (Exception ex) { throw new RuntimeException(\"Error while uploading to Dropbox\", ex); } }", "tokens": 182} {"id": 536273, "source": "method", "repo": "sendgrid/sendgrid-java", "text": "public static void main(String[] args) throws IOException { final Mail mail = new Mail(); mail.setFrom(new Email(\"test@example.com\", \"Example User\")); mail.setSubject(\"Sending with Twilio SendGrid is Fun\"); // Details on how to send an email with dynamic transactional templates: // https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/ mail.setTemplateId(\"d-12345678901234567890123456789012\"); final Personalization personalization1 = new Personalization(); personalization1.addTo(new Email(\"test1@example.com\", \"Example User1\")); personalization1.addDynamicTemplateData(\"name\", \"Example User1\"); personalization1.addDynamicTemplateData(\"city\", \"Denver\"); mail.addPersonalization(personalization1); final Personalization personalization2 = new Personalization(); personalization2.addTo(new Email(\"test2@example.com\", \"Example User2\")); personalization2.setFrom(new Email(\"test3@example.com\", \"Example User3\")); personalization2.addDynamicTemplateData(\"name\", \"Example User2\"); personalization2.addDynamicTemplateData(\"city\", \"San Francisco\"); mail.addPersonalization(personalization2); mail.addContent(new Content(\"text/plain\", \"and easy to do anywhere, even with Java\")); mail.addContent(new Content(\"text/html\", \"and easy to do anywhere, even with Java\")); send(mail); }", "tokens": 370} {"id": 536274, "source": "method", "repo": "sendgrid/sendgrid-java", "text": "private static void send(final Mail mail) throws IOException { final SendGrid client = new SendGrid(System.getenv(\"SENDGRID_API_KEY\")); final Request request = new Request(); request.setMethod(Method.POST); request.setEndpoint(\"mail/send\"); request.setBody(mail.build()); final Response response = client.api(request); System.out.println(response.getStatusCode()); System.out.println(response.getBody()); System.out.println(response.getHeaders()); }", "tokens": 103} {"id": 536348, "source": "method", "repo": "sendgrid/sendgrid-java", "text": "/** Convert the public key string to a ECPublicKey. @param publicKey: verification key under Mail Settings @return a public key using the ECDSA algorithm @throws NoSuchAlgorithmException @throws NoSuchProviderException @throws InvalidKeySpecException */ public java.security.interfaces.ECPublicKey ConvertPublicKeyToECDSA(String publicKey) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException { byte[] publicKeyInBytes = Base64.getDecoder().decode(publicKey); KeyFactory factory = KeyFactory.getInstance(\"ECDSA\", \"BC\"); return (ECPublicKey) factory.generatePublic(new X509EncodedKeySpec(publicKeyInBytes)); }", "tokens": 130} {"id": 536372, "source": "method", "repo": "sendgrid/sendgrid-java", "text": "/** Set the email's from address. @param from the email's from address. */ public void setFrom(Email from) { this.from = from; }", "tokens": 37} {"id": 537045, "source": "method", "repo": "shadows-of-fire/apotheosis", "text": "/** This event handler allows affixes to react to projectiles hitting something. */ public void impact(ProjectileImpactEvent e) { if (e.getProjectile() instanceof Projectile proj) { SocketHelper.getGemInstances(proj).forEach(inst -> inst.onProjectileImpact(proj, e.getRayTraceResult())); var affixes = AffixHelper.getAffixes(proj); affixes.values().forEach(inst -> inst.onProjectileImpact(proj, e.getRayTraceResult(), e.getRayTraceResult().getType())); } }", "tokens": 115} {"id": 537194, "source": "method", "repo": "shadows-of-fire/apotheosis", "text": "public void doPostAttack(AffixInstance inst, LivingEntity user, Entity target) { float threshold = this.getTrueLevel(inst.getRarity(), inst.level()); if (ApothicAttributes.getLocalAtkStrength(user) >= 0.98 && target instanceof LivingEntity living && !living.level().isClientSide()) { if (!living.isDeadOrDying() && living.getHealth() / living.getMaxHealth() < threshold) { DamageSource src = living.damageSources().source(Apoth.DamageTypes.EXECUTE, user); if (!((LivingEntityInvoker) living).callCheckTotemDeathProtection(src)) { SoundEvent soundevent = ((LivingEntityInvoker) living).callGetDeathSound(); if (soundevent != null) { living.playSound(soundevent, ((LivingEntityInvoker) living).callGetSoundVolume(), living.getVoicePitch()); } living.setLastHurtByMob(user); if (user instanceof Player p) { living.setLastHurtByPlayer(p, 100); } living.getCombatTracker().recordDamage(src, 99999); living.setHealth(0); living.die(src); } } } }", "tokens": 253} {"id": 537248, "source": "method", "repo": "shadows-of-fire/apotheosis", "text": "public boolean clickMenuButton(Player player, int id) { if (id == 0) { this.salvageAll(); this.level.playSound(null, player.blockPosition(), SoundEvents.EVOKER_CAST_SPELL, SoundSource.BLOCKS, 0.99F, this.level.getRandom().nextFloat() * 0.25F + 1F); this.level.playSound(null, player.blockPosition(), SoundEvents.AMETHYST_CLUSTER_STEP, SoundSource.BLOCKS, 0.34F, this.level.getRandom().nextFloat() * 0.2F + 0.8F); this.level.playSound(null, player.blockPosition(), SoundEvents.SMITHING_TABLE_USE, SoundSource.BLOCKS, 0.45F, this.level.getRandom().nextFloat() * 0.5F + 0.75F); return true; } return super.clickMenuButton(player, id); }", "tokens": 209} {"id": 537390, "source": "method", "repo": "shadows-of-fire/apotheosis", "text": "protected void completeWave() { Player player = this.summonerOrClosest(); this.undroppedItems.addAll(this.getCurrentWave().spawnRewards((ServerLevel) this.level(), this, player)); }", "tokens": 44} {"id": 537407, "source": "method", "repo": "shadows-of-fire/apotheosis", "text": "public int getHeight() { return 74; }", "tokens": 12} {"id": 537430, "source": "method", "repo": "shadows-of-fire/apotheosis", "text": "public final CompletableFuture run(CachedOutput output) { return this.apoth_registries.thenCompose(regs -> { var conditionalCodec = ConditionalOps.createConditionalCodecWithConditions(Advancement.CODEC); Set set = new HashSet<>(); List> list = new ArrayList<>(); ConditionalConsumer consumer = this.wrap(holder -> { if (!set.add(holder.id())) { throw new IllegalStateException(\"Duplicate advancement \" + holder.id()); } else { Path path = this.pathProvider.json(holder.id()); List conds = this.conditions.getOrDefault(holder.id(), List.of()); if (conds.isEmpty()) { list.add(DataProvider.saveStable(output, regs, Advancement.CODEC, holder.value(), path)); } else { WithConditions withConds = new WithConditions<>(conds, holder.value()); list.add(DataProvider.saveStable(output, regs, conditionalCodec, Optional.of(withConds), path)); } } }); for (AdvancementSubProvider advancementsubprovider : this.apoth_subProviders) { advancementsubprovider.generate(regs, consumer); } return CompletableFuture.allOf(list.toArray(CompletableFuture[]::new)); }); }", "tokens": 282} {"id": 537676, "source": "method", "repo": "shadows-of-fire/apotheosis", "text": "/** Computes the invalidation hash for the SocketedGems cache. The hash changes if the number of sockets changes, or the affix data changes. */ private static int hashSockets(ItemStack stack) { return Objects.hash(SOCKET_DEPENDENT_COMPONENTS_HASHER.applyAsInt(stack), getSockets(stack)); }", "tokens": 74} {"id": 537709, "source": "method", "repo": "shadows-of-fire/apotheosis", "text": "/** @see GemBonus#getDamageBonus(ItemStack, LootRarity, MobType) */ public float getDamageBonus(Entity target) { return this.map(b -> b.getDamageBonus(this, target)).orElse(0F); }", "tokens": 51} {"id": 537752, "source": "method", "repo": "shadows-of-fire/apotheosis", "text": "/** Returns the serialization key for this GemBonus.

This is unique on a per-type basis, rather than per-instance basis. */ public final Identifier getTypeKey() { return GemBonus.CODEC.getKey(this.getCodec()); }", "tokens": 53} {"id": 537825, "source": "method", "repo": "shadows-of-fire/apotheosis", "text": "public Gem getSelectedGem() { return this.menu.selectedGem; }", "tokens": 16} {"id": 537880, "source": "method", "repo": "shadows-of-fire/apotheosis", "text": "public LootRarity getRarity() { return this.rarity.get(); }", "tokens": 16} {"id": 537900, "source": "method", "repo": "shadows-of-fire/apotheosis", "text": "public Stream resolve(ContextMap context, DisplayContentsFactory factory) { if (!(factory instanceof DisplayContentsFactory.ForStacks stacks)) { return Stream.empty(); } return GemRegistry.INSTANCE.getValues().stream() .filter(gem -> this.gems.size() == 0 || this.gems.contains(gem)) .map(gem -> GemItem.createStack(gem, this.purity, 1)) .filter(gem -> GemItem.getPurity(gem) == this.purity) // Filter out gems whose minimum purity is above the specified one. .map(stacks::forStack); }", "tokens": 148} {"id": 538138, "source": "method", "repo": "shafthq/shaft_engine", "text": "public BrowserDownload cancel() { return query(\"cancel\", file.getName(), () -> { throw new UnsupportedOperationException(\"Selenium HasDownloads cannot cancel an individual download.\"); }); }", "tokens": 38} {"id": 538279, "source": "method", "repo": "shafthq/shaft_engine", "text": "public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof IdentityWeakReference reference)) { return false; } NetworkExchange exchange = get(); return exchange != null && exchange == reference.get(); }", "tokens": 51} {"id": 538301, "source": "method", "repo": "shafthq/shaft_engine", "text": "private static void rewriteCssResource(Resource resource, String baseUrl, Model model, SnapshotContext context, RenderBudget output, CssSourceBudget sources, Set imports, int depth) { if (resource.size() > output.remainingBytes()) { throw new IllegalArgumentException(\"Captured stylesheet exceeds the offline render limit.\"); } CssBuffer rewritten = new CssBuffer(output.remainingBytes()); rewriteCss(resource.text(output.remainingBytes(), sources), baseUrl, model, context, rewritten, sources, imports, depth); output.append(rewritten.value()); }", "tokens": 120} {"id": 538702, "source": "method", "repo": "shafthq/shaft_engine", "text": "private void setStatus(String message) { String value = message == null || message.isBlank() ? READY_STATUS : message; // Trim text if it exceeds available width, but keep full text in tooltip int availableWidth = Math.max(220, status.getWidth() > 0 ? status.getWidth() : 260); FontMetrics metrics = status.getFontMetrics(status.getFont()); String displayText = trimChatTitleForWidth(value, metrics, availableWidth - JBUI.scale(8)); status.setText(displayText); status.setToolTipText(value); status.getAccessibleContext().setAccessibleDescription(value); status.setVisible(!READY_STATUS.equals(value)); }", "tokens": 148} {"id": 538722, "source": "method", "repo": "shafthq/shaft_engine", "text": "JButton debugButtonForTest() { return debugButton; }", "tokens": 12} {"id": 538758, "source": "method", "repo": "shafthq/shaft_engine", "text": "private static Object coordinator() throws Exception { Class type; try { type = Class.forName(COORDINATOR); } catch (ClassNotFoundException error) { fail(\"Observable codegen coordinator is missing\", error); return null; } Constructor constructor = type.getDeclaredConstructor(); constructor.setAccessible(true); // NOPMD - test-only construction of the package-private coordinator seam return constructor.newInstance(); }", "tokens": 84} {"id": 538846, "source": "method", "repo": "shafthq/shaft_engine", "text": "private static McpCodeBlock targetActionSnippetBlock( TargetInsertionContext context, String insertAfter, PomCandidates pom) { return new McpCodeBlock( \"mobile-target-action-snippet\", \"Mobile record-at-target action snippet\", McpCodeBlock.Kind.ACTION, \"java\", List.of(), targetActionSnippet(pom), targetActionPlacement(context.targetName(), insertAfter), context.anchorFound(), actionEvidenceIds(pom.actions()), context.warnings()); }", "tokens": 99} {"id": 538857, "source": "method", "repo": "shafthq/shaft_engine", "text": "private static String normalizeUrl(String raw) { if (raw == null || raw.isBlank()) { return null; } try { URI uri = new URI(raw.trim()); if (uri.getScheme() == null || uri.getHost() == null) { return null; } URI normalized = new URI(uri.getScheme().toLowerCase(Locale.ROOT), uri.getAuthority(), uri.getPath(), uri.getQuery(), null); String result = normalized.toString(); return result.length() > 1 && result.endsWith(\"/\") ? result.substring(0, result.length() - 1) : result; } catch (URISyntaxException exception) { return null; } }", "tokens": 140} {"id": 539189, "source": "method", "repo": "shiroha-233/MC-MMD-rust", "text": "public static PlayerActionSyncService getInstance() { return INSTANCE; }", "tokens": 14} {"id": 539244, "source": "method", "repo": "shiroha-233/MC-MMD-rust", "text": "private static boolean bindActiveShader(OpenGlModelInstance target, PoseStack deliverStack) { int shaderPipelineMode = ClientRenderRuntime.get().renderBackendRegistry().shaderPipelineMode(); if (shaderPipelineMode == 0) { ShaderInstance mcShader = RenderSystem.getShader(); if (mcShader == null) { return false; } target.shaderProgram = mcShader.getId(); target.setUniforms(mcShader, deliverStack); mcShader.apply(); return true; } if (shaderPipelineMode == 1) { target.shaderProgram = OpenGlModelInstance.MMDShaderProgram; GlStateManager._glUseProgram(target.shaderProgram); return true; } return false; }", "tokens": 145} {"id": 539525, "source": "method", "repo": "shiroha-233/MC-MMD-rust", "text": "public boolean mouseClicked(double mouseX, double mouseY, int button) { if (button == 0 && mouseX >= panelX && mouseX <= panelX + PANEL_WIDTH && mouseY >= listTop && mouseY <= listBottom) { return handleListClick(mouseX, mouseY); } return super.mouseClicked(mouseX, mouseY, button); }", "tokens": 70} {"id": 539544, "source": "method", "repo": "shiroha-233/MC-MMD-rust", "text": "public void setAllVisible(MaterialScreenContext context, List materials, boolean visible) { gateway.setAllVisible(context.modelHandle(), visible); for (MaterialEntryState material : materials) { material.setVisible(visible); } }", "tokens": 54} {"id": 539581, "source": "method", "repo": "shiroha-233/MC-MMD-rust", "text": "private void updateAudioVolume(double mouseX) { float t = (float) ((mouseX - audioSliderX) / Math.max(1.0f, audioSliderWidth)); state.setAudioVolume(Mth.clamp(t, 0.0f, 1.0f)); }", "tokens": 64} {"id": 539593, "source": "method", "repo": "shiroha-233/MC-MMD-rust", "text": "public WorkbenchPreferences loadPreferences() { return configAccess.loadPreferences(); }", "tokens": 17} {"id": 539866, "source": "method", "repo": "shmuelzon/home-assistant-floor-plan", "text": "private double intersect(int triangle, double[] origin, double[] direction, double maxDistance) { double[] t = triangles.get(triangle); double px = direction[1] * t[8] - direction[2] * t[7]; double py = direction[2] * t[6] - direction[0] * t[8]; double pz = direction[0] * t[7] - direction[1] * t[6]; double determinant = t[3] * px + t[4] * py + t[5] * pz; if (doubleSided.get(triangle) ? Math.abs(determinant) < EPSILON : determinant < EPSILON) return -1; double inverseDeterminant = 1 / determinant; double sx = origin[0] - t[0], sy = origin[1] - t[1], sz = origin[2] - t[2]; double u = (sx * px + sy * py + sz * pz) * inverseDeterminant; if (u < 0 || u > 1) return -1; double qx = sy * t[5] - sz * t[4]; double qy = sz * t[3] - sx * t[5]; double qz = sx * t[4] - sy * t[3]; double v = (direction[0] * qx + direction[1] * qy + direction[2] * qz) * inverseDeterminant; if (v < 0 || u + v > 1) return -1; double distance = (t[6] * qx + t[7] * qy + t[8] * qz) * inverseDeterminant; return distance > 1E-6 && distance < maxDistance ? distance : -1; }", "tokens": 415} {"id": 539931, "source": "method", "repo": "shmuelzon/home-assistant-floor-plan", "text": "private String generateFloorsSwitchYaml(Map floorsYaml) throws IOException { Floor defaultFloor = floors.stream().filter(floor -> floor.getLevel() == home.getSelectedLevel()).findFirst().orElse(floors.get(0)); String yaml = String.format( \"type: picture-elements\\n\" + \"image: %s.png%s\\n\" + \"elements:\\n\" + \" - type: custom:state-switch\\n\" + \" entity: hash\\n\" + \" default: %s\\n\" + \" style:\\n\" + \" left: 50%%\\n\" + \" top: 50%%\\n\" + \" width: 100%%\\n\" + \" states:\\n\", imagePath(TRANSPARENT_IMAGE_NAME), imageVersionSuffix(TRANSPARENT_IMAGE_NAME, true), Utils.yamlQuote(floorHash(defaultFloor))); for (Floor floor : floors) { yaml += String.format(\" %s:\\n\", Utils.yamlQuote(floorHash(floor))); yaml += floorsYaml.get(floor).replaceAll(\"(?m)^(?=.)\", \" \"); } return yaml; }", "tokens": 261} {"id": 540314, "source": "method", "repo": "shopify/mobile-buy-sdk-android", "text": "public void testInputObject() throws Exception { String queryString = Generated.mutation(mutation -> mutation .setInteger(new Generated.SetIntegerInput(\"answer\", 42).setNegate(true)) ).toString(); assertEquals(\"mutation {set_integer(input:{key:\\\"answer\\\",value:42,negate:true})}\", queryString); }", "tokens": 78} {"id": 540492, "source": "method", "repo": "shsupercm/citresewn", "text": "/** Logs an info line in CIT Resewn's name. @param message log message */ public static void info(String message) { LOG.info(\"[citresewn] \" + message); }", "tokens": 45} {"id": 540654, "source": "method", "repo": "sika-code-cloud/sika-code", "text": "public ItemProcessor, Map> build(BatchBean batchBean) { return new StandardProcessor().setBatchBean(batchBean); }", "tokens": 39} {"id": 540712, "source": "method", "repo": "sika-code-cloud/sika-code", "text": "public void onProcessError(Map t, Exception e) { }", "tokens": 20} {"id": 540991, "source": "method", "repo": "sika-code-cloud/sika-code", "text": "public Boolean getFileOverride() { if (fileOverride == null) { return false; } return fileOverride; }", "tokens": 24} {"id": 540997, "source": "method", "repo": "sika-code-cloud/sika-code", "text": "public ForestRequest build() { ForestRequest forestRequest = forestRequest(); buildRequestHeader(forestRequest); buildRequestQuery(forestRequest); buildRequestBody(forestRequest); return forestRequest; }", "tokens": 45} {"id": 541451, "source": "method", "repo": "silentchaos512/silent-gear", "text": "public Mutable toMutable() { return new Mutable(this.enchantments); }", "tokens": 17} {"id": 541499, "source": "method", "repo": "silentchaos512/silent-gear", "text": "public boolean matches(CraftingInput input, Level level) { if (input.size() < 2) return false; ItemStack gear = ItemStack.EMPTY; boolean foundModKit = false; PartType type = PartTypes.NONE.get(); for (int i = 0; i < input.size(); ++i) { ItemStack stack = input.getItem(i); if (!stack.isEmpty()) { if (gear.isEmpty() && GearHelper.isGear(stack)) { gear = stack; } else if (!foundModKit && isModKit(stack)) { type = ModKitItem.getSelectedType(stack); if (type == PartTypes.NONE.get()) { return false; } foundModKit = true; } else { return false; } } } return !gear.isEmpty() && foundModKit && isActionSupported(type) && GearData.hasPartOfType(gear, type); }", "tokens": 191} {"id": 541728, "source": "method", "repo": "silentchaos512/silent-gear", "text": "private int getStageTime(Trait trait, int traitLevel) { return this.counterTimesPerLevel.get(Mth.clamp(traitLevel - 1, 0, this.counterTimesPerLevel.size())); }", "tokens": 46} {"id": 541797, "source": "method", "repo": "silentchaos512/silent-gear", "text": "public InteractionResult useOn(UseOnContext context) { // No action if broken or player is sneaking if (GearHelper.isBroken(context.getItemInHand()) || context.getPlayer() != null && context.getPlayer().isCrouching()) return InteractionResult.PASS; // Try to let traits do their thing first InteractionResult result = GearHelper.useOn(context); // Other vanilla actions (strip, scrape, wax off) if (result == InteractionResult.PASS) { return GearHelper.useAndCheckBroken(context, Items.NETHERITE_AXE::useOn); } return result; }", "tokens": 124} {"id": 541807, "source": "method", "repo": "silentchaos512/silent-gear", "text": "public boolean supportsPart(ItemStack gear, PartInstance part) { if (!part.isValid()) return false; PartType type = part.getType(); boolean canAdd = part.get().canAddToGear(gear, part); boolean supported = (requiresPartOfType(part.getType()) && canAdd) || canAdd; return (type == PartTypes.MAIN.get() && supported) || type == PartTypes.LINING.get() || supported; }", "tokens": 97} {"id": 541828, "source": "method", "repo": "silentchaos512/silent-gear", "text": "private static void harvestBerryBush(ServerLevel level, BlockPos pos, BlockState state, Player player) { state.useWithoutItem(level, player, new BlockHitResult(new Vec3(pos.getX(), pos.getY(), pos.getZ()), Direction.UP, pos, false)); }", "tokens": 61} {"id": 542089, "source": "method", "repo": "simioni87/auth_analyzer", "text": "private boolean textChanged(String currentPatternText, String currentMethodsText) { if (currentPatternText.equals(patternText) && currentMethodsText.equals(methodsText)) { return false; } else { patternText = currentPatternText; methodsText = currentMethodsText; return true; } }", "tokens": 64} {"id": 542091, "source": "method", "repo": "simioni87/auth_analyzer", "text": "private IHttpRequestResponse[] getMessageToRepeat(IHttpRequestResponse[] sourceMessages, boolean onlyUnique, boolean onlyWithResponse, String pattern, String methods, String responseConentTypes) { ArrayList messages = new ArrayList<>(); HashSet uniqueRequests = new HashSet(); for (IHttpRequestResponse message : sourceMessages) { boolean doRepeat = true; if (onlyWithResponse && message.getResponse() == null) { doRepeat = false; } if (doRepeat && onlyUnique) { String key = message.getHttpService().getHost(); if (message.getRequest() != null) { IRequestInfo requestInfo = BurpExtender.callbacks.getHelpers().analyzeRequest(message); key += requestInfo.getMethod() + requestInfo.getUrl().getPath(); } if (uniqueRequests.contains(key)) { doRepeat = false; } else { uniqueRequests.add(key); } } if (doRepeat && (!pattern.equals(\"\") || !methods.equals(\"\"))) { if (message.getRequest() != null) { String request = new String(message.getRequest()); if (!pattern.equals(\"\")) { if (!request.contains(pattern)) { doRepeat = false; } } if (!methods.equals(\"\")) { String[] methodSplit = methods.split(\",\"); boolean methodInList = false; for (String method : methodSplit) { if (request.startsWith(method.trim())) { methodInList = true; break; } } if (!methodInList) { doRepeat = false; } } } } if (doRepeat && !responseConentTypes.equals(\"\")) { if(message.getResponse() == null) { doRepeat = false; } else { IResponseInfo responseInfo = BurpExtender.callbacks.getHelpers().analyzeResponse(message.getResponse()); String stateMimeType = responseInfo.getStatedMimeType(); String[] contentTypeSplit = responseConentTypes.split(\",\"); boolean contentTypeInList = false; for (String contentType : contentTypeSplit) { if (stateMimeType.toLowerCase().equals(contentType.trim().toLowerCase())) { contentTypeInList = true; break; } } if (!contentTypeInList) { doRepeat = false; } } } if (doRepeat) { messages.add(message); } } return messages.toArray(new IHttpRequestResponse[messages.size()]); }", "tokens": 487} {"id": 542098, "source": "method", "repo": "simioni87/auth_analyzer", "text": "public void updateMatchAndReplaceButtonText() { if(matchAndReplaceList.size() > 0) { matchAndReplaceButton.setText(\"Match and Replace (\" + matchAndReplaceList.size() + \")\"); } else { matchAndReplaceButton.setText(\"Match and Replace\"); } }", "tokens": 62} {"id": 542161, "source": "method", "repo": "simioni87/auth_analyzer", "text": "public void setRedColorGenericTextField() { genericTextField.setBackground(GenericHelper.getErrorBgColor()); }", "tokens": 23} {"id": 542576, "source": "method", "repo": "simplix-softworks/cirrus", "text": "public void lore(@NonNull List lore) { this.itemStack.lore(lore.stream().map(ChatElement::ofLegacyText).collect(Collectors.toList())); }", "tokens": 40} {"id": 542624, "source": "method", "repo": "simplix-softworks/cirrus", "text": "public Container topContainer() { return currentPage().topContainer(); }", "tokens": 14} {"id": 542769, "source": "method", "repo": "simplix-softworks/cirrus", "text": "public ModernInventoryView( @NonNull Menu menu, @NonNull Inventory top, @NonNull Inventory bottom) { this.menu = menu; this.top = top; this.bottom = bottom; }", "tokens": 42} {"id": 542903, "source": "method", "repo": "sinkillerj/projecte", "text": "public ConvertibleLanguageProvider(PackOutput output, String modid, String locale) { super(output, modid, locale); }", "tokens": 28} {"id": 543073, "source": "method", "repo": "sinkillerj/projecte", "text": "public String getName() { return PEConfigTranslations.MAPPING_WAXABLE_MAPPER.title(); }", "tokens": 24} {"id": 543253, "source": "method", "repo": "sinkillerj/projecte", "text": "public void initialize(@NotNull ItemStack stack) { }", "tokens": 11} {"id": 543306, "source": "method", "repo": "sinkillerj/projecte", "text": "public GUIDMFurnace(CONTAINER container, Inventory invPlayer, Component title) { this(container, invPlayer, title, DM_FURNACE, 178, 165, 57); }", "tokens": 46} {"id": 543363, "source": "method", "repo": "sinkillerj/projecte", "text": "public List getPedestalDescription(float tickRate) { List list = new ArrayList<>(); if (ProjectEConfig.server.cooldown.pedestal.volcanite.get() != -1) { list.add(PELang.PEDESTAL_VOLCANITE_1.translateColored(ChatFormatting.BLUE)); list.add(PELang.PEDESTAL_VOLCANITE_2.translateColored(ChatFormatting.BLUE, MathUtils.tickToSecFormatted(ProjectEConfig.server.cooldown.pedestal.volcanite.get(), tickRate))); } return list; }", "tokens": 128} {"id": 543558, "source": "method", "repo": "sinkillerj/projecte", "text": "private static boolean equals(@Nullable Either a, @Nullable Either b) { if (a == b) { return true; } else if (a == null || b == null) { return false; } Optional leftA = a.left(); Optional leftB = b.left(); if (leftA.isPresent() != leftB.isPresent()) { return false; } else if (leftA.isPresent()) { return ItemStack.isSameItemSameComponents(leftA.get(), leftB.get()); } //Note: These should always be present, but use orElse just to avoid the warning of get without isPreset check return FluidStack.isSameFluidSameComponents(a.right().orElse(FluidStack.EMPTY), b.right().orElse(FluidStack.EMPTY)); }", "tokens": 174} {"id": 543631, "source": "method", "repo": "sinkillerj/projecte", "text": "public static long clampToLong(BigInteger bigInt) { return bigInt.compareTo(MAX_LONG) >= 0 ? Long.MAX_VALUE : bigInt.longValue(); }", "tokens": 38} {"id": 543721, "source": "method", "repo": "Sinytra/Connector", "text": "private static List buildCandiates(List input, TransformerEnvironment environment, JarTransformer transformer) { Multimap byId = HashMultimap.create(); for (IModFile modFile : input) { LoaderModMetadata metadata = ((StubModFileInfo) modFile.getModFileInfo()).metadata(); byId.put(metadata.getId(), new ComparableModFile(modFile, metadata.getVersion(), getNestingLevel(modFile))); } List output = new ArrayList<>(); byId.asMap().forEach((_, files) -> { // Select by highest version and lowest nesting level IModFile latest = files.stream() .max(Comparator.comparing(ComparableModFile::version) .thenComparing(ComparableModFile::nestingLevel, Comparator.reverseOrder())) .map(ComparableModFile::file) .orElseThrow(); LoaderModMetadata loaderModMetadata = ((StubModFileInfo) latest.getModFileInfo()).metadata(); FabricModFileMetadata metadata = MetadataReader.readJarMetadata(latest.getContents(), loaderModMetadata, environment); File file = latest.getFilePath().toFile(); String name = getUniqueName(latest); TransformableJar txJar = uncheck(() -> transformer.cacheTransformableJar(file, metadata, name)); output.add(txJar); }); return output; }", "tokens": 285} {"id": 543796, "source": "method", "repo": "Sinytra/Connector", "text": "public Set runsBefore() { return Set.of(ClassProcessorIds.MIXIN); }", "tokens": 25} {"id": 543800, "source": "method", "repo": "Sinytra/Connector", "text": "private static InsnList listOf(AbstractInsnNode... nodes) { InsnList list = new InsnList(); for (AbstractInsnNode node : nodes) list.add(node); return list; }", "tokens": 36} {"id": 543901, "source": "method", "repo": "Sinytra/Connector", "text": "default ResourceEntry process(ResourceEntry entry) { return entry; }", "tokens": 15} {"id": 543945, "source": "method", "repo": "Sinytra/Connector", "text": "private void applyGlobalModAliases(JsonObject depends) { DependencyConfiguration config = this.environment.getDependencyConfiguration(); if (config == null) return; for (Map.Entry entry : Set.copyOf(depends.entrySet())) { String modId = entry.getKey(); if (!config.knownMods().contains(modId)) { String alternative = config.findAlternative(modId); if (alternative != null) { depends.remove(modId); depends.addProperty(alternative, \"*\"); } } } }", "tokens": 108} {"id": 544067, "source": "method", "repo": "sirjonasxx/g-earth", "text": "protected boolean canLeave() { return false; }", "tokens": 11} {"id": 544292, "source": "method", "repo": "sirjonasxx/g-earth", "text": "public void setLegacyString(String legacyString) { this.legacyString = legacyString == null ? \"\" : legacyString; }", "tokens": 28} {"id": 544367, "source": "method", "repo": "sirjonasxx/g-earth", "text": "public boolean readBoolean(int index) { return (readByte(index) != 0); }", "tokens": 21} {"id": 544412, "source": "method", "repo": "sirjonasxx/g-earth", "text": "protected void onConnect() { stateSetter.setState(HState.CONNECTED); }", "tokens": 18} {"id": 544667, "source": "method", "repo": "sirjonasxx/g-earth", "text": "public CategorizedOverview(HOverview parent, int startIndex, int size, StoreRepository storeRepository, ExtCategory category) { super(parent, startIndex, size, storeRepository); this.category = category; }", "tokens": 48} {"id": 544803, "source": "method", "repo": "sirjonasxx/g-earth", "text": "public FuncType getFuncType() { return new FuncType(new ResultType(Arrays.asList(ValType.I32, ValType.I32, ValType.I32)), new ResultType(Collections.emptyList())); }", "tokens": 56} {"id": 545120, "source": "method", "repo": "SJ14Apps/JsonList", "text": "public void deleteLog(View view) { BasicDialog dialog = new BasicDialog(); dialog.Delete(this,true) .setTitle(getString(R.string.delete_logs)) .onButtonClick(() ->{ dialog.dismiss(); FileSystem.SaveLog(this,new Gson().toJson(new CrashLogs())); update(); }) .show(); }", "tokens": 79} {"id": 545139, "source": "method", "repo": "SJ14Apps/JsonList", "text": "public boolean isScrollAnimation() { return scrollAnimation; }", "tokens": 13} {"id": 545146, "source": "method", "repo": "SJ14Apps/JsonList", "text": "public boolean isHasNewVersion() { return hasNewVersion; }", "tokens": 15} {"id": 545158, "source": "method", "repo": "SJ14Apps/JsonList", "text": "public void setRawData(String data) { this.rawData = data; }", "tokens": 18} {"id": 545384, "source": "method", "repo": "skidfuscatordev/skidfuscator-java-obfuscator", "text": "public BitwiseHashTransformer(Skidfuscator skidfuscator) { this.methodNode = new SkidMethodNodeBuilder(skidfuscator, skidfuscator.getFactoryNode()) .desc(\"(I)I\") .name(RandomUtil.randomAlphabeticalString(16)) .access(Opcodes.ACC_STATIC | Opcodes.ACC_PUBLIC) .phantom(true) .build(); final SkidControlFlowGraph cfg = methodNode.getCfg(); final Expr const7 = new ConstantExpr(7, Type.INT_TYPE); final Expr const29a = new ConstantExpr(29, Type.INT_TYPE); final Expr shifted7to29 = new FakeArithmeticExpr(const7, const29a, ArithmeticExpr.Operator.SHL); // (starting & (7 << 29)) final Expr shiftedvartoshift = new FakeArithmeticExpr( new VarExpr(cfg.getLocals().get(0), Type.INT_TYPE), shifted7to29, ArithmeticExpr.Operator.AND ); // (starting & (7 << 29)) >> 29) final Expr const29b = new ConstantExpr(29, Type.INT_TYPE); final Expr shiftedHashTto29 = new FakeArithmeticExpr(shiftedvartoshift, const29b, ArithmeticExpr.Operator.SHR); // (starting << 3) final Expr const3 = new ConstantExpr(3, Type.INT_TYPE); final Expr shiftedStartTo3 = new FakeArithmeticExpr( new VarExpr(cfg.getLocals().get(0), Type.INT_TYPE), const3, ArithmeticExpr.Operator.SHL ); // ((starting & (7 << 29)) >> 29) | (starting << 3); final Expr hash = new FakeArithmeticExpr(shiftedHashTto29, shiftedStartTo3, ArithmeticExpr.Operator.OR); methodNode.getCfg().getEntry().add(new ReturnStmt( Type.INT_TYPE, hash )); methodNode.node.maxLocals = 1; }", "tokens": 463} {"id": 545794, "source": "method", "repo": "skidfuscatordev/skidfuscator-java-obfuscator", "text": "public CreationFixer(ControlFlowGraphBuilder builder) { super(builder); }", "tokens": 18} {"id": 545821, "source": "method", "repo": "skidfuscatordev/skidfuscator-java-obfuscator", "text": "protected void _new_2(Type type, BasicBlock b, AbstractInsnNode next) { int index = currentStack.height(); while ((next = next.getNext()).getOpcode() != INVOKESPECIAL) { process(b, next); codeIndex++; } MethodInsnNode init = (MethodInsnNode) next; codeIndex++; Type[] argTypes = Type.getArgumentTypes(init.desc); Expr[] args = new Expr[argTypes.length]; for (int i = 0; i < argTypes.length; i++) { final Expr popped = pop(); /*assert popped.getType().equals(argTypes[i]) : \"Failed to match arg type at index \" + i + \" from \" + popped.getType() + \" to \" + argTypes[i];*/ args[i] = popped; } index = currentStack.height(); InitialisedObjectExpr e = new InitialisedObjectExpr( init.owner, init.desc, args ); System.out.println(\"Created a cool thing\"); assign_stack(index, e); push(load_stack(index, type)); }", "tokens": 228} {"id": 545896, "source": "method", "repo": "skidfuscatordev/skidfuscator-java-obfuscator", "text": "public void toString(TabbedStringWriter printer) { if (instanceExpression != null) { int selfPriority = getPrecedence(); int basePriority = instanceExpression.getPrecedence(); if (basePriority > selfPriority) printer.print('('); instanceExpression.toString(printer); if (basePriority > selfPriority) printer.print(')'); } else printer.print(owner.replace('/', '.')); printer.print('.'); printer.print(name); }", "tokens": 98} {"id": 545988, "source": "method", "repo": "skidfuscatordev/skidfuscator-java-obfuscator", "text": "private static void section(String text) { section0(\"...took %fs.\", text); }", "tokens": 26} {"id": 546125, "source": "method", "repo": "skidfuscatordev/skidfuscator-java-obfuscator", "text": "public boolean hasProcessed(N n) { return processed.contains(n); }", "tokens": 18} {"id": 546320, "source": "method", "repo": "skynetcap/solanaj", "text": "private static String bodyToString(final Request request){ try { final Request copy = request.newBuilder().build(); final Buffer buffer = new Buffer(); copy.body().writeTo(buffer); return buffer.readUtf8(); } catch (final IOException e) { return \"did not work\"; } }", "tokens": 61} {"id": 546399, "source": "method", "repo": "skynetcap/solanaj", "text": "public List getSlotLeaders(long startSlot, long limit) throws RpcException { List params = new ArrayList<>(); params.add(startSlot); params.add(limit); List rawResult = callWithGenericType(\"getSlotLeaders\", params, List.class); List result = new ArrayList<>(); for (String item : rawResult) { result.add(new PublicKey(item)); } return result; }", "tokens": 96} {"id": 546505, "source": "method", "repo": "skynetcap/solanaj", "text": "public static int readInt32(byte[] data, int offset) { // convert 4 bytes into an int. // create a byte buffer and wrap the array ByteBuffer bb = ByteBuffer.wrap( Arrays.copyOfRange( data, offset, offset + 4 ) ); // if the file uses little endian as apposed to network // (big endian, Java's native) format, // then set the byte order of the ByteBuffer bb.order(ByteOrder.LITTLE_ENDIAN); // read your integers using ByteBuffer's getInt(). // four bytes converted into an integer! return bb.getInt(0); }", "tokens": 133} {"id": 546685, "source": "method", "repo": "skynetcap/solanaj", "text": "/** Extracts the account from a subscription request. @param request The subscription request @return The account address, or null if not found */ private String extractAccountFromRequest(CustomRpcRequest request) { try { String method = request.getMethod(); List params = request.getParams(); if (params == null || params.isEmpty()) { return null; } switch (method) { case \"accountSubscribe\": return (String) params.get(0); case \"logsSubscribe\": if (params.get(0) instanceof Map) { @SuppressWarnings(\"unchecked\") Map mentionsMap = (Map) params.get(0); if (mentionsMap.containsKey(\"mentions\")) { @SuppressWarnings(\"unchecked\") List mentions = (List) mentionsMap.get(\"mentions\"); return mentions.isEmpty() ? null : mentions.get(0); } } return null; case \"signatureSubscribe\": return (String) params.get(0); case \"programSubscribe\": return (String) params.get(0); default: return null; } } catch (Exception ex) { LOGGER.log(Level.WARNING, \"Error extracting account from request\", ex); return null; } }", "tokens": 266} {"id": 546786, "source": "method", "repo": "skynetcap/solanaj", "text": "public void getTransactionCountTest() throws RpcException { long transactionCount = client.getApi().getTransactionCount(); assertTrue(transactionCount > 0); }", "tokens": 31} {"id": 546886, "source": "method", "repo": "skynetcap/solanaj", "text": "public void testCreateAccountInstructionWithNegativeLamports() { assertThrows(IllegalArgumentException.class, () -> { PublicKey fromPublicKey = new PublicKey(\"QqCCvshxtqMAL2CVALqiJB7uEeE5mjSPsseQdDzsRUo\"); PublicKey newAccountPublicKey = new PublicKey(\"GrDMoeqMLFjeXQ24H56S1RLgT4R76jsuWCd6SvXyGPQ5\"); long negativeLamports = -1; long space = 165; PublicKey programId = SystemProgram.PROGRAM_ID; SystemProgram.createAccount(fromPublicKey, newAccountPublicKey, negativeLamports, space, programId); }); }", "tokens": 165} {"id": 546895, "source": "method", "repo": "skynetcap/solanaj", "text": "/** Tests the thawAccount instruction creation for TokenProgram. This instruction is used to thaw a frozen account, allowing transfers. */ public void testThawAccount() { PublicKey account = new PublicKey(\"Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr\"); PublicKey mint = new PublicKey(\"FuLFkNQzNEAzZ2dEgXVUqVVLxJYLYhbSgpZf9RVVXZuT\"); PublicKey authority = new PublicKey(\"HNGVuL5kqjDehw7KR63w9gxow32sX6xzRNgLb8GkbwCM\"); TransactionInstruction instruction = TokenProgram.thawAccount(account, mint, authority); assertEquals(TokenProgram.PROGRAM_ID, instruction.getProgramId()); assertEquals(3, instruction.getKeys().size()); assertEquals(account, instruction.getKeys().get(0).getPublicKey()); assertEquals(mint, instruction.getKeys().get(1).getPublicKey()); assertEquals(authority, instruction.getKeys().get(2).getPublicKey()); byte[] expectedData = new byte[]{0x0B}; // Instruction type: ThawAccount assertArrayEquals(expectedData, instruction.getData()); }", "tokens": 292} {"id": 546991, "source": "method", "repo": "skytasul/beautyquests", "text": "public TextEditorBuilder setIndication(@Nullable String indication) { this.indication = indication; return this; }", "tokens": 27} {"id": 547016, "source": "method", "repo": "skytasul/beautyquests", "text": "public void setKiller(@NotNull Entity killer) { this.killer = killer; }", "tokens": 21} {"id": 547175, "source": "method", "repo": "skytasul/beautyquests", "text": "public List<@NotNull CountableObject> getObjects() { return objects; }", "tokens": 20} {"id": 547362, "source": "method", "repo": "skytasul/beautyquests", "text": "public void setStay(int stay) { this.stay = stay; ItemUtils.lore(getInventory().getItem(SLOT_STAY), QuestOption.formatNullableValue(Lang.Ticks.quickFormat(\"ticks\", stay), stay == Title.STAY)); }", "tokens": 56} {"id": 547364, "source": "method", "repo": "skytasul/beautyquests", "text": "protected void populate(@NotNull Player player, @NotNull Inventory inventory) { inventory.setItem(SLOT_TITLE, ItemUtils.item(XMaterial.NAME_TAG, Lang.title_title.toString())); inventory.setItem(SLOT_SUBTITLE, ItemUtils.item(XMaterial.NAME_TAG, Lang.title_subtitle.toString())); inventory.setItem(SLOT_FADE_IN, ItemUtils.item(XMaterial.CLOCK, Lang.title_fadeIn.toString())); inventory.setItem(SLOT_STAY, ItemUtils.item(XMaterial.CLOCK, Lang.title_stay.toString())); inventory.setItem(SLOT_FADE_OUT, ItemUtils.item(XMaterial.CLOCK, Lang.title_fadeOut.toString())); inventory.setItem(7, QuestsPlugin.getPlugin().getGuiManager().getItemFactory().getCancel()); inventory.setItem(8, QuestsPlugin.getPlugin().getGuiManager().getItemFactory().getDone()); // updating lores setTitle(title); setSubtitle(subtitle); setFadeIn(fadeIn); setStay(stay); setFadeOut(fadeOut); updateFinishState(); }", "tokens": 224} {"id": 547383, "source": "method", "repo": "skytasul/beautyquests", "text": "public CloseBehavior onClose(@NotNull Player player) { if (cancel != null) return new DelayCloseBehavior(cancel); return StandardCloseBehavior.REMOVE; }", "tokens": 34} {"id": 547437, "source": "method", "repo": "skytasul/beautyquests", "text": "public void load(ConfigurationSection config, String key) { setValue(BeautyQuests.getInstance().getPoolsManager().getPool(config.getInt(key))); }", "tokens": 36} {"id": 547598, "source": "method", "repo": "skytasul/beautyquests", "text": "public void onAccountLeave(QuesterLeaveEvent e) { removePlayerScoreboard(e.getPlayer()); }", "tokens": 22} {"id": 547623, "source": "method", "repo": "skytasul/beautyquests", "text": "public void setText(String text) { this.text = text; getLine().refreshItem(MESSAGE_SLOT, item -> ItemUtils.lore(item, QuestOption.formatNullableValue(text))); }", "tokens": 44} {"id": 547686, "source": "method", "repo": "skytasul/beautyquests", "text": "public void stageUnload(@NotNull StageController stage) { super.stageUnload(stage); bars.values().forEach(ProgressBar::remove); bars.clear(); }", "tokens": 34} {"id": 547789, "source": "method", "repo": "skytasul/beautyquests", "text": "public static void initialize() { QuestsAPI.getAPI().registerItemComparison(COMPARISON); }", "tokens": 24} {"id": 547811, "source": "method", "repo": "skytasul/beautyquests", "text": "public void appendTextLine(String text) { hologram.addLine(text); hologram.update(); }", "tokens": 23} {"id": 547813, "source": "method", "repo": "skytasul/beautyquests", "text": "public void appendItem(ItemStack item) { var data = new ItemHologramData(\"bq-%d-%d\".formatted(id, internalHolograms.size()), lc); data.setItemStack(item); data.setVisibility(defaultVisible ? Visibility.ALL : Visibility.MANUAL); data.setPersistent(false); // A block item model in its \"ground\" state has a scale of 0.25. // We use this value to mimmick the appearance of a dropped item. data.setScale(new Vector3f(item.getType().isBlock() ? 0.25f : 0.5f)); var holo = hologramsManager.create(data); hologramsManager.addHologram(holo); internalHolograms.add(holo); teleport(lc); }", "tokens": 173} {"id": 547921, "source": "method", "repo": "slabiak/appointmentscheduler", "text": "public String showCustomerDetails(@PathVariable int id, Model model) { Customer customer = userService.getCustomerById(id); if (customer.hasRole(\"ROLE_CUSTOMER_CORPORATE\")) { if (!model.containsAttribute(\"user\")) { model.addAttribute(\"user\", new UserForm(userService.getCorporateCustomerById(id))); } model.addAttribute(\"account_type\", \"customer_corporate\"); model.addAttribute(\"formActionProfile\", \"/customers/corporate/update/profile\"); } else if (customer.hasRole(\"ROLE_CUSTOMER_RETAIL\")) { if (!model.containsAttribute(\"user\")) { model.addAttribute(\"user\", new UserForm(userService.getRetailCustomerById(id))); } model.addAttribute(\"account_type\", \"customer_retail\"); model.addAttribute(\"formActionProfile\", \"/customers/retail/update/profile\"); } if (!model.containsAttribute(\"passwordChange\")) { model.addAttribute(\"passwordChange\", new ChangePasswordForm(id)); } model.addAttribute(\"formActionPassword\", \"/customers/update/password\"); model.addAttribute(\"numberOfScheduledAppointments\", appointmentService.getNumberOfScheduledAppointmentsForUser(id)); model.addAttribute(\"numberOfCanceledAppointments\", appointmentService.getNumberOfCanceledAppointmentsForUser(id)); return \"users/updateUserForm\"; }", "tokens": 277} {"id": 547958, "source": "method", "repo": "slabiak/appointmentscheduler", "text": "public String processProviderAddBreak(@ModelAttribute(\"breakModel\") TimePeroid breakToAdd, @RequestParam(\"planId\") int planId, @RequestParam(\"dayOfWeek\") String dayOfWeek) { workingPlanService.addBreakToWorkingPlan(breakToAdd, planId, dayOfWeek); return \"redirect:/providers/availability\"; }", "tokens": 72} {"id": 547966, "source": "method", "repo": "slabiak/appointmentscheduler", "text": "public String deleteWork(@RequestParam(\"workId\") int workId) { workService.deleteWorkById(workId); return \"redirect:/works/all\"; }", "tokens": 37} {"id": 547971, "source": "method", "repo": "slabiak/appointmentscheduler", "text": "public Provider getProvider() { return provider; }", "tokens": 12} {"id": 547990, "source": "method", "repo": "slabiak/appointmentscheduler", "text": "public void setAppointment(Appointment appointment) { this.appointment = appointment; }", "tokens": 17} {"id": 547995, "source": "method", "repo": "slabiak/appointmentscheduler", "text": "public void setStatus(ExchangeStatus status) { this.status = status; }", "tokens": 18} {"id": 548136, "source": "method", "repo": "slabiak/appointmentscheduler", "text": "public int getNumberOfCanceledAppointmentsForUser(int userId) { return appointmentRepository.findCanceledByUser(userId).size(); }", "tokens": 28} {"id": 548213, "source": "method", "repo": "slabiak/appointmentscheduler", "text": "public List getProvidersByWork(Work work) { return providerRepository.findByWorks(work); }", "tokens": 25} {"id": 548218, "source": "method", "repo": "slabiak/appointmentscheduler", "text": "public void saveNewRetailCustomer(UserForm userForm) { RetailCustomer retailCustomer = new RetailCustomer(userForm, passwordEncoder.encode(userForm.getPassword()), getRolesForRetailCustomer()); retailCustomerRepository.save(retailCustomer); }", "tokens": 58} {"id": 548350, "source": "method", "repo": "slackapi/java-slack-sdk", "text": "public WorkflowStepSaveRequest( String requestBody, String payloadBody, RequestHeaders headers) { this.requestBody = requestBody; this.headers = headers; this.payload = GsonFactory.createSnakeCase().fromJson(payloadBody, WorkflowStepSavePayload.class); if (payload.getEnterprise() != null) { getContext().setEnterpriseId(payload.getEnterprise().getId()); } else if (payload.getTeam() != null) { getContext().setEnterpriseId(payload.getTeam().getEnterpriseId()); } if (payload.getTeam() != null && payload.getTeam().getId() != null) { getContext().setTeamId(payload.getTeam().getId()); } else if (payload.getUser() != null && payload.getUser().getTeamId() != null) { getContext().setTeamId(payload.getUser().getTeamId()); } getContext().setRequestUserId(payload.getUser().getId()); getContext().setWorkflowStepEditId(payload.getWorkflowStep().getWorkflowStepEditId()); }", "tokens": 204} {"id": 548422, "source": "method", "repo": "slackapi/java-slack-sdk", "text": "public void failure_with_urls() { InstallationService installationService = new FileInstallationService(new AppConfig(), \"target/files\") { @Override public void saveInstallerAndBot(Installer installer) { throw new RuntimeException(); } }; OAuthDefaultSuccessHandler handler = new OAuthDefaultSuccessHandler(new AppConfig(), installationService); RequestHeaders headers = new RequestHeaders(new HashMap<>()); OAuthCallbackRequest request = new OAuthCallbackRequest(new HashMap<>(), \"\", VerificationCodePayload.from(new HashMap<>()), headers); request.getContext().setOauthCompletionUrl(\"https://www.example.com/completion\"); request.getContext().setOauthCancellationUrl(\"https://www.example.com/cancellation\"); Response response = new Response(); OAuthAccessResponse apiResponse = new OAuthAccessResponse(); Response processedResponse = handler.handle(request, response, apiResponse); assertEquals(302, processedResponse.getStatusCode().longValue()); assertEquals(\"https://www.example.com/cancellation\", processedResponse.getHeaders().get(\"Location\").get(0)); }", "tokens": 218} {"id": 548572, "source": "method", "repo": "slackapi/java-slack-sdk", "text": "public LogsResponse getLogs(RequestConfigurator req) throws IOException, AuditApiException { return getLogs(req.configure(LogsRequest.builder()).build()); }", "tokens": 42} {"id": 548878, "source": "method", "repo": "slackapi/java-slack-sdk", "text": "public void setup() throws Exception { server.start(); }", "tokens": 13} {"id": 549028, "source": "method", "repo": "slackapi/java-slack-sdk", "text": "public MockWebApiServer(int port) { setup(port); }", "tokens": 16} {"id": 549122, "source": "method", "repo": "slackapi/java-slack-sdk", "text": "public void serialize() { Gson gson = GsonFactory.createSnakeCase(); TeamAccessRevokedEvent event = new TeamAccessRevokedEvent(); String generatedJson = gson.toJson(event); String expectedJson = \"{\\\"type\\\":\\\"team_access_revoked\\\"}\"; assertThat(generatedJson, is(expectedJson)); }", "tokens": 64} {"id": 549443, "source": "method", "repo": "slackhq/astra", "text": "public static SearchResult soft_error() { return USER_ERROR; }", "tokens": 18} {"id": 549450, "source": "method", "repo": "slackhq/astra", "text": "public static Map fromSchemaResultProto( AstraSearch.SchemaResult protoSchemaResult) { Map schemaMap = new HashMap<>(); protoSchemaResult .getFieldDefinitionMap() .forEach( (key, value) -> { schemaMap.put(key, fromSchemaDefinitionProto(value)); }); return schemaMap; }", "tokens": 78} {"id": 549475, "source": "method", "repo": "slackhq/astra", "text": "public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof CacheSlotMetadata that)) return false; if (!super.equals(o)) return false; if (updatedTimeEpochMs != that.updatedTimeEpochMs) return false; if (!hostname.equals(that.hostname)) return false; if (!Objects.equals(replicaSet, that.replicaSet)) return false; if (cacheSlotState != that.cacheSlotState) return false; return replicaId.equals(that.replicaId); }", "tokens": 110} {"id": 549888, "source": "method", "repo": "slackhq/astra", "text": "/** Runs a test against all modes of AstraMetadataStore. */ private void testAllStoreModes(StoreTestRunner testRunner) throws Exception { // Test ZK creates mode try (AstraMetadataStore store = createZkCreatesStore()) { testRunner.test(store, \"ZOOKEEPER_CREATES\"); } // Test Etcd creates mode try (AstraMetadataStore store = createEtcdCreatesStore()) { testRunner.test(store, \"ETCD_CREATES\"); } }", "tokens": 101} {"id": 549959, "source": "method", "repo": "slackhq/astra", "text": "/** One turn of a flapping stream: opened, then lost again almost immediately. */ private void flap() { flap(10); }", "tokens": 33} {"id": 550104, "source": "method", "repo": "slackhq/astra", "text": "public String toString() { return server.toString(); }", "tokens": 12} {"id": 550204, "source": "method", "repo": "slackhq/kaldb", "text": "private static List parseSort(JsonNode body) { List sortFields = new ArrayList<>(); if (!body.has(\"sort\") || body.get(\"sort\").isNull()) { return sortFields; // No sort specified, return empty list (will use default) } JsonNode sortNode = body.get(\"sort\"); if (sortNode.isArray()) { // Array format: [{ \"field1\": { \"order\": \"desc\" } }, \"field2\", ...] for (JsonNode element : sortNode) { parseSingleSortField(element, sortFields); } } else { // Single value: { \"field\": \"desc\" } or \"field\" parseSingleSortField(sortNode, sortFields); } return sortFields; }", "tokens": 167} {"id": 550309, "source": "method", "repo": "slackhq/kaldb", "text": "/** One bounded keys-only probe per filtered partition, run concurrently, so discovery costs O(filters) tiny reads instead of a scan of every key in the folder. */ private PartitionsAt probeFilteredPartitions() throws InterruptedException, ExecutionException, TimeoutException { List> probes = partitionFilters.stream() .map( partition -> EtcdRangePaginator.firstKeyAsync( etcdClient.getKVClient(), ByteSequence.from(storeFolderPrefix + partition, StandardCharsets.UTF_8), operationsTimeoutMs)) .toList(); // Each probe carries its own timeout, so getting them in turn is already bounded. List ranges = new ArrayList<>(); for (CompletableFuture probe : probes) { ranges.add(probe.get()); } // extractPartitions re-checks the filter, since a prefix probe for \"p1\" also matches \"p10\". return new PartitionsAt( extractPartitions(ranges.stream().flatMap(r -> r.keyValues().stream()).toList()), // The oldest revision any probe saw, so a watch resuming from it replays rather than skips // events the later probes already reflect. ranges.stream().mapToLong(EtcdRangePaginator.PaginatedRange::revision).min().orElseThrow()); }", "tokens": 292} {"id": 550432, "source": "method", "repo": "slackhq/kaldb", "text": "public static byte[] getIndexRequestBytes(String filename) throws IOException { return Resources.toString( Resources.getResource(String.format(\"opensearchRequest/bulk/%s.ndjson\", filename)), Charset.defaultCharset()) .getBytes(StandardCharsets.UTF_8); }", "tokens": 57} {"id": 550582, "source": "method", "repo": "slackhq/kaldb", "text": "public void testRecoveryNodeMetadataSerializer() throws InvalidProtocolBufferException { String name = \"name\"; Metadata.RecoveryNodeMetadata.RecoveryNodeState recoveryNodeState = Metadata.RecoveryNodeMetadata.RecoveryNodeState.ASSIGNED; String recoveryTaskName = \"taskName\"; long updatedTimeEpochMs = Instant.now().toEpochMilli(); RecoveryNodeMetadata recoveryNodeMetadata = new RecoveryNodeMetadata(name, recoveryNodeState, recoveryTaskName, updatedTimeEpochMs); String serializedCacheSlotMetadata = serDe.toJsonStr(recoveryNodeMetadata); assertThat(serializedCacheSlotMetadata).isNotEmpty(); RecoveryNodeMetadata deserializedRecoveryNodeMetadata = serDe.fromJsonStr(serializedCacheSlotMetadata); assertThat(deserializedRecoveryNodeMetadata).isEqualTo(recoveryNodeMetadata); assertThat(deserializedRecoveryNodeMetadata.name).isEqualTo(name); assertThat(deserializedRecoveryNodeMetadata.recoveryNodeState).isEqualTo(recoveryNodeState); assertThat(deserializedRecoveryNodeMetadata.recoveryTaskName).isEqualTo(recoveryTaskName); assertThat(deserializedRecoveryNodeMetadata.updatedTimeEpochMs).isEqualTo(updatedTimeEpochMs); }", "tokens": 214} {"id": 550641, "source": "method", "repo": "slackhq/kaldb", "text": "public void testExponentialBackOffCapsAtMax() { // initialInterval=5000, maxInterval=10000 \u2014 should cap quickly ExponentialBackOff backoff = new ExponentialBackOff(5000, 10000, 60000); backoff.nextBackOffMillis(); // interval advances to 7500 backoff.nextBackOffMillis(); // interval advances to 10000 (capped) // Third call should be randomized around 10000: [5000, 15000] for (int trial = 0; trial < 20; trial++) { ExponentialBackOff b = new ExponentialBackOff(5000, 10000, 60000); b.nextBackOffMillis(); b.nextBackOffMillis(); long delay = b.nextBackOffMillis(); assertThat(delay).isBetween(5000L, 15000L); } }", "tokens": 220} {"id": 550658, "source": "method", "repo": "slackhq/kaldb", "text": "public static void setRetentionTime( AdminClient adminClient, String topicName, int retentionTimeMs) { ConfigResource resource = new ConfigResource(ConfigResource.Type.TOPIC, topicName); Collection entries = new ArrayList<>(); entries.add(new ConfigEntry(TopicConfig.RETENTION_MS_CONFIG, String.valueOf(retentionTimeMs))); Config config = new Config(entries); Map configs = new HashMap<>(); configs.put(resource, config); adminClient.alterConfigs(configs); }", "tokens": 109} {"id": 550659, "source": "method", "repo": "slackhq/kaldb", "text": "public static long getStartOffset(AdminClient adminClient, TopicPartition topicPartition) throws Exception { ListOffsetsResult r = adminClient.listOffsets(Map.of(topicPartition, OffsetSpec.earliest())); return r.partitionResult(topicPartition).get().offset(); }", "tokens": 58} {"id": 550683, "source": "method", "repo": "sladkoff/minecraft-prometheus-exporter", "text": "private void log(float tps) { tpsQueue.add(tps); if (tpsQueue.size() > TPS_QUEUE_SIZE) { tpsQueue.poll(); } }", "tokens": 42} {"id": 550760, "source": "method", "repo": "sladkoff/minecraft-prometheus-exporter", "text": "public void disable() { super.disable(); Bukkit.getScheduler().cancelTask(taskId); }", "tokens": 20} {"id": 550813, "source": "method", "repo": "sladkoff/minecraft-prometheus-exporter", "text": "void metrics_server_should_return_404_on_unknown_paths() { String requestPath = URIUtil.newURI(\"http\", \"localhost\", metricsServerPort, \"/unknown-path\", null); RestAssured.when() .get(requestPath) .then() .statusCode(HttpStatus.NOT_FOUND_404); }", "tokens": 76} {"id": 550987, "source": "method", "repo": "slimeknights/mantle", "text": "public ContentTableTransformer() { this.sectionToTransform = null; }", "tokens": 16} {"id": 551047, "source": "method", "repo": "slimeknights/mantle", "text": "/** Renders a fluid cuboid with partial height based on the capacity @param matrices Matrix stack instance @param buffer Render type buffer instance @param fluid Fluid to render @param offset Fluid amount offset, used to animate transitions @param capacity Fluid tank capacity, must be above 0 @param light Quad lighting from TER @param cube Fluid cuboid instance @param flipGas If true, flips gas cubes */ public static void renderScaledCuboid(PoseStack matrices, MultiBufferSource buffer, FluidCuboid cube, FluidStack fluid, float offset, int capacity, int light, boolean flipGas) { // nothing to render if (fluid.isEmpty() || capacity <= 0) { return; } // fluid attributes IClientFluidTypeExtensions clientFluid = IClientFluidTypeExtensions.of(fluid.getFluid()); TextureAtlasSprite still = getBlockSprite(clientFluid.getStillTexture(fluid)); TextureAtlasSprite flowing = getBlockSprite(clientFluid.getFlowingTexture(fluid)); FluidType type = fluid.getFluid().getFluidType(); boolean isGas = type.isLighterThanAir(); int color = clientFluid.getTintColor(fluid); light = withBlockLight(light, type.getLightLevel(fluid)); // determine height based on fluid amount Vector3f from = cube.getFromScaled(); Vector3f to = cube.getToScaled(); // gas renders upside down float minY = from.y(); float maxY = to.y(); float height = (fluid.getAmount() - offset) / capacity; if (isGas && flipGas) { from = new Vector3f(from); from.y = maxY + (height * (minY - maxY)); } else { to = new Vector3f(to); to.y = minY + (height * (maxY - minY)); } // draw cuboid renderCuboid(matrices, buffer.getBuffer(MantleRenderTypes.FLUID), cube, still, flowing, from, to, color, light, isGas); }", "tokens": 408} {"id": 551064, "source": "method", "repo": "slimeknights/mantle", "text": "protected ModuleScreen getModuleForPoint(double x, double y) { for (ModuleScreen module : this.modules) { if (this.isHovering(module.leftPos, module.topPos, module.imageWidth, module.imageHeight, x + this.cornerX, y + this.cornerY)) { return module; } } return null; }", "tokens": 77} {"id": 551094, "source": "method", "repo": "slimeknights/mantle", "text": "public void mouseClicked(double mouseX, double mouseY, int mouseButton) { }", "tokens": 16} {"id": 551204, "source": "method", "repo": "slimeknights/mantle", "text": "/** Creates a defaulting field that uses a default value when missing */ default

LoadableField defaultField(String key, T defaultValue, boolean serializeDefault, Function getter) { return new DefaultingField<>(this, key, defaultValue, serializeDefault, getter); }", "tokens": 67} {"id": 551355, "source": "method", "repo": "slimeknights/mantle", "text": "public void encode(FriendlyByteBuf buffer, R object) { fieldA.encode(buffer, object); }", "tokens": 22} {"id": 551356, "source": "method", "repo": "slimeknights/mantle", "text": "public void encode(FriendlyByteBuf buffer, R object) { fieldA.encode(buffer, object); fieldB.encode(buffer, object); fieldC.encode(buffer, object); fieldD.encode(buffer, object); fieldE.encode(buffer, object); fieldF.encode(buffer, object); fieldG.encode(buffer, object); fieldH.encode(buffer, object); fieldI.encode(buffer, object); fieldJ.encode(buffer, object); fieldK.encode(buffer, object); fieldL.encode(buffer, object); fieldM.encode(buffer, object); fieldN.encode(buffer, object); fieldO.encode(buffer, object); }", "tokens": 148} {"id": 551357, "source": "method", "repo": "slimeknights/mantle", "text": "public void encode(FriendlyByteBuf buffer, R object) { fieldA.encode(buffer, object); fieldB.encode(buffer, object); }", "tokens": 31} {"id": 551418, "source": "method", "repo": "slimeknights/mantle", "text": "/** Serializes the passed object into the passed JSON @param json JSON target for serializing @param typeKey Key to use for \"type\" in the serialized value @param element Element to insert */ public static void serializeInto(JsonObject json, String typeKey, JsonElement element) { // if its an object, copy all the data over if (element.isJsonObject()) { JsonObject nestedObject = element.getAsJsonObject(); for (Entry entry : nestedObject.entrySet()) { String key = entry.getKey(); if (typeKey.equals(key)) { throw new JsonIOException(\"Unable to serialize nested object, object already has key \" + typeKey); } if (\"type\".equals(key)) { key = typeKey; } json.add(key, entry.getValue()); } } else if (element.isJsonPrimitive()){ // if its a primitive, its the type ID, add just that by itself json.add(typeKey, element); } else { throw new JsonIOException(\"Unable to serialize nested object, expected string or object\"); } }", "tokens": 220} {"id": 551464, "source": "method", "repo": "slimeknights/mantle", "text": "public AbstractFluidTooltipProvider(PackOutput output, String modId) { super(output, Target.RESOURCE_PACK, FluidTooltipHandler.FOLDER, FluidTooltipHandler.GSON); this.modId = modId; }", "tokens": 43} {"id": 551593, "source": "method", "repo": "slimeknights/mantle", "text": "/** Sets the XP gain from this recipe */ public T experience(float experience) { this.experience = experience; return (T) this; }", "tokens": 32} {"id": 551617, "source": "method", "repo": "slimeknights/mantle", "text": "/** Prefixes the registry object ID @param location Object to use for location @param prefix Path prefix @return Location with the given prefix */ default ResourceLocation prefix(IdAwareObject location, String prefix) { return prefix(location.getId(), prefix); }", "tokens": 53} {"id": 551669, "source": "method", "repo": "slimeknights/mantle", "text": "public List decode(FriendlyByteBuf buffer, TypedMap context) { return ITEM_LIST.decode(buffer, context); }", "tokens": 29} {"id": 551714, "source": "method", "repo": "slimeknights/mantle", "text": "/** Adds the given potion type */ private Builder with(PotionType type, int duration, int amplifier) { // TODO 1.21: normal should have no prefix, not just an underscore. Move the underscore addition to line below String prefix = type == PotionType.NORMAL ? \"\" : type.toString().toLowerCase(Locale.ROOT); builder.put(type, register(prefix + '_' + name, () -> new Potion(modID + \".\" + name, new MobEffectInstance(effect.get(), duration, amplifier)))); return this; }", "tokens": 119} {"id": 551876, "source": "method", "repo": "slimeknights/tinkersconstruct", "text": "public HtmlSerializable toHTML(BookData book) { return HtmlGroup.indent().add( makeTitleHTML(), HtmlElement.div().style(\"padding-left\", 10).add( HtmlElement.div().classes(\"column\").style(\"height\", 128) .add(TextData.toHtml(text, book)), HtmlElement.div().style(\"width\", 210) .add(HtmlElement.p().classes(\"underline\").add(I18n.get(KEY_PROPERTIES)) .add(HtmlElement.ul().style(\"margin-top\", 8).classes(\"prop-list\").add(HTMLUtils.toListItems(properties))) ) ) ); }", "tokens": 156} {"id": 552013, "source": "method", "repo": "slimeknights/tinkersconstruct", "text": "public UpdateMaterialsPacket(FriendlyByteBuf buffer) { int materialCount = buffer.readInt(); ImmutableMap.Builder materials = ImmutableMap.builder(); for (int i = 0; i < materialCount; i++) { MaterialId id = new MaterialId(buffer.readResourceLocation()); int tier = buffer.readVarInt(); int sortOrder = buffer.readVarInt(); Rarity rarity = buffer.readEnum(Rarity.class); boolean craftable = buffer.readBoolean(); boolean hidden = buffer.readBoolean(); materials.put(id, new Material(id, tier, sortOrder, rarity, craftable, hidden)); } this.materials = materials.build(); // process redirects int redirectCount = buffer.readVarInt(); if (redirectCount == 0) { this.redirects = Collections.emptyMap(); } else { this.redirects = new HashMap<>(redirectCount); for (int i = 0; i < redirectCount; i++) { this.redirects.put(new MaterialId(buffer.readUtf()), new MaterialId(buffer.readUtf())); } } this.tags = GenericTagUtil.decodeTags(buffer, MaterialManager.REGISTRY_KEY, id -> this.materials.get(new MaterialId(id))); }", "tokens": 260} {"id": 552127, "source": "method", "repo": "slimeknights/tinkersconstruct", "text": "/** Checks if the tool condition matches */ default boolean matchesTool(IToolStackView tool, ModifierEntry entry) { return condition().matches(tool, entry); }", "tokens": 31} {"id": 552145, "source": "method", "repo": "slimeknights/tinkersconstruct", "text": "/** @deprecated use {@link #assemble(Container, RegistryAccess)} */ public ItemStack getResultItem(RegistryAccess access) { return new ItemStack(this.result); }", "tokens": 35} {"id": 552165, "source": "method", "repo": "slimeknights/tinkersconstruct", "text": "public boolean test(@Nullable ItemStack stack) { if (stack == null || !stack.is(item)) { return false; } CompoundTag tag = stack.getTag(); if (tag != null) { ResourceLocation key = ResourceLocation.tryParse(tag.getString(TAG_INSTRUMENT)); if (key != null) { // if we just want the instrument to match, can just compare by ID over doing a fetch if (this.instrument != null) { return this.instrument.location().equals(key); } assert this.ignore != null; // must valid and not in the tag Optional> instrument = BuiltInRegistries.INSTRUMENT.getHolder(ResourceKey.create(Registries.INSTRUMENT, key)); return instrument.isPresent() && !instrument.get().is(ignore); } } // if no instrument, its fine as long as we don't have a specific instrument return this.instrument == null; }", "tokens": 192} {"id": 552173, "source": "method", "repo": "slimeknights/tinkersconstruct", "text": "public NonNullList getIngredients() { return NonNullList.of(Ingredient.EMPTY, ingredient); }", "tokens": 22} {"id": 552215, "source": "method", "repo": "slimeknights/tinkersconstruct", "text": "/** Sets the mold item, in the players hand */ public MoldingRecipeBuilder setPattern(Ingredient ingredient, boolean consumed) { this.pattern = ingredient; this.patternConsumed = consumed; return this; }", "tokens": 45} {"id": 552328, "source": "method", "repo": "slimeknights/tinkersconstruct", "text": "/** Writes a slot to the packet buffer */ public void write(FriendlyByteBuf buffer) { if (icon != null) { buffer.writeBoolean(true); buffer.writeResourceLocation(icon); } else { buffer.writeBoolean(false); } buffer.writeUtf(getTranslationKey()); buffer.writeVarInt(x); buffer.writeVarInt(y); if (filter != null) { buffer.writeBoolean(true); filter.toNetwork(buffer); } else { buffer.writeBoolean(false); } }", "tokens": 99} {"id": 552376, "source": "method", "repo": "slimeknights/tinkersconstruct", "text": "/** Adds an item as a casting catalyst, and as a molding catalyst if it has molding recipes @param registry Catalyst registry @param item Item to add @param ownCategory Category to always add @param type Molding recipe type */ private static void addCastingCatalyst(IRecipeCatalystRegistration registry, ItemLike item, mezz.jei.api.recipe.RecipeType ownCategory, RecipeType type) { registry.addRecipeCatalyst(item, ownCategory); assert Minecraft.getInstance().level != null; if (!Minecraft.getInstance().level.getRecipeManager().byType(type).isEmpty()) { registry.addRecipeCatalyst(item, TConstructJEIConstants.MOLDING); } }", "tokens": 161} {"id": 552401, "source": "method", "repo": "slimeknights/tinkersconstruct", "text": "default void onTooltip(IRecipeSlotView recipeSlotView, List tooltip) { ListIterator listIterator = tooltip.listIterator(); while (listIterator.hasNext()) { Component component = listIterator.next(); if (component.getContents() instanceof TranslatableContents translatable && AMOUNT_KEY.equals(translatable.getKey())) { listIterator.remove(); FluidStack fluid = recipeSlotView.getDisplayedIngredient(ForgeTypes.FLUID_STACK).orElse(FluidStack.EMPTY); List newTooltip = new ArrayList<>(); onFluidTooltip(fluid, recipeSlotView, newTooltip); tooltip.addAll(listIterator.nextIndex(), newTooltip); return; } } // failed to find the tooltip to replace, so just append our stuff at the end FluidStack fluid = recipeSlotView.getDisplayedIngredient(ForgeTypes.FLUID_STACK).orElse(FluidStack.EMPTY); onFluidTooltip(fluid, recipeSlotView, tooltip); }", "tokens": 195} {"id": 552773, "source": "method", "repo": "smltq/spring-boot-demo", "text": "public static void main(String[] args) { SpringApplication.run(AliNacosProviderApplication.class, args); }", "tokens": 29} {"id": 552844, "source": "method", "repo": "smltq/spring-boot-demo", "text": "public TreeNode sortedArrayToBST(int[] nums) { return convertToBST(nums, 0, nums.length - 1); }", "tokens": 30} {"id": 552949, "source": "method", "repo": "smltq/spring-boot-demo", "text": "public int hammingDistance(int x, int y) { int xor = x ^ y; int bitCount = 0; while (xor != 0) { bitCount++; xor = xor & (xor - 1); } return bitCount; }", "tokens": 60} {"id": 553196, "source": "method", "repo": "smltq/spring-boot-demo", "text": "public void tooLongUuidStringAssertsFalse() throws NoSuchAlgorithmException, SocketException, UnknownHostException { for (final boolean ignoreNetwork : falseTrue) { for (final boolean ignoreArchitecture : falseTrue) { for (final boolean ignoreHostName : falseTrue) { final HardwareBinder hb = new HardwareBinder(); if (ignoreNetwork) hb.ignore.network(); if (ignoreArchitecture) hb.ignore.architecture(); if (ignoreHostName) hb.ignore.hostName(); final String uuid = hb.getMachineIdString(); final String buuid = uuid + \"*\"; Assertions.assertFalse(hb.assertUUID(buuid)); } } } }", "tokens": 142} {"id": 553287, "source": "method", "repo": "smltq/spring-boot-demo", "text": "public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { FilterInvocation fi = new FilterInvocation(servletRequest, servletResponse, filterChain); invoke(fi); }", "tokens": 43} {"id": 553309, "source": "method", "repo": "smltq/spring-boot-demo", "text": " AjaxResult(String code, String msg, T data, E footer) { this.code = code; this.msg = msg; this.data = data; this.footer = footer; }", "tokens": 46} {"id": 553423, "source": "method", "repo": "sniffy/sniffy", "text": "public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ThreadMetaData that = (ThreadMetaData) o; return threadId == that.threadId; }", "tokens": 52} {"id": 553499, "source": "method", "repo": "sniffy/sniffy", "text": "public void setFirstPacketSent(boolean firstPacketSent) { this.firstPacketSent = firstPacketSent; }", "tokens": 25} {"id": 553503, "source": "method", "repo": "sniffy/sniffy", "text": "public OutputStream getOutputStream() throws IOException { long start = System.currentTimeMillis(); checkConnectionAllowed(); try { return new SnifferOutputStream(this, super.getOutputStream()); } finally { logSocket(System.currentTimeMillis() - start); } }", "tokens": 51} {"id": 553624, "source": "method", "repo": "sniffy/sniffy", "text": "/** @since 3.1.7 */ public static boolean hasClassInStackTrace(String className) { StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); for (StackTraceElement ste : stackTrace) { if (ste.getClassName().startsWith(className)) { return true; } } return false; }", "tokens": 64} {"id": 553688, "source": "method", "repo": "sniffy/sniffy", "text": "public void testClose() throws IOException { ByteArrayInputStream bais = new ByteArrayInputStream(DATA); SnifferInputStream sis = new SnifferInputStream(snifferSocket, bais); sis.close(); verify(snifferSocket).logSocket(anyLong()); }", "tokens": 58} {"id": 554116, "source": "method", "repo": "sniffy/sniffy", "text": "public void testAllowedExactTwoQueriesExecutedTwo() { BaseTest.executeStatements(2); }", "tokens": 21} {"id": 554222, "source": "method", "repo": "sniffy/sniffy", "text": "public void allGeneratedResourcesAreAvailableFromStablePaths() throws Exception { assertResource(\"sniffy.js\"); assertResource(\"sniffy.min.js\"); assertResource(\"sniffy.map\"); }", "tokens": 39} {"id": 554378, "source": "method", "repo": "sonarsonic/flux-networks", "text": "protected GuiButtonCore(GuiFocusable screen, int x, int y, int width, int height) { this.screen = screen; this.x = x; this.y = y; this.width = width; this.height = height; }", "tokens": 55} {"id": 554521, "source": "method", "repo": "sonarsonic/flux-networks", "text": "public void init() { super.init(); mCancel = new SimpleButton(this, leftPos + (imageWidth / 2) - 12 - 48, topPos + 86, 48, 12, FluxTranslate.CANCEL.get()); mButtons.add(mCancel); mConnect = new SimpleButton(this, leftPos + (imageWidth / 2) + 12, topPos + 86, 48, 12, FluxTranslate.CONNECT.get()); mConnect.setClickable(false); mButtons.add(mConnect); mPassword = FluxEditBox.create(FluxTranslate.NETWORK_PASSWORD.get() + \": \", font, leftPos + (imageWidth / 2) - 60, topPos + 64, 120, 12); mPassword.setTextInvisible(); mPassword.setMaxLength(FluxNetwork.MAX_PASSWORD_LENGTH); mPassword.setResponder(s -> mConnect.setClickable(!s.isEmpty())); addRenderableWidget(mPassword); }", "tokens": 221} {"id": 554549, "source": "method", "repo": "sonarsonic/flux-networks", "text": "protected void drawForegroundLayer(GuiGraphics gr, int mouseX, int mouseY, float deltaTicks) { super.drawForegroundLayer(gr, mouseX, mouseY, deltaTicks); if (getNetwork().isValid() || getNavigationTab() == EnumNavigationTab.TAB_CREATE) { gr.drawCenteredString(font, getNavigationTab().getTranslatedName(), leftPos + 88, topPos + 10, 0xFFB4B4B4); gr.drawString(font, FluxTranslate.NETWORK_SECURITY.get() + \": \" + ChatFormatting.AQUA + mSecurityLevel.getName(), leftPos + 16, topPos + 47, 0xFF808080); //font.drawString(matrixStack, FluxTranslate.NETWORK_ENERGY.t() + \": \" + TextFormatting.AQUA + energyType // .getName(), 14, 78, 0x606060); gr.drawString(font, FluxTranslate.NETWORK_COLOR.get() + \":\", leftPos + 16, topPos + 89, 0xFF808080); renderNetwork(gr, mNetworkName.getValue(), mColorButton.mColor, topPos + 126); } }", "tokens": 264} {"id": 554605, "source": "method", "repo": "sonarsonic/flux-networks", "text": "public Component getTitle() { return FluxTranslate.JEI_CREATING_FLUX.getComponent(); }", "tokens": 21} {"id": 555049, "source": "method", "repo": "sonarsonic/flux-networks", "text": "public static void reloadBlacklist(@Nonnull List blockBlacklist, @Nonnull List itemBlacklist) { BLOCK_BLACKLIST.clear(); for (String s : blockBlacklist) { if (s == null || s.isEmpty()) { continue; } try { Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(s)); if (block != null) { BLOCK_BLACKLIST.add(block); } } catch (Exception e) { FluxNetworks.LOGGER.warn(MARKER, \"Block blacklist error: {} has incorrect formatting\", s, e); } } ITEM_BLACKLIST.clear(); for (String s : itemBlacklist) { if (s == null || s.isEmpty()) { continue; } try { Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(s)); if (item != null) { ITEM_BLACKLIST.add(item); } } catch (Exception e) { FluxNetworks.LOGGER.warn(MARKER, \"Item blacklist error: {} has incorrect formatting\", s, e); } } FluxNetworks.LOGGER.info(MARKER, \"Energy blacklist loaded: {} block entries, {} item entries\", BLOCK_BLACKLIST.size(), ITEM_BLACKLIST.size()); }", "tokens": 265} {"id": 555130, "source": "method", "repo": "sonarsonic/flux-networks", "text": "public void sendToAll(@Nonnull FriendlyByteBuf payload) { ServerLifecycleHooks.getCurrentServer().getPlayerList() .broadcastAll(new ClientboundCustomPayloadPacket(CHANNEL_NAME, payload)); }", "tokens": 39} {"id": 555253, "source": "method", "repo": "spair/imgui-java", "text": "/** Method called at the beginning of the main cycle. It clears OpenGL buffer and starts an ImGui frame. */ protected void startFrame() { clearBuffer(); imGuiGl3.newFrame(); imGuiGlfw.newFrame(); ImGui.newFrame(); }", "tokens": 56} {"id": 555273, "source": "method", "repo": "spair/imgui-java", "text": "public static int rgb(final Color color) { return rgb(color.getRed(), color.getGreen(), color.getBlue()); }", "tokens": 27} {"id": 555667, "source": "method", "repo": "spair/imgui-java", "text": "public boolean[] getData() { return data; }", "tokens": 11} {"id": 555750, "source": "method", "repo": "spair/imgui-java", "text": "/** Get the size of the data buffer. Buffer size will always have '+1' to its size, since it's used by the Dear ImGui to draw a caret char. @return size of the data buffer */ public int getBufferSize() { return data.length; }", "tokens": 59} {"id": 555912, "source": "method", "repo": "spair/imgui-java", "text": "private void ensureVertexBuffer(final long device, final int sizeNeeded) { if (vertexBufferSize >= sizeNeeded && vertexBuffer != 0L) { return; } final int newSize = Math.max(sizeNeeded, vertexBufferSize == 0 ? 16 * 1024 : vertexBufferSize * 2); if (vertexBuffer != 0L) { SDL_ReleaseGPUBuffer(device, vertexBuffer); } if (vertexTransferBuffer != 0L) { SDL_ReleaseGPUTransferBuffer(device, vertexTransferBuffer); } try (MemoryStack stack = MemoryStack.stackPush()) { vertexBuffer = SDL_CreateGPUBuffer(device, SDL_GPUBufferCreateInfo.calloc(stack) .usage(SDL_GPU_BUFFERUSAGE_VERTEX) .size(newSize) .props(0)); vertexTransferBuffer = SDL_CreateGPUTransferBuffer(device, SDL_GPUTransferBufferCreateInfo.calloc(stack) .usage(SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD) .size(newSize) .props(0)); } vertexBufferSize = newSize; }", "tokens": 232} {"id": 555959, "source": "method", "repo": "spinyowl/legui", "text": "/** Used to set size vector. @param width width to set. @param height height to set. */ public void setSize(float width, float height) { this.size.set(width, height); }", "tokens": 46} {"id": 556026, "source": "method", "repo": "spinyowl/legui", "text": "/** Used to deselect all of radio buttons. */ public void clearSelection() { if (selection != null) { RadioButton oldSelection = selection; selection = null; oldSelection.setChecked(false); } }", "tokens": 45} {"id": 556600, "source": "method", "repo": "spinyowl/legui", "text": "/** Returns chain callback used to keep {@link GLFWCharModsCallbackI} instances. @return chain char callback. */ public IChainCharModsCallback getChainCharModsCallback() { return chainCharModsCallback; }", "tokens": 45} {"id": 556629, "source": "method", "repo": "spinyowl/legui", "text": "public void handle(SystemKeyEvent event, Frame frame, Context context) { int keyCode = event.key; KeyboardKey key = new KeyboardKey(Keyboard.getKeyCode(event.key), event.key); Component focusedGui = context.getFocusedGui(); if (focusedGui == null) { return; } KeyAction action = null; if (event.action == GLFW_RELEASE) { action = KeyAction.RELEASE; } else if (event.action == GLFW_PRESS) { action = KeyAction.PRESS; } else if (event.action == GLFW_REPEAT) { action = KeyAction.REPEAT; } Set modSet = new HashSet<>(); if (isMod(event.mods, GLFW_MOD_SHIFT)) { modSet.add(KeyMod.SHIFT); } if (isMod(event.mods, GLFW_MOD_ALT)) { modSet.add(KeyMod.ALT); } if (isMod(event.mods, GLFW_MOD_CONTROL)) { modSet.add(KeyMod.CONTROL); } if (isMod(event.mods, GLFW_MOD_CAPS_LOCK)) { modSet.add(KeyMod.CAPS_LOCK); } if (isMod(event.mods, GLFW_MOD_NUM_LOCK)) { modSet.add(KeyMod.NUM_LOCK); } EventProcessorProvider.getInstance().pushEvent( new KeyEvent(focusedGui, context, frame, event.action, keyCode, event.mods, event.scancode)); EventProcessorProvider.getInstance() .pushEvent(new KeyboardEvent(focusedGui, context, frame, action, key, modSet)); }", "tokens": 349} {"id": 556765, "source": "method", "repo": "spinyowl/legui", "text": "/** Returns slider color. @return slider color. */ public Vector4f sliderColor() { return sliderColor == null ? null : new Vector4f(sliderColor); }", "tokens": 37} {"id": 556805, "source": "method", "repo": "spinyowl/legui", "text": "/** Creates {@link String} from file or resource. @param path path to file or resource. @return String from file or resource data or null. @throws IOException in case if any IO exception occurs. */ public static String resourceToString(String path) throws IOException { return byteBufferToString(resourceToByteBuffer(path)); }", "tokens": 67} {"id": 556991, "source": "method", "repo": "spongepowered/mixin", "text": "public URL[] getClassPath() { return Launch.classLoader.getSources().toArray(new URL[0]); }", "tokens": 24} {"id": 557018, "source": "method", "repo": "spongepowered/mixin", "text": "public void debug(String message, Object... params) { this.log(Level.DEBUG, message, params); }", "tokens": 28} {"id": 557040, "source": "method", "repo": "spongepowered/mixin", "text": "boolean isSupported() { return JavaVersion.current() >= JavaVersion.JAVA_8; }", "tokens": 21} {"id": 557202, "source": "method", "repo": "spongepowered/mixin", "text": "public String toString() { String desc = Strings.nullToEmpty(this.getDesc()); if (!desc.isEmpty() && this.isField()) { desc = \":\" + desc; } String owner = Strings.nullToEmpty(this.getOwner()); if (!owner.isEmpty()) { owner = \"L\" + owner + \";\"; } return String.format(\"%s%s%s\", owner, Strings.nullToEmpty(this.getName()), desc); }", "tokens": 94} {"id": 557317, "source": "method", "repo": "spongepowered/mixin", "text": "public InvalidInjectionException(IMixinContext context, String message) { super(context, message); this.selectorContext = null; }", "tokens": 29} {"id": 557411, "source": "method", "repo": "spongepowered/mixin", "text": "protected void mergeShadowFields(MixinTargetContext mixin) { for (Entry entry : mixin.getShadowFields()) { FieldNode shadow = entry.getKey(); FieldNode target = this.findTargetField(shadow); if (target != null) { Annotations.merge(shadow, target); // Strip the FINAL flag from @Mutable fields if (entry.getValue().isDecoratedMutable()) { target.access &= ~Opcodes.ACC_FINAL; } } } }", "tokens": 104} {"id": 557448, "source": "method", "repo": "spongepowered/mixin", "text": "Accessor(MixinInfo info) { super(info, \"@Mixin\", false); this.interfaces.add(info.getClassRef()); }", "tokens": 30} {"id": 557456, "source": "method", "repo": "spongepowered/mixin", "text": "/** True if this mixin is decorated with {@link Pseudo} */ public boolean isVirtual() { return this.virtual; }", "tokens": 28} {"id": 557540, "source": "method", "repo": "spongepowered/mixin", "text": "public int hashCode() { return Objects.hashCode(this.toString()); }", "tokens": 16} {"id": 557853, "source": "method", "repo": "spongepowered/noise", "text": "/** Inserts the control point at the specified position in the internal control point array.

Because the curve mapping algorithm used by this noise module requires that all control points in the array mut be sorted by input value, the new control point should be inserted at the position in which the order is still preserved.

@param insertionPos the zero-based array position in which to insert the control point @param inputValue the input value stored in the control point @param outputValue the output value stored in the control point */ private void insertAtPos(final int insertionPos, final double inputValue, final double outputValue) { final ControlPoint newPoint = new ControlPoint(inputValue, outputValue); this.controlPoints.add(insertionPos, newPoint); }", "tokens": 162} {"id": 557891, "source": "method", "repo": "spongepowered/noise", "text": "public ScalePoint() { super(1); }", "tokens": 12} {"id": 558093, "source": "method", "repo": "spongepowered/sponge", "text": "public boolean hasAny(Parameter.Value parameter) { return this.hasAny(parameter.key()); }", "tokens": 23} {"id": 558142, "source": "method", "repo": "spongepowered/sponge", "text": "public static void visit(final ConfigurationNode child, final ConfigurationNode parent) { child.visit(DuplicateRemovalVisitor.INSTANCE, new AtomicReference<>(parent)); }", "tokens": 33} {"id": 558179, "source": "method", "repo": "spongepowered/sponge", "text": "SpongeDataManipulator(final Map, Object> values) { this.values = values; }", "tokens": 23} {"id": 558239, "source": "method", "repo": "spongepowered/sponge", "text": "protected SetValue.Immutable modifyCollection(Consumer> consumer) { final Set set; if (this.element instanceof ImmutableSet) { final Set temp = new LinkedHashSet<>(this.element); consumer.accept(temp); set = ImmutableSet.copyOf(temp); } else if (this.element instanceof LinkedHashSet) { set = new LinkedHashSet<>(this.element); consumer.accept(set); } else { set = new HashSet<>(this.element); consumer.accept(set); } return this.key().getValueConstructor().getRawImmutable(set).asImmutable(); }", "tokens": 128} {"id": 558359, "source": "method", "repo": "spongepowered/sponge", "text": "public BiConsumer getFrameModifier() { return CompletePhase.EMPTY_MODIFIER; }", "tokens": 26} {"id": 558572, "source": "method", "repo": "spongepowered/sponge", "text": "public SpongeBlockChangeFlag withBlocksMoving(boolean moving) { if (this.movingBlocks() == moving) { return this; } return BlockChangeFlagManager.fromNativeInt(moving ? this.rawFlag | Constants.BlockChangeFlags.BLOCK_MOVING : this.rawFlag & ~Constants.BlockChangeFlags.BLOCK_MOVING); }", "tokens": 73} {"id": 558668, "source": "method", "repo": "spongepowered/sponge", "text": "public void setCustom(ItemStack stack) { ((SlotTransaction) (Object) this).setCustom(stack); }", "tokens": 26} {"id": 558774, "source": "method", "repo": "spongepowered/sponge", "text": "public void notifyRemovedFromMap(final MapInfo mapInfo) { this.impl$attachedMapDatas.remove((MapItemSavedData) mapInfo); }", "tokens": 36} {"id": 558954, "source": "method", "repo": "spongepowered/sponge", "text": "public P getParentList() { return this.parentList; }", "tokens": 14} {"id": 559283, "source": "method", "repo": "spongepowered/spongeapi", "text": "/** {@link Keys#IS_PERSISTENT} @return Whether the entity will be prevented from despawning */ default Value.Mutable persistent() { return this.requireValue(Keys.IS_PERSISTENT).asMutable(); }", "tokens": 49} {"id": 559365, "source": "method", "repo": "spongepowered/spongeapi", "text": "public Builder from(final Cause value) { for (int i = 0; i < value.cause.length; i++) { this.causes.add(value.cause[i]); } return this; }", "tokens": 48} {"id": 559385, "source": "method", "repo": "spongepowered/spongeapi", "text": "public boolean equals(final @Nullable Object o) { if (this == o) { return true; } if (o == null || this.getClass() != o.getClass()) { return false; } final DamageFunction that = (DamageFunction) o; return Objects.equals(this.modifier, that.modifier) && Objects.equals(this.function, that.function); }", "tokens": 82} {"id": 559425, "source": "method", "repo": "spongepowered/spongeapi", "text": "/** Adds an {@link AttributeModifier} to this item stack. @param attributeType The Attribute type. @param modifier The Attribute modifier. @param equipmentType The equipment type this {@link AttributeModifier} will apply to. @return This builder, for chaining */ default Builder attributeModifier(Supplier attributeType, AttributeModifier modifier, DefaultedRegistryReference equipmentType) { return this.attributeModifier(attributeType.get(), modifier, equipmentType.get()); }", "tokens": 105} {"id": 559516, "source": "method", "repo": "spongepowered/spongeapi", "text": "static ScoreFormat fixed(Component component) { return Sponge.game().factoryProvider().provide(Factory.class).fixed(component); }", "tokens": 31} {"id": 559534, "source": "method", "repo": "spongepowered/spongeapi", "text": "public boolean equals(final Object other) { if (this == other) { return true; } return other instanceof Map.Entry && this.wrapped.equals(other); }", "tokens": 39} {"id": 559604, "source": "method", "repo": "spongepowered/spongeapi", "text": "/** Returns a new transform representing a translation. @param vector The translation vector @return The new translation transform */ public static DiscreteTransform2 fromTranslation(final Vector2i vector) { return DiscreteTransform2.fromTranslation(vector.x(), vector.y()); }", "tokens": 55} {"id": 559640, "source": "method", "repo": "spongepowered/spongeapi", "text": "/** Returns a {@link Ticks} that represents the supplied number of ticks.

This is platform and potentially {@link Engine} dependent - consult the target implementation for what a tick represents.

@param ticks The number of ticks @return A {@link Ticks} object that represents the number of ticks. */ static Ticks of(final long ticks) { return Sponge.game().factoryProvider().provide(Factory.class).of(ticks); }", "tokens": 97} {"id": 559751, "source": "method", "repo": "spongepowered/spongeapi", "text": "/** Gets spawn chance during world generation.

The entity to spawn is picked randomly from {@link #spawners()} of type {@link EntityCategories#CREATURE}

@return The spawn chance */ default double generationSpawnChance() { return this.require(Keys.SPAWN_CHANCE); }", "tokens": 62} {"id": 559752, "source": "method", "repo": "spongepowered/spongeapi", "text": "/** Gets the fog color. @return The fog color */ default Color fogColor() { return this.require(Keys.FOG_COLOR); }", "tokens": 32} {"id": 559769, "source": "method", "repo": "spongepowered/spongeapi", "text": "/** Gets a value that indicates the relative strength of an explosion. @return The resolution of the explosion. */ default int resolution() { return 16; }", "tokens": 34} {"id": 559960, "source": "method", "repo": "spongepowered/spongeforge", "text": "public Type getExecutionType() { return staticGetExecutionType(); }", "tokens": 15} {"id": 560101, "source": "method", "repo": "spongepowered/spongeforge", "text": "default Fabric bridge$getFabric() { return (Fabric) this; }", "tokens": 16} {"id": 560168, "source": "method", "repo": "spongepowered/spongeforge", "text": "public InetSocketAddress getAddress() { return ((NetworkManagerBridge) this.netManager).bridge$getAddress(); }", "tokens": 25} {"id": 560254, "source": "method", "repo": "spongepowered/spongeforge", "text": "/** @author unknown @reason Forge compatibility */ public static int getMaxSpawnPackSize(final EntityLiving entityLiving) { return ForgeEventFactory.getMaxSpawnPackSize(entityLiving); }", "tokens": 38} {"id": 560455, "source": "method", "repo": "spongepowered/spongeforge", "text": "private static void onDispense(final World world, final BlockPos pos, final TileEntityDispenser dropper, final int slot, final ItemStack stack, final CallbackInfoReturnable cir, final EnumFacing enumFacing, final BlockPos blockPos, final Pair destinationResult, final IItemHandler itemHandler, final Object destination) { if (ShouldFire.CHANGE_INVENTORY_EVENT_TRANSFER_PRE) { if (SpongeCommonEventFactory.callTransferPre(InventoryUtil.toInventory(dropper, null), InventoryUtil.toInventory(destination, itemHandler)).isCancelled()) { cir.setReturnValue(false); } } }", "tokens": 129} {"id": 560456, "source": "method", "repo": "spongepowered/spongeforge", "text": "private static ItemStack onInsertStack(final TileEntity source, final Object destination, final IItemHandler destInventory, final ItemStack stack, final int slot) { if (ShouldFire.CHANGE_INVENTORY_EVENT_TRANSFER_POST) { return SpongeCommonEventFactory.captureTransaction(InventoryUtil.forCapture(source), InventoryUtil.toInventory(destination, destInventory), slot, () -> insertStack(source, destination, destInventory, stack, slot)); } return insertStack(source, destination, destInventory, stack, slot); }", "tokens": 109} {"id": 560555, "source": "method", "repo": "spongepowered/spongeforge", "text": "/** Get the names of loaded classes from the cache, filter using the supplied filter string @param filter filter string or null @return set of class names */ private static Set getLoadedClasses(final String filter) { final Map> cachedClasses = net.minecraftforge.fml.relauncher.ReflectionHelper.>, LaunchClassLoader>getPrivateValue(LaunchClassLoader.class, Launch.classLoader, \"cachedClasses\"); if (cachedClasses == null) { return ImmutableSet.of(\"Unable to determine classloader state\"); } final Set loadedClasses = new HashSet(); for (final String className : cachedClasses.keySet()) { if (filter == null || className.startsWith(filter)) { loadedClasses.add(className); } } return loadedClasses; }", "tokens": 171} {"id": 560592, "source": "method", "repo": "spongepowered/spongeforge", "text": "public void onCustomPacketRegistration(CustomPacketRegistrationEvent event) { final Set channels = ((INetPlayHandlerBridge_Forge) event.getHandler()).forgeBridge$getRegisteredChannels(); final EntityPlayer player; if (event.getSide().isClient()) { player = null; } else { player = ((NetHandlerPlayServer) event.getHandler()).player; } final Cause currentCause = Cause.of(EventContext.empty(), player == null ? Sponge.getGame() : player, event.getSide().isClient() ? Platform.Type.CLIENT : Platform.Type.SERVER); if (event.getOperation().equals(\"REGISTER\")) { for (String channel : event.getRegistrations()) { if (channels.add(channel)) { SpongeImpl.postEvent(SpongeEventFactory.createChannelRegistrationEventRegister(currentCause, channel)); } } } else if (event.getOperation().equals(\"UNREGISTER\")) { for (String channel : event.getRegistrations()) { if (channels.remove(channel)) { SpongeImpl.postEvent(SpongeEventFactory.createChannelRegistrationEventUnregister(currentCause, channel)); } } } }", "tokens": 238} {"id": 560697, "source": "method", "repo": "spongepowered/spongeforge", "text": "public Optional createTicket(final Object plugin, final World world) { final Ticket forgeTicket = ForgeChunkManager.requestTicket(plugin, (net.minecraft.world.World) world, ForgeChunkManager.Type.NORMAL); if (forgeTicket == null) { return Optional.empty(); } return Optional.of(new SpongeLoadingTicket(forgeTicket)); }", "tokens": 79} {"id": 560733, "source": "method", "repo": "spongepowered/spongeforge", "text": "public static FluidStack drain(IFluidBlock fluidBlock, World world, BlockPos pos, boolean doDrain) { return fluidBlock.drain(world, pos, doDrain); }", "tokens": 37} {"id": 561155, "source": "method", "repo": "spongepowered/spongevanilla", "text": "/** @author Aikar - July 29th, 2018 @reason Always process chunk registration after moving. This will help guarantee that entities are always in the chunk that they are currently located at. @see https://github.com/PaperMC/Paper/blob/master/Spigot-Server-Patches/0315-Always-process-chunk-registration-after-moving.patch @param x The x position @param y The y position @param z The z position @param ci The callback info */ private void processChunkOnMove$onSetPositionEnsureWorldChunkNoticed(final double x, final double y, final double z, final CallbackInfo ci) { if (this.bridge$isWorldTracked() && !this.world.isRemote) { // We want to not force an update, this just forces the world to update the tracked entity lists // and the chunks containing entities. this.world.updateEntityWithOptionalForce((net.minecraft.entity.Entity) (Object) this, false); } }", "tokens": 227} {"id": 561451, "source": "method", "repo": "spotify-web-api-java/spotify-web-api-java", "text": "/** Get the total tracks of the album. @return The total tracks of the album. */ public Integer getTotalTracks() { return totalTracks; }", "tokens": 31} {"id": 561586, "source": "method", "repo": "spotify-web-api-java/spotify-web-api-java", "text": "public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Show show = (Show) o; return Objects.equals(id, show.id) && Objects.equals(name, show.name) && Objects.equals(explicit, show.explicit) && Objects.equals(uri, show.uri); }", "tokens": 91} {"id": 561628, "source": "method", "repo": "spotify-web-api-java/spotify-web-api-java", "text": "/** The limit setter. @param limit Optional. The maximum number of objects to return. Default: 20. Minimum: 1. Maximum: 50. @return A {@link GetUsersSavedAlbumsRequest.Builder}. */ public Builder limit(final Integer limit) { assert (1 <= limit && limit <= 50); return setQueryParameter(\"limit\", limit); }", "tokens": 81} {"id": 561682, "source": "method", "repo": "spotify-web-api-java/spotify-web-api-java", "text": "/** The collaborative state setter. @param collaborative Optional. Defaults to {@code false}. If {@code true} the playlist will be collaborative. Note: To create a collaborative playlist you must also set {@code public} to {@code false}. To create collaborative playlists you must have granted {@code playlist-modify-private} and {@code playlist-modify-public} scopes. @return A {@link CreatePlaylistRequest.Builder}. */ public Builder collaborative(final Boolean collaborative) { return setBodyParameter(\"collaborative\", collaborative); }", "tokens": 134} {"id": 561704, "source": "method", "repo": "spotify-web-api-java/spotify-web-api-java", "text": "/** The private {@link UpdatePlaylistsItemsReplaceDeprecatedRequest} constructor. @param builder A {@link UpdatePlaylistsItemsReplaceDeprecatedRequest.Builder}. */ private UpdatePlaylistsItemsReplaceDeprecatedRequest(final Builder builder) { super(builder); }", "tokens": 52} {"id": 561745, "source": "method", "repo": "spotify-web-api-java/spotify-web-api-java", "text": "/** The private {@link GetTrackRequest} constructor. @param builder A {@link GetTrackRequest.Builder}. */ private GetTrackRequest(final Builder builder) { super(builder); }", "tokens": 40} {"id": 561810, "source": "method", "repo": "spotify-web-api-java/spotify-web-api-java", "text": "public void shouldComplyWithReference() { assertHasHeader(defaultRequest, \"Content-Type\", \"application/json\"); assertEquals(\"https://api.spotify.com:443/v1/me/player/queue?uri=spotify%3Atrack%3A01iyCAUm8EvOFqVWYJ3dVX&device_id=5fbb3ba6aa454b5534c4ba43a8c7e8e45a63ad0e\", defaultRequest.getUri().toString()); }", "tokens": 124} {"id": 561886, "source": "method", "repo": "sqlancer/sqlancer", "text": "public static void main(String[] args) { try { if (args.length == 0) { System.err.println( \"Usage: java -cp target/sqlancer-2.0.0.jar sqlancer.StandaloneReducer [output-file]\"); System.exit(1); } Path inputPath = Paths.get(args[0]); Path outputPath = args.length > 1 ? Paths.get(args[1]) : null; StandaloneReducer reducer = new StandaloneReducer(inputPath, outputPath); reducer.reduce(); } catch (Throwable e) { System.err.println(\"ERROR: \" + e.getMessage()); e.printStackTrace(); System.exit(1); } }", "tokens": 160} {"id": 561904, "source": "method", "repo": "sqlancer/sqlancer", "text": "public void visitSpecific(ClickHouseExpression expr) { ClickHouseVisitor.super.visit(expr); }", "tokens": 22} {"id": 561959, "source": "method", "repo": "sqlancer/sqlancer", "text": "public static CockroachDBDataType getRandom() { return Randomly.fromOptions(values()); }", "tokens": 19} {"id": 562070, "source": "method", "repo": "sqlancer/sqlancer", "text": "public DatabendConstant getExpectedValue() { DatabendConstant leftVal = getLeftExpr().getExpectedValue(); DatabendConstant rightVal = getRightExpr().getExpectedValue(); if (leftVal == null || rightVal == null) { return null; } if (leftVal.isNull() || rightVal.isNull()) { return DatabendConstant.createNullConstant(); } else { boolean result = LikeImplementationHelper.match(leftVal.asString(), rightVal.asString(), 0, 0, true); return DatabendConstant.createBooleanConstant(result); } }", "tokens": 116} {"id": 562117, "source": "method", "repo": "sqlancer/sqlancer", "text": "public static List getFunctionsCompatibleWith(DorisDataType returnType) { return Stream.of(values()).filter(f -> f.isCompatibleWithReturnType(returnType)) .collect(Collectors.toList()); }", "tokens": 46} {"id": 562129, "source": "method", "repo": "sqlancer/sqlancer", "text": "public DorisInsertGenerator(DorisGlobalState globalState) { this.globalState = globalState; }", "tokens": 21} {"id": 562150, "source": "method", "repo": "sqlancer/sqlancer", "text": "public DuckDBExpression isNull(DuckDBExpression expr) { return new sqlancer.duckdb.ast.DuckDBUnaryPostfixOperator(expr, DuckDBUnaryPostfixOperator.IS_NULL); }", "tokens": 41} {"id": 562286, "source": "method", "repo": "sqlancer/sqlancer", "text": "public static MySQLEngine get(String val) { return Stream.of(values()).filter(engine -> engine.s.equalsIgnoreCase(val)).findFirst().get(); }", "tokens": 35} {"id": 562306, "source": "method", "repo": "sqlancer/sqlancer", "text": "public MySQLConstant castAs(CastType type) { if (type == CastType.SIGNED || type == CastType.UNSIGNED) { String value = this.value; while (value.startsWith(\" \") || value.startsWith(\"\\t\") || value.startsWith(\"\\n\")) { if (value.startsWith(\"\\n\")) { /* workaround for https://bugs.mysql.com/bug.php?id=96294 */ throw new IgnoreMeException(); } value = value.substring(1); } for (int i = value.length(); i >= 0; i--) { try { String substring = value.substring(0, i); long val = Long.parseLong(substring); return MySQLConstant.createIntConstant(val, type == CastType.SIGNED); } catch (NumberFormatException e) { // ignore } } return MySQLConstant.createIntConstant(0, type == CastType.SIGNED); } else { throw new AssertionError(); } }", "tokens": 202} {"id": 562318, "source": "method", "repo": "sqlancer/sqlancer", "text": "private MySQLExpression getComputableFunction(int depth) { MySQLFunction func = MySQLFunction.getRandomFunction(); int nrArgs = func.getNrArgs(); if (func.isVariadic()) { nrArgs += Randomly.smallNumber(); } MySQLExpression[] args = new MySQLExpression[nrArgs]; for (int i = 0; i < args.length; i++) { args[i] = generateExpression(depth + 1); } return new MySQLComputableFunction(func, args); }", "tokens": 111} {"id": 562326, "source": "method", "repo": "sqlancer/sqlancer", "text": "public MySQLSetGenerator(Randomly r, MainOptions options) { this.r = r; this.isSingleThreaded = options.getNumberConcurrentThreads() == 1; }", "tokens": 38} {"id": 562415, "source": "method", "repo": "sqlancer/sqlancer", "text": "public PostgresDataType[] getInputTypesForReturnType(PostgresDataType returnType, int nrArguments) { return new PostgresDataType[] { PostgresDataType.TEXT }; }", "tokens": 33} {"id": 562526, "source": "method", "repo": "sqlancer/sqlancer", "text": "public SQLQueryAdapter getQuery(QuestDBGlobalState globalState, @Nullable String tableName) { this.globalState = globalState; this.tableName = tableName; return getStatement(); }", "tokens": 36} {"id": 562570, "source": "method", "repo": "sqlancer/sqlancer", "text": "public SQLite3Constant applyNumericAffinity() { Pattern leadingDigitPattern = Pattern .compile(\"[-+]?((\\\\d(\\\\d)*(\\\\.(\\\\d)*)?)|\\\\.(\\\\d)(\\\\d)*)([Ee][+-]?(\\\\d)(\\\\d)*)?\"); String trimmedString = text.trim(); if (trimmedString.isEmpty()) { return this; } Matcher matcher = leadingDigitPattern.matcher(trimmedString); if (matcher.matches()) { return SQLite3Cast.castToNumeric(this); } else { return this; } }", "tokens": 133} {"id": 562763, "source": "method", "repo": "sqlancer/sqlancer", "text": "void testSimple() throws Exception { TestEnvironment env = TestEnvironment.getStatementReducerEnv(); String[] queriesStr = { \"CREATE TABLE FAKE_TABLE;\", \"SELECT * FROM FAKE_TABLE;\", \"EXIT\", }; env.setInitialStatementsFromStrings(List.of(queriesStr)); env.setBugInducingCondition(statements -> { String queriesString = TestEnvironment.getQueriesString(statements); return queriesString.contains(\"SELECT\"); }); env.runReduce(); List> reducedResult = env.getReducedStatements(); assertEquals(1, reducedResult.size()); assertEquals(\"SELECT * FROM FAKE_TABLE;\", reducedResult.get(0).toString()); }", "tokens": 150} {"id": 562833, "source": "method", "repo": "srgantmoomoo/postman", "text": "public void drawComponent(DrawContext context) { context.fill(this.getX(), this.getY(), this.getX() + this.getModuleComponent().getCategoryRect().getWidth(), this.getY() + this.getModuleComponent().getCategoryRect().getHeight(), this.getComponentColor()); context.fill(this.getX(), this.getY() + this.catRect.getHeight() - 1, this.getX() + (int) this.sliderWidth, this.getY() + this.catRect.getHeight(), this.getSettingColor()); context.drawTextWithShadow(MinecraftClient.getInstance().textRenderer, this.setting.getName() + \" \" + Formatting.GRAY + \"<\" + this.setting.getValue() + \">\", this.getX() + 2, this.getY() + 2, -1); }", "tokens": 170} {"id": 562967, "source": "method", "repo": "srgantmoomoo/postman", "text": "public ClickGuiModule() { super(\"clickGui\", \"kms.\", Category.CLIENT, GLFW.GLFW_KEY_RIGHT_SHIFT); INSTANCE = this; }", "tokens": 36} {"id": 563068, "source": "method", "repo": "srgantmoomoo/postman", "text": "public void onEvent(Event e) { if(MinecraftClient.getInstance().player == null) return; if(e instanceof EventTick) { if((MinecraftClient.getInstance().player.getMainHandStack().getItem() instanceof BlockItem || MinecraftClient.getInstance().player.getOffHandStack().getItem() instanceof BlockItem) && !isMainHandThrowable(throwables)) { MinecraftClient.getInstance().itemUseCooldown = 0; } } }", "tokens": 87} {"id": 563117, "source": "method", "repo": "ssssssss-team/magic-api", "text": "public JsonBean> backups(@PathVariable(\"id\") String id) { if(service == null || StringUtils.isBlank(id)){ return new JsonBean<>(Collections.emptyList()); } return new JsonBean<>(service.backupById(id)); }", "tokens": 55} {"id": 563585, "source": "method", "repo": "ssssssss-team/magic-api", "text": "public void readAll() { List keys = new ArrayList<>(keys()); List values = redisTemplate.opsForValue().multiGet(keys); this.cachedContent.entrySet().removeIf(entry -> entry.getKey().startsWith(path)); if (values != null) { for (int i = 0, size = keys.size(); i < size; i++) { this.cachedContent.put(keys.get(i), values.get(i)); } } }", "tokens": 103} {"id": 563696, "source": "method", "repo": "ssssssss-team/magic-api", "text": "private RestTemplate createRestTemplate() { RestTemplate restTemplate = new RestTemplate(); restTemplate.getMessageConverters().add(new StringHttpMessageConverter(StandardCharsets.UTF_8) { { setSupportedMediaTypes(Collections.singletonList(MediaType.ALL)); } @Override public boolean supports(Class clazz) { return true; } }); return restTemplate; }", "tokens": 72} {"id": 563704, "source": "method", "repo": "starmcc/qs-beanfun", "text": "public String getWebUrlServiceCenter() { // return \"https://cs.hk.beanfun.com/faq/index.aspx\"; return \"https://csp.hk.beanfun.com/\"; }", "tokens": 47} {"id": 563714, "source": "method", "repo": "starmcc/qs-beanfun", "text": "public void loginOut(String token) throws Exception { String url = \"https://tw.beanfun.com/generic_handlers/remove_bflogin_session.ashx\"; String time = new SimpleDateFormat(\"yyyyMMddHHmmss.SSS\").format(new Date()); ReqParams params = ReqParams.getInstance().addParam(\"d\", time); HttpClient.getInstance().get(url, params); }", "tokens": 92} {"id": 563778, "source": "method", "repo": "starmcc/qs-beanfun", "text": "public static ActPwd build(String act, String pwd) { ActPwd actPwd = new ActPwd(); actPwd.setAct(act); actPwd.setPwd(pwd); return actPwd; }", "tokens": 45} {"id": 564257, "source": "method", "repo": "Stonewuu/ai-fusion-video", "text": "private AiModelMultimodalCapabilities() { }", "tokens": 10} {"id": 564482, "source": "method", "repo": "Stonewuu/ai-fusion-video", "text": "private Identity withReplyAndAgent(String reply, String agent) { return withReply(reply).withAgent(agent); }", "tokens": 28} {"id": 564487, "source": "method", "repo": "Stonewuu/ai-fusion-video", "text": "public Mono settle( String idempotencyKey, NormalizedModelUsage usage) { return Mono.fromSupplier(() -> { if (idempotencyKey == null || !IDEMPOTENCY_KEY.matcher(idempotencyKey).matches()) { throw new IllegalArgumentException( \"idempotency key must be runId:modelCallId\"); } Objects.requireNonNull(usage, \"usage must not be null\"); byte[] material = (\"afv-usage-v1:\" + idempotencyKey) .getBytes(StandardCharsets.UTF_8); return \"usage-\" + HexFormat.of().formatHex(sha256(material)); }); }", "tokens": 133} {"id": 564523, "source": "method", "repo": "Stonewuu/ai-fusion-video", "text": "public Mono assertLease( String runId, String ownerInstanceId, long ownerEpoch) { OwnerIdentity owner = owner(runId, ownerInstanceId, ownerEpoch); return journal(() -> runs.hasValidOwnedLease( owner.runId(), owner.ownerInstanceId(), owner.ownerEpoch())) .flatMap(valid -> valid ? Mono.empty() : Mono.error(new OwnerFencedException(owner.runId()))); }", "tokens": 90} {"id": 564549, "source": "method", "repo": "Stonewuu/ai-fusion-video", "text": "private String errorResult(String message) { return JSONUtil.createObj().set(\"status\", \"error\").set(\"message\", message).toString(); }", "tokens": 34} {"id": 564558, "source": "method", "repo": "Stonewuu/ai-fusion-video", "text": "public Map countAccessibleByUserGroupByType(Long userId, Long projectId, String keyword) { LambdaQueryWrapper wrapper = buildAccessibleQueryWrapper(userId, projectId, null, keyword); List all = assetMapper.selectList( wrapper.select(Asset::getType)); return all.stream().collect( Collectors.groupingBy(Asset::getType, Collectors.counting())); }", "tokens": 86} {"id": 564686, "source": "method", "repo": "Stonewuu/ai-fusion-video", "text": "public Long getCurrentTeamIdByUser(Long userId) { Long currentUserId = SecurityUtils.getCurrentUserId(); Long authenticatedTeamId = SecurityUtils.getCurrentTeamId(); if (currentUserId != null && currentUserId.equals(userId) && authenticatedTeamId != null && isUserInTeam(authenticatedTeamId, userId)) { return authenticatedTeamId; } TeamMember member = teamMemberMapper.selectOne(new LambdaQueryWrapper() .eq(TeamMember::getUserId, userId) .eq(TeamMember::getStatus, 1) .orderByAsc(TeamMember::getTeamId) .orderByAsc(TeamMember::getId) .last(\"LIMIT 1\")); return member != null ? member.getTeamId() : null; }", "tokens": 152} {"id": 564763, "source": "method", "repo": "Stonewuu/ai-fusion-video", "text": "void capabilityPresetDoesNotReplaceMissingSnapshotProtocolIdentity() { AiChatReqVO request = requestForScript(41L) .setAgentType(\"script_full_parse\"); model.setModelProtocol(null); model.setCapabilityPresetCode(\"gpt-image-1\"); AgentKernelSpec spec = factory.createRoot(request, model, \"root prompt\"); assertThatThrownBy(() -> new CanonicalAgentKernelSnapshotBuilder().build(spec)) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining(\"provider must not be blank\"); }", "tokens": 111} {"id": 564948, "source": "method", "repo": "stripe/stripe-java", "text": "public void setGeneratedCardObject(PaymentMethod expandableObject) { this.generatedCard = new ExpandableField(expandableObject.getId(), expandableObject); }", "tokens": 38} {"id": 564956, "source": "method", "repo": "stripe/stripe-java", "text": "/** Get ID of expandable {@code destinationPayment} object. */ public String getDestinationPayment() { return (this.destinationPayment != null) ? this.destinationPayment.getId() : null; }", "tokens": 43} {"id": 565063, "source": "method", "repo": "stripe/stripe-java", "text": "/** Required. Customer name. */ public Builder setName(EmptyParam name) { this.name = name; return this; }", "tokens": 33} {"id": 565091, "source": "method", "repo": "stripe/stripe-java", "text": "/** A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. */ public Builder setUnitLabel(String unitLabel) { this.unitLabel = unitLabel; return this; }", "tokens": 59} {"id": 565273, "source": "method", "repo": "stripe/stripe-java", "text": "private SpendingControls( List allowedCardPresences, List allowedCategories, List allowedMerchantCountries, List blockedCardPresences, List blockedCategories, List blockedMerchantCountries, Map extraParams, List spendingLimits, String spendingLimitsCurrency) { this.allowedCardPresences = allowedCardPresences; this.allowedCategories = allowedCategories; this.allowedMerchantCountries = allowedMerchantCountries; this.blockedCardPresences = blockedCardPresences; this.blockedCategories = blockedCategories; this.blockedMerchantCountries = blockedMerchantCountries; this.extraParams = extraParams; this.spendingLimits = spendingLimits; this.spendingLimitsCurrency = spendingLimitsCurrency; }", "tokens": 220} {"id": 565407, "source": "method", "repo": "stripe/stripe-java", "text": "/** Transitions a test mode created OutboundTransfer to the {@code failed} status. The OutboundTransfer must already be in the {@code processing} state. */ public OutboundTransfer fail(String outboundTransfer, OutboundTransferFailParams params) throws StripeException { return fail(outboundTransfer, params, (RequestOptions) null); }", "tokens": 71} {"id": 565443, "source": "method", "repo": "stripe/stripe-java", "text": "public void testSubscriptionsDeleteServices() throws StripeException { StripeClient client = new StripeClient(networkSpy); com.stripe.param.SubscriptionCancelParams params = com.stripe.param.SubscriptionCancelParams.builder().build(); com.stripe.model.Subscription subscription = client.v1().subscriptions().cancel(\"sub_xxxxxxxxxxxxx\", params); assertNotNull(subscription); verifyRequest( BaseAddress.API, ApiResource.RequestMethod.DELETE, \"/v1/subscriptions/sub_xxxxxxxxxxxxx\", params.toMap(), null); }", "tokens": 113} {"id": 565657, "source": "method", "repo": "structurizr/lite", "text": "static HmacAuthorizationHeader parse(String s) { String parts[] = s.split(\":\"); if (parts.length == 2) { String apiKey = parts[0]; String hmac = new String(Base64.getDecoder().decode(parts[1])); return new HmacAuthorizationHeader(apiKey, hmac); } else { throw new IllegalArgumentException(\"Invalid authorization header\"); } }", "tokens": 84} {"id": 565669, "source": "method", "repo": "structurizr/lite", "text": "public HttpUnauthorizedException(Throwable cause) { this(cause.getMessage()); }", "tokens": 17} {"id": 565874, "source": "method", "repo": "structurizr/onpremises", "text": "public AzureBlobStorageConfigurer(Properties properties) { super(properties); }", "tokens": 16} {"id": 566047, "source": "method", "repo": "structurizr/onpremises", "text": "public WorkspaceLockResponse lockWorkspace( @PathVariable(\"workspaceId\") long workspaceId, @RequestParam(required = true) String agent ) { WorkspaceMetaData workspaceMetaData = workspaceComponent.getWorkspaceMetaData(workspaceId); if (workspaceMetaData == null) { return new WorkspaceLockResponse(false, false); } User user = getUser(); if (!workspaceMetaData.isLocked() || workspaceMetaData.isLockedBy(user.getUsername(), agent)) { try { if (workspaceComponent.lockWorkspace(workspaceId, user.getUsername(), agent)) { return new WorkspaceLockResponse(true, true); } } catch (WorkspaceComponentException e) { log.error(e); } } // not locked - refresh the metadata and try to figure out why workspaceMetaData = workspaceComponent.getWorkspaceMetaData(workspaceId); if (workspaceMetaData.isLocked() && !workspaceMetaData.isLockedBy(user.getUsername(), agent)) { // locked by somebody else SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.USER_FRIENDLY_DATE_FORMAT); return new WorkspaceLockResponse(false, true, \"The workspace could not be locked; it was locked by \" + workspaceMetaData.getLockedUser() + \" using \" + workspaceMetaData.getLockedAgent() + \" at \" + sdf.format(workspaceMetaData.getLockedDate()) + \".\"); } else { // other problem :-) return new WorkspaceLockResponse(false, workspaceMetaData.isLocked(), \"The workspace could not be locked - please save your workspace and refresh the page.\"); } }", "tokens": 306} {"id": 566109, "source": "method", "repo": "structurizr/onpremises", "text": "public void test_isLockedBy_ReturnsTrue_WhenTheWorkspaceIsLockedByTheSpecifiedUserAndAgent() { WorkspaceMetaData workspaceMetaData = new WorkspaceMetaData(1); workspaceMetaData.setLockedUser(\"user\"); workspaceMetaData.setLockedAgent(\"agent\"); workspaceMetaData.setLockedDate(new Date()); assertTrue(workspaceMetaData.isLockedBy(\"user\", \"agent\")); }", "tokens": 75} {"id": 566127, "source": "method", "repo": "structurizr/onpremises", "text": "public void isUserOrRole_ReturnsTrue_WhenRoleMatchesARegex() { Set roles = new HashSet<>(); roles.add(\"group1-subgroup1\"); user = new User(\"user@example.com\", roles, AuthenticationMethod.LOCAL); // 4. regex match on role - true assertTrue(user.isUserOrRole(Collections.singleton(\"^group1-.*$\"))); }", "tokens": 87} {"id": 566248, "source": "method", "repo": "structurizr/onpremises", "text": "public void numberOfWorkspacesIsLessThanPageSize() { WorkspaceMetaData wmd1 = new WorkspaceMetaData(1); WorkspaceMetaData wmd2 = new WorkspaceMetaData(2); WorkspaceMetaData wmd3 = new WorkspaceMetaData(3); list = new PaginatedWorkspaceList(List.of(wmd1, wmd2, wmd3), 1, 5); assertEquals(3, list.getPageSize()); // page size has been modified assertEquals(1, list.getPageNumber()); assertEquals(1, list.getMaxPage()); assertFalse(list.hasPreviousPage()); assertFalse(list.hasNextPage()); assertEquals(3, list.getWorkspaces().size()); }", "tokens": 136} {"id": 566292, "source": "method", "repo": "structurizr/onpremises", "text": "public void showAuthenticatedTheme_ReturnsTheThemePage_WhenTheUserHasWriteAccess() { final WorkspaceMetaData workspaceMetaData = new WorkspaceMetaData(1); workspaceMetaData.addWriteUser(\"user1@example.com\"); controller.setWorkspaceComponent(new MockWorkspaceComponent() { @Override public WorkspaceMetaData getWorkspaceMetaData(long workspaceId) { return workspaceMetaData; } @Override public String getWorkspace(long workspaceId, String branch, String version) throws WorkspaceComponentException { return workspaceJson; } }); setUser(\"user1@example.com\"); String view = controller.showAuthenticatedTheme(1, \"main\", \"version\", model); assertEquals(\"json\", view); assertEquals(\"\"\" { \"name\" : \"Name\", \"description\" : \"Description\", \"elements\" : [ { \"tag\" : \"Person\", \"shape\" : \"Person\" } ] }\"\"\", model.getAttribute(\"json\")); }", "tokens": 183} {"id": 566426, "source": "method", "repo": "summersec/shiroattack2", "text": "public String getKey() { javax.crypto.KeyGenerator keygen = null; try { keygen = javax.crypto.KeyGenerator.getInstance(\"AES\"); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } SecretKey deskey = keygen.generateKey(); return Base64.encodeToString(deskey.getEncoded()); }", "tokens": 73} {"id": 566529, "source": "method", "repo": "summersec/shiroattack2", "text": "public static Object createTemplatesImpl(String classpayload) throws Exception { return Boolean.parseBoolean(System.getProperty(\"properXalan\", \"false\")) ? createTemplatesImpl(classpayload, Class.forName(\"org.apache.xalan.xsltc.trax.TemplatesImpl\"), Class.forName(\"org.apache.xalan.xsltc.runtime.AbstractTranslet\")) : createTemplatesImpl(classpayload, TemplatesImpl.class, AbstractTranslet.class); }", "tokens": 103} {"id": 566552, "source": "method", "repo": "summersec/shiroattack2", "text": "protected Class findClass(String name) throws ClassNotFoundException { try { return super.findClass(name); } catch(ClassNotFoundException e) { return StandardExecutorClassLoader.class.getClassLoader().loadClass(name); } }", "tokens": 47} {"id": 566605, "source": "method", "repo": "summersec/shiroattack2", "text": "public static byte[] encrypt(byte[] plainText, byte[] key) throws Exception { int ivSize = 16; byte[] iv = new byte[ivSize]; SecureRandom random = new SecureRandom(); random.nextBytes(iv); IvParameterSpec ivParameterSpec = new IvParameterSpec(iv); SecretKeySpec secretKeySpec = new SecretKeySpec(key, \"AES\"); Cipher cipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\"); cipher.init(1, secretKeySpec, ivParameterSpec); byte[] encrypted = cipher.doFinal(plainText); byte[] encryptedIvandtext = new byte[ivSize + encrypted.length]; System.arraycopy(iv, 0, encryptedIvandtext, 0, ivSize); System.arraycopy(encrypted, 0, encryptedIvandtext, ivSize, encrypted.length); return encryptedIvandtext; }", "tokens": 176} {"id": 566838, "source": "method", "repo": "summersec/shiroattack2", "text": "/** Constructs a new ShiroException. @param cause the underlying Throwable that caused this exception to be thrown. */ public ShiroException(Throwable cause) { super(cause); }", "tokens": 38} {"id": 566915, "source": "method", "repo": "summersec/shiroattack2", "text": "public static Object instantiate(Constructor ctor, Object... args) { try { return ctor.newInstance(args); } catch (Exception e) { String msg = \"Unable to instantiate Permission instance with constructor [\" + ctor + \"]\"; throw new InstantiationException(msg, e); } }", "tokens": 59} {"id": 566963, "source": "method", "repo": "summersec/shiroattack2", "text": "public int size() { processQueue(); // throw out garbage collected values first return map.size(); }", "tokens": 22} {"id": 567082, "source": "method", "repo": "sunagatov/online-store", "text": "public Optional getUrl(FileMetadataDto fileMetadataDto) { String logMessage = \"file.url.skipped: reason=aws_not_configured, bucket={}, key={}\"; log.debug(logMessage, fileMetadataDto.bucketName(), fileMetadataDto.fileName()); return Optional.empty(); }", "tokens": 65} {"id": 567118, "source": "method", "repo": "sunagatov/online-store", "text": "default BigDecimal roundAverageRatingValue(@Nullable BigDecimal averageRating) { return (averageRating == null) ? null : averageRating.setScale(1, RoundingMode.HALF_UP); }", "tokens": 38} {"id": 567124, "source": "method", "repo": "sunagatov/online-store", "text": "public ProductNotFoundException(final List productIds) { super(message(productIds)); this.productIds = List.copyOf(productIds); }", "tokens": 35} {"id": 567146, "source": "method", "repo": "sunagatov/online-store", "text": "protected boolean shouldNotFilter(@NonNull HttpServletRequest request) { return RateLimitRouteClassifier.shouldSkip(request); }", "tokens": 23} {"id": 567330, "source": "method", "repo": "sunagatov/online-store", "text": "private OwnerMessageDeliveryResult sendFallback( UUID messageId, SupportConversationEntity conversation, String text) { Optional sent = telegramBotClient.sendMessage(null, text); if (sent.isEmpty()) { return OwnerMessageDeliveryResult.failedResult(); } long telegramMessageId = sent.get().messageId(); storeTelegramMessageId(messageId, telegramMessageId); saveFallbackCorrelation(conversation, telegramMessageId); return OwnerMessageDeliveryResult.deliveredResult(telegramMessageId); }", "tokens": 101} {"id": 567375, "source": "method", "repo": "sunagatov/online-store", "text": "private void supersedeOlderInflightUploads(UUID userId, java.time.Instant now) { List uploadsToSupersede = repository.findByUserIdAndStatusIn(userId, DELETE_INVALIDATED_STATUSES).stream() .filter(upload -> !upload.isActive()) .toList(); if (uploadsToSupersede.isEmpty()) { return; } uploadsToSupersede.forEach(upload -> { upload.setActive(false); upload.setStatus(UserAvatarUploadStatus.SUPERSEDED); upload.setSupersededAt(now); enqueueSourceObjectDeletion(upload); enqueueProcessedObjectDeletion(upload); }); repository.saveAll(uploadsToSupersede); }", "tokens": 153} {"id": 567417, "source": "method", "repo": "sunagatov/online-store", "text": "void shouldConvertEmptyShoppingCartCorrectly() { ShoppingCart emptyCart = CartDtoTestStub.createEmptyShoppingCart(); Map productsById = Map.of(); ShoppingCartDto result = ShoppingCartDtoConverter.toDto(emptyCart, productsById); assertNotNull(result); assertEquals(emptyCart.getId(), result.getId()); assertEquals(emptyCart.getUserId(), result.getUserId()); assertEquals(0, result.getItems().size()); assertEquals(0, result.getItemsQuantity()); assertEquals(0, result.getProductsQuantity()); assertEquals(BigDecimal.ZERO, result.getItemsTotalPrice()); assertEquals(emptyCart.getCreatedAt(), result.getCreatedAt()); assertEquals(emptyCart.getClosedAt(), result.getClosedAt()); }", "tokens": 151} {"id": 567424, "source": "method", "repo": "sunagatov/online-store", "text": "void shouldReturnBadRequestWhenDeletingEmptyItemIdList() { AuthenticatedUser user = registerAndAuthenticateUser(); given(authenticatedJsonSpec(CartEndpoint.CART_URL, user.accessToken())) .body(\"\"\" { \"shoppingCartItemIds\": [] } \"\"\") .delete(\"/items\") .then() .statusCode(HttpStatus.BAD_REQUEST.value()); }", "tokens": 76} {"id": 567539, "source": "method", "repo": "sunagatov/online-store", "text": "void reusesPersistedCheckoutForSameIdempotencyKey() throws StripeException { AuthenticatedUser user = registerAndAuthenticateUser(); UUID userId = userLookupApi.getUserByEmail(user.email()).id(); addCartItem(user, PRODUCT_ID, 2); var firstResponse = given(authenticatedJsonSpec(\"/api/v1/payment\", user.accessToken())) .header(\"Idempotency-Key\", \"checkout-key-123\") .body(checkoutRequestJson()) .post(\"/checkout\") .then() .statusCode(HttpStatus.OK.value()) .extract() .jsonPath(); var secondResponse = given(authenticatedJsonSpec(\"/api/v1/payment\", user.accessToken())) .header(\"Idempotency-Key\", \"checkout-key-123\") .body(checkoutRequestJson()) .post(\"/checkout\") .then() .statusCode(HttpStatus.OK.value()) .extract() .jsonPath(); UUID orderId = UUID.fromString(firstResponse.getString(\"orderId\")); assertThat(secondResponse.getString(\"orderId\")).isEqualTo(orderId.toString()); assertThat(firstResponse.getString(\"stripeSessionId\")).isEqualTo(STRIPE_SESSION_ID); assertThat(secondResponse.getString(\"stripeSessionId\")).isEqualTo(STRIPE_SESSION_ID); assertThat(firstResponse.getString(\"checkoutUrl\")).isEqualTo(CHECKOUT_URL); assertThat(secondResponse.getString(\"checkoutUrl\")).isEqualTo(CHECKOUT_URL); Payment payment = paymentRepository .findByCheckoutIdempotencyKeyAndUserId(\"checkout-key-123\", userId) .orElseThrow(); assertThat(payment.getOrderId()).isEqualTo(orderId); assertThat(payment.getProviderSessionId()).isEqualTo(STRIPE_SESSION_ID); assertThat(payment.getStatus()).isEqualTo(PaymentStatus.STRIPE_SESSION_CREATED); assertThat(payment.getCurrency()).isEqualTo(\"usd\"); assertThat(payment.getAmountMinor()) .isEqualTo(BigDecimal.valueOf(15.98).movePointRight(2).longValueExact()); assertThat(paymentRepository.findAll().stream() .filter(saved -> userId.equals(saved.getUserId())) .count()) .isEqualTo(1); verify(stripeSessionGateway, times(1)).create(any(SessionCreateParams.class), anyString()); verify(stripeSessionGateway, times(1)).retrieve(STRIPE_SESSION_ID); }", "tokens": 492} {"id": 567553, "source": "method", "repo": "sunagatov/online-store", "text": "void saveStripeDetails_updatesPayment() { UUID paymentId = UUID.randomUUID(); Payment payment = Payment.builder().id(paymentId).status(PaymentStatus.CREATED).build(); when(paymentRepository.findById(paymentId)).thenReturn(Optional.of(payment)); when(paymentRepository.save(any())).thenAnswer(inv -> inv.getArgument(0)); service.saveStripeDetails(paymentId, new StripeSessionResult(\"cs_test_123\", \"https://checkout.stripe.com/...\")); assertThat(payment.getProviderSessionId()).isEqualTo(\"cs_test_123\"); assertThat(payment.getStatus()).isEqualTo(PaymentStatus.STRIPE_SESSION_CREATED); verify(paymentRepository).save(payment); }", "tokens": 164} {"id": 567667, "source": "method", "repo": "sunagatov/online-store", "text": "CorsConfigurationSource corsConfigurationSource() { return _ -> new CorsConfiguration(); }", "tokens": 21} {"id": 567671, "source": "method", "repo": "sunagatov/online-store", "text": "void logsDeniedEventsWithUnknownPrincipalWhenAuthenticationIsAbsent() { ListAppender appender = attachAppender(); MockHttpServletRequest request = new MockHttpServletRequest(\"GET\", \"/api/v1/admin\"); RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request)); var event = deniedEvent(null); listener.onAuthorizationDenied(event); assertThat(appender.list).singleElement().satisfies(loggingEvent -> { assertThat(loggingEvent.getLevel()).isEqualTo(Level.WARN); assertThat(loggingEvent.getFormattedMessage()) .isEqualTo(\"auth.denied: method=GET, path=/api/v1/admin, principal=unknown\"); }); }", "tokens": 138} {"id": 567700, "source": "method", "repo": "sunagatov/online-store", "text": "void validateNotBlacklistedThrowsWhenTokenIsBlacklisted() { when(temporaryStore.contains(\"jwt:blacklist:\" + service.hash(TOKEN))).thenReturn(true); assertThatThrownBy(() -> service.validateNotBlacklisted(TOKEN)) .isInstanceOf(JwtTokenBlacklistedException.class); }", "tokens": 58} {"id": 568449, "source": "method", "repo": "sweng-epfl/public", "text": "/** Constructs a ListAdapter with the specified list. @param list Representation of a binary tree. @throws IllegalArgumentException when the list is null or empty. */ public ListAdapter(List list) { // TODO throw new UnsupportedOperationException(\"Not implemented yet\"); }", "tokens": 57} {"id": 568594, "source": "method", "repo": "sweng-epfl/public", "text": "/** Uses `Server.uploadBatch` to upload the given texts, or cancels if 2 seconds have elapsed */ public static CompletableFuture upload(String[] texts) { // TODO: add cancellation to `Server.upload` and use it here var cancelFlag = new AtomicBoolean(false); return CompletableFuture.completedFuture(null); }", "tokens": 74} {"id": 568637, "source": "method", "repo": "sweng-epfl/public", "text": "/** Uploads using `Server.upload` the weather given by `Weather.today` */ public static CompletableFuture uploadTodaysWeather() { return Weather.today().thenCompose(Server::upload); }", "tokens": 46} {"id": 568810, "source": "method", "repo": "sweng-epfl/public", "text": "/** {@inheritDoc} */ public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Story story = (Story) o; return Objects.equals(id, story.id) && Objects.equals(title, story.title) && Objects.equals(url, story.url); }", "tokens": 82} {"id": 568968, "source": "method", "repo": "sweng-epfl/public", "text": "void useOfAssertAll() { Assertions.assertAll( () -> AppPartiallyCovered.main(true), () -> assertThat(new App(), is(not(nullValue()))) ); }", "tokens": 41} {"id": 569078, "source": "method", "repo": "symgraph/GhidrAssist", "text": "/** Get all registered factories @return Map of provider types to their factories */ public Map getRegisteredFactories() { return new HashMap<>(factories); }", "tokens": 40} {"id": 569251, "source": "method", "repo": "symgraph/GhidrAssist", "text": "/** Create a new streaming renderer. @param updateCallback Callback to receive render updates (called on EDT) @param markdownHelper Helper for markdown-to-HTML conversion */ public StreamingMarkdownRenderer(Consumer updateCallback, MarkdownHelper markdownHelper) { this.updateCallback = updateCallback; this.markdownHelper = markdownHelper; }", "tokens": 73} {"id": 569421, "source": "method", "repo": "symgraph/GhidrAssist", "text": "public CompletableFuture executeTool(String name, JsonObject args) { MCPTool tool = findTool(name); if (tool == null) { return CompletableFuture.completedFuture( ToolResult.error(\"MCP tool not found: \" + name)); } MCPClientAdapter client = clients.get(tool.getServerName()); if (client == null || !client.isReady()) { return CompletableFuture.completedFuture( ToolResult.error(\"MCP server not available: \" + tool.getServerName())); } // Use the original tool name (without server prefix) when calling the MCP server String originalToolName = tool.getName(); Msg.debug(this, \"Executing MCP tool: \" + name + \" (original: \" + originalToolName + \") via server: \" + tool.getServerName()); return client.executeTool(originalToolName, args) .thenApply(result -> { String content = result != null ? result.toString() : \"\"; return ToolResult.success(content); }) .exceptionally(throwable -> { Msg.error(this, \"MCP tool execution failed: \" + throwable.getMessage()); return ToolResult.error(throwable.getMessage()); }); }", "tokens": 246} {"id": 569627, "source": "method", "repo": "symgraph/GhidrAssistMCP", "text": "public void onProgramActivated(Program program) { // Program activation is now handled dynamically - no caching needed if (program != null) { Msg.info(this, \"Program activated: \" + program.getName()); // Notify listeners for logging purposes notifySessionEvent(\"Program activated: \" + program.getName()); } }", "tokens": 67} {"id": 569714, "source": "method", "repo": "symgraph/GhidrAssistMCP", "text": "public void setCurrentProgram(Program program) { backend.onProgramActivated(program); }", "tokens": 20} {"id": 569719, "source": "method", "repo": "symgraph/GhidrAssistMCP", "text": "public synchronized void unsubscribe(Consumer listener) { listeners.remove(listener); }", "tokens": 21} {"id": 569745, "source": "method", "repo": "symgraph/GhidrAssistMCP", "text": "/** Clear the entire cache */ public void clear() { int size = cache.size(); cache.clear(); evictionCount.addAndGet(size); Msg.info(this, \"Cache cleared, removed \" + size + \" entries\"); }", "tokens": 50} {"id": 569911, "source": "method", "repo": "symgraph/GhidrAssistMCP", "text": "static Map objectMap(Object value) { if (!(value instanceof Map rawMap)) { return null; } Map result = new LinkedHashMap<>(); for (Map.Entry entry : rawMap.entrySet()) { if (entry.getKey() != null) { result.put(entry.getKey().toString(), entry.getValue()); } } return result; }", "tokens": 86} {"id": 569935, "source": "method", "repo": "symgraph/GhidrAssistMCP", "text": "private static AssembledBlock assembleBytes(Assembler assembler, Address address, String[] lines) throws AssemblySyntaxException, AssemblySemanticException, AddressOverflowException { ByteArrayOutputStream out = new ByteArrayOutputStream(); Address nextAddress = address; for (String line : lines) { byte[] lineBytes = assembler.assembleLine(nextAddress, line); out.write(lineBytes, 0, lineBytes.length); if (lineBytes.length > 0) { nextAddress = nextAddress.addNoWrap(lineBytes.length); } } byte[] bytes = out.toByteArray(); if (bytes.length == 0) { return new AssembledBlock(bytes, address); } Address endAddress = address.addNoWrap(bytes.length - 1L); return new AssembledBlock(bytes, endAddress); }", "tokens": 178} {"id": 570059, "source": "method", "repo": "symgraph/GhidrAssistMCP", "text": "/** Get disassembly for a function. */ private McpSchema.CallToolResult getDisassemblyCode(Program program, Function function, TaskMonitor monitor) { StringBuilder result = new StringBuilder(); result.append(\"Disassembly of function: \").append(function.getName(true)).append(\"\\n\"); result.append(\"Entry Point: \").append(function.getEntryPoint()).append(\"\\n\\n\"); // Iterate through instructions in the function InstructionIterator instrIter = program.getListing().getInstructions(function.getBody(), true); int instructionCount = 0; while (instrIter.hasNext()) { if (monitor.isCancelled()) { return cancelledResult(); } Instruction instruction = instrIter.next(); result.append(instruction.getAddress()).append(\": \"); result.append(instruction.getMnemonicString()); // Add operands for (int i = 0; i < instruction.getNumOperands(); i++) { if (i == 0) { result.append(\" \"); } else { result.append(\", \"); } result.append(instruction.getDefaultOperandRepresentation(i)); } // Add any comments String comment = instruction.getComment(CommentType.EOL); if (comment != null && !comment.trim().isEmpty()) { result.append(\" ; \").append(comment.trim()); } result.append(\"\\n\"); instructionCount++; } result.append(\"\\nTotal instructions: \").append(instructionCount); return McpSchema.CallToolResult.builder() .addTextContent(result.toString()) .build(); }", "tokens": 322} {"id": 570169, "source": "method", "repo": "symgraph/GhidrAssistMCP", "text": "public String getName() { return \"open_program\"; }", "tokens": 13} {"id": 570829, "source": "method", "repo": "tabulapdf/tabula-java", "text": "public void testExtractWithMultiplePercentArea() throws ParseException, IOException { String expectedCsv = UtilsForTesting.loadCsv(\"src/test/resources/technology/tabula/csv/MultiColumn.csv\"); assertEquals(expectedCsv, this.csvFromCommandLineArgs(new String[]{ \"src/test/resources/technology/tabula/MultiColumn.pdf\", \"-p\", \"1\", \"-a\", \"%0,0,100,50\", \"-a\", \"%0,50,100,100\", \"-f\", \"CSV\" })); }", "tokens": 123} {"id": 570891, "source": "method", "repo": "tabulapdf/tabula-java", "text": "public void testLinesToCells() { List cells = SpreadsheetExtractionAlgorithm.findCells(Arrays.asList(HORIZONTAL_RULING_LINES), Arrays.asList(VERTICAL_RULING_LINES)); Collections.sort(cells, Rectangle.ILL_DEFINED_ORDER); List expected = Arrays.asList(EXPECTED_CELLS); Collections.sort(expected, Rectangle.ILL_DEFINED_ORDER); assertTrue(cells.equals(expected)); }", "tokens": 99} {"id": 571218, "source": "method", "repo": "tamboui/tamboui", "text": "/** Returns an empty property map. @return an empty property map */ public static TypedPropertyMap empty() { return EMPTY; }", "tokens": 27} {"id": 571227, "source": "method", "repo": "tamboui/tamboui", "text": "/** Creates a closing bracket token. @param position the source position */ public CloseBracket(Position position) { super(position); }", "tokens": 28} {"id": 571351, "source": "method", "repo": "tamboui/tamboui", "text": "/** Rounds a float value to the nearest integer. @param x the value to round @return the nearest integer to {@code x} */ public static float round(float x) { return java.lang.Math.round(x); }", "tokens": 52} {"id": 571381, "source": "method", "repo": "tamboui/tamboui", "text": "private static String formatUptime(long seconds) { var d = Duration.ofSeconds(seconds); var days = d.toDays(); long hours = d.toHoursPart(); long minutes = d.toMinutesPart(); if (days > 0) { return String.format(\"%dd %02d:%02d\", days, hours, minutes); } return String.format(\"%02d:%02d:%02d\", hours, minutes, d.toSecondsPart()); }", "tokens": 109} {"id": 571874, "source": "method", "repo": "tamboui/tamboui", "text": "void returnsEmptyForNullOrEmpty() { assertThat(SpinnerFrameSetConverter.INSTANCE.convert(null)).isEmpty(); assertThat(SpinnerFrameSetConverter.INSTANCE.convert(\"\")).isEmpty(); assertThat(SpinnerFrameSetConverter.INSTANCE.convert(\" \")).isEmpty(); }", "tokens": 55} {"id": 572047, "source": "method", "repo": "taoofagi/easegen-admin", "text": "public CommonResult updateCustomerLimitConfig(@Valid @RequestBody CrmCustomerLimitConfigSaveReqVO updateReqVO) { customerLimitConfigService.updateCustomerLimitConfig(updateReqVO); return success(true); }", "tokens": 41} {"id": 572064, "source": "method", "repo": "taoofagi/easegen-admin", "text": "private CrmClueDO validateClueExists(Long id) { CrmClueDO crmClueDO = clueMapper.selectById(id); if (crmClueDO == null) { throw exception(CLUE_NOT_EXISTS); } return crmClueDO; }", "tokens": 64} {"id": 572197, "source": "method", "repo": "taoofagi/easegen-admin", "text": "default BargainRecordDO selectByIdAndUserId(Long id, Long userId) { return selectOne(BargainRecordDO::getId, id, BargainRecordDO::getUserId, userId); }", "tokens": 40} {"id": 572877, "source": "method", "repo": "tcplugins/tcwebhooks", "text": "public void testEmptyTemplateSupportsFormatAndState() { SBuildServer server = mock(SBuildServer.class); SBuildType build = new MockSBuildType(\"test\", \"something else\", \"build01\"); SProject project = new MockSProject(\"test\", \"something\", \"project01\", \"MyProject\", build); WebHookPayloadManager payloadManager = new WebHookPayloadManager(server); WebHookTemplateManager templateManager = new WebHookTemplateManager(payloadManager, new WebHookTemplateJaxHelperImpl(), null); WebHookTemplateResolver resolver = new WebHookTemplateResolver(templateManager, payloadManager); WebHookPayloadTemplate template = new LegacyEmptyWebHookTemplate(templateManager); template.register(); assertTrue(resolver.templateSupportsFormatAndState(BuildStateEnum.BUILD_STARTED, project, \"legacy-empty\")); assertTrue(resolver.templateSupportsFormatAndState(BuildStateEnum.BUILD_INTERRUPTED, project, \"legacy-empty\")); assertTrue(resolver.templateSupportsFormatAndState(BuildStateEnum.BEFORE_BUILD_FINISHED, project, \"legacy-empty\")); assertTrue(resolver.templateSupportsFormatAndState(BuildStateEnum.BUILD_BROKEN, project, \"legacy-empty\")); assertTrue(resolver.templateSupportsFormatAndState(BuildStateEnum.BUILD_FIXED, project, \"legacy-empty\")); assertTrue(resolver.templateSupportsFormatAndState(BuildStateEnum.BUILD_FAILED, project, \"legacy-empty\")); assertTrue(resolver.templateSupportsFormatAndState(BuildStateEnum.BUILD_SUCCESSFUL, project, \"legacy-empty\")); }", "tokens": 316} {"id": 573081, "source": "method", "repo": "tcplugins/tcwebhooks", "text": "public List findBuildInstancesByBuildNumber(String buildTypeId, String buildNumber) { // TODO Auto-generated method stub return null; }", "tokens": 34} {"id": 573134, "source": "method", "repo": "tcplugins/tcwebhooks", "text": "public Webhooks() { // TODO Auto-generated constructor stub }", "tokens": 14} {"id": 573230, "source": "method", "repo": "tcplugins/tcwebhooks", "text": "public static ProjectTemplatesBean newInstance(SProject project, List templates) { if (templates != null) { return new ProjectTemplatesBean(project, templates); } else { return new ProjectTemplatesBean(project, new ArrayList<>()); } }", "tokens": 54} {"id": 573364, "source": "method", "repo": "tduckcloud/tduck-platform", "text": "public List listThemeCategories() { return formThemeCategoryMapper.selectList(null); }", "tokens": 26} {"id": 573381, "source": "method", "repo": "tduckcloud/tduck-platform", "text": "public Boolean checkPhoneCode(String phoneNumber, String code) { String phoneCodeKey = StrUtil.format(FormRedisKeyConstants.PHONE_NUMBER_CODE, phoneNumber); String validateCode = timedCache.get(phoneCodeKey); if (code.equals(validateCode)) { timedCache.remove(phoneCodeKey); return true; } return false; }", "tokens": 76} {"id": 573489, "source": "method", "repo": "teamgalacticraft/galacticraft", "text": "public void renderGUI(GuiGraphics graphics, int x, int y, int mouseX, int mouseY, float delta) { if (!hasWarned) { hasWarned = true; Constant.LOGGER.warn(\"EmptyRocketPartRenderer renderer is in use! RocketPartRenderer wasn't registered?\"); } }", "tokens": 64} {"id": 573567, "source": "method", "repo": "teamgalacticraft/galacticraft", "text": "/** Called after GL render context has been created should be safe to do general initialization here. */ public static void init() { var helper = ResourceManagerHelper.get(PackType.CLIENT_RESOURCES); helper.registerReloadListener(RocketTextureManager.INSTANCE); helper.registerReloadListener(GCModelLoader.INSTANCE); helper.registerReloadListener(GCResourceReloadListener.INSTANCE); GCModelLoader.registerModelType(UnbakedObjModel.TYPE); GCDimensionEffects.register(); }", "tokens": 99} {"id": 573732, "source": "method", "repo": "teamgalacticraft/galacticraft", "text": "public Optional getSoundFromEntity(BlockEntity entity, MachineStatus status, boolean isActive) { for (var activeSound : this.activeSounds) { if (activeSound.machine == entity && Objects.equals(GCSoundMap.get(status, (MachineBlockEntity) entity), activeSound.event)) { return Optional.of(activeSound); } } return Optional.empty(); }", "tokens": 85} {"id": 573784, "source": "method", "repo": "teamgalacticraft/galacticraft", "text": "public RecipeType getRecipeType() { return GCJEIRecipeTypes.ELECTRIC_SMELTING; }", "tokens": 28} {"id": 574043, "source": "method", "repo": "teamgalacticraft/galacticraft", "text": "public SlotAccess getSlot(int mappedIndex) { return SlotAccess.forContainer(this.inventory, mappedIndex); }", "tokens": 27} {"id": 574259, "source": "method", "repo": "teamgalacticraft/galacticraft", "text": "public void addChildren(StructurePiece componentIn, StructurePieceAccessor listIn, RandomSource rand) { boolean validAttempt = false; final int maxAttempts = 10; int attempts = 0; while (!validAttempt && attempts < maxAttempts) { attachedComponents.clear(); componentBounds.clear(); componentBounds.add(this.boundingBox); // listIn.clear(); listIn.addPiece(this); DungeonPiece next = getNextPiece(this, rand); while (next != null) { listIn.addPiece(next); attachedComponents.add(next); componentBounds.add(next.getBoundingBox()); next = next.getNextPiece(this, rand); } if (attachedComponents.size() >= 3 && attachedComponents.get(attachedComponents.size() - 1) instanceof RoomTreasure && attachedComponents.get(attachedComponents.size() - 3) instanceof RoomBoss) { validAttempt = true; } attempts++; } Constant.LOGGER.debug(\"Dungeon generation took \" + attempts + \" attempt(s)\"); if (!validAttempt) { int xPos = this.boundingBox.minX() + (this.boundingBox.maxX() - this.boundingBox.minX()) / 2; int zPos = this.boundingBox.minZ() + (this.boundingBox.maxZ() - this.boundingBox.minZ()) / 2; System.err.println(\"Could not find valid dungeon layout! This is a bug, please report it, including your world seed (/seed) and dungeon location (\" + xPos + \", \" + zPos + \")\"); } super.addChildren(componentIn, listIn, rand); }", "tokens": 351} {"id": 574317, "source": "method", "repo": "teamgalacticraft/galacticraft", "text": "public BasicSolarPanelTestSuite() { super(GCBlocks.BASIC_SOLAR_PANEL); }", "tokens": 21} {"id": 574427, "source": "method", "repo": "teammidnightdust/midnightcontrols", "text": "/** Handles compatibility of a mod. @param mod this mod instance */ default void handle(@NotNull MidnightControlsClient mod) {}", "tokens": 26} {"id": 574440, "source": "method", "repo": "teammidnightdust/midnightcontrols", "text": "public static boolean isEMIEnabled() { return EmiConfig.enabled; }", "tokens": 16} {"id": 574506, "source": "method", "repo": "teammidnightdust/midnightcontrols", "text": "/** Puts a cooldown on the {@link ButtonBinding}. @return the builder instance @since 1.5.0 */ public Builder cooldown() { return this.cooldown(true); }", "tokens": 40} {"id": 574563, "source": "method", "repo": "teammidnightdust/midnightcontrols", "text": "public static ButtonCategory registerCategory(@NotNull Identifier identifier) { return registerCategory(new ButtonCategory(identifier)); }", "tokens": 24} {"id": 574642, "source": "method", "repo": "teammidnightdust/midnightcontrols", "text": "protected void init() { super.init(); if (ring.getMaxPages() > 1) { this.addRenderableWidget(Button.builder(Component.nullToEmpty(\"\u25c0\"), button -> ring.cyclePage(false)).bounds(5, 5, 20, 20).build()); this.addRenderableWidget(Button.builder(Component.nullToEmpty(\"\u25b6\"), button -> ring.cyclePage(true)).bounds(width - 25, 5, 20, 20).build()); } }", "tokens": 112} {"id": 575054, "source": "method", "repo": "TeamOpenSmartGlasses/AugmentOS", "text": "/** Get all registered MIME types @return Map of extensions to MIME types */ public Map getAllMimeTypes() { return new HashMap<>(mimeTypeMap); }", "tokens": 38} {"id": 575169, "source": "method", "repo": "TeamOpenSmartGlasses/AugmentOS", "text": "/** Prefer an exact-base delta; a full OTA is eligible only for a known older version. */ public static JSONObject select(JSONObject manifest, String currentVersion) { return select(manifest, currentVersion, null); }", "tokens": 47} {"id": 575281, "source": "method", "repo": "TeamOpenSmartGlasses/AugmentOS", "text": "public void setEnabled(boolean enabled) { this.isEnabled = enabled; Log.i(TAG, \"Crashlytics \" + (enabled ? \"enabled\" : \"disabled\")); }", "tokens": 40} {"id": 575350, "source": "method", "repo": "TeamOpenSmartGlasses/AugmentOS", "text": "/** Request BES chip trace buffer logs and print them to logcat. Pass a non-null incidentId to also upload to the incident backend as \"glasses_firmware\". */ public void requestBesLogs( String incidentId, android.content.Context context, IConfigurationManager configManager) { if (k900CommandHandler != null) { k900CommandHandler.requestBesLogs(incidentId, context, configManager); } else { Log.w(TAG, \"\u26a0\ufe0f K900CommandHandler not available \u2014 cannot request BES logs\"); } }", "tokens": 119} {"id": 575437, "source": "method", "repo": "TeamOpenSmartGlasses/AugmentOS", "text": "public void wholePhotoRetryInvalidatesOldRecoveryAndRestartsAtZero() throws Exception { atReportedStall(); manager.handleFileTransferAck(0, 120); Runnable oldRecovery = timers.get(timers.size() - 1); set(session, \"highestSentIndex\", 199); set(session, \"waitingForPhoneConfirmation\", true); manager.handlePhoneConfirmation(\"photo.jpg\", false); assertEquals(8, get(session, \"currentPacketIndex\")); assertEquals(-1, get(session, \"highestAckedIndex\")); assertEquals(false, get(manager, \"failureRetryScheduled\")); verify(uart, times(8)).runFileWrite(any(), any()); oldRecovery.run(); verify(uart, times(8)).runFileWrite(any(), any()); }", "tokens": 171} {"id": 575491, "source": "method", "repo": "TeamOpenSmartGlasses/AugmentOS", "text": "public void reconciliationKeepsPreviouslyPausedStationNetworksDisabled() { android.content.pm.PackageInfo info; try { info = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); } catch (android.content.pm.PackageManager.NameNotFoundException e) { throw new AssertionError(e); } info.applicationInfo.flags |= ApplicationInfo.FLAG_SYSTEM; shadowOf(context.getPackageManager()).installPackage(info); context.getSharedPreferences(\"station_autojoin_pause\", Context.MODE_PRIVATE) .edit() .putStringSet(\"paused_network_ids\", java.util.Collections.singleton(\"7\")) .commit(); manager = new NativeHotspot(context); manager.gateway = \"192.168.43.1\"; manager.startHotspot(); manager.gateway = \"\"; manager.apState = 13; manager.startHotspot(); advance(400); assertThat( context.getSharedPreferences(\"station_autojoin_pause\", Context.MODE_PRIVATE) .getStringSet( \"paused_network_ids\", java.util.Collections.emptySet())) .containsExactly(\"7\"); manager.stopHotspot(); assertThat( context.getSharedPreferences(\"station_autojoin_pause\", Context.MODE_PRIVATE) .getStringSet( \"paused_network_ids\", java.util.Collections.emptySet())) .isEmpty(); }", "tokens": 297} {"id": 575503, "source": "method", "repo": "TeamOpenSmartGlasses/AugmentOS", "text": "public void phoneBesInstallPassesGuardToControllerWithoutPhonePresenceGate() { StubRegistry registry = new StubRegistry(); IBesOtaController controller = mock(IBesOtaController.class); ValidatedBesArtifact artifact = mock(ValidatedBesArtifact.class); when(controller.startFirmwareUpdateWithInstallGuard( any(), anyString(), any(JSONObject.class))) .thenReturn(true); registry.setInstance(controller); OtaHelper helper = newHelper(registry); OtaHelper.PhoneConnectionProvider provider = mock(OtaHelper.PhoneConnectionProvider.class); helper.setPhoneConnectionProvider(provider); clearInvocations(provider, controller); assertThat(helper.startBesFirmwareInstall(controller, artifact, \"ota-owner\")).isTrue(); verify(controller) .startFirmwareUpdateWithInstallGuard( eq(artifact), eq(\"ota-owner\"), argThat( status -> \"bes\".equals(status.optString(\"step_type\")) && \"install\".equals(status.optString(\"phase\")) && \"in_progress\".equals( status.optString(\"status\")))); verifyNoInteractions(provider); }", "tokens": 229} {"id": 575849, "source": "method", "repo": "techa03/goodskill", "text": "public ActorsFilms() { }", "tokens": 10} {"id": 575869, "source": "method", "repo": "techa03/goodskill", "text": "public MinioStorageServiceImpl(MinioClient minioClient) { this.minioClient = minioClient; }", "tokens": 20} {"id": 576023, "source": "method", "repo": "techa03/goodskill", "text": "public Result addRole(int userId, int roleId) { return restClient.post() .uri(\"/user/role/add?userId={userId}&roleId={roleId}\", userId, roleId) .retrieve() .body(Result.class); }", "tokens": 58} {"id": 576042, "source": "method", "repo": "techa03/goodskill", "text": "public String toAddSeckillPage() { return \"seckill/addSeckill\"; }", "tokens": 17} {"id": 576098, "source": "method", "repo": "techa03/goodskill", "text": "void testGetGoodsByIdSuccess() { // Given Goods goods = new Goods(); goods.setGoodsId(1); when(goodsService.getById(1)).thenReturn(goods); // When Result result = goodsController.getGoodsById(1); // Then assertEquals(Result.SUCCESS, result.getCode()); assertNotNull(result.getData()); verify(goodsService, times(1)).getById(1); }", "tokens": 91} {"id": 576140, "source": "method", "repo": "techa03/goodskill", "text": "void testHandleWithDifferentSeckillId() { request.setSeckillId(2000L); when(stateMachineService.feedMachine(Events.ACTIVITY_RESET, 2000L)).thenReturn(true); when(stateMachineService.feedMachine(Events.ACTIVITY_START, 2000L)).thenReturn(true); handler.handle(request); verify(stateMachineService, times(1)).initStateMachine(2000L); verify(stateMachineService, times(1)).feedMachine(Events.ACTIVITY_RESET, 2000L); verify(stateMachineService, times(1)).feedMachine(Events.ACTIVITY_START, 2000L); }", "tokens": 147} {"id": 576252, "source": "method", "repo": "techreborn/techreborn", "text": "public void drawCentredText(GuiGraphicsExtractor drawContext, Component text, int y, int colour, Layer layer) { drawText(drawContext, text, (imageWidth / 2 - getFont().width(text) / 2), y, colour, layer); }", "tokens": 57} {"id": 576380, "source": "method", "repo": "techreborn/techreborn", "text": "public void syncChunkLoaderToClient(ServerPlayer serverPlayerEntity, BlockPos chunkLoader){ syncToClient(serverPlayerEntity, loadedChunks.stream().filter(loadedChunk -> loadedChunk.chunkLoader().equals(chunkLoader)).collect(Collectors.toList())); }", "tokens": 52} {"id": 576485, "source": "method", "repo": "techreborn/techreborn", "text": "public void resetMuffler() { parentUpgradeHandler.ifPresent(IUpgradeHandler::resetMuffler); }", "tokens": 25} {"id": 576651, "source": "method", "repo": "techreborn/techreborn", "text": "public Codec valueCodec() { return VALUE_CODEC; }", "tokens": 18} {"id": 576699, "source": "method", "repo": "techreborn/techreborn", "text": "private static void testInactiveReactorDoesNotConsumeFuel(ClientTestHarness test) { placeReactor(test); test.onServer(server -> { NuclearReactorBlockEntity reactor = reactor(server); reactor.setItemAt(0, 0, new ItemStack(TRContent.NuclearReactorComponents.URANIUM_FUEL_ROD)); reactor.setChanged(); }); test.waitTicks(30); test.assertServer(server -> { NuclearReactorBlockEntity reactor = reactor(server); return reactor.getEuPerTick() == 0 && reactor.getHeat() == 0 && reactor.getItemAt(0, 0).getOrDefault(TRDataComponentTypes.STORED_HEAT, 0) == 0; }, \"Unpowered nuclear reactor consumed fuel or generated heat/energy\"); test.openUi(REACTOR_POS, NuclearReactorBlockEntity.class, \"nuclear-inactive-fuel-preserved\"); }", "tokens": 192} {"id": 576826, "source": "method", "repo": "techreborn/techreborn", "text": "public BlockEntityScreenHandlerBuilder syncNbt(BlockEntityScreenHandlerBuilder builder) { return builder.sync(SyncedObjectTypes.INT, this::getPlaceTime, this::setPlaceTime) .sync(SyncedObjectTypes.INT, this::getCurrentPlaceTime, this::setCurrentPlaceTime) .sync(SyncedObjectTypes.INT, this::getStatus, this::setStatus); }", "tokens": 78} {"id": 577045, "source": "method", "repo": "techreborn/techreborn", "text": "private void playEmptyingSound(@Nullable Player playerEntity, LevelAccessor world, BlockPos blockPos, Fluid fluid) { SoundEvent soundEvent = fluid.is(FluidTags.LAVA) ? SoundEvents.BUCKET_EMPTY_LAVA : SoundEvents.BUCKET_EMPTY; world.playSound(playerEntity, blockPos, soundEvent, SoundSource.BLOCKS, 1.0F, 1.0F); }", "tokens": 83} {"id": 577074, "source": "method", "repo": "techreborn/techreborn", "text": "/** Calculate heat transfer based on fill percentages. Heat flows from higher % to lower %. @param currentHeat exchanger's current heat @param maxHeat exchanger's max heat @param targetHeat target component's current heat @param targetMax target component's max heat @param maxTransfer maximum transfer rate (componentTransfer or reactorTransfer) @return positive = send to target, negative = receive from target */ private int calculateTransfer(int currentHeat, int maxHeat, int targetHeat, int targetMax, int maxTransfer) { double currentPercent = currentHeat * 100.0 / maxHeat; double targetPercent = targetHeat * 100.0 / targetMax; double combinedPercent = targetPercent + currentPercent / 2.0; // Cap at maxTransfer int transfer = Math.min((int) (targetMax / 100.0 * combinedPercent), maxTransfer); // Throttle at low combinedPercent percentages // Divisors are 8,4,2 for steps 1,2,3 = 2^(4-step) int step = Math.min((int) (combinedPercent / 0.25), 4); if (step == 0) transfer = 1; else if (step < 4) transfer = maxTransfer >> (4 - step); double currentRounded = Math.round(currentPercent * 10.0) / 10.0; double targetRounded = Math.round(targetPercent * 10.0) / 10.0; if (targetRounded > currentRounded) return -transfer; // Receive from target if (targetRounded == currentRounded) return 0; // Equal, no transfer return transfer; // Send to target }", "tokens": 379} {"id": 577155, "source": "method", "repo": "tencentyun/cos-java-sdk-v5", "text": "public BucketTaggingConfiguration getBucketTaggingConfiguration(GetBucketTaggingConfigurationRequest getBucketTaggingConfigurationRequest) { rejectNull(getBucketTaggingConfigurationRequest, \"The request object parameter getBucketTaggingConfigurationRequest must be specifed.\"); String bucketName = getBucketTaggingConfigurationRequest.getBucketName(); rejectNull(bucketName, \"The bucket name must be specified when retrieving the bucket tagging configuration.\"); CosHttpRequest request = createRequest(bucketName, null, getBucketTaggingConfigurationRequest, HttpMethodName.GET); request.addParameter(\"tagging\", null); try { return invoke(request, new Unmarshallers.BucketTaggingConfigurationUnmarshaller()); } catch (CosServiceException ase) { switch (ase.getStatusCode()) { case 404: return null; default: throw ase; } } }", "tokens": 171} {"id": 577181, "source": "method", "repo": "tencentyun/cos-java-sdk-v5", "text": "public AbstractCOSCachedCredentialsProvider(long refreshPeriodSeconds) { super(); if (refreshPeriodSeconds <= 0) { throw new IllegalArgumentException(\"refreshPeriodSeconds must be positive num\"); } this.refreshPeriodSeconds = refreshPeriodSeconds; executors = Executors.newScheduledThreadPool(1, new ThreadFactory() { public Thread newThread(Runnable r) { Thread t = Executors.defaultThreadFactory().newThread(r); t.setName(\"credentials-refresh-daemon\"); t.setDaemon(true); return t; } }); executors.scheduleWithFixedDelay(new Runnable() { @Override public void run() { if (ifNeedToRefreshCredentials()) { updateCOSCredentials(); } } }, 0, refreshPeriodSeconds, TimeUnit.SECONDS); }", "tokens": 158} {"id": 577203, "source": "method", "repo": "tencentyun/cos-java-sdk-v5", "text": "public final InputStream getWrappedInputStream() { return in; }", "tokens": 13} {"id": 577310, "source": "method", "repo": "tencentyun/cos-java-sdk-v5", "text": "public Message(Map headers, byte[] payload) { this.headers = headers; this.payload = payload.clone(); }", "tokens": 33} {"id": 577383, "source": "method", "repo": "tencentyun/cos-java-sdk-v5", "text": "/** Constructs a new {@link ListObjectsRequest} object and initializes all required and optional object fields. @param bucketName The name of the bucket whose objects are to be listed. @param prefix The prefix restricting what keys will be listed. @param marker The key marker indicating where listing results should begin. @param delimiter The delimiter for condensing common prefixes in the returned listing results. @param maxKeys The maximum number of results to return. @see ListObjectsRequest#ListObjectsRequest() */ public ListObjectsRequest(String bucketName, String prefix, String marker, String delimiter, Integer maxKeys) { setBucketName(bucketName); setPrefix(prefix); setMarker(marker); setDelimiter(delimiter); setMaxKeys(maxKeys); }", "tokens": 154} {"id": 577406, "source": "method", "repo": "tencentyun/cos-java-sdk-v5", "text": "public String toString() { return algorithm; }", "tokens": 10} {"id": 577472, "source": "method", "repo": "tencentyun/cos-java-sdk-v5", "text": "public void setTranscode(MediaTranscodeObject transcode) { this.transcode = transcode; }", "tokens": 24} {"id": 577567, "source": "method", "repo": "tencentyun/cos-java-sdk-v5", "text": "public String toString() { return \"MediaContainerObject{\" + \"format='\" + format + '\\'' + '}'; }", "tokens": 23} {"id": 577570, "source": "method", "repo": "tencentyun/cos-java-sdk-v5", "text": "public MediaSnapshotObject getSnapshot() { if (snapshot == null) { snapshot = new MediaSnapshotObject(); } return snapshot; }", "tokens": 28} {"id": 577881, "source": "method", "repo": "terraformersmc/modmenu", "text": "public Set getDefaultValue() { return defaultValue; }", "tokens": 14} {"id": 577940, "source": "method", "repo": "terraformersmc/modmenu", "text": "public int addEntry(ModListEntry entry) { if (addedMods.contains(entry.mod)) { return 0; } addedMods.add(entry.mod); int i = super.addEntry(entry); if (entry.getMod().getId().equals(selectedModId)) { setSelected(entry); } return i; }", "tokens": 72} {"id": 578035, "source": "method", "repo": "terraformersmc/modmenu", "text": "public static String removeBuildMetadata(String version) { return version.split(\"\\\\+\")[0]; }", "tokens": 23} {"id": 578047, "source": "method", "repo": "terraformersmc/modmenu", "text": "public ModBadgeRenderer(int startX, int startY, int endX, Mod mod, ModsScreen screen) { this.startX = startX; this.startY = startY; this.badgeMax = endX; this.mod = mod; this.screen = screen; this.client = Minecraft.getInstance(); }", "tokens": 68} {"id": 578099, "source": "method", "repo": "terraformersmc/modmenu", "text": "private FabricLoaderUpdateInfo(String version, boolean isStable) { this.version = version; this.isStable = isStable; }", "tokens": 30} {"id": 578141, "source": "method", "repo": "terraformersmc/modmenu", "text": "private static boolean isStableOrBeta(String preRelease) { return preRelease.isEmpty() || preRelease.startsWith(\"beta\") || preRelease.startsWith(\"pre\") || preRelease.startsWith(\"rc\"); }", "tokens": 45} {"id": 578201, "source": "method", "repo": "testcontainers/testcontainers-java", "text": "/** Attach an output consumer at container startup, enabling stdout and stderr to be followed, waited on, etc.

More than one consumer may be registered. @param serviceName the name of the service as set in the docker-compose.yml file @param consumer consumer that output frames should be sent to @return this instance, for chaining */ public SELF withLogConsumer(String serviceName, Consumer consumer) { this.composeDelegate.withLogConsumer(serviceName, consumer); return self(); }", "tokens": 109} {"id": 578203, "source": "method", "repo": "testcontainers/testcontainers-java", "text": "/** Remove images after containers shutdown. @return this instance, for chaining */ public SELF withRemoveImages(RemoveImages removeImages) { this.removeImages = removeImages; return self(); }", "tokens": 41} {"id": 578292, "source": "method", "repo": "testcontainers/testcontainers-java", "text": "ParsedDockerfile(List lines) { this.dockerFilePath = Paths.get(\"dummy.Dockerfile\"); this.dependencyImageNames = parse(lines); }", "tokens": 35} {"id": 578438, "source": "method", "repo": "testcontainers/testcontainers-java", "text": "void testWaitOnOneOfMultipleStrategiesFailing() { environment .withExposedService( \"redis-1\", REDIS_PORT, Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(10)) ) .waitingFor( \"db-1\", Wait.forLogMessage(\".*test test test.*\\\\s\", 1).withStartupTimeout(Duration.ofSeconds(10)) ) .withTailChildContainers(true); assertThat(catchThrowable(() -> environment.start())) .as(\"waiting on one failing strategy to time out\") .isInstanceOf(RuntimeException.class); }", "tokens": 128} {"id": 578521, "source": "method", "repo": "testcontainers/testcontainers-java", "text": "void shouldReadReuseFromUserProperties() { assertThat(newConfig().environmentSupportsReuse()).as(\"no reuse by default\").isFalse(); userProperties.setProperty(\"testcontainers.reuse.enable\", \"true\"); assertThat(newConfig().environmentSupportsReuse()).as(\"reuse enabled via user property\").isTrue(); }", "tokens": 63} {"id": 578565, "source": "method", "repo": "testcontainers/testcontainers-java", "text": "/** @return new KeyStore built with PKCS12 */ public KeyStore buildNewKeyStore() { return KeyStoreBuilder.buildByDownloadingCertificate(getEmulatorEndpoint(), getEmulatorKey()); }", "tokens": 37} {"id": 578576, "source": "method", "repo": "testcontainers/testcontainers-java", "text": "/** Get password

By default, Cassandra has authenticator: AllowAllAuthenticator in cassandra.yaml If username and password need to be used, then authenticator should be set as PasswordAuthenticator (through custom Cassandra configuration) and through CQL with default cassandra-cassandra credentials user management should be modified */ public String getPassword() { return PASSWORD; }", "tokens": 76} {"id": 578753, "source": "method", "repo": "testcontainers/testcontainers-java", "text": "protected String commandKraft() { String command = \"sed -i '/KAFKA_ZOOKEEPER_CONNECT/d' /etc/confluent/docker/configure\\n\"; command += \"echo 'kafka-storage format --ignore-formatted -t \\\"\" + getContainerDef().getEnvVars().get(\"CLUSTER_ID\") + \"\\\" -c /etc/kafka/kafka.properties' >> /etc/confluent/docker/configure\\n\"; return command; }", "tokens": 101} {"id": 578899, "source": "method", "repo": "testcontainers/testcontainers-java", "text": "protected String createR2DBCUrl() { return \"r2dbc:tc:oracle:///db?TC_IMAGE_TAG=21-slim-faststart\"; }", "tokens": 39} {"id": 578942, "source": "method", "repo": "testcontainers/testcontainers-java", "text": "ConnectionPublisher(Supplier> futureSupplier) { this.futureSupplier = futureSupplier; }", "tokens": 25} {"id": 579049, "source": "method", "repo": "testcontainers/testcontainers-java", "text": "public String getHttpHostAddress() { return getHost() + \":\" + getHttpPort(); }", "tokens": 21} {"id": 579095, "source": "method", "repo": "the3deer/android-3d-model-viewer", "text": "public static String resolvePropertyDescription(Context context, String beanName, String propertyName) { int resId = context.getResources().getIdentifier(\"property_\" + beanName + \"_\" + propertyName + \"_description\", \"string\", context.getPackageName()); if (resId != 0) return context.getString(resId); return null; }", "tokens": 71} {"id": 579202, "source": "method", "repo": "thealgorithms/java", "text": "/** Sets the bit at the specified position to 1. @param num the input number @param bit the position of the bit to set (0-indexed) @return the new number after setting the specified bit to 1 */ public static int setBit(final int num, final int bit) { return num | (1 << bit); }", "tokens": 72} {"id": 579326, "source": "method", "repo": "thealgorithms/java", "text": "void splitChild(int i, BTreeNode y) { BTreeNode z = new BTreeNode(y.t, y.leaf); z.n = t - 1; System.arraycopy(y.keys, t, z.keys, 0, t - 1); if (!y.leaf) { System.arraycopy(y.children, t, z.children, 0, t); } y.n = t - 1; for (int j = n; j >= i + 1; j--) { children[j + 1] = children[j]; } children[i + 1] = z; for (int j = n - 1; j >= i; j--) { keys[j + 1] = keys[j]; } keys[i] = y.keys[t - 1]; n++; }", "tokens": 183} {"id": 579411, "source": "method", "repo": "thealgorithms/java", "text": "public Line(Point start, Point end) { this.start = start; this.end = end; }", "tokens": 24} {"id": 579609, "source": "method", "repo": "thealgorithms/java", "text": "public void testNextLowerPowerOfTwo() { assertEquals(16, HigherLowerPowerOfTwo.nextLowerPowerOfTwo(19)); // next lower power of two is 16 assertEquals(1, HigherLowerPowerOfTwo.nextLowerPowerOfTwo(1)); // next lower power of two is 1 assertEquals(8, HigherLowerPowerOfTwo.nextLowerPowerOfTwo(9)); // next lower power of two is 8 assertEquals(8, HigherLowerPowerOfTwo.nextLowerPowerOfTwo(15)); // next lower power of two is 8 assertEquals(8, HigherLowerPowerOfTwo.nextLowerPowerOfTwo(8)); // next lower power of two is 8 }", "tokens": 134} {"id": 579803, "source": "method", "repo": "thealgorithms/java", "text": "private static Stream valuesToTest() { return Stream.of(5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90); }", "tokens": 87} {"id": 579868, "source": "method", "repo": "thealgorithms/java", "text": "public void testLargeBinaryNumbers() { String a = \"101010101010101010101010101010\"; String b = \"110110110110110110110110110110\"; String expected = \"1100001100001100001100001100000\"; assertEquals(expected, binaryAddition.addBinary(a, b)); }", "tokens": 130} {"id": 579872, "source": "method", "repo": "thealgorithms/java", "text": "public void testBlockPractical() throws IOException { String text = \"!Hello\\nWorld!\"; byte[] bytes = text.getBytes(); int len = bytes.length; ByteArrayInputStream input = new ByteArrayInputStream(bytes); BufferedReader reader = new BufferedReader(input); assertEquals('H', reader.peek()); assertEquals('!', reader.read()); // read the first letter len--; // this only reads the next 5 bytes (Hello) because // the default buffer size = 5 assertEquals(\"Hello\", new String(reader.readBlock())); len -= 5; assertEquals(reader.available(), len); // maybe kind of a practical demonstration / use case if (reader.read() == '\\n') { assertEquals('W', reader.read()); assertEquals('o', reader.read()); // the rest of the blocks assertEquals(\"rld!\", new String(reader.readBlock())); } else { // should not reach throw new IOException(\"Something not right\"); } }", "tokens": 209} {"id": 579946, "source": "method", "repo": "thealgorithms/java", "text": "private static Stream provideTestCases() { return Stream.of(new TestData(new int[] {1, 2, 1, 3, 2, 4}, new int[] {3, 4}), new TestData(new int[] {-1, -2, -1, -3, -2, -4}, new int[] {-3, -4}), new TestData(new int[] {-1, 2, 2, -3, -1, 4}, new int[] {-3, 4})); }", "tokens": 121} {"id": 579968, "source": "method", "repo": "thealgorithms/java", "text": "void testPrimeFactorsSize(int number, int expectedSize) { assertEquals(expectedSize, PrimeFactorization.pfactors(number).size(), \"Size of prime factors list for number: \" + number); }", "tokens": 50} {"id": 580034, "source": "method", "repo": "thealgorithms/java", "text": "public void testScheduleMultipleTasks() { scheduler.addTask(\"Task1\", 2, 5); scheduler.addTask(\"Task2\", 1, 4); scheduler.addTask(\"Task3\", 3, 7); List expected = List.of(\"Task1\", \"Task2\", \"Task3\"); assertEquals(expected, scheduler.scheduleTasks()); }", "tokens": 82} {"id": 580068, "source": "method", "repo": "thealgorithms/java", "text": "/** Test for finding the first element in the array. */ void testSentinelLinearSearchFirstElement() { SentinelLinearSearch sentinelLinearSearch = new SentinelLinearSearch(); Integer[] array = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; Integer key = 0; // First element assertEquals(0, sentinelLinearSearch.find(array, key), \"The index of the first element should be 0.\"); }", "tokens": 109} {"id": 580130, "source": "method", "repo": "thealgorithms/java", "text": "void handlesEvenWindows() { MedianFilter filter = new MedianFilter(4); filter.accept(1.0); filter.accept(2.0); filter.accept(3.0); assertEquals(2.5, filter.accept(4.0), 1e-12); assertEquals(3.5, filter.accept(5.0), 1e-12); }", "tokens": 86} {"id": 580332, "source": "method", "repo": "theholywaffle/teamspeak-3-java-api", "text": "/** @see PermissionApi#ownValues(String...) */ public CompletableFuture> ownValues(String... permissionNames) { return requests.integers(PermissionCommands.permGet(permissionNames), \"permvalue\"); }", "tokens": 55} {"id": 580467, "source": "method", "repo": "theholywaffle/teamspeak-3-java-api", "text": "FileTransferHelper getFileTransferHelper() { return fileTransferHelper; }", "tokens": 15} {"id": 580658, "source": "method", "repo": "theholywaffle/teamspeak-3-java-api", "text": "public long getFiletransferBandwidthReceived() { return requireLong(VirtualServerProperty.CONNECTION_FILETRANSFER_BANDWIDTH_RECEIVED); }", "tokens": 27} {"id": 580711, "source": "method", "repo": "theholywaffle/teamspeak-3-java-api", "text": "public QueryError(Map map) { super(map); }", "tokens": 19} {"id": 580733, "source": "method", "repo": "theholywaffle/teamspeak-3-java-api", "text": "public boolean isAutoStart() { return requireBoolean(VirtualServerProperty.VIRTUALSERVER_AUTOSTART); }", "tokens": 22} {"id": 580773, "source": "method", "repo": "theholywaffle/teamspeak-3-java-api", "text": "/** Gets a property's raw value. @param propertyName the property name @return the raw value, or empty if the property is missing */ public final Optional find(String propertyName) { return Optional.ofNullable(map.get(propertyName)); }", "tokens": 54} {"id": 580826, "source": "method", "repo": "theholywaffle/teamspeak-3-java-api", "text": "public static Command complainAdd(int clientDBId, String message) { CommandBuilder builder = new CommandBuilder(\"complainadd\"); builder.add(new KeyValueParam(\"tcldbid\", clientDBId)); builder.add(new KeyValueParam(\"message\", message)); return builder.build(); }", "tokens": 61} {"id": 580920, "source": "method", "repo": "theholywaffle/teamspeak-3-java-api", "text": "void synchronousAdapterRethrowsWrappedCancellation() { var source = new CompletableFuture(); source.cancel(false); var dependent = source.thenApply(value -> value + 1); assertThrows(CancellationException.class, () -> CommandFutures.join(dependent)); }", "tokens": 56} {"id": 580930, "source": "method", "repo": "theholywaffle/teamspeak-3-java-api", "text": "void handshakeDeadlineBoundsStalledLoginAndHandler() throws Exception { try (var peer = new FakeServerQuery(p -> { p.expect(\"login client_login_name=test client_login_password=test\"); Thread.sleep(1000); })) { var query = new TS3Query(config(peer.port()) .setLoginCredentials(\"test\", \"test\") .setCommandResponseTimeout(Duration.ofSeconds(5))); assertTimeout( Duration.ofMillis(900), () -> assertThrows(TS3ConnectionFailedException.class, query::connect)); terminated(query); } var entered = new CountDownLatch(1); try (var peer = new FakeServerQuery(p -> Thread.sleep(1000))) { var query = new TS3Query(config(peer.port()).setConnectionHandler(new ConnectionHandler() { @Override public void onConnect(TS3Api api) { entered.countDown(); try { Thread.sleep(5000); } catch (InterruptedException expected) { Thread.currentThread().interrupt(); } } @Override public void onDisconnect(TS3Query query) {} })); assertTimeout( Duration.ofMillis(900), () -> assertThrows(TS3ConnectionFailedException.class, query::connect)); assertEquals(0, entered.getCount()); terminated(query); } }", "tokens": 284} {"id": 581079, "source": "method", "repo": "theholywaffle/teamspeak-3-java-api", "text": "void redactsSecretValuesAndKeepsStructure(String line, String expected) { assertEquals(expected.strip(), ProtocolRedactor.redactLine(line.strip())); }", "tokens": 36} {"id": 581133, "source": "method", "repo": "theokanning/openai-java", "text": "public static ObjectMapper defaultObjectMapper() { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); mapper.addMixIn(ChatFunction.class, ChatFunctionMixIn.class); mapper.addMixIn(ChatCompletionRequest.class, ChatCompletionRequestMixIn.class); mapper.addMixIn(ChatFunctionCall.class, ChatFunctionCallMixIn.class); return mapper; }", "tokens": 119} {"id": 581144, "source": "method", "repo": "theokanning/openai-java", "text": "void createChatCompletion() { final List messages = new ArrayList<>(); final ChatMessage systemMessage = new ChatMessage(ChatMessageRole.SYSTEM.value(), \"You are a dog and will speak as such.\"); messages.add(systemMessage); ChatCompletionRequest chatCompletionRequest = ChatCompletionRequest .builder() .model(\"gpt-3.5-turbo\") .messages(messages) .n(5) .maxTokens(50) .logitBias(new HashMap<>()) .build(); List choices = service.createChatCompletion(chatCompletionRequest).getChoices(); assertEquals(5, choices.size()); }", "tokens": 135} {"id": 581167, "source": "method", "repo": "theokanning/openai-java", "text": "Message createTestMessage() { return createTestMessage(threadId); }", "tokens": 13} {"id": 581461, "source": "method", "repo": "theonedev/onedev", "text": "public void setCodeManagement(boolean codeManagement) { this.codeManagement = codeManagement; }", "tokens": 21} {"id": 581625, "source": "method", "repo": "theonedev/onedev", "text": "public CharSequence getBeforeHandler(Component component) { String script = \"onedev.server.viewState.getFromViewAndSetToHistory();\"; if (carryOver) { script += \"onedev.server.viewState.carryOver = onedev.server.viewState.getFromHistory();\"; } else { script += \"onedev.server.viewState.carryOver = undefined;\"; } return script; }", "tokens": 91} {"id": 581653, "source": "method", "repo": "theonedev/onedev", "text": "private WebMarkupContainer newActionsContainer() { WebMarkupContainer actionsContainer = new Fragment(\"actions\", \"actionsFrag\", this) { @Override protected void onConfigure() { super.onConfigure(); setVisible(SecurityUtils.getAuthUser() != null); } }; actionsContainer.setOutputMarkupId(true); actionsContainer.add(new AjaxLink(\"reply\") { @Override public void onClick(AjaxRequestTarget target) { onAddReply(target, null); } }); actionsContainer.add(new AjaxLink(\"resolve\") { @Override public void onClick(AjaxRequestTarget target) { onAddReply(target, true); } @Override protected void onConfigure() { super.onConfigure(); setVisible(!getComment().isResolved() && SecurityUtils.canChangeStatus(getComment())); } }); actionsContainer.add(new AjaxLink(\"unresolve\") { @Override public void onClick(AjaxRequestTarget target) { onAddReply(target, false); } @Override protected void onConfigure() { super.onConfigure(); setVisible(getComment().isResolved() && SecurityUtils.canChangeStatus(getComment())); } }); actionsContainer.add(new AjaxLink(\"delete\") { @Override protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { super.updateAjaxAttributes(attributes); String confirmMessage; if (getComment().getReplies().isEmpty()) { confirmMessage = _T(\"Do you really want to delete this code comment?\"); } else { confirmMessage = _T(\"Do you really want to delete this code comment and all its replies?\"); } attributes.getAjaxCallListeners().add(new ConfirmClickListener(confirmMessage)); } @Override public void onClick(AjaxRequestTarget target) { OneDev.getInstance(TransactionService.class).run(() -> { onDeleteComment(target, getComment()); var oldAuditContent = VersionedXmlDoc.fromBean(getComment()).toXML(); OneDev.getInstance(AuditService.class).audit(getComment().getProject(), \"deleted code comment on file \\\"\" + getComment().getMark().getPath() + \"\\\"\", oldAuditContent, null); OneDev.getInstance(CodeCommentService.class).delete(getComment()); }); } protected void onConfigure() { super.onConfigure(); setVisible(SecurityUtils.canModifyOrDelete(getComment())); } }); return actionsContainer; }", "tokens": 506} {"id": 581791, "source": "method", "repo": "theonedev/onedev", "text": "protected String getPropertyName() { return PROP_COMMIT_NOTIFICATION; }", "tokens": 15} {"id": 581821, "source": "method", "repo": "theonedev/onedev", "text": "private AdvancedSearchPanel newAdvancedSearchPanel(String id, ModalPanel modal) { /* * Re-use advanced search panel instance so that search options can be preserved in the page */ advancedSearchPanelModal = modal; if (advancedSearchPanel == null) { advancedSearchPanel = new AdvancedSearchPanel(id, projectModel, new IModel() { @Override public String getObject() { return state.blobIdent.revision; } }) { @Override protected void onSearchComplete(AjaxRequestTarget target, List hits) { newSearchResult(target, hits); resizeWindow(target); advancedSearchPanelModal.close(); } @Override protected void onCancel(AjaxRequestTarget target) { advancedSearchPanelModal.close(); } @Override protected BlobIdent getCurrentBlob() { return state.blobIdent; } }; } return advancedSearchPanel; }", "tokens": 182} {"id": 581857, "source": "method", "repo": "theonedev/onedev", "text": "public IssueCommitsPage(PageParameters params) { super(params); }", "tokens": 16} {"id": 581890, "source": "method", "repo": "theonedev/onedev", "text": "private static GlobalPullRequestSetting getPullRequestSetting() { return OneDev.getInstance(SettingService.class).getPullRequestSetting(); }", "tokens": 27} {"id": 582056, "source": "method", "repo": "thevindu-w/clip_share_client", "text": "public void isValidIPTest() { String[] validIPv4s = {\"192.168.1.1\", \"0.0.0.0\"}; for (String ip : validIPv4s) { assertTrue(Utils.isValidIP(ip)); } String[] validIPv6s = {\"::\", \"fc00:abcd::123\", \"fe80::1\", \"::1\"}; for (String ip : validIPv6s) { assertTrue(Utils.isValidIP(ip)); } String[] invalidIPv4s = {\"192.168.1.1.1\", \"127.0.0.256\"}; for (String ip : invalidIPv4s) { assertFalse(Utils.isValidIP(ip)); } String[] invalidIPv6s = {\":::\", \"fc00\", \"fe80:\", \":1\", \"fe80:abcg::1\", \" fe80::1\"}; for (String ip : invalidIPv6s) { assertFalse(Utils.isValidIP(ip)); } }", "tokens": 236} {"id": 582117, "source": "method", "repo": "thevindu-w/clip_share_client", "text": "public static void doUIOperation(AndroidUtils utils) { if (command == GET_TEXT) { String text; synchronized (TEXT_LOCK) { text = copiedText; command = 0; copiedText = null; } utils.setClipboardText(text); } else if (command == SEND_TEXT) { String text = utils.getClipboardText(); (new Thread( () -> { synchronized (TEXT_LOCK) { copiedText = text; TEXT_LOCK.notifyAll(); } })) .start(); } }", "tokens": 112} {"id": 582123, "source": "method", "repo": "thevindu-w/clip_share_client", "text": "public boolean onOptionsItemSelected(MenuItem item) { try { this.lastActivityTime = System.currentTimeMillis(); int itemID = item.getItemId(); if (itemID == R.id.action_settings) { if (!Settings.isIsSettingsLoaded()) return true; Intent settingsIntent = new Intent(ClipShareActivity.this, SettingsActivity.class); settingsActivityLauncher.launch(settingsIntent); startActiveTask(); } else if (itemID == R.id.action_info) { Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse(\"https://github.com/thevindu-w/clip_share_client#how-to-use\")); startActivity(intent); } else if (itemID == R.id.action_secure) { Toast.makeText(ClipShareActivity.this, R.string.change_in_settings, Toast.LENGTH_SHORT) .show(); } } catch (Exception ignored) { } return true; }", "tokens": 209} {"id": 582356, "source": "method", "repo": "thevindu-w/clip_share_client", "text": "public int getLeafCount(boolean includeLeafDirs) { return 1; }", "tokens": 18} {"id": 582467, "source": "method", "repo": "thombergs/code-examples", "text": "public CustomerDto getCustomerByID(@PathVariable(\"customerID\") String customerID) { log.info(\"g=fetching customer with id {}\", customerID); return customerService.fetchCustomer(customerID); }", "tokens": 44} {"id": 582564, "source": "method", "repo": "thombergs/code-examples", "text": "public String toString() { return \"BookDto{\" + \"id=\" + id + \", name='\" + name + '\\'' + \", publisher='\" + publisher + '\\'' + \", publicationYear='\" + publicationYear + '\\'' + \", copyrightIssued=\" + copyrightIssued + \", authors=\" + authors + '}'; }", "tokens": 67} {"id": 582711, "source": "method", "repo": "thombergs/code-examples", "text": "void timeBasedSlidingWindow_SlowCalls() { CircuitBreakerConfig config = CircuitBreakerConfig .custom() .slidingWindowType(SlidingWindowType.TIME_BASED) .minimumNumberOfCalls(10) .slidingWindowSize(10) .slowCallRateThreshold(70.0f) .slowCallDurationThreshold(Duration.ofSeconds(1)) .build(); CircuitBreakerRegistry registry = CircuitBreakerRegistry.of(config); CircuitBreaker circuitBreaker = registry.circuitBreaker(\"flightSearchService\"); FlightSearchService service = new FlightSearchService(); SearchRequest request = new SearchRequest(\"NYC\", \"LAX\", \"12/31/2020\"); service.setPotentialDelay(new AlwaysSlowNSeconds(1)); Supplier> flightsSupplier = circuitBreaker.decorateSupplier(() -> service.searchFlights(request)); System.out.println(\"Start time: \" + LocalDateTime.now().format(formatter)); for (int i=0; i<20; i++) { try { System.out.println(flightsSupplier.get()); } catch (Exception e) { e.printStackTrace(); } } }", "tokens": 258} {"id": 582773, "source": "method", "repo": "thombergs/code-examples", "text": "public AdminBooksRestController(CreateBookService createBookService, UpdateBookService updateBookService, DeleteBookService deleteBookService) { this.createBookService = createBookService; this.updateBookService = updateBookService; this.deleteBookService = deleteBookService; }", "tokens": 59} {"id": 583009, "source": "method", "repo": "thombergs/code-examples", "text": "void whenValidInput_thenReturnsUserResource_withTypedAssertion() throws Exception { UserResource user = new UserResource(\"Zaphod\", \"zaphod@galaxy.net\"); MvcResult mvcResult = mockMvc.perform(post(\"/forums/{forumId}/register\", 42L) .contentType(\"application/json\") .param(\"sendWelcomeMail\", \"true\") .content(objectMapper.writeValueAsString(user))) .andExpect(status().isOk()) .andReturn(); UserResource expected = user; UserResource actualResponseBody = objectMapper.readValue(mvcResult.getResponse().getContentAsString(), UserResource.class); assertThat(actualResponseBody.getName()).isEqualTo(expected.getName()); assertThat(actualResponseBody.getEmail()).isEqualTo(expected.getEmail()); }", "tokens": 167} {"id": 583121, "source": "method", "repo": "thombergs/code-examples", "text": "public PersonUpdateRequestBuilder password(String password){ this.password = password; return this; }", "tokens": 20} {"id": 583199, "source": "method", "repo": "thombergs/docx-stamper", "text": "public ExpressionResolver(EvaluationContextConfigurer evaluationContextConfigurer) { this.evaluationContextConfigurer = evaluationContextConfigurer; }", "tokens": 24} {"id": 583353, "source": "method", "repo": "thombergs/docx-stamper", "text": "private void walkContent(List contentElements) { for (int i = 0; i < contentElements.size(); i++) { Object contentElement = contentElements.get(i); Object unwrappedObject = XmlUtils.unwrap(contentElement); if (unwrappedObject instanceof P) { P p = (P) unwrappedObject; ParagraphCoordinates coordinates = new ParagraphCoordinates(p, i); walkParagraph(coordinates); } else if (unwrappedObject instanceof Tbl) { Tbl table = (Tbl) unwrappedObject; TableCoordinates tableCoordinates = new TableCoordinates(table, i); walkTable(tableCoordinates); } } }", "tokens": 140} {"id": 583465, "source": "method", "repo": "thombergs/docx-stamper", "text": "public Image getMonalisa() { return monalisa; }", "tokens": 19} {"id": 583583, "source": "method", "repo": "timtebeek/spring-security-samples", "text": "public static void main(String... args) { SpringApplication.run(DummyApplication.class, args); }", "tokens": 26} {"id": 583642, "source": "method", "repo": "timtebeek/spring-security-samples", "text": "JwtDecoder jwtDecoderByIssuerUri(OAuth2ResourceServerProperties properties) { String issuerUri = properties.getJwt().getIssuerUri(); NimbusJwtDecoder jwtDecoder = (NimbusJwtDecoder) JwtDecoders.fromIssuerLocation(issuerUri); // Use preferred_username from claims as authentication name, instead of UUID subject jwtDecoder.setClaimSetConverter(new UsernameSubClaimAdapter()); return jwtDecoder; }", "tokens": 90} {"id": 583871, "source": "method", "repo": "tkowalcz/tjahzi", "text": "public StandardMonitoringModule() { distinctErrorLog = new DistinctErrorLog( new UnsafeBuffer(ByteBuffer.allocateDirect(ERROR_LOG_CAPACITY)), new SystemEpochClock() ); StatsDumpingThread thread = new StatsDumpingThread(this); if (thread.isEnabled()) { thread.start(); } }", "tokens": 67} {"id": 583885, "source": "method", "repo": "tkowalcz/tjahzi", "text": "public void incrementChannelInactive() { channelInactive.incrementAndGet(); }", "tokens": 14} {"id": 584015, "source": "method", "repo": "tkowalcz/tjahzi", "text": "public void tick(long amount) { millis += amount; }", "tokens": 14} {"id": 584099, "source": "method", "repo": "tkowalcz/tjahzi", "text": "public void initialize(BiConsumer drain, LogEvent context) { this.context = context; this.drain = drain; buffer.clear(); }", "tokens": 36} {"id": 584239, "source": "method", "repo": "tkowalcz/tjahzi", "text": "public static Encoder threadLocal() { Encoder result = THREAD_LOCAL.get(); result.clear(); return result; }", "tokens": 28} {"id": 584336, "source": "method", "repo": "tkowalcz/tjahzi", "text": "void shouldLogVerboseWhenEnabled() { // Given LoggerContext context = loadConfig(\"appender-test-with-log-internal-errors.xml\"); Logger logger = (Logger) LoggerFactory.getLogger(LoggingMonitoringModuleIntegrationTest.class); // When logger.info(\"Test message\"); // Then context.getStatusManager().getCopyOfStatusList().forEach(System.out::println); await().atMost(Durations.FOREVER) .untilAsserted(() -> { List statuses = context.getStatusManager().getCopyOfStatusList(); assertThat(statuses) .extracting(\"message\") .contains(\"[Tjahzi] HTTP request failed.\"); }); }", "tokens": 141} {"id": 584384, "source": "method", "repo": "tlaplus/tlaplus", "text": "public int getSupportedNodeKind() { return NodeKind.ACTION_EXPR.getId(); }", "tokens": 20} {"id": 584395, "source": "method", "repo": "tlaplus/tlaplus", "text": "public Doc buildDoc(TreeNode node, ConstructContext context, int indentSize) { assert (node.zero() != null && node.zero().length >= 3); Doc innerExpr = context.buildChild(node.zero()[1]); return Doc.group(context.buildChild(node.zero()[0]) // ( .appendSpace(innerExpr.indent(\"( \".length())) .appendLineOrSpace(context.buildChild(node.zero()[node.zero().length - 1]))); // ) }", "tokens": 113} {"id": 584473, "source": "method", "repo": "tlaplus/tlaplus", "text": "public SemanticNode[] getChildren() { if (this.steps == null || this.steps.length == 0) { return null; } SemanticNode[] res = new SemanticNode[this.steps.length]; for (int i = 0; i < steps.length; i++) { res[i] = steps[i]; } return res; }", "tokens": 80} {"id": 584493, "source": "method", "repo": "tlaplus/tlaplus", "text": "/** ********************************************************************** The following methods implement the OpDefOrLabel interface. * * These are the same as the other classes that implement the interface. * There doesn't seem to be any easy way to write these methods only * once. * *********************************************************************** */ public void setLabels(Hashtable ht) {labels = ht; }", "tokens": 84} {"id": 584566, "source": "method", "repo": "tlaplus/tlaplus", "text": "public void recover() throws IOException { // TODO Check that the number of disk .st files is >= workers.length. If it is // lower, TLC runs with fewer workers than when the checkpoint was taken. Take // this case into account. for (Worker worker : workers) { worker.recover(); } }", "tokens": 66} {"id": 584626, "source": "method", "repo": "tlaplus/tlaplus", "text": "public final void recoverFP(long fp) throws IOException { Assert.check(!this.put(fp), EC.TLC_FP_NOT_IN_SET); }", "tokens": 37} {"id": 584807, "source": "method", "repo": "tlaplus/tlaplus", "text": "/** Closes this stream and its underlying stream, after first flushing any buffered data. */ public final void close() throws IOException { this.flush(); this.out.close(); this.out = null; }", "tokens": 44} {"id": 584934, "source": "method", "repo": "tlaplus/tlaplus", "text": "public SubsetEqTest() { super(\"SubsetEq\"); }", "tokens": 14} {"id": 584957, "source": "method", "repo": "tlaplus/tlaplus", "text": "/** Test method for {@link tlc2.tool.fp.MultiFPSet#new}. @throws IOException Not supposed to happen */ public void testCTorMax() throws IOException { try { FPSetConfiguration conf = new FPSetConfiguration(); conf.setFpBits(30); new MultiFPSet(conf); } catch (OutOfMemoryError e) { // might happen depending on test machine setup return; } catch (IllegalArgumentException e) { // Happens when MultiFPSetConfiguration is invalid (too many fpsets // leaving no room/memory for each individual fpset). if (e.getMessage().equals(\"Given fpSetConfig results in zero or negative fp count.\")) { return; } // some other cause for the IAE fail(); } catch (RuntimeException e) { fail(); } return; }", "tokens": 168} {"id": 585029, "source": "method", "repo": "tlaplus/tlaplus", "text": "public void testRandomSubsetE5F075() { final SetEnumValue innerSet = new SetEnumValue(getValue(\"a\", \"b\", \"c\", \"d\", \"e\"), true); doTest(1 << innerSet.size(), innerSet, 24); }", "tokens": 60} {"id": 585108, "source": "method", "repo": "tlaplus/tlaplus", "text": "/** {@inheritDoc}

May be replaced or extended by subclasses.

*/ public String getContentType(int offset) { checkInitialization(); TypedPosition p= findClosestPosition(offset); if (p != null && p.includes(offset)) return p.getType(); return IDocument.DEFAULT_CONTENT_TYPE; }", "tokens": 70} {"id": 585694, "source": "method", "repo": "tmseidel/ai-git-bot", "text": "public CodeReviewService(RepositoryApiClient repositoryClient, AiClient aiClient, SessionService sessionService, String botUsername, ReviewConfigProperties reviewConfig, String sessionPromptKey, String reviewSystemPrompt, int maxDiffCharsPerChunk, int maxDiffChunks, int retryTruncatedChunkChars, String excludedFilePatterns) { if (sessionPromptKey == null || sessionPromptKey.isBlank()) { throw new IllegalArgumentException(\"Session prompt key is required\"); } if (reviewSystemPrompt == null || reviewSystemPrompt.isBlank()) { throw new IllegalArgumentException(\"Review system prompt is required\"); } this.repositoryClient = repositoryClient; this.aiClient = aiClient; this.sessionService = sessionService; this.botUsername = botUsername; this.sessionPromptKey = sessionPromptKey; this.reviewSystemPrompt = reviewSystemPrompt; this.contextEnricher = new PrContextEnricher(repositoryClient, reviewConfig); this.maxDiffCharsPerChunk = maxDiffCharsPerChunk; this.maxDiffChunks = maxDiffChunks; this.retryTruncatedChunkChars = retryTruncatedChunkChars; this.excludedFilePatterns = DiffFileFilter.parsePatterns(excludedFilePatterns); }", "tokens": 245} {"id": 585818, "source": "method", "repo": "tmseidel/ai-git-bot", "text": "void extractNonJsonResponse_pureJsonContainingBacktickJson_returnsNull() { // Regression: A pure-JSON response (starts with '{') that contains the literal // string \"```json\" inside a tool argument must NOT be treated as having thinking // text before a markdown code-fence. The \"starts with '{'\" check must take // priority over the \"```json\" search. String pureJson = \"{\\\"summary\\\":\\\"Add docs\\\",\\\"runTools\\\":[{\\\"id\\\":\\\"abc\\\",\\\"tool\\\":\\\"patch-file\\\",\" + \"\\\"args\\\":[\\\"README.md\\\",\\\"old content ```json fenced block end\\\"]}]}\"; assertThat(parser.extractNonJsonResponse(pureJson)).isNull(); }", "tokens": 141} {"id": 585875, "source": "method", "repo": "tmseidel/ai-git-bot", "text": "void http503IsUnavailable() { assertTrue(client.isProviderUnavailableError( serverError(HttpStatus.SERVICE_UNAVAILABLE, \"upstream down\"))); }", "tokens": 33} {"id": 586095, "source": "method", "repo": "tmseidel/ai-git-bot", "text": "void invalidSignatureReturns401() { when(runService.getById(42L)).thenReturn(runWith(\"topsecret\", PrWorkflowRunStatus.WAITING_DEPLOY)); ResponseEntity r = controller.callback(42L, \"topsecret\", \"sha256=deadbeef\", \"{\\\"status\\\":\\\"READY\\\"}\"); assertThat(r.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED); }", "tokens": 84} {"id": 586145, "source": "method", "repo": "tmseidel/ai-git-bot", "text": "void renderStarting_listsPatternsBaselineAndLifecycle() { String out = I18nCoverageSummaryRenderer.renderStarting( 7L, List.of(\"i18n/*.json\"), \"en\", SuiteLifecycleMode.COMMIT_TO_PR); assertThat(out).contains(\"PR #7\") .contains(\"`i18n/*.json`\") .contains(\"`en`\") .contains(\"commit-to-pr\"); }", "tokens": 101} {"id": 586148, "source": "method", "repo": "tmseidel/ai-git-bot", "text": "void metadata_isStableAndDocs() { I18nCoverageWorkflow wf = workflow(); assertEquals(\"i18n-coverage\", wf.key()); assertEquals(PrWorkflowCategory.DOCS, wf.category()); assertEquals(4, wf.paramsSchema().fields().size()); }", "tokens": 60} {"id": 586353, "source": "method", "repo": "tom5454/customplayermodels", "text": "public static UnmodifiablePair ofUnmodifiable(K key, V value){ return new UnmodifiablePair<>(key, value); }", "tokens": 36} {"id": 586372, "source": "method", "repo": "tom5454/customplayermodels", "text": "public void setGestureValue(int id, int val) { if(MinecraftObjectHolder.DEBUGGING)Log.debug(\"Set: \" + id + \" to \" + val); if (gestureData.length > id && id >= 0) { byte v = (byte) val; if (gestureData[id] != v) { gestureData[id] = v; gesturesChanged = true; } } else { Log.error(\"Parameter out of bounds\", new IndexOutOfBoundsException(id + \", len=\" + gestureData.length)); } }", "tokens": 124} {"id": 586419, "source": "method", "repo": "tom5454/customplayermodels", "text": "protected void readTags(IProject project, EditorTagManager mngr, String name) throws IOException { project.jsonIfExists(\"tags/\" + name + \".json\", data -> { JsonList list = data.getList(\"tags\"); list.forEachMap(d -> { String id = d.getString(\"id\"); if (id == null)return; id = EditorTagManager.formatTag(id); if (id == null)return; String[] elems = d.getList(\"elements\").stream().map(String::valueOf).toArray(String[]::new); mngr.load(id, elems); }); }); }", "tokens": 144} {"id": 586465, "source": "method", "repo": "tom5454/customplayermodels", "text": "public void render(MatrixStack stack, VertexBuffer buf) { pole.render(stack, buf); }", "tokens": 23} {"id": 586647, "source": "method", "repo": "tom5454/customplayermodels", "text": "public static RedirectHolder createVRPlayer(PlayerRenderManager mngr, Object model) { return new RedirectHolderVRPlayer(mngr, (VRPlayerModel) model); }", "tokens": 54} {"id": 586659, "source": "method", "repo": "tom5454/customplayermodels", "text": "public void updateJump() { if(minecraft.player.isOnGround() && minecraft.player.input.jumping) { manager.jump(minecraft.player); } }", "tokens": 37} {"id": 586860, "source": "method", "repo": "tom5454/customplayermodels", "text": "public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); try { GL11.glEnable(GL11.GL_SCISSOR_TEST); stack = new CtxStack(width, height); gui.draw(mouseX, mouseY, partialTicks); } catch (Throwable e) { onGuiException(\"Error drawing gui\", e, true); } finally { GL11.glDisable(GL11.GL_SCISSOR_TEST); String s = \"Minecraft 1.5.2 (\" + ClientBrandRetriever.getClientModName() + \") \" + Loader.instance().getIndexedModList().get(CustomPlayerModels.ID).getDisplayVersion(); fontRenderer.drawString(s, width - fontRenderer.getStringWidth(s) - 4, 2, 0xff000000); s = Minecraft.getMinecraft().debug; fontRenderer.drawString(s, width - fontRenderer.getStringWidth(s) - 4, 11, 0xff000000); } if(mc.thePlayer != null && gui.enableChat()) { try { ScaledResolution res = new ScaledResolution(mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); Method m = GuiIngameForge.class.getDeclaredMethod(\"renderChat\", int.class, int.class); m.setAccessible(true); m.invoke(mc.ingameGUI, res.getScaledWidth(), res.getScaledHeight()); } catch (Throwable e) { } } }", "tokens": 332} {"id": 586903, "source": "method", "repo": "tom5454/customplayermodels", "text": "public static void registerPictureInPictureRenderers(RegistrationHandler handler) { handler.register(Panel3dImpl.State.class, Panel3dImpl.Renderer::new); }", "tokens": 38} {"id": 587021, "source": "method", "repo": "tom5454/customplayermodels", "text": "private static Group findPart(VanillaModelPart p) { for(Group g : Group.all) { if(g.parent == Group.ROOT && g.name.equals(p.getName())) { return g; } } return null; }", "tokens": 52} {"id": 587078, "source": "method", "repo": "tom5454/customplayermodels", "text": "/** Marks the present position in the stream. Subsequent calls to reset() will attempt to reposition the stream to this point. @param readAheadLimit Limit on the number of characters that may be read while still preserving the mark. An attempt to reset the stream after reading characters up to this limit or beyond may fail. A limit value larger than the size of the input buffer will cause a new buffer to be allocated whose size is no smaller than limit. Therefore large values should be used with care. @exception IllegalArgumentException If {@code readAheadLimit < 0} @exception IOException If an I/O error occurs */ public void mark(int readAheadLimit) throws IOException { if (readAheadLimit < 0) { throw new IllegalArgumentException(\"Read-ahead limit < 0\"); } ensureOpen(); this.readAheadLimit = readAheadLimit; markedChar = nextChar; markedSkipLF = skipLF; }", "tokens": 193} {"id": 587125, "source": "method", "repo": "tom5454/toms-storage", "text": "public long insert(ItemVariant resource, long maxAmount, TransactionContext transaction) { if (maxAmount < 1) return 0; updateSnapshots(transaction); State state = new State(); state.spawn = resource.toStack((int) maxAmount); this.state.add(state); return maxAmount; }", "tokens": 71} {"id": 587232, "source": "method", "repo": "tom5454/toms-storage", "text": "public static boolean canScrapeWithItem(ItemStack item, Player player, InteractionHand hand) { return item.is(ItemTags.AXES); }", "tokens": 31} {"id": 587371, "source": "method", "repo": "tom5454/toms-storage", "text": "public void onRemove(BlockState state, Level world, BlockPos pos, BlockState state2, boolean flag) { if (!state.is(state2.getBlock())) { BlockEntity blockentity = world.getBlockEntity(pos); if (blockentity instanceof BasicInventoryHopperBlockEntity te && !te.getFilter().isEmpty() && te.getFilter().getItem() instanceof IItemFilter) { Containers.dropItemStack(world, pos.getX(), pos.getY(), pos.getZ(), te.getFilter()); } super.onRemove(state, world, pos, state2, flag); } }", "tokens": 119} {"id": 587401, "source": "method", "repo": "tom5454/toms-storage", "text": "public void appendHoverText(ItemStack itemStack, TooltipContext tooltipContext, List tooltip, TooltipFlag tooltipFlag) { ClientUtil.tooltip(\"inventory_cable_connector\", tooltip); if (Config.get().invLinkBeaconLvl != -1) { ClientUtil.tooltip(\"inventory_cable_connector_link.beacon\", false, tooltip); ClientUtil.tooltip(\"inventory_cable_connector_link.beacon0\", false, tooltip, Config.get().invLinkBeaconLvl, Config.get().invLinkBeaconRange); if (Config.get().invLinkBeaconLvlSameDim != -1) { ClientUtil.tooltip(\"inventory_cable_connector_link.beacon1\", false, tooltip, Config.get().invLinkBeaconLvlSameDim); } if (Config.get().invLinkBeaconLvlCrossDim != -1) { ClientUtil.tooltip(\"inventory_cable_connector_link.beacon2\", false, tooltip, Config.get().invLinkBeaconLvlCrossDim); } ClientUtil.tooltip(\"inventory_cable_connector_link\", false, tooltip); } }", "tokens": 233} {"id": 587433, "source": "method", "repo": "tom5454/toms-storage", "text": "public void loadAdditional(CompoundTag nbtIn, HolderLookup.Provider provider) { super.loadAdditional(nbtIn, provider); this.filter = ItemStack.parseOptional(provider, nbtIn.getCompound(\"Filter\")); }", "tokens": 44} {"id": 587574, "source": "method", "repo": "tom5454/toms-storage", "text": "public CompoundTag save(CompoundTag tag, HolderLookup.Provider provider) { ListTag list = new ListTag(); connections.forEach((k, v) -> { CompoundTag t = new CompoundTag(); t.putUUID(CHANNEL_ID, k); v.save(t); list.add(t); }); tag.put(CONNECTIONS_TAG, list); return tag; }", "tokens": 76} {"id": 587628, "source": "method", "repo": "tom5454/toms-storage", "text": "public void openGui(ItemStack is, Player player, BooleanSupplier isValid, Runnable refresh) { player.openMenu(new SimpleMenuProvider((id, pi, pl) -> new ItemFilterMenu(id, pi, new SimpleItemFilter(is), isValid, refresh), is.getHoverName())); }", "tokens": 63} {"id": 587635, "source": "method", "repo": "tom5454/toms-storage", "text": "public InteractionResult useOn(UseOnContext context) { if(!context.getLevel().isClientSide) { if(context.isSecondaryUseActive()) { BlockState state = context.getLevel().getBlockState(context.getClickedPos()); BlockEntity tile = context.getLevel().getBlockEntity(context.getClickedPos()); if(tile == null && state.canOcclude() && Block.isShapeFullBlock(state.getShape(context.getLevel(), context.getClickedPos()))) { ItemStack is = context.getItemInHand(); is.applyComponents(DataComponentPatch.builder().set(Content.paintComponent.get(), state).build()); } return InteractionResult.SUCCESS; } else { BlockState state = context.getLevel().getBlockState(context.getClickedPos()); ItemStack is = context.getItemInHand(); if (state.getBlock() instanceof IPaintable) { BlockState st = is.get(Content.paintComponent.get()); if (st != null) { if(((IPaintable)state.getBlock()).paint(context.getLevel(), context.getClickedPos(), st)) { Player playerentity = context.getPlayer(); context.getLevel().playSound(playerentity, context.getClickedPos(), SoundEvents.BUCKET_EMPTY, SoundSource.BLOCKS, 1.0F, 1.0F); if(playerentity != null) { is.hurtAndBreak(1, context.getPlayer(), context.getHand() == InteractionHand.MAIN_HAND ? EquipmentSlot.MAINHAND : EquipmentSlot.OFFHAND); if(is.isEmpty()) { playerentity.setItemInHand(context.getHand(), new ItemStack(Items.BUCKET)); } } } return InteractionResult.SUCCESS; } } } } else { BlockState state = context.getLevel().getBlockState(context.getClickedPos()); if(context.isSecondaryUseActive())return InteractionResult.SUCCESS; if(state.getBlock() instanceof IPaintable) { return InteractionResult.SUCCESS; } } return super.useOn(context); }", "tokens": 396} {"id": 587767, "source": "method", "repo": "tom5454/toms-storage", "text": "public DraggedAcceptorResult acceptDraggedStack(DraggingContext context, DraggableStack stack) { var targets = getTargets(context.getScreen(), stack.get()); var pos = context.getCurrentPosition(); for (var target : targets) { if (target.getArea().contains(pos)) { target.accept(stack); return DraggedAcceptorResult.ACCEPTED; } } return DraggedAcceptorResult.PASS; }", "tokens": 92} {"id": 587846, "source": "method", "repo": "tom5454/toms-storage", "text": "private void click(int id, boolean val) { this.minecraft.gameMode.handleInventoryButtonClick(this.menu.containerId, (id << 1) | (val ? 1 : 0)); }", "tokens": 45} {"id": 587926, "source": "method", "repo": "tom5454/toms-storage", "text": "public void stopOpen(Player pPlayer) { delegate.stopOpen(pPlayer); }", "tokens": 20} {"id": 587999, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public void process( HttpMethod method, TusServletRequest servletRequest, TusServletResponse servletResponse, UploadStorageService uploadStorageService, String ownerKey) throws IOException, TusException { String uploadChecksumHeader = servletRequest.getHeader(HttpHeader.UPLOAD_CHECKSUM); if (servletRequest.hasCalculatedChecksum() && StringUtils.isNotBlank(uploadChecksumHeader)) { // The Upload-Checksum header can be a trailing header which is only present after // reading the full content. Therefor we need to revalidate that header here. new ChecksumAlgorithmValidator() .validate(method, servletRequest, uploadStorageService, ownerKey); Utils.ChecksumInfo checksumInfo = Utils.parseUploadChecksumHeader(servletRequest); if (checksumInfo != null) { String expectedValue = checksumInfo.getValue(); ChecksumAlgorithm checksumAlgorithm = checksumInfo.getAlgorithm(); String calculatedValue = servletRequest.getCalculatedChecksum(checksumAlgorithm); if (!Strings.CS.equals(expectedValue, calculatedValue)) { // Throw an exception if the checksum is invalid. This will also trigger the removal of // any bytes that were already saved. throw new UploadChecksumMismatchException( \"Expected checksum \" + expectedValue + \" but was \" + calculatedValue + \" with algorithm \" + checksumAlgorithm); } else if (uploadStorageService.isUploadDeduplicationEnabled()) { UploadInfo uploadInfo = uploadStorageService.getUploadInfo( Utils.getUploadUri(servletRequest, servletResponse), ownerKey); if (uploadInfo != null && !uploadInfo.isUploadInProgress() && uploadInfo.getDuplicatesUploadId() == null) { uploadInfo.setChecksum(expectedValue); uploadInfo.setChecksumAlgorithm(checksumAlgorithm); uploadStorageService.update(uploadInfo); } } } } }", "tokens": 335} {"id": 588004, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public boolean supports(HttpMethod method) { return HttpMethod.PATCH.equals(method); }", "tokens": 19} {"id": 588124, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public int getCloudUploadThreadPoolSize() { return cloudUploadThreadPoolSize; }", "tokens": 17} {"id": 588136, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public void setMinSize(Long minSize) { storageServiceDelegate.setMinSize(minSize); }", "tokens": 21} {"id": 588153, "source": "method", "repo": "tomdesair/tus-java-server", "text": "private Long calculateTotalLength(List partialUploads) { Long totalLength = 0L; for (UploadInfo childInfo : partialUploads) { if (childInfo.getLength() == null) { // One of our partial uploads does not have a length, we can't calculate the total // length // yet totalLength = null; } else if (totalLength != null) { totalLength += childInfo.getLength(); } } return totalLength; }", "tokens": 96} {"id": 588261, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public String getCalculatedChecksum(ChecksumAlgorithm algorithm) { MessageDigest messageDigest = getMessageDigest(algorithm); return messageDigest == null ? null : Base64.encodeBase64String(messageDigest.digest()); }", "tokens": 45} {"id": 588288, "source": "method", "repo": "tomdesair/tus-java-server", "text": "/** Parse the Upload-Checksum header from the HTTP request. @param request The HttpServletRequest @return ChecksumInfo if header is present and valid, null otherwise */ public static ChecksumInfo parseUploadChecksumHeader(HttpServletRequest request) { String uploadChecksumHeader = request.getHeader(HttpHeader.UPLOAD_CHECKSUM); if (StringUtils.isNotBlank(uploadChecksumHeader)) { ChecksumAlgorithm algorithm = ChecksumAlgorithm.forUploadChecksumHeader(uploadChecksumHeader); String checksumValue = StringUtils.substringAfter( uploadChecksumHeader, ChecksumAlgorithm.CHECKSUM_VALUE_SEPARATOR); if (algorithm != null && StringUtils.isNotBlank(checksumValue) && CHECKSUM_VALUE_PATTERN.matcher(checksumValue).matches()) { return new ChecksumInfo(algorithm, checksumValue); } } return null; }", "tokens": 166} {"id": 588351, "source": "method", "repo": "tomdesair/tus-java-server", "text": "/** Create a {@link com.azure.storage.blob.BlobContainerClient} connected to Azurite Testcontainer. @param azurite The active Azurite Testcontainer @param containerName Target container name @return Pre-configured BlobContainerClient */ public static com.azure.storage.blob.BlobContainerClient createBlobContainerClient( GenericContainer azurite, String containerName) { String connectionString = String.format( \"DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;\" + \"AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/\" + \"K1SZFPTOtr/KBHBeksoGMGw==;\" + \"BlobEndpoint=http://%s:%d/devstoreaccount1\", azurite.getHost(), azurite.getMappedPort(10000)); com.azure.storage.blob.BlobServiceClient serviceClient = new com.azure.storage.blob.BlobServiceClientBuilder() .connectionString(connectionString) .buildClient(); com.azure.storage.blob.BlobContainerClient containerClient = serviceClient.getBlobContainerClient(containerName); if (!containerClient.exists()) { containerClient.create(); } return containerClient; }", "tokens": 298} {"id": 588370, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public void testProcessReturnsNullOnOptionsAndError() throws Exception { MockHttpServletRequest optionsRequest = new MockHttpServletRequest(\"OPTIONS\", \"/files\"); optionsRequest.addHeader(HttpHeader.TUS_RESUMABLE, TusFileUploadService.TUS_API_VERSION); MockHttpServletResponse optionsResponse = new MockHttpServletResponse(); UploadInfo optionsInfo = tusFileUploadService.process(optionsRequest, optionsResponse); assertNull(optionsInfo); assertEquals(HttpServletResponse.SC_NO_CONTENT, optionsResponse.getStatus()); // Invalid PATCH request (non-existent upload) MockHttpServletRequest badPatchRequest = new MockHttpServletRequest(\"PATCH\", \"/files/non-existent-id\"); badPatchRequest.addHeader(HttpHeader.TUS_RESUMABLE, TusFileUploadService.TUS_API_VERSION); badPatchRequest.addHeader(HttpHeader.UPLOAD_OFFSET, \"0\"); badPatchRequest.addHeader(HttpHeader.CONTENT_TYPE, \"application/offset+octet-stream\"); MockHttpServletResponse badPatchResponse = new MockHttpServletResponse(); UploadInfo badPatchInfo = tusFileUploadService.process(badPatchRequest, badPatchResponse); assertNull(badPatchInfo); assertEquals(HttpServletResponse.SC_NOT_FOUND, badPatchResponse.getStatus()); }", "tokens": 240} {"id": 588425, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public void isErrorHandler() { assertThat(handler.isErrorHandler(), is(true)); }", "tokens": 19} {"id": 588427, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public void processWithLengthAndMetadata() throws Exception { UploadInfo info = new UploadInfo(); info.setOffset(2L); info.setLength(10L); info.setEncodedMetadata(\"encoded-metadata\"); when(uploadStorageService.getUploadInfo(nullable(String.class), nullable(String.class))) .thenReturn(info); handler.process( HttpMethod.HEAD, new TusServletRequest(servletRequest), new TusServletResponse(servletResponse), uploadStorageService, null); assertThat(servletResponse.getHeader(HttpHeader.UPLOAD_METADATA), is(\"encoded-metadata\")); assertThat(servletResponse.getHeader(HttpHeader.UPLOAD_DEFER_LENGTH), is(nullValue())); }", "tokens": 131} {"id": 588450, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public void testProcessWithLockingService() throws Exception { TusServletRequest request = mock(TusServletRequest.class); TusServletResponse response = mock(TusServletResponse.class); UploadStorageService storageService = mock(UploadStorageService.class); UploadLockingService lockingService = mock(UploadLockingService.class); when(request.getHeader(HttpHeader.CONTENT_LENGTH)).thenReturn(\"5\"); when(response.getHeader(HttpHeader.LOCATION)).thenReturn(\"/files/123\"); when(request.getContentInputStream()).thenReturn(new ByteArrayInputStream(\"hello\".getBytes())); UploadInfo uploadInfo = new UploadInfo(); uploadInfo.setLength(10L); uploadInfo.setOffset(0L); UploadInfo updatedInfo = new UploadInfo(); updatedInfo.setLength(10L); updatedInfo.setOffset(5L); when(storageService.getUploadInfo(\"/files/123\", \"owner\")).thenReturn(uploadInfo); when(storageService.append(eq(uploadInfo), any(InputStream.class))).thenReturn(updatedInfo); handler.process( HttpMethod.POST, request, response, storageService, lockingService, \"owner\", null); ArgumentCaptor captor = ArgumentCaptor.forClass(InterruptibleInputStream.class); verify(lockingService).registerInputStream(eq(\"/files/123\"), captor.capture()); assertNotNull(captor.getValue()); verify(response).setHeader(HttpHeader.UPLOAD_OFFSET, \"5\"); }", "tokens": 280} {"id": 588530, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public void testNullParameters() throws Exception { // Calling process with null response or storageService should return without error or setting // headers handler.process( HttpMethod.POST, new TusServletRequest(servletRequest), null, uploadStorageService, null); handler.process( HttpMethod.POST, new TusServletRequest(servletRequest), new TusServletResponse(servletResponse), null, null); assertThat( servletResponse.getHeader(HttpHeader.UPLOAD_LIMIT), org.hamcrest.CoreMatchers.nullValue()); }", "tokens": 92} {"id": 588619, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public void testCloudUploadThreadPoolSizeConfiguration() { assertEquals( \"Default thread pool size is 10\", 10, storageService.getCloudUploadThreadPoolSize()); storageService.setCloudUploadThreadPoolSize(30); assertEquals( \"Updated thread pool size is 30\", 30, storageService.getCloudUploadThreadPoolSize()); storageService.setCloudUploadThreadPoolSize(4); assertEquals(\"Reduced thread pool size is 4\", 4, storageService.getCloudUploadThreadPoolSize()); try { storageService.setCloudUploadThreadPoolSize(0); org.junit.Assert.fail(\"Should reject 0 pool size\"); } catch (IllegalArgumentException expected) { assertTrue(expected.getMessage().contains(\"greater than 0\")); } try { storageService.setCloudUploadThreadPoolSize(-1); org.junit.Assert.fail(\"Should reject negative pool size\"); } catch (IllegalArgumentException expected) { assertTrue(expected.getMessage().contains(\"greater than 0\")); } }", "tokens": 200} {"id": 588684, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public void create() throws Exception { UploadInfo info = new UploadInfo(); info.setLength(10L); info.setEncodedMetadata(\"Encoded Metadata\"); info = storageService.create(info, null); assertThat(info.getId(), is(notNullValue())); assertThat(info.getOffset(), is(0L)); assertThat(info.getLength(), is(10L)); assertThat(info.getEncodedMetadata(), is(\"Encoded Metadata\")); assertTrue(Files.exists(getUploadInfoPath(info.getId()))); }", "tokens": 100} {"id": 588697, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public void testGetUploadInfoByChecksumWithNullValues() throws Exception { // 1. null checksum should return null assertThat( storageService.getUploadInfoByChecksum(null, ChecksumAlgorithm.SHA256), is(nullValue())); // 2. null algorithm should return null assertThat( storageService.getUploadInfoByChecksum( \"ba7816bc4335da0d4435913c04792c254db9c9363b8968b92b2313fa1d01f98b\", null), is(nullValue())); }", "tokens": 130} {"id": 588730, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public void testRenewLeaseWithNullLockDirShouldBeNoOp() { LeaseData leaseData = createLeaseData(\"holder\", \"/uri\", 10000L); LeaseFileUploadLock lock = new LeaseFileUploadLock(leaseData, null, null, null); // Should safely do nothing without throwing exception lock.renewLease(); assertEquals(\"holder\", lock.getHolderId()); lock.close(); }", "tokens": 85} {"id": 588846, "source": "method", "repo": "tomdesair/tus-java-server", "text": "public void setIntHeader() throws Exception { tusServletResponse.setIntHeader(\"TEST\", 1); tusServletResponse.setIntHeader(\"TEST\", 2); assertThat(tusServletResponse.getHeader(\"TEST\"), is(\"2\")); assertThat(servletResponse.getHeaders(\"TEST\"), contains(\"2\")); }", "tokens": 60} {"id": 589080, "source": "method", "repo": "tomdodd4598/nuclearcraft", "text": "public Class getTileClass() { return tileClass; }", "tokens": 25} {"id": 589096, "source": "method", "repo": "tomdodd4598/nuclearcraft", "text": "public GuiItemRenderer size(int newWidth, int newHeight) { width = newWidth; height = newHeight; return this; }", "tokens": 29} {"id": 589101, "source": "method", "repo": "tomdodd4598/nuclearcraft", "text": "public void setTexturePosition() { textureX = value.getTextureX(); textureY = value.getTextureY(); }", "tokens": 25} {"id": 589214, "source": "method", "repo": "tomdodd4598/nuclearcraft", "text": "public static void registerGemCasting(String oreSuffix, String fluidName) { registerTableCasting(OreDictHelper.getPrioritisedCraftingStack(ItemStack.EMPTY, \"gem\" + oreSuffix), TinkerSmeltery.castGem, fluidName, GEM_VOLUME); registerTableCasting(OreDictHelper.getPrioritisedCraftingStack(ItemStack.EMPTY, \"nugget\" + oreSuffix), TinkerSmeltery.castNugget, fluidName, GEM_NUGGET_VOLUME); registerBasinCasting(OreDictHelper.getPrioritisedCraftingStack(ItemStack.EMPTY, \"block\" + oreSuffix), null, fluidName, GEM_BLOCK_VOLUME); }", "tokens": 148} {"id": 589286, "source": "method", "repo": "tomdodd4598/nuclearcraft", "text": "public CondenserRenderPacket getRenderPacket() { return new CondenserRenderPacket(multiblock.controller.getTilePos(), multiblock.shellTanks); }", "tokens": 37} {"id": 589291, "source": "method", "repo": "tomdodd4598/nuclearcraft", "text": "public boolean isBlockGoodForInterior(World world, BlockPos pos) { return true; }", "tokens": 21} {"id": 589307, "source": "method", "repo": "tomdodd4598/nuclearcraft", "text": "public MachineUpdatePacket getMultiblockUpdatePacket() { return new ElectrolyzerUpdatePacket(multiblock.controller.getTilePos(), multiblock.isMachineOn, multiblock.processor.isProcessing, multiblock.processor.time, multiblock.processor.baseProcessTime, multiblock.baseProcessPower, multiblock.tanks, multiblock.baseSpeedMultiplier, multiblock.basePowerMultiplier, multiblock.recipeUnitInfo, multiblock.readyToProcess, electrolyteEfficiency); }", "tokens": 96} {"id": 589337, "source": "method", "repo": "tomdodd4598/nuclearcraft", "text": "public String getSingleControlQasmLine(int control, int i) { return \"crx(\" + Math.toRadians(angle) + \") q[\" + control + \"], q[\" + i + \"];\"; }", "tokens": 48} {"id": 589461, "source": "method", "repo": "tomdodd4598/nuclearcraft", "text": "public boolean getIsRedstonePowered() { return isRedstonePowered; }", "tokens": 15} {"id": 589524, "source": "method", "repo": "tomdodd4598/nuclearcraft", "text": "public LongSet[] getPassiveModeratorCaches() { return passiveModeratorCaches; }", "tokens": 20} {"id": 589647, "source": "method", "repo": "tomdodd4598/nuclearcraft", "text": "public void onMachineAssembled(Machine multiblock) { doStandardNullControllerResponse(multiblock); super.onMachineAssembled(multiblock); if (!world.isRemote) { EnumFacing facing = getPartPosition().getFacing(); if (facing != null) { world.setBlockState(pos, world.getBlockState(pos).withProperty(AXIS_ALL, facing.getAxis()), 2); } } }", "tokens": 84} {"id": 589698, "source": "method", "repo": "tomdodd4598/nuclearcraft", "text": "public BUILDER setJeiTitle(String jeiTitle) { this.jeiTitle = jeiTitle; return getThis(); }", "tokens": 28} {"id": 589725, "source": "method", "repo": "tomdodd4598/nuclearcraft", "text": "public static int maxSize(String string) { int use; String longestWord = \"\"; while (!string.isEmpty()) { string = string.trim(); use = string.indexOf(\" \"); if (use < 0) { break; } String cut = string.substring(0, use); if (sizeString(cut) > sizeString(longestWord)) { longestWord = cut; } string = string.substring(use + 1); } return sizeString(longestWord); }", "tokens": 102} {"id": 589804, "source": "method", "repo": "tomsik68/mclauncher-api", "text": "/** @return port of this server(e.g. 25565) */ public final int getPort() { return port; }", "tokens": 32} {"id": 589875, "source": "method", "repo": "tomsik68/mclauncher-api", "text": "public boolean isRemember() { return pass.length() > 0; }", "tokens": 18} {"id": 589959, "source": "method", "repo": "tomsik68/mclauncher-api", "text": "public String getIcon() { return jsonObject.get(\"favicon\").toString(); }", "tokens": 16} {"id": 589978, "source": "method", "repo": "tomsik68/mclauncher-api", "text": "public void run() { MCLauncherAPI.log.fine(\"Starting server finder...\"); // create socket MulticastSocket socket = null; byte[] buffer = new byte[1024]; try { // assign it to group socket = new MulticastSocket(4445); socket.setSoTimeout(5000); socket.joinGroup(this.broadcastAddress); } catch (IOException e) { e.printStackTrace(); } // we will use single builder to build all FoundServerInfo objects final FoundServerInfoBuilder builder = new FoundServerInfoBuilder(); builder.finder(this); while (socket != null && isActive()) { // try to receive a packet DatagramPacket packet = new DatagramPacket(buffer, buffer.length); try { socket.receive(packet); } catch (SocketTimeoutException ign) { continue; } catch (Exception e) { // TODO: add option to handle this error! } // if packet was received successfully, String recvString = new String(packet.getData(), packet.getOffset(), packet.getLength()); String motd = ServerStringDecoder.parseProperty(recvString, \"MOTD\"); Integer port = Integer.parseInt(ServerStringDecoder.parseProperty(recvString, \"AD\")); MCLauncherAPI.log.finer(\"Discovered server: '\".concat(recvString).concat(\"'\")); // we can construct FoundServerInfo using given information builder.motd(motd).port(port).ip(packet.getAddress().getHostAddress()); builder.property(\"recvString\", recvString); FoundServerInfo server = builder.build(); // and notify all observers about it notifyObservers(server); } }", "tokens": 341} {"id": 590300, "source": "method", "repo": "tonivade/claudb", "text": "private int parsetTtl(SafeString param) { return Integer.parseInt(param.toString()); }", "tokens": 22} {"id": 590338, "source": "method", "repo": "tonivade/claudb", "text": "public RedisToken execute(Database db, Request request) { String channel = request.getParam(0).toString(); SafeString message = request.getParam(1); return integer(publishAll(getClauDB(request.getServerContext()), channel, message)); }", "tokens": 56} {"id": 590569, "source": "method", "repo": "tonivade/claudb", "text": "public OnHeapMVDatabaseFactory() { store = new MVStore.Builder().open(); }", "tokens": 21} {"id": 590615, "source": "method", "repo": "tonivade/claudb", "text": "public static KeySpace commandEvent(SafeString command, SafeString key, int schema) { return new KeySpace(command, key, schema); }", "tokens": 31} {"id": 590728, "source": "method", "repo": "tonivade/claudb", "text": "public void testLengthKO() { when(request.getLength()).thenReturn(1); DBCommandWrapper wrapper = new DBCommandWrapper(new LengthCommand()); RedisToken response = wrapper.execute(request); assertThat(response, equalTo(error(\"ERR wrong number of arguments for 'test' command\"))); }", "tokens": 64} {"id": 590919, "source": "method", "repo": "tonivade/claudb", "text": "public void pcall() { when(redis.pcall(safeString(\"echo\"), safeString(\"hello\"))).thenReturn(error(\"message\")); RedisToken token = interpreter.execute(safeString(\"return redis.pcall('echo', 'hello')\"), emptyList(), emptyList()); assertThat(token, equalTo(error(\"message\"))); }", "tokens": 73} {"id": 591008, "source": "method", "repo": "tonivade/purefun", "text": "public Tuple4 map1(Function1 mapper) { return Tuple4.of(mapper.apply(value1), value2, value3, value4); }", "tokens": 55} {"id": 591113, "source": "method", "repo": "tonivade/purefun", "text": "public PipelineWithInput take(int n) { return new PipelineWithInput<>(pipeline.take(n), input); }", "tokens": 31} {"id": 591748, "source": "method", "repo": "tonivade/purefun", "text": "private BufferedReader reader(String file) { try { return Files.newBufferedReader(Paths.get(file)); } catch (IOException e) { throw new UncheckedIOException(e); } }", "tokens": 39} {"id": 591758, "source": "method", "repo": "tonivade/purefun", "text": "static , A, B> Kleisli of( Function1> run, F...reified) { return of(Instances.monad(reified), run); }", "tokens": 67} {"id": 591791, "source": "method", "repo": "tonivade/purefun", "text": "default Kind, B> imap(Kind, ? extends A> value, Function1 map, Function1 comap) { Function1, Kind> map2 = ga -> g().imap(ga, map, comap); Function1, Kind> comap2 = gb -> g().imap(gb, comap, map); return nest(f().imap(unnest(value), map2, comap2)); }", "tokens": 152} {"id": 592036, "source": "method", "repo": "tools4j/unix4j", "text": "public Iterator iterator() { return input.iterator(); }", "tokens": 15} {"id": 592053, "source": "method", "repo": "tools4j/unix4j", "text": "public CharSequence subSequence(int start, int end) { final int clen = content.length(); final int elen = lineEnding.length(); if (start < clen && end <= clen) { return content.subSequence(start, end); } final int estart = start - clen; final int eend = end - clen; if (estart >= 0 && estart <= elen && eend >= 0 && eend <= elen) { return lineEnding.subSequence(estart, eend); } // overlaps the two strings final StringBuilder sb = new StringBuilder(clen + elen); return sb.append(content).append(lineEnding).subSequence(start, end); }", "tokens": 155} {"id": 592191, "source": "method", "repo": "tools4j/unix4j", "text": "/** Private constructor used to create the {@link #DEFAULT_INSTANCE}. */ private UnitsNumberStringComparator() { this(DecimalNumberStringComparator.getInstance()); }", "tokens": 34} {"id": 592302, "source": "method", "repo": "tools4j/unix4j", "text": "public CdCommand(CdArguments arguments) { super(Cd.NAME, arguments); }", "tokens": 22} {"id": 592352, "source": "method", "repo": "tools4j/unix4j", "text": "public WholeLineIgnoreCase(GrepArguments args) { super(args.getRegexp()); }", "tokens": 20} {"id": 592497, "source": "method", "repo": "tools4j/unix4j", "text": "public boolean processLine(Line line) { counters.update(line); return true;//we want to count all lines }", "tokens": 26} {"id": 592501, "source": "method", "repo": "tools4j/unix4j", "text": "public void incrementLineCount() { lineCount++; if ((lineCount % maxLines) == 0 && (runCountForLine == 0 || !items.isEmpty())) { invokeCommandAndClearAllItems(); runCountForLine = 0; } }", "tokens": 55} {"id": 592594, "source": "method", "repo": "tools4j/unix4j", "text": "public void testRelativePath() { assertThat(Unix4j.fromResource(FromFileOnClasspathTest.class, \"redneck-unix.txt\").grep(\"for\").grep(\"ask\").wc(Wc.Options.lines).toStringResult(), is(\"15\")); assertThat(Unix4j.fromResource(FromFileOnClasspathTest.class, \"redneck-unix.txt\").grep(\"for\").grep(\"ask\").wc(Wc.Options.words).wc(Wc.Options.lines).toStringResult(), is(\"1\")); }", "tokens": 117} {"id": 592653, "source": "method", "repo": "tools4j/unix4j", "text": "public void testSed_printQuietCaseDoesNotMatch() { final MultilineString expectedOutput = new MultilineString(); assertSed(input, \"Blah\", expectedOutput, Sed.Options.quiet);//should be the default command here assertSed(input, \"Blah\", expectedOutput, Sed.Options.n.p); assertSed(input, \"Blah\", expectedOutput, Sed.Options.print.quiet); assertStringArgs(input, expectedOutput, \"--quiet\", \"--regexp\", \"Blah\"); assertStringArgs(input, expectedOutput, \"--quiet\", \"--print\", \"--regexp\", \"Blah\"); assertStringArgs(input, expectedOutput, \"-n\", \"-p\", \"--regexp\", \"Blah\"); assertStringArgs( input, expectedOutput, \"-n\", \"/Blah/ p\"); assertStringArgs( input, expectedOutput, \"/Blah/ p\", \"--quiet\"); assertStringArgs( input, expectedOutput, \"-n\", \"/Blah/p\"); assertStringArgs( input, expectedOutput, \"/Blah/p\", \"--quiet\"); }", "tokens": 231} {"id": 592894, "source": "method", "repo": "toon-format/toon-java", "text": "/** Parses the value portion of an object item in a list, handling nested objects, empty values, and primitives. @param value the value string to parse @param depth the depth of the list item @param context decode an object to deal with lines, delimiter and options @return the parsed value (Map, List, or primitive) */ static Object parseObjectItemValue(final String value, final int depth, final DecodeContext context) { final boolean isEmpty = value.isEmpty(); // Find the next non-blank line and its depth final Integer nextDepth = DecodeHelper.findNextNonBlankLineDepth(context); // Handle empty value with nested content. // The list item is at depth, and the field itself is conceptually at depth + 1, // So nested content should be parsed with parentDepth = depth + 1 // This allows nested fields at depth + 2 or deeper to be processed correctly if (isEmpty && nextDepth != null && nextDepth > depth) { return parseNestedObject(depth + 1, context); } // Handle empty value without nested content or non-empty value return isEmpty ? new LinkedHashMap<>() : PrimitiveDecoder.parse(value, context); }", "tokens": 243} {"id": 593023, "source": "method", "repo": "toon-format/toon-java", "text": "void testDefaultMaxDepth() { // Given final DecodeOptions options = DecodeOptions.DEFAULT; // Then assertEquals(DEFAULT_MAX_DEPTH, options.maxDepth()); }", "tokens": 33} {"id": 593157, "source": "method", "repo": "toon-format/toon-java", "text": "void mixesObjectsAndArrays() { // Given final Map obj = obj( \"items\", list(obj(\"a\", 1), list(1, 2))); // Then assertEquals( \"\"\" items[2]: - a: 1 - [2]: 1,2\"\"\", encode(obj)); }", "tokens": 70} {"id": 593445, "source": "method", "repo": "toon-format/toon-java", "text": "void testNoLines() { // Given final LineWriter writer = new LineWriter(2); // Then assertEquals(\"\", writer.toString()); }", "tokens": 28} {"id": 593570, "source": "method", "repo": "toon-format/toon-java", "text": "void testUtilDate() { // Given final Date date = Date.from(Instant.parse(\"2023-10-15T14:30:45.123Z\")); // When final JsonNode result = JsonNormalizer.normalize(date); // Then assertTrue(result.isString()); assertEquals(\"2023-10-15\", result.asString()); }", "tokens": 85} {"id": 593622, "source": "method", "repo": "toon-format/toon-java", "text": "void tryNormalizePojo_thenNullNode() throws Exception { // Given final Object input = new Object(); // When final Object result = invokePrivateStatic(\"tryNormalizePojo\", new Class[]{Object.class}, input); // Then assertInstanceOf(ObjectNode.class, result); }", "tokens": 57} {"id": 593679, "source": "method", "repo": "toon-format/toon-java", "text": "void handlesTrailingBackslashCorrectly() { // Then // trailing \\ will set escaped=true but there is no next char \u2192 nothing appended assertEquals(\"abc\", StringEscaper.unescape(\"\\\"abc\\\\\\\"\")); }", "tokens": 40} {"id": 593869, "source": "method", "repo": "tootallnate/java-websocket", "text": "public void writeMore() throws IOException { write(outCrypt); }", "tokens": 15} {"id": 593937, "source": "method", "repo": "tootallnate/java-websocket", "text": "/** Constructs a WebSocketClient instance and sets it to the connect to the specified URI. The channel does not attampt to connect automatically. The connection will be established once you call connect. @param serverUri the server URI to connect to */ public WebSocketClient(URI serverUri) { this(serverUri, new Draft_6455()); }", "tokens": 78} {"id": 593976, "source": "method", "repo": "tootallnate/java-websocket", "text": "public InetSocketAddress getLocalSocketAddress(WebSocket conn) { if (socket != null) { return (InetSocketAddress) socket.getLocalSocketAddress(); } return null; }", "tokens": 34} {"id": 594030, "source": "method", "repo": "tootallnate/java-websocket", "text": "/** Getter for all available protocols for this draft @return the protocols which are enabled for this draft @since 1.3.7 */ public List getKnownProtocols() { return knownProtocols; }", "tokens": 47} {"id": 594049, "source": "method", "repo": "tootallnate/java-websocket", "text": "private byte[] toByteArray(long val, int bytecount) { byte[] buffer = new byte[bytecount]; int highest = 8 * bytecount - 8; for (int i = 0; i < bytecount; i++) { buffer[i] = (byte) (val >>> (highest - 8 * i)); } return buffer; }", "tokens": 77} {"id": 594271, "source": "method", "repo": "tootallnate/java-websocket", "text": "/** Encodes a byte array into Base64 notation.

Example options:

 GZIP: gzip-compresses object before encoding it. DO_BREAK_LINES: break lines at 76 characters Note: Technically, this makes your encoding non-compliant. 

Example: encodeBytes( myData, Base64.GZIP ) or

Example: encodeBytes( myData, Base64.GZIP | Base64.DO_BREAK_LINES )

As of v 2.3, if there is an error with the GZIP stream, the method will throw an java.io.IOException. This is new to v2.3! In earlier versions, it just returned a null value, but in retrospect that's a pretty poor way to handle it.

@param source The data to convert @param off Offset in array where conversion should begin @param len Length of data to convert @param options Specified options @return The Base64-encoded data as a String @throws java.io.IOException if there is an error @throws IllegalArgumentException if source array is null, if source array, offset, or length are invalid @see Base64#GZIP @see Base64#DO_BREAK_LINES @since 2.0 */ public static String encodeBytes(byte[] source, int off, int len, int options) throws java.io.IOException { byte[] encoded = encodeBytesToBytes(source, off, len, options); // Return value according to relevant encoding. try { return new String(encoded, PREFERRED_ENCODING); } catch (java.io.UnsupportedEncodingException uue) { return new String(encoded); } // end catch }", "tokens": 385} {"id": 594306, "source": "method", "repo": "tootallnate/java-websocket", "text": "public void postProcessHandshakeRequestAsClient() throws Exception { Draft_6455 draft_6455 = new Draft_6455(); HandshakeImpl1Client request = new HandshakeImpl1Client(); draft_6455.postProcessHandshakeRequestAsClient(request); assertEquals(\"websocket\", request.getFieldValue(\"Upgrade\")); assertEquals(\"Upgrade\", request.getFieldValue(\"Connection\")); assertEquals(\"13\", request.getFieldValue(\"Sec-WebSocket-Version\")); assertTrue(request.hasFieldValue(\"Sec-WebSocket-Key\")); assertFalse(request.hasFieldValue(\"Sec-WebSocket-Extensions\")); assertFalse(request.hasFieldValue(\"Sec-WebSocket-Protocol\")); ArrayList protocols = new ArrayList(); protocols.add(new Protocol(\"chat\")); draft_6455 = new Draft_6455(Collections.emptyList(), protocols); request = new HandshakeImpl1Client(); draft_6455.postProcessHandshakeRequestAsClient(request); assertFalse(request.hasFieldValue(\"Sec-WebSocket-Extensions\")); assertEquals(\"chat\", request.getFieldValue(\"Sec-WebSocket-Protocol\")); protocols.add(new Protocol(\"chat2\")); draft_6455 = new Draft_6455(Collections.emptyList(), protocols); request = new HandshakeImpl1Client(); draft_6455.postProcessHandshakeRequestAsClient(request); assertFalse(request.hasFieldValue(\"Sec-WebSocket-Extensions\")); assertEquals(\"chat, chat2\", request.getFieldValue(\"Sec-WebSocket-Protocol\")); protocols.clear(); protocols.add(new Protocol(\"\")); draft_6455 = new Draft_6455(Collections.emptyList(), protocols); request = new HandshakeImpl1Client(); draft_6455.postProcessHandshakeRequestAsClient(request); assertFalse(request.hasFieldValue(\"Sec-WebSocket-Extensions\")); assertFalse(request.hasFieldValue(\"Sec-WebSocket-Protocol\")); }", "tokens": 402} {"id": 594560, "source": "method", "repo": "tootallnate/java-websocket", "text": "public void onWebsocketClosing(WebSocket ws, int code, String reason, boolean remote) { }", "tokens": 21} {"id": 594655, "source": "method", "repo": "tordanik/osm2world", "text": "public MapRelation getMapRelation(long id) { for (MapRelation relation : mapRelations) { if (relation.getId() == id) { return relation; } } return null; }", "tokens": 41} {"id": 594661, "source": "method", "repo": "tordanik/osm2world", "text": "public Collection getAdjacentAreas() { return adjacentAreas; }", "tokens": 19} {"id": 594695, "source": "method", "repo": "tordanik/osm2world", "text": "public void perform() { /* determine points and neighbors (4 each) of the quadrangle */ VectorXYZ[] points = new VectorXYZ[4]; points[0] = originalTriangles[0].getPoint(1); neighbors[0] = originalTriangles[0].getNeighbor(1); points[1] = originalTriangles[0].getPoint(2); neighbors[1] = originalTriangles[0].getNeighbor(2); int i = originalTriangles[1].indexOfNeighbor(originalTriangles[0]); points[2] = originalTriangles[1].getPoint((i + 1) % 3); neighbors[2] = originalTriangles[1].getNeighbor((i + 1) % 3); points[3] = originalTriangles[1].getPoint((i + 2) % 3); neighbors[3] = originalTriangles[1].getNeighbor((i + 2) % 3); /* build two new triangles for the quadrangle */ createdTriangles = new DelaunayTriangle[2]; createdTriangles[0] = new DelaunayTriangle( points[2], points[3], points[1]); createdTriangles[1] = new DelaunayTriangle( points[3], points[0], points[1]); createdTriangles[0].setNeighbor(0, neighbors[2]); createdTriangles[0].setNeighbor(1, createdTriangles[1]); createdTriangles[0].setNeighbor(2, neighbors[1]); createdTriangles[1].setNeighbor(0, neighbors[3]); createdTriangles[1].setNeighbor(1, neighbors[0]); createdTriangles[1].setNeighbor(2, createdTriangles[0]); if (neighbors[0] != null) neighbors[0].replaceNeighbor(originalTriangles[0], createdTriangles[1]); if (neighbors[1] != null) neighbors[1].replaceNeighbor(originalTriangles[0], createdTriangles[0]); if (neighbors[2] != null) neighbors[2].replaceNeighbor(originalTriangles[1], createdTriangles[0]); if (neighbors[3] != null) neighbors[3].replaceNeighbor(originalTriangles[1], createdTriangles[1]); }", "tokens": 466} {"id": 594807, "source": "method", "repo": "tordanik/osm2world", "text": "public LineSegmentXZ getSegmentXZ() { return new LineSegmentXZ(p1.xz(), p2.xz()); }", "tokens": 27} {"id": 595068, "source": "method", "repo": "tordanik/osm2world", "text": "public AerowayJunction(MapNode node) { super(node, AerowaySegment.class); }", "tokens": 26} {"id": 595213, "source": "method", "repo": "tordanik/osm2world", "text": "public boolean isEmpty() { return walls.isEmpty() && rooms.isEmpty() && areas.isEmpty(); }", "tokens": 26} {"id": 595292, "source": "method", "repo": "tordanik/osm2world", "text": "public OSMData getAllData() throws IOException { if (!file.exists()) { throw new FileNotFoundException(file.toString()); } if (!isJOSMGenerated(file)) { /* try to read file using osm4j */ try (FileInputStream is = new FileInputStream(file)) { return new OSMStreamReader(is, CompressionMethod.fromFileName(file.getName()), false).getAllData(); } catch (IOException e) { System.out.println(\"could not read file, trying workaround for files created by JOSM\"); } } /* try reading the file while taking into account JOSM-specific extensions */ try (FileInputStream is = new FileInputStream(file)) { return new OSMStreamReader(is, CompressionMethod.fromFileName(file.getName()), true).getAllData(); } catch (Exception e2) { throw new IOException(\"could not read OSM file (not even with workaround for JOSM files)\", e2); } }", "tokens": 204} {"id": 595444, "source": "method", "repo": "tordanik/osm2world", "text": "public void actionPerformed(ActionEvent arg0) { File osmFile = askFile(); if (osmFile != null) { openOSMFile(osmFile, true); } }", "tokens": 40} {"id": 595849, "source": "method", "repo": "tr7zw/item-nbt-api", "text": "/** Sets data inside the Compound @param comp @param type @param key @param data */ public static void setData(NBTCompound comp, ReflectionMethod type, String key, Object data) { if (data == null) { remove(comp, key); return; } Object rootnbttag = comp.getCompound(); if (rootnbttag == null) { rootnbttag = ObjectCreator.NMS_NBTTAGCOMPOUND.getInstance(); } if (!validCompound(comp)) throw new NbtApiException(\"The Compound wasn't able to be linked back to the root!\"); Object workingtag = getToCompount(rootnbttag, comp); type.run(workingtag, key, data); comp.setCompound(rootnbttag); }", "tokens": 152} {"id": 596115, "source": "method", "repo": "tranxactive/j2pay", "text": "public JSONObject getApiSampleParameters() { return new JSONObject() .put(MERCHANT_ID, \"the merchant id\") .put(PUBLIC_KEY, \"the public key\") .put(PRIVATE_KEY, \"the private key\"); }", "tokens": 55} {"id": 596168, "source": "method", "repo": "tranxactive/j2pay", "text": "private JSONObject buildPurchaseParameters(JSONObject apiParameters, Customer customer, CustomerCard customerCard, Currency currency, float amount) { return new JSONObject() .put(\"TRXTYPE\", \"S\") .put(\"TENDER\", \"C\") .put(\"USER\", apiParameters.getString(\"USER\")) .put(\"VENDOR\", apiParameters.getString(\"VENDOR\")) .put(\"PWD\", apiParameters.getString(\"PWD\")) .put(\"PARTNER\", apiParameters.getString(\"PARTNER\")) .put(\"ACCT\", customerCard.getNumber()) .put(\"CVV2\", customerCard.getCvv()) .put(\"EXPDATE\", customerCard.getExpiryMonth() + customerCard.getExpiryYear().substring(2)) .put(\"AMT\", amount) .put(\"BILLTOFIRSTNAME\", customer.getFirstName()) .put(\"BILLTOLASTNAME\", customer.getLastName()) .put(\"BILLTOSTREET\", customer.getAddress()) .put(\"BILLTOCITY\", customer.getCity()) .put(\"BILLTOSTATE\", customer.getState()) .put(\"BILLTOZIP\", customer.getZip()) .put(\"BILLTOCOUNTRY\", customer.getCountry().getNumericCode()) .put(\"CUSTIP\", customer.getIp()) .put(\"VERBOSITY\", \"HIGH\") .put(\"RECURRING\", \"Y\") .put(\"PROFILENAME\", getUniqueCustomerId()) .put(\"ACTION\", \"A\"); }", "tokens": 323} {"id": 596270, "source": "method", "repo": "tranxactive/j2pay", "text": "/** This method is the wrapper of apache http client post request. @param url The url on which the request will be hit. @param postParams parameters which will be passed for post. @param contentType content-type in which data will be posted. @param headers To add additional headers otherwise pass null. @return The HTTPResponse class. @see com.tranxactive.j2pay.net.HTTPResponse @see ContentType */ public static HTTPResponse httpPost(String url, String postParams, ContentType contentType, HashMap headers) { return httpPost(url, postParams, contentType, null, headers); }", "tokens": 136} {"id": 596311, "source": "method", "repo": "trautonen/coveralls-maven-plugin", "text": "private void handleSubmissionError(final T ex, final String message, final boolean failOnException) throws T { if (failOnException) { getLog().error(message); throw ex; } else { getLog().warn(message); } }", "tokens": 55} {"id": 596410, "source": "method", "repo": "trautonen/coveralls-maven-plugin", "text": "public void log(final Log log) { if (dryRun) { log.info(\"Dry run enabled, Coveralls report will NOT be submitted to API\"); log.info(coverallsFile.length() + \" bytes of data was recorded in \" + coverallsFile.getAbsolutePath()); } }", "tokens": 60} {"id": 596496, "source": "method", "repo": "trautonen/coveralls-maven-plugin", "text": "/** Defaults to no-op implementation. @see #onComplete() @throws ProcessingException if processing fails @throws IOException if an I/O error occurs */ protected void onCompleteInternal() throws ProcessingException, IOException { }", "tokens": 48} {"id": 596598, "source": "method", "repo": "trautonen/coveralls-maven-plugin", "text": "public void testParseErrorousResponse() throws Exception { StatusLine statusLine = new BasicStatusLine(HttpVersion.HTTP_1_1, 400, \"Bad Request\"); when(httpClientMock.execute(any(HttpUriRequest.class))).thenReturn(httpResponseMock); when(httpResponseMock.getStatusLine()).thenReturn(statusLine); when(httpResponseMock.getEntity()).thenReturn(httpEntityMock); when(httpEntityMock.getContent()).thenReturn(coverallsResponse(new CoverallsResponse(\"failure\", true, \"submission failed\"))); CoverallsClient client = new CoverallsClient(\"http://test.com/coveralls\", httpClientMock, new ObjectMapper()); client.submit(file); }", "tokens": 135} {"id": 596708, "source": "method", "repo": "trautonen/coveralls-maven-plugin", "text": "public void testIsSelectedForWercker() { assertTrue(new Wercker(env()).isSelected()); }", "tokens": 23} {"id": 596823, "source": "method", "repo": "tree-sitter/java-tree-sitter", "text": "/** Get another reference to the language. @since 0.24.0 */ public Language clone() { return new Language(ts_language_copy(self)); }", "tokens": 37} {"id": 596889, "source": "method", "repo": "tree-sitter/java-tree-sitter", "text": "/** Get the smallest named node within this node that spans the given point range, if any. @throws IllegalArgumentException If {@code start > end}. */ public Optional getNamedDescendant(Point start, Point end) { if (start.compareTo(end) > 0) { throw new IllegalArgumentException(\"Start point %s exceeds end point %s\".formatted(start, end)); } MemorySegment startPoint = start.into(arena), endPoint = end.into(arena); return optional(ts_node_named_descendant_for_point_range(arena, self, startPoint, endPoint)); }", "tokens": 137} {"id": 596964, "source": "method", "repo": "tree-sitter/java-tree-sitter", "text": "/** Iterate over all the matches in the order that they were found.

Because multiple patterns can match the same set of nodes, one match may contain captures that appear before some of the captures from a previous match. @param node The node that the query will run on. @implNote The lifetime of the matches is bound to that of the cursor. */ public Stream findMatches(Node node) { return findMatches(node, arena, null); }", "tokens": 108} {"id": 596974, "source": "method", "repo": "tree-sitter/java-tree-sitter", "text": "protected QueryError(@NonNull String message) { super(message, null); }", "tokens": 17} {"id": 596986, "source": "method", "repo": "tree-sitter/java-tree-sitter", "text": "public String toString() { return String.format( \"QueryMatch[patternIndex=%s, captures=%s]\", Integer.toUnsignedString(patternIndex), captures); }", "tokens": 36} {"id": 597080, "source": "method", "repo": "tree-sitter/java-tree-sitter", "text": "void getType() { assertEquals(\"program\", node.getType()); }", "tokens": 14} {"id": 597140, "source": "method", "repo": "tree-sitter/java-tree-sitter", "text": "private static void assertCursor(Consumer assertions) { assertCursor(source, assertions); }", "tokens": 23} {"id": 597317, "source": "method", "repo": "trekawek/coffee-gb", "text": "public void rejectsFirstSideLiesAndObservedRowOrderLies() { List firstSideLie = new ArrayList<>(); for (String line : syntheticSummaryLog(61.0, 62.0)) { if (line.contains(\"matrix_block=\" + blockName(0)) && line.contains(\"first_side=parent\")) { line = line.replace(\"first_side=parent\", \"first_side=candidate\"); } firstSideLie.add(line); } BenchmarkMatrix.Report firstSideReport = parse(firstSideLie, 7L, BenchmarkMatrix.BOOTSTRAP_RESAMPLES); assertFalse(firstSideReport.accepted()); assertContains(firstSideReport.errors(), \"declares first_side=candidate but the earlier matrix_run is parent\"); List rowOrderLie = new ArrayList<>(); for (String line : syntheticSummaryLog(61.0, 62.0)) { if (line.contains(\"matrix_block=\" + blockName(0)) && line.contains(\"effective_mode=sgb2\")) { line = line.replace(\"row_order=0\", \"row_order=1\"); } else if (line.contains(\"matrix_block=\" + blockName(0)) && line.contains(\"effective_mode=cgb-dmg-compat\")) { line = line.replace(\"row_order=1\", \"row_order=0\"); } rowOrderLie.add(line); } BenchmarkMatrix.Report rowOrderReport = parse(rowOrderLie, 8L, BenchmarkMatrix.BOOTSTRAP_RESAMPLES); assertFalse(rowOrderReport.accepted()); assertContains(rowOrderReport.errors(), \"observed row sgb2 at order 0\"); }", "tokens": 377} {"id": 597351, "source": "method", "repo": "trekawek/coffee-gb", "text": "/** Physical-DMG counterpart to {@link #runPerformanceEpoch(int)}. This path is deliberately separate so native CGB retains its fixed two-dot hot loop. @return master ticks consumed by the CPU epoch */ public int runPhysicalDmgPerformanceEpoch(int maxMasterTicks) { return runPhysicalDmgPerformanceEpoch(maxMasterTicks, 0); }", "tokens": 75} {"id": 597454, "source": "method", "repo": "trekawek/coffee-gb", "text": "/** Same output-before-pop sequence as count scalar dots, without payload publication. Used in 4/2/2 groups so the fetcher's map/D0/D1 reads retain their original clocks. */ void advanceSteadyBackgroundPixelsTrusted(int count) { if (count <= 0 || count > 8 || linePixels + count > 160) { throw new IllegalStateException(\"Invalid timing background pixel span\"); } background.dequeueSpanTrusted(count); spriteFifo.popEmptySpanTrusted(count); outputTicks += count; linePixels += count; delayHead = (delayHead + delaySize + count - 1) & 7; delaySize = 1; }", "tokens": 149} {"id": 597570, "source": "method", "repo": "trekawek/coffee-gb", "text": "public boolean accepts(int address) { return (address >= 0x0000 && address < 0x8000) || (address >= 0xa000 && address < 0xc000); }", "tokens": 54} {"id": 597636, "source": "method", "repo": "trekawek/coffee-gb", "text": "public boolean isDacEnabled() { return dacEnabled; }", "tokens": 15} {"id": 597772, "source": "method", "repo": "trekawek/coffee-gb", "text": "private static boolean rawAcknowledgeSurvives( InterruptEntrySignalMachine.Model model, int requestDistance) { return requestDistance > (model.cgb() ? 8 : 4); }", "tokens": 43} {"id": 597822, "source": "method", "repo": "trekawek/coffee-gb", "text": "public void frameCallbackRemainsAtTheCanonicalCpuGpuStatBoundary()throws Exception{ for(HardwareProfile profile:GpuNativeVblankHistoryTest.PROFILES)try(Gameboy a=rich(profile,0x93,0xb3,143,432);Gameboy b=rich(profile,0x93,0xb3,143,432)){ Recorder x=new Recorder(a),y=new Recorder(b);((Display)field(a,\"display\")).init(x);((Display)field(b,\"display\")).init(y); long frames=b.getPerformanceNativeFrames();assertEquals(8,packet(b,54));for(int i=0;i<8;i++)a.tick(); assertTrue(x.frames.isEmpty());assertTrue(y.frames.isEmpty());assertEquals(frames,b.getPerformanceNativeFrames()); for(int i=0;i<32;i++)assertEquals(a.tick(),b.tick()); assertEquals(1,x.frames.size());assertEquals(1,y.frames.size()); assertStateEquals(\"callback order and fully published CPU/GPU/IF/frame\",x.frames,y.frames); assertStateEquals(\"after VBlank callback\",a.captureStateWithoutTimeSource(),b.captureStateWithoutTimeSource()); } }", "tokens": 296} {"id": 597871, "source": "method", "repo": "trekawek/coffee-gb", "text": "private static Op refreshOverlay(int[] oldLine, int[] newLine, int fromIndex, int attribute) { return new Op(Kind.REFRESH_OVERLAY, null, oldLine, newLine, attribute, fromIndex, 0, 0, 0); }", "tokens": 58} {"id": 598000, "source": "method", "repo": "trekawek/coffee-gb", "text": "private static int[] attrChr(int x, int y, int count, int style) { int dataBytes = inRange(count, 1, 360) ? (count + 3) / 4 : 1; int[] payload = new int[5 + dataBytes]; payload[0] = x; payload[1] = y; payload[2] = count & 0xff; payload[3] = count >>> 8 & 0xff; payload[4] = style; for (int i = 0; i < dataBytes; i++) { payload[5 + i] = 0x1b; } if ((count & 3) != 0 && count > 0) { payload[payload.length - 1] &= 0xff << (8 - (count & 3) * 2); } return command(0x07, Math.min(6, packetsForPayload(payload.length)), payload); }", "tokens": 211} {"id": 598034, "source": "method", "repo": "trekawek/coffee-gb", "text": "public void powerOffAndWaveAccessOnlyReportWritesAcceptedByTheApu() { Sound cgb = newSound(true); RecordingHooks cgbHooks = new RecordingHooks(); cgb.setDebugHooks(cgbHooks); cgb.setByte(0xff26, 0x00); cgbHooks.events.clear(); cgb.setByte(0xff12, 0xf0); cgb.setByte(0xff26, 0x00); assertEquals(List.of( event(ApuTrace.Kind.REGISTER_WRITTEN, -1, 0xff26, 0x00)), cgbHooks.events); Sound dmg = newSound(false); RecordingHooks dmgHooks = new RecordingHooks(); dmg.setDebugHooks(dmgHooks); dmg.setByte(0xff1a, 0x80); dmg.setByte(0xff1e, 0x80); dmgHooks.events.clear(); dmg.setByte(0xff30, 0x55); assertEquals(List.of(), dmgHooks.events); dmg.setByte(0xff26, 0x00); dmgHooks.events.clear(); dmg.setByte(0xff11, 0x3f); assertEquals(List.of( event(ApuTrace.Kind.REGISTER_WRITTEN, 1, 0xff11, 0x3f)), dmgHooks.events); }", "tokens": 326} {"id": 598173, "source": "method", "repo": "trekawek/coffee-gb", "text": "public void productionClassesExposeOnlyTheInternalRuntimeArtworkPath() throws Exception { Path classes = Paths.get(MenuArtwork.class.getProtectionDomain().getCodeSource() .getLocation().toURI()); if (Files.isDirectory(classes)) { assertTrue(Files.isRegularFile(classes.resolve( \"eu/rekawek/coffeegb/ui/menu/artwork/proposal3/templates/\" + MenuArtworkCatalog.COMMON_TEMPLATE_FILENAME))); assertFalse(Files.exists(classes.resolve( \"eu/rekawek/coffeegb/ui/menu/artwork/proposal3/routes/templates\"))); assertFalse(Files.exists(classes.resolve( \"eu/rekawek/coffeegb/ui/menu/artwork/proposal3/routes/raw\"))); assertFalse(Files.exists(classes.resolve(\"eu/rekawek/coffeegb/ui/menu/artwork/proposal3/source\"))); } }", "tokens": 200} {"id": 598221, "source": "method", "repo": "triumphteam/triumph-gui", "text": "/** Sets the pattern at the specified index @param index the index @param color the pattern color @param pattern the pattern type @return {@link BannerBuilder} @throws IndexOutOfBoundsException when index is not in [0, {@link BannerMeta#numberOfPatterns()}) range @since 3.0.1 */ public BannerBuilder pattern(final int index, @NotNull final DyeColor color, @NotNull final PatternType pattern) { return pattern(index, new Pattern(color, pattern)); }", "tokens": 102} {"id": 598242, "source": "method", "repo": "triumphteam/triumph-gui", "text": "/** Sets the item model of the item Added in 1.21.4 @param modelKey The item model key from the resource pack @return {@link ItemBuilder} @since 3.1.14 */ public B model(final NamespacedKey modelKey) { if (SET_ITEM_MODEL != null) { try { SET_ITEM_MODEL.invoke(meta, modelKey); } catch (IllegalAccessException | InvocationTargetException e) { throw new GuiException(\"Could not invoke setItemModel method.\", e); } } return (B) this; }", "tokens": 117} {"id": 598394, "source": "method", "repo": "triumphteam/triumph-gui", "text": "/** Alternative {@link #updateItem(int, ItemStack)} but creates a new {@link GuiItem}. @param slot The slot of the item to update. @param item The {@link GuiItem} to replace in the original. */ public void updateItem(final int slot, @NotNull final GuiItem item) { guiItems.put(slot, item); inventory.setItem(slot, item.getItemStack()); }", "tokens": 87} {"id": 598567, "source": "method", "repo": "tryghost/ghost-android", "text": "public void stop() { getBus().unregister(this); }", "tokens": 14} {"id": 598580, "source": "method", "repo": "tryghost/ghost-android", "text": "public static void logPublishedPostUpdated(String postUrl) { logPostAction(\"Published post updated\", postUrl); }", "tokens": 26} {"id": 598740, "source": "method", "repo": "tryghost/ghost-android", "text": "public void setSlug(String slug) { this.slug = slug; }", "tokens": 17} {"id": 598769, "source": "method", "repo": "tryghost/ghost-android", "text": "public boolean hasPendingAction(@PendingAction.Type String type) { for (PendingAction action : getPendingActions()) { if (type.equals(action.getType())) { return true; } } return false; }", "tokens": 46} {"id": 598815, "source": "method", "repo": "tryghost/ghost-android", "text": "public void onDeletePostEvent(DeletePostEvent event) { String postId = event.post.getId(); Log.i(TAG, \"[onDeletePostEvent] post id = %s\", postId); Post realmPost = mRealm.where(Post.class).equalTo(\"id\", postId).findFirst(); if (realmPost == null) { RuntimeException e = new IllegalArgumentException(\"Trying to delete post with non-existent id = \" + postId); Log.exception(e); } else if (realmPost.hasPendingAction(PendingAction.CREATE)) { deleteModel(realmPost); getBus().post(new PostDeletedEvent(postId)); } else { // don't delete locally until the remote copy is deleted clearAndSetPendingActionOnPost(realmPost, PendingAction.DELETE); getBus().post(new PostDeletedEvent(postId)); // DON'T trigger a sync here, because it is automatically triggered by the post list anyway // triggering it twice causes crashes due to invalid Realm objects (deleted twice) //getBus().post(new SyncPostsEvent(false)); } }", "tokens": 238} {"id": 598865, "source": "method", "repo": "tryghost/ghost-android", "text": "public TagStub(@NonNull Tag tag) { this.name = tag.getName(); }", "tokens": 19} {"id": 598868, "source": "method", "repo": "tryghost/ghost-android", "text": "private AppState(@NonNull Context context) { super(context.getApplicationContext(), PREFS_FILE_NAME); }", "tokens": 26} {"id": 598970, "source": "method", "repo": "tryghost/ghost-android", "text": "public void onTranslateClicked(View v) { AppUtils.openUri(this, URL_TRANSLATE); }", "tokens": 24} {"id": 599059, "source": "method", "repo": "tryghost/ghost-android", "text": "private void refreshData(boolean loadCachedData) { getBus().post(new RefreshDataEvent(loadCachedData)); mHandler.postDelayed(mRefreshTimeoutRunnable, REFRESH_TIMEOUT); }", "tokens": 42} {"id": 599232, "source": "method", "repo": "tryghost/ghost-android", "text": "private void init() { mTokenPattern = Pattern.compile(\"[^,]+\"); setOnItemClickListener(this); addTextChangedListener(mTextWatcher); // regenerate chips when user taps \"Done\" action on the keyboard setOnEditorActionListener((view, actionId, event) -> { if (actionId == EditorInfo.IME_ACTION_DONE) { updateChips(); // don't consume the event, so the keyboard can also be hidden // http://stackoverflow.com/questions/2342620/how-to-hide-keyboard-after-typing-in-edittext-in-android#comment20849208_10184099 return false; } return false; }); }", "tokens": 162} {"id": 599318, "source": "method", "repo": "tsantalis/refactoringminer", "text": "public void testNestedExtractMethodStatementMappings3() throws Exception { GitHistoryRefactoringMiner miner = new GitHistoryRefactoringMinerImpl(); Repository repo = gitService.cloneIfNotExists( REPOS + \"/jadx\", \"https://github.com/skylot/jadx.git\"); final List actual = new ArrayList<>(); miner.detectAtCommit(repo, \"2d8d4164830631d3125575f055b417c5addaa22f\", new RefactoringHandler() { @Override public void handle(String commitId, List refactorings) { List parentMappers = new ArrayList<>(); for (Refactoring ref : refactorings) { if(ref instanceof ExtractOperationRefactoring) { ExtractOperationRefactoring ex = (ExtractOperationRefactoring)ref; if(!ex.getSourceOperationBeforeExtraction().getClassName().equals(\"jadx.core.utils.RegionUtils\")) { UMLOperationBodyMapper bodyMapper = ex.getBodyMapper(); if(!bodyMapper.isNested()) { if(!parentMappers.contains(bodyMapper.getParentMapper())) { parentMappers.add(bodyMapper.getParentMapper()); } } mapperInfo(bodyMapper, actual); } } } for(UMLOperationBodyMapper parentMapper : parentMappers) { mapperInfo(parentMapper, actual); } } }); List expected = IOUtils.readLines(new FileReader(System.getProperty(\"user.dir\") + \"/src-test/Data/jadx-2d8d4164830631d3125575f055b417c5addaa22f.txt\")); Assertions.assertTrue(expected.size() == actual.size() && expected.containsAll(actual) && actual.containsAll(expected)); }", "tokens": 400} {"id": 599380, "source": "method", "repo": "tsantalis/refactoringminer", "text": "public ClusterParameterGroupStatus clone() { try { return (ClusterParameterGroupStatus) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( \"Got a CloneNotSupportedException from Object.clone() \" + \"even though we're Cloneable!\", e); } }", "tokens": 64} {"id": 599490, "source": "method", "repo": "tsantalis/refactoringminer", "text": "/** ArrayUtils instances should NOT be constructed in standard programming. Instead, the class should be used as {@code ArrayUtils.clone(new int[] {2})}.

This constructor is public to permit tools that require a JavaBean instance to operate.

*/ public ArrayUtils() { }", "tokens": 64} {"id": 599556, "source": "method", "repo": "tsantalis/refactoringminer", "text": "DiscoverEnums(JSTypeRegistry registry) { this.registry = registry; }", "tokens": 18} {"id": 599639, "source": "method", "repo": "tsantalis/refactoringminer", "text": "/** Test a Node. @param node to test @param test to execute @return true if node passes test */ public static boolean testNode(Node node, NodeTest test) { if (test == null) { return true; } if (test instanceof NodeNameTest) { if (node.getNodeType() != Node.ELEMENT_NODE) { return false; } NodeNameTest nodeNameTest = (NodeNameTest) test; QName testName = nodeNameTest.getNodeName(); String namespaceURI = nodeNameTest.getNamespaceURI(); boolean wildcard = nodeNameTest.isWildcard(); String testPrefix = testName.getPrefix(); if (wildcard && testPrefix == null) { return true; } if (wildcard || testName.getName() .equals(DOMNodePointer.getLocalName(node))) { String nodeNS = DOMNodePointer.getNamespaceURI(node); return equalStrings(namespaceURI, nodeNS) || nodeNS == null && equalStrings(testPrefix, getPrefix(node)); } return false; } if (test instanceof NodeTypeTest) { int nodeType = node.getNodeType(); switch (((NodeTypeTest) test).getNodeType()) { case Compiler.NODE_TYPE_NODE : return nodeType == Node.ELEMENT_NODE || nodeType == Node.DOCUMENT_NODE; case Compiler.NODE_TYPE_TEXT : return nodeType == Node.CDATA_SECTION_NODE || nodeType == Node.TEXT_NODE; case Compiler.NODE_TYPE_COMMENT : return nodeType == Node.COMMENT_NODE; case Compiler.NODE_TYPE_PI : return nodeType == Node.PROCESSING_INSTRUCTION_NODE; } return false; } if (test instanceof ProcessingInstructionTest) { if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) { String testPI = ((ProcessingInstructionTest) test).getTarget(); String nodePI = ((ProcessingInstruction) node).getTarget(); return testPI.equals(nodePI); } } return false; }", "tokens": 420} {"id": 599649, "source": "method", "repo": "tsantalis/refactoringminer", "text": "/** Create a complex number given the real and imaginary parts. @param realPart Real part. @param imaginaryPart Imaginary part. @return a new complex number instance. @since 1.2 @see #valueOf(double, double) */ protected Complex createComplex(double realPart, double imaginaryPart) { return new Complex(realPart, imaginaryPart); }", "tokens": 91} {"id": 599847, "source": "method", "repo": "tsantalis/refactoringminer", "text": "public String jpaEntityName() { return jpaEntityName; }", "tokens": 16} {"id": 599872, "source": "method", "repo": "tsantalis/refactoringminer", "text": "public CacheInvocationBuilder setOnlyPrimary(boolean onlyPrimary) { this.onlyPrimary = onlyPrimary; return this; }", "tokens": 26} {"id": 599907, "source": "method", "repo": "tsantalis/refactoringminer", "text": "public String getName() { return \"Radix sort\"; }", "tokens": 12} {"id": 599923, "source": "method", "repo": "tsantalis/refactoringminer", "text": "/** Get the values for all type parameters declared on this type. The list can be empty for raw types. */ public List typeParametersValues() { return this.typeParametersMap.isEmpty() ? Collections.emptyList() : typeDeclaration.getTypeParameters().stream().map(tp -> typeParametersMap.getValue(tp)).collect(Collectors.toList()); }", "tokens": 77} {"id": 599933, "source": "method", "repo": "tsantalis/refactoringminer", "text": "public Set zrevrangeByLex(final byte[] key, final byte[] max, final byte[] min) { return new JedisClusterCommand>(connectionHandler, maxRedirections) { @Override public Set execute(Jedis connection) { return connection.zrangeByLex(key, max, min); } }.runBinary(key); }", "tokens": 84} {"id": 599935, "source": "method", "repo": "tsantalis/refactoringminer", "text": "public byte[] echo(byte[] arg) { Jedis j = getShard(arg); return j.echo(arg); }", "tokens": 27} {"id": 600022, "source": "method", "repo": "tsantalis/refactoringminer", "text": "public long relationshipCreate( int relationshipTypeId, long startNodeId, long endNodeId ) throws RelationshipTypeIdNotFoundKernelException, EntityNotFoundException { statement.assertOpen(); return dataWrite().relationshipCreate( statement, relationshipTypeId, startNodeId, endNodeId ); }", "tokens": 59} {"id": 600166, "source": "method", "repo": "tsantalis/refactoringminer", "text": "private void loadBeanDefinitionsFromImportedResources( Map> importedResources) { Map, BeanDefinitionReader> readerInstanceCache = new HashMap, BeanDefinitionReader>(); for (Map.Entry> entry : importedResources.entrySet()) { String resource = entry.getKey(); Class readerClass = entry.getValue(); // Default reader selection necessary? if (readerClass.equals(BeanDefinitionReader.class)) { if (StringUtils.endsWithIgnoreCase(resource, \".groovy\")) { // When clearly asking for Groovy, that's what they'll get... readerClass = GroovyBeanDefinitionReader.class; } else { // Primarily \".xml\" files but for any other extension as well readerClass = XmlBeanDefinitionReader.class; } } BeanDefinitionReader reader = readerInstanceCache.get(readerClass); if (reader == null) { try { // Instantiate the specified BeanDefinitionReader reader = readerClass.getConstructor(BeanDefinitionRegistry.class).newInstance(this.registry); // Delegate the current ResourceLoader to it if possible if (reader instanceof AbstractBeanDefinitionReader) { AbstractBeanDefinitionReader abdr = ((AbstractBeanDefinitionReader) reader); abdr.setResourceLoader(this.resourceLoader); abdr.setEnvironment(this.environment); } readerInstanceCache.put(readerClass, reader); } catch (Exception ex) { throw new IllegalStateException( \"Could not instantiate BeanDefinitionReader class [\" + readerClass.getName() + \"]\"); } } // TODO SPR-6310: qualify relative path locations as done in AbstractContextLoader.modifyLocations reader.loadBeanDefinitions(resource); } }", "tokens": 367} {"id": 600173, "source": "method", "repo": "tsantalis/refactoringminer", "text": "private void validateConstructorArgument( Class constructorClass, String nestedPath, String name, @Nullable Object value) { Object[] hints = null; if (this.targetType != null && this.targetType.getSource() instanceof MethodParameter parameter) { for (Annotation ann : parameter.getParameterAnnotations()) { hints = ValidationAnnotationUtils.determineValidationHints(ann); if (hints != null) { break; } } } if (hints == null) { return; } for (Validator validator : getValidatorsToApply()) { if (validator instanceof SmartValidator smartValidator) { boolean isNested = !nestedPath.isEmpty(); if (isNested) { getBindingResult().pushNestedPath(nestedPath.substring(0, nestedPath.length() - 1)); } try { smartValidator.validateValue(constructorClass, name, value, getBindingResult(), hints); } catch (IllegalArgumentException ex) { // No corresponding field on the target class... } if (isNested) { getBindingResult().popNestedPath(); } } } }", "tokens": 221} {"id": 600346, "source": "method", "repo": "ttdyce/nhentai-nhviewer", "text": "protected void onPostExecute(Boolean success) { dialog.dismiss(); String actionCapital = qrData.action.substring(0, 1).toUpperCase() + qrData.action.substring(1); if (success) Toast.makeText(activityRef.get().getApplicationContext(), actionCapital + \" finished! \", Toast.LENGTH_SHORT).show(); else Toast.makeText(activityRef.get().getApplicationContext(), actionCapital + \" failed :(\", Toast.LENGTH_SHORT).show(); activityRef.get().finish(); }", "tokens": 115} {"id": 600546, "source": "method", "repo": "tuituidan/team-nav", "text": "private static String rgbToHex(int rgb) { return String.format(\"#%06X\", (0xFFFFFF & rgb)); }", "tokens": 29} {"id": 600718, "source": "method", "repo": "turkraft/spring-filter", "text": "public Expression process(FilterExpressionTransformer transformer, FunctionNode source) { transformer.registerTargetType(source.getArgument(0), Number.class); return transformer .getCriteriaBuilder() .abs((Expression) transformer.transform(source.getArgument(0))); }", "tokens": 60} {"id": 600798, "source": "method", "repo": "turkraft/spring-filter", "text": "void orNestedInsideAndTest() { TestEntity noMatch = new TestEntity(); noMatch.setInteger(0); noMatch.setIntegers(Collections.emptyList()); noMatch.setStrings(Collections.singletonList(\"x\")); entityManager.persist(noMatch); TestEntity matchViaScalarWithEmptyIntegers = new TestEntity(); matchViaScalarWithEmptyIntegers.setInteger(10); matchViaScalarWithEmptyIntegers.setIntegers(Collections.emptyList()); matchViaScalarWithEmptyIntegers.setStrings(Collections.singletonList(\"x\")); entityManager.persist(matchViaScalarWithEmptyIntegers); TestEntity noMatchWrongStrings = new TestEntity(); noMatchWrongStrings.setInteger(10); noMatchWrongStrings.setIntegers(Collections.singletonList(999)); noMatchWrongStrings.setStrings(Collections.singletonList(\"y\")); entityManager.persist(noMatchWrongStrings); TestEntity matchViaIntegersMember = new TestEntity(); matchViaIntegersMember.setInteger(0); matchViaIntegersMember.setIntegers(Collections.singletonList(999)); matchViaIntegersMember.setStrings(Collections.singletonList(\"x\")); entityManager.persist(matchViaIntegersMember); test(\"\"\" select t from TestEntity t where 'x' member of t.strings and (t.integer > 5 or 999 member of t.integers) \"\"\", fb.field(\"strings\").equal(fb.input(\"x\")) .and( fb.field(\"integer\").greaterThan(fb.input(5)) .or(fb.field(\"integers\").equal(fb.input(999))) ).get()); }", "tokens": 354} {"id": 600854, "source": "method", "repo": "turkraft/spring-filter", "text": "public SignFunction() { super(\"sign\"); }", "tokens": 11} {"id": 600909, "source": "method", "repo": "turkraft/spring-filter", "text": "public JsonNode transformPriority(PriorityNode node) { return transform(node.getNode()); }", "tokens": 19} {"id": 600939, "source": "method", "repo": "turkraft/spring-filter", "text": "public String getMongoOperator() { return \"$lt\"; }", "tokens": 13} {"id": 601051, "source": "method", "repo": "turkraft/spring-filter", "text": "public Map getFlags() { return flags; }", "tokens": 16} {"id": 601157, "source": "method", "repo": "turkraft/spring-filter", "text": "public String withFieldsAnnotation() { return \"ok\"; }", "tokens": 13} {"id": 601373, "source": "method", "repo": "turkraft/springfilter", "text": "public String getExample() { return \"orders is empty\"; }", "tokens": 15} {"id": 601521, "source": "method", "repo": "turkraft/springfilter", "text": "public boolean isCollectionDbRefField(Class klass, final String path) { Field field = referenceDollarField(klass, path); return field != null && Collection.class.isAssignableFrom(field.getType()); }", "tokens": 45} {"id": 601561, "source": "method", "repo": "turkraft/springfilter", "text": "void mapValueBetweenCoercesBoundsTest() { test(\"\"\" { \"$and\": [ { \"$gte\": [\"$counters.views\", 5] }, { \"$lte\": [\"$counters.views\", 10] } ] } \"\"\", fb .field(\"counters.views\") .between(fb.input(\"5\"), fb.input(\"10\")) .get()); }", "tokens": 91} {"id": 601791, "source": "method", "repo": "twilio/twilio-java", "text": "public TwilioResponse createWithResponse() { return createWithResponse(Twilio.getRestClient()); }", "tokens": 21} {"id": 601927, "source": "method", "repo": "twilio/twilio-java", "text": "public Map getDetails() { return details; }", "tokens": 16} {"id": 601984, "source": "method", "repo": "twilio/twilio-java", "text": "/** Create a Response from content string and status code. @param content content string @param statusCode status code */ public Response(final String content, final int statusCode) { this(content, statusCode, null); }", "tokens": 44} {"id": 602003, "source": "method", "repo": "twilio/twilio-java", "text": "public String fetchAccessToken() { TokenCreator tokenCreator = Token.creator(grantType).setClientId(clientId).setClientSecret(clientSecret); if (this.code != null) tokenCreator.setCode(code); if (this.redirectUri != null) tokenCreator.setRedirectUri(redirectUri); if (this.audience != null) tokenCreator.setAudience(audience); if (this.refreshToken != null) tokenCreator.setRefreshToken(refreshToken); if (this.scope != null) tokenCreator.setScope(scope); Token token = tokenCreator.create(); return token.getAccessToken(); }", "tokens": 126} {"id": 602252, "source": "method", "repo": "twilio/twilio-java", "text": "public static void assertUrlsEqual(final String expected, final String actual) { String[] expectedParts = expected.split(\"[?#]\"); String[] actualParts = actual.split(\"[?#]\"); assertEquals(expectedParts.length, actualParts.length); assertEquals(expectedParts[0], actualParts[0]); if (expectedParts.length >= 2) { assertQueryStringsEqual(expectedParts[1], actualParts[1]); } if (expectedParts.length == 3) { assertEquals(expectedParts[2], actualParts[2]); } }", "tokens": 116} {"id": 602280, "source": "method", "repo": "twilio/twilio-java", "text": "public void testNoPagingDefaults() { Reader reader = new CallReader(); Assert.assertNull(reader.getLimit()); Assert.assertNull(reader.getPageSize()); }", "tokens": 36} {"id": 602731, "source": "method", "repo": "twilio/video-quickstart-android", "text": "public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action.equals(ACTION_REGISTRATION)) { handleRegistration(intent); } else if (action.equals(ACTION_VIDEO_NOTIFICATION)) { handleVideoNotificationIntent(intent); } }", "tokens": 60} {"id": 602797, "source": "method", "repo": "twilio/video-quickstart-android", "text": "private void requestPermissionForCameraMicrophoneAndBluetooth() { String[] permissionsList; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) { permissionsList = new String[] { Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO, Manifest.permission.BLUETOOTH_CONNECT }; } else { permissionsList = new String[] {Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO}; } requestPermissions(permissionsList); }", "tokens": 107} {"id": 602799, "source": "method", "repo": "twilio/video-quickstart-android", "text": "private void connectToRoom(String roomName) { audioSwitch.activate(); ConnectOptions.Builder connectOptionsBuilder = new ConnectOptions.Builder(accessToken).roomName(roomName); /* * Add local audio track to connect options to share with participants. */ if (localAudioTrack != null) { connectOptionsBuilder.audioTracks(Collections.singletonList(localAudioTrack)); } /* * Add local video track to connect options to share with participants. */ if (localVideoTrack != null) { connectOptionsBuilder.videoTracks(Collections.singletonList(localVideoTrack)); } /* * Set the preferred audio and video codec for media. */ connectOptionsBuilder.preferAudioCodecs(Collections.singletonList(audioCodec)); connectOptionsBuilder.preferVideoCodecs(Collections.singletonList(videoCodec)); /* * Set the sender side encoding parameters. */ connectOptionsBuilder.encodingParameters(encodingParameters); /* * Toggles automatic track subscription. If set to false, the LocalParticipant will receive * notifications of track publish events, but will not automatically subscribe to them. If * set to true, the LocalParticipant will automatically subscribe to tracks as they are * published. If unset, the default is true. Note: This feature is only available for Group * Rooms. Toggling the flag in a P2P room does not modify subscription behavior. */ connectOptionsBuilder.enableAutomaticSubscription(enableAutomaticSubscription); room = Video.connect(this, connectOptionsBuilder.build(), roomListener()); setDisconnectAction(); }", "tokens": 307} {"id": 602801, "source": "method", "repo": "twilio/video-quickstart-android", "text": "private void updateAudioDeviceIcon(AudioDevice selectedAudioDevice) { if (null != audioDeviceMenuItem) { int audioDeviceMenuIcon = R.drawable.ic_phonelink_ring_white_24dp; if (selectedAudioDevice instanceof BluetoothHeadset) { audioDeviceMenuIcon = R.drawable.ic_bluetooth_white_24dp; } else if (selectedAudioDevice instanceof WiredHeadset) { audioDeviceMenuIcon = R.drawable.ic_headset_mic_white_24dp; } else if (selectedAudioDevice instanceof Earpiece) { audioDeviceMenuIcon = R.drawable.ic_phonelink_ring_white_24dp; } else if (selectedAudioDevice instanceof Speakerphone) { audioDeviceMenuIcon = R.drawable.ic_volume_up_white_24dp; } audioDeviceMenuItem.setIcon(audioDeviceMenuIcon); } }", "tokens": 189} {"id": 602918, "source": "method", "repo": "twilio/voice-quickstart-android", "text": "private static boolean arePermissionsGranted(Context context) { return (PackageManager.PERMISSION_GRANTED == ActivityCompat.checkSelfPermission(context, Manifest.permission.MANAGE_OWN_CALLS)); }", "tokens": 39} {"id": 602950, "source": "method", "repo": "twilio/voice-quickstart-android", "text": "public void onTerminate() { // Note: this method is not called when running on device, devices just kill the process. serviceConnectionManager.unbind(); super.onTerminate(); }", "tokens": 38} {"id": 602992, "source": "method", "repo": "twilio/voice-quickstart-android", "text": "public void onReconnecting(@NonNull Call call, @NonNull CallException callException) { log.debug(\"Reconnecting: \" + logException(callException)); // find call record final UUID callId = Objects.requireNonNull(findAssociatedCallId(call)); // notify observers for (Observer observer: observerList) { observer.onReconnecting(callId, callException); } }", "tokens": 81} {"id": 603046, "source": "method", "repo": "twilio/voice-quickstart-android", "text": "public void playDisconnect() { if (loaded && !playing) { soundPool.play(disconnectSoundId, volume, volume, 1, 0, 1f); playing = false; } }", "tokens": 45} {"id": 603208, "source": "method", "repo": "twiliodeved/api-snippets", "text": "public static String CreateTemplate() { var twilioMedia = new Content.TwilioMedia(); twilioMedia.setBody(\"Thank you for your order {{1}}\"); twilioMedia.setMedia(Arrays.asList(\"https://twilio-cms-prod.s3.amazonaws.com/images/library-logo-resource2x.width-1000.png\")); var types = new Content.Types(); types.setTwilioMedia(twilioMedia); var createRequest = new Content.ContentCreateRequest(\"en\", types); createRequest.setFriendlyName(\"media_template\"); createRequest.setVariables(Map.of( \"1\", \"order_number\" )); var content = Content.creator(createRequest).create(); return content.getSid(); }", "tokens": 161} {"id": 603520, "source": "method", "repo": "twiliodeved/api-snippets", "text": "public static void main(String[] args) { Twilio.init(ACCOUNT_SID, AUTH_TOKEN); ResourceSet transcriptions = Transcription.reader().read(); // Loop over transcriptions and print out a property for each one. for (Transcription transcription : transcriptions) { System.out.println(transcription.getTranscriptionText()); } }", "tokens": 76} {"id": 603642, "source": "method", "repo": "twiliodeved/api-snippets", "text": "public static void main(String[] args) { Number number = new Number.Builder(\"+15551239876\").build(); Dial dial = new Dial.Builder().record(Dial.Record.RECORD_FROM_ANSWER).recordingTrack(\"inbound\").recordingStatusCallback(\"https://www.myexample.com/recording-handler\").number(number).build(); VoiceResponse response = new VoiceResponse.Builder().dial(dial).build(); try { System.out.println(response.toXml()); } catch (TwiMLException e) { e.printStackTrace(); } }", "tokens": 126} {"id": 603690, "source": "method", "repo": "twiliodeved/api-snippets", "text": "public static void main(String[] args) { Sip sip = new Sip.Builder(\"sip:kate@example.com\") .statusCallback(\"https://myapp.com/calls/events\") .statusCallbackMethod(HttpMethod.POST).statusCallbackEvents(Arrays .asList(Sip.Event.INITIATED, Sip.Event.RINGING, Sip.Event.ANSWERED, Sip.Event.COMPLETED)).build(); Dial dial = new Dial.Builder().sip(sip).build(); VoiceResponse response = new VoiceResponse.Builder().dial(dial).build(); try { System.out.println(response.toXml()); } catch (TwiMLException e) { e.printStackTrace(); } }", "tokens": 158} {"id": 603926, "source": "method", "repo": "twitch4j/twitch4j", "text": "/** Inbound Raid Event Constructor @param event Raw Message Event @param channel ChatChannel receiving the raid @param raider User who is sending the raid @param viewers number of viewers from the raid */ public RaidEvent(IRCMessageEvent event, EventChannel channel, EventUser raider, Integer viewers) { super(channel); this.messageEvent = event; this.raider = raider; this.viewers = viewers; }", "tokens": 111} {"id": 603948, "source": "method", "repo": "twitch4j/twitch4j", "text": "private static TwitchChat getChatInstance(int maxRetries, boolean removeChannelOnJoinFailure) { // spy on EventManager EventManager eventManager = new EventManager(); eventManager.autoDiscovery(); eventManager.setDefaultEventHandler(SimpleEventHandler.class); // synchronous execution is best suited for tests // spy on TwitchChat TwitchChat twitchChat = Mockito.spy( TwitchChatBuilder.builder() .withEventManager(Mockito.spy(eventManager)) .withRemoveChannelOnJoinFailure(removeChannelOnJoinFailure) .withMaxJoinRetries(maxRetries) .withChatJoinTimeout(100L) // reduce the duration of test executions .build() ); return twitchChat; }", "tokens": 150} {"id": 604051, "source": "method", "repo": "twitch4j/twitch4j", "text": "public Class getEventClass() { return AutomodSettingsUpdateEvent.class; }", "tokens": 23} {"id": 604147, "source": "method", "repo": "twitch4j/twitch4j", "text": "public Class getEventClass() { return StreamOnlineEvent.class; }", "tokens": 21} {"id": 604235, "source": "method", "repo": "twitch4j/twitch4j", "text": "public boolean unregister(@NotNull EventSubSubscription subscription) { if (subscription.getId() == null && subscription.getType() == null) throw new IllegalArgumentException(\"Subscription to be unregistered is invalid\"); if (subscription.getTransport() != null && !conduitId.equals(subscription.getTransport().getConduitId())) throw new IllegalArgumentException(\"Specified subscription is not registered with this Conduit\"); String token = credential != null ? credential.getAccessToken() : null; String id; if (subscription.getId() != null) { id = subscription.getId(); } else { try { // noinspection OptionalGetWithoutIsPresent id = api.getEventSubSubscriptions(token, EventSubSubscriptionStatus.ENABLED, subscription.getType(), null, null, null).execute().getSubscriptions().stream().filter(sub -> conduitId.equals(sub.getTransport().getConduitId())).findAny().map(EventSubSubscription::getId).get(); } catch (Exception e) { log.warn(\"Specified subscription is not actively registered to this Conduit with ID {}: {}\", conduitId, subscription, e); return false; } } try { api.deleteEventSubSubscription(token, id).execute(); return true; } catch (Exception e) { log.warn(\"Failed to delete EventSub subscription from Conduit with ID {}: {}\", conduitId, subscription, e); return false; } }", "tokens": 290} {"id": 604302, "source": "method", "repo": "twitch4j/twitch4j", "text": "protected ApolloCall getGraphQLCall() { return apolloClient.query( FetchSquadStreamQuery.builder() .id(id) .build() ); }", "tokens": 44} {"id": 604307, "source": "method", "repo": "twitch4j/twitch4j", "text": "/** Constructor @param apolloClient Apollo Client @param channelLogin The login name of the channel whose vip list is being queried @param cursor Relay cursor for forward pagination (optional) @param limit The maximum number of nodes to return in a single call */ public CommandFetchVips(ApolloClient apolloClient, String channelLogin, String cursor, Integer limit) { super(apolloClient); this.channelLogin = channelLogin; this.cursor = cursor; this.limit = limit != null ? limit : 100; }", "tokens": 109} {"id": 604362, "source": "method", "repo": "twitch4j/twitch4j", "text": "/** Event Listener: Anyone follows the specified channel. @param credential {@link OAuth2Credential} @param channelId the id for the channel @return PubSubSubscription @deprecated Twitch has silently disabled this topic, even for first-party moderator tokens. You should migrate to eventsub (websocket) channel.follow v2 subscription type. */ // https://github.com/twitchdev/issues/issues/843 default PubSubSubscription listenForFollowingEvents(OAuth2Credential credential, String channelId) { return listenOnTopic(PubSubType.LISTEN, credential, \"following.\" + channelId); }", "tokens": 127} {"id": 604451, "source": "method", "repo": "twitch4j/twitch4j", "text": "public String topicName() { return \"chat_moderator_actions\"; }", "tokens": 15} {"id": 604769, "source": "method", "repo": "typemeta/funcj", "text": "public float asFloat() { return ((float)numer) / denom; }", "tokens": 20} {"id": 604867, "source": "method", "repo": "typemeta/funcj", "text": "public void registerArgArrayCtor(Class clazz, ArgArrayTypeCtor typeCtor) { delegate.registerArgArrayCtor(clazz, typeCtor); }", "tokens": 43} {"id": 604921, "source": "method", "repo": "typemeta/funcj", "text": "public BooleanData(Init init) { super( true, false, new Boolean[]{false, true}, new Boolean[]{false}, arrayList(true, false, true), treeSet(false, true), treeMap(\"a\", false, \"b\", true), hashMap(\"c\", true, \"d\", false), hashMap(\"c\", true, \"d\", false), treeMap(\"e\", true, \"f\", true), Optional.empty(), Optional.of(true) ); this.val = true; this.valArr = new boolean[]{true, false}; this.valArrArr = new boolean[][]{{true, false}, {false, true}, null}; this.listVal = arrayList(false, true, false); this.mapStrVal = treeMap(\"f\", false, \"g\", true); }", "tokens": 174} {"id": 604926, "source": "method", "repo": "typemeta/funcj", "text": "public DoubleData() { this.val = 0; this.valArr = null; this.valArrArr = null; this.listVal = null; this.mapStrVal = null; }", "tokens": 44} {"id": 604937, "source": "method", "repo": "typemeta/funcj", "text": "private ShouldFail() { this.simpleType = null; }", "tokens": 14} {"id": 604960, "source": "method", "repo": "typemeta/funcj", "text": "public OutStream encode(CodecCoreEx core, float[] value, OutStream out) { out.startArray(); for (float val : value) { floatCodec().encodePrim(val, out); } return out.endArray(); }", "tokens": 60} {"id": 604984, "source": "method", "repo": "typemeta/funcj", "text": "public Number readNumber() { checkTokenType(JsonEvent.Type.NUMBER); final String value = ((JsonEvent.JNumber) currentEvent()).value; processCurrentEvent(); try { return NumberFormat.getInstance().parse(value); } catch (ParseException ex) { final String excerpt = value.length() > 16 ? value.substring(0, 16) + \"...\" : value; throw raiseError(\"Number token '\" + excerpt + \"' is not a valid number\"); } }", "tokens": 105} {"id": 605157, "source": "method", "repo": "typemeta/funcj", "text": "public Option map(F6 f) { return map(f.curry()); }", "tokens": 40} {"id": 605279, "source": "method", "repo": "typemeta/funcj", "text": "/** Partially apply this function to three values. @param a the first value @param b the second value @param c the third value @return the partially applied function */ default F3 partial(A a, B b, C c) { return (d, e, g) -> apply(a, b, c, d, e, g); }", "tokens": 85} {"id": 605298, "source": "method", "repo": "typemeta/funcj", "text": "/** Convert an curried function to its uncurried equivalent. @param f the curried function @param the function's first argument type @param the function's second argument type @param the function's third argument type @param the function's fourth argument type @param the function's fifth argument type @param the function's sixth argument type @param the function's seventh argument type @param the function's return type @param the exception type @return the uncurried function */ static F7 uncurry( F, X>, X>, X>, X>, X>, X> f) { return (a, b, c, d, e, g, h) -> f.apply(a).apply(b).apply(c).apply(d).apply(e).apply(g).apply(h); }", "tokens": 285} {"id": 605526, "source": "method", "repo": "typemeta/funcj", "text": "public A getOrThrow() { throw new RuntimeException( \"Failure at position \" + input.position() + \", error=\" + error ); }", "tokens": 32} {"id": 605613, "source": "method", "repo": "uber-archive/phabricator-jenkins-plugin", "text": "private void addShortText(final AbstractBuild build) { build.addAction(PhabricatorPostbuildAction.createShortText(\"master\", null)); }", "tokens": 31} {"id": 605648, "source": "method", "repo": "uber-archive/phabricator-jenkins-plugin", "text": "private Set getCoverageReports(Run build) { Set reports = new HashSet<>(); File[] foundReports = build.getRootDir().listFiles(COVERAGE_FILENAME_FILTER); if (foundReports != null) { Collections.addAll(reports, foundReports); } return reports; }", "tokens": 64} {"id": 605751, "source": "method", "repo": "uber-archive/phabricator-jenkins-plugin", "text": "public XmlCoverageProvider(Set coverageReports, Set includeFiles) { super(includeFiles); this.coverageReports = coverageReports; this.xmlCoverageHandlers = Arrays.asList(new CoberturaXmlCoverageHandler(), new CloverXmlCoverageHandler(), new JacocoXmlCoverageHandler()); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setValidating(false); dbf.setNamespaceAware(true); DocumentBuilder localDb = null; try { dbf.setFeature(\"http://xml.org/sax/features/namespaces\", false); dbf.setFeature(\"http://xml.org/sax/features/validation\", false); dbf.setFeature(\"http://apache.org/xml/features/nonvalidating/load-dtd-grammar\", false); dbf.setFeature(\"http://apache.org/xml/features/nonvalidating/load-external-dtd\", false); localDb = dbf.newDocumentBuilder(); } catch (ParserConfigurationException e) { e.printStackTrace(); } db = localDb; cc = new CoverageCounters(); }", "tokens": 239} {"id": 606125, "source": "method", "repo": "uber/nullaway", "text": "private void writeAnnotations(String inPath, String outFile) throws IOException { Preconditions.checkArgument( inPath.endsWith(\".jar\") || inPath.endsWith(\".aar\") || inPath.endsWith(\".class\"), \"invalid input path - %s\", inPath); LOG(DEBUG, \"DEBUG\", \"Writing Annotations to \" + outFile); new File(outFile).getParentFile().mkdirs(); if (inPath.endsWith(\".jar\")) { JarFile jar = new JarFile(inPath); JarOutputStream jarOS = new JarOutputStream(new FileOutputStream(outFile)); BytecodeAnnotator.annotateBytecodeInJar( jar, jarOS, nonnullParams, nullableReturns, stripJarSignatures, DEBUG); jarOS.close(); } else if (inPath.endsWith(\".aar\")) { ZipFile zip = new ZipFile(inPath); ZipOutputStream zipOS = new ZipOutputStream(new FileOutputStream(outFile)); BytecodeAnnotator.annotateBytecodeInAar( zip, zipOS, nonnullParams, nullableReturns, stripJarSignatures, DEBUG); zipOS.close(); } else { InputStream is = new FileInputStream(inPath); OutputStream os = new FileOutputStream(outFile); BytecodeAnnotator.annotateBytecodeInClass(is, os, nonnullParams, nullableReturns, DEBUG); os.close(); } }", "tokens": 293} {"id": 606193, "source": "method", "repo": "uber/nullaway", "text": "public String getString(T t) { return t != null ? t.toString() : \"\"; }", "tokens": 21} {"id": 606224, "source": "method", "repo": "uber/nullaway", "text": "protected String getSourceDirectory() { return System.getProperty(\"nullaway.autodispose.sources\"); }", "tokens": 20} {"id": 606497, "source": "method", "repo": "uber/nullaway", "text": "static WildcardType asWildcard(Type typeArg) { if (typeArg instanceof WildcardType wildcardType) { return wildcardType; } if (typeArg instanceof CapturedType capturedType) { return capturedType.wildcard; } return null; }", "tokens": 51} {"id": 607171, "source": "method", "repo": "uber/rides-android-sdk", "text": "public LoginButton(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); }", "tokens": 24} {"id": 607341, "source": "method", "repo": "uber/rides-android-sdk", "text": "public void getCodeFromUrl_whenValidAuthorizationCodePassed() throws LoginAuthenticationException { String redirectUrl = \"http://localhost:1234?code=\" + AUTH_CODE; assertThat(AuthUtils.parseAuthorizationCode(Uri.parse(redirectUrl))).isEqualTo(AUTH_CODE); }", "tokens": 62} {"id": 607355, "source": "method", "repo": "uber/rides-android-sdk", "text": "public void isLegacyMode_uninitialized_validState() { assertThat(legacyUriRedirectHandler.isLegacyMode()).isFalse(); assertNoDialogShown(); assertNoLogs(); }", "tokens": 35} {"id": 607409, "source": "method", "repo": "uber/rides-android-sdk", "text": "public void onActivityResult_whenUnavailableAndPrivilegedScopesNoRedirect_shouldError() { Intent intent = new Intent().putExtra(EXTRA_ERROR, AuthenticationError.UNAVAILABLE.toStandardString()); sessionConfiguration = sessionConfiguration.newBuilder().build(); loginManager = new LoginManager(accessTokenStorage, callback, sessionConfiguration) .setAuthCodeFlowEnabled(false); loginManager.onActivityResult(activity, REQUEST_CODE_LOGIN_DEFAULT, Activity.RESULT_CANCELED, intent); verify(callback).onLoginError(AuthenticationError.UNAVAILABLE); }", "tokens": 114} {"id": 607449, "source": "method", "repo": "uber/rides-android-sdk", "text": "public void isSupported_eatsAppInstalled_withProductPriority_shouldBeTrue() { when(appProtocol.isInstalled(activity, UBER, MIN_UBER_RIDES_VERSION_SUPPORTED)).thenReturn(false); when(appProtocol.isInstalled(activity, UBER_EATS, MIN_UBER_EATS_VERSION_SUPPORTED)).thenReturn(true); final SsoDeeplink link = new SsoDeeplink.Builder(activity) .clientId(CLIENT_ID) .scopes(GENERAL_SCOPES) .appProtocol(appProtocol) .productFlowPriority(ImmutableList.of(UBER_EATS)) .build(); assertThat(link.isSupported()).isTrue(); }", "tokens": 140} {"id": 607459, "source": "method", "repo": "uber/rides-android-sdk", "text": "public void execute_withoutAnyScopes_shouldFail() { enableSupport(DEFAULT); new SsoDeeplink.Builder(activity) .clientId(CLIENT_ID) .scopes(Collections.emptyList()) .customScopes(Collections.emptyList()) .activityRequestCode(REQUEST_CODE) .appProtocol(appProtocol) .build() .execute(); }", "tokens": 83} {"id": 607551, "source": "method", "repo": "uber/rides-android-sdk", "text": "RideRequestDeeplink.Builder setAppProtocol(@NonNull AppProtocol appProtocol){ this.appProtocol = appProtocol; return this; }", "tokens": 26} {"id": 607733, "source": "method", "repo": "uber/rides-java-sdk", "text": "/** Set first name @param firstName first name of the user */ public Builder firstName(@Nonnull String firstName) { this.firstName = firstName; return this; }", "tokens": 37} {"id": 607948, "source": "method", "repo": "uber/rides-java-sdk", "text": "/** Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier. */ public Float getSurgeMultiplier() { return surge_multiplier; }", "tokens": 51} {"id": 607970, "source": "method", "repo": "uber/rides-java-sdk", "text": "/** Gets the summation of the normal_fare and surge_charge. */ public String getSubTotal() { return subtotal; }", "tokens": 32} {"id": 608176, "source": "method", "repo": "ulisesbocchio/jasypt-spring-boot", "text": "private void reinitializeLoggingSystem() { log.info(\"Re-initializing Logging System\"); // Reinitialize logging system to pick up any encrypted properties used in logging configuration LoggingApplicationListener loggingListener = ((AbstractApplicationContext) this.applicationContext) .getApplicationListeners() .stream() .filter(LoggingApplicationListener.class::isInstance) .map(LoggingApplicationListener.class::cast) .findFirst() .orElse(null); ApplicationEnvironmentPreparedEvent applicationEnvironmentPreparedEvent = BootstrapSpringApplicationListener.getApplicationEnvironmentPreparedEvent(); if (loggingListener != null && applicationEnvironmentPreparedEvent != null) { LoggingSystem loggingSystem = LoggingSystem.get(applicationEnvironmentPreparedEvent.getSpringApplication().getClassLoader()); // Reset logging system loggingSystem.cleanUp(); for (LoggingSystemProperty property : LoggingSystemProperty.values()) { System.clearProperty(property.getEnvironmentVariableName()); } loggingListener.onApplicationEvent(applicationEnvironmentPreparedEvent); log.info(\"Logging System re-initialized by LoggingApplicationListener\"); } }", "tokens": 211} {"id": 608201, "source": "method", "repo": "ulisesbocchio/jasypt-spring-boot", "text": "/** Static method to enable getSource wrapping on EncryptableSystemEnvironmentPropertySourceWrapper. Can be called from both EnvironmentPostProcessor and BeanFactoryPostProcessor contexts. @param environment the ConfigurableEnvironment to process */ public static void enableGetSourceWrapping(ConfigurableEnvironment environment) { String sourceName = StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME; PropertySource propertySource = environment.getPropertySources().get(sourceName); log.info(\"Attempting to bootstrap EncryptableSystemEnvironmentPropertySourceWrapper\"); if (propertySource instanceof EncryptableSystemEnvironmentPropertySourceWrapper) { log.info(\"EncryptableSystemEnvironmentPropertySourceWrapper found! Bootstrapping...\"); ((EncryptableSystemEnvironmentPropertySourceWrapper)propertySource).setWrapGetSource(true); } }", "tokens": 147} {"id": 608270, "source": "method", "repo": "ulisesbocchio/jasypt-spring-boot", "text": "/**

getSecretKeySaltGenerator.

@return a {@link org.jasypt.salt.SaltGenerator} object */ public SaltGenerator getSecretKeySaltGenerator() { return saltGenerator != null ? saltGenerator : (secretKeySalt == null ? new ZeroSaltGenerator() : new FixedBase64ByteArraySaltGenerator(secretKeySalt)); }", "tokens": 73} {"id": 608297, "source": "method", "repo": "ulisesbocchio/jasypt-spring-boot", "text": "/**

Constructor for DecryptionException.

@param message a {@link java.lang.String} object */ public DecryptionException(final String message) { super(message); }", "tokens": 42} {"id": 608520, "source": "method", "repo": "umple/umple", "text": "private static MethodDescriptor[] getMdescriptor(){//GEN-HEADEREND:Methods // Here you can add code for customizing the methods array. return methods; }", "tokens": 34} {"id": 608547, "source": "method", "repo": "umple/umple", "text": "public void setPopupMenu(JPopupMenu popupMenu) { if (this.popupMenu != null) { popupMenu.removePopupMenuListener(handler); } this.popupMenu = popupMenu; if (this.popupMenu != null) { popupMenu.addPopupMenuListener(handler); } }", "tokens": 61} {"id": 608575, "source": "method", "repo": "umple/umple", "text": "public Collection createHandles(int detailLevel) { LinkedList handles = new LinkedList(); switch (detailLevel % 2) { case 0: ResizeHandleKit.addResizeHandles(this, handles); handles.add(new ODGRectRadiusHandle(this)); break; case 1: TransformHandleKit.addTransformHandles(this, handles); break; default: break; } return handles; }", "tokens": 94} {"id": 608658, "source": "method", "repo": "umple/umple", "text": "public Evaluation(Instances data) throws Exception { m_delegate = new weka.classifiers.evaluation.Evaluation(data); }", "tokens": 28} {"id": 608694, "source": "method", "repo": "umple/umple", "text": "/** Calc Node Score With Parent Deleted @param nNode node for which the score is calculate @param nCandidateParent candidate parent to delete from the existing parent set @return log score */ public double calcScoreWithMissingParent(int nNode, int nCandidateParent) { ParentSet oParentSet = m_BayesNet.getParentSet(nNode); // sanity check: nCandidateParent should be in parent set already if (!oParentSet.contains(nCandidateParent)) { return -1e100; } // set up candidate parent int iParent = oParentSet.deleteParent(nCandidateParent, m_BayesNet.m_Instances); // calculate the score double logScore = calcNodeScore(nNode); // restore temporarily deleted parent oParentSet.addParent(nCandidateParent, iParent, m_BayesNet.m_Instances); return logScore; }", "tokens": 197} {"id": 609110, "source": "method", "repo": "umple/umple", "text": "public AlphabeticTokenizerTest(String name) { super(name); }", "tokens": 16} {"id": 609160, "source": "method", "repo": "umple/umple", "text": "public void emptyFilter() { assertParse(\"600_emptyFilter.ump\", \"[filter]\"); Assert.assertNotNull(model.getFilter(null)); }", "tokens": 33} {"id": 609161, "source": "method", "repo": "umple/umple", "text": "public void oneState_StateMachineGraph_DFS() { assertParse(\"100_oneState_StateMachine.ump\", \"[classDefinition][name:LightFixture][stateMachine][inlineStateMachine][name:bulb][state][stateName:On]\"); UmpleClass c = model.getUmpleClass(\"LightFixture\"); StateMachine sm = c.getStateMachine(0); State startNode = sm.getStartState(); boolean isDFS = true; // Base case no walking StateMachineGraph graph = new StateMachineGraph(startNode, isDFS); Assert.assertEquals(isDFS, graph.isDepthFirst()); Assert.assertEquals(true, graph.hasNext()); Assert.assertEquals(true, startNode.getIsVisited()); Assert.assertEquals(startNode, graph.nextNode()); Assert.assertEquals(false, graph.hasNext()); }", "tokens": 171} {"id": 609200, "source": "method", "repo": "umple/umple", "text": "public void parseReqStArgumetToSatisfyFeatureModel_9() { FeatureModel featureModel = parseUnsatisfiedFeatureModel(\"reqStArgumentParse_NotvalidCombinedOpWithRoundBracket.ump\"); Assert.assertEquals(false,featureModel.satisfyFeatureModel()); }", "tokens": 61} {"id": 609222, "source": "method", "repo": "umple/umple", "text": "public void nativeCodeIsBracketedBySourceMarkersWhenItsStartIsKnown() throws Exception { UmpleModel model = generate(\"class X { }\"); PythonGenerator gen = generator(model); UmpleClass x = model.getUmpleClass(\"X\"); Assert.assertEquals(\"\\n # line 3 \\\"model.ump\\\"\\n return 1\\n # end line\", gen.nativeCode(\"return 1\", null, INDENT, new Position(new File(dir, \"model.ump\").getPath(), 3, 0, 0), x)); Assert.assertEquals(\"\\n return 1\", gen.nativeCode(\"return 1\", null, INDENT, null, x)); Assert.assertEquals(\"\\n pass\", gen.nativeCode(\" \", null, INDENT, new Position(\"model.ump\", 3, 0, 0), x)); }", "tokens": 181} {"id": 609349, "source": "method", "repo": "umple/umple", "text": "public String getUndoMsg() { return \"Returning \" + m_nodes.size() + \" from centering horizontally.\"; }", "tokens": 29} {"id": 609358, "source": "method", "repo": "umple/umple", "text": "public void MNToOne_RightTest() { Z_m_n__1 z = new Z_m_n__1(1); YR_m_n__1 y = new YR_m_n__1(z); z.delete(); Assert.assertEquals(null, y.getZVar()); Assert.assertEquals(0, z.getY_m_n__1().size()); }", "tokens": 93} {"id": 609368, "source": "method", "repo": "umple/umple", "text": "public void optionalOneToMNSetAndDelete(){ Z_0_1__m_n z1=new Z_0_1__m_n(1); Z_0_1__m_n z2=new Z_0_1__m_n(1); YR_0_1__m_n y1=new YR_0_1__m_n(new Z_0_1__m_n[]{z1, z2}); Assert.assertEquals(y1, z1.getY_0_1__m_n()); Assert.assertEquals(y1, z2.getY_0_1__m_n()); Assert.assertTrue(y1.getZVar().contains(z1)); Assert.assertTrue(y1.getZVar().contains(z2)); y1.delete(); Assert.assertNull(z1.getY_0_1__m_n()); Assert.assertNull(z2.getY_0_1__m_n()); Assert.assertEquals(0, y1.numberOfZVar()); }", "tokens": 238} {"id": 609506, "source": "method", "repo": "uncle-novel/uncle-novel", "text": "public void closeSetting() { settingDrawer.close(); }", "tokens": 13} {"id": 609512, "source": "method", "repo": "uncle-novel/uncle-novel", "text": "public SmoothScrollingTransition(ScrollPane contentHolder, double to) { super(contentHolder, new Timeline( new KeyFrame(Duration.millis(2000), new KeyValue(contentHolder.vvalueProperty(), to, Interpolator.EASE_BOTH))) ); setCycleDuration(Duration.seconds(1)); setDelay(Duration.seconds(0)); }", "tokens": 77} {"id": 609551, "source": "method", "repo": "uncle-novel/uncle-novel", "text": "public SearchBar() { NodeHelper.addClass(this, DEFAULT_STYLE_CLASS); this.input = new TextField(); HBox.setHgrow(input, Priority.ALWAYS); this.input.setPromptText(prompt); IconButton searchButton = new IconButton(IconFont.SEARCH, localized(\"search\")); searchButton.prefHeightProperty().bind(input.heightProperty()); this.getChildren().setAll(input, searchButton); this.input.setOnKeyPressed(event -> { if (event.getCode() == KeyCode.ENTER) { fire(); } }); searchButton.setOnMouseClicked(event -> fire()); }", "tokens": 131} {"id": 609558, "source": "method", "repo": "uncle-novel/uncle-novel", "text": "public boolean isSelected() { return selectedProperty().get(); }", "tokens": 13} {"id": 609569, "source": "method", "repo": "uncle-novel/uncle-novel", "text": "public TitleBar(@NamedArg(\"title\") String title) { this(title, null); }", "tokens": 22} {"id": 609680, "source": "method", "repo": "uncle-novel/uncle-novel", "text": "public SignerHelper storetype(String storetype) { this.storetype = storetype; return this; }", "tokens": 25} {"id": 609873, "source": "method", "repo": "unnamed/creative", "text": "/** Creates a new equipment layer with the given texture and player texture override. @param texture The equipment layer texture @param usePlayerTexture If the player texture should override this layer texture @return A new equipment layer @since 1.8.0 @sinceMinecraft 1.21.2 */ static EquipmentLayer layer(final @NotNull Key texture, final boolean usePlayerTexture) { return layer(texture, null, usePlayerTexture); }", "tokens": 92} {"id": 609904, "source": "method", "repo": "unnamed/creative", "text": "public boolean equals(final @Nullable Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final ReferenceFontProviderImpl that = (ReferenceFontProviderImpl) o; return id.equals(that.id); }", "tokens": 62} {"id": 609946, "source": "method", "repo": "unnamed/creative", "text": "default void addTo(final @NotNull ResourceContainer resourceContainer) { resourceContainer.item(this); }", "tokens": 22} {"id": 609967, "source": "method", "repo": "unnamed/creative", "text": "public ItemModel fallback() { return fallback; }", "tokens": 11} {"id": 609999, "source": "method", "repo": "unnamed/creative", "text": "public int hashCode() { return Objects.hashCode(normalize); }", "tokens": 14} {"id": 610140, "source": "method", "repo": "unnamed/creative", "text": "public Builder addFrame(final @NotNull AnimationFrame frame) { requireNonNull(frame, \"frame\"); frames.add(frame); return this; }", "tokens": 31} {"id": 610234, "source": "method", "repo": "unnamed/creative", "text": "public ElementRotation angle(float angle) { return new ElementRotation(this.origin, this.axis, angle, this.rescale); }", "tokens": 31} {"id": 610288, "source": "method", "repo": "unnamed/creative", "text": "public Builder particle(final @Nullable ModelTexture particle) { this.particle = particle; return this; }", "tokens": 23} {"id": 610289, "source": "method", "repo": "unnamed/creative", "text": "public Builder variables(final @NotNull Map variables) { requireNonNull(variables, \"variables\"); this.variables = new LinkedHashMap<>(variables); return this; }", "tokens": 38} {"id": 610334, "source": "method", "repo": "unnamed/creative", "text": "/** Sets the {@link SoundEvent} name for the sound entry. @param name The sound event name @return This builder @since 1.0.0 @deprecated Set {@link #type} and {@link #key} separately instead */ default Builder nameEvent(final @NotNull @Subst(\"minecraft:sound\") String name) { return nameEvent(Key.key(name)); }", "tokens": 81} {"id": 610560, "source": "method", "repo": "unnamed/creative", "text": "void test() { // No sounds, all other options are default assertSerializes( \"{\\\"sound1\\\":{\\\"sounds\\\":[]}}\", SoundRegistry.soundRegistry() .namespace(\"creative\") .sound(SoundEvent.soundEvent(Key.key(\"creative\", \"sound1\"), false, null, Collections.emptyList())) ); // Has sounds, all other options are default assertSerializes( \"{\\\"sound1\\\":{\\\"sounds\\\":[\\\"example\\\",\\\"custom:example2\\\"]}}\", SoundRegistry.soundRegistry() .namespace(\"help\") .sound(SoundEvent.soundEvent(Key.key(\"help\", \"sound1\"), false, null, Arrays.asList( SoundEntry.soundEntry(Sound.sound(Key.key(\"example\"), Writable.EMPTY)), SoundEntry.soundEntry(Sound.sound(Key.key(\"custom:example2\"), Writable.EMPTY)) ))) ); // No sounds, custom options assertSerializes( \"{\\\"sound1\\\":{\\\"replace\\\":true,\\\"subtitle\\\":\\\"The Sound 1\\\",\\\"sounds\\\":[]}}\", SoundRegistry.soundRegistry() .namespace(\"creative\") .sound(SoundEvent.soundEvent(Key.key(\"creative\", \"sound1\"), true, \"The Sound 1\", Collections.emptyList())) ); }", "tokens": 260} {"id": 610573, "source": "method", "repo": "unnamed/creative", "text": "/** Sets the server's bound address, required. @param address The server's bound address @param port The server's bound port @return This builder @since 1.0.0 */ default Builder address(final @NotNull InetAddress address, final int port) { requireNonNull(address, \"address\"); return address(new InetSocketAddress(address, port)); }", "tokens": 77} {"id": 610575, "source": "method", "repo": "unnamed/creative", "text": "/** Sets the server's request handler, required, may also be set by using {@link #pack}. @param handler The server's request handler @return This builder @since 1.0.0 @deprecated Use {@link #handler(ResourcePackRequestHandler)} instead */ default Builder handler(final @NotNull team.unnamed.creative.server.ResourcePackRequestHandler handler) { // cast to new ResourcePackRequestHandler return handler((ResourcePackRequestHandler) requireNonNull(handler, \"handler\")); }", "tokens": 99} {"id": 610577, "source": "method", "repo": "unnamed/creative", "text": "/** Sets a request handler that will always return the given {@link BuiltResourcePack pack}. @param pack The served resource pack @return This builder @since 1.0.0 */ default Builder pack(final @NotNull BuiltResourcePack pack) { requireNonNull(pack, \"pack\"); return handler(ResourcePackRequestHandler.fixed(pack)); }", "tokens": 70} {"id": 610666, "source": "method", "repo": "unnamed/hephaestus-engine", "text": "BezierInterpolator(final int divisions) { this.divisions = divisions; }", "tokens": 20} {"id": 610744, "source": "method", "repo": "unnamed/hephaestus-engine", "text": "public BoneTimeline build() { return new BoneTimelineImpl(positions, rotations, scales); }", "tokens": 25} {"id": 610853, "source": "method", "repo": "unnamed/hephaestus-engine", "text": "public Writable fragmentShader() { return FRAGMENT_SHADER; }", "tokens": 15} {"id": 610925, "source": "method", "repo": "unnamed/hephaestus-engine", "text": "public void test_bigass_block_cube() { MonoResult result = processSingleCube(new ElementAsset( // 1024x1024x1024 cube (64x64x64 minecraft blocks! big as fuck!) new Vector3Float(-512, -512, -512), new Vector3Float(512, 512, 512), ElementRotation.of(Vector3Float.ZERO, Axis3D.X, 0, false), Collections.emptyMap() )); // scale is big as fuck too! and will be split into two scales, one applied // by the resource-pack (max 4), and another, applied in-game (5.33333) assertEquals(21.333334F, result.scale); ElementAsset scaledElement = result.element; assertEquals(new Vector3Float(-16F, -16F, -16F), scaledElement.from(), \"from\"); assertEquals(new Vector3Float(32F, 32F, 32F), scaledElement.to(), \"to\"); }", "tokens": 260} {"id": 610944, "source": "method", "repo": "unnamed/hephaestus-engine", "text": "public boolean matches(String name) { return matcher.test(name); }", "tokens": 17} {"id": 611103, "source": "method", "repo": "unnamed/hephaestus-engine", "text": "public GenericBoneEntity(@NotNull EntityType entityType) { super(entityType); }", "tokens": 16} {"id": 611149, "source": "method", "repo": "unnamed/hephaestus-engine", "text": "public ModelReader reader() { return reader; }", "tokens": 11} {"id": 611188, "source": "method", "repo": "usb4java/usb4java", "text": "public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (this.getClass() != obj.getClass()) { return false; } final Context other = (Context) obj; if (this.contextPointer != other.contextPointer) { return false; } return true; }", "tokens": 78} {"id": 611260, "source": "method", "repo": "usb4java/usb4java", "text": "public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (this.getClass() != obj.getClass()) { return false; } final InterfaceDescriptor other = (InterfaceDescriptor) obj; return new EqualsBuilder() .append(this.bLength(), other.bLength()) .append(this.bDescriptorType(), other.bDescriptorType()) .append(this.bInterfaceNumber(), other.bInterfaceNumber()) .append(this.bAlternateSetting(), other.bAlternateSetting()) .append(this.bNumEndpoints(), other.bNumEndpoints()) .append(this.bInterfaceClass(), other.bInterfaceClass()) .append(this.bInterfaceSubClass(), other.bInterfaceSubClass()) .append(this.bInterfaceProtocol(), other.bInterfaceProtocol()) .append(this.iInterface(), other.iInterface()) .append(this.endpoint(), other.endpoint()) .append(this.extra(), other.extra()) .append(this.extraLength(), other.extraLength()) .isEquals(); }", "tokens": 250} {"id": 611421, "source": "method", "repo": "usb4java/usb4java", "text": "/** Tests the {@link LibUsb#getBusNumber(Device)} method. */ public void testGetBusNumber() { assumeUsbTestsEnabled(); assumeNotNull(this.device); assertTrue(LibUsb.getBusNumber(this.device) >= 0); }", "tokens": 54} {"id": 611619, "source": "method", "repo": "usb4java/usb4java", "text": "/** Tests uninitialized access to {@link SsUsbDeviceCapabilityDescriptor#bFunctionalitySupport()} */ public void testUninitializedFunctionalitySupport() { assumeUsbTestsEnabled(); this.descriptor.bFunctionalitySupport(); }", "tokens": 44} {"id": 611775, "source": "method", "repo": "UWSysLab/tapir", "text": "public boolean doTransactionScan(DB db) { // choose a random key int keynum = nextKeynum(); String startkeyname = buildKeyName(keynum); // choose a random scan length int len = scanlength.nextInt(); HashSet fields = null; if (!readallfields) { // read a random field String fieldname = \"field\" + fieldchooser.nextString(); fields = new HashSet(); fields.add(fieldname); } return (db.scan(table, startkeyname, len, fields, new Vector>()) == 0); }", "tokens": 131} {"id": 611807, "source": "method", "repo": "UWSysLab/tapir", "text": "/** @return {@code get(0)} */ public byte get() { return get(0); }", "tokens": 22} {"id": 611846, "source": "method", "repo": "UWSysLab/tapir", "text": "/** For direct buffers, calls {@link Pointer#Pointer(Buffer)}, while for buffers backed with an array, allocates enough memory for the array and copies it. @param buffer the Buffer to reference or copy @see #put(double[]) */ public DoublePointer(DoubleBuffer buffer) { super(buffer); if (buffer != null && buffer.hasArray()) { double[] array = buffer.array(); allocateArray(array.length); put(array); position(buffer.position()); limit(buffer.limit()); } }", "tokens": 112} {"id": 611957, "source": "method", "repo": "UWSysLab/tapir", "text": "/** @see Pointer#Pointer(Pointer) */ public PointerPointer(Pointer p) { super(p); }", "tokens": 26} {"id": 612070, "source": "method", "repo": "UWSysLab/tapir", "text": "public double[] array() { return array; }", "tokens": 11} {"id": 612105, "source": "method", "repo": "UWSysLab/tapir", "text": "public FloatIndexer get(int i, float[] f, int offset, int length) { for (int n = 0; n < length; n++) { f[offset + n] = array[i * strides[0] + n]; } return this; }", "tokens": 58} {"id": 612107, "source": "method", "repo": "UWSysLab/tapir", "text": "public float get(int i, int j, int k) { return array[i * strides[0] + j * strides[1] + k]; }", "tokens": 35} {"id": 612116, "source": "method", "repo": "UWSysLab/tapir", "text": "/** Constructor to set the {@link #buffer}, {@link #sizes} and {@link #strides}. */ public FloatBufferIndexer(FloatBuffer buffer, int[] sizes, int[] strides) { super(sizes, strides); this.buffer = buffer; }", "tokens": 57} {"id": 612146, "source": "method", "repo": "UWSysLab/tapir", "text": "/** Computes the linear index as the dot product of indices and strides. @param indices of each dimension @return index to access array or buffer */ public int index(int ... indices) { int index = 0; for (int i = 0; i < indices.length; i++) { index += indices[i] * strides[i]; } return index; }", "tokens": 78} {"id": 612837, "source": "method", "repo": "valarchie/agileboot-back-end", "text": "void testHasChildrenMenus() { boolean hasChildrenMenu = menuService.hasChildrenMenu(5L); boolean hasNotChildrenMenu = menuService.hasChildrenMenu(20L); Assertions.assertTrue(hasChildrenMenu); Assertions.assertFalse(hasNotChildrenMenu); }", "tokens": 59} {"id": 612934, "source": "method", "repo": "valentinacupac/banking-kata-java", "text": "void should_find_multiple_added_bank_accounts() { var bankAccount1 = createSomeBankAccount(); shouldRetrieveAddedAccount(bankAccount1); var bankAccount2 = createSomeBankAccount(); shouldRetrieveAddedAccount(bankAccount2); var bankAccount3 = createSomeBankAccount(); shouldRetrieveAddedAccount(bankAccount3); }", "tokens": 64} {"id": 613100, "source": "method", "repo": "valentinacupac/banking-kata-java", "text": "public FakeNationalIdentityGatewaySimulator() { this.provider = new FakeNationalIdentityGateway(); provider.setupExistent(\"SIM_1\"); provider.setupExistent(\"SIM_2\"); }", "tokens": 46} {"id": 613201, "source": "method", "repo": "valentinacupac/banking-kata-java", "text": "public MoneyGuard(Money value) { super(value); }", "tokens": 15} {"id": 613222, "source": "method", "repo": "valentinacupac/banking-kata-java", "text": "private AccountHolderName getAccountHolderName(OpenAccountRequest request) { return AccountHolderName.of(request.getFirstName(), request.getLastName()); }", "tokens": 34} {"id": 613598, "source": "method", "repo": "validator/validator", "text": "/** Returns the name of this property */ public String getPropertyName() { return \"height\"; }", "tokens": 19} {"id": 613608, "source": "method", "repo": "validator/validator", "text": "/** Is the value of this property is a default value. It is used by all macro for the function print */ public boolean isDefault() { return (repeat == value); }", "tokens": 40} {"id": 613678, "source": "method", "repo": "validator/validator", "text": "public static final CssIdent getDiscretionaryLigValues(CssIdent ident) { for (CssIdent id : discretionaryLigValues) { if (id.equals(ident)) { return id; } } return null; }", "tokens": 51} {"id": 614019, "source": "method", "repo": "validator/validator", "text": "public int hashCode() { return namespaceUri.hashCode(); }", "tokens": 13} {"id": 614117, "source": "method", "repo": "validator/validator", "text": "private static void testMultiplePredicates() throws Exception { String json = \"{\\\"prerender\\\": [{\\\"source\\\": \\\"document\\\", \\\"where\\\": {\\\"href_matches\\\": \\\"/*\\\", \\\"selector_matches\\\": \\\"a\\\"}}]}\"; List errors = validateSpeculationRules(json); assertContains(\"Multiple predicates: error about only one\", errors, \"only one\"); }", "tokens": 78} {"id": 614251, "source": "method", "repo": "valterc/ki2", "text": "private void connectionTracker() { if (disconnected) { return; } if (connectionStatus == ConnectionStatus.ESTABLISHED) { if (System.currentTimeMillis() - timestampLastMessage > TIME_MS_MESSAGE_TIMEOUT) { timestampLastMessage = System.currentTimeMillis(); Timber.w(\"[%s] No ANT messages in last 30 seconds, restarting connection...\", deviceId); disconnectInternal(); connectOnce(); } } if (!disconnected && !executorService.isShutdown()) { executorService.schedule(this::connectionTracker, TIME_S_CONNECTION_TRACKER_INTERVAL, TimeUnit.SECONDS); } }", "tokens": 133} {"id": 614276, "source": "method", "repo": "valterc/ki2", "text": "public DeviceId getDeviceId() { return deviceId; }", "tokens": 12} {"id": 614303, "source": "method", "repo": "valterc/ki2", "text": "public static CommandType fromValue(int commandValue) { for (CommandType commandType : values()) { if (commandType.commandValue == commandValue) { return commandType; } } return UNKNOWN; }", "tokens": 46} {"id": 614347, "source": "method", "repo": "valterc/ki2", "text": "public SignalInfo[] newArray(int size) { return new SignalInfo[size]; }", "tokens": 20} {"id": 614642, "source": "method", "repo": "valterc/ki2", "text": "public GearsView getGearsView() { return gearsView; }", "tokens": 17} {"id": 614821, "source": "method", "repo": "valterc/ki2", "text": "private void maybeStartShiftingEvents() { if (service == null) { return; } if (!dataRouter.hasShiftingInfoListeners()) { return; } registrationShiftingInfo.register(); }", "tokens": 43} {"id": 614895, "source": "method", "repo": "valterc/ki2", "text": "public void registerConnectionInfoListener(IConnectionInfoCallback callback) { if (callback == null) { return; } callbackListConnectionInfo.register(callback); serviceHandler.postAction(() -> { for (ConnectionDataManager connectionDataManager : connectionsDataManager.getDataManagers()) { try { callback.onConnectionInfo( connectionDataManager.getDeviceId(), connectionDataManager.buildConnectionInfo()); } catch (RemoteException e) { break; } } }); serviceHandler.postRetriableAction(Ki2Service.this::processConnections); }", "tokens": 112} {"id": 614898, "source": "method", "repo": "valterc/ki2", "text": "public void unregisterWirelessSwitchesListener(IWirelessSwitchesCallback callback) { if (callback != null) { callbackListWirelessSwitches.unregister(callback); } serviceHandler.postRetriableAction(Ki2Service.this::processConnections); }", "tokens": 51} {"id": 614916, "source": "method", "repo": "valterc/ki2", "text": "public void onCreate() { PostUpdateActions.executePreInit(new PostUpdateContext(this, deviceStore)); messageManager = new MessageManager(); serviceHandler = new ServiceHandler(); antManager = new AntManager(this, this::onAntServiceReady); antScanner = new AntScanner(antManager, this); antConnectionManager = new AntConnectionManager(this, antManager); deviceStore = new DeviceStore(this); connectionsDataManager = new ConnectionsDataManager(); inputManager = new InputManager(this); backgroundUpdateChecker = new BackgroundUpdateChecker(this, this); preferencesStore = new PreferencesStore(this, this::onPreferences); devicePreferencesStore = new DevicePreferencesStore(this, this::onDevicePreferences); karooRideStateListener = new KarooRideStateListener(this, this::onRideStatus); karooRideStateListener.start(); DebugHelper.init(deviceStore); PostUpdateActions.executePostInit(new PostUpdateContext(this, deviceStore)); devicePreferencesStore.setDevices(deviceStore.getDevices()); registerReceiver(receiverReconnectDevices, new IntentFilter(\"io.hammerhead.action.RECONNECT_DEVICES\"), Context.RECEIVER_EXPORTED); registerReceiver(receiverInRide, new IntentFilter(\"io.hammerhead.action.IN_RIDE\"), Context.RECEIVER_EXPORTED); Timber.i(\"Service created\"); }", "tokens": 287} {"id": 615379, "source": "method", "repo": "vandeseer/easytable", "text": "private static String repeat(char ch, int repeat) { if (repeat <= 0) { return \"\"; } else { char[] buf = new char[repeat]; for(int i = repeat - 1; i >= 0; --i) { buf[i] = ch; } return new String(buf); } }", "tokens": 70} {"id": 615624, "source": "method", "repo": "vectorwing/farmersdelight", "text": "public InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hit) { if (Configuration.ENABLE_ROPE_REELING.get() && player.isSecondaryUseActive()) { if (player.getAbilities().mayBuild && (player.getAbilities().instabuild || player.getInventory().add(new ItemStack(this.asItem())))) { BlockPos.MutableBlockPos reelingPos = pos.mutable().move(Direction.DOWN); int minBuildHeight = level.getMinBuildHeight(); while (reelingPos.getY() >= minBuildHeight - 1) { BlockState blockStateBelow = level.getBlockState(reelingPos); if (blockStateBelow.is(this)) { reelingPos.move(Direction.DOWN); } else { reelingPos.move(Direction.UP); level.destroyBlock(reelingPos, false, player); return InteractionResult.sidedSuccess(level.isClientSide); } } } } else { BlockPos.MutableBlockPos bellRingingPos = pos.mutable().move(Direction.UP); for (int i = 0; i < 24; i++) { BlockState blockStateAbove = level.getBlockState(bellRingingPos); Block blockAbove = blockStateAbove.getBlock(); if (blockAbove == Blocks.BELL) { ((BellBlock) blockAbove).attemptToRing(level, bellRingingPos, blockStateAbove.getValue(BellBlock.FACING).getClockWise()); return InteractionResult.SUCCESS; } else if (blockAbove == ModBlocks.ROPE.get()) { bellRingingPos.move(Direction.UP); } else { return InteractionResult.PASS; } } } return InteractionResult.PASS; }", "tokens": 369} {"id": 615700, "source": "method", "repo": "vectorwing/farmersdelight", "text": "public BlockState getStateForPlacement(BlockPlaceContext context) { BlockPos pos = context.getClickedPos(); FluidState fluid = context.getLevel().getFluidState(context.getClickedPos()); return pos.getY() < context.getLevel().getMaxBuildHeight() - 1 && fluid.is(FluidTags.WATER) && fluid.getAmount() == 8 && context.getLevel().getBlockState(pos.above()).isAir() ? super.getStateForPlacement(context) : null; }", "tokens": 95} {"id": 615855, "source": "method", "repo": "vectorwing/farmersdelight", "text": "public boolean matches(RecipeWrapper inv, Level level) { java.util.List inputs = new java.util.ArrayList<>(); int i = 0; for (int j = 0; j < INPUT_SLOTS; ++j) { ItemStack itemstack = inv.getItem(j); if (!itemstack.isEmpty()) { ++i; inputs.add(itemstack); } } return i == this.inputItems.size() && RecipeMatcher.findMatches(inputs, this.inputItems) != null; }", "tokens": 110} {"id": 616003, "source": "method", "repo": "vectorwing/farmersdelight", "text": "private static ResourceKey register(String id) { // return ResourceLocation.fromNamespaceAndPath(FarmersDelight.MODID, id); return ResourceKey.create(Registries.LOOT_TABLE, RecipeUtils.FDLocation(id)); }", "tokens": 50} {"id": 616059, "source": "method", "repo": "vectorwing/farmersdelight", "text": "public int tries() { return this.tries; }", "tokens": 13} {"id": 616165, "source": "method", "repo": "vectorwing/farmersdelight", "text": "public void save(RecipeOutput output) { ResourceLocation defaultLocation = getDefaultRecipeId(getResult()); save(output, ResourceLocation.fromNamespaceAndPath(this.namespace != null ? namespace : defaultLocation.getNamespace(), defaultLocation.getPath()).withPrefix(folder.getSerializedName() + \"/\")); }", "tokens": 60} {"id": 616263, "source": "method", "repo": "vectorwing/farmersdelight", "text": "public int getHeight() { return 80; }", "tokens": 12} {"id": 616378, "source": "method", "repo": "vectrix-space/ignite", "text": "private Ember() { Ember.INSTANCE = this; final ServiceLoader serviceLoader = ServiceLoader.load(LaunchService.class, Ember.class.getClassLoader()); this.service = IgniteCollections.firstOrNull(serviceLoader.iterator()); }", "tokens": 60} {"id": 616488, "source": "method", "repo": "vectrix-space/ignite", "text": "public String toString() { return \"ModConfig(\" + \"id=\" + this.id + \", \" + \"version=\" + this.version + \", \" + \"mixins=\" + Arrays.toString(this.mixins.toArray(new String[0])) + \", \" + \"wideners=\" + Arrays.toString(this.wideners.toArray(new String[0])) + \")\"; }", "tokens": 88} {"id": 616590, "source": "method", "repo": "verisimilitudex/dnanalyzer", "text": "/** Loads the bundled reference panel either from the classpath or from the {@code assets/ancestry/continental_reference.json} file in the repository. */ public static AncestrySnapshot usingBundledReference() throws IOException { try (InputStream input = openBundledReference()) { if (input == null) { throw new IOException( \"Bundled ancestry reference not found. Expected \" + CLASSPATH_REFERENCE + \" on the classpath or \" + FALLBACK_REFERENCE_PATH + \" on disk.\"); } return new AncestrySnapshot(parseReferencePanel(input)); } }", "tokens": 129} {"id": 616644, "source": "method", "repo": "verisimilitudex/dnanalyzer", "text": "private ParsedSequence parseFasta(List lines, String originalName) throws IOException { Path tempFile = Files.createTempFile(\"dnanalyzer\", \".fasta\"); try { Files.write(tempFile, String.join(\"\\n\", lines).getBytes(StandardCharsets.UTF_8)); FastaRecord record = FastaParser.parseSingle(tempFile); String header = record.header() == null || record.header().isBlank() ? originalName : record.header(); return new ParsedSequence(originalName, header, record.sequence(), \"FASTA\"); } finally { Files.deleteIfExists(tempFile); } }", "tokens": 129} {"id": 616732, "source": "method", "repo": "verisimilitudex/dnanalyzer", "text": "int maxTokens() { return maxTokens; }", "tokens": 11} {"id": 616758, "source": "method", "repo": "verisimilitudex/dnanalyzer", "text": "public Builder analysisMode(String value) { if (value != null && !value.isBlank()) { this.analysisMode = value.trim().toLowerCase(Locale.ROOT); } return this; }", "tokens": 42} {"id": 616977, "source": "method", "repo": "vertical-blank/sql-formatter", "text": "private Token getCommentToken(String input) { return Util.firstNotnull( () -> this.getLineCommentToken(input), () -> this.getBlockCommentToken(input)); }", "tokens": 41} {"id": 617124, "source": "method", "repo": "vimasig/bozar", "text": "public LineNumberTransformer(Bozar bozar) { super(bozar, \"Line numbers\", BozarCategory.STABLE); }", "tokens": 27} {"id": 617202, "source": "method", "repo": "vimasig/bozar", "text": "private InsnBuilder() { this.insnList = new InsnList(); }", "tokens": 16} {"id": 617240, "source": "method", "repo": "vimasig/bozar", "text": "Enum getEnum(Class transformerClass) { ClassTransformer transformer = Objects.requireNonNull(TransformManager.createTransformerInstance(transformerClass)); return getEnum(transformer.getName(), getComboBox(transformerClass).getSelectionModel().getSelectedItem()); }", "tokens": 55} {"id": 617293, "source": "method", "repo": "vincenzopalazzo/material-ui-swing", "text": "public void installUI(JComponent c) { mouseHoverEnabled = false; super.installUI(c); borderEnabled = false; buttonBorderToAll = false; }", "tokens": 36} {"id": 617531, "source": "method", "repo": "vincenzopalazzo/material-ui-swing", "text": "/** This is method for init style button into JDialog */ protected void initMaterialButtonClose() { MaterialManagerListener.removeAllMaterialMouseListener(myCloseButton); myCloseButton.setBackground(UIManager.getColor(\"OptionPane.errorDialog.titlePane.background\")); myCloseButton.setAction(myCloseAction); }", "tokens": 65} {"id": 617951, "source": "method", "repo": "vincenzopalazzo/material-ui-swing", "text": "public void propertyChange(PropertyChangeEvent e) { switch (e.getPropertyName()) { case \"ancestor\": if (e.getNewValue() != null) addNotify(); else removeNotify(); break; case \"resizable\": updateVisibility(); break; } }", "tokens": 54} {"id": 618077, "source": "method", "repo": "vincenzopalazzo/material-ui-swing", "text": "public Object getValueAt(int row, int col) { File f = new File(dir, filenames[row]); switch (col) { case 0: return filenames[row]; case 1: return new Long(f.length()); case 2: return new Date(f.lastModified()); case 3: return f.isDirectory() ? Boolean.TRUE : Boolean.FALSE; case 4: return f.canRead() ? Boolean.TRUE : Boolean.FALSE; case 5: return f.canWrite() ? Boolean.TRUE : Boolean.FALSE; default: return null; } }", "tokens": 127} {"id": 618111, "source": "method", "repo": "virtuslab/git-machete-intellij-plugin", "text": "public static GitMacheteException getOrWrap(Throwable e) { return e instanceof GitMacheteException gme ? gme : new GitMacheteException(e); }", "tokens": 34} {"id": 618187, "source": "method", "repo": "virtuslab/git-machete-intellij-plugin", "text": "public static String hashFile(String algorithm, File f) throws IOException, NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance(algorithm); try (BufferedInputStream in = new BufferedInputStream(new FileInputStream(f)); DigestOutputStream out = new DigestOutputStream(OutputStream.nullOutputStream(), md)) { in.transferTo(out); } return new BigInteger(/* signum */ 1, md.digest()).toString(16); }", "tokens": 90} {"id": 618243, "source": "method", "repo": "virtuslab/git-machete-intellij-plugin", "text": "public void parentAgnosticForkPointIsMissingAndParentIsAncestorOfChild() { // given IGitCoreCommit parentCommit = createGitCoreCommit(); IGitCoreCommit childCommit = createGitCoreCommit(); IGitCoreLocalBranchSnapshot parentBranch = createGitCoreLocalBranch(parentCommit); IGitCoreLocalBranchSnapshot childBranch = createGitCoreLocalBranch(childCommit); when(gitCoreRepository.ancestorsOf(eq(childCommit), anyInt())).thenReturn(Stream.empty()); when(gitCoreRepository.isAncestorOrEqual(parentCommit, childCommit)).thenReturn(true); // when IGitCoreCommit result = invokeDeriveParentAwareForkPoint(childBranch, parentBranch); // then assertEquals(parentCommit, result); }", "tokens": 136} {"id": 618248, "source": "method", "repo": "virtuslab/git-machete-intellij-plugin", "text": "public void deriveRelationToRemote_Ahead() { // given when(gitCoreRepository.deriveAllRemoteNames()).thenReturn(List.of(ORIGIN)); when(coreLocalBranch.getRemoteTrackingBranch()).thenReturn(coreRemoteBranch); when(coreLocalBranch.getPointedCommit()).thenReturn(coreLocalBranchCommit); when(coreRemoteBranch.getPointedCommit()).thenReturn(coreRemoteBranchCommit); val relativeCommitCount = GitCoreRelativeCommitCount.of(3, 0); when(gitCoreRepository .deriveRelativeCommitCount(coreLocalBranchCommit, coreRemoteBranchCommit)).thenReturn(relativeCommitCount); // when RelationToRemote relationToRemote = invokeDeriveRelationToRemote(coreLocalBranch); // then assertEquals(SyncToRemoteStatus.AheadOfRemote, relationToRemote.getSyncToRemoteStatus()); }", "tokens": 160} {"id": 618302, "source": "method", "repo": "virtuslab/git-machete-intellij-plugin", "text": "public boolean equals(@Nullable Object other) { if (this == other) { return true; } else if (!(other instanceof BranchLayoutEntry otherEntry)) { return false; } else { val areNamesSame = this.name.equals(otherEntry.name); val areCustomAnnotationsSame = Objects.equals(this.customAnnotation, otherEntry.customAnnotation); if (areNamesSame && areCustomAnnotationsSame && this.children.size() == otherEntry.children.size()) { val entryNameComparator = Comparator.comparing(BranchLayoutEntry::getName); val sortedSelfEntries = this.children.sorted(entryNameComparator); val sortedOtherEntries = otherEntry.children.sorted(entryNameComparator); return sortedSelfEntries.zip(sortedOtherEntries) .forAll(entryTuple -> entryTuple._1.equals(entryTuple._2)); } return false; } }", "tokens": 184} {"id": 618464, "source": "method", "repo": "virtuslab/git-machete-intellij-plugin", "text": "public SlideOut(IManagedBranchSnapshot branchToSlideOut, GitRepository gitRepository, BranchLayout branchLayout, BaseEnhancedGraphTable graphTable) { this.project = gitRepository.getProject(); this.branchToSlideOutName = branchToSlideOut.getName(); this.branchLayout = branchLayout; this.gitRepository = gitRepository; this.graphTable = graphTable; }", "tokens": 78} {"id": 618477, "source": "method", "repo": "virtuslab/git-machete-intellij-plugin", "text": "public Hash getId() { return hash; }", "tokens": 11} {"id": 618520, "source": "method", "repo": "virtuslab/git-machete-intellij-plugin", "text": "public String getNameOfBranchUnderAction(AnActionEvent anActionEvent) { return getCurrentBranchNameIfManaged(anActionEvent); }", "tokens": 23} {"id": 618575, "source": "method", "repo": "virtuslab/git-machete-intellij-plugin", "text": "String getOSName() { return SystemUtils.OS_NAME; }", "tokens": 16} {"id": 618576, "source": "method", "repo": "virtuslab/git-machete-intellij-plugin", "text": "String getOSVersion() { return SystemUtils.OS_VERSION; }", "tokens": 16} {"id": 618723, "source": "method", "repo": "virtuslab/git-machete-intellij-plugin", "text": "public IEdgeRenderPart asEdge() { throw new NotImplementedError(); }", "tokens": 16} {"id": 619049, "source": "method", "repo": "vishalmysore/Tools4AI", "text": "/** The processor being wrapped, for callers that still need a blocking path. */ public AIProcessor getDelegate() { return delegate; }", "tokens": 28} {"id": 619127, "source": "method", "repo": "vishalmysore/Tools4AI", "text": "public Object processSingleAction(String promptText, AIAction action, HumanInLoop humanVerification, ExplainDecision explain) throws AIProcessingException { return throttled(() -> delegate.processSingleAction(promptText, action, humanVerification, explain)); }", "tokens": 52} {"id": 619156, "source": "method", "repo": "vishalmysore/Tools4AI", "text": "public GenericJavaMethodAction(Object actionInstance) throws AIProcessingException { this.actionInstance= actionInstance; init(actionInstance.getClass(),getAnnotatedMethods(actionInstance.getClass())) ; }", "tokens": 41} {"id": 619236, "source": "method", "repo": "vishalmysore/Tools4AI", "text": "public String getActionParams(AIAction action, String prompt, AIPlatform aiProvider, Map params) throws AIProcessingException { String OPEN_AIPRMT = \"here is your prompt - prompt_str - here is you action- action_name(params_values) - what parameter should you pass to this function. give comma separated name=values only and nothing else\"; String prmpt = OPEN_AIPRMT.replace(\"prompt_str\",prompt); prmpt = prmpt.replace(\"action_name\",action.getActionName()); String realParms = getCommaSeparatedKeys(params); prmpt = prmpt.replace(\"params_values\",realParms); log.debug(prmpt); if(aiProvider == AIPlatform.OPENAI) { return openAiChatModel.generate(prmpt); } if(aiProvider == AIPlatform.ANTHROPIC) { return anthropicChatModel.generate(prmpt); } else { try { return ResponseHandler.getText(chatExplain.sendMessage(prmpt)); } catch (IOException e) { throw new AIProcessingException(e); } } }", "tokens": 245} {"id": 619401, "source": "method", "repo": "vishalmysore/Tools4AI", "text": "void testReportListsEveryOperation() throws AIProcessingException { InMemoryActionMetrics metrics = new InMemoryActionMetrics(); MeteredActionProcessor metered = new MeteredActionProcessor(new ScriptedProcessor(), metrics); metered.processSingleAction(\"a\"); metered.query(\"b\"); String report = metrics.report(); assertTrue(report.contains(MeteredActionProcessor.OPERATION_PROCESS)); assertTrue(report.contains(MeteredActionProcessor.OPERATION_QUERY)); }", "tokens": 96} {"id": 619420, "source": "method", "repo": "vishalmysore/Tools4AI", "text": "void testNullRouterThrows() { assertThrows(IllegalArgumentException.class, () -> new AgentOrchestrator(null)); }", "tokens": 24} {"id": 619554, "source": "method", "repo": "vishalmysore/Tools4AI", "text": "public Object saveInformationToLocalFile(String args[]) { StringBuilder content = new StringBuilder(); for (String arg : args) { content.append(arg).append(\"\\n\"); } String fileName = null; FileWriter writer = null; try { // Create a temporary file File tempFile = File.createTempFile(\"temp\", \".txt\"); fileName = tempFile.getAbsolutePath(); // Write content to the temporary file writer = new FileWriter(tempFile); writer.write(content.toString()); log.debug(\"Information saved to local file: \" + fileName); } catch (IOException e) { log.error(\"Failed to save information to local file: \" + e.getMessage()); } finally { // Close the writer if (writer != null) { try { writer.close(); } catch (IOException e) { log.error(\"Failed to close writer: \" + e.getMessage()); } } } return fileName; }", "tokens": 186} {"id": 619557, "source": "method", "repo": "vishalmysore/Tools4AI", "text": "public static void plantAnalsisPojo(GeminiImageActionProcessor processor, URL url) throws AIProcessingException { Plant plantDetails = (Plant) processor.imageToPojo(url, Plant.class); log.info(plantDetails.toString()); log.info(processor.imageToText(url, \"based on image what action should i take on this plant?\")); }", "tokens": 80} {"id": 619694, "source": "method", "repo": "vishalmysore/Tools4AI", "text": "void testAddActionWithNullAction() { assertDoesNotThrow(() -> actionGroup.addAction((AIAction)null)); assertEquals(1, actionGroup.getActions().size()); assertNull(actionGroup.getActions().get(0).getActionName()); }", "tokens": 51} {"id": 619715, "source": "method", "repo": "vishalmysore/Tools4AI", "text": "void testAskAdditionalQuestionWithNull() { BlankAction blankAction = new BlankAction(); String result = blankAction.askAdditionalQuestion(null); assertNull(result); }", "tokens": 37} {"id": 619962, "source": "method", "repo": "visualdataweb/owl2vowl", "text": "private void addProperty(AbstractProperty property) { if (property instanceof HasReference) { addReferenceProperty(property); return; } if (property.getDomains().isEmpty() || property.getRanges().isEmpty()) { logger.info(\"Domain or range is empty in property: \" + property); return; } Map object = new HashMap<>(); Map attributes = new HashMap<>(); addCommonFields(property, object, attributes); attributes.put(\"domain\", vowlData.getIdForIri(property.getJsonDomain())); attributes.put(\"range\", vowlData.getIdForIri(property.getJsonRange())); attributes.put(\"description\", getLabelsFromAnnotations(property.getAnnotations().getDescription())); attributes.put(\"comment\", getLabelsFromAnnotations(property.getAnnotations().getComments())); attributes.put(\"attributes\", property.getAttributes()); attributes.put(\"annotations\", property.getAnnotations().getIdentifierToAnnotation()); attributes.put(\"inverse\", getIdForIri(property.getInverse())); attributes.put(\"superproperty\", getListWithIds(property.getSuperEntities())); attributes.put(\"subproperty\", getListWithIds(property.getSubEntities())); attributes.put(\"equivalent\", getListWithIds(property.getSortedEquivalents())); attributes.put(\"minCardinality\", getCardinality(property.getMinCardinality())); attributes.put(\"maxCardinality\", getCardinality(property.getMaxCardinality())); attributes.put(\"cardinality\", getCardinality(property.getExactCardinality())); propertyList.add(object); propertyAttributeList.add(attributes); }", "tokens": 320} {"id": 620063, "source": "method", "repo": "visualdataweb/owl2vowl", "text": "protected void checkConsistenty() { int currentSize = data.getEntityMap().keySet().size(); if (currentSize != dataSize) { refresh(); dataSize = currentSize; } }", "tokens": 40} {"id": 620074, "source": "method", "repo": "visualdataweb/owl2vowl", "text": "protected void addDisjoint(IRI... disjoints) { if (!disjointMapping.containsKey(disjoints[0])) { disjointMapping.put(disjoints[0], new HashSet<>()); } if (!disjointMapping.containsKey(disjoints[1])) { disjointMapping.put(disjoints[1], new HashSet<>()); } disjointMapping.get(disjoints[0]).add(disjoints[1]); disjointMapping.get(disjoints[1]).add(disjoints[0]); }", "tokens": 109} {"id": 620528, "source": "method", "repo": "vkcom/vk-java-sdk", "text": "public Comment setIsUnread(Boolean isUnread) { this.isUnread = isUnread; return this; }", "tokens": 23} {"id": 620549, "source": "method", "repo": "vkcom/vk-java-sdk", "text": "public String toPrettyString() { final StringBuilder sb = new StringBuilder(\"GetFacultiesResponse{\"); sb.append(\"count=\").append(count); sb.append(\", items=\").append(items); sb.append('}'); return sb.toString(); }", "tokens": 54} {"id": 620596, "source": "method", "repo": "vkcom/vk-java-sdk", "text": "public boolean isFavorite() { return isFavorite == BoolInt.YES; }", "tokens": 18} {"id": 620603, "source": "method", "repo": "vkcom/vk-java-sdk", "text": "public BoolInt getVerified() { return verified; }", "tokens": 13} {"id": 620727, "source": "method", "repo": "vkcom/vk-java-sdk", "text": "public ItemDigestFullItem setPost(ItemWallpost post) { this.post = post; return this; }", "tokens": 25} {"id": 620737, "source": "method", "repo": "vkcom/vk-java-sdk", "text": "public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Note note = (Note) o; return Objects.equals(date, note.date) && Objects.equals(canComment, note.canComment) && Objects.equals(comments, note.comments) && Objects.equals(ownerId, note.ownerId) && Objects.equals(privacyComment, note.privacyComment) && Objects.equals(readComments, note.readComments) && Objects.equals(viewUrl, note.viewUrl) && Objects.equals(id, note.id) && Objects.equals(text, note.text) && Objects.equals(textWiki, note.textWiki) && Objects.equals(title, note.title) && Objects.equals(privacyView, note.privacyView); }", "tokens": 187} {"id": 620764, "source": "method", "repo": "vkcom/vk-java-sdk", "text": "public Boolean getMultiple() { return multiple; }", "tokens": 11} {"id": 620773, "source": "method", "repo": "vkcom/vk-java-sdk", "text": "public WallpostStat setReachSubscribers(Integer reachSubscribers) { this.reachSubscribers = reachSubscribers; return this; }", "tokens": 31} {"id": 620916, "source": "method", "repo": "vkcom/vk-java-sdk", "text": "/** Creates a AbstractQueryBuilder instance that can be used to build user api request with various parameters @param client VK API client @param actor actor with access token */ public BoardRestoreCommentQuery(VkApiClient client, UserActor actor) { super(client, \"board.restoreComment\", OkResponse.class); accessToken(actor.getAccessToken()); }", "tokens": 70} {"id": 621120, "source": "method", "repo": "vkcom/vk-java-sdk", "text": "/** Set group id @param value value of \"group id\" parameter. Minimum is 0. Entity - owner @return a reference to this {@code AbstractQueryBuilder} object to fulfill the \"Builder\" pattern. */ public VideoStartStreamingQuery groupId(Long value) { return unsafeParam(\"group_id\", value); }", "tokens": 67} {"id": 621123, "source": "method", "repo": "vkcom/vk-java-sdk", "text": "/** (Required if 'attachments' is not set.) Text of the post. @param value value of \"message\" parameter. @return a reference to this {@code AbstractQueryBuilder} object to fulfill the \"Builder\" pattern. */ public WallEditAdsStealthQuery message(String value) { return unsafeParam(\"message\", value); }", "tokens": 73} {"id": 621213, "source": "method", "repo": "vojtechhabarta/typescript-generator", "text": "private static void checkAnnotationsHaveRuntimeRetention(List> annotationClasses) { annotationClasses.forEach(Settings::checkAnnotationHasRuntimeRetention); }", "tokens": 35} {"id": 621411, "source": "method", "repo": "vojtechhabarta/typescript-generator", "text": "public TsModifierFlags setStatic() { return new TsModifierFlags(true, isReadonly); }", "tokens": 23} {"id": 621616, "source": "method", "repo": "vojtechhabarta/typescript-generator", "text": "public RestMethodModel withComments(@Nullable List comments) { return new RestMethodModel(originClass, name, returnType, originalMethod, rootResource, httpMethod, path, pathParams, queryParams, entityParam, comments); }", "tokens": 52} {"id": 621768, "source": "method", "repo": "vojtechhabarta/typescript-generator", "text": "public void test() { final Jackson2Configuration configuration = new Jackson2Configuration(); configuration.serializerTypeMappings = Arrays.asList(Jackson2ParserTest.IdSerializer.class.getName() + \":\" + \"string\"); final Jackson2ConfigurationResolved resolved = Jackson2ConfigurationResolved.from(configuration, Thread.currentThread().getContextClassLoader()); Assertions.assertEquals(\"string\", requireNonNull(resolved.serializerTypeMappings).get(Jackson2ParserTest.IdSerializer.class)); }", "tokens": 96} {"id": 621898, "source": "method", "repo": "vojtechhabarta/typescript-generator", "text": "private static Map generateMap(V... values) { final AtomicInteger index = new AtomicInteger(); return Stream.of(values).collect(Collectors.toMap( v -> \"k\" + index.incrementAndGet(), v -> v, (v1, v2) -> { throw new RuntimeException(); }, LinkedHashMap::new )); }", "tokens": 79} {"id": 622135, "source": "method", "repo": "voxivoid/recipe-lab-sony-pmca", "text": "/** the favourite after / before {@code recipe} in marking order, wrapping; the first one when it is not marked; -1 when none */ static int next(List favs, int recipe, int dir) { if (favs.isEmpty()) return -1; int pos = favs.indexOf(recipe); if (pos < 0) return favs.get(0); return favs.get((pos + favs.size() + dir) % favs.size()); }", "tokens": 116} {"id": 622177, "source": "method", "repo": "voxivoid/recipe-lab-sony-pmca", "text": "Row add(int icon, int alt, String label) { keys.add(new int[] { icon, alt }); labels.add(label); return this; }", "tokens": 37} {"id": 622243, "source": "method", "repo": "voxivoid/recipe-lab-sony-pmca", "text": "private void load() { try { for (int i = 1; i < N; i++) { int id = ROW_ID[i]; if (id == SUB_SLOT) { int sid = Recipes.subId(cur[R_PE]); cur[i] = edit[i] = sid == 0 ? 0 : rdu(sid); continue; } if (id == QUALITY_SLOTS) { cur[i] = edit[i] = readQuality(); continue; } cur[i] = edit[i] = Params.fromStore(id, NativeBackup.readByte(id)); } } catch (Throwable t) { showToast(Lang.t(\"status_read_failed\", String.valueOf(t.getMessage())), 0); } }", "tokens": 170} {"id": 622269, "source": "method", "repo": "voxivoid/recipe-lab-sony-pmca", "text": "/** the centre button on a highlighted answer */ private void promptAnswered() { switch (promptKind) { case P_RESET: if (promptSel == 0) storeFactory(); else showToast(Lang.t(\"status_not_reset\"), 2000); return; case P_DISCARD: { Runnable then = afterDiscard; afterDiscard = null; if (promptSel == CustomRecipes.DISCARD && then != null) then.run(); return; } case P_OPTIONS: if (promptSel == CustomRecipes.OPT_RENAME) openName(NAME_RENAME); else if (promptSel == CustomRecipes.OPT_DELETE) openPrompt(P_DELETE, CustomRecipes.DELETE_DEFAULT); return; case P_DELETE: if (promptSel == 0) deleteCustom(); return; default: if (promptSel == 0) writeAll(true); else showToast(Lang.t(\"status_not_picked\"), 2000); // cancel: recipe stays previewed only } }", "tokens": 218} {"id": 622271, "source": "method", "repo": "voxivoid/recipe-lab-sony-pmca", "text": "private File snapFile() { return new File(getFilesDir(), \"snapshot.bin\"); }", "tokens": 19} {"id": 622344, "source": "method", "repo": "voxivoid/recipe-lab-sony-pmca", "text": "/** trash pressed and released before the hold: close the brand list, or step the panel full \u2192 label \u2192 hidden \u2192 full */ private void trashPress() { if (running || promptOpen || menuOpen || nameOpen) return; if (overlay == OV_BROWSER) openBrowser(false); else cycleOverlay(); }", "tokens": 69} {"id": 622452, "source": "method", "repo": "voxivoid/recipe-lab-sony-pmca", "text": "private float bodyStep() { return 15 * d; }", "tokens": 16} {"id": 622876, "source": "method", "repo": "w3stling/rssreader", "text": "/** Add item extension for tags @param tag - tag name @param consumer - setter method in Item class to use for mapping @return this instance */ public AbstractRssReader addItemExtension(String tag, BiConsumer consumer) { Objects.requireNonNull(tag, \"Item tag must not be null\"); Objects.requireNonNull(consumer, \"Item consumer must not be null\"); itemTags.put(tag, consumer); return this; }", "tokens": 98} {"id": 623112, "source": "method", "repo": "w3stling/rssreader", "text": "/** Sets the GeoRSS box. @param geoRssBox the box to set */ public void setGeoRssBox(String geoRssBox) { this.geoRssBox = geoRssBox; }", "tokens": 41} {"id": 623113, "source": "method", "repo": "w3stling/rssreader", "text": "/** Sets the GeoRSS elevation. @param geoRssElevation the elevation to set */ public void setGeoRssElevation(Double geoRssElevation) { this.geoRssElevation = geoRssElevation; }", "tokens": 41} {"id": 623503, "source": "method", "repo": "w3stling/rssreader", "text": "protected PscChannel createChannel(DateTimeParser dateTimeParser) { return new PscChannelImpl(dateTimeParser); }", "tokens": 27} {"id": 623565, "source": "method", "repo": "w3stling/rssreader", "text": "/** Create a new instance if a getter returns optional empty and assigns the field the new instance. @param getter getter method @param setter setter method @param factory factory for creating a new instance if field is not set before @return existing or new instance @param any class */ public static Optional createIfNullOptional(Supplier> getter, Consumer setter, Supplier factory) { Optional instance = getter.get(); if (instance.isEmpty()) { T newInstance = factory.get(); setter.accept(newInstance); instance = Optional.of(newInstance); } return instance; }", "tokens": 138} {"id": 623841, "source": "method", "repo": "waffle/waffle", "text": "/** Sets the up. */ void setUp() { this.provider = new BasicSecurityFilterProvider(this.auth); }", "tokens": 25} {"id": 623930, "source": "method", "repo": "waffle/waffle", "text": "/** Logout_subject read only. @throws LoginException the login exception */ void logout_subjectReadOnly() throws LoginException { this.subject.setReadOnly(); this.loginModule.initialize(this.subject, this.callbackHandler, null, this.options); Assertions.assertThrows(LoginException.class, () -> { this.loginModule.logout(); }); }", "tokens": 79} {"id": 624052, "source": "method", "repo": "waffle/waffle", "text": "/** Test sso default basic enabled false. */ void testSsoDefaultBasicEnabledFalse() { final WaffleProperties.SingleSignOnProperties sso = new WaffleProperties.SingleSignOnProperties(); Assertions.assertFalse(sso.isBasicEnabled()); }", "tokens": 53} {"id": 624097, "source": "method", "repo": "waffle/waffle", "text": "/** Test guest is disabled. @throws IOException Signals that an I/O exception has occurred. @throws ServletException the servlet exception */ void testGuestIsDisabled() throws IOException, ServletException { final String securityPackage = \"Negotiate\"; final SimpleFilterChain filterChain = new SimpleFilterChain(); final SimpleHttpRequest request = new SimpleHttpRequest(); final String clientToken = Base64.getEncoder().encodeToString(\"Guest\".getBytes(StandardCharsets.UTF_8)); request.addHeader(\"Authorization\", securityPackage + \" \" + clientToken); final SimpleHttpResponse response = new SimpleHttpResponse(); this.filter.doFilter(request, response, filterChain); Assertions.assertEquals(401, response.getStatus()); Assertions.assertNull(SecurityContextHolder.getContext().getAuthentication()); }", "tokens": 153} {"id": 624450, "source": "method", "repo": "wanglingsong/jsonsurfer", "text": "public void testCollectOneFoundNothing() throws Exception { String jsonPathFoundNothing = \"$..authors\"; Object expireNull = surfer.collectOne(read(\"sample.json\"), jsonPathFoundNothing); assertNull(expireNull); }", "tokens": 48} {"id": 624463, "source": "method", "repo": "wanglingsong/jsonsurfer", "text": "public void testJsonPathFilterMatchRegexInputMismatch() throws Exception { try { JsonPathCompiler.compile(\"$.store.book[?(@.author=~ /abc)]\"); // not a valid regular expression } catch (ParseCancellationException e) { assertTrue(e.getCause() instanceof InputMismatchException); } }", "tokens": 63} {"id": 624656, "source": "method", "repo": "wanglingsong/jsonsurfer", "text": "public boolean startObjectEntry(String key) { if (shouldBreak()) { return false; } currentPosition.updateObjectEntry(key); dispatcher.startObjectEntry(key); filterVerifierDispatcher.startObjectEntry(key); return true; }", "tokens": 52} {"id": 624713, "source": "method", "repo": "wanglingsong/jsonsurfer", "text": "public Void visitFilterGtNum(JsonPathParser.FilterGtNumContext ctx) { filterPathBuilder = createFilterPathBuilder(); Void rst = super.visitFilterGtNum(ctx); filterBuilder.append(new GreaterThanNumPredicate(filterPathBuilder.build(), new BigDecimal(ctx.NUM().getText()))); filterPathBuilder = null; return rst; }", "tokens": 80} {"id": 624734, "source": "method", "repo": "wanglingsong/jsonsurfer", "text": "public RelativePathContext relativePath(int i) { return getRuleContext(RelativePathContext.class,i); }", "tokens": 24} {"id": 624749, "source": "method", "repo": "wanglingsong/jsonsurfer", "text": "public FilterContext filter() { return getRuleContext(FilterContext.class,0); }", "tokens": 20} {"id": 624832, "source": "method", "repo": "wanglingsong/jsonsurfer", "text": "public List getFilters() { return filters; }", "tokens": 15} {"id": 624876, "source": "method", "repo": "wanglingsong/jsonsurfer", "text": "public Type getType() { return Type.ARRAY; }", "tokens": 12} {"id": 624896, "source": "method", "repo": "wanglingsong/jsonsurfer", "text": "public Object resolve(Object document, DocumentResolver resolver) { return document; }", "tokens": 17} {"id": 625032, "source": "method", "repo": "wanglingsong/jsonsurfer", "text": "public JsonNode primitive(long value) { return factory.numberNode(value); }", "tokens": 18} {"id": 625329, "source": "method", "repo": "warmuuh/milkman", "text": "default String computeIndentationForNextLine(String currentLine){ return \"\"; }", "tokens": 16} {"id": 625483, "source": "method", "repo": "warmuuh/milkman", "text": "public void setup() { cmd = new CommandLine(CommandSpec.create() .name(\"\") .addSubcommand(null, commandSpecFactory.getSpecFor(wsCmd)) .addSubcommand(null, commandSpecFactory.getSpecFor(execCmd)) .addSubcommand(null, commandSpecFactory.getSpecFor(editCmd)) .addSubcommand(null, commandSpecFactory.getSpecFor(quitCmd)) .addSubcommand(null, commandSpecFactory.getSpecFor(colCmd))); cmd.setExecutionExceptionHandler(new IExecutionExceptionHandler() { @Override public int handleExecutionException(Exception ex, CommandLine commandLine, ParseResult parseResult) throws Exception { System.out.println(ex.getMessage()); log.error(\"Command execution failed\", ex); return 0; } }); terminal = TerminalBuilder.builder() .build(); reader = LineReaderBuilder.builder() .terminal(terminal) .completer(new PicocliJLineCompleter(cmd.getCommandSpec())) .parser(new DefaultParser()) .build(); rightPrompt = null; }", "tokens": 234} {"id": 625488, "source": "method", "repo": "warmuuh/milkman", "text": "public List createParameters() { return List.of(new Parameter(\"workspace\", \"the name of the workspace to switch to\", new Completion() { @Override public Collection getCompletionCandidates() { return context.getAvailableWorkspaceNames(); } })); }", "tokens": 57} {"id": 625505, "source": "method", "repo": "warmuuh/milkman", "text": "public int getOrder() { return 35; }", "tokens": 13} {"id": 625622, "source": "method", "repo": "warmuuh/milkman", "text": "public Tab getRoot(RequestContainer request, ResponseContainer response) { editor = new TableEditor<>(\"jdbc.result.list\"); editor.disableAddition(); editor.setRowToStringConverter(this::rowToString); VBox.setVgrow(editor, Priority.ALWAYS); RowSetResponseAspect rowSetAspect = response.getAspect(RowSetResponseAspect.class).get(); initEditor(rowSetAspect); HBox tableToolbar = setupToolbar(rowSetAspect); VBox vBox = new VBox(tableToolbar, editor); return new Tab(\"Result\", vBox); }", "tokens": 116} {"id": 625639, "source": "method", "repo": "warmuuh/milkman", "text": "public Flux getEvents() { return events.asFlux(); }", "tokens": 17} {"id": 625759, "source": "method", "repo": "warmuuh/milkman", "text": "public boolean isPrimary() { return false; }", "tokens": 11} {"id": 625772, "source": "method", "repo": "warmuuh/milkman", "text": "public void linkToUrlTextfield(StringProperty urlProperty) { urlProperty.addListener((obs, o, n) -> { if (o != n && n != null) { parseQueryParams(n); onInvalidate.invoke(); } }); }", "tokens": 54} {"id": 625905, "source": "method", "repo": "warmuuh/milkman", "text": "private Ack ack(int id) { Socket self = this; boolean[] sent = {false}; return new Ack() { @Override public void call(Object... args) { EventThread.exec(new Runnable() { @Override public void run() { if (sent[0]) return; sent[0] = true; if (logger.isLoggable(Level.FINE)) { logger.fine(String.format(\"sending ack %s\", args.length != 0 ? args : null)); } JSONArray jsonArgs = new JSONArray(); for (Object arg : args) { jsonArgs.put(arg); } Packet packet = new Packet(Parser.ACK, jsonArgs); packet.id = id; self.packet(packet); } }); } }; }", "tokens": 170} {"id": 625919, "source": "method", "repo": "warmuuh/milkman", "text": "public boolean isSsh() { return (StringUtils.startsWith(gitUrl, \"ssh://\") || StringUtils.startsWith(gitUrl, \"git@\")); }", "tokens": 33} {"id": 626109, "source": "method", "repo": "wayn111/waynboot-mall", "text": "void submitExecutesSingleOrderChain() { OrderDTO orderDTO = new OrderDTO(); orderDTO.setOrderSn(\"ORDER-SN\"); orderDTO.setUserId(100L); when(orderSubmitChain.execute(any(OrderSubmitChainContext.class))) .thenAnswer(invocation -> invocation.getArgument(0)); assertDoesNotThrow(() -> orderSubmitSupport.submit(orderDTO)); verify(orderSubmitChain).execute(any(OrderSubmitChainContext.class)); }", "tokens": 103} {"id": 626133, "source": "method", "repo": "wayn111/waynboot-mall", "text": "public OrderPayResVO pay(OrderPayReqVO reqVo) { Order order = orderService.getOne(new QueryWrapper().eq(\"order_sn\", reqVo.getOrderSn())); order.setPayId(NanoId.randomNanoId()); order.setPayTime(LocalDateTime.now()); order.setOrderStatus(OrderStatusEnum.STATUS_PAY.getStatus()); order.setUpdateTime(new Date()); orderService.updateById(order); updateVirtualSales(order.getId()); return new OrderPayResVO(); }", "tokens": 111} {"id": 626262, "source": "method", "repo": "WeaponMechanics/WeaponMechanics", "text": "public Condition serialize(@NotNull SerializeData data) throws SerializerException { return applyParentArgs(data, new WalkingCondition()); }", "tokens": 28} {"id": 626445, "source": "method", "repo": "WeaponMechanics/WeaponMechanics", "text": "/** Constructs a DefaultExplosion object. @param yield The yield of the explosion, typically 4.0. @param gridSize How many grids on the cube, typically 16. */ public DefaultExplosion(double yield, int gridSize) { this.yield = (float) yield; this.gridSize = gridSize; this.bound = gridSize - 1; }", "tokens": 81} {"id": 626634, "source": "method", "repo": "WeaponMechanics/WeaponMechanics", "text": "/** @return the weapon title used to shoot this projectile */ public String getWeaponTitle() { return weaponTitle; }", "tokens": 25} {"id": 626729, "source": "method", "repo": "WeaponMechanics/WeaponMechanics", "text": "public float getRecoilVarianceX() { return recoilVarianceX; }", "tokens": 16} {"id": 627149, "source": "method", "repo": "webcompere/system-stubs", "text": "/** Construct with an output shared from the an output created against the System.out original @param outputFactory the output factory to create the output */ public SystemErrAndOut(OutputFactory outputFactory) { systemOut = new SystemOut(outputFactory); systemErr = new SystemErr(outputStream -> systemOut.getOutput()); }", "tokens": 74} {"id": 627350, "source": "method", "repo": "webcompere/system-stubs", "text": "void taps_text_that_is_written_to_System_out_by_statement( ) throws Exception { String textWrittenToSystemOut = tapSystemOut( () -> out.print(\"some text\") ); assertThat(textWrittenToSystemOut) .isEqualTo(\"some text\"); }", "tokens": 67} {"id": 627396, "source": "method", "repo": "webcompere/system-stubs", "text": "void system_in_throws_IndexOutOfBoundsException_when_read_is_called_with_negative_offset() throws Exception { withTextFromSystemIn(\"arbitrary text\") .execute(() -> { Throwable exception = catchThrowable( () -> System.in.read(DUMMY_ARRAY, -1, VALID_READ_LENGTH) ); assertThat(exception) .isInstanceOf(IndexOutOfBoundsException.class); }); }", "tokens": 91} {"id": 627511, "source": "method", "repo": "webcompere/system-stubs", "text": "public static byte[] toEnvironmentBlock(Map m, int[] envc) { if (m == null) { return null; } int count = m.size() * 2; // For added '=' and NUL for (Map.Entry entry : m.entrySet()) { count += entry.getKey().getBytes().length; count += entry.getValue().getBytes().length; } byte[] block = new byte[count]; int i = 0; for (Map.Entry entry : m.entrySet()) { final byte[] key = entry.getKey().getBytes(); final byte[] value = entry.getValue().getBytes(); System.arraycopy(key, 0, block, i, key.length); i += key.length; block[i++] = (byte) '='; System.arraycopy(value, 0, block, i, value.length); i += value.length + 1; // No need to write NUL byte explicitly //block[i++] = (byte) '\\u0000'; } envc[0] = m.size(); return block; }", "tokens": 246} {"id": 627638, "source": "method", "repo": "webcompere/system-stubs", "text": "public void beforeTest() { // even though the stub looks to be null, it's instantiated by here environmentVariables.set(\"setinbefore\", \"yes\"); }", "tokens": 36} {"id": 627644, "source": "method", "repo": "webcompere/system-stubs", "text": "public void canReadThingsSentToSystemOut() { // simulate the system under test writing to std out System.out.println(\"Can I assert this?\"); assertThat(out.getText()).startsWith(\"Can I assert this?\"); }", "tokens": 48} {"id": 627708, "source": "method", "repo": "webliteca/swingwebview", "text": "public static void main(String[] args) throws Exception { // Heavyweight popups so the \"Save password?\" JOptionPane renders // above the WebView region on macOS / Windows heavyweight. JPopupMenu.setDefaultLightWeightPopupEnabled(false); ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); HttpServer server = HttpServer.create(new InetSocketAddress(\"127.0.0.1\", 0), 0); server.createContext(\"/\", new LoginHandler()); // Canvas 26 4a: a two-step login, the shape the username-first flow exists for. server.createContext(\"/two-step\", new TwoStepHandler()); server.setExecutor(null); server.start(); int port = server.getAddress().getPort(); origin = \"http://127.0.0.1:\" + port; EventQueue.invokeLater(() -> run(port)); }", "tokens": 187} {"id": 627862, "source": "method", "repo": "webliteca/swingwebview", "text": "private OffscreenWebView(long peer) { this.peer = peer; this.evalDispatcher = new EvalDispatcher(new EvalDispatcher.EvalSink() { @Override public void eval(String js) { long p = OffscreenWebView.this.peer; if (p != 0L) { WebViewNative.webview_offscreen_eval(p, js); } } }, true, \"OffscreenWebView\"); this.functionDispatcher = new FunctionDispatcher( new FunctionDispatcher.FunctionSink() { @Override public void eval(String js) { long p = OffscreenWebView.this.peer; if (p != 0L) { WebViewNative.webview_offscreen_eval(p, js); } } @Override public void addOnBeforeLoad(String js) { long p = OffscreenWebView.this.peer; if (p != 0L) { WebViewNative.webview_offscreen_init(p, js); } } }, \"OffscreenWebView\"); }", "tokens": 211} {"id": 628005, "source": "method", "repo": "webliteca/swingwebview", "text": "private void deliver(WebViewMouseEvent event) { // CopyOnWriteArrayList iteration sees a stable snapshot, so a // listener calling removeWebViewMouseListener / addWebViewMouseListener // during contextMenuRequested only takes effect for the NEXT event. for (WebViewMouseListener l : listeners) { try { l.contextMenuRequested(event); } catch (Throwable t) { Thread.UncaughtExceptionHandler h = Thread.getDefaultUncaughtExceptionHandler(); if (h != null) { try { h.uncaughtException(Thread.currentThread(), t); } catch (Throwable ignored) {} } else { t.printStackTrace(); } } } }", "tokens": 124} {"id": 628058, "source": "method", "repo": "webliteca/swingwebview", "text": "public void install(String[] schemes, Object dispatcher) { WebViewNative.webview_scheme_install(schemes, dispatcher); }", "tokens": 28} {"id": 628447, "source": "method", "repo": "webliteca/swingwebview", "text": "public void testThrowingResolverFallsThroughInsteadOfPropagating() { StubComponent c = new StubComponent(); c.setUserAgent(SAFARI); c.setUserAgentResolver(new Function() { @Override public String apply(String url) { throw new IllegalStateException(\"resolver blew up\"); } }); assertEquals(\"a throwing resolver must never break a navigation\", SAFARI, c.resolveFor(\"https://example.com/\")); }", "tokens": 100} {"id": 628650, "source": "method", "repo": "weisj/darklaf", "text": "public double currentState() { return fraction; }", "tokens": 10} {"id": 628664, "source": "method", "repo": "weisj/darklaf", "text": "public void drawLine(final int x1, final int y1, final int x2, final int y2) { g.drawLine(x1, y1, x2, y2); }", "tokens": 44} {"id": 628923, "source": "method", "repo": "weisj/darklaf", "text": "public void mouseMoved(final MouseEvent e) { super.mouseMoved(ui.convertEvent(e)); }", "tokens": 26} {"id": 628944, "source": "method", "repo": "weisj/darklaf", "text": "protected void paintText(final Graphics g, final int tabPlacement, final Font font, final FontMetrics metrics, final int tabIndex, final String title, final Rectangle textRect, final boolean isSelected) { View v = getTextViewForTab(tabIndex); int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); Color bg = getTabBackgroundColor(tabIndex, isSelected, getRolloverTab() == tabIndex); g.setColor(getTabForeground(tabIndex, isSelected)); StringPainter.drawStringImpl(g, tabPane, v, title, textRect, font, metrics, mnemIndex, bg); }", "tokens": 132} {"id": 628953, "source": "method", "repo": "weisj/darklaf", "text": "/** Select the next tab in the run. @param current the current tab */ protected void selectNextTabInRun(final int current) { int tabCount = tabPane.getTabCount(); int tabIndex = getNextTabIndexInRun(tabCount, current); while (tabIndex != current && !tabPane.isEnabledAt(tabIndex)) { tabIndex = getNextTabIndexInRun(tabCount, tabIndex); } navigateTo(tabIndex); }", "tokens": 95} {"id": 629224, "source": "method", "repo": "weisj/darklaf", "text": "protected JComponent createComponent() { JSplitPane splitPane = new JSplitPane(); JInternalFrame left = new JInternalFrame(\"Left Frame\"); left.setContentPane(makeContent(\"Left Content\", ColorPalette.FOREST)); left.show(); JInternalFrame right = new JInternalFrame(\"Right Frame\"); right.setContentPane(makeContent(\"Right Content\", ColorPalette.PINK)); right.show(); SwingUtilities.invokeLater(() -> splitPane.setDividerLocation(0.5f)); splitPane.setLeftComponent(wrap(left)); splitPane.setRightComponent(wrap(right)); return splitPane; }", "tokens": 123} {"id": 629405, "source": "method", "repo": "weisj/darklaf", "text": "public boolean isValid() { return hwnd != 0; }", "tokens": 15} {"id": 629456, "source": "method", "repo": "weisj/jsvg", "text": "public Color get(@NotNull MeasureContext context) { return current(context); }", "tokens": 18} {"id": 629493, "source": "method", "repo": "weisj/jsvg", "text": "public Data resolve(@NotNull ComputeFlags flags) { return transformer.apply(data, flags.or(additionalFlags)); }", "tokens": 26} {"id": 629500, "source": "method", "repo": "weisj/jsvg", "text": "private static boolean isPossibleEmoji(char @NotNull [] codepoint) { for (char c : codepoint) { if (Character.isHighSurrogate(c) || Character.isLowSurrogate(c)) { return true; } } return false; }", "tokens": 55} {"id": 629503, "source": "method", "repo": "weisj/jsvg", "text": "public int hashCode() { return Objects.hash(super.hashCode(), size, weight); }", "tokens": 20} {"id": 629506, "source": "method", "repo": "weisj/jsvg", "text": "private static String stripQuotes(@NotNull String str, char quoteChar) { String quoteStr = String.valueOf(quoteChar); if (str.length() > 2 && str.startsWith(quoteStr) && str.endsWith(quoteStr)) { return str.substring(1, str.length() - 1); } return str; }", "tokens": 73} {"id": 629526, "source": "method", "repo": "weisj/jsvg", "text": "public int hashCode() { return Italic.class.hashCode(); }", "tokens": 15} {"id": 629556, "source": "method", "repo": "weisj/jsvg", "text": "private void validateShape(@NotNull MeasureContext measureContext) { line.setLine( x1.resolve(measureContext), y1.resolve(measureContext), x2.resolve(measureContext), y2.resolve(measureContext)); }", "tokens": 52} {"id": 629889, "source": "method", "repo": "weisj/jsvg", "text": "public String toString() { return \"Delim{value='\" + new String(Character.toChars(value)) + \"'}\"; }", "tokens": 28} {"id": 629907, "source": "method", "repo": "weisj/jsvg", "text": "public Specificity specificity() { return Specificity.ONE_ID; }", "tokens": 19} {"id": 629971, "source": "method", "repo": "weisj/jsvg", "text": "private T recordIndirectChild(T child, String value, ElementRelation relation) { if (child != null && relation == ElementRelation.PAINTED_CHILD) { ParsedElement containingElement = getElementByUrl(ParsedElement.class, value); if (containingElement != null) { element().addIndirectChild(containingElement); } } return child; }", "tokens": 78} {"id": 630020, "source": "method", "repo": "weisj/jsvg", "text": "DefaultElementLoader(AllowExternalResources allowExternalResources) { documentLoader = createDocumentLoader(allowExternalResources); }", "tokens": 25} {"id": 630115, "source": "method", "repo": "weisj/jsvg", "text": "public void close() { Output previousOutput = this.output; BufferedImage result = this.blittableImage.image(); if (isolationEffects.filter != null) { assert filterInfo != null; result = isolationEffects.filter.applyFilter(previousOutput, context, filterInfo); previousOutput.applyClip(filterInfo.filterRegion()); } if (isolationEffects.mask != null) { previousOutput.setPaint(() -> isolationEffects.mask.createMaskPaint( previousOutput, context, elementBounds)); } if (isolationEffects.clipPath != null) { isolationEffects.clipPath.applyClip(previousOutput, context, elementBounds); } blittableImage.prepareForBlitting(previousOutput); previousOutput.drawImage(result, context.platformSupport().imageObserver()); imageOutput.dispose(); super.close(); }", "tokens": 175} {"id": 630170, "source": "method", "repo": "weisj/jsvg", "text": "public void scale(double sx, double sy) { currentTransform.scale(sx, sy); }", "tokens": 25} {"id": 630268, "source": "method", "repo": "weisj/jsvg", "text": "void testSymbol() { assertEquals(SUCCESS, compareShape(\"symbol/symbol1.svg\")); assertEquals(SUCCESS, compareShape(\"symbol/symbol2.svg\")); }", "tokens": 35} {"id": 630378, "source": "method", "repo": "weisj/jsvg", "text": "public boolean isLoggable(Level level) { return false; }", "tokens": 14} {"id": 630502, "source": "method", "repo": "weizhiqiang1995/erp-pro", "text": "public Class getAuthEnumClass() { return AutoDemandAuthEnum.class; }", "tokens": 18} {"id": 630625, "source": "method", "repo": "weizhiqiang1995/erp-pro", "text": "public List listEnabledByStoreId(String storeId) { QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(MybatisPlusUtil.toColumns(ShopStoreDepot::getStoreId), storeId); wrapper.eq(MybatisPlusUtil.toColumns(ShopStoreDepot::getEnabled), EnableEnum.ENABLE_USING.getKey()); wrapper.orderByAsc(MybatisPlusUtil.toColumns(ShopStoreDepot::getPriority)); return list(wrapper); }", "tokens": 97} {"id": 630661, "source": "method", "repo": "weizhiqiang1995/erp-pro", "text": "public void removeAllLifecycleState(InputObject inputObject, OutputObject outputObject) { Map params = inputObject.getParams(); String className = params.get(\"className\").toString(); String appId = params.get(\"appId\").toString(); QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq(MybatisPlusUtil.toColumns(LifecycleState::getClassName), className); queryWrapper.eq(MybatisPlusUtil.toColumns(LifecycleState::getAppId), appId); List lifecycleStateList = list(queryWrapper); if (CollectionUtil.isEmpty(lifecycleStateList)) { return; } List idsList = lifecycleStateList.stream().map(LifecycleState::getId).collect(Collectors.toList()); deleteById(idsList); }", "tokens": 152} {"id": 630678, "source": "method", "repo": "weizhiqiang1995/erp-pro", "text": "public List queryDictTypeIdByDictCode(List dictCodeList, Integer enabled) { if (CollectionUtil.isEmpty(dictCodeList)) { return new ArrayList<>(); } dictCodeList = dictCodeList.stream().filter(StringUtils::isNotBlank).distinct().collect(Collectors.toList()); if (CollectionUtil.isEmpty(dictCodeList)) { return new ArrayList<>(); } QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.in(MybatisPlusUtil.toColumns(SysDictType::getDictCode), dictCodeList); if (enabled != null) { queryWrapper.eq(MybatisPlusUtil.toColumns(SysDictType::getEnabled), enabled); } List dictTypeList = list(queryWrapper); if (CollectionUtil.isEmpty(dictTypeList)) { return new ArrayList<>(); } return dictTypeList; }", "tokens": 174} {"id": 630929, "source": "method", "repo": "weliem/blessed-android", "text": "public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action != null && action.equals(LocationManager.MODE_CHANGED_ACTION)) { boolean isEnabled = areLocationServicesEnabled(); Timber.i(\"Location service state changed to: %s\", isEnabled ? \"on\" : \"off\"); checkPermissions(); } }", "tokens": 75} {"id": 631054, "source": "method", "repo": "weliem/blessed-android", "text": "public void onScanResult(final int callbackType, final ScanResult result) { synchronized (this) { final String deviceName = result.getDevice().getName(); if (deviceName == null) return; for (String name : scanPeripheralNames) { if (deviceName.contains(name)) { sendScanResult(result); return; } } } }", "tokens": 73} {"id": 631146, "source": "method", "repo": "weliem/blessed-android", "text": "/** Try to connect to a device whenever it is found by the OS. This call never times out. Connecting to a device will take longer than when using connect() */ void autoConnect() { // Note that this will only work for devices that are known! After turning BT on/off Android doesn't know the device anymore! // https://stackoverflow.com/questions/43476369/android-save-ble-device-to-reconnect-after-app-close if (state == BluetoothProfile.STATE_DISCONNECTED) { mainHandler.post(new Runnable() { @Override public void run() { // Connect to device with autoConnect = true Logger.i(TAG, \"autoConnect to '%s' (%s) using transport %s\", getName(), getAddress(), transport.name()); registerBondingBroadcastReceivers(); discoveryStarted = false; connectTimestamp = SystemClock.elapsedRealtime(); bluetoothGatt = connectGattHelper(device, true, bluetoothGattCallback); if (bluetoothGatt != null) { bluetoothGattCallback.onConnectionStateChange(bluetoothGatt, HciStatus.SUCCESS.value, BluetoothProfile.STATE_CONNECTING); } else { Logger.e(TAG, \"failed to autoconnect to peripheral '%s'\", getAddress()); } } }); } else { Logger.e(TAG, \"peripheral '%s' not yet disconnected, will not connect\", getName()); } }", "tokens": 291} {"id": 631206, "source": "method", "repo": "weliem/blessed-android", "text": "/** Callback invoked as the result of a descriptor write operation. This callback is not called for the Client Characteristic Configuration descriptor. Instead the {@link BluetoothPeripheralCallback#onNotificationStateUpdate(BluetoothPeripheral, BluetoothGattCharacteristic, GattStatus)} will be called @param peripheral the peripheral @param value the value that was written @param descriptor the descriptor written to @param status the GATT status code */ public void onDescriptorWrite(@NotNull BluetoothPeripheral peripheral, @NotNull byte[] value, @NotNull BluetoothGattDescriptor descriptor, @NotNull GattStatus status) {}", "tokens": 108} {"id": 631244, "source": "method", "repo": "weliem/blessed-android", "text": "private boolean internalNotifyCharacteristicChanged(@NotNull final BluetoothDevice device, @NotNull final BluetoothGattCharacteristic characteristic, @NotNull final byte[] value, final boolean confirm) { currentNotifyValue = value; currentNotifyCharacteristic = characteristic; if (android.os.Build.VERSION.SDK_INT >= 33) { final int result = bluetoothGattServer.notifyCharacteristicChanged(device, characteristic, confirm, value); return result == BluetoothStatusCodes.SUCCESS; } else { characteristic.setValue(value); return bluetoothGattServer.notifyCharacteristicChanged(device, characteristic, confirm); } }", "tokens": 119} {"id": 631330, "source": "method", "repo": "weliem/blessed-android", "text": "public void parseFloat_LittleEndianTest() { BluetoothBytesParser parser; parser = new BluetoothBytesParser(new byte[]{1,2,3,4}, LITTLE_ENDIAN); assertEquals(1.97120998E9f, parser.getFloatValue(FORMAT_FLOAT), 0.001f); parser.setOffset(0); assertEquals(1.97120998E9f, parser.getFloatValue(FORMAT_FLOAT, LITTLE_ENDIAN), 0.001f); parser.setOffset(0); assertEquals(1.97120998E9f, parser.getFloatValue(FORMAT_FLOAT, 0, LITTLE_ENDIAN), 0.001f); parser = new BluetoothBytesParser(new byte[]{1,-2,3,-4}, LITTLE_ENDIAN); assertEquals(26.1633, parser.getFloatValue(FORMAT_FLOAT), 0.001f); parser.setOffset(0); assertEquals(26.1633, parser.getFloatValue(FORMAT_FLOAT, LITTLE_ENDIAN), 0.001f); parser.setOffset(0); assertEquals(26.1633, parser.getFloatValue(FORMAT_FLOAT, 0, LITTLE_ENDIAN), 0.001f); parser = new BluetoothBytesParser(new byte[]{-1,2,-3,4}, LITTLE_ENDIAN); assertEquals(-1.958409984E9f, parser.getFloatValue(FORMAT_FLOAT), 0.001f); parser.setOffset(0); assertEquals(-1.958409984E9f, parser.getFloatValue(FORMAT_FLOAT, LITTLE_ENDIAN), 0.001f); parser.setOffset(0); assertEquals(-1.958409984E9f, parser.getFloatValue(FORMAT_FLOAT, 0, LITTLE_ENDIAN), 0.001f); }", "tokens": 445} {"id": 631404, "source": "method", "repo": "weliem/blessed-android", "text": "public void When_getPeripheral_is_called_with_a_valid_address_then_a_corresponding_peripheral_is_returned() { // Given String address = \"AC:DE:EF:12:34:56\"; BluetoothDevice device = mock(BluetoothDevice.class); when(device.getAddress()).thenReturn(address); when(bluetoothAdapter.getRemoteDevice(address)).thenReturn(device); // Get peripheral and supply lowercase mac address BluetoothPeripheral peripheral = central.getPeripheral(address); assertNotNull(peripheral); assertEquals(address, peripheral.getAddress()); }", "tokens": 124} {"id": 631529, "source": "method", "repo": "wesjd/anvilgui", "text": "/** {@inheritDoc} */ public void setActiveContainerId(AnvilContainerWrapper container, int containerId) { // noop }", "tokens": 26} {"id": 631600, "source": "method", "repo": "wesjd/anvilgui", "text": "public String getRenameText() { return this.x; }", "tokens": 14} {"id": 631672, "source": "method", "repo": "wesjd/anvilgui", "text": "/** Updates the title of the AnvilGUI to the new one. @param literalTitle The title to use as literal text @param preserveRenameText Whether to preserve the entered rename text @throws IllegalArgumentException when literalTitle is null @see Builder#title(String) */ static ResponseAction updateTitle(String literalTitle, boolean preserveRenameText) { Validate.notNull(literalTitle, \"literalTitle cannot be null\"); return (anvilGUI, player) -> anvilGUI.setTitle(literalTitle, preserveRenameText); }", "tokens": 108} {"id": 631791, "source": "method", "repo": "wgpsec/fofa_viewer", "text": "public static void close(){ if(pool != null){ pool.shutdown(); } }", "tokens": 18} {"id": 631998, "source": "method", "repo": "whirvis/jraknet", "text": "/** Returns whether or not the client is handshaking. @return true if the client is handshaking, false otherwise. */ public boolean isHandshaking() { if (peer == null) { return false; // No peer } return peer.isHandshaking(); }", "tokens": 65} {"id": 632006, "source": "method", "repo": "whirvis/jraknet", "text": "/** Called by the {@link com.whirvis.jraknet.client.RakNetClientHandler RakNetClientHander} when it catches a Throwable while handling a packet. @param address the address that caused the exception. @param cause the Throwable caught by the handler. @throws NullPointerException if the cause address or cause are null. */ protected final void handleHandlerException(InetSocketAddress address, Throwable cause) throws NullPointerException { if (address == null) { throw new NullPointerException(\"Address cannot be null\"); } else if (cause == null) { throw new NullPointerException(\"Cause cannot be null\"); } else if (peerFactory != null) { if (address.equals(peerFactory.getAddress())) { peerFactory.exceptionCaught(new NettyHandlerException(this, handler, address, cause)); } } else if (peer != null) { if (address.equals(peer.getAddress())) { this.disconnect(cause); } } logger.warn(\"Handled exception \" + cause.getClass().getName() + \" caused by address \" + address); this.callEvent(listener -> listener.onHandlerException(this, address, cause)); }", "tokens": 252} {"id": 632237, "source": "method", "repo": "whirvis/jraknet", "text": "/** Constructs a TimeoutException. @param peer the peer that has timed out. */ public TimeoutException(RakNetPeer peer) { super(\"Peer timeout\"); this.peer = peer; }", "tokens": 41} {"id": 632285, "source": "method", "repo": "whirvis/jraknet", "text": "/** Creates a CONNECTION_REQUEST_ACCEPTED packet to be decoded. @param packet the original packet whose data will be read from in the {@link #decode()} method. */ public ConnectionRequestAccepted(Packet packet) { super(packet); }", "tokens": 53} {"id": 632330, "source": "method", "repo": "whirvis/jraknet", "text": "/** Creates a ranged record. @param index the starting index. @param endIndex the ending index. @throws IllegalArgumentException if the index is negative. */ public Record(int index, int endIndex) throws IllegalArgumentException { if (index < 0) { throw new IllegalArgumentException(\"Index cannot be negative\"); } this.index = index; this.endIndex = endIndex; this.updateSequenceIds(); }", "tokens": 87} {"id": 632379, "source": "method", "repo": "whirvis/jraknet", "text": "/** Forwards the port that the server is running on. @return the result of the port forward attempt. @see RakNet#forwardPort(int) */ public final RakNet.UPnPResult forwardPort() { return RakNet.forwardPort(this.getPort()); }", "tokens": 57} {"id": 632435, "source": "method", "repo": "whirvis/jraknet", "text": "/** Disconnects a client from the server. @param address the IP address of the client. @param port the port. @return true if a client was disconnect, false otherwise. */ public final boolean disconnect(InetAddress address, int port) { return this.disconnect(address, port, (String) /* Solves ambiguity */ null); }", "tokens": 78} {"id": 632517, "source": "method", "repo": "whirvis/jraknet", "text": "public void writeChars(String s) throws IOException { for (char c : s.toCharArray()) { packet.writeUnsignedShort(c); } }", "tokens": 33} {"id": 632549, "source": "method", "repo": "whirvis/jraknet", "text": "/** Creates the client for the test. @return the client that will be sending the sequenced packets. @throws RakNetException if a RakNet error occurs. @throws UnknownHostException if the localhost address could not be found. */ private static RakNetClient createClient() throws RakNetException, UnknownHostException { RakNetClient client = new RakNetClient(); client.addListener(new RakNetClientListener() { @Override public void onLogin(RakNetClient client, RakNetServerPeer peer) { LOG.info(\"Client - Logged in to server with MTU \" + peer.getMaximumTransferUnit() + \", sending \" + PACKET_SEND_COUNT + \" packets...\"); int packetSize = 0; startSend = System.currentTimeMillis(); for (int i = 0; i < PACKET_SEND_COUNT; i++) { RakNetPacket sequencedPacket = new RakNetPacket(SEQUENCE_HEADER_ID); sequencedPacket.writeInt(i); packetSize += sequencedPacket.size(); peer.sendMessage(Reliability.UNRELIABLE_SEQUENCED, sequencedPacket); } peer.sendMessage(Reliability.RELIABLE_SEQUENCED, SEQUENCE_END_ID); LOG.info(\"Client - Sent \" + PACKET_SEND_COUNT + \" packets (\" + packetSize + \" bytes, \" + (packetSize / 4) + \" ints)\"); } @Override public void onDisconnect(RakNetClient client, InetSocketAddress address, RakNetServerPeer peer, String reason) { LOG.error(\"Client - Lost connection to server (\" + reason + \")\"); System.exit(1); } @Override public void onHandlerException(RakNetClient client, InetSocketAddress address, Throwable cause) { cause.printStackTrace(); System.exit(1); } }); client.connect(\"localhost\", RakNetTest.WHIRVIS_DEVELOPMENT_PORT); return client; }", "tokens": 388} {"id": 632813, "source": "method", "repo": "wildmountainfarms/solarthing", "text": "/** If {@code ignoreConflicts} is true, then when a conflict is found, no exception will be thrown. You should ignore conflicts if you are retrying the uploading of a given unique packet, because if there is a conflict, then it must have gotten uploaded correctly without you knowing about it.

Note: If ignoreConflicts=false, this implementation is not thread safe for parallel uploading @param database The database to upload to @param ignoreConflicts true to ignore conflicts, false otherwise. */ public CouchDbPacketSaver(CouchDbDatabase database, boolean ignoreConflicts){ this.database = database; idMap = ignoreConflicts ? null : new HashMap<>(); }", "tokens": 134} {"id": 632815, "source": "method", "repo": "wildmountainfarms/solarthing", "text": "public static Set> flattenJsonObject(ObjectNode object) { return flattenJsonObject(object, \".\"); }", "tokens": 31} {"id": 632938, "source": "method", "repo": "wildmountainfarms/solarthing", "text": "ImmutableCouchProperties(HttpUrl url, @Nullable String username, @Nullable String password, boolean basicAuth) { this.basicAuth = basicAuth; this.url = requireNonNull(url); this.username = username; this.password = password; }", "tokens": 52} {"id": 633238, "source": "method", "repo": "wildmountainfarms/solarthing", "text": "default ChargingState getChargingMode() { return Modes.getActiveMode(ChargingState.class, getChargingStateValue()); }", "tokens": 28} {"id": 633399, "source": "method", "repo": "wildmountainfarms/solarthing", "text": "public List getMeta(long dateMillis, int fragmentId) { List r = new ArrayList<>(); for (TimedMetaCollection timedMetaCollection : rootMetaPacket.getMeta()) { if (timedMetaCollection.getTimeRange().contains(dateMillis)) { for (BasicMetaPacket basicMetaPacket : timedMetaCollection.getPackets()) { if (basicMetaPacket instanceof TargetMetaPacket targetMetaPacket) { if (targetMetaPacket.getFragmentIds().contains(fragmentId)) { r.addAll(targetMetaPacket.getPackets()); } } } } } return r; }", "tokens": 133} {"id": 633416, "source": "method", "repo": "wildmountainfarms/solarthing", "text": "public Instant getEndTime() { return endTime == null ? null : Instant.ofEpochMilli(endTime); }", "tokens": 21} {"id": 633750, "source": "method", "repo": "williamfiset/algorithms", "text": "/** Returns the query of the range [l, r] on the original `values` array (+ any updates made to it) @param l the left endpoint of the range query (inclusive) @param r the right endpoint of the range query (inclusive) */ public long rangeQuery(int l, int r) { return rangeQuery(0, 0, n - 1, l, r); }", "tokens": 86} {"id": 633874, "source": "method", "repo": "williamfiset/algorithms", "text": "private MatchingCost f(int state, MatchingCost[] dp, int[] history) { if (dp[state] != null) { return dp[state]; } if (state == 0) { return new MatchingCost(); } int p1, p2; // Seek to find active bit position (p1) for (p1 = 0; p1 < n; p1++) { if ((state & (1 << p1)) > 0) { break; } } int bestState = -1; MatchingCost bestMatchingCost = MatchingCost.createInfiniteValueMatchingCost(); for (p2 = p1 + 1; p2 < n; p2++) { // Position `p2` is on. Try matching the pair (p1, p2) together. if ((state & (1 << p2)) > 0) { int reducedState = state ^ (1 << p1) ^ (1 << p2); MatchingCost matchCost = new MatchingCost(f(reducedState, dp, history)); matchCost.updateMatchingCost(cost[p1][p2]); if (matchCost.isBetterMatchingCost(bestMatchingCost)) { bestMatchingCost = matchCost; bestState = reducedState; } } } history[state] = bestState; return dp[state] = bestMatchingCost; }", "tokens": 295} {"id": 633939, "source": "method", "repo": "williamfiset/algorithms", "text": "public void solve() { if (solved) return; int[] sccs = sccSolver.getSccs(); // System.out.println(Arrays.toString(sccs)); // Assume that this 2SAT problem is satisfiable and try to // disprove it by looking at which SCCs p and ~p belong to. isSatisfiable = true; for (int i = 0; i < sccs.length; i += 2) { if (sccs[i] == sccs[i ^ 1]) { isSatisfiable = false; break; } } // Find a truth assignment. if (isSatisfiable) { // get topsort ordering } solved = true; }", "tokens": 168} {"id": 633964, "source": "method", "repo": "williamfiset/algorithms", "text": "private static void testSmallFlowGraph() { int n = 6; int s = n - 1; int t = n - 2; Dinics solver; solver = new Dinics(n, s, t); // Source edges solver.addEdge(s, 0, 10); solver.addEdge(s, 1, 10); // Sink edges solver.addEdge(2, t, 10); solver.addEdge(3, t, 10); // Middle edges solver.addEdge(0, 1, 2); solver.addEdge(0, 2, 4); solver.addEdge(0, 3, 8); solver.addEdge(1, 3, 9); solver.addEdge(3, 2, 6); System.out.println(solver.getMaxFlow()); // 19 }", "tokens": 189} {"id": 634038, "source": "method", "repo": "williamfiset/algorithms", "text": "public static void generatePermutations(Object[] sequence) { if (sequence == null) return; boolean[] used = new boolean[sequence.length]; int[] picked = new int[sequence.length]; permutations(0, used, picked, sequence); }", "tokens": 54} {"id": 634113, "source": "method", "repo": "williamfiset/algorithms", "text": "public void LeftLeftCase() { tree.insert(15, 15); tree.insert(10, 8); tree.insert(20, 10); tree.insert(30, 9); assertThat(tree.root.left.getValue()).isEqualTo(10); assertThat(tree.root.getValue()).isEqualTo(15); assertThat(tree.root.right.getValue()).isEqualTo(20); assertThat(tree.root.right.right.getValue()).isEqualTo(30); tree.insert(32, 14); assertThat(tree.root.left.getValue()).isEqualTo(10); assertThat(tree.root.getValue()).isEqualTo(15); assertThat(tree.root.right.getValue()).isEqualTo(32); assertThat(tree.root.right.left.getValue()).isEqualTo(20); assertThat(tree.root.right.left.right.getValue()).isEqualTo(30); assertThat(tree.root.right.left.right.left).isNull(); assertThat(tree.root.right.left.right.right).isNull(); assertThat(tree.root.right.left.left).isNull(); assertThat(tree.root.right.right).isNull(); assertThat(tree.root.left.left).isNull(); assertThat(tree.root.left.right).isNull(); }", "tokens": 290} {"id": 634279, "source": "method", "repo": "williamfiset/algorithms", "text": "public void testInsertionsOnly() { // \"aaa\" -> \"aaabbb\" requires 3 insertions at cost 10 assertThat(EditDistanceIterative.editDistance(\"aaa\", \"aaabbb\", 10, 2, 3)).isEqualTo(30); }", "tokens": 59} {"id": 634401, "source": "method", "repo": "williamfiset/algorithms", "text": "public void rGreaterThanNThrows() { assertThrows(IllegalArgumentException.class, () -> BinomialCoefficientModPrime.compute(5, 6, MOD)); }", "tokens": 36} {"id": 634402, "source": "method", "repo": "williamfiset/algorithms", "text": "public void eliminateCoefficient_unsolvable() { // 2x \u2261 3 (mod 4) \u2014 no solution since gcd(2,4)=2 does not divide 3 assertNull(ChineseRemainderTheorem.eliminateCoefficient(2, 3, 4)); }", "tokens": 66} {"id": 634518, "source": "method", "repo": "willowtreeapps/hyperion-android", "text": "public void setParallax(float parallax) { // Make sure parallax is between 0 and 1 parallax = Math.min(1, Math.max(0, parallax)); this.parallax = parallax; }", "tokens": 52} {"id": 634556, "source": "method", "repo": "willowtreeapps/hyperion-android", "text": "public EditTextAttributeCollector() { super(EditText.class); }", "tokens": 15} {"id": 634700, "source": "method", "repo": "willowtreeapps/hyperion-android", "text": "public Activity getForegroundActivity() { return activity; }", "tokens": 12} {"id": 634791, "source": "method", "repo": "willowtreeapps/hyperion-android", "text": "void forceDisconnect() { // `onServiceDisconnected` doesn't seem to be called as expected, so this method guarantees unbinding. if (this.service != null) { this.service.detach(activity); } service = null; }", "tokens": 52} {"id": 634885, "source": "method", "repo": "willowtreeapps/hyperion-android", "text": "public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater inflater = LayoutInflater.from(parent.getContext()); if (viewType == 1) { View itemView = inflater.inflate(R.layout.hd_item_up, parent, false); return new UpViewHolder(files, itemView); } View itemView = inflater.inflate(R.layout.hd_item_file, parent, false); return new FileViewHolder(files, itemView); }", "tokens": 97} {"id": 634935, "source": "method", "repo": "willowtreeapps/hyperion-android", "text": "public PluginModule createPluginModule() { return new GeigerCounterModule(detector); }", "tokens": 21} {"id": 634940, "source": "method", "repo": "willowtreeapps/hyperion-android", "text": "public PluginModule createPluginModule() { return new MeasurementInspectorModule(); }", "tokens": 17} {"id": 634953, "source": "method", "repo": "willowtreeapps/hyperion-android", "text": "public View createPluginView(@NonNull LayoutInflater layoutInflater, @NonNull ViewGroup parent) { final View view = layoutInflater.inflate(R.layout.hp_item_plugin, parent, false); view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final Activity activity = getExtension().getActivity(); confirmRebirth(activity); } }); return view; }", "tokens": 84} {"id": 635017, "source": "method", "repo": "willowtreeapps/hyperion-android", "text": "private static void stopScreenSharing() { if (virtualDisplay == null) { return; } virtualDisplay.release(); //mMediaRecorder.release(); //If used: mMediaRecorder object cannot // be reused again destroyMediaProjection(); }", "tokens": 50} {"id": 635037, "source": "method", "repo": "willowtreeapps/hyperion-android", "text": "private void bind(final File file) { this.file = file; nameText.setText(file.getName()); Date lastModDate = new Date(file.lastModified()); dateText.setText(lastModDate.toString()); exec.execute(new Runnable() { @Override public void run() { final Bitmap thumb = ThumbnailUtils.createVideoThumbnail(file.getPath(), MediaStore.Images.Thumbnails.MINI_KIND); main.post(new Runnable() { @Override public void run() { thumbnail.setAlpha(0.0f); thumbnail.setImageBitmap(thumb); thumbnail.animate().alpha(1.0f).start(); } }); } }); }", "tokens": 143} {"id": 635096, "source": "method", "repo": "willowtreeapps/hyperion-android", "text": "public Builder withFirstName(String val) { firstName = val; return this; }", "tokens": 19} {"id": 635110, "source": "method", "repo": "willowtreeapps/hyperion-android", "text": "public void onBindViewHolder(@NonNull PreferenceViewHolder holder, int position) { String key = getKey(position); Object preferenceValue = getSharedPreferencesMap().get(key); holder.bind(key, preferenceValue); }", "tokens": 46} {"id": 635599, "source": "method", "repo": "wisp-forest/owo-lib", "text": "public boolean poll() { if (this.triggered.getAndSet(false)) { this.lastTriggerTimestamp = Instant.now(); } if (this.lastTriggerTimestamp != null && ChronoUnit.MILLIS.between(this.lastTriggerTimestamp, Instant.now()) > DEBOUNCE_TIME) { this.lastTriggerTimestamp = null; return true; } return false; }", "tokens": 81} {"id": 635676, "source": "method", "repo": "wisp-forest/owo-lib", "text": "protected void setState(Runnable action) { action.run(); this.recompute(); }", "tokens": 19} {"id": 635734, "source": "method", "repo": "wisp-forest/owo-lib", "text": "protected double measureIntrinsicWidth(double height) { return Double.isFinite(height) ? height * this.widget.ratio : this.child.getIntrinsicWidth(height); }", "tokens": 38} {"id": 635821, "source": "method", "repo": "wisp-forest/owo-lib", "text": "protected double[] measureMainAxis(double crossAxisCellSize) { var crossAxisCells = this.widget.crossAxisCells; var mainAxisCells = Mth.ceil(this.children.size() / (double) this.widget.crossAxisCells); var measureFunction = this.widget.mainAxis.>>chooseCompute( () -> child -> child.getIntrinsicWidth(crossAxisCellSize), () -> child -> child.getIntrinsicHeight(crossAxisCellSize) ); var intrinsics = this.children.stream().mapToDouble(measureFunction).toArray(); var sizes = new double[mainAxisCells]; for (var cell = 0; cell < mainAxisCells; cell++) { var cellSize = 0d; var firstChild = cell * crossAxisCells; var lastChild = firstChild + (crossAxisCells - 1); for (var childIdx = firstChild; childIdx <= lastChild; childIdx++) { if (childIdx >= this.children.size()) break; cellSize = Math.max(cellSize, intrinsics[childIdx]); } sizes[cell] = cellSize; } return sizes; }", "tokens": 253} {"id": 636071, "source": "method", "repo": "wisp-forest/owo-lib", "text": "public Item.Properties stackGenerator(BiConsumer generator) { this.owo$stackGenerator = generator; return (Item.Properties)(Object) this; }", "tokens": 41} {"id": 636321, "source": "method", "repo": "wisp-forest/owo-lib", "text": "public void parseProperties(UIModel model, Element element, Map children) { super.parseProperties(model, element, children); final var components = UIParsing .get(children, \"children\", e -> UIParsing.allChildrenOfType(e, Node.ELEMENT_NODE)) .orElse(Collections.emptyList()); for (var child : components) { this.child(model.parseComponent(UIComponent.class, child)); } }", "tokens": 102} {"id": 636347, "source": "method", "repo": "wisp-forest/owo-lib", "text": "/** @apiNote When overriding update and calling {@code ParentComponent.super.update()}, ensure that {@link UIComponent#update(float, int, int)} is called as well, through some means */ default void update(float delta, int mouseX, int mouseY) { this.padding().update(delta); for (int i = 0; i < this.children().size(); i++) { this.children().get(i).update(delta, mouseX, mouseY); } }", "tokens": 105} {"id": 636391, "source": "method", "repo": "wisp-forest/owo-lib", "text": "/** Register a factory used to create components from XML elements. Most factories will only consider the tag name of the element, but more context can be extracted from the passed element @param componentId The identifier under which to register the component, which (separated by a period instead of a colon) is used as the tag name for which this factory gets invoked @param factory The factory to register */ public static void registerFactory(Identifier componentId, Function factory) { registerFactory(componentId.getNamespace() + \".\" + componentId.getPath(), factory); }", "tokens": 118} {"id": 636487, "source": "method", "repo": "wisp-forest/owo-lib", "text": "public Widget build(BuildContext context) { return new Overlay( new Builder(innerContext -> { return new Sized( Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, new MouseArea( widget -> widget .clickCallback((x, y, button, modifiers) -> { this.spawn(innerContext, x, y); return true; }) .dragCallback((x, y, dx, dy) -> { this.spawn(innerContext, x, y); }), new Center( new Panel( Panel.VANILLA_LIGHT, new Padding( Insets.all(10), new Sized( 120, null, new ComboBox<>( test -> Component.literal(test.name().toLowerCase(Locale.ROOT).replace('_', ' ')), Arrays.asList(Tests.values()), this.selectedOption, option -> this.setState(() -> this.selectedOption = option) ) ) ) ) ) ) ); }) ); }", "tokens": 223} {"id": 636553, "source": "method", "repo": "wkgcass/vproxy", "text": "public void warn(Object message, Throwable t) { Logger.warn(logType(message), prefix() + msg(message), t); }", "tokens": 31} {"id": 636797, "source": "method", "repo": "wkgcass/vproxy", "text": "public String valueAsString() { return value; }", "tokens": 11} {"id": 636798, "source": "method", "repo": "wkgcass/vproxy", "text": "public BinaryHttpContext init(ContextInitParams params) { return new BinaryHttpContext(params.clientAddress()); }", "tokens": 23} {"id": 636883, "source": "method", "repo": "wkgcass/vproxy", "text": "public int wndsize(int sndWnd, int rcvWnd) { if (sndWnd > 0) { this.sndWnd = sndWnd; } if (rcvWnd > 0) { this.rcvWnd = rcvWnd; } return 0; }", "tokens": 73} {"id": 636970, "source": "method", "repo": "wkgcass/vproxy", "text": "public ReusableListIterator rewind() { return rewind(0); }", "tokens": 20} {"id": 636983, "source": "method", "repo": "wkgcass/vproxy", "text": "private ToStringHelper(int indent) { this.indent = indent; }", "tokens": 17} {"id": 637173, "source": "method", "repo": "wkgcass/vproxy", "text": "public void release() { if (released) { return; } if (!referencedSockets.isEmpty()) { throw new IllegalStateException(\"the umem is referenced by \" + referencedSockets.size() + \" xsks\"); } synchronized (this) { if (released) { return; } released = true; } umem.close(true); }", "tokens": 76} {"id": 637241, "source": "method", "repo": "wkgcass/vproxy", "text": "public void init(IfaceInitParams params) throws Exception { super.init(params); var callback = initCallback; if (callback == null) { callback = new Callback(); } else { callback = new CallbackDelegate(new Callback(), callback); } fubuki = new Fubuki(new Fubuki.Data(getIndex(), nodeName, serverIPPort, key, localAddr, ipsJson, callback)); sw = params.sw; bondLoop = params.loop; }", "tokens": 104} {"id": 637612, "source": "method", "repo": "woaiys3/deepseek-harness-android-app", "text": "public void onDestroy() { running = false; instance = null; stopPreviewPolling(); hidePreviewWindow(); if (serverSocket != null) { try { serverSocket.close(); } catch (Throwable ignored) {} } super.onDestroy(); }", "tokens": 49} {"id": 637810, "source": "method", "repo": "woodser/monero-java", "text": "/** Set the connection's authentication status. @param isAuthenticated sets if the connection is authenticated */ public void setAuthenticated(Boolean isAuthenticated) { this.isAuthenticated = isAuthenticated; }", "tokens": 39} {"id": 637889, "source": "method", "repo": "woodser/monero-java", "text": "public int setUploadLimit(int limit) { if (limit == -1) return resetUploadLimit(); if (limit <= 0) throw new MoneroError(\"Upload limit must be an integer greater than 0\"); return setBandwidthLimits(0, limit)[1]; }", "tokens": 59} {"id": 638365, "source": "method", "repo": "woodser/monero-java", "text": "public MoneroTxSet setTxs(MoneroTxWallet... txs) { this.txs = GenUtils.arrayToList(txs); return this; }", "tokens": 34} {"id": 638399, "source": "method", "repo": "woodser/monero-java", "text": "public String getServerUri() { return server == null ? null : server.getUri(); }", "tokens": 19} {"id": 638470, "source": "method", "repo": "woodser/monero-java", "text": "public void testSetAccountLabel() { // create account if (wallet.getAccounts().size() < 2) wallet.createAccount(); // set account label String label = GenUtils.getUUID(); wallet.setAccountLabel(1, label); assertEquals(label, wallet.getSubaddress(1, 0).getLabel()); }", "tokens": 70} {"id": 638571, "source": "method", "repo": "woodser/monero-java", "text": "public void testMining() { super.testMining(); }", "tokens": 13} {"id": 638690, "source": "method", "repo": "woowacourse-teams/2022-dallog", "text": "public void deleteAll() { TOKEN_REPOSITORY.clear(); }", "tokens": 15} {"id": 638695, "source": "method", "repo": "woowacourse-teams/2022-dallog", "text": "public void change(final String refreshToken) { if (!Objects.isNull(refreshToken)) { this.refreshToken = refreshToken; } }", "tokens": 27} {"id": 639018, "source": "method", "repo": "woowacourse-teams/2022-dallog", "text": "public IntegrationScheduleResponse(final String id, final String title, final LocalDateTime startDateTime, final LocalDateTime endDateTime, final String memo, final Long categoryId, final String colorCode, final String categoryType) { this.id = id; this.title = title; this.startDateTime = startDateTime; this.endDateTime = endDateTime; this.memo = memo; this.categoryId = categoryId; this.colorCode = colorCode; this.categoryType = categoryType; }", "tokens": 103} {"id": 639117, "source": "method", "repo": "woowacourse-teams/2023-hang-log", "text": "public ResponseEntity> getCategoriesDetail( @AdminAuth final Accessor accessor ) { final List categoryDetailResponses = categoryService.getAllCategoriesDetail(); return ResponseEntity.ok(categoryDetailResponses); }", "tokens": 54} {"id": 639265, "source": "method", "repo": "woowacourse-teams/2023-hang-log", "text": "public void addQueryTime(final Long queryTime) { this.queryTime += queryTime; }", "tokens": 22} {"id": 639370, "source": "method", "repo": "woowacourse-teams/2023-hang-log", "text": "public ResponseEntity getMyInfo(@Auth final Accessor accessor) { final MyPageResponse myPageResponse = memberService.getMyPageInfo(accessor.getMemberId()); return ResponseEntity.ok().body(myPageResponse); }", "tokens": 52} {"id": 639420, "source": "method", "repo": "woowacourse-teams/2023-hang-log", "text": "public static PublishedStatusType mappingType(final boolean isPublished) { if (isPublished) { return PUBLISHED; } return UNPUBLISHED; }", "tokens": 33} {"id": 639798, "source": "method", "repo": "woowacourse/prolog", "text": "public Map parse(final String url) { try { final Document document = Jsoup.connect(url).get(); return OgType.parseMap(document); } catch (Exception e) { throw new BadRequestException(BadRequestCode.ARTICLE_INVALID_URL_EXCEPTION); } }", "tokens": 69} {"id": 639942, "source": "method", "repo": "woowacourse/prolog", "text": "public ResponseEntity create(@AuthMemberPrincipal LoginMember member, @RequestBody LevelLogRequest levelLogRequest) { final LevelLogResponse response = levelLogService.insertLevellogs( member.getId(), levelLogRequest); return ResponseEntity.created(URI.create(\"/levellogs/\" + response.getId())).build(); }", "tokens": 67} {"id": 640173, "source": "method", "repo": "woowacourse/prolog", "text": "public List findTagsIncludedInStudylogs() { return studylogTagService.findAll().stream() .map(StudylogTag::getTag) .distinct() .map(TagResponse::of) .sorted(Comparator.comparing(TagResponse::getName)) .collect(toList()); }", "tokens": 66} {"id": 640221, "source": "method", "repo": "woowacourse/prolog", "text": "public static String makeKeywordsQueryString(List keywords) { if (Objects.isNull(keywords) || keywords.isEmpty()) { return WILD_CARD; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < keywords.size(); i++) { final String value = keywords.get(i); if (value.contains(EMPTY)) { sb.append(\"\\\"*\").append(value).append(\"*\\\"\"); } else { sb.append(WILD_CARD).append(value).append(WILD_CARD); } if (i != keywords.size() - 1) { sb.append(OR); } } return sb.toString(); }", "tokens": 145} {"id": 640223, "source": "method", "repo": "woowacourse/prolog", "text": "public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Like like = (Like) o; return Objects.equals(getMemberId(), like.getMemberId()); }", "tokens": 60} {"id": 640412, "source": "method", "repo": "woowacourse/prolog", "text": "void registerMembersByGroupId() { // given final SessionGroupMemberRequest request = new SessionGroupMemberRequest(1L); // when sessionMemberService.registerMembersByGroupId(1L, request); // then verify(sessionMemberRepository, atMostOnce()).findAllBySessionId(1L); verify(departmentMemberService, atMostOnce()).findDepartmentMemberByDepartmentId(request.getGroupId()); verify(sessionMemberRepository, atMostOnce()).saveAll(null); }", "tokens": 94} {"id": 640458, "source": "method", "repo": "woowacourse/prolog", "text": "void findByMemberTest() { //given //when Page expectedResult = studylogRepository .findByMember(member1, PageRequest.of(0, 10)); //then assertThat(expectedResult.getContent()).containsExactlyInAnyOrder(studylog1, studylog2); }", "tokens": 57} {"id": 640707, "source": "method", "repo": "wpilibsuite/gradlerio", "text": "public WPIJavaVendorDepsExtension getVendor() { return vendor; }", "tokens": 16} {"id": 640748, "source": "method", "repo": "wpilibsuite/gradlerio", "text": "public HalSimExtension addWebsocketsClient() { return addDep(\"Sim Websockets Client\", \"org.wpilib.halsim\", \"halsim_ws_client\"); }", "tokens": 39} {"id": 640825, "source": "method", "repo": "wrandelshofer/fastdoubleparser", "text": "public static int readIntBE(byte[] a, int offset) { return (int) readIntBE.get(a, offset); }", "tokens": 31} {"id": 641066, "source": "method", "repo": "wrandelshofer/fastdoubleparser", "text": "public boolean containsKey(char ch) { return Character.getType(ch) == Character.FORMAT; }", "tokens": 23} {"id": 641233, "source": "method", "repo": "wrandelshofer/fastdoubleparser", "text": "public double m() { return JavaDoubleParser.parseDouble(byteArray); }", "tokens": 15} {"id": 641432, "source": "method", "repo": "xdagger/xdagj", "text": "/** Unlocks this wallet */ public boolean unlock(String password) { if (password == null) { throw new IllegalArgumentException(\"Password can not be null\"); } try { byte[] key; byte[] salt; if (exists()) { SimpleDecoder dec = new SimpleDecoder(FileUtils.readFileToByteArray(file)); int version = dec.readInt(); // version Set newAccounts; switch (version) { // only version 4 case 4 -> { salt = dec.readBytes(); key = BCrypt.generate(password.getBytes(UTF_8), salt, BCRYPT_COST); try { newAccounts = readAccounts(key, dec, true, version); readHdSeed(key, dec); } catch (Exception e) { log.warn(\"Failed to read HD mnemonic phrase\"); return false; } } default -> throw new RuntimeException(\"Unknown wallet version.\"); } synchronized (accounts) { accounts.clear(); for (ECKeyPair account : newAccounts) { Bytes b = Bytes.wrap(toBytesAddress(account)); accounts.put(b, account); } } } this.password = password; return true; } catch (Exception e) { log.error(\"Failed to open wallet\", e); } return false; }", "tokens": 266} {"id": 641442, "source": "method", "repo": "xdagger/xdagj", "text": "private void requireUnlocked() { if (!isUnlocked()) { throw new RuntimeException(\"Wallet is Locked!\"); } }", "tokens": 25} {"id": 641454, "source": "method", "repo": "xdagger/xdagj", "text": "public Commands(Kernel kernel) { this.kernel = kernel; }", "tokens": 16} {"id": 641472, "source": "method", "repo": "xdagger/xdagj", "text": "/** Get maximum transferable balance */ public String balanceMaxXfer() { return getBalanceMaxXfer(kernel); }", "tokens": 26} {"id": 641639, "source": "method", "repo": "xdagger/xdagj", "text": "/** Get the number of transactions executed in the main block package @param refHashLow The hash of the transaction packaged in the main block @param mHashLow The hash of the main block @return Number of transactions executed */ public int txNumber(Bytes32 refHashLow, Bytes32 mHashLow) { int sum = 0; if (getBlockByHash(refHashLow, true) != null) { Block block = getBlockByHash(refHashLow, true); if (!isTxBlock(block) && (block.getInfo().flags & BI_MAIN_CHAIN) == 0) { for (Address link : block.getLinks()) { if (equalBytes(block.getInfo().getRef(), mHashLow.toArray())) { sum += txNumber(link.getAddress(), block.getHashLow()); } } return sum; } if ((block.getInfo().flags & BI_APPLIED) != 0 && (block.getInfo().getRef() != null && equalBytes(block.getInfo().getRef(), mHashLow.toArray()))) { return outPutNum(block) == -1 ? 0 : outPutNum(block); } } return 0; }", "tokens": 240} {"id": 641876, "source": "method", "repo": "xdagger/xdagj", "text": "/** Get number of IPs in the list */ public int getSize() { return ipList.size(); }", "tokens": 24} {"id": 641928, "source": "method", "repo": "xdagger/xdagj", "text": "public byte toByte() { return (byte) code; }", "tokens": 14} {"id": 642188, "source": "method", "repo": "xdagger/xdagj", "text": "public void testPasswordOption() throws ParseException { Launcher launcher = new Launcher(); CommandLine cmd = launcher.parseOptions(new String[]{\"--password\", \"123\"}); assertTrue(cmd.hasOption(\"password\")); }", "tokens": 45} {"id": 642196, "source": "method", "repo": "xdagger/xdagj", "text": "public void testState() { Mockito.when(kernel.getXdagState()).thenReturn(XdagState.INIT); String str = commands.state(); assertEquals(\"Pool Initializing....\", str); }", "tokens": 41} {"id": 642377, "source": "method", "repo": "xfl03/jmccc", "text": "/** Get the JSONArray associated with an index. @param index The index must be between 0 and length() - 1. @return A JSONArray value. @throws JSONException If there is no value for the index. or if the value is not a JSONArray */ public JSONArray getJSONArray(int index) throws JSONException { Object object = this.get(index); if (object instanceof JSONArray) { return (JSONArray) object; } throw new JSONException(\"JSONArray[\" + index + \"] is not a JSONArray.\"); }", "tokens": 106} {"id": 642400, "source": "method", "repo": "xfl03/jmccc", "text": "/** Returns a java.util.List containing all of the elements in this array. If an element in the array is a JSONArray or JSONObject it will also be converted.

Warning: This method assumes that the data structure is acyclical. @return a java.util.List containing the elements of this array */ public List toList() { List results = new ArrayList(this.list.size()); for (Object element : this.list) { if (element == null || JSONObject.NULL.equals(element)) { results.add(null); } else if (element instanceof JSONArray) { results.add(((JSONArray) element).toList()); } else if (element instanceof JSONObject) { results.add(((JSONObject) element).toMap()); } else { results.add(element); } } return results; }", "tokens": 185} {"id": 642449, "source": "method", "repo": "xfl03/jmccc", "text": "private List getFormattedMinecraftArguments(List templete) { Map variables = new HashMap<>(); variables.putAll(defaultVariables); variables.putAll(launchOption.commandlineVariables()); List args = new ArrayList<>(); for (String arg : templete) { for (Entry var : variables.entrySet()) { String k = var.getKey(); String v = var.getValue(); if (k != null && v != null) { arg = arg.replace(\"${\" + k + \"}\", v); } } args.add(arg); } return args; }", "tokens": 134} {"id": 642461, "source": "method", "repo": "xfl03/jmccc", "text": "public void setPrintDebugCommandline(boolean printDebugCommandline) { this.printDebugCommandline = printDebugCommandline; }", "tokens": 29} {"id": 642543, "source": "method", "repo": "xfl03/jmccc", "text": "/** Returns the file separator of current platform.

This method refers to System.getProperty(\"file.separator\") @return the file separator of current platform */ public static String getFileSeparator() { return System.getProperty(\"file.separator\"); }", "tokens": 54} {"id": 642730, "source": "method", "repo": "xfl03/jmccc", "text": "private boolean canContinue(Throwable e) { for (Class expected : expectedExceptions) { if (expected.isInstance(e)) { return true; } } return false; }", "tokens": 42} {"id": 643021, "source": "method", "repo": "xfl03/jmccc", "text": "public Set getLibraries() { return libraries; }", "tokens": 14} {"id": 643080, "source": "method", "repo": "xfl03/jmccc", "text": "public MojangAPIBuilder apiProvider(MojangAPIProvider apiProvider) { this.apiProvider = apiProvider; return this; }", "tokens": 27} {"id": 643413, "source": "method", "repo": "xmlet/htmlflow", "text": "public HtmlVisitorAsync clone(boolean isIndented) { return new HtmlViewVisitorAsyncHot( out, isIndented, continuationSupplier ); }", "tokens": 31} {"id": 643452, "source": "method", "repo": "xmlet/htmlflow", "text": "public final void visitParentImg(Img element) { visitParentOnVoidElements(); }", "tokens": 27} {"id": 643488, "source": "method", "repo": "xmlet/htmlflow", "text": "public final char[] escape(char c) { if (c < replacementLength) { char[] chars = replacements[c]; if (chars != null) { return chars; } } if (c >= safeMin && c <= safeMax) { return null; } return escapeUnsafeChar(c); }", "tokens": 64} {"id": 643547, "source": "method", "repo": "xmlet/htmlflow", "text": "public void testWrong__use() { HtmlFlow.doc(System.out).__(); }", "tokens": 23} {"id": 643552, "source": "method", "repo": "xmlet/htmlflow", "text": "void should_use_cached_visitor_when_caching_enabled() { HtmlViewAsync view = HtmlFlow.viewAsync(v -> { v.html() .body() .h1().text(\"Hello, Cached!\").__() .__() .__(); }); assertInstanceOf(HtmlViewAsync.class, view, \"Should be HtmlViewAsync instance\"); assertEquals(\"HtmlViewAsync\", view.getName()); Object visitor = view.getVisitor(); assertInstanceOf(HtmlViewVisitorAsync.class, visitor, \"Should use HtmlViewVisitorAsync\"); }", "tokens": 118} {"id": 643562, "source": "method", "repo": "xmlet/htmlflow", "text": "public void viewWithNoIndent() { HtmlView view = HtmlFlow.view(page -> page .div() .textarea() .text(\"Sample text\\nfoo\\nbar\") .__() .script() .raw(\"// some comment\" + lineSeparator() + \"console.log('Hello world');\") .__() // script .__()); // div String actual = view.setIndented(false).render(); assertEquals(EXPECTED, actual); }", "tokens": 97} {"id": 643634, "source": "method", "repo": "xmlet/htmlflow", "text": "public TaskDelayed(int id, String title, String description, Priority priority) { super(id, title, description, priority); }", "tokens": 29} {"id": 643637, "source": "method", "repo": "xmlet/htmlflow", "text": "public Priority getPriority() { sleep(10); return super.getPriority(); }", "tokens": 18} {"id": 643654, "source": "method", "repo": "xmlet/htmlflow", "text": "/** This unit test does not contain any assertion because it is only a sample to use in README.md. */ public void testSample05() { Flux tasks = Flux.fromStream(Stream.of( new Task(3, \"ISEL MPD project\", \"A Java library for serializing objects in HTML.\", Priority.HIGH), new Task(4, \"Special dinner\", \"Moonlight dinner!\", Priority.NORMAL), new Task(5, \"US Open Final 2018\", \"Juan Martin del Potro VS Novak Djokovic\", Priority.HIGH) )) .delayElements(Duration.ofMillis(1000)); tasksTableViewAsync.writeAsync(System.out, tasks).join(); }", "tokens": 171} {"id": 643656, "source": "method", "repo": "xmlet/htmlflow", "text": "static void tasksTableTemplateAsync(HtmlPage page) { page .html() .head() .title() .text(\"Tasks Table\") .__() .__() .body() .table().attrClass(\"table\") .tr() .th().text(\"Title\").__() .th().text(\"Description\").__() .th().text(\"Priority\").__() .__() .tbody() .>await((tbody, tasks, onCompletion) -> tasks .doOnNext(task -> tbody .tr() .td().text(task.getTitle()).__() .td().text(task.getDescription()).__() .td().text(task.getPriority().toString()).__() .__() // tr ) .doOnComplete(onCompletion::finish) .subscribe() ) .__() // tbody .__() // table .__() // body .__(); // html }", "tokens": 201} {"id": 643664, "source": "method", "repo": "xmlet/htmlflow", "text": "/** Sample showcase of loop with HtmlView */ public void playlistView() { HtmlView> playlistView = HtmlFlow.view(view -> view .html() .body() .table() .tr() .th().text(\"Artist\").__() .th().text(\"Track\").__() .__() .>dynamic((table, tracks) -> tracks.forEach( trk -> table .tr() .td().text(trk.getArtist()).__() .td().text(trk.getName()).__() .__() )) .__() .__() .__() ); List tracks = asList(new Track(\"David Bowie\", \"Space Oddity\", LocalDate.of(2016, 1, 10)), new Track(\"U2\", \"Bad\"), new Track(\"Queen\", \"Under Pressure\")); final StringBuilder actual = new StringBuilder(); playlistDoc(actual, tracks); assertEquals(actual.toString(), playlistView.render(tracks)); }", "tokens": 221} {"id": 643747, "source": "method", "repo": "xnnyygn/xraft", "text": "public String toString() { return \"NormalLogDir{\" + \"dir=\" + dir + '}'; }", "tokens": 21} {"id": 643801, "source": "method", "repo": "xnnyygn/xraft", "text": "private void checkEmpty() { if (isEmpty()) { throw new IllegalStateException(\"no entry index\"); } }", "tokens": 23} {"id": 643821, "source": "method", "repo": "xnnyygn/xraft", "text": "public Entry getLastEntry() { if (isEmpty()) { return null; } if (!pendingEntries.isEmpty()) { return pendingEntries.getLast(); } assert !entryIndexFile.isEmpty(); return getEntryInFile(entryIndexFile.getMaxEntryIndex()); }", "tokens": 55} {"id": 643840, "source": "method", "repo": "xnnyygn/xraft", "text": "public int getLastIncludedTerm() { return 0; }", "tokens": 13} {"id": 643997, "source": "method", "repo": "xnnyygn/xraft", "text": "public void replicateLog(NodeEndpoint endpoint) { context.taskExecutor().submit( () -> doReplicateLog(endpoint, context.log().getNextIndex()), LOGGING_FUTURE_CALLBACK ); }", "tokens": 43} {"id": 644043, "source": "method", "repo": "xnnyygn/xraft", "text": "public void setVotesCount(int votesCount) { this.votesCount = votesCount; }", "tokens": 25} {"id": 644072, "source": "method", "repo": "xnnyygn/xraft", "text": "public GroupConfigChangeTaskResult getResult() throws InterruptedException { return result; }", "tokens": 16} {"id": 644129, "source": "method", "repo": "xnnyygn/xraft", "text": "public GroupConfigChangeStatus getStatus() { return status; }", "tokens": 14} {"id": 644138, "source": "method", "repo": "xnnyygn/xraft", "text": "public AppendEntriesRpc getRpc() { return rpc; }", "tokens": 12} {"id": 644198, "source": "method", "repo": "xnnyygn/xraft", "text": "public void close() { logger.debug(\"close connector\"); inboundChannelGroup.closeAll(); outboundChannelGroup.closeAll(); bossNioEventLoopGroup.shutdownGracefully(); if (!workerGroupShared) { workerNioEventLoopGroup.shutdownGracefully(); } }", "tokens": 50} {"id": 644233, "source": "method", "repo": "xnnyygn/xraft", "text": "public void seek(long position) throws IOException { checkPosition(position); this.position = (int) position; }", "tokens": 26} {"id": 644281, "source": "method", "repo": "xnnyygn/xraft", "text": "public void testCreateAppendEntriesRpcStartFromOne() { MemoryLog log = new MemoryLog(); log.appendEntry(1); // 1 log.appendEntry(1); // 2 AppendEntriesRpc rpc = log.createAppendEntriesRpc( 1, new NodeId(\"A\"), 1, Log.ALL_ENTRIES ); Assert.assertEquals(1, rpc.getTerm()); Assert.assertEquals(0, rpc.getPrevLogIndex()); Assert.assertEquals(0, rpc.getPrevLogTerm()); Assert.assertEquals(2, rpc.getEntries().size()); Assert.assertEquals(1, rpc.getEntries().get(0).getIndex()); }", "tokens": 133} {"id": 644317, "source": "method", "repo": "xnnyygn/xraft", "text": "public void testGetResultNodeEndpoints() { AddNodeEntry entry = new AddNodeEntry(1, 1, Collections.emptySet(), new NodeEndpoint(\"A\", \"localhost\", 2333)); Set nodeEndpoints = entry.getResultNodeEndpoints(); Assert.assertEquals(1, nodeEndpoints.size()); Assert.assertEquals(NodeId.of(\"A\"), nodeEndpoints.iterator().next().getId()); }", "tokens": 87} {"id": 644364, "source": "method", "repo": "xnnyygn/xraft", "text": "public void testGetEntryMeta() { MemoryEntrySequence sequence = new MemoryEntrySequence(2); Assert.assertNull(sequence.getEntry(2)); sequence.append(new NoOpEntry(2, 1)); EntryMeta meta = sequence.getEntryMeta(2); Assert.assertNotNull(meta); Assert.assertEquals(2, meta.getIndex()); Assert.assertEquals(1, meta.getTerm()); }", "tokens": 84} {"id": 644497, "source": "method", "repo": "xnnyygn/xraft", "text": "public void set(String key, byte[] value) { serverRouter.send(new SetCommand(key, value)); }", "tokens": 27} {"id": 644593, "source": "method", "repo": "xtuhcy/gecco", "text": "public GeccoEngine proxysLoader(Proxys proxysLoader) { this.proxysLoader = proxysLoader; return this; }", "tokens": 30} {"id": 644654, "source": "method", "repo": "xtuhcy/gecco", "text": "public AtomicLong getFailureCount() { return failureCount; }", "tokens": 13} {"id": 644659, "source": "method", "repo": "xtuhcy/gecco", "text": "public String toString() { return \"Proxy [httpHost=\" + httpHost + \", successCount=\" + successCount + \", failureCount=\" + failureCount + \"]\"; }", "tokens": 37} {"id": 644804, "source": "method", "repo": "xtuhcy/gecco", "text": "public void close() { if(raw != null) { try{ raw.close(); } catch(Exception ex) { raw = null; } } }", "tokens": 33} {"id": 644818, "source": "method", "repo": "xtuhcy/gecco", "text": "public static void into(HttpRequest request) { SpiderThreadLocal.get().getEngine().getScheduler().into(request); }", "tokens": 26} {"id": 644860, "source": "method", "repo": "xtuhcy/gecco", "text": "public static Object getValue(Class type, Object value) throws Exception { TypeHandle th = TYPE_HANDLERS.get(type); if (th != null && value != null) { return th.getValue(value); } return value; }", "tokens": 53} {"id": 644881, "source": "method", "repo": "xtuhcy/gecco", "text": "public MonitorRenderFactory(Reflections reflections) { super(reflections); }", "tokens": 19} {"id": 644933, "source": "method", "repo": "xtuhcy/gecco", "text": "public JsonRender() { super(); this.jsonFieldRender = new JsonFieldRender(); }", "tokens": 20} {"id": 644934, "source": "method", "repo": "xtuhcy/gecco", "text": "public void fieldRender(HttpRequest request, HttpResponse response, BeanMap beanMap, SpiderBean bean) { jsonFieldRender.render(request, response, beanMap, bean); }", "tokens": 38} {"id": 644935, "source": "method", "repo": "xtuhcy/gecco", "text": "public static String download(String parentPath, String fileName, InputStream in) { Closer closer = Closer.create(); try { File imageDir = new File(parentPath); if(!imageDir.exists()) { imageDir.mkdirs(); } File imageFile = new File(imageDir, fileName); Files.write(ByteStreams.toByteArray(in), imageFile); return imageFile.getAbsolutePath(); } catch(Exception ex) { ex.printStackTrace(); return null; } finally { try { closer.close(); } catch (IOException e) { closer = null; } } }", "tokens": 121} {"id": 644988, "source": "method", "repo": "xtuhcy/gecco", "text": "public void setDetails(List details) { this.details = details; }", "tokens": 21} {"id": 645007, "source": "method", "repo": "Xujiayao/Discord-MC-Chat", "text": "/** Requests keeping the log tailer alive for the next client shutdown. */ public static void preserveLogTailerOnNextShutdown() { PRESERVE_LOG_TAILER_ON_NEXT_SHUTDOWN.set(true); }", "tokens": 52} {"id": 645129, "source": "method", "repo": "Xujiayao/Discord-MC-Chat", "text": "public void execute(CommandSender sender, String... args) { if (sender instanceof TerminalManager.TerminalCommandSender) { sender.reply(I18nManager.getDmccTranslation(\"commands.log.terminal_not_supported\")); return; } String fileName = args[0]; byte[] fileData; try { fileData = LogFileUtils.readLogFile(fileName); } catch (RuntimeException e) { // A rejected file name (e.g. one pointing outside the logs directory) may be signalled by an // exception instead of null; both mean \"no such log file\" to the sender. fileData = null; } if (fileData == null) { sender.reply(I18nManager.getDmccTranslation(\"commands.log.file_not_found\", fileName)); return; } // Strip .gz extension for the output file name if it was decompressed String outputName = fileName.endsWith(\".gz\") ? fileName.substring(0, fileName.length() - 3) : fileName; sender.replyWithFile( I18nManager.getDmccTranslation(\"commands.log.success\", fileName), fileData, outputName ); }", "tokens": 240} {"id": 645449, "source": "method", "repo": "Xujiayao/Discord-MC-Chat", "text": "/** Player names are shared by every member linked to the same account, and the newest link decides the name when a Discord user is allowed to link more than one account. */ private static String latestPlayerName(List entries) { LinkedAccountManager.LinkEntry newest = entries.getFirst(); for (LinkedAccountManager.LinkEntry entry : entries) { if (entry.linkedAt() > newest.linkedAt()) { newest = entry; } } return MojangUtils.resolvePlayerName(newest.minecraftUuid(), newest.offlinePlayerName()); }", "tokens": 117} {"id": 645538, "source": "method", "repo": "Xujiayao/Discord-MC-Chat", "text": "private static List buildEmbedSegments(String title, String url, boolean spoiler) { List segments = new ArrayList<>(); String color = url == null ? \"yellow\" : URL_COLOR; TextSegment prefix = new TextSegment(EMBED_LABEL_PREFIX, false, color); TextSegment titleSegment = new TextSegment(title, false, color); TextSegment suffix = new TextSegment(LABEL_SUFFIX, false, color); if (url != null) { applyLinkStyle(prefix, url); applyLinkStyle(titleSegment, url); applyLinkStyle(suffix, url); } if (spoiler) { titleSegment.obfuscated = true; titleSegment.hoverText = title; } segments.add(prefix); segments.add(titleSegment); segments.add(suffix); return segments; }", "tokens": 173} {"id": 645628, "source": "method", "repo": "Xujiayao/Discord-MC-Chat", "text": "private static void notifyMinecraft(String mode, String message) { MinecraftMessageParser.ParsedMessage parsedMessage = MinecraftMessageParser.parseSystemMessage(message, true); List segments = parsedMessage.minecraftSegments(); if (segments == null || segments.isEmpty()) { return; } MinecraftRelayPacket packet = new MinecraftRelayPacket(segments); if (\"single_server\".equals(mode)) { NetworkManager.sendPacketToClient(packet, \"Internal\"); } else if (\"standalone\".equals(mode)) { NetworkManager.broadcastToClients(packet); } }", "tokens": 123} {"id": 645710, "source": "method", "repo": "Xujiayao/Discord-MC-Chat", "text": "private static Component buildComponentFromSegments(List segments) { if (segments == null || segments.isEmpty()) { return Component.empty(); } MutableComponent root = Component.empty(); for (TextSegment seg : segments) { root.append(buildComponentPart(seg)); } return root; }", "tokens": 64} {"id": 646197, "source": "method", "repo": "xvik/dropwizard-guicey", "text": "/** When guicey extension starts in beforeAll - it can't see instance fields (by default) and so can't check if use provide any value. On beforeEach we have to validate that value was not provided, because it's too late - guice context was already created. @param field field to check @param testInstances test instances (might be several in case of nested tests) */ protected void failIfInstanceFieldInitialized(final AnnotatedField field, final TestInstances testInstances) { final Object value = field.getValue(testInstances); if (value != null && !field.isCustomDataSet(FIELD_INJECTED)) { throw new IllegalStateException(getDeclarationErrorPrefix(field) + \"field value can't be used because \" + \"guice context starts in beforeAll phase. Either make field static or remove value (\" + \"guice will create instance with guice injector)\"); } }", "tokens": 197} {"id": 646334, "source": "method", "repo": "xvik/dropwizard-guicey", "text": "/** Shortcut for entity parameter source access. @return entity parameter declaration source (method argument or bean field) */ public ParameterSource getEntityParamSource() { final List res = selectParameterSources(source -> source .getType() == Parameter.Source.ENTITY); return res.isEmpty() ? null : res.get(0); }", "tokens": 74} {"id": 646500, "source": "method", "repo": "xvik/dropwizard-guicey", "text": "void setUp() { Preconditions.checkNotNull(stub); Preconditions.checkNotNull(stub2); }", "tokens": 19} {"id": 646533, "source": "method", "repo": "xvik/dropwizard-guicey", "text": "void testDummyObjects() { test(boolean.class); test(int.class); test(char.class); test(double.class); test(float.class); test(byte.class); test(short.class); test(long.class); test(boolean[].class); test(int[].class); test(char[].class); test(double[].class); test(float[].class); test(byte[].class); test(short[].class); test(long[].class); test(String.class); test(String[].class); test(Boolean.class); test(Integer.class); test(Character.class); test(Double.class); test(Float.class); test(Byte.class); test(Short.class); test(Long.class); test(Boolean[].class); test(Integer[].class); test(Character[].class); test(Double[].class); test(Float[].class); test(Byte[].class); test(Short[].class); test(Long[].class); test(Object.class); test(Object[].class); test(Obj.class); test(Obj[].class); test(Iface.class); test(Iface[].class); test(Abstr.class); test(Abstr[].class); test(List.class); test(Set.class); test(Collection.class); test(BigDecimal.class); }", "tokens": 307} {"id": 646594, "source": "method", "repo": "xvik/dropwizard-guicey", "text": "/** @param readOnly true for read only transaction @return config itself for chained calls */ public TxConfig readOnly(final boolean readOnly) { this.readOnly = readOnly; return this; }", "tokens": 42} {"id": 646679, "source": "method", "repo": "xxdark/ssvm", "text": "public InstanceClass java_lang_Error() { return symbols.java_lang_Error(); }", "tokens": 21} {"id": 646946, "source": "method", "repo": "xxdark/ssvm", "text": "private static void handleExceptionCaught(ExecutionContext ctx, VMException ex) { Stack stack = ctx.getStack(); stack.clear(); InstanceValue oop = ex.getOop(); InstanceClass exceptionType = oop.getJavaClass(); List tryCatchBlocks = ctx.getMethod().getTryCatchBlocks(); int index = ctx.getInsnPosition() - 1; boolean shouldRepeat; search: do { shouldRepeat = false; for (int i = 0, j = tryCatchBlocks.size(); i < j; i++) { VMTryCatchBlock block = tryCatchBlocks.get(i); if (index < AsmUtil.getIndex(block.getStart()) || index > AsmUtil.getIndex(block.getEnd())) { continue; } InstanceClass candidate = block.getType(); boolean handle = candidate == null; if (!handle) { try { handle = candidate.isAssignableFrom(exceptionType); } catch (VMException hex) { index = AsmUtil.getIndex(block.getHandler()); shouldRepeat = true; continue search; } } if (handle) { stack.pushReference(oop); ctx.setInsnPosition(AsmUtil.getIndex(block.getHandler())); return; } } } while (shouldRepeat); throw ex; }", "tokens": 264} {"id": 646983, "source": "method", "repo": "xxdark/ssvm", "text": "public Result execute(VarInsnNode insn, ExecutionContext ctx) { ObjectValue ref = ctx.getStack().popReference(); ctx.getLocals().setReference(insn.var, ref); return Result.CONTINUE; }", "tokens": 46} {"id": 647452, "source": "method", "repo": "xxdark/ssvm", "text": "/** @param vm VM to pull references from. @param loader Loader reference to check for class in. @param className Name of class to check. @return VM reference to {@link Class} instance for the class name. */ public static InstanceValue findClassInLoader(VirtualMachine vm, InstanceValue loader, String className) { try { InstanceClass java_lang_classLoader = vm.getSymbols().java_lang_ClassLoader(); JavaMethod method = java_lang_classLoader.getMethod(\"loadClass\", \"(Ljava/lang/String;)Ljava/lang/Class;\"); VMOperations ops = vm.getOperations(); Locals locals = vm.getThreadStorage().newLocals(method); locals.setReference(0, loader); locals.setReference(1, ops.newUtf8(className)); return (InstanceValue) ops.invokeReference(method, locals); } catch (Throwable t) { // Expected, thrown when class not found return null; } }", "tokens": 206} {"id": 647473, "source": "method", "repo": "xxdark/ssvm", "text": "public NullValue(MemoryBlock memory) { this.memory = memory; }", "tokens": 17} {"id": 647494, "source": "method", "repo": "xxdark/ssvm", "text": "/** @return this value as boolean. */ default boolean asBoolean() { return asInt() != 0; }", "tokens": 25} {"id": 647535, "source": "method", "repo": "xxdark/ssvm", "text": "private static void testVariableCapture() { int[] box = {0}; int v = ThreadLocalRandom.current().nextInt(); Runnable r = () -> box[0] = v; r.run(); if (box[0] != v) { throw new IllegalStateException(); } }", "tokens": 60} {"id": 647566, "source": "method", "repo": "xxdark/ssvm", "text": "private static byte[] map(byte[] bytes, String fromName, String toName) { ClassWriter writer = new ClassWriter(0); ClassReader reader = new ClassReader(bytes); reader.accept(new ClassRemapper(writer, new SimpleRemapper(fromName.replace('.', '/'), toName.replace('.', '/'))), 0); return writer.toByteArray(); }", "tokens": 73} {"id": 647586, "source": "method", "repo": "xxdark/ssvm", "text": "public synchronized long getExitCode(long handle) { Process process = processes.get(Handle.threadLocal(handle)); if(process != null) { return process.exitValue(); } return -1; }", "tokens": 43} {"id": 647690, "source": "method", "repo": "yangzongzhuan/ruoyi-cloud", "text": "public static void setUserName(String username) { set(SecurityConstants.DETAILS_USERNAME, username); }", "tokens": 23} {"id": 647711, "source": "method", "repo": "yangzongzhuan/ruoyi-cloud", "text": "public static void main(String[] args) { String html = \"\"; String escape = EscapeUtil.escape(html); // String html = \"ipt>alert(\\\"XSS\\\")ipt>\"; // String html = \"<123\"; // String html = \"123>\"; System.out.println(\"clean: \" + EscapeUtil.clean(html)); System.out.println(\"escape: \" + escape); System.out.println(\"unescape: \" + EscapeUtil.unescape(escape)); }", "tokens": 129} {"id": 647767, "source": "method", "repo": "yangzongzhuan/ruoyi-cloud", "text": "public String getRouteName() { return routeName; }", "tokens": 13} {"id": 647841, "source": "method", "repo": "yash-srivastava/Overdrive-release", "text": "public Response(Parcel parcel) { this.status = parcel.readParcelable(Status.class.getClassLoader()); this.result = (T) parcel.readParcelable(getClass().getClassLoader()); }", "tokens": 40} {"id": 647867, "source": "method", "repo": "yash-srivastava/Overdrive-release", "text": "/** Check whether the worker should currently be running If there are no running automations, then there is no need for a worker to be running Synchronized on {@link #lock} so two concurrent HTTP threads cannot both observe a null worker and start two threads (which would double-fire actions), and so a disable-all cannot orphan a live worker while another thread is mid-start. */ public static void checkWorkerState() { Thread disabledWorker = null; java.util.List replay = java.util.Collections.emptyList(); synchronized (lock) { if (Automations.isDisabled()) { retainLatestStateReconciliationsLocked(); disabledWorker = automationWorker; if (disabledWorker != null) { if (disabledWorker.isAlive()) { CancellationBarrier isolation = new CancellationBarrier( new ShutdownDrainGeneration(), disabledWorker); isolation.finished = true; isolateExecutorLocked(disabledWorker, isolation); inFlightActions.remove(disabledWorker); } if (automationWorker == disabledWorker) { automationWorker = null; } disabledWorker.interrupt(); } if (workerRetryThread != null) { workerRetryThread.interrupt(); } automationQueue.clear(); urgentReadyQueue.clear(); queueItems.clear(); if (shutdownDrainGeneration != null) { shutdownDrainGeneration.pending.clear(); } enableReconciliationPending = !disabledLatestStateReconciliations.isEmpty(); workerRetryAttempt = 0; lock.notifyAll(); } else { forceDisabledLatestStateReconciliationsLocked(); replay = enqueueReadyReplacementReplaysLocked(); ensureWorker(); } } logQueuedReplacementReplays(replay); if (disabledWorker == null) return; try { disabledWorker.join(WORKER_DISABLE_JOIN_MS); } catch (InterruptedException interrupted) { Thread.currentThread().interrupt(); } synchronized (lock) { if (disabledWorker.isAlive()) { logger.warn(\"Automation disable exceeded \" + WORKER_DISABLE_JOIN_MS + \"ms; isolated stale worker generation\"); } if (!Automations.isDisabled()) { forceDisabledLatestStateReconciliationsLocked(); replay = enqueueReadyReplacementReplaysLocked(); ensureWorker(); if (automationWorker == null && hasWorkerWorkLocked()) { scheduleWorkerRetryLocked(); } } lock.notifyAll(); } logQueuedReplacementReplays(replay); }", "tokens": 469} {"id": 647871, "source": "method", "repo": "yash-srivastava/Overdrive-release", "text": "/** Does any variable of this action embed a {@code ${signal:\u2026}} token naming {@code key}?

Covers the interpolated free-text fields ({@code message}, {@code topic}, {@code payload}, API body values) that {@link TextInterpolator} resolves from the shared state map. Scans every variable, but matches only the literal {@code ${signal:} prefix, so a free-text word that merely coincides with a legacy signal alias can never wake a poller.

Allocation-free until a token is actually present: the {@code indexOf} pre-checks reject ordinary text before anything is parsed, which matters because the fast pollers call {@link #isEventReferenced} several times a second. */ private static boolean anyValueEmbedsSignal(Map vars, EventData key) { if (vars == null || vars.isEmpty()) return false; String type = key.getType(); if (type == null || type.isEmpty()) return false; for (Object v : vars.values()) { if (!(v instanceof String)) continue; String s = (String) v; // Both pre-checks are pure scans. A token for THIS key must contain the marker and // the type name; anything else can't match, so we never parse ordinary prose. int from = s.indexOf(SIGNAL_TOKEN); if (from < 0 || !s.contains(type)) continue; while (from >= 0) { int end = s.indexOf('}', from); if (end < 0) break; // unterminated token \u2014 nothing to match if (key.equals(AutomationCondition.resolveSignalAddress(s.substring(from, end + 1)))) { return true; } from = s.indexOf(SIGNAL_TOKEN, end + 1); // several tokens can share one string } } return false; }", "tokens": 408} {"id": 647946, "source": "method", "repo": "yash-srivastava/Overdrive-release", "text": "/** Best-effort decryption of `respondData` for diagnostic logging. Returns the decrypted JSON as a string, or a placeholder describing why we couldn't decode it. Never throws \u2014 used in failure paths where we already have an error and just want extra context. */ private static String decodeRespondDataSafe(JSONObject response, String contentKey) { try { String hex = response.optString(\"respondData\", \"\"); if (hex.isEmpty()) return \"\"; return BydCryptoUtils.aesDecryptUtf8(hex, contentKey); } catch (Exception e) { return \"\"; } }", "tokens": 136} {"id": 648095, "source": "method", "repo": "yash-srivastava/Overdrive-release", "text": "private static void shutdownTripAnalyticsBeforeBlockingCleanup() { markTripAnalyticsShutdownRequested(); try { java.util.concurrent.CompletableFuture initFuture = tripAnalyticsInitFuture; if (initFuture != null) { initFuture.get( 5, java.util.concurrent.TimeUnit.SECONDS); } } catch (Exception initFailure) { log(\"Early trip analytics init join error: \" + initFailure.getMessage()); } try { com.overdrive.app.trips.TripAnalyticsManager manager; synchronized (TRIP_ANALYTICS_LIFECYCLE_LOCK) { manager = tripAnalyticsManager; } if (shouldFinalizeTripsOnShutdown() && manager != null && manager.isInitialized()) { manager.shutdown(); } else if (manager != null && manager.isInitialized()) { // A camera/EGL restart is not a trip end. Checkpoint the open // trip instead so it is not split into a separate card. manager.checkpointActiveTrip(); } } catch (Throwable tripFailure) { log(\"Early trip analytics shutdown error: \" + tripFailure.getMessage()); } }", "tokens": 228} {"id": 648198, "source": "method", "repo": "yash-srivastava/Overdrive-release", "text": "private void rememberCounterBaselineCandidate(double counterKwh, long observedAt) { if (!Double.isFinite(counterKwh) || counterKwh < 0) return; if (Double.isNaN(counterBaselineCandidateKwh) || counterKwh < counterBaselineCandidateKwh) { counterBaselineCandidateKwh = counterKwh; counterBaselineCandidateAtMs = observedAt; } counterBaselineLatestKwh = counterKwh; counterBaselineLatestAtMs = observedAt; if (wasCharging && chargingStartTime > 0L) { persistChargingLifecycleJournal(); } }", "tokens": 121} {"id": 648230, "source": "method", "repo": "yash-srivastava/Overdrive-release", "text": "private static String areaLabel(int area) { switch (area) { case BodyworkConstants.AREA_FRONT_DRIVER: return Messages.get(isRhd() ? \"notifications.area_front_right\" : \"notifications.area_front_left\"); case BodyworkConstants.AREA_FRONT_PASSENGER: return Messages.get(isRhd() ? \"notifications.area_front_left\" : \"notifications.area_front_right\"); case BodyworkConstants.AREA_REAR_LEFT: return Messages.get(\"notifications.area_rear_left\"); case BodyworkConstants.AREA_REAR_RIGHT: return Messages.get(\"notifications.area_rear_right\"); case BodyworkConstants.AREA_HOOD: return Messages.get(\"notifications.area_hood\"); case BodyworkConstants.AREA_TRUNK: return Messages.get(\"notifications.area_trunk\"); case BodyworkConstants.AREA_FUEL_CAP: return Messages.get(\"notifications.area_fuel_cap\"); default: return Messages.get(\"notifications.area_door_n\", area); } }", "tokens": 237} {"id": 648396, "source": "method", "repo": "yash-srivastava/Overdrive-release", "text": "boolean needsCompensation() { return compensationRequired; }", "tokens": 13} {"id": 648401, "source": "method", "repo": "yash-srivastava/Overdrive-release", "text": "private Notification buildNotification() { Notification.Builder b = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) ? new Notification.Builder(this, CHANNEL_ID) : new Notification.Builder(this); return b.setContentTitle(\"Vehicle control\") .setContentText(\"OverDrive\") .setSmallIcon(R.drawable.ic_play_circle) .setOngoing(false) .setGroup(DaemonKeepaliveService.NOTIFICATION_GROUP_KEY) .build(); }", "tokens": 110} {"id": 648924, "source": "method", "repo": "yegor256/cactoos", "text": "/** Ctor. @param input The source @param output The target @since 0.13.3 */ public TeeInput(final Reader input, final Output output) { this(new InputOf(input), output); }", "tokens": 49} {"id": 649257, "source": "method", "repo": "yegor256/cactoos", "text": "void runtimeExceptionIsNotWrapped() { MatcherAssert.assertThat( \"Runtime exception should be rethrown\", () -> new CheckedFunc<>( input -> { throw new IllegalStateException(\"runtime1\"); }, IOException::new ).apply(true), new Throws<>(IllegalStateException.class) ); }", "tokens": 62} {"id": 649272, "source": "method", "repo": "yegor256/cactoos", "text": "void addsAllElementsInThreads() throws Exception { final List list = new ArrayList<>(100); final int threads = 100; for (int idx = 0; idx < threads; ++idx) { new SyncFunc(input -> list.add(1)).apply(true); } MatcherAssert.assertThat( \"Must run the expected amount of threads\", list.size(), new IsEqual<>(threads) ); }", "tokens": 97} {"id": 649387, "source": "method", "repo": "yegor256/cactoos", "text": "void mustReturnNextIndex() { MatcherAssert.assertThat( \"Must return next index\", new ImmutableListIterator<>( new ListOf<>(1).listIterator() ).nextIndex(), new IsEqual<>(0) ); }", "tokens": 44} {"id": 649558, "source": "method", "repo": "yegor256/cactoos", "text": "void throwsFallbackIfNothingMatches() { MatcherAssert.assertThat( \"Fallback was not thrown\", new FirstOf<>( num -> num.equals(0), new IterableOf<>( 1, 2, 3, 4, 5 ), () -> { throw new IllegalArgumentException( String.format(\"Unable to found element with id %d\", 0) ); } ), new Throws<>(IllegalArgumentException.class) ); }", "tokens": 92} {"id": 649872, "source": "method", "repo": "yegor256/takes", "text": "public Response exit(final Response response, final Identity identity) { return response; }", "tokens": 18} {"id": 650048, "source": "method", "repo": "yegor256/takes", "text": "public InputStream itemBody(final Request item) throws IOException { return item.body(); }", "tokens": 19} {"id": 650116, "source": "method", "repo": "yegor256/takes", "text": "public boolean contains(final Object obj) { return this.origin.contains(obj); }", "tokens": 20} {"id": 650209, "source": "method", "repo": "yegor256/takes", "text": "public int read() throws IOException { return this.body().read(); }", "tokens": 16} {"id": 650222, "source": "method", "repo": "yegor256/takes", "text": "public InputStream stream() { return new ByteArrayInputStream(this.bytes.value()); }", "tokens": 18} {"id": 650399, "source": "method", "repo": "yegor256/takes", "text": "/** Ctor. @param input The encapsulated InputStream */ public ServletInputStreamOf(final InputStream input) { super(); this.source = input; }", "tokens": 31} {"id": 650438, "source": "method", "repo": "yegor256/takes", "text": "void passesWhenSinglePassSucceeds() throws Exception { MatcherAssert.assertThat( \"Single successful pass must return true\", new PsAll( Collections.singletonList(new PsFake(true)), 0 ).enter(new RqFake()).has(), new IsEqual<>(true) ); }", "tokens": 59} {"id": 650440, "source": "method", "repo": "yegor256/takes", "text": "void returnsIdentityFromIndex() throws Exception { final int index = 3; final Pass resulting = new PsFixed( new Identity.Simple(\"urn:foo:test\") ); final RqFake request = new RqFake(); MatcherAssert.assertThat( \"Must return identity from pass at specified index\", new PsAll( Arrays.asList( new PsFake(true), new PsFake(true), new PsFake(true), resulting ), index ).enter(request).get().urn(), new IsEqual<>(resulting.enter(request).get().urn()) ); }", "tokens": 125} {"id": 650602, "source": "method", "repo": "yegor256/takes", "text": "public void reset() throws IOException { this.origin.reset(); }", "tokens": 15} {"id": 650701, "source": "method", "repo": "yegor256/takes", "text": "void reportsCorrectContentLength() throws IOException { final String text = \"some text to encode\"; final Response response = new RsGzip(new RsText(text)); MatcherAssert.assertThat( \"Gzip response must report correct compressed content length\", new RsHeadPrint(response).asString(), Matchers.containsString( String.format( \"Content-Length: %d\", new RsBodyPrint(response).asString().length() ) ) ); }", "tokens": 92} {"id": 650799, "source": "method", "repo": "yizzuide/milkomeda", "text": "private void sharedReentrantUnLock(Object lock) throws Exception { ((InterProcessMutex)lock).release(); }", "tokens": 28} {"id": 651260, "source": "method", "repo": "yizzuide/milkomeda", "text": "public RedisTemplate jsonRedisTemplate(LettuceConnectionFactory redisConnectionFactory) { RedisTemplate redisTemplate = new RedisTemplate<>(); Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class); ObjectMapper objectMapper = new ObjectMapper(); objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); objectMapper.configure(JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS.mappedFeature(),true); TimeZone china = TimeZone.getTimeZone(\"GMT+08:00\"); objectMapper.setTimeZone(china); objectMapper.setDateFormat(new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\")); jackson2JsonRedisSerializer.setObjectMapper(objectMapper); redisTemplate.setKeySerializer(new StringRedisSerializer()); redisTemplate.setValueSerializer(jackson2JsonRedisSerializer); redisTemplate.setHashKeySerializer(new StringRedisSerializer()); redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer); redisTemplate.setConnectionFactory(redisConnectionFactory); return redisTemplate; }", "tokens": 238} {"id": 651329, "source": "method", "repo": "yizzuide/milkomeda", "text": "public void onApplicationEvent(@NonNull ApplicationStartedEvent event) { loadConfig(); }", "tokens": 18} {"id": 651450, "source": "method", "repo": "yuliskov/SmartTube", "text": "public AppUpdatePresenter(Context context) { super(context); mUpdateChecker = new AppUpdateChecker(context, this); mSettingsPresenter = AppDialogPresenter.instance(context); mUpdateManifestUrls = context.getResources().getStringArray(R.array.update_urls); }", "tokens": 59} {"id": 651567, "source": "method", "repo": "yuliskov/SmartTube", "text": "protected void onDestroy() { setPlayer(null); releaseSurface(surfaceTexture, surface); super.onDestroy(); }", "tokens": 24} {"id": 651702, "source": "method", "repo": "yuliskov/SmartTube", "text": "/** Generates a new set of track and track format ids. Must be called before {@code get*} methods. */ public void generateNewId() { trackId = trackId == ID_UNSET ? firstTrackId : trackId + trackIdIncrement; formatId = formatIdPrefix + trackId; }", "tokens": 64} {"id": 651704, "source": "method", "repo": "yuliskov/SmartTube", "text": "public final void setOperatingRate(float operatingRate) throws ExoPlaybackException { rendererOperatingRate = operatingRate; if (codec != null && codecDrainAction != DRAIN_ACTION_REINITIALIZE && getState() != STATE_DISABLED) { updateCodecOperatingRate(); } }", "tokens": 60} {"id": 652034, "source": "method", "repo": "yuliskov/SmartTube", "text": "/** Return the host object of this fragment. @throws IllegalStateException if not currently associated with a host. @see #getHost() */ public final Object requireHost() { Object host = getHost(); if (host == null) { throw new IllegalStateException(\"Fragment \" + this + \" not attached to a host.\"); } return host; }", "tokens": 71} {"id": 652092, "source": "method", "repo": "yuliskov/SmartTube", "text": "public void onSeekFinished(boolean cancelled) { if (mSeekUiClient != null) { mSeekUiClient.onSeekFinished(cancelled); } setSeekMode(false); }", "tokens": 40} {"id": 652168, "source": "method", "repo": "yuliskov/SmartTube", "text": "void updatePositionToRowMapInPostLayout() { mPositionToRowInPostLayout.clear(); final int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { // Grid still maps to old positions at this point, use old position to get row infor int position = mBaseGridView.getChildViewHolder(getChildAt(i)).getOldPosition(); if (position >= 0) { Grid.Location loc = mGrid.getLocation(position); if (loc != null) { mPositionToRowInPostLayout.put(position, loc.row); } } } }", "tokens": 130} {"id": 652255, "source": "method", "repo": "yuliskov/SmartTube", "text": "SynchronizeDatabaseTask(Context context, JobParameters jobParameters) { mJobParameters = jobParameters; mTask = new UpdateChannelsTask(context); }", "tokens": 33} {"id": 652261, "source": "method", "repo": "yuliskov/SmartTube", "text": "/** Return the size of an edge. This is the range in pixels along the edges of this view that will actively detect edge touches or drags if edge tracking is enabled. @return The size of an edge in pixels @see #setEdgeTrackingEnabled(int) */ public int getEdgeSize() { return mEdgeSize; }", "tokens": 70} {"id": 652299, "source": "method", "repo": "yuliskov/SmartTube", "text": "/** @return The current position of the media item in milliseconds. */ public long getCurrentPosition() { return mPlayerAdapter.getCurrentPosition(); }", "tokens": 30} {"id": 652364, "source": "method", "repo": "yunaiv/ruoyi-vue-pro", "text": "public AbstractEngineConfiguration setDatabaseWildcardEscapeCharacter(String databaseWildcardEscapeCharacter) { this.databaseWildcardEscapeCharacter = databaseWildcardEscapeCharacter; return this; }", "tokens": 34} {"id": 652505, "source": "method", "repo": "yunaiv/ruoyi-vue-pro", "text": "public CommonResult quitGroup(@RequestParam(\"groupId\") Long groupId) { groupService.quitGroup(groupId, getLoginUserId()); return success(true); }", "tokens": 35} {"id": 652533, "source": "method", "repo": "yunaiv/ruoyi-vue-pro", "text": "public IotDeviceMessage sendDeviceMessage(IotDeviceMessage message) { IotDeviceDO device = deviceService.validateDeviceExists(message.getDeviceId()); return sendDeviceMessage(message, device); }", "tokens": 45} {"id": 652558, "source": "method", "repo": "yunaiv/ruoyi-vue-pro", "text": "public CommonResult createCouponTemplate(@Valid @RequestBody CouponTemplateCreateReqVO createReqVO) { return success(couponTemplateService.createCouponTemplate(createReqVO)); }", "tokens": 36} {"id": 652563, "source": "method", "repo": "yunaiv/ruoyi-vue-pro", "text": "public CommonResult> getSeckillActivityPage(@Valid SeckillConfigPageReqVO pageVO) { PageResult pageResult = seckillConfigService.getSeckillConfigPage(pageVO); return success(SeckillConfigConvert.INSTANCE.convertPage(pageResult)); }", "tokens": 62} {"id": 652656, "source": "method", "repo": "yunaiv/ruoyi-vue-pro", "text": "public void recalculateLineDefectStats(Long oqcId, List records) { List lines = oqcLineMapper.selectListByOqcId(oqcId); if (CollUtil.isEmpty(lines)) { return; } List updateLines = new ArrayList<>(lines.size()); for (MesQcOqcLineDO line : lines) { int critical = 0, major = 0, minor = 0; for (MesQcDefectRecordDO record : records) { if (ObjUtil.notEqual(record.getLineId(), line.getId())) { continue; } int quantity = ObjUtil.defaultIfNull(record.getQuantity(), 1); if (Objects.equals(record.getLevel(), MesQcDefectLevelEnum.CRITICAL.getType())) { critical += quantity; } else if (Objects.equals(record.getLevel(), MesQcDefectLevelEnum.MAJOR.getType())) { major += quantity; } else if (Objects.equals(record.getLevel(), MesQcDefectLevelEnum.MINOR.getType())) { minor += quantity; } else { throw exception(QC_DEFECT_RECORD_LEVEL_UNKNOWN); } } updateLines.add(new MesQcOqcLineDO().setId(line.getId()) .setCriticalQuantity(critical).setMajorQuantity(major).setMinorQuantity(minor)); } for (MesQcOqcLineDO updateLine : updateLines) { oqcLineMapper.updateById(updateLine); } }", "tokens": 355} {"id": 652687, "source": "method", "repo": "yunaiv/ruoyi-vue-pro", "text": "public CommonResult> getReceivedNotePage(@Valid OaNotePageReqVO pageReqVO) { PageResult pageResult = noteService.getReceivedNotePage(pageReqVO, getLoginUserId()); return success(new PageResult<>(buildNoteRespVOList(pageResult.getList()), pageResult.getTotal())); }", "tokens": 72} {"id": 652747, "source": "method", "repo": "yunaiv/ruoyi-vue-pro", "text": "public Long sendSingleMailToAdmin(MailSendSingleToUserReqDTO reqDTO) { return mailSendService.sendSingleMailToAdmin(reqDTO.getUserId(), reqDTO.getToMails(), reqDTO.getCcMails(), reqDTO.getBccMails(), reqDTO.getTemplateCode(), reqDTO.getTemplateParams(), reqDTO.getAttachments()); }", "tokens": 79} {"id": 652973, "source": "method", "repo": "yunaiv/yudao-cloud", "text": "public PageResult getDemo03StudentPage(Demo03StudentNormalPageReqVO pageReqVO) { return demo03StudentNormalMapper.selectPage(pageReqVO); }", "tokens": 41} {"id": 653149, "source": "method", "repo": "yunaiv/yudao-cloud", "text": "public CommonResult updateAppStatus(@Valid @RequestBody PayAppUpdateStatusReqVO updateReqVO) { appService.updateAppStatus(updateReqVO.getId(), updateReqVO.getStatus()); return success(true); }", "tokens": 45} {"id": 653299, "source": "method", "repo": "yuriy-budiyev/code-scanner", "text": "/** A view to display code scanner preview @see CodeScanner */ public CodeScannerView(final Context context, final AttributeSet attrs, @AttrRes final int defStyleAttr, @StyleRes final int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); initialize(context, attrs, defStyleAttr, defStyleRes); }", "tokens": 63} {"id": 653351, "source": "method", "repo": "yuriy-budiyev/code-scanner", "text": "/** Flash button horizontal padding @param padding Padding in pixels */ public void setFlashButtonPaddingHorizontal(@Px final int padding) { if (padding < 0) { throw new IllegalArgumentException(\"Padding should be equal to or grater then zero\"); } final boolean changed = padding != mFlashButtonPaddingHorizontal; mFlashButtonPaddingHorizontal = padding; if (changed) { invalidateFlashButtonPadding(); } }", "tokens": 87} {"id": 653584, "source": "method", "repo": "yworks/yguard", "text": "public DataInputStream getNextClassEntryStream() throws IOException { JarEntry entry = null; while ( en.hasMoreElements() ) { entry = en.nextElement(); if ( entry.getName().endsWith( \".class\" ) ) { break; } } if ( entry != null && entry.getName().endsWith( \".class\" ) ) { setCurrentEntry( entry ); return new DataInputStream( new BufferedInputStream( f.getInputStream( entry ) ) ); } else { setCurrentEntry( null ); return null; } }", "tokens": 115} {"id": 653598, "source": "method", "repo": "yworks/yguard", "text": "public Iterator edges() { return edges.iterator(); }", "tokens": 12} {"id": 653795, "source": "method", "repo": "yworks/yguard", "text": "/** Is source file mapping set boolean. @return the boolean */ public boolean isSourceFileMappingSet(){ return sourceFileMappingSet; }", "tokens": 27} {"id": 653848, "source": "method", "repo": "yworks/yguard", "text": "/** Getter for property pedantic. @return Value of property pedantic. */ public boolean isPedantic() { return this.pedantic; }", "tokens": 38} {"id": 653876, "source": "method", "repo": "yworks/yguard", "text": "/** Return the display name of the descriptor types. */ protected String getDescriptorName() { String[] types = parseTypes(); StringBuffer sb = new StringBuffer(); sb.append(\"(\"); if (types.length > 0) { for (int i = 0; i < types.length - 1; i++) { sb.append(types[i]); if (i < types.length - 2) { sb.append(\", \"); } } } sb.append(\");\"); return sb.toString(); }", "tokens": 110} {"id": 653939, "source": "method", "repo": "yworks/yguard", "text": "/** Read the data following the header; over-ride this in sub-classes. @param din the din @throws IOException the io exception */ protected void readInfo(DataInput din) throws java.io.IOException { info = new byte[u4attrLength]; din.readFully(info); }", "tokens": 63} {"id": 653947, "source": "method", "repo": "yworks/yguard", "text": "/** Get bootstrap methods bootstrap method [ ]. @return the bootstrap method [ ] */ public BootstrapMethod[] getBootstrapMethods() { return bootstrapMethods; }", "tokens": 34} {"id": 654001, "source": "method", "repo": "yworks/yguard", "text": "/** Add an entry to the constant pool and return its index. @param entry the entry @return the int */ public int addEntry(CpInfo entry) { int oldLength = pool.size(); pool.setSize(oldLength + 1); pool.setElementAt(entry, oldLength); return oldLength; }", "tokens": 67} {"id": 654057, "source": "method", "repo": "yworks/yguard", "text": "/** Export data following the header to a DataOutput stream. */ public void writeInfo(DataOutput dout) throws java.io.IOException { dout.writeShort(u2lineNumberTableLength); for (int i = 0; i < u2lineNumberTableLength; i++) { lineNumberTable[i].write(dout); } }", "tokens": 71} {"id": 654126, "source": "method", "repo": "yworks/yguard", "text": "/** Dump the content of the class file to the specified file (used for debugging). */ public void dump(PrintWriter pw, ClassFile cf, int index) { pw.println(\" Ref \" + Integer.toString(index) + \": \" + ((Utf8CpInfo)cf.getCpEntry(((ClassCpInfo)cf.getCpEntry(u2classIndex)).getNameIndex())).getString() + \" \" + ((Utf8CpInfo)cf.getCpEntry(((NameAndTypeCpInfo)cf.getCpEntry(u2nameAndTypeIndex)).getNameIndex())).getString() + \" \" + ((Utf8CpInfo)cf.getCpEntry(((NameAndTypeCpInfo)cf.getCpEntry(u2nameAndTypeIndex)).getDescriptorIndex())).getString()); }", "tokens": 163} {"id": 654231, "source": "method", "repo": "yworks/yguard", "text": "public void visitFrame(int i, int i1, Object[] objects, int i2, Object[] objects1) { }", "tokens": 28} {"id": 654321, "source": "method", "repo": "yworks/yguard", "text": "/** Creates a new instance of AnnotationsTest */ public AnnotationsTest() { try { Constructor c = getClass().getConstructor(); Annotation[] a = c.getAnnotations(); for (int i = 0; i < a.length; i++){ log.log(Level.FINE, \"annotation \" + a[i]); if (a[i] instanceof TestAnnotation){ TestAnnotation ta = (TestAnnotation) a[i]; log.log(Level.FINE, \"id = 23 ? \" + ta.id()); log.log(Level.FINE, \"test1 = blah ? \" + ta.test1()); log.log(Level.FINE, \"test2 = test ? \" + ta.test2()); log.log(Level.FINE, \"test3 = 2 ? \" + ta.test3()); log.log(Level.FINE, \"classType \" + ta.classType()); log.log(Level.FINE, \"recursive \" + ta.recursive()); log.log(Level.FINE, \"enumTest \" + ta.enumTest()); log.log(Level.FINE, \"classArray \" + ta.classArray()[0]); } } } catch (Exception ex){ ex.printStackTrace(); } }", "tokens": 260} {"id": 654469, "source": "method", "repo": "zalando/intellij-swagger", "text": "public boolean completeResponseKey() { return pathResolver.childOfResponse(psiElement); }", "tokens": 19} {"id": 654497, "source": "method", "repo": "zalando/intellij-swagger", "text": "public void fill() { OpenApiFields.callback().forEach(this::addUnique); }", "tokens": 20} {"id": 654674, "source": "method", "repo": "zalando/intellij-swagger", "text": "public String getText() { return \"Create\"; }", "tokens": 11} {"id": 654711, "source": "method", "repo": "zalando/intellij-swagger", "text": "boolean isCircular() { return resultType == ResultType.CIRCULAR; }", "tokens": 18} {"id": 654777, "source": "method", "repo": "zalando/intellij-swagger", "text": "public final boolean childOfHeader(final PsiElement psiElement) { return hasPath(psiElement, \"$.paths.*.*.responses.*.headers.*\") || hasPath(psiElement, \"$.components.headers.*\"); }", "tokens": 47} {"id": 654790, "source": "method", "repo": "zalando/intellij-swagger", "text": "public boolean childOfServerVariable(PsiElement psiElement) { return hasPath(psiElement, \"$.servers.variables.*\"); }", "tokens": 26} {"id": 654929, "source": "method", "repo": "zalando/intellij-swagger", "text": "public void thatRootKeysAreSuggested() { getCaretCompletions(\"root\") .assertContains( \"info\", \"servers\", \"paths\", \"components\", \"security\", \"tags\", \"externalDocs\") .isOfSize(7); }", "tokens": 51} {"id": 654942, "source": "method", "repo": "zalando/intellij-swagger", "text": "public void thatHeaderKeysAreSuggested() { getCaretCompletions(\"header\") .assertContains( \"$ref\", \"description\", \"required\", \"deprecated\", \"allowEmptyValue\", \"style\", \"explode\", \"allowReserved\", \"schema\", \"example\", \"examples\", \"content\") .isOfSize(12); }", "tokens": 68} {"id": 655085, "source": "method", "repo": "zalando/intellij-swagger", "text": "public void thatKeyInsideQuotesIsHandled() { completeAndCheckResultsByFile(\"key_inside_quotes\"); }", "tokens": 25} {"id": 655128, "source": "method", "repo": "zalando/intellij-swagger", "text": "public void testRenameLocalDefinitionDeclaration() { testRename( \"NewPets\", \"rename_definition_ref_declaration.yaml\", \"rename_definition_ref_declaration_after.yaml\"); }", "tokens": 43} {"id": 655242, "source": "method", "repo": "zalando/logbook", "text": "/** Produces a map of individual properties from an HTTP response. @param correlation the correlation @param response the response @return a map containing HTTP response attributes @throws IOException if reading body fails @see #prepare(Correlation, HttpResponse) @see #format(Map) */ default Map prepare(final Correlation correlation, final HttpResponse response) throws IOException { final Map content = new LinkedHashMap<>(); content.put(\"origin\", response.getOrigin().name().toLowerCase(Locale.ROOT)); content.put(\"type\", \"response\"); content.put(\"correlation\", correlation.getId()); content.put(\"duration\", correlation.getDuration().toMillis()); content.put(\"protocol\", response.getProtocolVersion()); content.put(\"status\", response.getStatus()); if (!response.getAttributes().isEmpty()) { content.put(\"attributes\", response.getAttributes()); } prepareHeaders(response).ifPresent(headers -> content.put(\"headers\", headers)); prepareBody(response).ifPresent(body -> content.put(\"body\", body)); return content; }", "tokens": 220} {"id": 655250, "source": "method", "repo": "zalando/logbook", "text": "void mergesConsecutiveMergeableFilters() { final BodyFilter actual = merge( new TestFilter(\"a\"), new TestFilter(\"b\"), new TestFilter(\"c\")); assertThat(actual).isInstanceOf(TestFilter.class); final TestFilter result = (TestFilter) actual; assertThat(result.names).contains(\"a\", \"b\", \"c\"); }", "tokens": 79} {"id": 655255, "source": "method", "repo": "zalando/logbook", "text": "void uselessOperationsPreserveOriginalInstance() { HttpHeaders newHeaders = headers .update(\"uppercase\", lst1) .update(\"UPPERCASE\", lst1) .delete(\"Non-Existent-Key\"); assertThat(newHeaders).isSameAs(headers); }", "tokens": 55} {"id": 655423, "source": "method", "repo": "zalando/logbook", "text": "public void testIgnoresIncorrectExpression1() { final String path = \"/a/b/c/d/e\"; final String expr = \"/a/b/{c/d/e\"; final PathFilter regexpPathUriFilter = new DefaultPathFilter(\"XXX\", expr); final String result = regexpPathUriFilter.filter(path); assertThat(path).isSameAs(result); }", "tokens": 81} {"id": 655433, "source": "method", "repo": "zalando/logbook", "text": "void testEmptyFields() throws IOException { final String output = test( MockHttpRequest.create() .withRemote(\"185.85.220.253\") .withMethod(\"POST\") .withPath(\"/search\") .withQuery(\"q=zalando\"), MockHttpResponse.create(), \"\"); assertEquals(\"2019-08-02 08:16:41 185.85.220.253 localhost POST /search ?q=zalando 200 0 0 0.125 HTTP/1.1 - - -\", output); }", "tokens": 139} {"id": 655495, "source": "method", "repo": "zalando/logbook", "text": "public LogbookHttpResponseInterceptor() { this(false); }", "tokens": 13} {"id": 655498, "source": "method", "repo": "zalando/logbook", "text": "public HttpHeaders getHeaders() { HttpHeaders headers = HttpHeaders.empty(); final Set>> entries = Stream.of(response.getAllHeaders()) .collect(groupingBy( Header::getName, mapping(Header::getValue, toList()))) .entrySet(); for (final Map.Entry> entry : entries) { final String name = entry.getKey(); final List values = entry.getValue(); headers = headers.update(name, values); } return headers; }", "tokens": 113} {"id": 655647, "source": "method", "repo": "zalando/logbook", "text": "public void shouldReturnDescription() { assertEquals(\"Logbook filter\", new LogbookFilter().description()); }", "tokens": 21} {"id": 655938, "source": "method", "repo": "zalando/logbook", "text": "void withBody_eagerlyBuffersBody() throws Exception { final byte[] bodyContent = \"test body content\".getBytes(); final var inputStream = mock(jakarta.servlet.ServletInputStream.class); when(inputStream.read(any(byte[].class))).thenAnswer(invocation -> { byte[] buffer = invocation.getArgument(0); System.arraycopy(bodyContent, 0, buffer, 0, bodyContent.length); return bodyContent.length; }).thenReturn(-1); when(httpServletRequest.getInputStream()).thenReturn(inputStream); when(httpServletRequest.getContentType()).thenReturn(\"application/json\"); remoteRequest.withBody(); assertEquals(17, remoteRequest.getBody().length); final var secondInputStream = mock(jakarta.servlet.ServletInputStream.class); when(secondInputStream.read((byte[]) any())).thenThrow(new java.io.IOException(\"Stream closed\")); when(httpServletRequest.getInputStream()).thenReturn(secondInputStream); assertEquals(17, remoteRequest.getBody().length); }", "tokens": 212} {"id": 656069, "source": "method", "repo": "zalando/logbook", "text": "public void write( final Correlation correlation, final HttpRequest request, final HttpResponse response, final Sink sink) throws IOException { response.getBody(); response.withoutBody() // ignoring .withBody() // buffering .withBody(); // buffering (self transition) if (request.getHeaders().containsKey(\"ignore\")) { response.withoutBody(); } sink.write(correlation, request, response); }", "tokens": 83} {"id": 656099, "source": "method", "repo": "zalando/nakadi", "text": "public void whenStreamIdInvalidThenException() throws Exception { try { cursorsService.commitCursors(\"wrong-stream-id\", sid, testCursors); fail(\"Expected InvalidStreamIdException to be thrown\"); } catch (final InvalidStreamIdException ignore) { } checkCurrentOffsetInZk(P1, OLD_OFFSET); }", "tokens": 73} {"id": 656283, "source": "method", "repo": "zalando/nakadi", "text": "public void createIfMissing(final EventTypeBase eventType, final boolean checkAuth) throws AuthorizationSectionException, TopicCreationException, InternalNakadiException, NoSuchPartitionStrategyException, DuplicatedEventTypeNameException, InvalidEventTypeException, DbWriteOperationsBlockedException, EventTypeOptionsValidationException { try { eventTypeCache.getEventType(eventType.getName()); LOG.info(\"Event-type {} already exists\", eventType.getName()); } catch (final NoSuchEventTypeException noSuchEventTypeException) { LOG.info(\"Creating event-type {} as it is missing\", eventType.getName()); create(eventType, checkAuth); } }", "tokens": 121} {"id": 656350, "source": "method", "repo": "zalando/nakadi", "text": "public void setUp() throws Exception { this.avroSchemaCompatibility = new AvroSchemaCompatibility(); }", "tokens": 21} {"id": 656378, "source": "method", "repo": "zalando/nakadi", "text": "private static ScmSource loadScmSource(final ObjectMapper objectMapper) { try (InputStream in = new FileInputStream(SCM_SOURCE_FILE)) { return objectMapper.readValue(in, ScmSource.class); } catch (FileNotFoundException ex) { LOG.warn(\"Failed to read scm-source.json file from \" + SCM_SOURCE_FILE + \", file not found\"); } catch (IOException ex) { LOG.warn(\"Failed to read scm-source.json file from \" + SCM_SOURCE_FILE, ex); } return null; }", "tokens": 115} {"id": 656430, "source": "method", "repo": "zalando/nakadi", "text": "public ZooKeeperHolder mockZKHolder() { return mock(ZooKeeperHolder.class); }", "tokens": 23} {"id": 656691, "source": "method", "repo": "zalando/nakadi", "text": "public SubscriptionCursor withToken(final String token) { return new SubscriptionCursor(getPartition(), getOffset(), getEventType(), token); }", "tokens": 28} {"id": 656744, "source": "method", "repo": "zalando/nakadi", "text": "public HashGeneratorTest() { hashGenerator = new HashGenerator(); }", "tokens": 15} {"id": 656802, "source": "method", "repo": "zalando/nakadi", "text": "private NoJsonSchemaValidator(final String eventTypeName) { this.message = \"No json_schema found for event type: \" + eventTypeName; }", "tokens": 32} {"id": 656857, "source": "method", "repo": "zalando/nakadi", "text": "public List calculate( final Subscription subscription, final TimelineService timelineService, final CursorConverter converter) { return subscription.getEventTypes() .stream() .map(et -> { try { // get oldest active timeline return timelineService.getActiveTimelinesOrdered(et).get(0); } catch (final InternalNakadiException e) { throw new NakadiRuntimeException(e); } }) .collect(groupingBy(Timeline::getStorage)) // for performance reasons. See ARUHA-1387 .values() .stream() .flatMap(timelines -> { try { return timelineService.getTopicRepository(timelines.get(0)) .loadTopicStatistics(timelines).stream(); } catch (final ServiceTemporarilyUnavailableException e) { throw new NakadiRuntimeException(e); } }) .map(PartitionStatistics::getBeforeFirst) .map(converter::convertToNoToken) .collect(Collectors.toList()); }", "tokens": 207} {"id": 656961, "source": "method", "repo": "zalando/nakadi", "text": "public void whenSchemaHasIncompatibilitiesThenThrows() throws Exception { Mockito.doThrow(SchemaEvolutionException.class) .when(schemaEvolutionService).collectIncompatibilities(any()); assertThrows(SchemaEvolutionException.class, () -> schemaService.validateSchema(eventType)); }", "tokens": 68} {"id": 656996, "source": "method", "repo": "zalando/nakadi", "text": "public void testExecuteSuccess() { final EventType eventType = Mockito.mock(EventType.class); Mockito.when(eventType.getEnrichmentStrategies()) .thenReturn(List.of(EnrichmentStrategyDescriptor.METADATA_ENRICHMENT)); final NakadiRecord nakadiRecord = Mockito.mock(NakadiRecord.class); final List nakadiRecords = List.of(nakadiRecord); final List result = enrichmentCheck.execute(eventType, nakadiRecords); assertNotNull(result); assertEquals(0, result.size()); Mockito.verify(metadataEnrichmentStrategy).enrich(nakadiRecord, eventType); }", "tokens": 133} {"id": 657281, "source": "method", "repo": "zalando/opentracing-toolbox", "text": "public Map intercept( final Span span, final String key, final String value) { return interceptors.stream() .flatMap(interceptor -> interceptor .intercept(span, key, value).entrySet().stream()) .collect(toMap(Entry::getKey, Entry::getValue, this::firstComeFirstServe)); }", "tokens": 75} {"id": 657305, "source": "method", "repo": "zalando/opentracing-toolbox", "text": "public SpanBuilder intercept(final Tracer tracer, final SpanBuilder builder) { SpanBuilder result = builder; for (final SpanBuilderInterceptor interceptor : interceptors) { result = interceptor.intercept(tracer, result); } return result; }", "tokens": 50} {"id": 657442, "source": "method", "repo": "zalando/opentracing-toolbox", "text": "void shouldNotAutoTagOrdinaryKeyOnSetBaggage() { unit.buildSpan(\"test\").start() .setBaggageItem(\"ordinary\", \"yes\") .finish(); final MockSpan span = getOnlyElement(tracer.finishedSpans()); assertNull(span.tags().get(\"ordinary\")); }", "tokens": 65} {"id": 657577, "source": "method", "repo": "zalando/opentracing-toolbox", "text": "public void onResponse( final ServerWebExchange exchange, final Span span) { HttpStatus statusCode = exchange.getResponse().getStatusCode(); if (statusCode == null || predicate.test(statusCode)) { span.setTag(Tags.ERROR, true); } }", "tokens": 50} {"id": 657586, "source": "method", "repo": "zalando/opentracing-toolbox", "text": "private Optional getPath(final ServerWebExchange exchange) { return Optional.ofNullable(exchange.getAttribute(BEST_MATCHING_HANDLER_ATTRIBUTE)) .filter(HandlerMethod.class::isInstance) .map(HandlerMethod.class::cast) // TODO verify that we see class-level @RequestMapping paths .map(method -> method.getMethodAnnotation(RequestMapping.class)) .map(RequestMapping::path) .map(Arrays::asList) .map(List::iterator) .filter(Iterator::hasNext) .map(Iterator::next); }", "tokens": 126} {"id": 657693, "source": "method", "repo": "zalando/problem", "text": "void shouldCreateGenericProblem() { final Problem problem = Problem.valueOf(Status.NOT_FOUND); assertThat(problem, hasFeature(\"type\", Problem::getType, hasToString(\"about:blank\"))); assertThat(problem, hasFeature(\"title\", Problem::getTitle, equalTo(\"Not Found\"))); assertThat(problem, hasFeature(\"status\", Problem::getStatus, equalTo(Status.NOT_FOUND))); }", "tokens": 81} {"id": 657722, "source": "method", "repo": "zalando/problem", "text": "private String getStackTrace(final Throwable throwable) { final StringWriter writer = new StringWriter(); throwable.printStackTrace(new PrintWriter(writer)); return writer.toString(); }", "tokens": 33} {"id": 657760, "source": "method", "repo": "zalando/problem", "text": "void shouldSerializeProblemCause() { final Problem problem = Problem.builder() .withType(URI.create(\"https://example.org/preauthorization-failed\")) .withTitle(\"Preauthorization Failed\") .withStatus(BAD_REQUEST) .withCause(Problem.builder() .withType(URI.create(\"https://example.org/expired-credit-card\")) .withTitle(\"Expired Credit Card\") .withStatus(BAD_REQUEST) .withDetail(\"Credit card is expired as of 2015-09-16T00:00:00Z\") .with(\"since\", \"2015-09-16T00:00:00Z\") .build()) .build(); final String json = gson.toJson(problem); assertThat(\"json\", Objects.nonNull(json)); with(json) .assertThat(\"$.*\", hasSize(4)) .assertThat(\"$.cause.*\", hasSize(5)) .assertThat(\"$.cause.type\", is(\"https://example.org/expired-credit-card\")) .assertThat(\"$.cause.title\", is(\"Expired Credit Card\")) .assertThat(\"$.cause.status\", is(400)) .assertThat(\"$.cause.detail\", is(\"Credit card is expired as of 2015-09-16T00:00:00Z\")) .assertThat(\"$.cause.since\", is(\"2015-09-16T00:00:00Z\")); }", "tokens": 338} {"id": 657778, "source": "method", "repo": "zalando/problem", "text": "MyProblem(URI type, @Nullable String title, @Nullable StatusType status) { this(type, title, status, null); }", "tokens": 30} {"id": 657883, "source": "method", "repo": "zalando/problem-spring-web", "text": "private IllegalArgumentException newIllegalArgument(final Exception e) { throw new IllegalArgumentException(\"Illegal Argument\", e); }", "tokens": 23} {"id": 658022, "source": "method", "repo": "zalando/problem-spring-web", "text": "public void initialize(final NotBob constraintAnnotation) { // no initialization needed }", "tokens": 17} {"id": 658029, "source": "method", "repo": "zalando/problem-spring-web", "text": "public ProblemHandling unit() { return new NestedProblemHandling(); }", "tokens": 15} {"id": 658104, "source": "method", "repo": "zalando/problem-spring-web", "text": "void shouldBeConfigured() throws Exception { final ObjectPostProcessor objectPostProcessor = mock(ObjectPostProcessor.class); final AuthenticationManagerBuilder authenticationManagerBuilder = mock(AuthenticationManagerBuilder.class); final SecurityProblemSupport securityProblemSupport = mock(SecurityProblemSupport.class); final HttpSecurity http = new HttpSecurity(objectPostProcessor, authenticationManagerBuilder, new HashMap<>()); doAnswer(answer -> { final Consumer consumer = (Consumer) answer.getArguments()[0]; consumer.accept(securityProblemSupport); return null; }).when(provider).ifAvailable(any(Consumer.class)); assertThat(processor.postProcessAfterInitialization(http, \"httpSecurity\")).isEqualTo(http); assertThat(ReflectionTestUtils.getField(http.exceptionHandling(), \"authenticationEntryPoint\")).isEqualTo(securityProblemSupport); assertThat(ReflectionTestUtils.getField(http.exceptionHandling(), \"accessDeniedHandler\")).isEqualTo(securityProblemSupport); }", "tokens": 197} {"id": 658134, "source": "method", "repo": "zalando/problem-spring-web", "text": "default Mono> handleAuthentication(final AuthenticationException e, final ServerWebExchange request) { return create(UNAUTHORIZED, e, request); }", "tokens": 33} {"id": 658144, "source": "method", "repo": "zalando/problem-spring-web", "text": "default Mono> newConstraintViolationProblem(final Exception exception, final ServerWebExchange request, final ValidationReport report) { final List violations = report.getMessages().stream() .map(this::createViolation) .collect(toList()); return newConstraintViolationProblem(exception, violations, request); }", "tokens": 70} {"id": 658309, "source": "method", "repo": "zalando/riptide", "text": "void shouldExecute(final Function test) { server.enqueue(jsonMockResponse(\"{\\\"name\\\":\\\"D. Fault\\\",\\\"birthday\\\":\\\"1984-09-13\\\"}\")); final User user = test.apply(new HttpOperations(http)); assertEquals(new User(\"D. Fault\", \"1984-09-13\"), user); var recordedRequest = getRecordedRequest(server); verifyRequest(recordedRequest, \"/departments/1/users\", POST.toString()); verifyRequestBody(recordedRequest, \"{\\\"name\\\":\\\"D. Fault\\\",\\\"birthday\\\":\\\"1984-09-13\\\"}\"); assertEquals(\"true\", recordedRequest.getHeaders().get(\"Test\")); }", "tokens": 148} {"id": 658538, "source": "method", "repo": "zalando/riptide", "text": "public void execute(final String baseUrl, final UrlResolution resolution, @Nullable final String uri, final HttpMethod method, final Consumer tester) { try { final Http unit = Http.builder() .executor(Executors.newSingleThreadExecutor()) .requestFactory(new SimpleClientHttpRequestFactory()) .baseUrl(baseUrl) .urlResolution(resolution) .build(); tester.accept(unit); fail(\"Expected exception\"); } catch (final Exception e) { final Throwable cause = Throwables.getRootCause(e); assertThat(cause, is(instanceOf(IllegalArgumentException.class))); assertThat(cause.getMessage(), is(message)); } }", "tokens": 136} {"id": 658958, "source": "method", "repo": "zalando/riptide", "text": "static TimeSpan valueOf(final String value) { if (value.isEmpty()) { return new TimeSpan(0, TimeUnit.NANOSECONDS); } final Matcher matcher = PATTERN.matcher(value); if (!matcher.matches()) { throw new IllegalArgumentException(\"'\" + value + \"' is not a valid time span\"); } final long amount = Long.parseLong(matcher.group(1)); final TimeUnit unit = fromName(matcher.group(2)); return new TimeSpan(amount, unit); }", "tokens": 105} {"id": 658974, "source": "method", "repo": "zalando/riptide", "text": "void shouldNotLowerProvidedDefaultConnectionMaxTotalToConnectionsMaxPerRoute() { final RiptideProperties properties = new RiptideProperties(); properties.getDefaults().getConnections().setMaxTotal(75); final RiptideProperties actual = Defaulting.withDefaults(properties); assertThat(actual.getDefaults().getConnections().getMaxTotal(), is(75)); }", "tokens": 74} {"id": 659146, "source": "method", "repo": "zed-0xff/ZombieBuddy", "text": "static List getActiveJavaMods() { return g_jarLoadStatus.values().stream() .filter(s -> s.flags().has(MF_ACTIVE)) .toList(); }", "tokens": 48} {"id": 659246, "source": "method", "repo": "zed-0xff/ZombieBuddy", "text": "private static Map buildNameMap(Class patchClass) { Map out = new LinkedHashMap<>(); for (Method method : patchClass.getDeclaredMethods()) { Parameter[] params = method.getParameters(); for (int i = 0; i < params.length; i++) { Advice.FieldValue fv = params[i].getAnnotation(Advice.FieldValue.class); if (fv == null || Utils.isBlank(fv.value())) { continue; } Patch.Field field = params[i].getAnnotation(Patch.Field.class); String logicalName = field != null && !Utils.isBlank(field.logicalName()) ? field.logicalName() : params[i].isNamePresent() ? params[i].getName() : fv.value(); out.put(logicalName, fv.value()); } } return Map.copyOf(out); }", "tokens": 191} {"id": 659267, "source": "method", "repo": "zed-0xff/ZombieBuddy", "text": "public List declaredMethods(Flag... flags) { Flag[] flags2 = new Flag[flags.length + 1]; System.arraycopy(flags, 0, flags2, 0, flags.length); flags2[flags.length] = Flag.DECLARED; return methods(flags2); }", "tokens": 74} {"id": 659373, "source": "method", "repo": "zed-0xff/ZombieBuddy", "text": "public AnnotationNode convert(AnnotationNode src, Object o, ClassContext ctx) throws Throwable { if (!(o instanceof ParameterNode node)) throw new IllegalArgumentException(\"Expected ParameterNode, got \" + o.getClass().getName()); var els = AnnElements.fromValues(src.values); var names = els.getListStr(\"value\"); String name = null; if (Utils.isBlank(names)) { name = node.name; // fallback to parameter name if 'name' element is missing or empty } else if (names.size() == 1) { name = names.get(0); } else { Logger.warn(\"Invalid @Patch.Field annotation: exactly one field name must be specified in 'name' element\", src, names, ctx.className()); return null; } els.put(\"value\", name); if (els.get(\"readOnly\") == null) { els.put(\"readOnly\", Boolean.FALSE); // default to false for backward compatibility } return createNode( Advice.FieldValue.class, els ); }", "tokens": 222} {"id": 659413, "source": "method", "repo": "zed-0xff/ZombieBuddy", "text": "private static void renderCrossMark(ImDrawList drawList, float x, float y, int color, float size) { float thickness = Math.max(size / 5.0f, 1.0f); size -= thickness * 0.5f; x += thickness * 0.25f; y += thickness * 0.25f; drawList.pathClear(); drawList.pathLineTo(x, y); drawList.pathLineTo(x + size, y + size); drawList.pathStroke(color, 0, thickness); drawList.pathClear(); drawList.pathLineTo(x + size, y); drawList.pathLineTo(x, y + size); drawList.pathStroke(color, 0, thickness); }", "tokens": 171} {"id": 659520, "source": "method", "repo": "zed-0xff/ZombieBuddy", "text": "private static Thread luaOwnerThread() { KahluaThread kt = LuaManager.thread; if (kt == null) { return null; } ensureDebugOwnerThreadCache(); if (vh_debugOwnerThread == null) { return null; } return (Thread) vh_debugOwnerThread.get(kt); }", "tokens": 72} {"id": 659705, "source": "method", "repo": "zed-0xff/ZombieBuddy", "text": "private boolean probeMethod(AnnotationNode ann, String elemName, AnnElements els, boolean[] hasList) { Object raw = els.get(elemName); if (!(raw instanceof List values) || Utils.isBlank(values)) return false; hasList[0] = true; if (values.size() == 1) return false; TypeDescription td = AnnConverterBase.resolveHandleOwner(m_ctx, AnnElements.fromValues(ann.values)); if (td == null) td = m_ctx.getTarget(); if (td == null) { _logger.once.warn(\"cannot find patch target class for\", m_ctx.className()); return false; } var methods = td.getDeclaredMethods(); for (var m : values) { if (!(m instanceof String methodName)) continue; var r = methods.filter(named(methodName)); if (r.size() == 1) { ann.visit(elemName, List.of(methodName)); return true; } } return false; }", "tokens": 223} {"id": 659841, "source": "method", "repo": "zed-0xff/ZombieBuddy", "text": "static void m1(@Patch.Local(Patch.NAMEMAP_LOCAL_NAME) Map nameMap) { }", "tokens": 30} {"id": 659920, "source": "method", "repo": "zed-0xff/ZombieBuddy", "text": "void testRWFieldExplicitWritesBack() { FieldValueTarget t = new FieldValueTarget(); t.counter = 0; t.incrementExplicit(); assertEquals(1, t.counter); }", "tokens": 42} {"id": 659997, "source": "method", "repo": "zeljkoobrenovic/sokrates", "text": "void logReportLocation(File reportsFolder) { if (reportsFolder == null) { return; } File index = new File(reportsFolder, \"index.html\"); File dataZip = new File(new File(reportsFolder, \"data\"), \"data.zip\"); LOG.info(\"\"); if (index.exists()) { LOG.info(\"Done. Open the report: \" + index.toPath().toAbsolutePath().normalize().toUri()); } else if (dataZip.exists()) { LOG.info(\"Done. Analysis data stored in \" + dataZip.toPath().toAbsolutePath().normalize()); } }", "tokens": 123} {"id": 660005, "source": "method", "repo": "zeljkoobrenovic/sokrates", "text": "public Option getPostAnalysis() { return postAnalysis; }", "tokens": 13} {"id": 660007, "source": "method", "repo": "zeljkoobrenovic/sokrates", "text": "public Options getUpdateLandscapeOptions() { Options options = new Options(); options.addOption(analysisRoot); options.addOption(url); options.addOption(urls); options.addOption(depth); options.addOption(dataOnly); options.addOption(prune); options.addOption(postAnalysis); options.addOption(ai); options.addOption(aiPrompt); options.addOption(aiMaxRepos); options.addOption(aiForce); options.addOption(conventionsFile); options.addOption(confFile); options.addOption(recursive); options.addOption(setName); options.addOption(setDescription); options.addOption(setLogoLink); options.addOption(addLink); options.addOption(timeout); options.addOption(date); options.addOption(help); setName.setRequired(false); setDescription.setRequired(false); setLogoLink.setRequired(false); addLink.setRequired(false); addLink.setArgs(2); help.setArgs(0); return options; }", "tokens": 211} {"id": 660028, "source": "method", "repo": "zeljkoobrenovic/sokrates", "text": "/** The label of the link to the organization page (\"GitHub\", \"GitLab\"). */ public String getLinkLabel() { return linkLabel; }", "tokens": 31} {"id": 660050, "source": "method", "repo": "zeljkoobrenovic/sokrates", "text": "private File directory(Path tmp, String name) throws IOException { File directory = new File(tmp.toFile(), name); Files.createDirectories(directory.toPath()); return directory; }", "tokens": 39} {"id": 660114, "source": "method", "repo": "zeljkoobrenovic/sokrates", "text": "public List getPeopleFileDependencies180Days() { return peopleFileDependencies180Days; }", "tokens": 27} {"id": 660147, "source": "method", "repo": "zeljkoobrenovic/sokrates", "text": "private static Map weights(double... values) { Map weights = new LinkedHashMap<>(); for (int i = 0; i < KEYS.size(); i++) { weights.put(KEYS.get(i), values[i]); } return Collections.unmodifiableMap(weights); }", "tokens": 70} {"id": 660447, "source": "method", "repo": "zeljkoobrenovic/sokrates", "text": "void mostContributorsOrderUnchanged() { assertEquals( oldOrder(sample(), Comparator.comparingInt(o -> -changeCount(o)), (o1, o2) -> contributors(o2) - contributors(o1), false), newOrder(sample(), Comparator.comparingInt(this::contributors).reversed() .thenComparing(Comparator.comparingInt(this::changeCount).reversed()))); }", "tokens": 82} {"id": 660573, "source": "method", "repo": "zeljkoobrenovic/sokrates", "text": "private void addTableColumns() { TableColumn instanceColumn = new TableColumn<>(\"Instance\"); instanceColumn.setPrefWidth(400); instanceColumn.setCellValueFactory(p -> new SimpleStringProperty(p.getValue().getText())); TableColumn countColumn = new TableColumn<>(\"Count\"); countColumn.setCellFactory(new NumericBarCellFactory(p -> maxCountPerText, p -> totalCount)); countColumn.setMinWidth(120); countColumn.setMaxWidth(120); countColumn.setCellValueFactory(new Callback, ObservableValue>() { public ObservableValue call(TableColumn.CellDataFeatures p) { return new ReadOnlyObjectWrapper(p.getValue().getCount()); } }); table.getColumns().addAll(instanceColumn, countColumn); table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); }", "tokens": 207} {"id": 660585, "source": "method", "repo": "zeljkoobrenovic/sokrates", "text": "private ObjectMapper getObjectMapper() { return configuredMapper(); }", "tokens": 12} {"id": 660762, "source": "method", "repo": "zeljkoobrenovic/sokrates", "text": "public int getAgeInDays() { return ageInDays; }", "tokens": 15} {"id": 660922, "source": "method", "repo": "zerodha/javakiteconnect", "text": "/** Place a mutualfunds sip. @param tradingsymbol Tradingsymbol (ISIN) of the fund. @param frequency weekly, monthly, or quarterly. @param amount Amount worth of units to purchase. It should be equal to or greated than minimum_additional_purchase_amount and in multiple of purchase_amount_multiplier in the instrument master. @param installmentDay If Frequency is monthly, the day of the month (1, 5, 10, 15, 20, 25) to trigger the order on. @param instalments Number of instalments to trigger. If set to -1, instalments are triggered at fixed intervals until the SIP is cancelled. @param initialAmount Amount worth of units to purchase before the SIP starts. Should be equal to or greater than minimum_purchase_amount and in multiple of purchase_amount_multiplier. This is only considered if there have been no prior investments in the target fund. @return MFSIP object which contains sip id and order id. @throws KiteException is thrown for all Kite trade related errors. @throws IOException is thrown when there is connection related error. */ public MFSIP placeMFSIP(String tradingsymbol, String frequency, int installmentDay, int instalments, int initialAmount, double amount) throws KiteException, IOException, JSONException { Map params = new HashMap(); params.put(\"tradingsymbol\", tradingsymbol); params.put(\"frequency\", frequency); params.put(\"instalment_day\", installmentDay); params.put(\"instalments\", instalments); params.put(\"initial_amount\", initialAmount); params.put(\"amount\", amount); MFSIP MFSIP = new MFSIP(); JSONObject response = kiteRequestHandler.postRequest(routes.get(\"mutualfunds.sips.place\"),params, apiKey, accessToken); MFSIP.orderId = response.getJSONObject(\"data\").getString(\"order_id\"); MFSIP.sipId = response.getJSONObject(\"data\").getString(\"sip_id\"); return MFSIP; }", "tokens": 463} {"id": 660946, "source": "method", "repo": "zerodha/javakiteconnect", "text": "/** Creates a GET request. @param url is the endpoint to which request has to be done. @param apiKey is the api key of the Kite Connect app. @param accessToken is the access token obtained after successful login process. @param commonKey is the key that has to be sent in query param for quote calls. @param values is the values that has to be sent in query param like 265, 256265, NSE:INFY. */ public Request createGetRequest(String url, String commonKey, String[] values, String apiKey, String accessToken) { HttpUrl.Builder httpBuilder = HttpUrl.parse(url).newBuilder(); for(int i = 0; i < values.length; i++) { httpBuilder.addQueryParameter(commonKey, values[i]); } return new Request.Builder().url(httpBuilder.build()).header(\"User-Agent\", USER_AGENT).header(\"X-Kite-Version\", \"3\").header(\"Authorization\", \"token \"+apiKey+\":\"+accessToken).build(); }", "tokens": 227} {"id": 661012, "source": "method", "repo": "zerodha/javakiteconnect", "text": "public double getOpenInterestDayHigh() { return oiDayHigh; }", "tokens": 17} {"id": 661055, "source": "method", "repo": "zerodha/javakiteconnect", "text": "/** Creates url for websocket connection. */ private void createUrl(String accessToken, String apiKey){ wsuri = new Routes().getWsuri().replace(\":access_token\", accessToken).replace(\":api_key\", apiKey); }", "tokens": 52} {"id": 661372, "source": "method", "repo": "zfdang/zsmth-android", "text": "public Board getCurrentPath() { if (mFavoritePaths.size() > 0) { return this.mFavoritePaths.get(this.mFavoritePaths.size() - 1); } else { return null; } }", "tokens": 49} {"id": 661402, "source": "method", "repo": "zfdang/zsmth-android", "text": "protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); SwipeBackHelper.onCreate(this); setContentView(R.layout.activity_mail_content); mMailTitle = (TextView) findViewById(R.id.mail_content_title); // init post widget mPostAuthor = (TextView) findViewById(R.id.post_author); mPostIndex = (TextView) findViewById(R.id.post_index); mPostIndex.setVisibility(View.GONE); mPostPublishDate = (TextView) findViewById(R.id.post_publish_date); mViewGroup = (LinearLayout) findViewById(R.id.post_content_holder); mPostContent = (LinkConsumableTextView) findViewById(R.id.post_content); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); // Show the Up button in the action bar. ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } // load mMail content Bundle bundle = getIntent().getExtras(); mMail = (Mail) bundle.getParcelable(SMTHApplication.MAIL_OBJECT); loadMailContent(); }", "tokens": 251} {"id": 661580, "source": "method", "repo": "zfdang/zsmth-android", "text": "/** unzip zip file to dest folder */ public static void $unzip(String zipFilePath, String destPath) throws IOException { // check or create dest folder File destFile = new File(destPath); if (!destFile.exists()) { destFile.mkdirs(); } // start unzip ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(zipFilePath)); ZipEntry zipEntry; String zipEntryName; while ((zipEntry = zipInputStream.getNextEntry()) != null) { zipEntryName = zipEntry.getName(); if (zipEntry.isDirectory()) { File folder = new File(destPath + File.separator + zipEntryName); folder.mkdirs(); } else { File file = new File(destPath + File.separator + zipEntryName); if (file != null && !file.getParentFile().exists()) { file.getParentFile().mkdirs(); } file.createNewFile(); FileOutputStream out = new FileOutputStream(file); int len; byte[] buffer = new byte[1024]; while ((len = zipInputStream.read(buffer)) > 0) { out.write(buffer, 0, len); out.flush(); } out.close(); } } zipInputStream.close(); }", "tokens": 254} {"id": 661676, "source": "method", "repo": "zfdang/zsmth-android", "text": "public void addAttachFile(Attachment attach) { if (attachFiles == null) { attachFiles = new ArrayList<>(); } if (attach != null) { attachFiles.add(attach); } }", "tokens": 42} {"id": 661701, "source": "method", "repo": "zfdang/zsmth-android", "text": "public void setLikes(String likes) { this.likes = likes; }", "tokens": 21} {"id": 661755, "source": "method", "repo": "zfdang/zsmth-android", "text": "public int getFace_width() { return face_width; }", "tokens": 15} {"id": 661765, "source": "method", "repo": "zfdang/zsmth-android", "text": "public boolean is_register() { return is_register; }", "tokens": 14} {"id": 661949, "source": "method", "repo": "zfdang/zsmth-android", "text": "/** Called when the child view is no longer being actively dragged. The fling velocity is also supplied, if relevant. The velocity values may be clamped to system minimums or maximums.

Calling code may decide to fling or otherwise release the view to let it settle into place. It should do so using {@link #settleCapturedViewAt(int, int)} or {@link #flingCapturedView(int, int, int, int)}. If the Callback invokes one of these methods, the ViewDragHelper will enter {@link #STATE_SETTLING} and the view capture will not fully end until it comes to a complete stop. If neither of these methods is invoked before onViewReleased returns, the view will stop in place and the ViewDragHelper will return to {@link #STATE_IDLE}.

@param releasedChild The captured child view now being released @param xvel X velocity of the pointer as it left the screen in pixels per second. @param yvel Y velocity of the pointer as it left the screen in pixels per second. */ public void onViewReleased(View releasedChild, float xvel, float yvel) { }", "tokens": 248} {"id": 662076, "source": "method", "repo": "zfile-dev/zfile", "text": "public static Class getGenericType(Field field) { ParameterizedType listType = (ParameterizedType) field.getGenericType(); return (Class) listType.getActualTypeArguments()[0]; }", "tokens": 39} {"id": 662139, "source": "method", "repo": "zfile-dev/zfile", "text": "public Date getDateTo() { if (searchDate == null || searchDate.isEmpty()) { return null; } return DateUtil.endOfDay(searchDate.getLast()); }", "tokens": 38} {"id": 662167, "source": "method", "repo": "zfile-dev/zfile", "text": "public AjaxJson> list() { FileOperatorTypeEnum[] values = FileOperatorTypeEnum.values(); List permissionInfoResults = new java.util.ArrayList<>(values.length); for (FileOperatorTypeEnum value : values) { if (value.isDeprecated()) { continue; } PermissionInfoResult permissionInfoResult = new PermissionInfoResult(); permissionInfoResult.setName(value.getName()); permissionInfoResult.setValue(value.getValue()); permissionInfoResult.setTips(value.getTips()); permissionInfoResults.add(permissionInfoResult); } return AjaxJson.getSuccessData(permissionInfoResults); }", "tokens": 135} {"id": 662335, "source": "method", "repo": "zfile-dev/zfile", "text": "public String getAuthenticateEndPoint() { return \"login.partner.microsoftonline.cn\"; }", "tokens": 21} {"id": 662522, "source": "method", "repo": "zhouwg/kantv", "text": "/** @deprecated Use {@link CronetDataSource.Factory} instead. */ public CronetDataSource( CronetEngine cronetEngine, Executor executor, int connectTimeoutMs, int readTimeoutMs, boolean resetTimeoutOnRedirects, @Nullable RequestProperties defaultRequestProperties) { this( cronetEngine, executor, REQUEST_PRIORITY_MEDIUM, connectTimeoutMs, readTimeoutMs, resetTimeoutOnRedirects, /* handleSetCookieRequests= */ false, /* userAgent= */ null, defaultRequestProperties, /* contentTypePredicate= */ null, /* keepPostFor302Redirects */ false); }", "tokens": 126} {"id": 662571, "source": "method", "repo": "zhouwg/kantv", "text": "public int hashCode() { int result = 17; result = 31 * result + id.hashCode(); result = 31 * result + Arrays.hashCode(data); return result; }", "tokens": 43} {"id": 662704, "source": "method", "repo": "zhouwg/kantv", "text": "/** Returns whether there is data available for reading.

Note: If the stream has ended then a buffer with the end of stream flag can always be read from {@link #read}. Hence an ended stream is always ready. @param loadingFinished Whether no more samples will be written to the sample queue. When true, this method returns true if the sample queue is empty, because an empty sample queue means the end of stream has been reached. When false, this method returns false if the sample queue is empty. */ // See comments in setUpstreamFormat public synchronized boolean isReady(boolean loadingFinished) { if (!hasNextSample()) { return loadingFinished || isLastSampleQueued || (upstreamFormat != null && upstreamFormat != downstreamFormat); } if (sharedSampleMetadata.get(getReadIndex()).format != downstreamFormat) { // A format can be read. return true; } return mayReadSample(getRelativeIndex(readPosition)); }", "tokens": 195} {"id": 662738, "source": "method", "repo": "zhouwg/kantv", "text": "/** @param groupIndex The overriding track group index. @param tracks The overriding track indices within the track group. @param type The type that will be returned from {@link TrackSelection#getType()}. */ public SelectionOverride(int groupIndex, int[] tracks, int type) { this.groupIndex = groupIndex; this.tracks = Arrays.copyOf(tracks, tracks.length); this.length = tracks.length; this.type = type; Arrays.sort(this.tracks); }", "tokens": 107} {"id": 663161, "source": "method", "repo": "zhouwg/kantv", "text": "/** Returns the duration of the last chunk in the queue, in microseconds, or {@link C#TIME_UNSET} if the queue is empty or if the last chunk has an undefined start or end time. */ private long getLastChunkDurationUs(List queue) { if (queue.isEmpty()) { return C.TIME_UNSET; } MediaChunk lastChunk = Iterables.getLast(queue); return lastChunk.startTimeUs != C.TIME_UNSET && lastChunk.endTimeUs != C.TIME_UNSET ? lastChunk.endTimeUs - lastChunk.startTimeUs : C.TIME_UNSET; }", "tokens": 131} {"id": 663200, "source": "method", "repo": "zhouwg/kantv", "text": "private static String getPlaybackSuppressionReasonString( @PlaybackSuppressionReason int playbackSuppressionReason) { switch (playbackSuppressionReason) { case Player.PLAYBACK_SUPPRESSION_REASON_NONE: return \"NONE\"; case Player.PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS: return \"TRANSIENT_AUDIO_FOCUS_LOSS\"; default: return \"?\"; } }", "tokens": 82} {"id": 663363, "source": "method", "repo": "zhouwg/kantv", "text": "public SkinCompatViewGroup(Context context) { this(context, null); }", "tokens": 17} {"id": 663403, "source": "method", "repo": "zhp8341/flink-streaming-platform-web", "text": "public void close(Long id, String userName) { JobConfigDTO jobConfigDTO = jobConfigService.getJobConfigById(id); jobBaseServiceAO.checkClose(jobConfigDTO); jobConfigService.openOrClose(id, YN.N, userName); if (jobConfigDTO.getJobTypeEnum() == JobTypeEnum.SQL_BATCH) { batchJobRegister.deleteJob(id); } }", "tokens": 80} {"id": 663408, "source": "method", "repo": "zhp8341/flink-streaming-platform-web", "text": "public RestResult upsertSynConfig(String key, String val) { try { systemConfigService.addOrUpdateConfigByKey(key, val.trim()); } catch (BizException biz) { log.warn(\"upsertSynConfig is error \", biz); return RestResult.error(biz.getMessage()); } catch (Exception e) { log.error(\"upsertSynConfig is error\", e); return RestResult.error(e.getMessage()); } return RestResult.success(); }", "tokens": 104} {"id": 663419, "source": "method", "repo": "zhp8341/flink-streaming-platform-web", "text": "public String getUserName() { UserSession userSession = UserSessionUtil.userSession(getServletRequest()); if (userSession == null) { return \"\"; } return userSession.getName(); }", "tokens": 40} {"id": 663465, "source": "method", "repo": "zhp8341/flink-streaming-platform-web", "text": "public String getSavepointPathById(Long jobConfigId, Long id) { SavepointBackup savepointBackup = savepointBackupMapper.getSavepointBackupById(jobConfigId, id); if (savepointBackup != null) { return savepointBackup.getSavepointPath(); } return null; }", "tokens": 66} {"id": 663545, "source": "method", "repo": "zhp8341/flink-streaming-platform-web", "text": "public static String getUriCheckpoints(String appId) { return String.format(URI_CHECKPOINTS_JOB, appId); }", "tokens": 28} {"id": 663716, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "private static boolean isCurrent(Project project, GitCommitMessageService service) { synchronized (ACTIVE) { return ACTIVE.get(project) == service; } }", "tokens": 35} {"id": 663724, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "private static File tryResolveConfiguredPath(String path, String source) { if (path == null || path.trim().isEmpty()) { return null; } File dir = new File(path.trim()); if (isValidBridgeDir(dir)) { LOG.debug(\"[BridgeResolver] Using \" + source + \": \" + dir.getAbsolutePath()); return dir; } LOG.warn(\"[BridgeResolver] \" + source + \" points to invalid directory: \" + dir.getAbsolutePath()); return null; }", "tokens": 103} {"id": 663808, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "public boolean handle(String type, String content) { if (\"enhance_prompt\".equals(type)) { handleEnhancePrompt(content); return true; } return false; }", "tokens": 41} {"id": 663928, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "public void setMode(String mode) { this.currentMode.set(mode); refreshDisplay(null); }", "tokens": 25} {"id": 664058, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "private static long fileMtime(Path path) { try { if (path != null && Files.isRegularFile(path)) { return Files.getLastModifiedTime(path).toMillis(); } } catch (IOException ignored) { } return 0L; }", "tokens": 53} {"id": 664085, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "private static JsonObject toWindow(String label, int defaultHours, JsonObject source, String payloadSource, long now) { JsonObject window = new JsonObject(); window.addProperty(\"windowLabel\", label); int durationMinutes = readWindowDurationMinutes(source); window.addProperty(\"windowHours\", durationMinutes > 0 ? Math.max(1, durationMinutes / 60) : defaultHours); Double usedPercent = readDoubleNullable(source, \"used_percent\"); Double remainingPercent = usedPercent == null ? null : Math.max(0.0, Math.min(100.0, 100.0 - usedPercent)); if (usedPercent != null) { window.addProperty(\"usedPercent\", usedPercent); } else { window.add(\"usedPercent\", JsonNull.INSTANCE); } if (remainingPercent != null) { window.addProperty(\"remainingPercent\", remainingPercent); } else { window.add(\"remainingPercent\", JsonNull.INSTANCE); } Long resetsAtMs = readEpochMillisNullable(source, \"reset_at\", \"resets_at\"); if (resetsAtMs != null) { window.addProperty(\"resetsAt\", resetsAtMs); } else { window.add(\"resetsAt\", JsonNull.INSTANCE); } window.addProperty(\"usedTokens\", 0); window.add(\"limitTokens\", JsonNull.INSTANCE); window.add(\"remainingTokens\", JsonNull.INSTANCE); window.add(\"usedCost\", JsonNull.INSTANCE); window.addProperty(\"sessionCount\", 0); window.addProperty(\"lastUpdated\", now); window.addProperty(\"source\", payloadSource); return window; }", "tokens": 344} {"id": 664086, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "public GitCommitMessageService(@Nullable Project project) { this.project = project; this.settingsService = new CodemossSettingsService(); this.client = new CommitAIClient(project); this.diffProvider = new CommitDiffProvider(project, LOG); this.promptBuilder = new CommitPromptBuilder(settingsService, project); }", "tokens": 71} {"id": 664154, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "public void setSlashCommands(List slashCommands) { this.slashCommands = new ArrayList<>(slashCommands); }", "tokens": 27} {"id": 664196, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "/** Set whether visual system notifications should only be shown when the IDE is not focused. @param enabled whether to enable */ public void setSystemNotificationOnlyWhenUnfocused(boolean enabled) throws IOException { JsonObject config = readConfig(); config.addProperty(\"systemNotificationOnlyWhenUnfocused\", enabled); writeConfig(config); LOG.info(\"[CodemossSettings] Set system notification only when unfocused: \" + enabled); }", "tokens": 88} {"id": 664228, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "/** Create CLI login provider object with internationalized name and description @param isActive whether this provider is currently active @return JsonObject representing the CLI login provider */ private JsonObject createCliLoginProviderObject(boolean isActive) { JsonObject cliLoginProvider = new JsonObject(); cliLoginProvider.addProperty(\"id\", CLI_LOGIN_PROVIDER_ID); cliLoginProvider.addProperty(\"name\", ClaudeCodeGuiBundle.message(\"provider.cliLogin.name\")); cliLoginProvider.addProperty(\"isActive\", isActive); cliLoginProvider.addProperty(\"isCliLoginProvider\", true); return cliLoginProvider; }", "tokens": 121} {"id": 664234, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "public TabSessionState copy() { TabSessionState copy = new TabSessionState(); copy.projectPath = this.projectPath; copy.provider = this.provider; copy.sessionId = this.sessionId; copy.cwd = this.cwd; copy.model = this.model; copy.permissionMode = this.permissionMode; copy.reasoningEffort = this.reasoningEffort; return copy; }", "tokens": 79} {"id": 664258, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "/** Attach the hook to the window's current browser client, retrying briefly while the CEF browser is still initializing. Safe to call on every browser (re)bind: each CefClient gets at most one hook. */ public static void installForWindow(ClaudeChatWindow window) { installForWindow(window, 0); }", "tokens": 72} {"id": 664378, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "public KeyboardShortcut getKeyboardShortcut(String actionId) { return null; }", "tokens": 18} {"id": 664416, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "public void updatesImportedAliasWithValidJson() throws Exception { Path root = temporaryFolder.newFolder(\"imported-alias-root\").toPath(); String slug = createLegacyImportedPet(root, \"alias-pet\", \"Alias Pet\"); CodexPetHandler.setImportedPetAlias(root, slug, \"Desk Pet\"); Path metadata = root.resolve(slug).resolve(\"pet.json\"); JsonObject parsed = JsonParser.parseString(Files.readString(metadata, StandardCharsets.UTF_8)) .getAsJsonObject(); assertEquals(\"Desk Pet\", parsed.get(\"alias\").getAsString()); try (java.util.stream.Stream files = Files.list(metadata.getParent())) { assertFalse(files.anyMatch(path -> path.getFileName().toString().startsWith(\".pet-metadata-\"))); } }", "tokens": 172} {"id": 664639, "source": "method", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "/** Verifies the optional browser-closed API is discovered on newer runtimes. */ public void findsOptionalBrowserClosedApiWhenPresent() { Assert.assertTrue(JBCefBrowserFactory.findIsClosedMethod(BrowserWithClosedApi.class).isPresent()); }", "tokens": 55} {"id": 664848, "source": "method", "repo": "zmilla93/slimtrade", "text": "/** These values need to be initialized after the setup has run, so that they are based on the correct game window locations. */ public boolean initMessageAndMenuBarLocations() { if (hasInitLocations) return false; applyDefaultMessageLocation(); applyDefaultMenuBarLocation(); hasInitLocations = true; return true; }", "tokens": 65} {"id": 664898, "source": "method", "repo": "zmilla93/slimtrade", "text": "public static void applyAnchorPoint(Window window, Point point, Anchor anchor) { Point adjustedPoint = new Point(point.x, point.y); if (anchor == Anchor.TOP_RIGHT || anchor == Anchor.BOTTOM_RIGHT) adjustedPoint.x -= window.getWidth(); if (anchor == Anchor.BOTTOM_LEFT || anchor == Anchor.BOTTOM_RIGHT) adjustedPoint.y -= window.getHeight(); window.setLocation(adjustedPoint); }", "tokens": 101} {"id": 664930, "source": "method", "repo": "zmilla93/slimtrade", "text": "public String getNewName() { return newNameInput.getText(); }", "tokens": 16} {"id": 664939, "source": "method", "repo": "zmilla93/slimtrade", "text": "public void showDeletePanel() { ChatScannerCustomizerPanel selectedPanel = entryList.getSelectedValue(); if (selectedPanel == null) return; cardLayout.show(cardPanel, DELETE_PANEL_TITLE); entryList.clearSelection(); getRootPane().requestFocus(); deletePanel.setCurrentName(selectedPanel.getTitle()); }", "tokens": 68} {"id": 665358, "source": "method", "repo": "zmilla93/slimtrade", "text": "public void setData(StashTabData data) { nameInput.setText(data.stashTabName); matchTypeCombo.setSelectedItem(data.matchType); stashTypeCombo.setSelectedItem(data.stashTabType); colorCombo.setSelectedIndex(data.stashColorIndex); }", "tokens": 59} {"id": 665415, "source": "method", "repo": "zmilla93/slimtrade", "text": "public void updateSizeAndLocation() { boolean isQuadTab = isQuadTab(); Dimension cellSize = isQuadTab ? POEWindow.getPoe1StashCellSizeQuad() : POEWindow.getPoe1StashCellSize(); float cellCount = isQuadTab ? 24f : 12f; int xOffset = Math.round(POEWindow.getPoe1StashBonds().width * ((tradeOffer.stashTabX - 1) / cellCount)); int yOffset = Math.round(POEWindow.getPoe1StashBonds().height * ((tradeOffer.stashTabY - 1) / cellCount)); int x = POEWindow.getPoe1StashBonds().x + xOffset; int y = POEWindow.getPoe1StashBonds().y + yOffset; setLocation(x, y); setSize(cellSize); }", "tokens": 200} {"id": 665472, "source": "method", "repo": "zmilla93/slimtrade", "text": "public static FileMonitor startNewMonitor(Path path) { return new FileMonitor(path).start(); }", "tokens": 24} {"id": 665498, "source": "method", "repo": "zmilla93/slimtrade", "text": "public boolean colorBlind() { if (inferColorBind) return SaveManager.settingsSaveFile.data.colorBlindMode; return colorBlind; }", "tokens": 30} {"id": 665506, "source": "method", "repo": "zmilla93/slimtrade", "text": "public ColorCheckbox() { this.background = UIManager.getColor(\"TextField.background\"); this.checkmarkColor = UIManager.getColor(\"TextField.background\"); }", "tokens": 33} {"id": 665574, "source": "method", "repo": "zmilla93/slimtrade", "text": "public boolean equals(Object obj) { if (!(obj instanceof AppVersion)) return false; AppVersion other = (AppVersion) obj; return compareTo(other) == 0; }", "tokens": 38} {"id": 665580, "source": "method", "repo": "zmilla93/slimtrade", "text": "public void basicTest() { // Ensure the default key value for enter didn't change assertEquals(28, NativeKeyEvent.VC_ENTER); }", "tokens": 32} {"id": 665680, "source": "method", "repo": "znsio/teswiz", "text": "private static boolean isIOSAppUpload(String appPath) { if (null == appPath) { return false; } String normalizedPath = appPath.toLowerCase(); return normalizedPath.endsWith(\".ipa\") || normalizedPath.endsWith(\".zip\"); }", "tokens": 55} {"id": 665694, "source": "method", "repo": "znsio/teswiz", "text": "static String getPathForFileInLogDir(String fullFilePath) { LOGGER.info(String.format(\"\\tgetPathForFileInLogDir: fullFilePath: %s\", fullFilePath)); Path path = Paths.get(fullFilePath); String fileName = path.getFileName().toString(); String newFileName = new File( Setup.getFromConfigs(LOG_DIR) + File.separator + fileName).getAbsolutePath(); LOGGER.info(String.format(\"\\tNew file available here: %s\", newFileName)); return newFileName; }", "tokens": 109} {"id": 665868, "source": "method", "repo": "znsio/teswiz", "text": "private static String getBranchNameUsingGitCommand() { String[] getBranchNameCommand = new String[]{\"git rev-parse --abbrev-ref HEAD\"}; CommandLineResponse response = CommandLineExecutor.execCommand(getBranchNameCommand); String branchName = response.getStdOut(); LOGGER.info(String.format(\"\\tBranch name from git command: '%s': '%s'\", Arrays.toString(getBranchNameCommand), branchName)); return branchName; }", "tokens": 90} {"id": 665954, "source": "method", "repo": "znsio/teswiz", "text": "public static HttpResponse deleteHttpRequest(String completeURLPath){ LOGGER.info(\"Processing delete call\"); return getUnirestObj().delete(completeURLPath).asJson(); }", "tokens": 41} {"id": 665975, "source": "method", "repo": "znsio/teswiz", "text": "public void run() { currentThread = Thread.currentThread(); currentThread.setName(threadName); while(running) { // Continue running as long as the flag is true try { String message = \"HeartBeat: '%s', API is '%s'. Current count: '%d'\"; String status = \"up\"; if(!checkHeartBeat()) { status = \"down\"; } heartBeatCounter++; message = String.format(message, this.threadName, status, heartBeatCounter); ReportPortalLogger.logInfoMessage(message); Thread.sleep(this.pollingDuration * 1000); // Sleep for x seconds } catch(InterruptedException e) { // do nothing } } }", "tokens": 152} {"id": 666409, "source": "method", "repo": "znsio/teswiz", "text": "public void iDragTheCircleObjectToDropTarget() { new VodqaBL().dragAndDropElement(); }", "tokens": 26} {"id": 666482, "source": "method", "repo": "zpeanut/hydrogen", "text": "public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Range)) return false; Range range = (Range) o; return Objects.equals(version, range.version) && op == range.op; }", "tokens": 54} {"id": 666645, "source": "method", "repo": "zpeanut/hydrogen", "text": "public GuiAltLogin(GuiScreen parent) { this.parent = parent; }", "tokens": 17} {"id": 666683, "source": "method", "repo": "zpeanut/hydrogen", "text": "public EventPacket(Packet packet) { this.packet = packet; }", "tokens": 16} {"id": 666811, "source": "method", "repo": "zpeanut/hydrogen", "text": "public int getNextStepDistance() { return nextStepDistance; }", "tokens": 14} {"id": 667242, "source": "method", "repo": "Zy-Fang1102/E-Stega", "text": "public void setNoticeTitle(String noticeTitle) { this.noticeTitle = noticeTitle; }", "tokens": 21} {"id": 667244, "source": "method", "repo": "Zy-Fang1102/E-Stega", "text": "public void setCostTime(Long costTime) { this.costTime = costTime; }", "tokens": 21} {"id": 667557, "source": "commit", "repo": "3arthqu4ke/3arthh4ck", "text": "[1.8.1] Extrapolation fix, closes #161", "tokens": 19} {"id": 667623, "source": "commit", "repo": "3arthqu4ke/3arthh4ck", "text": "[1.7.11] Decreased Logger complexity", "tokens": 14} {"id": 667757, "source": "commit", "repo": "3arthqu4ke/headlessmc", "text": "feat(specifics): fetch latest Github Release of specifics mods (#379) * feat(hmc-specifics): fetch latest Github Release of specifics mods * test(specifics): Added test and cleaned up a bit * fix(specifics): add deprecated legacy method for VersionSpecificModRepository * test: Disable GitHub API test * test(integration): Fix SecurityManager", "tokens": 79} {"id": 667771, "source": "commit", "repo": "3arthqu4ke/headlessmc", "text": "build(deps): Updated jetbrains annotations to 26.0.2-1", "tokens": 19} {"id": 667950, "source": "commit", "repo": "3arthqu4ke/headlessmc", "text": "Drastically reduced docker image size, now using eclipse-temurin on Ubuntu 24", "tokens": 22} {"id": 668184, "source": "commit", "repo": "3arthqu4ke/headlessmc", "text": "[1.0.6]: Fixed java regex", "tokens": 11} {"id": 668349, "source": "commit", "repo": "721806280/lark-notice-plugin", "text": "feat: improve configuration UI i18n and notifier page behavior Internationalize major config pages with en/zh_CN resource bundles. Add i18n for notifier/dispatcher runtime messages used in validation and logs. Fix and improve notifier-related frontend scripts for multi-block raw toggle and validation rendering.", "tokens": 66} {"id": 668400, "source": "commit", "repo": "721806280/lark-notice-plugin", "text": ":bookmark: version label. 0.0.3-SNAPSHOT", "tokens": 15} {"id": 668901, "source": "commit", "repo": "839128/bus", "text": ":passport_control: Update Image BaseEntity and Result authorization handling for length and array", "tokens": 18} {"id": 668969, "source": "commit", "repo": "839128/bus", "text": ":recycle: Integrate contributor changes for README, base, extra, BaseEntity, Entity, OAuth2", "tokens": 21} {"id": 669075, "source": "commit", "repo": "839128/bus", "text": ":recycle: Refine project travis and cron implementation for cron and DskipTests", "tokens": 18} {"id": 669082, "source": "commit", "repo": "839128/bus", "text": ":bookmark: 3.0.8", "tokens": 10} {"id": 669129, "source": "commit", "repo": "aaberg/sql2o", "text": "Commented out a test that doesn't run on java 11", "tokens": 16} {"id": 669834, "source": "commit", "repo": "abdelrahmanbayoumi/azkar-app", "text": "resolve #40 Add one hour to time", "tokens": 10} {"id": 669873, "source": "commit", "repo": "abdelrahmanbayoumi/azkar-app", "text": "Localization for `PrayerTimes` & `AzkarPeriods`", "tokens": 14} {"id": 670470, "source": "commit", "repo": "abtsoftware/scichart.android.examples", "text": "SciChart.Android v4.8.1.4936", "tokens": 16} {"id": 670474, "source": "commit", "repo": "abtsoftware/scichart.android.examples", "text": "SciChart.Android v4.8.0.4928", "tokens": 16} {"id": 670481, "source": "commit", "repo": "abtsoftware/scichart.android.examples", "text": "SciChart.Android v4.7.0-nightly.4907", "tokens": 19} {"id": 670543, "source": "commit", "repo": "abtsoftware/scichart.android.examples", "text": "SciChart version 4.0.0.4469", "tokens": 15} {"id": 670578, "source": "commit", "repo": "abtsoftware/scichart.android.examples", "text": "SciChart version 2.5.0.2547", "tokens": 15} {"id": 670602, "source": "commit", "repo": "abtsoftware/scichart.android.examples", "text": "SciChart version 2.1.0.2222", "tokens": 15} {"id": 670702, "source": "commit", "repo": "adafruit/bluefruit_le_connect_android_v2", "text": "Fix memory leaks: null out views when fragments are being pushed to the backstack", "tokens": 17} {"id": 670729, "source": "commit", "repo": "adafruit/bluefruit_le_connect_android_v2", "text": "ImageTransfer: add permission request for camera and external read, fix resize height calculation", "tokens": 17} {"id": 670774, "source": "commit", "repo": "adafruit/bluefruit_le_connect_android_v2", "text": "Scanner: Fix crash when showing Advertising Data on Android Oreo", "tokens": 14} {"id": 670817, "source": "commit", "repo": "adelf/idea-php-dotenv-plugin", "text": "IJPL-221307 add missing module dependencies for JDK25 compilation JDK25 javac processes type annotations (@NotNull/@Nullable) on ALL methods of a loaded class, not just the ones being called. This means that if module M uses class C, and C has a method whose signature references type T from dependency D, then M needs D on its classpath \u2014 even if M never calls that method and jdeps doesn't show a direct reference. Example error: Cannot attach type annotations @org.jetbrains.annotations.NotNull to com.intellij.openapi.ui.DialogWrapper.showAndGetOk: class file for com.intellij.openapi.util.AsyncResult not found GitOrigin-RevId: 4871d18cb2c05c658cb0dfcabd74a8452cf7f8ee", "tokens": 183} {"id": 670838, "source": "commit", "repo": "adelf/idea-php-dotenv-plugin", "text": "[dotenv] add missing dependency in intellij.dotenv.kotlin (IDEA-372976) KotlinPsiHelper from that module uses JavaEnvironmentClasses class from intellij.dotenv.java module. Since intellij.dotenv.kotlin and intellij.dotenv.java are registered as content modules, their classes are loaded by different classloaders so an explicit dependency should be added. The problem was found by IdeaUltimatePluginModuleDependenciesTest (IJPL-171921). GitOrigin-RevId: 50df444cf720902dbd1cb6feb2a96ce34505e284", "tokens": 150} {"id": 670866, "source": "commit", "repo": "adelf/idea-php-dotenv-plugin", "text": "bazel - move ultimate-specific iml files to the corresponding project GitOrigin-RevId: 587ec798554b139319dad7266eef242be955101b", "tokens": 58} {"id": 670893, "source": "commit", "repo": "adelf/idea-php-dotenv-plugin", "text": "build.gradle.kts and 213 fixes", "tokens": 13} {"id": 671963, "source": "commit", "repo": "adyen/adyen-java-api-library", "text": "[payment] Automated update from Adyen/adyen-openapi@aa5556e", "tokens": 21} {"id": 672021, "source": "commit", "repo": "adyen/adyen-java-api-library", "text": "Correct OneOf deserialization (#1543) * Generate stricter deserialization * Check if type attribute exists", "tokens": 22} {"id": 672108, "source": "commit", "repo": "adyen/adyen-java-api-library", "text": "Remove capital old models (#1102)", "tokens": 12} {"id": 672131, "source": "commit", "repo": "adyen/adyen-java-api-library", "text": "PW-8005: Fix Javadoc issues (#957)", "tokens": 17} {"id": 672420, "source": "commit", "repo": "ageerle/ruoyi-ai", "text": "chore: Rename METADATA_DOC_ID_KEY", "tokens": 12} {"id": 672541, "source": "commit", "repo": "agentdid127/resourcepackconverter", "text": "Add SlidersCreator for packs < 1.19.4", "tokens": 16} {"id": 672856, "source": "commit", "repo": "agonyforge/arbitrader", "text": "Fix bug where the last char of groupId was missing", "tokens": 11} {"id": 673281, "source": "commit", "repo": "agricraft/agricraft", "text": "Fix plant products to be in min,max range This changes which toStack method gets called by getHarvestProducts. When the Random parameter was missing, AgriStack.toStack(Class) was being called on the parent, and not AgriProduct.toStack(Class, Random). The harvest amount randomization from min to max occurs in the latter.", "tokens": 75} {"id": 673588, "source": "commit", "repo": "agricraft/agricraft", "text": "Update fr_FR.lang Added sprinkler and tooltips localization", "tokens": 14} {"id": 673670, "source": "commit", "repo": "aidenlab/juicebox", "text": "change custom chromosome buffer, start adding gui options", "tokens": 10} {"id": 673959, "source": "commit", "repo": "aidenlab/juicebox", "text": "Resolved #164 At least for 2D annotations. One bug still left: if an annotation is removed from the list, and then immediately re-added, it stays unchecked. (It does however reload properly i.e. new changes pulled).", "tokens": 54} {"id": 674170, "source": "commit", "repo": "aikar/commands", "text": "Fixed typo Sorry, it just really bugged me.", "tokens": 13} {"id": 674244, "source": "commit", "repo": "aikar/commands", "text": "Add russian translation (#141)", "tokens": 12} {"id": 674606, "source": "commit", "repo": "aimacode/aima-java", "text": "Add DT-Agent to AIMA3e Add BeliefState for DTAgent Add DTAgent to AIMA3e Update DTAgent.java Add DTAgent to AIMA3e Add DTAgent to AIMA3e Add DTAgent to AIMA3e Add DTAgent to AIMA3e Add DTAgent to AIMA3e Add DTAgent to AIMA3e", "tokens": 89} {"id": 674994, "source": "commit", "repo": "aionnetwork/aion", "text": "AKI-288 FVM state return FvmDataword instead of long in the block difficulty", "tokens": 22} {"id": 675010, "source": "commit", "repo": "aionnetwork/aion", "text": "1. Proccessing blockstore revert after found the best block and handle the exeception 2. Refactoring blockstore and added database corruption handle case including testcase 3. Adding totaldifficulty info into the log 4. fixed small issues in Aionhub 5. refactoring blockstore and added database corruption handle case in cluding testcase", "tokens": 73} {"id": 675080, "source": "commit", "repo": "aionnetwork/aion", "text": "Correction to version test - The unknown version test can fail on certain of the random inputs because it is casting what is effectively a short to a byte, and the short will get truncated on large inputs. Two of these truncated results will be 0 and 1, which are the two numbers this test is expressly trying to avoid, because they are supposed to fail. - The random range is now bound above by Byte.MAX_VALUE so that this truncating does not occur anymore.", "tokens": 101} {"id": 675515, "source": "commit", "repo": "akto-api-security/akto", "text": "ignore internal ip actors (#4475) * ignore internal ip actors * put in try catch", "tokens": 23} {"id": 675878, "source": "commit", "repo": "Alanosy/exam-platform", "text": "update xxl-job 2.3.0 => 2.3.1", "tokens": 20} {"id": 676172, "source": "commit", "repo": "aleixrodriala/newtube", "text": "lifecycle libs fix; set cronet as default", "tokens": 11} {"id": 677250, "source": "commit", "repo": "aliyun/aliyun-log-android-sdk", "text": "feat: add multi-thread safe for Resoruce class", "tokens": 15} {"id": 678309, "source": "commit", "repo": "alturkovic/distributed-lock", "text": "It seems like a better idea to arrange version releases from newer to older", "tokens": 16} {"id": 678521, "source": "commit", "repo": "amithkoujalgi/ollama4j", "text": "added `getLibraryModelDetails` API and `pullModel` API with `LibraryModelTag`", "tokens": 21} {"id": 678834, "source": "commit", "repo": "AMPLIFIER-sp-z-o-o/ampli-sync", "text": "sqlite-sync provider added, opening db on app startup", "tokens": 13} {"id": 679167, "source": "commit", "repo": "amplitude/amplitude-android", "text": "cleaned up readme, added idempotent enableForegroundTracking", "tokens": 11} {"id": 679199, "source": "commit", "repo": "amplitude/amplitude-android", "text": "Don't use reflection to find api package name.", "tokens": 12} {"id": 679517, "source": "commit", "repo": "andrewauclair/moderndocking", "text": "1.1.2 (#320)", "tokens": 12} {"id": 679541, "source": "commit", "repo": "andrewauclair/moderndocking", "text": "Had to create a new key because the old one expired. No longer going to store the key id directly in the github workflow. Not sure why I did that in the first place (setting this up was a real struggle). (#251)", "tokens": 56} {"id": 679572, "source": "commit", "repo": "andrewauclair/moderndocking", "text": "Making an official 0.11 release so that we can make some API changes for a 0.12-SNAPSHOT release. (#177)", "tokens": 34} {"id": 679606, "source": "commit", "repo": "andrewauclair/moderndocking", "text": "Issue #110 DockableMenuItem will now be set to invisible if the dockable doesn't exist.", "tokens": 22} {"id": 679619, "source": "commit", "repo": "andrewauclair/moderndocking", "text": "Adding a new getPinningStyle to Dockable in order to separate the normal docking style and pinning style.", "tokens": 22} {"id": 679676, "source": "commit", "repo": "andrewauclair/moderndocking", "text": "Issue #94 Improving how pinning toolbars are configured. The application can now determine which toolbars are available.", "tokens": 25} {"id": 679703, "source": "commit", "repo": "andrewauclair/moderndocking", "text": "Issue #66 Split restoration finally works properly.", "tokens": 11} {"id": 679813, "source": "commit", "repo": "andrewauclair/moderndocking", "text": "New DockableNotFoundException. Moving to 0.0.2-SNAPSHOT. undock no longer throws an exception if the dockable is not docked. Undock just works better as a do it if not already done type of method.", "tokens": 49} {"id": 679867, "source": "commit", "repo": "andrewauclair/moderndocking", "text": "Switching to gradle to make this easier to setup.", "tokens": 12} {"id": 680067, "source": "commit", "repo": "anof-cyber/pycript", "text": "added burp api version, update gson and commons-lang3 version - updated code with new burp API version", "tokens": 24} {"id": 680853, "source": "commit", "repo": "apace100/origins-fabric", "text": "Fixed missing name in origin display screen not changing when cycling through layers An edge case that happens if the current origin layer and the origin layer prior to it has the EMPTY origin", "tokens": 36} {"id": 680920, "source": "commit", "repo": "apace100/origins-fabric", "text": "Updating to 1.18.2 (#517) * Bump library versions * Convert Tags to TagKeys * Bump mod version", "tokens": 30} {"id": 680969, "source": "commit", "repo": "apace100/origins-fabric", "text": "Update to 1.17 and using Apoli", "tokens": 13} {"id": 681141, "source": "commit", "repo": "apace100/origins-fabric", "text": "Re-added `in_block` player condition...", "tokens": 14} {"id": 681372, "source": "commit", "repo": "apollographql/federation-jvm", "text": "[build] migrate to Gradle (#177) * [build] migrate to Gradle Resolves https://github.com/apollographql/federation-jvm/issues/131 * generate sources/javadocs only for releases * conditionally build sources and javadocs Explicitly checking for SNAPSHOT version as extra properties are not available at java task configuration time.", "tokens": 72} {"id": 681626, "source": "commit", "repo": "apollographql/federation-jvm", "text": "_Entity bugfix when building multiple schemas `GraphQLSchema.newSchema().build()` *mutates* any object which contains a `GraphQLTypeReference`.", "tokens": 31} {"id": 681850, "source": "commit", "repo": "appiumtestdistribution/appiumtestdistribution", "text": "Added support to push app files to remote machine", "tokens": 10} {"id": 682158, "source": "commit", "repo": "apple/app-store-server-library-java", "text": "Update README.md Change typo in Maven dependency", "tokens": 10} {"id": 682184, "source": "commit", "repo": "archimatetool/archi", "text": "Add support for importing SVG images in Canvas DnD and Image Manager Dialog - And update help files", "tokens": 22} {"id": 682637, "source": "commit", "repo": "archimatetool/archi", "text": "Add default canExecute() implementation in EObjectFeatureCommand Most instances of EObjectFeatureCommand over-ride canExecute() with the same comparison of old value against new value. So put this as a default in EObjectFeatureCommand.", "tokens": 48} {"id": 682724, "source": "commit", "repo": "archy-x/aureliumskills", "text": "Relocate and create Configurate API wrapper (#296) - ConfigurationNode has been replaced with the ConfigNode wrapper class in api and api-bukkit - Configurate is no longer included in the api as a dependency", "tokens": 42} {"id": 682946, "source": "commit", "repo": "archy-x/aureliumskills", "text": "Add leaderboard menu option to auto-generation", "tokens": 10} {"id": 683037, "source": "commit", "repo": "archy-x/aureliumskills", "text": "Fix Replenish changing blocks in protected regions", "tokens": 11} {"id": 683655, "source": "commit", "repo": "arnaudroger/simpleflatmapper", "text": "#142 make all optional apart from asm", "tokens": 12} {"id": 683707, "source": "commit", "repo": "arnaudroger/simpleflatmapper", "text": "add primitive support for delayed getter and delayed setter", "tokens": 10} {"id": 684202, "source": "commit", "repo": "artipie/artipie", "text": "#382 - send continue response before actual response if expected", "tokens": 14} {"id": 684423, "source": "commit", "repo": "ashald/envfile", "text": "[GH-23] Remember most recently used files", "tokens": 12} {"id": 684640, "source": "commit", "repo": "askimed/nf-test", "text": "Allow to override `workflow` in `nextflow_workflow`", "tokens": 14} {"id": 684770, "source": "commit", "repo": "askimed/nf-test", "text": "Fix testcaes and fix nio extension", "tokens": 10} {"id": 684866, "source": "commit", "repo": "asmcup/runtime", "text": "Added pin rom to menu (#122)", "tokens": 12} {"id": 684874, "source": "commit", "repo": "asmcup/runtime", "text": "Changed member variables of FrontPanel explicitly protected. (#115)", "tokens": 16} {"id": 684888, "source": "commit", "repo": "asmcup/runtime", "text": "Add Test for accelerometer (#88) refs #82", "tokens": 15} {"id": 685159, "source": "commit", "repo": "aspose-cells/aspose.cells-for-java", "text": "Aspose.Cells for Java 21.11", "tokens": 12} {"id": 685755, "source": "commit", "repo": "aspose-words/aspose.words-for-java", "text": "Added the content as per the Standard Template.", "tokens": 10} {"id": 686010, "source": "commit", "repo": "assert-kth/depclean", "text": "build: fix all Maven build warnings - Fix Error Prone EqualsGetClass in six value classes by making them final and using instanceof pattern matching in equals - Fix Error Prone UndefinedEquals by typing ProjectContext multimaps as ListMultimap, which has well-defined equality semantics - Fix Error Prone NonApiType by exposing SortedSet instead of TreeSet in the DependencyAnalysisInfo API - Fix maven-plugin-plugin wrong-scope warning by moving plexus-xml (unused by depclean-core) to depclean-maven-plugin in provided scope, since Maven's core class realm exports Xpp3Dom to plugins - Fix unresolvable-link javadoc warnings by moving the DepCleanMojo reference links from @see tags into the class description", "tokens": 151} {"id": 686456, "source": "commit", "repo": "assert-kth/sorald", "text": "doc: add Sorald paper (#609)", "tokens": 12} {"id": 686458, "source": "commit", "repo": "assert-kth/sorald", "text": "doc: Fix typographical and grammatical errors in four processor READMEs (#596)", "tokens": 23} {"id": 686494, "source": "commit", "repo": "assert-kth/sorald", "text": "fix: Fix memory leak from accumulating compilation units across writes (#498) * Replace JAR sanity check with memory-constrained test * Clear CompilationUnitCollector after each write * Reduce segment size * Remove JAR sanity check This is covered by the memory-constrined test * Strengthen memory-constrained test", "tokens": 67} {"id": 686688, "source": "commit", "repo": "assert-kth/sorald", "text": "Improve (and fix in some cases) paths in tests", "tokens": 12} {"id": 686750, "source": "commit", "repo": "assert-kth/sorald", "text": "Try to update JDK. Can it be this easy?", "tokens": 12} {"id": 686756, "source": "commit", "repo": "assert-kth/sorald", "text": "Update Spoon to 7.5", "tokens": 10} {"id": 686882, "source": "commit", "repo": "astrazeneca-ngs/vardictjava", "text": "VCF updated to 4.3. specification version. MQ changed to Integer, AF field to A, BIAS contains 2 numbers.", "tokens": 33} {"id": 687195, "source": "commit", "repo": "astrelsky/ghidra-cpp-class-analyzer", "text": "Gracefully return null if the service is null If the plugin isn't activated yet, the analyzers will still try to check if they can analyze the program. But if the plugin isn't activated the service returned will be `null` and the crash will result in multiple annoying popups. This gracefully handles this, by propagating the null return value.", "tokens": 75} {"id": 687330, "source": "commit", "repo": "astrelsky/ghidra-cpp-class-analyzer", "text": "Fixed issue with retreiving the correct namespace after new demangler changes", "tokens": 18} {"id": 687334, "source": "commit", "repo": "astrelsky/ghidra-cpp-class-analyzer", "text": "Changed python scripts category and fixed VtableModel oversights", "tokens": 12} {"id": 687679, "source": "commit", "repo": "aterai/java-swing-tips", "text": "refactor: UIManager.put(Tree.repaintWholeRow, Boolean.TRUE) in, FocusListener out", "tokens": 23} {"id": 687695, "source": "commit", "repo": "aterai/java-swing-tips", "text": "refactor: change text color and noFocusBorder of Renderer", "tokens": 13} {"id": 687809, "source": "commit", "repo": "Athlaeos/ValhallaMMO", "text": "potential fix to perk rewards executing doubly", "tokens": 11} {"id": 687891, "source": "commit", "repo": "Athlaeos/ValhallaMMO", "text": "updated various modifiers to allow for more friendly text configuration", "tokens": 11} {"id": 688073, "source": "commit", "repo": "Athlaeos/ValhallaMMO", "text": "added nms to git (didnt realize it wasnt there at first) and some more small bug fixes", "tokens": 23} {"id": 688333, "source": "commit", "repo": "AugmentOS-Community/AugmentOS", "text": "docs(bstack): transparent help text \u2014 show internals for humans and AI agents Help text now explains: - What tables exist (hot vs cold, prod vs dev) and their actual names - Auto-selection logic (\u22645min \u2192 hot, >5min \u2192 cold/S3 with _row_type=1) - JSONExtract syntax with all common field names - Credential loading order (env vars \u2192 Doppler mentra-sre auto-load) - Health endpoint URLs per region - What each command does internally (which feature/table it queries) - When and how to fall back to raw SQL - Cluster IDs in the help output The goal: if the CLI has a bug or returns unexpected results, the reader (human or AI) can reason about what's happening and work around it.", "tokens": 177} {"id": 688436, "source": "commit", "repo": "AugmentOS-Community/AugmentOS", "text": "cleanup-fixes-timing-version-check", "tokens": 10} {"id": 688487, "source": "commit", "repo": "AugmentOS-Community/AugmentOS", "text": "improve tests typing, and excluded tests from build to prevent tests build errors for deplpoyment", "tokens": 20} {"id": 688846, "source": "commit", "repo": "AugmentOS-Community/SmartGlassesManager", "text": "only open GCP ASR/STT stream if we are receiving live audio stream, fix bugs with server restart on disconnect Former-commit-id: d4cbebb18d779d759b1f43b564d7f1c56aefc498 Former-commit-id: 1724acded554006a27c1422982099f1df8f1d886 Former-commit-id: 6b88b94aa4edfd593e8c0e1184b51ff51d5aec27", "tokens": 155} {"id": 688969, "source": "commit", "repo": "AugmentOS-Community/SmartGlassesManager", "text": "Project import generated by Copybara. GitOrigin-RevId: f9a66589eaf652bb93f8e37ed9e4da26e59ef214 Former-commit-id: c828392681bc343a90e188c5ad5f295bada1eefb Former-commit-id: ca01d9ab2f5202bf9660f1f4fe4b9e56c973254a Former-commit-id: 9d500155e585665af6376f34ddc224c36f3a90e7", "tokens": 177} {"id": 689147, "source": "commit", "repo": "auth0/auth0-java", "text": "[SDK-4736] support backchannel logout property on Client (#587)", "tokens": 21} {"id": 689227, "source": "commit", "repo": "auth0/auth0-java", "text": "Update UsersEntity.java (#407)", "tokens": 11} {"id": 689507, "source": "commit", "repo": "auth0/auth0-java", "text": "add UrlMatcher class and use it on tests", "tokens": 11} {"id": 689567, "source": "commit", "repo": "auth0/java-jwt", "text": "Add reversing lab scanner (#695)", "tokens": 13} {"id": 690132, "source": "commit", "repo": "auth0/jwks-rsa-java", "text": "patch travis.yml file. Run clean before test", "tokens": 11} {"id": 690147, "source": "commit", "repo": "auth0/jwks-rsa-java", "text": "replace Executor usage with a StopWatch and counters.", "tokens": 10} {"id": 690490, "source": "commit", "repo": "auth0/lock.android", "text": "merge window flags and fix layout being pushed issue", "tokens": 10} {"id": 690499, "source": "commit", "repo": "auth0/lock.android", "text": "remove unnecesary error messages - failed to fetch jsonp - cancel social auth", "tokens": 20} {"id": 690514, "source": "commit", "repo": "auth0/lock.android", "text": "replace some png with svg drawables", "tokens": 10} {"id": 690534, "source": "commit", "repo": "auth0/lock.android", "text": "replace widgets fixed width with side margins.", "tokens": 10} {"id": 690578, "source": "commit", "repo": "auth0/lock.android", "text": "decide which widgets to show when several connections are available", "tokens": 11} {"id": 691025, "source": "commit", "repo": "auties00/cobalt", "text": "WhatsappAPI.java: Added queryGroupInviteCode, returns GroupInviteCodeResponse.java JsonResponseModel.java: Added permits clause for GroupInviteCodeResponse.java ModificationForParticipantStatus.java: Documented inviteCode and inviteCodeExpiration params ProtobufUtils.java: Removed option to create a live location message WhatsappGenericMessage.java: Fixed casting exception, all methods starting with the \"has\" prefix where being invoked expecting a return type of boolean which throws an exception for hashCode(), added a check to query only methods that return a boolean. WhatsappVideoMessage.java, WhatsappGifMessage.java, WhatsappMessageFactory.java: Reverted to having two distinct classes for videos and gifs", "tokens": 151} {"id": 691332, "source": "commit", "repo": "auties00/whatsappweb4j", "text": "More work on the mobile api Fixed some web bugs", "tokens": 11} {"id": 691353, "source": "commit", "repo": "auties00/whatsappweb4j", "text": "Cleaned up code(formatting) Added secret sending Fixed some small issues Added MessageIndexInfo.java to OnAction Removed un-necessary exports to module-info.java", "tokens": 35} {"id": 691372, "source": "commit", "repo": "auties00/whatsappweb4j", "text": "GroupBuilder and GroupCipher are definitely working, the problem is either in SessionCipher or BinarySocket", "tokens": 20} {"id": 691536, "source": "commit", "repo": "autoparams/autoparams", "text": "Update JUnit dependencies to 5.12.2 Update all modules to use JUnit Jupiter 5.12.2 for API and engine. Add junit-platform-launcher 1.12.2 as a test runtime dependency. This ensures consistent test execution and compatibility across modules.", "tokens": 60} {"id": 691616, "source": "commit", "repo": "autoparams/autoparams", "text": "Add Javadoc guidelines for internal packages Internal packages require special treatment in documentation.", "tokens": 15} {"id": 691863, "source": "commit", "repo": "autoparams/autoparams", "text": "Change the range of arguments of double to [0, 1)", "tokens": 15} {"id": 692302, "source": "commit", "repo": "aya-prover/aya-dev", "text": "distill: `LitTerm.ShapedList`", "tokens": 12} {"id": 692304, "source": "commit", "repo": "aya-prover/aya-dev", "text": "repr: improve Call instead of creating new class (tested!)", "tokens": 16} {"id": 692474, "source": "commit", "repo": "aztechmc/modern-industrialization", "text": "Add tooltip to ME wires (#1370)", "tokens": 14} {"id": 692578, "source": "commit", "repo": "aztechmc/modern-industrialization", "text": "Modify build.gradle and add shell.nix to .gitignore (#713) This reverts commit 155a22f66842b8f34e2abb428e4fa758f0887f43.", "tokens": 62} {"id": 692601, "source": "commit", "repo": "aztechmc/modern-industrialization", "text": "Cleanup API and move component holders there (#550)", "tokens": 14} {"id": 693294, "source": "commit", "repo": "Azure-Samples/azure-search-openai-demo-java", "text": "Fix prompt_template override, add tests (#606) * Remove defaults for getenv * Remove print * missing output * Add tests and fix prepdocs issue * Fix prompt issue, add tests * Fix prompt issue, add tests * Delete unneeded print", "tokens": 52} {"id": 693497, "source": "commit", "repo": "azure/azure-functions-java-worker", "text": "Update Java Worker Version to 2.18.0", "tokens": 14} {"id": 693556, "source": "commit", "repo": "azure/azure-functions-java-worker", "text": "Fix durable return type void issue (#711) * fix durable return type void issue add unit tests * fix stupid test name", "tokens": 29} {"id": 693574, "source": "commit", "repo": "azure/azure-functions-java-worker", "text": "update distribute agent version to 3.4.4", "tokens": 13} {"id": 693644, "source": "commit", "repo": "azure/azure-functions-java-worker", "text": "add end2end test case for BindingName Annotation", "tokens": 11} {"id": 693725, "source": "commit", "repo": "azure/azure-functions-java-worker", "text": "Add Install-Package NuGet.CommandLine", "tokens": 10} {"id": 693857, "source": "commit", "repo": "azure/azure-functions-java-worker", "text": "styling clean up - import clean up - removing reference to logger", "tokens": 13} {"id": 694039, "source": "commit", "repo": "azure/azure-sdk-for-android", "text": "Persist oidc env vars in deploy template (#1700)", "tokens": 18} {"id": 694253, "source": "commit", "repo": "azure/azure-sdk-for-android", "text": "Add caching support to verify-links (#759) - Update link checking pipeline to enable caching - Add loading cache file from a http endpoint - Add retry logic when hitting 429 Fix verify link renaming scenarios - Correctly error if link format is incorrect - Handle case where the replace regex is not passed - Improve the error logging so it is easier to identify the broken links", "tokens": 79} {"id": 694268, "source": "commit", "repo": "azure/azure-sdk-for-android", "text": "Added azure-core-http to ci.yml (#677)", "tokens": 16} {"id": 694287, "source": "commit", "repo": "azure/azure-sdk-for-android", "text": "Fix incompatibility between String and CommunicationUserIdentifier when serialization [1.0.0-beta.6] (#605) * Fix incompatibility between String and CommunicationUserIdentifier when serialization * version number update on root folder * Remove the test app * Fix link in README.md Add one example to README.md * Update CHANGELOG.md", "tokens": 69} {"id": 694292, "source": "commit", "repo": "azure/azure-sdk-for-android", "text": "Sync eng/common directory with azure-sdk-tools for PR 1421 (#597) * Add common tools for spell check * Updates from further iteration * Review feedback: Add check for git as well * Review feedback * Use common approach to resolving base branch name * Eliminate default base branch \"master\" as this will be changed later, providing no default and using a mandatory parameter means a dev must provide the value * Check for existence of $CspellConfigPath * No need to Set-Location if run from the root of the repo (most common scenario) * -join * Review feedback: Rename TargetRef -> TargetBranch, add SourceBranch, Add reference to spelling docs, exit 0, Rename to check-spelling-in-changed-files.ps1, * Review feedback: Remove ValidateNotNullOrEmpty (we do more definitive validation farther down that will also catch these errors), Update comments and script name", "tokens": 194} {"id": 694395, "source": "commit", "repo": "azure/azure-sdk-for-android", "text": "Created unit tests for classes in our com.azure.android.core.http package.", "tokens": 19} {"id": 694408, "source": "commit", "repo": "azure/azure-sdk-for-android", "text": "Adding unit testing project dependencies and azure-core test folder structure (#165) * Added dependencies for JUnit 4 and Square's mockwebserver * Created unit test class for RequestIdInterceptor with one test. * Changed the JUnit version to what is recommended in the Android guidelines. Changed the MockWebServer version to the same one as OkHttp for the sake of stability and to remove the dependency on Kotlin from version 4 and onwards. * Refactored the RequestIdInterceptorTest to include more descriptive method names.", "tokens": 105} {"id": 694675, "source": "commit", "repo": "azure/azure-sdk-for-java", "text": "[Service Bus] Prepare tracing methods for message processor and scheduleMessage (#16524)", "tokens": 22} {"id": 694690, "source": "commit", "repo": "azure/azure-sdk-for-java", "text": "Enhance Playback Record Naming (#14801) * Add enhanced playback record names * Fixed incorrect conditional and added missing Javadoc * Changes based an feedback, updating loading of all HttpClients on the class path", "tokens": 44} {"id": 694862, "source": "commit", "repo": "azure/azure-sdk-for-java", "text": "clean up all of the \u00a9 symbols that messed up throughout the AssemblyInfo.cs files", "tokens": 22} {"id": 695147, "source": "commit", "repo": "azuread/azure-activedirectory-library-for-android", "text": "Error messages, typos, log messages et al cleanup", "tokens": 13} {"id": 695341, "source": "commit", "repo": "azuread/microsoft-authentication-library-for-android", "text": "Make Native Auth V2 result mappings forward-compatible, Fixes AB#3763146 (#2596) ## Summary - make every Native Auth V2 Common command-result mapping forward-compatible with new result variants - log unsupported results with correlation IDs and return operation-appropriate `invalid_state` errors - cover sign-in, sign-up, reset password, submit-code, resend, attributes, password, MFA, and completion mappings ## Motivation Common can extend its sealed Native Auth V2 command-result interfaces before MSAL adds the corresponding public mapping. Exhaustive Kotlin `when` expressions then make MSAL `dev` fail to compile in Common consumer validation. This currently blocks PR 3254 because its new `ResetPasswordMethodRequired` result is not known by MSAL `dev`. The same source-compatibility pattern existed in 14 other V2 mappings, so this PR guards all of them rather than fixing one flow at a time. Known typed results continue to use their existing mappings. An unknown result is logged through `Logger.warnWithObject` and fails closed as `invalid_state`; feature PRs can later add explicit typed mappings. ## Validation Current Common `dev`: - `:msal:testLocalDebugUnitTest --tests 'com.microsoft.identity.nativeauth.v2.*'` - `:msal:assembleLocal` - `:msalautomationapp:assembleLocal` Common PR 3254 head `f123fac53bb658541b45af88d89311e928aafb4c`: - `:msal:compileLocalDebugKotlin` - confirmed the prior non-exhaustive reset-password mapping now compiles ## Intended merge order 1. Merge this compatibility PR into MSAL `dev`. 2. Rerun and merge PR 3254. Fixes [AB#3763146](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3763146)", "tokens": 469} {"id": 695396, "source": "commit", "repo": "azuread/microsoft-authentication-library-for-android", "text": "update common, parameterize 532736", "tokens": 13} {"id": 695409, "source": "commit", "repo": "azuread/microsoft-authentication-library-for-android", "text": "fix msal version number to 4.0.2-RC1", "tokens": 16} {"id": 695839, "source": "commit", "repo": "azuread/microsoft-authentication-library-for-java", "text": "Set refreshOn in MI flows to half of token lifetime", "tokens": 14} {"id": 695902, "source": "commit", "repo": "azuread/microsoft-authentication-library-for-java", "text": "Update change log URl in README.md (#649) Replaced broken link in change log reference with msal4j-sdk/changelog.txt", "tokens": 34} {"id": 696055, "source": "commit", "repo": "azuread/microsoft-authentication-library-for-java", "text": "Remove telemetry sample. Update MsalServiceExceptionFactory", "tokens": 10} {"id": 696160, "source": "commit", "repo": "AzzappApp/react-native-skia-video", "text": "chore: release 0.8.2", "tokens": 10} {"id": 696228, "source": "commit", "repo": "AzzappApp/react-native-skia-video", "text": "chore: release 0.1.0", "tokens": 10} {"id": 696432, "source": "commit", "repo": "baeldung/spring-security-oauth", "text": "JAVA-1132: Removed unused module oauth-ui-authorization-code-thymeleaf from main pom", "tokens": 26} {"id": 696436, "source": "commit", "repo": "baeldung/spring-security-oauth", "text": "JAVA-1132: Moved oauth-ui-implicit & oauth-ui-password-legacy from clients-angularjs to oauth-legacy", "tokens": 31} {"id": 696681, "source": "commit", "repo": "baeldung/spring-security-registration", "text": "OldRegistrationController: avoid NPE if passToken is null", "tokens": 13} {"id": 696983, "source": "commit", "repo": "bcgit/bc-java", "text": "Added missing 1.85 release note entries: AC signature verification, NTRU+ decapsulation, DHAgreement peer validation, exception cause-chaining, the fixed-arity ASN.1 SEQUENCE guard batch, DSTU4145/OpenPGP/CRMF/TLS/DANE/TSP/ERS/SSH/EST robustness fixes, CMS RFC 5084 GCM parameters, X509CertificateReviewer, PKCS12 default iteration count, Mayo OQS OIDs, Ed25519 expanded keys, ECDHRawAgreement, ML-DSA and DH performance work, name finder and ASN.1 limit constants", "tokens": 147} {"id": 697097, "source": "commit", "repo": "bcgit/bc-java", "text": "docs: add link to Extension Add a link to Extension because the known ASN1ObjectIdentifiers are located there, hence Extension and Extensions replace X509Extensions.", "tokens": 38} {"id": 697315, "source": "commit", "repo": "bcgit/bc-java", "text": "Add checks for JSSE enableSessionCreation properties", "tokens": 10} {"id": 697440, "source": "commit", "repo": "beehive-lab/GPULlama3.java", "text": "Release the KV lease when a session fails to build DelegatingModel.newSession took the KV lease and then built the DelegatingSession. If the constructor threw (state allocation, plan building, a missing TornadoVM class), nothing released the lease, and with the default single slot every later newSession() failed with \"no free KV slot\". The lease is now closed before the failure is rethrown. Fixes #182", "tokens": 90} {"id": 697506, "source": "commit", "repo": "beehive-lab/GPULlama3.java", "text": "[qwen3-8] Shared tiles, native half reads and cp.async staging for the MMA projections One shared allocation for each of projectionMMAQ4_0's tile pairs, block fields read through the array's half accessor rather than reconstructed, and asynchronous staging of the A tile. The Q5_K and Q4_1 projections take the same representation and the same staging.", "tokens": 86} {"id": 697563, "source": "commit", "repo": "beehive-lab/GPULlama3.java", "text": "Fuse QKV/GateUp MMA GEMMs, pipeline gemmMMA loads, and fix flash attention accumulation in FP16 batch prefill", "tokens": 34} {"id": 697584, "source": "commit", "repo": "beehive-lab/GPULlama3.java", "text": "Add Gemma 4 model support with tokenizer, configuration, and inference layers", "tokens": 16} {"id": 697665, "source": "commit", "repo": "beehive-lab/GPULlama3.java", "text": "Refactor `TransformerComputeKernelsLayered` and `LlamaQ8_0FFNLayers`: condense parameter lists, streamline formatting, optimize fused operations, and introduce Q8 fused methods for enhanced performance.", "tokens": 45} {"id": 697929, "source": "commit", "repo": "beehive-lab/jitllm", "text": "[fix] Count a deduplicated BOS at the facade, not in the Llama loops The earlier off-by-one fix (a request for 2 tokens returning 3 when the prompt's BOS matched the state's seed) capped the CPU Llama loops by the prompt length. Their maxTokens is a position bound, which the GPU loops kept, so every raw caller changed on the CPU only: the CPU/GPU parity goldens got 63 rows against 64. The loops are back to their position bound, and the facade computes the budget from the positions the prompt really occupies (PromptIngestion), so a request gets exactly maxNewTokens on every path.", "tokens": 150} {"id": 698049, "source": "commit", "repo": "beehive-lab/jitllm", "text": "Fuse Q/K/V bias addition into a single task in Qwen2 Q8_0 FFN layers.", "tokens": 26} {"id": 698255, "source": "commit", "repo": "bennidi/mbassador", "text": "Added eclipse classes dir and libs to .gitignore", "tokens": 12} {"id": 698312, "source": "commit", "repo": "bennidi/mbassador", "text": "1. Fixed bug #31, added a test case 2. SyncBusTest didn't compile, I fixed the imports so that it did.", "tokens": 34} {"id": 698380, "source": "commit", "repo": "bergerhealer/traincarts", "text": "Fix interaction bug that caused debug chests not to work when clicking hitboxes", "tokens": 16} {"id": 698486, "source": "commit", "repo": "bergerhealer/traincarts", "text": "[Switcher] Don't switch carts/trains that didn't trigger the switcher sign Prevents nearby trains/carts teleporting from one junction end to another.", "tokens": 41} {"id": 698491, "source": "commit", "repo": "bergerhealer/traincarts", "text": "[Commands] Use cloud @FlagYielding to clean up greedy arg commands", "tokens": 17} {"id": 698742, "source": "commit", "repo": "bergerhealer/traincarts", "text": "Fix configuration save bug for trains resulting in recursion/out of memory/problems", "tokens": 18} {"id": 698886, "source": "commit", "repo": "bernie-g/geckolib", "text": "Fix parallel loading potentially failing when doing DataTickets or Molang queries", "tokens": 14} {"id": 699312, "source": "commit", "repo": "binance/binance-connector-java", "text": "derivatives-usds v8.0.0", "tokens": 13} {"id": 699363, "source": "commit", "repo": "binance/binance-connector-java", "text": "v1.6.2 (#32) * move maven-checkstyle-plugin to scope test * pump logback version to 1.2.11", "tokens": 34} {"id": 699759, "source": "commit", "repo": "bitwig/bitwig-extensions", "text": "Komplete Allows CC66 and C11 for Sostenuto and Touchstrip", "tokens": 22} {"id": 699809, "source": "commit", "repo": "bitwig/bitwig-extensions", "text": "Removed Icon M+ and Launchkey Mini from Extension Definition", "tokens": 14} {"id": 699815, "source": "commit", "repo": "bitwig/bitwig-extensions", "text": "Launch Control XL: fixes bug with channels", "tokens": 10} {"id": 699818, "source": "commit", "repo": "bitwig/bitwig-extensions", "text": "Mapped all the controls to hw controls", "tokens": 10} {"id": 700126, "source": "commit", "repo": "bkiers/liqp", "text": "Supress deprecation warning for Includes.INCLUDES_DIRECTORY_KEY", "tokens": 16} {"id": 700134, "source": "commit", "repo": "bkiers/liqp", "text": "Clean up code in src/main/java Infer generic parameters for Map, List, etc. Cease use of deprecated Java API. Suppress \"unchecked\", \"hiding\" warnings where appropriate. Add missing serialVersionUID where necessary. Use getRenderSettings()/getParseSettings() instead of deprecated access. Remove unused class members. Remove unused imports.", "tokens": 73} {"id": 700158, "source": "commit", "repo": "bkiers/liqp", "text": "readme around playground reflect the latest helper usage", "tokens": 10} {"id": 700160, "source": "commit", "repo": "bkiers/liqp", "text": "First step fix for https://github.com/bkiers/Liqp/issues/267 but more investigation needed", "tokens": 29} {"id": 700177, "source": "commit", "repo": "bkiers/liqp", "text": "Return ANTLR dependency to Java 8 compatible version", "tokens": 13} {"id": 700221, "source": "commit", "repo": "bkiers/liqp", "text": "Contains node fallback to array (so safe numbers will be covered in case of object keys)", "tokens": 20} {"id": 700760, "source": "commit", "repo": "blackdread/sql-to-jdl", "text": "Bump liquibae to 4.18.0", "tokens": 15} {"id": 700871, "source": "commit", "repo": "blakebr0/mysticalagriculture", "text": "Fix Ore Infuser inventory capability not being registered", "tokens": 12} {"id": 701246, "source": "commit", "repo": "blakebr0/mysticalagriculture", "text": "[1.10] Fix growth accelerators slowing down watering can speed", "tokens": 19} {"id": 701359, "source": "commit", "repo": "blendi-remade/agentcraft", "text": "Add Linux support to the launcher and notifications tools/mac.mjs becomes tools/unix.mjs and runs on Linux too, finding Java 25 in /usr/lib/jvm as well as Homebrew. The Foreman sends Linux desktop notifications through notify-send. Docs cover Linux and running the mod in your own launcher instance (Prism) with only the Foreman started by the launcher.", "tokens": 83} {"id": 701511, "source": "commit", "repo": "blog-aurora/aurora-blog", "text": "fix: fix the problem that frontmatter contains title and h1 is hidden", "tokens": 17} {"id": 701615, "source": "commit", "repo": "bloxbean/cardano-client-lib", "text": "feat(cbor): add CborSpan walker; move TransactionBytes and TransactionUtil onto it CborSpan (common) is one complete CBOR item in an original buffer. Its walker uses an explicit frame stack instead of recursion, so any nesting depth works on any stack. It navigates by array index, map key and tag, reads scalars and tag-24 embedded CBOR, and splices. It checks RFC 8949 well-formedness, rejects truncated or malformed input with the byte offset, and checks declared sizes against the remaining input before allocating. Spans never re-encode, so hashes taken from them match the original bytes. TransactionBytes and TransactionUtil.extractTransactionBodyFromTx/getTxHash now slice the transaction with CborSpan instead of decoding it with cbor-java: - witness sets of any depth no longer overflow the stack (preprod tx f90dce57...24c9, a 5,383-level native script, threw StackOverflowError); - the tx array header may have any width (98 04 returned \"04\" as the body); - an indefinite tx array keeps its closing BREAK on round trip; - a 4-element tx needs a bool at element 2; other array sizes are rejected; - getTxHash rejects malformed witnesses or aux data instead of not reading them. Public signatures are unchanged. CborSerializationUtil and model parsing are untouched. Tests use 76 real txs and 9 real blocks (every era; mainnet, preprod, preview, including the trigger tx and block), depth fixtures run on the default stack, in a forked -Xint JVM and on a virtual thread (new JDK 21 CI job), malformed input, a truncation sweep and fuzzing. An opt-in benchmark compares the old and new paths. Refs #681. ADR 0001 (#682), Phase 1.", "tokens": 423} {"id": 701845, "source": "commit", "repo": "bloxbean/cardano-client-lib", "text": "Fix (#229): Change key sort comparator to compare unsign bytes and related tests", "tokens": 19} {"id": 701891, "source": "commit", "repo": "bloxbean/cardano-client-lib", "text": "Apply Koios 1.13 Schema Changes", "tokens": 12} {"id": 701894, "source": "commit", "repo": "bloxbean/cardano-client-lib", "text": "Bump version to 0.3.0-beta1", "tokens": 13} {"id": 701994, "source": "commit", "repo": "bloxbean/cardano-client-lib", "text": "Try again. Fixed build for aarch64 and armv7", "tokens": 15} {"id": 702407, "source": "commit", "repo": "bluemap-minecraft/bluemap", "text": "Improve startup on forge to be more stable with other mods", "tokens": 12} {"id": 702935, "source": "commit", "repo": "bluuewhale/hash-smith", "text": "fix: `eqMask` zero-byte detection bug caused by cross-byte borrow (Mycroft haszero mask) (#8) * fix: eqMask zero-byte detection bug caused by cross-byte borrow (Mycroft haszero mask) * chore: minor change in indentation * docs: update CHANGELOG * docs: simplify docs and add a reference link", "tokens": 79} {"id": 703017, "source": "commit", "repo": "bluuewhale/hash-smith", "text": "feat: add benchmarking class for SwissMap and RobinHoodMap, including hit/miss tests and iteration performance", "tokens": 26} {"id": 703244, "source": "commit", "repo": "boxbeam/RedLib", "text": "Make JSONParser handle exponentiated decimals (1.0E5)", "tokens": 17} {"id": 703310, "source": "commit", "repo": "boxbeam/RedLib", "text": "Attempt to get RedCommands sources working with RedLib", "tokens": 11} {"id": 703333, "source": "commit", "repo": "boxbeam/RedLib", "text": "Make 4-arg openSlots open horizontally first", "tokens": 12} {"id": 703637, "source": "commit", "repo": "boxbeam/RedLib", "text": "Several changes and improvements to the command manager. Multiple optional arguments can be used in a command, and the command manager will try to automatically determine which optional arguments are being supplied by the sender. If the name of the command argument type and the name of the command argument on the same, the type will automatically be hidden. For default arguments, you can now specify a default value by adding a string which will be parsed into the value in parenthesis after the argument. Example: commandname string:string?(default value here) {", "tokens": 108} {"id": 703840, "source": "commit", "repo": "boykaframework/boyka-framework", "text": "feat(java): :sparkles: finger gestures added for Mobile applications (#480)", "tokens": 22} {"id": 703883, "source": "commit", "repo": "boykaframework/boyka-framework", "text": "feat(java): :sparkles: added locator alias name for better logging (#242)", "tokens": 20} {"id": 703914, "source": "commit", "repo": "boykaframework/boyka-framework", "text": "fix: :bug: cleaned up pom and updated dependencies version (#147)", "tokens": 18} {"id": 704149, "source": "commit", "repo": "braintree/android-card-form", "text": "Upgrade gradle build plugin to 2.2.3", "tokens": 12} {"id": 704172, "source": "commit", "repo": "braintree/android-card-form", "text": "Fix card.io tests due to focusSearch", "tokens": 10} {"id": 704498, "source": "commit", "repo": "braintree/braintree-android-drop-in", "text": "Update android-card-form version to 5.1.0. (#217)", "tokens": 21} {"id": 704821, "source": "commit", "repo": "braintree/braintree_java", "text": "Add Maestro to Debit Network Enums", "tokens": 12} {"id": 704824, "source": "commit", "repo": "braintree/braintree_java", "text": "Expose ApplePay MPAN fields in Server SDK (#476)", "tokens": 15} {"id": 705025, "source": "commit", "repo": "braintree/braintree_java", "text": "[maven-release-plugin] prepare release 2.44.0", "tokens": 17} {"id": 705187, "source": "commit", "repo": "braintree/braintree_java", "text": "[#1673] bumped api version; return error result with transaction on process decline", "tokens": 20} {"id": 705231, "source": "commit", "repo": "Breus/json-masker", "text": "Update Gradle Wrapper from 8.14.2 to 8.14.3", "tokens": 21} {"id": 705754, "source": "commit", "repo": "brikster/chatty", "text": "Do not let one bad notification channel disable the plugin A single out-of-range number in notifications.yml stopped Chatty from enabling at all - no chat processing, no commands - because the channel's constructor threw out of the Guice injector. All the owner saw was a 40-line ProvisionException naming neither the file nor the channel, and on /chatty reload only \"Error while reloading plugin: ProvisionException\". That is a plausible reading of the \"notifications just do not work\" reports: the notification was never the part that broke, the whole plugin was. A channel that will not build is now reported by name, with its file and the actual complaint, and skipped; everything else loads. SupportedFormatsTest records which syntaxes a config may use, since the question keeps coming up. Verified against the converter: shadow, key, insert, sprite, lang, hover, click, transition and every hex and gradient spelling Chatty documents all work; CMI's {#hex>}text{#hex<} does not, and the test says so out loud.", "tokens": 226} {"id": 705760, "source": "commit", "repo": "brikster/chatty", "text": "Do not touch the modern chat adapter on servers without it isSupported() lived on ModernChatEventFacade, so asking the question ran that class's static initializer - which resolves Paper's AsyncChatEvent and throws when it is absent. Chatty failed to enable on 1.8.8, and then failed again on the way out because the disable path asks the same question. The smoke test's legacy scenario caught it. The check moves to ModernEventExecutor, which holds no Paper types, and the adapter is initialised explicitly inside the try that already falls back to the legacy listener.", "tokens": 122} {"id": 706269, "source": "commit", "repo": "broadinstitute/picard", "text": "Bump to Intel GKL version 0.8.5. (#1182) This is what GATK has used since 4.0.2.0. The new version has extra optimizations for compression level 2 (the level we use in our WGS pipeline).", "tokens": 63} {"id": 706272, "source": "commit", "repo": "broadinstitute/picard", "text": "Deprected old broken parseTileMetrics", "tokens": 10} {"id": 706315, "source": "commit", "repo": "broadinstitute/picard", "text": "Fix for MergeBamAlignment when one read maps to both pos and neg strand", "tokens": 16} {"id": 706417, "source": "commit", "repo": "broadinstitute/picard", "text": "Merged changes from the jc_file_util_refactor branch. This includes optimizations for BCL reading", "tokens": 22} {"id": 706572, "source": "commit", "repo": "broadinstitute/picard", "text": "When a read has negative strand flag set, reverse-complement it regardless of whether it is mapped or not, and clear the flag.", "tokens": 28} {"id": 706796, "source": "commit", "repo": "brunoborges/javaevolved", "text": "Rewrite generate.py to match generate.java with full i18n support Bring generate.py up to parity with generate.java (the source of truth). Previously the Python script only produced English output and was missing many features added to the Java generator. Added: - Full multi-locale build support (--locale, --all-locales flags) - UI string loading from translations/strings/ with English fallback - Content translation merging (resolveSnippet) from translations/content/ - Dotted-key token regex (e.g. {{nav.allPatterns}}) - Multi-pass token replacement (3 passes for nested tokens) - Locale picker, hreflang links, and i18n script block rendering - Contribute issue URLs (code, translation, suggest) - Locale-aware URLs in nav arrows, related cards, and index cards - i18n-aware difficultyDisplay and supportBadge lookups - Locales loaded from html-generators/locales.properties", "tokens": 205} {"id": 706845, "source": "commit", "repo": "brunoborges/javaevolved", "text": "Add Copilot agentic workflows and VS Code configuration - Add agentic workflows agent definition - Add copilot-setup-steps workflow - Add VS Code settings and MCP server config", "tokens": 37} {"id": 707061, "source": "commit", "repo": "BryanJacobs/FIDO2Applet", "text": "Implement \"uvm\" extension For whatever reason, there's an extension with authenticator behaviors only described in the webauthn-2 standard (not in CTAP, any version). Let's implement that.", "tokens": 45} {"id": 707070, "source": "commit", "repo": "BryanJacobs/FIDO2Applet", "text": "Extra check to make sure high-security creds require PIN We can't even *create* the high security credentials unless a PIN was provided this power-on.", "tokens": 37} {"id": 707130, "source": "commit", "repo": "BryanJacobs/FIDO2Applet", "text": "Fix getNextAssertion; use per-cred IV in storage", "tokens": 13} {"id": 707136, "source": "commit", "repo": "BryanJacobs/FIDO2Applet", "text": "Remove hacky APDU-packing for getNextAssertion", "tokens": 12} {"id": 707173, "source": "commit", "repo": "bsommerfeld/pathetic", "text": "docs: note the AbstractPathfinder subclass contract change", "tokens": 10} {"id": 707374, "source": "commit", "repo": "bsommerfeld/pathetic", "text": "refact: Marked prioritization as experimental", "tokens": 11} {"id": 707647, "source": "commit", "repo": "bttv-android/bttv", "text": "rebase to 15.0.0 (#611)", "tokens": 15} {"id": 707771, "source": "commit", "repo": "bttv-android/bttv", "text": "Tokenize sub messages (#220)", "tokens": 10} {"id": 707909, "source": "commit", "repo": "bttv-android/bttv", "text": "remove 'enable' prefix from settings Closes #19", "tokens": 12} {"id": 708005, "source": "commit", "repo": "BuildCLI/BuildCLI", "text": "refactor: BuildCLIServiceTest to improve readability and add Mockito support", "tokens": 14} {"id": 708109, "source": "commit", "repo": "BuildCLI/BuildCLI", "text": "chore: added dev.buildcli.hooks as a dependency", "tokens": 13} {"id": 708327, "source": "commit", "repo": "buildtheearth/terraplusplus", "text": "don't shade module-info.class from dependencies", "tokens": 13} {"id": 708331, "source": "commit", "repo": "buildtheearth/terraplusplus", "text": "Replaced command teleportation with player teleportation. Changed command window for FragmentManager", "tokens": 16} {"id": 708395, "source": "commit", "repo": "buildtheearth/terraplusplus", "text": "be able to project GeoJSON geometry objects, and make CachedChunkData use ints instead of doubles", "tokens": 21} {"id": 708850, "source": "commit", "repo": "byronka/minum", "text": "fix tests for Mac Noticed that some tests were failing on Mac. This corrects the issue.", "tokens": 22} {"id": 708943, "source": "commit", "repo": "byronka/minum", "text": "Handle endpoint error better Before this change, if an exception was thrown in an endpoint it would bubble up to the top of the server and get logged as an ASYNC_ERROR, and the server would respond by just closing the socket. Gross! Now, a bit deeper down and closer to the endpoint, we wrap the call with a try-catch, and if anything fails in the endpoint we return a 500 to the client, with a randomly generated code that is put on both the client response message and the log with more detail.", "tokens": 113} {"id": 709264, "source": "commit", "repo": "cacheflowe/haxademic", "text": "Update Demo_PImageShaderContained.java", "tokens": 10} {"id": 709867, "source": "commit", "repo": "cambridge-cares/theworldavatar", "text": "dev-marie-plm: Make sample question clickable", "tokens": 13} {"id": 709915, "source": "commit", "repo": "cambridge-cares/theworldavatar", "text": "Updated the methods used for using the new population data and remove the closed power plants.", "tokens": 19} {"id": 709979, "source": "commit", "repo": "cambridge-cares/theworldavatar", "text": "dev-improve-cloning-tool: move cloning tools into their own package uk.ac.cam.cares.jps.base.tools.cloning", "tokens": 36} {"id": 710014, "source": "commit", "repo": "cambridge-cares/theworldavatar", "text": "dev-stack-manager: Updated the Dataset classes so that they include methods and calls to also add layers to GeoServer.", "tokens": 27} {"id": 710039, "source": "commit", "repo": "cambridge-cares/theworldavatar", "text": "dev-ontomatch-cleanup: hotfix to dockerfile Added two lines required for dockerfiles.", "tokens": 20} {"id": 710047, "source": "commit", "repo": "cambridge-cares/theworldavatar", "text": "145-dev-release-py4jps-1015: minor fixes in README.md following comments in PR 110.", "tokens": 35} {"id": 710060, "source": "commit", "repo": "cambridge-cares/theworldavatar", "text": "dev-mods-moo-agent: Changes to the docker files: 1) so that the private key does not require a passphrase 2) Added an extra debugging port to allow debugging in Eclipse", "tokens": 42} {"id": 710209, "source": "commit", "repo": "capacitor-community/admob", "text": "fix(android): use AGP 9 compatible ProGuard defaults (#480)", "tokens": 19} {"id": 710237, "source": "commit", "repo": "capacitor-community/admob", "text": "(feat) Support impression-level ad revenue (#433)", "tokens": 19} {"id": 710287, "source": "commit", "repo": "capacitor-community/admob", "text": "separate request consent from showing UMP consent form", "tokens": 10} {"id": 710462, "source": "commit", "repo": "capacitor-community/admob", "text": "refactor(banner-android): banner cemits all their events", "tokens": 14} {"id": 710866, "source": "commit", "repo": "cardillan/mindcode", "text": "Updated assertbounds generation Fixed assertbounds error when applying floor optimization Internal stack documentation Runtime checks option category Stack overflow runtime check", "tokens": 24} {"id": 710881, "source": "commit", "repo": "cardillan/mindcode", "text": "Add an MlogWatcher button to the schematic page (#319)", "tokens": 16} {"id": 711183, "source": "commit", "repo": "cardillan/mindcode", "text": "Release 2024-02-17", "tokens": 13} {"id": 711257, "source": "commit", "repo": "cardillan/mindcode", "text": "Command line optimiser selection (#84)", "tokens": 12} {"id": 711261, "source": "commit", "repo": "cardillan/mindcode", "text": "Issue #64 fix (#69) Fixes #64: optimization should not replace strictEqual with notEqual", "tokens": 24} {"id": 711812, "source": "commit", "repo": "catcoderr/protocolsidebar", "text": "chore: Change version to have both variations on the repo.", "tokens": 14} {"id": 711963, "source": "commit", "repo": "chargetimeeu/java-oca-ocpp", "text": "Revert commits breaking API and binary OCPP 1.6 passwords These commits were based on a misunderstanding of the OCPP-J 1.6 specification, which clearly states that the password is a byte sequence and not a string: Revert \"More password fixes.\" This reverts commit fb5d0fb4c9e5cf8e1f14ab97ea5e15422fb441f4. Revert \"Fix password decoding.\" This reverts commit cf20205e849a258ee5f4893a1d916ef8091f12d1. Revert \"Recommended by 1.6 spec is a 20 byte (40 chars) key.\" This reverts commit f7b92a3d6ae51cce4e6bbdcc25148cb951e986d1. This commit breaks the API, because the behaviour of the method is changed to return the last configuration instead of the default configuration: Revert \"A single instace, otherwise a static get() method makes no sense.\" This reverts commit 953f50b3e7c4b975cae5ebcb74c2bd6e381d5e23.", "tokens": 288} {"id": 712135, "source": "commit", "repo": "chargetimeeu/java-oca-ocpp", "text": "To debug if server socket doesn't close at all or it's just slow", "tokens": 19} {"id": 712162, "source": "commit", "repo": "chargetimeeu/java-oca-ocpp", "text": "Added utilities to measure execution time and provide hashCode/equals/toString helpers (cut versions from Guava) String representation added to FeatureRepository and Queue Execution time measurement and logging with debug level added to Queue", "tokens": 40} {"id": 712926, "source": "commit", "repo": "chiselsandbits/chisels-and-bits", "text": "Fix occlusion errors. Closes: #1053 Closes: #1043", "tokens": 20} {"id": 712981, "source": "commit", "repo": "citerus/dddsample-core", "text": "Refactor HandlingReportParser, HandlingReportServiceImpl and UploadDirectoryScanner Also adds unit tests.", "tokens": 20} {"id": 713015, "source": "commit", "repo": "citerus/dddsample-core", "text": "Bumped Spring to 1.5.7", "tokens": 10} {"id": 713017, "source": "commit", "repo": "citerus/dddsample-core", "text": "Merged PR \"rename names in pathfiner package\" with Spring Boot changes.", "tokens": 17} {"id": 713200, "source": "commit", "repo": "citerus/dddsample-core", "text": "Arrival deadline date is now passed as parameter into booking facade (not read from request parameter yet though).", "tokens": 24} {"id": 713360, "source": "commit", "repo": "citerus/dddsample-core", "text": "Modified inclusion pattern in jar plugin to inlcude all flies and all folders under .../ws/", "tokens": 22} {"id": 713514, "source": "commit", "repo": "classgraph/classgraph", "text": "Correct stale comments in the classloader handlers The EquinoxClassLoaderHandler comment said that Equinox's modulesById map is keyed by Integer, but an OSGi bundle id is a long, which is why the code looks up 0L rather than 0. The UnoOneJarClassLoaderHandler comments described the v4 way of turning off classloader and classpath scanning. ClassLoaderHandlerRegistryEntry's class comment described it as a list of classloader class names paired with handlers, when it holds one handler and no names, and its canHandle() parameter is a classloader class rather than a classloader. Also replace the commented-out NativeLibraryResourceLoader test in JBossClassLoaderHandler with a note saying why it is not worth making.", "tokens": 147} {"id": 713731, "source": "commit", "repo": "classgraph/classgraph", "text": "[maven-release-plugin] prepare release fast-classpath-scanner-2.9.0", "tokens": 21} {"id": 714426, "source": "commit", "repo": "cloudinary/cloudinary_java", "text": "Add `type` parameter to `Api.publishResource()` (#73)", "tokens": 17} {"id": 714621, "source": "commit", "repo": "cloudinary/cloudinary_java", "text": "correctly located the cloudinary tld and updated to use the new classname of the tag Added a singleton manager to ease spring support.", "tokens": 27} {"id": 714846, "source": "commit", "repo": "code-disaster/steamworks4j", "text": "Added matchmaking test application. Lobby request and member count enumeration.", "tokens": 16} {"id": 714853, "source": "commit", "repo": "code-disaster/steamworks4j", "text": "Added onUserStatsUnloaded(), onUserAchievementStored() callbacks.", "tokens": 15} {"id": 715205, "source": "commit", "repo": "codedabble-dev/java-snapshot-testing", "text": "Change SnapshotMatcher to save ordered to prevent long VCS diffs", "tokens": 13} {"id": 715251, "source": "commit", "repo": "codetoexpress/dailycodebase", "text": "Fix typo in pull request template (#330)", "tokens": 12} {"id": 715327, "source": "commit", "repo": "codetoexpress/dailycodebase", "text": "Rename day1.cpp to day1_solve.cpp (#192) Solution to Fizz-Buzz Problem", "tokens": 27} {"id": 715400, "source": "commit", "repo": "codetoexpress/dailycodebase", "text": "Day 13 - C (#141) * Create fibonacci.c * Create factorial.c * Update README.md", "tokens": 29} {"id": 715551, "source": "commit", "repo": "codinasion/program", "text": "Add TypeScript implementation of binary search algorithm (#5523)", "tokens": 14} {"id": 715630, "source": "commit", "repo": "codinasion/program", "text": "Convert string to consonant case kotlin (#7601) * Create convertSringToReverseCase.kt \"add function to reverse case of string in kotlin\" * Create convert-string-to-consonantcase.kts \"add consonantCase function in kotlin\" ---------", "tokens": 62} {"id": 715766, "source": "commit", "repo": "codinasion/program", "text": "Added ConvertMinutesToDays cpp file (#6133)", "tokens": 15} {"id": 716218, "source": "commit", "repo": "col-e/cafed00d", "text": "Update version -> 1.7.3", "tokens": 10} {"id": 716781, "source": "commit", "repo": "CommandAPI/CommandAPI", "text": "Properly fix what I already fixed in 87d2cca1fc9149bc76f5b93b8a0081ef11a61380", "tokens": 45} {"id": 716928, "source": "commit", "repo": "CommandAPI/CommandAPI", "text": "Adds \"@since\" to all argument types (except CommandArgument)", "tokens": 14} {"id": 716992, "source": "commit", "repo": "CommandAPI/CommandAPI", "text": "Update getSenderForCommand and getCommandSenderFromCommandSource for the rest of bukkit NMS", "tokens": 17} {"id": 717015, "source": "commit", "repo": "CommandAPI/CommandAPI", "text": "Implements the fix for #312. Adds getter methods for CommandAPICommand help", "tokens": 18} {"id": 717287, "source": "commit", "repo": "compactmods/compactmachines", "text": "Add fallback lang support for machine tooltips/names", "tokens": 10} {"id": 717312, "source": "commit", "repo": "compactmods/compactmachines", "text": "Adjust jar-in-jar version pinning", "tokens": 10} {"id": 717357, "source": "commit", "repo": "compactmods/compactmachines", "text": "Refactor a bunch of packages. Again. (No api breaks, this is all internal)", "tokens": 19} {"id": 717497, "source": "commit", "repo": "compactmods/compactmachines", "text": "Added button to enter machines directly to the GUI This button only shows when having a shrinking device somewhere in the inventory and the player is actually allowed to enter the machine. This also includes an internal change to the way items are being recognized as Shrinking Devices.", "tokens": 54} {"id": 717538, "source": "commit", "repo": "compactmods/compactmachines", "text": "Replace superfluous MultiblockRecipeWrapperFactory with lambda expression", "tokens": 11} {"id": 717572, "source": "commit", "repo": "compactmods/compactmachines", "text": "Don't show damage bars on the PSD if its empty Also to remove clutter from inventories and item lists.", "tokens": 24} {"id": 717634, "source": "commit", "repo": "compactmods/compactmachines", "text": "Personal Shrinking Device should not be stackable", "tokens": 11} {"id": 717748, "source": "commit", "repo": "compasssecurity/samlraider", "text": "Fix JTree rendering There is still a problem when loading the extension in debug mode with certificates pre-imported, or when changing the color scheme of burpsuite from dark to light or vice versa. Then the JTree rendering is corrupted.", "tokens": 52} {"id": 717869, "source": "commit", "repo": "compasssecurity/samlraider", "text": "Passing Evil Assertion's subject name identifier from GUI to back-end methods", "tokens": 20} {"id": 717881, "source": "commit", "repo": "compasssecurity/samlraider", "text": "Latest Burp Suite 1.7.03", "tokens": 15} {"id": 718037, "source": "commit", "repo": "concurnas/concurnas", "text": "fixed REPL bug with functions having default arguments", "tokens": 11} {"id": 718110, "source": "commit", "repo": "congcoi123/tenio", "text": "Squashed 'framework/engine/' changes from 46c8e7903..0b699930f 0b699930f Merge pull request #26 from congcoi123/develop 8288d2200 build(0.6.8): bump new version 5909f6fff meta: update dependencies git-subtree-dir: framework/engine git-subtree-split: 0b699930ff479cb4efdd91f047f666e47912f03b", "tokens": 142} {"id": 718285, "source": "commit", "repo": "congcoi123/tenio", "text": "fix: solved the problems on the test examples", "tokens": 10} {"id": 718469, "source": "commit", "repo": "congcoi123/tenio", "text": "fix: silly bug, the player can not set \"ignore timeout\" status", "tokens": 16} {"id": 718699, "source": "commit", "repo": "conveyal/r5", "text": "fix(fares): get fare support to compile and run (although not yet correct).", "tokens": 22} {"id": 719050, "source": "commit", "repo": "cooperlyt/keycloak-phone-provider", "text": "update readme keycloak to 19.0.1 Quarkus", "tokens": 17} {"id": 719503, "source": "commit", "repo": "cornutum/tcases", "text": "JavaTestWriter: Refactor to assume some responsibilities for handling response validation", "tokens": 18} {"id": 719586, "source": "commit", "repo": "cornutum/tcases", "text": "Increment to version=3.4.2-SNAPSHOT", "tokens": 12} {"id": 719694, "source": "commit", "repo": "cornutum/tcases", "text": "tcases-reducer: Command line support relocated to ReducerCommand class", "tokens": 17} {"id": 719933, "source": "commit", "repo": "cosium/git-code-format-maven-plugin", "text": "[maven-release-plugin] prepare release 4.3", "tokens": 14} {"id": 720171, "source": "commit", "repo": "cosium/spring-data-jpa-entity-graph", "text": "Upgrade to Spring Data 3.0.x", "tokens": 11} {"id": 720180, "source": "commit", "repo": "cosium/spring-data-jpa-entity-graph", "text": "[maven-release-plugin] prepare release spring-data-jpa-entity-graph-parent-2.7.6", "tokens": 27} {"id": 720398, "source": "commit", "repo": "cottonmc/libgui", "text": "Remove deprecated APIs - ValidatedSlot.getFilter - ValidatedSlot.setFilter - WItemSlot.getFilter - WItemSlot.setFilter - WListPanel.margin", "tokens": 34} {"id": 720431, "source": "commit", "repo": "cottonmc/libgui", "text": "CottonInventoryScreen: Fix z order issues", "tokens": 11} {"id": 720484, "source": "commit", "repo": "cottonmc/libgui", "text": "Allow WGridPanel to have gaps between widgets. (#170) * Allow WGridPanel to have gaps between widgets. * Various formatting changes", "tokens": 31} {"id": 720559, "source": "commit", "repo": "cottonmc/libgui", "text": "Update to 1.17.1 stable and bump to 4.1.2", "tokens": 20} {"id": 720667, "source": "commit", "repo": "cottonmc/libgui", "text": "Add a global scissor stack for nested scissor support (#59) * Add a global scissor stack for nested scissor support * Fix scissors not having proper dimensions, add check for negatives", "tokens": 43} {"id": 720833, "source": "commit", "repo": "countly/countly-sdk-android", "text": "feat: 26.1.5", "tokens": 10} {"id": 721086, "source": "commit", "repo": "countly/countly-sdk-android", "text": "Adding tests and implementing custom metric override in the common call.", "tokens": 13} {"id": 721134, "source": "commit", "repo": "countly/countly-sdk-android", "text": "Adding a few connectionProcessor and other tests. Removed possibility of removing request in connection processor.", "tokens": 19} {"id": 721316, "source": "commit", "repo": "cqfn/aibolit", "text": "Fix my wrong logic in /aibolit/metrics/npath/main.py", "tokens": 19} {"id": 721902, "source": "commit", "repo": "cqfn/jpeek", "text": "#216 add LCOM4 tests Adds three tests on LCOM4: OneCommonAttribute, NotCommonAttributes, NotCommonAttributesWithAllArgsConstructor. Adds puzzle in order to fix constructors' affection on LCOM4", "tokens": 48} {"id": 722365, "source": "commit", "repo": "crafttweaker/crafttweaker", "text": "Made the patron message not print to chat", "tokens": 10} {"id": 722621, "source": "commit", "repo": "crazy-crew/crazyauctions", "text": "Add auction item adapters to the api module", "tokens": 12} {"id": 722688, "source": "commit", "repo": "crazy-crew/crazyauctions", "text": "prevent top bid going below 0L", "tokens": 10} {"id": 722824, "source": "commit", "repo": "crazy-crew/crazyauctions", "text": "Sell Sound Should cover #171", "tokens": 10} {"id": 723026, "source": "commit", "repo": "crazy-crew/crazyauctions", "text": "v1.0 Release Update The plugin has just been released on spigot. https://www.spigotmc.org/resources/crazy-auctions.25219/ Added: - Perms to all commands - Dependence on Vault", "tokens": 53} {"id": 723578, "source": "commit", "repo": "crazy-crew/crazyenchantments", "text": "Update FUNDING.yml (#678)", "tokens": 12} {"id": 723809, "source": "commit", "repo": "crazy-crew/crazyenchantments", "text": "Fix WorldGuard and GriefPrevention linking. Rename WorldGuard to WorldGuardSupport to avoid name conflict", "tokens": 22} {"id": 724408, "source": "commit", "repo": "crocs-muni/jcalgtest", "text": "Outdated link update link, the older one redirects, and does not accept direct parsing through url anymore", "tokens": 22} {"id": 724421, "source": "commit", "repo": "crocs-muni/jcalgtest", "text": "return card atr,reader name and protocol even when applet is not present", "tokens": 16} {"id": 724717, "source": "commit", "repo": "crocs-muni/jcalgtest", "text": "new binaries for AlgTestProcess and AlgTestJClient", "tokens": 14} {"id": 724926, "source": "commit", "repo": "crossbario/autobahn-java", "text": "Add publish/subscribe interaction to examples (#210) * Add subscribe interaction to examples * renaming * Add publish example", "tokens": 25} {"id": 724949, "source": "commit", "repo": "crossbario/autobahn-java", "text": "Add netty demo target to Makefile (#175)", "tokens": 13} {"id": 725230, "source": "commit", "repo": "crossoverjie/cim", "text": "fit: Modify the input parameter name Of fetcgOfflineMsg", "tokens": 15} {"id": 725473, "source": "commit", "repo": "cryptomorin/kingdomsx", "text": "v1.21.x Support - Player Selectors Added v1.21.3 and v1.21.4 support. Added an experimental player selector system for protection signs. (Reset your GUIs for this to work) Added /k admin masswar pause/resume The math compiler now supports other common math symbols specially used in phones. FSCK can now fix broken kingdom champion types. Added %kingdoms_stats_kingdoms_count%, %kingdoms_stats_nations_count%, %kingdoms_stats_lands_count%, %kingdoms_stats_lands_claimed% and %kingdoms_stats_players_with_kingdom% Added %kingdoms_kingdom_is_under_attack% and %kingdoms_kingdom_is_invading% Fixed an error caused by Outpost Events scoreboards. Fixed an error when explosions happen when not caused by a Siege Cannon. Fixed some issues with nexus level descriptions. Fixed an error caused by using time-based variables for math equations. Fixed nexus chest item saving in older versions. Fixed national rank permission categories. Fixed pacifism general cooldown. Fixed placeholder defaults of config.yml Fixed Pl3xMap support. Masswars will now resume after they're interrupted by a server restart. Fixed an error caused by a kingdomless player opening another kingdom's nexus. Fixed a crash caused by placing structures/turrets. Improved WorldEdit player edit restrictions.", "tokens": 328} {"id": 725476, "source": "commit", "repo": "cryptomorin/kingdomsx", "text": "v1.17.4-ALPHA", "tokens": 10} {"id": 725563, "source": "commit", "repo": "cryptomorin/kingdomsx", "text": "v1.14.18.1.1 Reupload map viewers", "tokens": 18} {"id": 725579, "source": "commit", "repo": "cryptomorin/kingdomsx", "text": "Map Viewer v1.1.1", "tokens": 10} {"id": 726290, "source": "commit", "repo": "Crystaelix/Create-Simurail", "text": "change the brake force nudge function to a cubic", "tokens": 14} {"id": 726296, "source": "commit", "repo": "Crystaelix/Create-Simurail", "text": "Translated ponders to Russian (#26)", "tokens": 11} {"id": 726497, "source": "commit", "repo": "cucumber/cucumber-eclipse", "text": "Issue #291 refactoring/improve the serialization", "tokens": 11} {"id": 726728, "source": "commit", "repo": "cucumber/cucumber-eclipse", "text": "Implement basic folding for the gherkin editor This was a bit more cumbersome than I had hoped for, since the parser/formatter from the gherkin library does not provide the end of Feature's, Scenario's etc. Hence calculating that using a stack manually. Other than the ReconcilingStrategy this is largely just boilerplate based on http://www.eclipse.org/articles/Article-Folding-in-Eclipse-Text-Editors/folding.html The folding allows to collapse/expand Feature, Scenario, Scenario Outline, Background and the Examples in Scenario Outlines. By using the Gherkin Lexer and its listener interface directly one could possibly support folding multi-line comments, descriptions and multi-line strings but that may also need more bookkeeping. fixes #64", "tokens": 176} {"id": 726852, "source": "commit", "repo": "cucumber/cucumber-expressions", "text": "Dotnet small fixes (#123) * .NET: fix word parameter name * Update changelog", "tokens": 23} {"id": 726882, "source": "commit", "repo": "cucumber/cucumber-expressions", "text": "Ignore the ESM-only hast-util-sanitize module when upgrading dependencies", "tokens": 17} {"id": 727278, "source": "commit", "repo": "cucumber/cucumber-jvm", "text": "Post release datatable v3.3.1", "tokens": 11} {"id": 727302, "source": "commit", "repo": "cucumber/cucumber-jvm", "text": "[JUnit] Mark Constants as part of the public API", "tokens": 12} {"id": 727409, "source": "commit", "repo": "cucumber/cucumber-jvm", "text": "Update the History.md wrt missing table headers and examples", "tokens": 14} {"id": 727429, "source": "commit", "repo": "cucumber/cucumber-jvm", "text": "Converted the existing scala/scala_previous to be more meaningful This uses a second level for aggregation of shared items, sources, dependencies, and build plugins. Then the individual projects actually produce the artifacts, using the properties defined in the parent level. (Could probably pull those up entirely, since the project names describe what scala version we're using.) This is a bit more descriptive than before, since we're almost into scala 2.12.", "tokens": 98} {"id": 727528, "source": "commit", "repo": "cucumber/cucumber-jvm", "text": "UTF-8 everywhere. Closes #251", "tokens": 11} {"id": 728201, "source": "commit", "repo": "cyborgscode/personal-voice-assistent", "text": "Rename 10-english-example.conf to 10-english-switch.conf", "tokens": 21} {"id": 728352, "source": "commit", "repo": "cyborgscode/personal-voice-assistent", "text": "netmasks are irrelevant on serverports", "tokens": 10} {"id": 728704, "source": "commit", "repo": "cyclopsmc/integrateddynamics", "text": "Update zh_CN.lang (#323)", "tokens": 12} {"id": 728754, "source": "commit", "repo": "cyclopsmc/integrateddynamics", "text": "Fix cable not always visually connecting when placing on a part, Closes #102", "tokens": 19} {"id": 728770, "source": "commit", "repo": "cyclopsmc/integrateddynamics", "text": "Remove IPartContainerFacade This drastically reduces the API's complexity.", "tokens": 18} {"id": 729074, "source": "commit", "repo": "dan2097/opsin", "text": "null arguments should throw IllegalArgumentException Don't double assign type/subType Removed barely used constructor", "tokens": 21} {"id": 729252, "source": "commit", "repo": "dan2097/opsin", "text": "A few more trivial names Strictened check for whether a locant will be used", "tokens": 17} {"id": 729358, "source": "commit", "repo": "daniel-frak/keycloak-user-migration", "text": "build: Increment version to 6.2.3-SNAPSHOT", "tokens": 14} {"id": 729430, "source": "commit", "repo": "daniel-frak/keycloak-user-migration", "text": "revert to .pf-c-alert__title", "tokens": 14} {"id": 729647, "source": "commit", "repo": "danielflower/multi-module-maven-release-plugin", "text": "Adding ability to control behavior when no modules have changed - can now specify a \"noChangesAction\" with possible values: ReleaseAll, ReleaseNone, FailBuild Fixes #4", "tokens": 37} {"id": 729887, "source": "commit", "repo": "datadog/java-dogstatsd-client", "text": "Add java module system declarations Core is in Java 7, so it can only have automatic module name, set via jar manifest. Forwarder gets a real declaration, which declares a transitive dependency on the core package. One wrinkle is that this breaks `mvn test`: automatic module name is only added to the packaged jar, which is not built when running tests, and then the forwarder tests are unable to find core module and fail. `mvn package` is a workaround, since it also builds jar for core, which is then used to run forwarder tests.", "tokens": 119} {"id": 730127, "source": "commit", "repo": "datadog/java-dogstatsd-client", "text": "Fix library cleanup by making the Telemetry TimerTask a daemon and making the StatsDProcessor use daemon threads in its executor (#117)", "tokens": 31} {"id": 730131, "source": "commit", "repo": "datadog/java-dogstatsd-client", "text": "Updated version in README to latest published one (#113)", "tokens": 14} {"id": 730219, "source": "commit", "repo": "datadog/java-dogstatsd-client", "text": "Use builder for ServiceCheck in README.md (#28)", "tokens": 15} {"id": 730325, "source": "commit", "repo": "datatheorem/trustkit-android", "text": "Add multiple domain pinning support for OkHttp2 Add support for SSL pinning validation on multiple different domains with a single OkHttp2 client", "tokens": 27} {"id": 730361, "source": "commit", "repo": "datatheorem/trustkit-android", "text": "Change to support localhost domain as a valid field for TrustKit-Android", "tokens": 15} {"id": 730362, "source": "commit", "repo": "datatheorem/trustkit-android", "text": "change CI to Bitrise instead of TravisCI", "tokens": 10} {"id": 730397, "source": "commit", "repo": "datatheorem/trustkit-android", "text": "Document the 3-parameter checkServerTrusted method and why we can\u2019t use it", "tokens": 19} {"id": 730552, "source": "commit", "repo": "datatheorem/trustkit-android", "text": "Modify the BackgroundReporter constructor to not require the Context", "tokens": 12} {"id": 730568, "source": "commit", "repo": "datatheorem/trustkit-android", "text": "override equals to be able to use our specific object to compare if a report should be send or not", "tokens": 21} {"id": 730604, "source": "commit", "repo": "dbos-inc/dbos-transact-java", "text": "Skip executor self recovery when Conductor is enabled (#548) Conductor decides which executors are gone and issues the recovery itself. An executor it manages that *also* sweeps at launch races that decision, so gate the launch-time sweep on Conductor being enabled \u2014 either a configured conductor key, or DBOS Cloud, which runs one for the application. This matches Python, which gates the same sweep on `not conductor_key and not dbos_cloud`. The gate bites on DBOS Cloud, where the executor id comes from `DBOS__VMID` and survives a restart: a self sweep there re-enqueues rows the process being replaced may still be running. Off Cloud a Conductor executor takes a fresh random id each launch, so the sweep finds nothing of its own to move and only costs a query. ### Test `aConductorManagedExecutorDoesNotSelfRecoverAtLaunch` seeds a PENDING row under a fixed executor id, relaunches under `DBOS__CLOUD=true` with that same `DBOS__VMID`, and asserts the row is untouched; then relaunches self-managed to show it isn't stranded. Verified as a real negative control \u2014 with the gate forced to `false` it fails `expected: but was: `. It lives in `ConfigEnvTest` rather than `RecoveryServiceTest` because env vars are JVM-global and the suite runs tests concurrently; `ConfigEnvTest` is `@Isolated` + `SAME_THREAD` for exactly that reason. (Placed in `RecoveryServiceTest` first, the leaked `DBOS__CLOUD` hung `recoveryThreadTest`.) `spotlessCheck`, `compileTestJava`, `javadoc` pass; `RecoveryServiceTest` + `ConfigEnvTest` are 23/23. ### Note TypeScript looks to have the same gap \u2014 `dbos-executor.ts` calls `recoverPendingWorkflows([this.executorID])` in `init()` with no gate, and sets a random executor ID under Conductor the same way Java does, so the Cloud case is exposed there too. Not addressed here. Fixes #536 \ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "tokens": 479} {"id": 730649, "source": "commit", "repo": "dbos-inc/dbos-transact-java", "text": "Fix Flaxy Tests (#396) A bunch of tests were failing because of an execution window where a workflow was started before recoverPendingWorkflows on launch could run, thus attempting to recover workflows started by tests instead of previously pending. switched to using listWorkflows with a withEndTime clause prior to launch completion. Also took the opportunity to remove sys db getPendingWorkflows since listWorkflows can handle that Also fixed a couple of other minor test issues + a missing conductor pingTimeout cancellation", "tokens": 98} {"id": 730766, "source": "commit", "repo": "dbos-inc/dbos-transact-java", "text": "enable auto release (#172) https://vanniktech.github.io/gradle-maven-publish-plugin/central/#publishing-releases", "tokens": 34} {"id": 731069, "source": "commit", "repo": "dc37/super-mario-paint", "text": "doc: harmonize doc in StaffArrangement", "tokens": 11} {"id": 731152, "source": "commit", "repo": "dc37/super-mario-paint", "text": "Implemented Staff.getSoundPlayer Also made the soundPlayer field final", "tokens": 14} {"id": 731247, "source": "commit", "repo": "dc37/super-mario-paint", "text": "Disable mouse event with model property Might be slightly less efficient but I want to remove that getter for the event handler.", "tokens": 24} {"id": 731268, "source": "commit", "repo": "dc37/super-mario-paint", "text": "Moving with Shift jumps between colored lines", "tokens": 10} {"id": 731291, "source": "commit", "repo": "dc37/super-mario-paint", "text": "Added method resize to StaffSequence Also fixed getLine to avoid linear recursive descent", "tokens": 18} {"id": 731525, "source": "commit", "repo": "ddd-by-examples/library", "text": "#21 Added lombok configuration to add generated annotation.", "tokens": 12} {"id": 732088, "source": "commit", "repo": "defano/wyldcard", "text": "Focusing stack window when programmatically selecting parts", "tokens": 11} {"id": 732235, "source": "commit", "repo": "defano/wyldcard", "text": "Added 'go back' command support; renamed zoom effects", "tokens": 12} {"id": 732540, "source": "commit", "repo": "DemchaAV/GraphCompose", "text": "feat(api): LineBuilder.fill() \u2014 line stretches to its available width (#234) A line drew at its authored width; there was no way to make it span its column or the content width without computing that width by hand. fill() stretches a horizontal line to the width available where it is placed \u2014 its row column, or the content width at flow level \u2014 so a dotted leader runs from one column to the next on its own. It is the flex line behind a table-of-contents row. Resolved in LineDefinition: a fill line measures to the available width and draws to the box's right edge; fill is a no-op on a vertical or diagonal line, where stretching the end point would change the slope. A non-fill line is unchanged, so existing line output is byte-identical. Tests: LineFillTest covers a fill line resolving to its row slot and to the content width at flow level, a non-fill line keeping its authored width, and fill as a no-op on a vertical line. Example: LineFillExample (full-width rule, dotted leader, weighted leader-to-number row). Full suite green, no visual baselines changed.", "tokens": 265} {"id": 732731, "source": "commit", "repo": "DemchaAV/GraphCompose", "text": "Add timeline minimal CV template and gallery support", "tokens": 11} {"id": 733011, "source": "commit", "repo": "denizenscript/denizen", "text": "add location. and entity. precise_target", "tokens": 10} {"id": 733167, "source": "commit", "repo": "denizenscript/denizen", "text": "Efficiency - world events Make world event code a bit more efficient by avoiding Regex's", "tokens": 20} {"id": 733441, "source": "commit", "repo": "derickfelix/bankapplication", "text": "Mix deposit and withdraw into one model Operation", "tokens": 11} {"id": 733784, "source": "commit", "repo": "devnatan/inventory-framework", "text": "Replace `watch` by `updateOnStateChange` (#447)", "tokens": 16} {"id": 733946, "source": "commit", "repo": "devnatan/inventory-framework", "text": "Mark `with` from AbstractVirtualView as `final`", "tokens": 13} {"id": 734361, "source": "commit", "repo": "devoxx/DevoxxGenieIDEAPlugin", "text": "Fix #657 RAG made a bit more robust", "tokens": 13} {"id": 734747, "source": "commit", "repo": "devs-immortal/paradise-lost", "text": "[Fix] Ensure Signs are allocated to the Atlas Texture Reference: #587", "tokens": 20} {"id": 735454, "source": "commit", "repo": "dipjyotimetia/hybridtestframework", "text": "Update and rename bug_report.md to bug_report.yaml", "tokens": 15} {"id": 735621, "source": "commit", "repo": "dipjyotimetia/hybridtestframework", "text": "updated selenium version to 4.0 alpha2", "tokens": 12} {"id": 735708, "source": "commit", "repo": "direwolf20-mc/buildinggadgets", "text": "fix: #450 text alignment issues", "tokens": 10} {"id": 735757, "source": "commit", "repo": "direwolf20-mc/buildinggadgets", "text": "Improve Size Checks and disable failing Tests.", "tokens": 10} {"id": 736037, "source": "commit", "repo": "direwolf20-mc/buildinggadgets", "text": "Added a toggle for Absolute vs Relative coords", "tokens": 11} {"id": 736197, "source": "commit", "repo": "DJ-Raven/swing-modal-dialog", "text": "Pagination: move from demo project to modal-dialog extras", "tokens": 12} {"id": 736230, "source": "commit", "repo": "DJ-Raven/swing-modal-dialog", "text": "Modal: fixed modal lightWeight `relativeToOwner` child modal was not closing after parent was closed", "tokens": 21} {"id": 736239, "source": "commit", "repo": "DJ-Raven/swing-modal-dialog", "text": "Demo: intelliJ removed `Gruvbox Dark Medium` and `Gruvbox Dark Soft`", "tokens": 27} {"id": 736701, "source": "commit", "repo": "docling-project/docling-java", "text": "chore(deps): Update Gradle Wrapper 9.2.0 to 9.2.1 (#92) - Update Gradle Wrapper to 9.2.1 and add checksum for validation - Refine GitHub Workflows to leverage the Gradle caching from the Setup Gradle action instead of Setup Java - Remove redundant Gradle Wrapper Validation workflow since it's already performed by Setup Gradle action - Optimize Git checkout operations in GitHub Workflows so that only the current branch is downloaded", "tokens": 97} {"id": 736740, "source": "commit", "repo": "docling-project/docling-java", "text": "Add 'docs:' prefix to commit message and title", "tokens": 12} {"id": 736965, "source": "commit", "repo": "docusign/docusign-esign-java-client", "text": "getting ready for version 2.2.0 release", "tokens": 12} {"id": 737071, "source": "commit", "repo": "dodie/scott", "text": "Handle line breaks in the report (#98) - fix", "tokens": 13} {"id": 737128, "source": "commit", "repo": "dodie/scott", "text": "Rename manually_specify_agent.md to manual_setup.md", "tokens": 16} {"id": 737388, "source": "commit", "repo": "doist/recyclerviewextensions", "text": "Handle stopping when a layout is being computed Also, invalidating RV is unecessary as invalidating item decorations already relayouts.", "tokens": 28} {"id": 737528, "source": "commit", "repo": "doist/recyclerviewextensions", "text": "Remove usage of deprecated methods in RV 22 Also fixes StickyHeaders position calculations by using a clearer and simpler algorithm.", "tokens": 27} {"id": 738385, "source": "commit", "repo": "dreamhead/moco", "text": "upgraded proguard to 6.1.1", "tokens": 10} {"id": 738630, "source": "commit", "repo": "dreamhead/moco", "text": "upgraded http client to 4.3.4", "tokens": 11} {"id": 738864, "source": "commit", "repo": "Drive-for-Java/MyCMD", "text": "Add Maven support to Dependabot configuration Added Maven package ecosystem to Dependabot configuration.", "tokens": 17} {"id": 739046, "source": "commit", "repo": "dromara/ruoyi-vue-plus", "text": "update sa-token 1.28.0 => 1.29.0", "tokens": 21} {"id": 739184, "source": "commit", "repo": "dropbox/dropbox-sdk-java", "text": "Created an Android Artifact, Added a Manifest Entry, Added version catalogs (#414)", "tokens": 21} {"id": 739221, "source": "commit", "repo": "dropbox/dropbox-sdk-java", "text": "append 'f' at the end of float value (#341) This gets rid of loss precision warning when assigning double value to floats.", "tokens": 32} {"id": 739225, "source": "commit", "repo": "dropbox/dropbox-sdk-java", "text": "Prepare for release 4.0.1 (#331)", "tokens": 15} {"id": 739341, "source": "commit", "repo": "dropbox/dropbox-sdk-java", "text": "Added Openwith code and example in android for 3.0.1 release", "tokens": 17} {"id": 739956, "source": "commit", "repo": "dubesar/ultimate-java-resources", "text": "Project: Spin the bottle - Update future work", "tokens": 12} {"id": 740581, "source": "commit", "repo": "dynamictreesteam/dynamictrees", "text": "cancelers working biomes unhandled Took 1 hour 32 minutes", "tokens": 14} {"id": 740649, "source": "commit", "repo": "dynamictreesteam/dynamictrees", "text": "added sapling_name and seed_name to species to allow customizing the names of seeds and saplings", "tokens": 25} {"id": 740694, "source": "commit", "repo": "dynamictreesteam/dynamictrees", "text": "Added leaves to shaders/block.properties for wavy leaves with shaders.", "tokens": 19} {"id": 741026, "source": "commit", "repo": "earlygrey/shapedrawer", "text": "Fix the call link of rectangle(Rectangle)", "tokens": 10} {"id": 741034, "source": "commit", "repo": "earlygrey/shapedrawer", "text": "individual drawers are required to push vertex colours individually, currently they just push the default colour", "tokens": 20} {"id": 741071, "source": "commit", "repo": "earlygrey/shapedrawer", "text": "added pushTriangle, and PolygonShapeDrawer uses this method to draw a single triangle", "tokens": 18} {"id": 741098, "source": "commit", "repo": "earlygrey/shapedrawer", "text": "more sides in ellipse estimate and small refactor of polygon drawer", "tokens": 12} {"id": 741104, "source": "commit", "repo": "earlygrey/shapedrawer", "text": "basic functionality of from/to angles in PolygonDrawer", "tokens": 13} {"id": 741254, "source": "commit", "repo": "earthcomputer/enchantmentcracker", "text": "Track inputs, highlight errors, and clear fields on reset", "tokens": 12} {"id": 741404, "source": "commit", "repo": "eclipse-repairnator/repairnator", "text": "Improve mail notification for end of process (#678) fix #546 Attempt at resolving issue #546. If I have understood the end of process notification correctly, then the start and end of the repair attempt was already mentioned in the mail. The only thing lacking was the duration, or if duration is not the same as uptime I have made a mistake. Should I perhaps `config.getInstance().getDuration().toString()` instead?", "tokens": 93} {"id": 741576, "source": "commit", "repo": "eclipse-repairnator/repairnator", "text": "Change the list of bugs for may w4", "tokens": 10} {"id": 741789, "source": "commit", "repo": "eclipse/repairnator", "text": "remove AUTOGENERATED FILE full of Github flagged security vulnerabilities", "tokens": 14} {"id": 741812, "source": "commit", "repo": "eclipse/repairnator", "text": "Update README.md (#611)", "tokens": 10} {"id": 741841, "source": "commit", "repo": "eclipse/repairnator", "text": "Avoid NPE when bearsMode is not set in config.", "tokens": 13} {"id": 741903, "source": "commit", "repo": "eclipse/repairnator", "text": "Update list of projects after cleaning it #334. Also put new code in sandbox for getting projects from Github trending.", "tokens": 27} {"id": 741977, "source": "commit", "repo": "eclipse/repairnator", "text": "Refactoring: create launcher for pipeline (#110) * Add a new launcher in pipeline to launch a pipeline as a standalone job. * Continue to create a main in pipeline. * Add some more logging information * Refactor repairnator-pipeline to be used in standalone. * Fix a serialization issue.", "tokens": 62} {"id": 742010, "source": "commit", "repo": "eclipse/repairnator", "text": "RepairNator: fix errors related to refactoring of serialization", "tokens": 13} {"id": 742038, "source": "commit", "repo": "eidottermihi/rpicheck", "text": "added links in documentation (#234) * Added fastlane, fixed spelling and minor documentaion extension for SBCs * added links in documentation", "tokens": 32} {"id": 742093, "source": "commit", "repo": "eidottermihi/rpicheck", "text": "Update changelog for 1.8.7", "tokens": 10} {"id": 742532, "source": "commit", "repo": "elbukkit/magicplugin", "text": "Improve mage activate/lock/deactivate/unlock tab-completion", "tokens": 13} {"id": 742722, "source": "commit", "repo": "elbukkit/magicplugin", "text": "Don't tick NPC mages at all", "tokens": 10} {"id": 742777, "source": "commit", "repo": "elbukkit/magicplugin", "text": "Fix using Feed action with a negative \"feed\" parameter", "tokens": 13} {"id": 743413, "source": "commit", "repo": "ellpeck/actuallyadditions", "text": "I don't even know the person But I'm a nice person.", "tokens": 17} {"id": 743790, "source": "commit", "repo": "emilyploszaj/emi", "text": "Fix recipe tree click crash fixes #180", "tokens": 11} {"id": 743994, "source": "commit", "repo": "emilyploszaj/trinkets", "text": "Add Japanese translation (#291)", "tokens": 10} {"id": 744063, "source": "commit", "repo": "emilyploszaj/trinkets", "text": "Add hat & shoes slots", "tokens": 10} {"id": 744141, "source": "commit", "repo": "emir/AIKON", "text": "Loading placeholders and a short entry movement (phone 0.13.5 build 043) Lists show grey placeholder rows while they load (chats, search, saved, models, photo folders) instead of 'Loading...'. Lists and text pages settle in from 18 px to the right in three 40 ms steps when they open (Enter).", "tokens": 85} {"id": 744160, "source": "commit", "repo": "emir/AIKON", "text": "AIKON in capitals everywhere (phone 0.12.2 build 033, server 0.9.2) The name is written AIKON in the app (MIDlet-Name, splash, texts), the server, the docs and the tools. Changing MIDlet-Name makes phones see a new app: the setup comes back from the backup file; delete the old \"AIKon\" in the phone menu. The designer's wordmark image still reads \"AIKon\" until a new one comes. The model picker no longer fails when the list of costs is shorter than the list of models (the emulator harness sets the list without costs).", "tokens": 150} {"id": 744170, "source": "commit", "repo": "emir/AIKON", "text": "The designer's AIKON mark: white AK monogram on a blue tile Replaces the keypad bubble. Logo.java draws it with primitives from coordinates measured on the 1254 px artwork (A diagonal, short bar, shared stem, K arms on a #0740DE rounded square); make_art.py draws the same polygons for the 46x48 icon, logo.png and the promo images (the overlay with the original differs only along the edges). The splash builds the monogram stroke by stroke. README images regenerated.", "tokens": 133} {"id": 744302, "source": "commit", "repo": "Engine-Room/Flywheel", "text": "Twas a snowy night full of scripting the builds - Post merge fixes - Remove stubs", "tokens": 24} {"id": 744411, "source": "commit", "repo": "Engine-Room/Flywheel", "text": "Smart lighting - Do not delete light volume memory when invalidated. Keep the block around, and then use it again later when we collect more light - Do not allocate fresh memory blocks when growing a light volume. Turns out self-blitting is perfectly fine since we always start from the volume's origin - Inline BoxSet back into light volume. The precise tracking it did is no longer relevant now that the embedding api has been simplified - Light volumes now directly", "tokens": 96} {"id": 744548, "source": "commit", "repo": "Engine-Room/Flywheel", "text": "Too much fun with boids - Fix tickable instances ticking while paused - Fix CME on effect origin shift - ExampleEffect is now boids fireflies - Better tick/update load distribution with small instance counts", "tokens": 46} {"id": 744587, "source": "commit", "repo": "Engine-Room/Flywheel", "text": "Batching is not actually compatible with shaders", "tokens": 10} {"id": 744856, "source": "commit", "repo": "enofex/taikai", "text": "Provide a new Logging Rule checking a Logger Usage Based on Classes Matching Regex Closes gh-54", "tokens": 25} {"id": 745004, "source": "commit", "repo": "eobermuhlner/big-math", "text": "BigFloat NAN,+INF,-INF", "tokens": 10} {"id": 745009, "source": "commit", "repo": "eobermuhlner/big-math", "text": "switch to release 2.1.0 in gradle", "tokens": 12} {"id": 745016, "source": "commit", "repo": "eobermuhlner/big-math", "text": "measure performance toBigDecimal() to 1000000", "tokens": 15} {"id": 745051, "source": "commit", "repo": "eobermuhlner/big-math", "text": "rename round() to roundWithTrailingZeroes() + correct behaviour", "tokens": 12} {"id": 745419, "source": "commit", "repo": "epam/ngb", "text": "Issue 946 Patents search - search drugs by ids - fix no data found cases (#1091)", "tokens": 30} {"id": 745611, "source": "commit", "repo": "epam/ngb", "text": "Molecular viewer enhancements (#547) - saving miew session", "tokens": 18} {"id": 746362, "source": "commit", "repo": "esotericsoftware/yamlbeans", "text": "Updated tag URI chars. Left minus in there, despite not being in the spec: http://www.yaml.org/spec/1.2/spec.html#ns-uri-char YAML is silly. closes #68", "tokens": 51} {"id": 746363, "source": "commit", "repo": "esotericsoftware/yamlbeans", "text": "Release 1.13 (#89) * update pom for release 1.13 * add travis file", "tokens": 25} {"id": 746575, "source": "commit", "repo": "eugenp/tutorials", "text": "BAEL-9434: Streaming Response in Spring AI ChatClient (#18813)", "tokens": 23} {"id": 746645, "source": "commit", "repo": "eugenp/tutorials", "text": "Update apache-libraries-2/src/test/java/com/baeldung/avro/AvroDefaultValuesUnitTest.java", "tokens": 27} {"id": 746646, "source": "commit", "repo": "eugenp/tutorials", "text": "[JAVA-28920] Upgrade FEIGn to Spring Boot 3. (#16768)", "tokens": 28} {"id": 747042, "source": "commit", "repo": "EvenMoreFish/EvenMoreFish", "text": "Update MessageLib to 1.0.6", "tokens": 11} {"id": 747381, "source": "commit", "repo": "EvenMoreFish/EvenMoreFish", "text": "Update messages_fr.yml - Fixed missing translation - Added message from config-version 6 - Updated comment in French", "tokens": 26} {"id": 747384, "source": "commit", "repo": "EvenMoreFish/EvenMoreFish", "text": "Fixed fish broadcast sometimes not being sent to players", "tokens": 10} {"id": 747504, "source": "commit", "repo": "exacaster/lighter", "text": "Checkout ref (#810) Use issue number for branch image", "tokens": 14} {"id": 748084, "source": "commit", "repo": "exceptionflug/protocolize", "text": "Now use new version independent sound names in packet", "tokens": 10} {"id": 748104, "source": "commit", "repo": "exceptionflug/protocolize", "text": "Better 1.13 support regarding inventories", "tokens": 10} {"id": 748328, "source": "commit", "repo": "exercism/java", "text": "[#1540]Binary search: Update error handling (#1635) * Update version file v2.2.0 --> v2.3.0 * Modiy error handling mechanism", "tokens": 43} {"id": 748493, "source": "commit", "repo": "exercism/java", "text": "remove final from class declaration in saddle-points exercise", "tokens": 14} {"id": 748549, "source": "commit", "repo": "exercism/java", "text": "Nucleotide-count: use JUnit's @Rule feature", "tokens": 13} {"id": 748685, "source": "commit", "repo": "exlll/configlib", "text": "Add serialization support for Bukkit's ConfigurationSerializable types", "tokens": 11} {"id": 748895, "source": "commit", "repo": "exopandora/shouldersurfing", "text": "Rotate camera with player when riding a boat and camera is coupled", "tokens": 15} {"id": 749020, "source": "commit", "repo": "exopandora/shouldersurfing", "text": "Update to forge 41.0.64", "tokens": 12} {"id": 749527, "source": "commit", "repo": "fabienrenaud/java-json-benchmark", "text": "Upgrade javax.json version to 1.1.2 for jsr-374", "tokens": 20} {"id": 749770, "source": "commit", "repo": "fabioz/startexplorer", "text": "maxium constraint for table column width in preference page", "tokens": 11} {"id": 749870, "source": "commit", "repo": "fabricmc/fabric-loom", "text": "Update Tiny Remapper to 0.11.2 (#1342)", "tokens": 20} {"id": 749915, "source": "commit", "repo": "fabricmc/fabric-loom", "text": "Add manifest entry allowing deps to define known bsms (#1111)", "tokens": 17} {"id": 750337, "source": "commit", "repo": "facebook/stetho", "text": "Allow hitting empty viewgroups This was implemented previously to get around an issue with overlays. This was wrong and should be implemented by making overlays non-focusable instead.", "tokens": 36} {"id": 750461, "source": "commit", "repo": "facebook/stetho", "text": "Fix javadoc errors on Java 8 Java 8 became much more strict about enforcement of HTML syntax and rules which breaks the norms we were previously adhering too.", "tokens": 36} {"id": 750506, "source": "commit", "repo": "facebook/stetho", "text": "Fix FragmentActivity class equality issue It must be isInstance else it would require that the Activity actually be FragmentActivity directly. This does not occur in practice, of course.", "tokens": 35} {"id": 750511, "source": "commit", "repo": "facebook/stetho", "text": "Introduce plugin framework for Console tab evaluation support This allows third parties to provide their own REPL implementation to interpret commands from the Console. Eventually we'd like to explore possibly using bsh or some other Java evaluation framework that is enabled if detected in the classpath. This is the first small step in that direction. Tested that exception processing and arbitrary object return types do indeed work.", "tokens": 80} {"id": 750613, "source": "commit", "repo": "facebookincubator/battery-metrics", "text": "fbsource//fbandroid/libraries/batterymetrics/metrics/src/main/java/com/facebook/battery/metrics/appwakeup:appwakeup Differential Revision: D119485578 fbshipit-source-id: 31a1ab55ff2d6bd1fd99a635e770e2cea8f6c2ab", "tokens": 87} {"id": 750725, "source": "commit", "repo": "facebookincubator/battery-metrics", "text": "fbandroid/libraries/batterymetrics/metrics/src/main/java/com/facebook/battery/metrics/appwakeup/AppWakeupMetrics.java Reviewed By: jocelynluizzi13 Differential Revision: D62628961 fbshipit-source-id: 84095d5ccd5a28019d59060551120b41e65df9e2", "tokens": 100} {"id": 750744, "source": "commit", "repo": "facebookincubator/battery-metrics", "text": "fbandroid/libraries/batterymetrics/metrics/src/main/java/com/facebook/battery/metrics/disk/DiskMetrics.java Reviewed By: nicholeic Differential Revision: D60913670 fbshipit-source-id: ad359ee4e6ddc4a551b5471ff1e663c95bd16656", "tokens": 92} {"id": 750746, "source": "commit", "repo": "facebookincubator/battery-metrics", "text": "fbandroid/libraries/batterymetrics/metrics/src/main/java/com/facebook/battery/metrics/cpu/Sysconf.java Reviewed By: nicholeic Differential Revision: D60913579 fbshipit-source-id: 95eba6367222f24cadb38144726e0d001cbe5fde", "tokens": 92} {"id": 750763, "source": "commit", "repo": "facebookincubator/battery-metrics", "text": "//fbandroid/libraries/batterymetrics/serializers/src/main/java/com/facebook/battery/serializer/disk:disk Differential Revision: D51019954 fbshipit-source-id: 8e014599d18dd312ab5582b329a8142f250487a4", "tokens": 87} {"id": 750839, "source": "commit", "repo": "facebookincubator/battery-metrics", "text": "Fix package name for serializers Summary: Fix package names. Differential Revision: D10158910 fbshipit-source-id: b1f84b22f8aca63a3db04a5f5513db5506ffdd1b", "tokens": 67} {"id": 750841, "source": "commit", "repo": "facebookincubator/battery-metrics", "text": "Add a reporter for app wakeup metrics Summary: Add an explicit reporter for app wakeup metrics, and cleaned up a little bit. Differential Revision: D10156899 fbshipit-source-id: c3006d6b3b834b34a1b39822ab439fca4abc349d", "tokens": 83} {"id": 750850, "source": "commit", "repo": "facebookincubator/battery-metrics", "text": "Ensure network bytes are always increasing Summary: If the collector notices that total bytes transferred have decreased, it simply disables itself for that session. From the logged battery session data I've noticed that suddenly the mobile data or wifi data or both might get reset to zero: since I can't simple just restart from zero again taking the more conservative approach af disabling the collector completely for now. Differential Revision: D7230387 fbshipit-source-id: 0abb9c49e33614f4290486ed8f8b90485c99381e", "tokens": 143} {"id": 750871, "source": "commit", "repo": "facebookincubator/battery-metrics", "text": "Revert D6407089: [Battery-Metrics][PR] fix(reporters)(serializers): Wrong package statement Summary: This reverts commit 4b4e6b905012d61f4ae9e91839628dc5ccb5b58a bypass-lint Differential Revision: D6407089 fbshipit-source-id: 6d0563f8c99617e1cb01297d09c5a5825d5f083f", "tokens": 135} {"id": 750899, "source": "commit", "repo": "faforever/downlords-faf-client", "text": "Add multiple map generation (#3534) * Add multiple map generation * Creating and using CSS * Refactoring on fxThreadExecutor * Reconfiguration on i18n * Changing the map generation via \"--num-to-generate\" * Optimization * Update 'Map select' * Increased the limit of generation maps. * Combine buttons into 1 * Fix after code review and optimizations * Fix parse GeneratorPrefs * Fix parse GeneratorPrefs * Update Tests * Add listener * Change get image for maps * Made separate function * Set for empty run for runnable * Optimization * Optimization * Optimization * Optimization * Add close dialog after select map * Remove comment * Fix by coderabbitai * Change name constant * Update GenerateMapTask * Refactoring * Fix after code review * Fix after code review * clean up and fix selection display bugs ---------", "tokens": 169} {"id": 750982, "source": "commit", "repo": "faforever/downlords-faf-client", "text": "Use faf server for install4j download", "tokens": 10} {"id": 751011, "source": "commit", "repo": "faforever/downlords-faf-client", "text": "#803 - Redesign \"Coop\" tab (#2428)", "tokens": 19} {"id": 751025, "source": "commit", "repo": "faforever/downlords-faf-client", "text": "fix \"messages containing multiple hash signs results in spam\" (#2327)", "tokens": 18} {"id": 751189, "source": "commit", "repo": "faforever/downlords-faf-client", "text": "Fix #338 replay server tries to start twice", "tokens": 12} {"id": 751404, "source": "commit", "repo": "FallingColors/HexMod", "text": "zh_cn lang: fix tag name", "tokens": 10} {"id": 751565, "source": "commit", "repo": "FallingColors/HexMod", "text": "fix frozen colorizers being weird on fabric", "tokens": 10} {"id": 751587, "source": "commit", "repo": "FallingColors/HexMod", "text": "close #189 (anything under 1 tick is a no-op)", "tokens": 18} {"id": 751972, "source": "commit", "repo": "falsehoodmc/fabrication", "text": "Fix #473 (#476)", "tokens": 11} {"id": 752057, "source": "commit", "repo": "falsehoodmc/fabrication", "text": "update *.feature command syntax and LoaderFScript for feature.txt changes (#322)", "tokens": 21} {"id": 752396, "source": "commit", "repo": "fancymcplugins/fancyholograms", "text": "Update api-version to 1.19", "tokens": 11} {"id": 752672, "source": "commit", "repo": "fancymcplugins/fancynpcs", "text": "Update chatcolorhandler to 5.0.1", "tokens": 12} {"id": 753341, "source": "commit", "repo": "farin/jcloisterzone", "text": "area layer - added z-index support based on feature type", "tokens": 13} {"id": 753394, "source": "commit", "repo": "farin/jcloisterzone", "text": "fixed #89 - overflowing in players panel", "tokens": 11} {"id": 754176, "source": "commit", "repo": "FixedDev/command-flow", "text": "Make the fields of the platform wrappers protected, to allow them to be extended", "tokens": 17} {"id": 754223, "source": "commit", "repo": "FixedDev/command-flow", "text": "If the command is already set, return the suggestions of the subcommand", "tokens": 14} {"id": 754346, "source": "commit", "repo": "flameish/novel-grabber", "text": "Added the option to block specific telegram users.", "tokens": 10} {"id": 754659, "source": "commit", "repo": "FlashyReese/nuit", "text": "fix: Refresh Architectury metadata before IDE launches", "tokens": 14} {"id": 755009, "source": "commit", "repo": "FlashyReese/nuit", "text": "Yeet parsers Changes to be committed: modified: src/main/java/io/github/amerebagatelle/fabricskyboxes/SkyboxManager.java modified: src/main/java/io/github/amerebagatelle/fabricskyboxes/resource/SkyboxResourceListener.java modified: src/main/java/io/github/amerebagatelle/fabricskyboxes/skyboxes/AbstractSkybox.java new file: src/main/java/io/github/amerebagatelle/fabricskyboxes/skyboxes/LegacyDeserializer.java modified: src/main/java/io/github/amerebagatelle/fabricskyboxes/skyboxes/MonoColorSkybox.java modified: src/main/java/io/github/amerebagatelle/fabricskyboxes/skyboxes/SkyboxType.java modified: src/main/java/io/github/amerebagatelle/fabricskyboxes/skyboxes/textured/AnimatedSquareTexturedSkybox.java modified: src/main/java/io/github/amerebagatelle/fabricskyboxes/skyboxes/textured/SquareTexturedSkybox.java modified: src/main/java/io/github/amerebagatelle/fabricskyboxes/skyboxes/textured/TexturedSkybox.java", "tokens": 236} {"id": 755178, "source": "commit", "repo": "flashyreese/reeses-sodium-options", "text": "new: Port to Minecraft `1.21.6` & Sodium `0.6.13`", "tokens": 24} {"id": 755380, "source": "commit", "repo": "flightstats/hub", "text": "Sort returned errors by timestamp so that we can trust our assertions a little more", "tokens": 16} {"id": 755453, "source": "commit", "repo": "flightstats/hub", "text": "Added some additional info to the 404 response.", "tokens": 13} {"id": 755613, "source": "commit", "repo": "flightstats/hub", "text": "let the spoke store decide it's own path", "tokens": 11} {"id": 755873, "source": "commit", "repo": "floci-io/floci", "text": "fix(ses): authorize the SES v2 operations and routes botocore added since the rule table (#4811) Follow-up from the review of #4775. The SES v2 rules in IamActionRegistry came from botocore 1.43.62's model. The current model (botocore develop at 9931e9741, 2026-09-29) adds four operations, AssociateEmailIdentityCertificate, DisassociateEmailIdentityCertificate, ListEmailIdentityCertificates and UpdateConfigurationSet, and moves two: ListConfigurationSets is now POST /v2/email/list-configuration-sets and ListEmailIdentities POST /v2/email/list-identities, each taking a Filter in the body, where they were GET /v2/email/configuration-sets and GET /v2/email/identities. Each new route gets its rule, mapped to the action AWS's service reference lists for it (ses: in every case). The two GET routes keep theirs, since older SDKs, and Floci's own routes, still use them. 118 routes in all; no two can match the same path. Floci serves none of the new routes yet, so nothing was exposed; the rules make sure they are authorized from the day a route lands. The test table is regenerated from the current model and the service reference; its six new rows fail without the new rules.", "tokens": 325} {"id": 755896, "source": "commit", "repo": "floci-io/floci", "text": "feat(cloudmap): honor service TTL in DNS A answers (#4448) * feat(cloudmap): honor service TTL in DNS A answers * fix(cloudmap): distinguish DNS no-data and reject case collisions * fix(cloudmap): resolve SRV instance A hostnames * refactor(cloudmap): simplify DNS answer states and resolver Give DnsAnswer explicit records, noData and nxDomain factories, drop the test-only buildAResponse overload, split Cloud Map name resolution into service and instance-hostname lookups, and parse DnsConfig once on CreateService. * fix(cloudmap): lowercase DNS names independent of the default locale * fix(route53): answer private zone DNS with the record set TTL Port Route53DnsRecordSource to DnsAnswer after rebasing onto #4353. Answers carry the record set TTL, a flattened CNAME chain uses the shortest TTL in the chain, and an alias uses its target's. A name absent from the zone gets NXDOMAIN; a name with records but no A gets NOERROR with no answers. * fix(route53): answer empty non-terminals with no data and cap external CNAME TTL A private zone name with records only beneath it exists in DNS, so it now answers NOERROR with no A records instead of NXDOMAIN. A CNAME to a name outside the private zones answers with at most 60 seconds, matching the alias path, since the target's own TTL is not visible. * fix(route53): stop wildcards matching at or beneath empty non-terminals A name with records only beneath it exists, so under RFC 4592 a wildcard from a farther ancestor must not answer for it or for names below it. The closer-name check now counts any record sharing an ancestor with the query name, including wildcard owners, so a closer wildcard also shadows a parent wildcard.", "tokens": 414} {"id": 755970, "source": "commit", "repo": "floci-io/floci", "text": "fix(docker): stop the bundled AWS CLI fetching URL-valued parameters (#3426) The image installs the AWS CLI with pip, which ships only v1, and v1 treats a parameter value that looks like a URL as a pointer to fetch rather than as the value. awscli/paramfile.py reads cli_follow_urlparam with a default of true, so an init hook in /etc/floci/init/ready.d putting an SSM parameter such as MY_API_URL=https://example.com fails with \"Unable to retrieve https://example.com\", and a hook that backgrounds its calls loses that silently. AWS CLI v2 dropped the behaviour, so this never reproduces when the same script is run from a host with v2 installed, only inside the image. Disabling the setting in the profile the image bakes fixes it for every hook; setting it at runtime does not work, because aws configure set writes to a root-owned file while hooks run after the entrypoint's privilege drop. Mirrored into docker/Dockerfile.jvm-package, whose runtime stage is a copy of this one and is pinned to it by DockerfileRuntimeParityTest.", "tokens": 256} {"id": 756101, "source": "commit", "repo": "floci-io/floci", "text": "feat(cloudformation): provision AWS::EC2::VPCEndpoint (#1995) * feat(cloudformation): provision AWS::EC2::VPCEndpoint Maps VpcId/ServiceName/VpcEndpointType and the RouteTableIds/SubnetIds/ SecurityGroupIds reference lists onto the existing Ec2Service.createVpcEndpoint; DeleteStack removes the endpoint. Fixes #1994 * refactor(cloudformation): move VPCEndpoint into the per-service provisioner structure Ec2VpcEndpointCfnProvisioner implements CfnResourceProvisioner for AWS::EC2::VPCEndpoint and injects only Ec2Service. The registry discovers it via CDI, so the provision and delete switch arms plus the resolveIdList helper come out of CloudFormationResourceProvisioner. Two review fixes carried in with the move: - PrivateDnsEnabled now resolves through the template engine instead of props.path(...).asBoolean(false), so a Ref or parameter no longer collapses to false. An absent property passes null and Ec2Service applies the AWS default (true for Interface endpoints). - An update deletes the endpoint it replaced, so re-deploys no longer leave orphaned endpoints behind. A missing prior endpoint is tolerated. Adds an isolated unit test for the new provisioner; the existing CloudFormationVpcEndpointIntegrationTest still covers the end-to-end path. * feat(cloudformation): VPCEndpoint sets the CreationTimestamp attribute The registry schema lists Id, CreationTimestamp, NetworkInterfaceIds and DnsEntries as Fn::GetAtt attributes, and only Id was set. An unset attribute resolves to the literal \"LogicalId.CreationTimestamp\" rather than failing, so a template asking for it got a wrong value with nothing to signal it. Ec2Service already stamps the timestamp at create, so the provisioner renders it with the same format DescribeVpcEndpoints uses. NetworkInterfaceIds and DnsEntries are not modelled yet and stay unset.", "tokens": 420} {"id": 756106, "source": "commit", "repo": "floci-io/floci", "text": "feat(cloudfront): serve distribution requests from S3 and custom origins (#1820) * feat(cloudfront): serve distribution requests from S3 and custom origins * chore: re-run CI The Build and Test failure on the previous head was RuntimeApiServerTest's extension/stop race, a pre-existing flake unrelated to this change \u2014 it also failed on #1820, #1823 and on #2131's own branch (the PR that tried to de-flake it). Reproduced locally under `--cpus=1` and fixed separately. * fix(cloudfront): wildcard aliases match exactly one subdomain level wildcardAliasMatches did a plain suffix check, so \"*.example.com\" also matched a.b.example.com. AWS is explicit that a wildcard alternate domain name replaces the wildcard at that level only: \"you can't add alternate domain names that are at levels higher or lower than the wildcard. For example, you can't add the alternate domain names example.com or marketing.product.example.com.\" https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html Practical effect: a distribution owning \"*.example.com\" would answer for a.b.example.com, which on AWS belongs to whoever owns \"*.b.example.com\" \u2014 or to nobody. Require the label standing in for the wildcard to contain no dot. wildcardAliasesMatchSubdomainsAndPreferMoreSpecificNames asserted the old behaviour (a.b.example.test resolving to the *.example.test distribution); it now asserts no match, plus the same for a deeper wildcard. * test(dynamodb): retain Quarkus port for cleanup * fix(cloudfront): isolate mocked storage backends", "tokens": 393} {"id": 756208, "source": "commit", "repo": "floci-io/floci", "text": "fix(sns): enforce message size limits on Publish and PublishBatch (#783) * fix(sns): enforce message size limits on Publish and PublishBatch Real AWS SNS rejects oversized publish payloads: - Publish: message + Subject + message attributes must not exceed 262144 bytes, otherwise InvalidParameterException with \"Invalid parameter: Message too long\". - PublishBatch: total bytes across all entries (message + Subject + attributes per entry) must not exceed 262144, otherwise BatchRequestTooLong. Floci was silently accepting both, which broke the .NET conformance tests asserting these limits. Size accounting matches AWS: UTF-8 bytes for message and subject, plus per-attribute (name + type + value) bytes, with the binary-value byte length used directly for Binary attributes. Refs #768. * fix(sns): address review \u2014 apply size limit to SMS, fix batch attr cast Move the Publish size check before the SMS short-circuit so oversized SMS payloads are also rejected. Normalize PublishBatch MessageAttributes in SnsJsonHandler to MessageAttributeValue objects so SnsService.publishBatch's cast no longer risks a ClassCastException.", "tokens": 257} {"id": 756446, "source": "commit", "repo": "floci-io/floci-az", "text": "chore(ci): welcome first-time contributors on their first issue or PR (#151) Greets a contributor's first issue and first PR via actions/first-interaction. The PR message explains GitHub's first-timer gate (CI waits for maintainer approval), links the review conventions, and points at the community Slack. Uses pull_request_target for fork-PR token access; the job only posts a comment and never checks out or executes PR code.", "tokens": 100} {"id": 756643, "source": "commit", "repo": "floci-io/floci-gcp", "text": "fix(gke): reject non-string cluster version fields (#235)", "tokens": 18} {"id": 756724, "source": "commit", "repo": "floci-io/floci-gcp", "text": "feat: add Pub/Sub REST API (#65) * feat: add Pub/Sub REST API * fix: support canonical Pub/Sub REST patch bodies", "tokens": 36} {"id": 756730, "source": "commit", "repo": "floci-io/floci-gcp", "text": "fix(native): register Cloud Scheduler and Monitoring protos for native-image reflection (#66) floci-gcp depends on the gRPC stubs (grpc-google-cloud-scheduler-v1, grpc-google-cloud-monitoring-v3), not the GAPIC client libraries that ship reflect-config.json, so the proto message classes were not registered for native-image reflection. In native builds this broke: - Cloud Scheduler REST (gcloud): \"Invalid protobuf JSON: Generated message class com.google.cloud.scheduler.v1.Job missing method getName\". - Cloud Monitoring CreateTimeSeries: com.google.monitoring.v3.TypedValue missing getBoolValue() -> StatusRuntimeException INTERNAL. Add the SDK's authoritative reflect-config.json for com.google.cloud.scheduler.v1 and com.google.cloud.monitoring.v3 under META-INF/native-image, so GraalVM registers the message graphs. JVM builds were unaffected.", "tokens": 213} {"id": 756731, "source": "commit", "repo": "floci-io/floci-gcp", "text": "fix(kafka): seed read-write data volumes from the image (drop nocopy) (#67) ContainerBuilder.withNamedVolume mounted volumes with VolumeOptions.withNoCopy(true), so a fresh data volume was never seeded from the image and stayed root-owned. Non-root images such as Redpanda cannot write to it and crash on startup (mkdir /var/lib/redpanda/data/crash_reports: Permission denied), so Managed Kafka clusters never reached ACTIVE. Apply nocopy only to read-only volumes, which are pre-populated and must not be overlaid by the image (e.g. Cloud Run GCS snapshots). Read-write data volumes (Kafka, Cloud SQL) are now seeded from the image, preserving the initialized directory and ownership. Verified: clusters reach ACTIVE in ~5s, and the Cloud Run read-only GCS volume mount is unchanged.", "tokens": 199} {"id": 756817, "source": "commit", "repo": "floci-io/floci-oci", "text": "fix: refresh existing shallow checkouts in make refs (#48) `git pull --ff-only --depth 1` cannot fast-forward a depth-1 clone, and the `|| true` hid the failure, so local/oracle checkouts never moved after their first clone. Fetch at depth 1 and hard-reset to FETCH_HEAD instead, skip checkouts with local changes, and exit non-zero listing any repo that failed to update.", "tokens": 97} {"id": 757518, "source": "commit", "repo": "forax/loom-fiber", "text": "change to use the new virtual/lightweight API", "tokens": 11} {"id": 757538, "source": "commit", "repo": "forax/loom-fiber", "text": "rework the scheduler package to separate the schedulers from the data structures", "tokens": 14} {"id": 758797, "source": "commit", "repo": "frohoff/ysoserial", "text": "fix travis link + add jitpack (#194)", "tokens": 12} {"id": 758943, "source": "commit", "repo": "fxmorin/carpet-fixes", "text": "Updated to v1.19.3 + Insane cleanup", "tokens": 15} {"id": 758990, "source": "commit", "repo": "fxmorin/carpet-fixes", "text": "Push to v 1.8.10", "tokens": 11} {"id": 759045, "source": "commit", "repo": "fxmorin/carpet-fixes", "text": "New Rule: `hungerGoesDownInPeacefulFix`", "tokens": 14} {"id": 759431, "source": "commit", "repo": "g3g4x5x6/ultimate-cube", "text": "update to newVersion=6.6.16", "tokens": 12} {"id": 759592, "source": "commit", "repo": "gaigresearch/tabletopgames", "text": "Added ability to specify a Heuristic as a target in AbstractLearner/ExpertIteration", "tokens": 19} {"id": 759594, "source": "commit", "repo": "gaigresearch/tabletopgames", "text": "Made parameters tunable, and hence also non-final Removed hard-coding of 4 players (for future enhancement) Other fixes as per review.", "tokens": 31} {"id": 759707, "source": "commit", "repo": "gaigresearch/tabletopgames", "text": "Now returns best action so far if budget runs out", "tokens": 12} {"id": 759733, "source": "commit", "repo": "gaigresearch/tabletopgames", "text": "Support for MCGS special case of key to be based on redeterminising player", "tokens": 19} {"id": 760006, "source": "commit", "repo": "gaigresearch/tabletopgames", "text": "hashCode and _getUnknownComponentsIds functions fixed", "tokens": 11} {"id": 760285, "source": "commit", "repo": "games647/changeskin", "text": "Fix compatibility with NCP (Fixes #58)", "tokens": 12} {"id": 760584, "source": "commit", "repo": "games647/fastlogin", "text": "Always log invalid state messages Related #803 Related #806", "tokens": 16} {"id": 761554, "source": "commit", "repo": "gaming32/arrayv", "text": "antiqsort basics set the code at line 287 in ArrayVisualizer.java to `this.ANTIQSORT = true;` to use antiqsort", "tokens": 36} {"id": 761577, "source": "commit", "repo": "gaming32/arrayv", "text": "add printing of advanced timer summary to console window", "tokens": 10} {"id": 761708, "source": "commit", "repo": "gaucho-matrero/altoclef", "text": "Remove unused imports Removed the unused imports in `LootContainerTask`", "tokens": 14} {"id": 761789, "source": "commit", "repo": "gaucho-matrero/altoclef", "text": "Brief `ItemHelper` code review and `rawFood` stuff", "tokens": 15} {"id": 761804, "source": "commit", "repo": "gaucho-matrero/altoclef", "text": "Remove obvious \"divide-by-zero\" when running away from entities", "tokens": 15} {"id": 761840, "source": "commit", "repo": "gaucho-matrero/altoclef", "text": "Move some `equip`/`reach` functions around.", "tokens": 11} {"id": 761856, "source": "commit", "repo": "gaucho-matrero/altoclef", "text": "Fixed a major crash + amethyst block task is smarter", "tokens": 15} {"id": 761949, "source": "commit", "repo": "gaucho-matrero/altoclef", "text": "Match hostile entities to avoid entities, bruh moment", "tokens": 12} {"id": 761963, "source": "commit", "repo": "gaucho-matrero/altoclef", "text": "Attempt to use Async Block Scanning for BlockTracker", "tokens": 11} {"id": 762124, "source": "commit", "repo": "gazbert/bxbot", "text": "chore: Sonar fixes (#169)", "tokens": 10} {"id": 762373, "source": "commit", "repo": "gazbert/bxbot", "text": "Added extra payload logging for unexpected ItBit payload response Bot occasionally (once a month?) blows with: Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $ at com.google.gson.Gson.fromJson(Gson.java:899) at com.google.gson.Gson.fromJson(Gson.java:852) at com.google.gson.Gson.fromJson(Gson.java:801) at com.google.gson.Gson.fromJson(Gson.java:773) at com.gazbert.bxbot.exchanges.ItBitExchangeAdapter.getBalanceInfo(ItBitExchangeAdapter.java:480) ... 19 more Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $ at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:70) at com.google.gson.Gson.fromJson(Gson.java:887) ... 23 more Change will now dump out the actual payload returned in the response (for all API calls) to get to the bottom of this!", "tokens": 307} {"id": 762386, "source": "commit", "repo": "gazbert/bxbot", "text": "Re-structure of REST API packages and shifted Boot app up to the package root", "tokens": 18} {"id": 762872, "source": "commit", "repo": "gdgahmedabad/awesome-learning-resources", "text": "Update experts_to_follow.md Added Links for Chet Haase", "tokens": 20} {"id": 763020, "source": "commit", "repo": "geforce132/securitycraft", "text": "Fixed compile error in KeypadChestBlock related to chest connectivity", "tokens": 14} {"id": 763261, "source": "commit", "repo": "geforce132/securitycraft", "text": "fix compatibility with forge 37.0.49", "tokens": 13} {"id": 763319, "source": "commit", "repo": "geforce132/securitycraft", "text": "fix manual tooltips not completely showing on screen this requires forge 34.0.3 to be the minimum forge version", "tokens": 25} {"id": 763680, "source": "commit", "repo": "george8188625/Create-Electro-Energetics", "text": "0.0.15 - Rebalanced Electrocution. - Made entities actually grounded when standing on ground. - Actual current flow is now needed for electrocution. - Added heavily insulated wires. - Added a config option for electrocution. - Fixed the ConcurrentModificationException crash (I think).", "tokens": 80} {"id": 763852, "source": "commit", "repo": "georgewfraser/java-language-server", "text": "Fix null pointer when using scan(path, _) recursively", "tokens": 14} {"id": 763933, "source": "commit", "repo": "georgewfraser/java-language-server", "text": "Re-use work across code lenses", "tokens": 10} {"id": 764450, "source": "commit", "repo": "geysermc/floodgate", "text": "Added a way to get the Floodgate prefix using the API", "tokens": 12} {"id": 764746, "source": "commit", "repo": "geysermc/geyser", "text": "Expose emote stuff in API; different secure chat checking This should fix false flags from secure chat disablers doing funky things.", "tokens": 26} {"id": 764837, "source": "commit", "repo": "geysermc/geyser", "text": "Convert GameProfileData to record; remove confusing skin log `Registering bedrock skin for PLAYERNAME` is now just confusing as it implies something to do with Floodgate's skin system when it's just for Bedrock <-> Bedrock players.", "tokens": 49} {"id": 765681, "source": "commit", "repo": "geysermc/mcprotocollib", "text": "Rename ClientEntityInteractPacket to ClientPlayerInteractEntityPacket", "tokens": 11} {"id": 766088, "source": "commit", "repo": "giraud/reasonml-idea-plugin", "text": "fix NPE in BsConfig (getToolWindow)", "tokens": 11} {"id": 766382, "source": "commit", "repo": "gitflow-incremental-builder/gitflow-incremental-builder", "text": "[skip ci] prepare release v4.7.0", "tokens": 13} {"id": 766618, "source": "commit", "repo": "gitflow-incremental-builder/gitflow-incremental-builder", "text": "Add gib.help to TOC [skip travis]", "tokens": 12} {"id": 766960, "source": "commit", "repo": "GitHubSecurityLab/CodeQL-Community-Packs", "text": "C#: Adjust paths in test option files.", "tokens": 11} {"id": 767161, "source": "commit", "repo": "gitlab4j/gitlab4j-api", "text": "[Gradle Release Plugin] - pre tag commit: '6.0.0-rc.8'.", "tokens": 23} {"id": 767272, "source": "commit", "repo": "gitlab4j/gitlab4j-api", "text": "Added LOCKED value to MergeRequestState enum (#457).", "tokens": 16} {"id": 767561, "source": "commit", "repo": "gliscowo/isometric-renders", "text": "very basic websocket command server, this severely messes with my conscience", "tokens": 19} {"id": 767632, "source": "commit", "repo": "gluufederation/oxauth", "text": "fix: temp listener disabled #1595;", "tokens": 12} {"id": 767695, "source": "commit", "repo": "gluufederation/oxauth", "text": "Algorithm validation method on register client endpoint changed to use WebApplicationException instead of Pair class. #1062", "tokens": 24} {"id": 767863, "source": "commit", "repo": "gluufederation/oxauth", "text": "Version 3.2.0-SNAPSHOT", "tokens": 10} {"id": 768248, "source": "commit", "repo": "gluufederation/oxtrust", "text": "oxTrust : added support for native persistence cache type. https://github.com/GluuFederation/oxAuth/issues/654 (cherry picked from commit 920ea4c)", "tokens": 42} {"id": 768264, "source": "commit", "repo": "gluufederation/oxtrust", "text": "Users API - Groups #923 - source 1.6 compatibility bugfix", "tokens": 18} {"id": 768277, "source": "commit", "repo": "gluufederation/oxtrust", "text": "Protect oxTrust apis by UMA #803 - UmaSecure annotation", "tokens": 20} {"id": 768308, "source": "commit", "repo": "gluufederation/oxtrust", "text": "SAML - Override Logout Functionality #5", "tokens": 11} {"id": 768411, "source": "commit", "repo": "gluufederation/oxtrust", "text": "Sync clients and person inum length with oxAuth", "tokens": 11} {"id": 768442, "source": "commit", "repo": "gluufederation/oxtrust", "text": "OpenID Connect Client auto selected #230", "tokens": 11} {"id": 768638, "source": "commit", "repo": "gmu-swe/phosphor", "text": "* Started making a control stack for the loop aware semantics", "tokens": 13} {"id": 768776, "source": "commit", "repo": "gmu-swe/phosphor", "text": "Ensured that calls to checkTaint for a sink occur before taint tags applied to arguments from source or taintThrough code (if a method is both a sink and a source or taintThrough method). Incorrectly ordered or missing calls to super.visitCode() whoops.", "tokens": 56} {"id": 769268, "source": "commit", "repo": "gnembon/fabric-carpet", "text": "removing / reloading an app will cause all their scheduled calls to be cleaned as well.", "tokens": 18} {"id": 769277, "source": "commit", "repo": "gnembon/fabric-carpet", "text": "fixed chunks not updating properly, fixes #404", "tokens": 12} {"id": 770055, "source": "commit", "repo": "gnmyt/VoxelDash", "text": "Added online_players & max_players to the StatsRoute.java", "tokens": 16} {"id": 770168, "source": "commit", "repo": "godot-sdk-integrations/godot-admob", "text": "Documentation Refactor & Cleanup (#117) * ci: streamline docs workflow configuration * docs: reorganise API docs methods and properties into tables * docs: fix broken anchors and fix unresolved markdown reference - Replace invalid internal anchor links with correct targets: - #prerequisites.md for Prerequisites link - #build-customization for Build Customization link - build-system-architecture.md#iosconfig-spm-dependencies for IosConfig SPM Dependencies reference - Escape [x number of] in installation warning to fix unresolved markdown link reference warning * docs: reorganize build documentation into tables * docs: fix list indentation and formatting consistency * docs: fix admonition block indentation and clean up markdown formatting * docs: misc documentation cleanup * docs: add documentation guidelines page", "tokens": 169} {"id": 770250, "source": "commit", "repo": "godot-sdk-integrations/godot-admob", "text": "Fix UMPConsentViewController crash by allowing all orientations. (#29)", "tokens": 17} {"id": 770297, "source": "commit", "repo": "gosimplellc/nbvcxz", "text": "Add test for concurrent use to ensure the results are the same when the same Nbvcxz is used concurrently by multiple threads when calling estimate. Refactored the tests for less code duplication.", "tokens": 39} {"id": 770417, "source": "commit", "repo": "gotify/android", "text": "chore: version 2.8.2", "tokens": 10} {"id": 770928, "source": "commit", "repo": "gradusnikov/eclipse-chatgpt-plugin", "text": "Add gitStagePatch tool for selective staging and GitServiceTest - Add stagePatch() to GitService: applies a unified diff to the index only, leaving the working tree unchanged. Enables partial file staging for selective commits. - Expose as gitStagePatch MCP tool in EclipseGitMcpServer - Add GitServiceTest with 17 tests covering: stagePatch, status, log, diff, branches, checkout, reset, stash, add, commit - Test creates a temporary Eclipse project with a local JGit repo and connects via EGit for realistic integration testing", "tokens": 115} {"id": 771074, "source": "commit", "repo": "gradusnikov/eclipse-chatgpt-plugin", "text": "Commenting out replaceLines LLMs don't know how to use it. Very unreliable when figuring out line numbers", "tokens": 27} {"id": 771920, "source": "commit", "repo": "grapheneos/attestationserver", "text": "add cloud-archive-password.txt to gitignore", "tokens": 11} {"id": 771968, "source": "commit", "repo": "grapheneos/attestationserver", "text": "no need for case insensitive match for cookie name", "tokens": 11} {"id": 772400, "source": "commit", "repo": "grapheneos/auditor", "text": "update Material library to 1.6.1", "tokens": 11} {"id": 773037, "source": "commit", "repo": "graphql-java/graphql-java", "text": "move variableDefinitions from the common grammar to operations: it is only needed in for operations and not SDL", "tokens": 21} {"id": 773055, "source": "commit", "repo": "graphql-java/graphql-java", "text": "Adds Apollo tracing support into graphql-java (#577) * Fixed javadoc warning * Better context in instrumentation calls. Now provides ExecutionPath and TypeInfo * Now with just enough change * Adding Apollo trace support into graphql-java * Made instrumentation have a createState object to make it (ironically) less stateful as a component * PR feedback", "tokens": 71} {"id": 773460, "source": "commit", "repo": "graphwalker/graphwalker-project", "text": "CWE-404: Improper Resource Shutdown or Release", "tokens": 15} {"id": 773639, "source": "commit", "repo": "graphwalker/graphwalker-project", "text": "Add a TestBuilder that can create a test without annotations", "tokens": 12} {"id": 773962, "source": "commit", "repo": "gtrxAC/discord-j2me", "text": "Bump version (5.4 beta 3)", "tokens": 11} {"id": 774586, "source": "commit", "repo": "gu-zt/gugle-carpet-addition", "text": "refactor(FakePlayerResident): update save and load methods to use BotActionInfo for action serialization", "tokens": 19} {"id": 774791, "source": "commit", "repo": "guilds-plugin/guilds", "text": "build(deps): batch bump of tooling and low-risk libraries (#825) indra 4.1.0, shadow 9.6.1, run-paper 3.1.0, spotless 8.10.3, mockito 5.24.0, mariadb-java-client 3.5.10, and the Gradle wrapper to 9.8.0. The ben-manes versions plugin goes to 0.64.0 so dependencyUpdates runs on a current build. Every candidate was checked by reading the bytecode major version rather than the release notes, because Java 11 is the runtime floor and a Java 17 jar is unloadable on a 1.8.8 server. mariadb 3.5.10 is Java 8, mockito 5.24.0 is Java 11, and indra, shadow, spotless, run-paper and the wrapper are build-time only. Nothing here raises the floor. jdbi stays pinned at 3.49.6. 3.55.0 is Java 17 bytecode, which is the constraint #781 recorded. HikariCP stays at 4.0.3, ConfigMe at 1.3.0, Kotlin at 2.4.0, and authlib at 1.5.21; each needs its own change and its own testing. run-paper 3.1.0 declares org.gradle.plugin.api-version 9.7.0, so it cannot resolve under the 9.6.0 wrapper. The wrapper bump is what makes the rest of this batch possible, which is why the two are in one commit.", "tokens": 373} {"id": 774798, "source": "commit", "repo": "guilds-plugin/guilds", "text": "fix(misc): harden guild damage, config parsing, and claims (#769)", "tokens": 19} {"id": 774799, "source": "commit", "repo": "guilds-plugin/guilds", "text": "fix(checker): revert back to older parsing method here", "tokens": 12} {"id": 775827, "source": "commit", "repo": "gustiks/neuralogic", "text": "template rule duplicities severe warning test corrected", "tokens": 12} {"id": 776137, "source": "commit", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "remove paid / deprecated extensions from public repository", "tokens": 11} {"id": 776347, "source": "commit", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "refactoring hot path usages of instance checks; say goodbye to our very beginning Symfony2InterfacesUtil", "tokens": 20} {"id": 776443, "source": "commit", "repo": "haehnchen/idea-php-symfony2-plugin", "text": "refactoring of Doctrine types references so that we can support odm too", "tokens": 15} {"id": 777045, "source": "commit", "repo": "hangarmc/hangar", "text": "Fix inconsistency in the keyword tag entry box (#1204)", "tokens": 16} {"id": 777065, "source": "commit", "repo": "hangarmc/hangar", "text": "fix: version stats endpoint (closes #1140)", "tokens": 15} {"id": 777501, "source": "commit", "repo": "hap-java/hap-java", "text": "update CHANGES.md and README.md", "tokens": 10} {"id": 777523, "source": "commit", "repo": "hap-java/hap-java", "text": "batch notifications when possible often, HomeKit will will change multiple characteristics at once (on and set brightness of a dimmable bulb, for example) or change multiple items at once (\"hey siri, close all the shades in the house\"). instead of sending a separate event message for every characteristic of every item that changed, batch them all up, and send as a single message", "tokens": 84} {"id": 777623, "source": "commit", "repo": "harmonwood/capacitor-video-player", "text": "add engines.node in package.json", "tokens": 10} {"id": 777799, "source": "commit", "repo": "harmonwood/capacitor-video-player", "text": "update to Capacitor 1.1.0", "tokens": 13} {"id": 777883, "source": "commit", "repo": "harshaghanta/springboot-eshopOnContainers", "text": "added storageclass to the k3d setpup", "tokens": 12} {"id": 778574, "source": "commit", "repo": "hash-checker/hash-checker", "text": "2019-05-25 Added links to release builds in cloud storages", "tokens": 21} {"id": 779048, "source": "commit", "repo": "heinrichreimer/material-intro", "text": "Fixed #22, fixed #21, fixed, #12", "tokens": 16} {"id": 779217, "source": "commit", "repo": "HelpChat/DeluxeMenus", "text": "Create .gitignore (I might've forgotten to add this in the initial commit)", "tokens": 19} {"id": 779698, "source": "commit", "repo": "hernanponcedeleon/dat3m", "text": "Update visitorPower for LKMM using the assembly from the tree", "tokens": 14} {"id": 779721, "source": "commit", "repo": "hernanponcedeleon/dat3m", "text": "Extend precision with BV2UINT and BV2INT", "tokens": 13} {"id": 780552, "source": "commit", "repo": "himitzh/hoj", "text": "add: get user problem last ac code", "tokens": 10} {"id": 780782, "source": "commit", "repo": "HiveGamesOSS/Chunker", "text": "Bump ip-address from 10.1.0 to 10.2.0 in /app Bumps [ip-address](https://github.com/beaugunderson/ip-address) from 10.1.0 to 10.2.0. - [Commits](https://github.com/beaugunderson/ip-address/commits)", "tokens": 85} {"id": 780826, "source": "commit", "repo": "HiveGamesOSS/Chunker", "text": "Bump actions/download-artifact from 7 to 8 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v7...v8)", "tokens": 85} {"id": 780935, "source": "commit", "repo": "HiveGamesOSS/Chunker", "text": "Bump wait-on from 8.0.3 to 8.0.4 in /app Bumps [wait-on](https://github.com/jeffbski/wait-on) from 8.0.3 to 8.0.4. - [Release notes](https://github.com/jeffbski/wait-on/releases) - [Commits](https://github.com/jeffbski/wait-on/compare/v8.0.3...v8.0.4)", "tokens": 120} {"id": 781184, "source": "commit", "repo": "hoangtien2k3/ecommerce-microservices", "text": "feat: add environment configuration files for admin and web applications", "tokens": 13} {"id": 781257, "source": "commit", "repo": "hoangtien2k3/ecommerce-microservices", "text": "fix: use system mvn instead of ./mvnw and add packages:write permission - ./mvnw does not exist at repo root, only in service subdirectories - Added packages:write permission required to push images to GHCR", "tokens": 48} {"id": 781377, "source": "commit", "repo": "horizenofficial/zencash-swing-wallet-ui", "text": "Update 0.90.0 Release checksums", "tokens": 12} {"id": 781379, "source": "commit", "repo": "horizenofficial/zencash-swing-wallet-ui", "text": "Travis build conf validation fixes -> move to dpl2", "tokens": 12} {"id": 781381, "source": "commit", "repo": "horizenofficial/zencash-swing-wallet-ui", "text": "Close the stream after the read, remove unused import", "tokens": 11} {"id": 781386, "source": "commit", "repo": "horizenofficial/zencash-swing-wallet-ui", "text": "Release 0.89.0 * CI updates for openjdk-14 * Change description, closes #151 * Zend 2.0.20 * Bump Version to 0.89.0", "tokens": 48} {"id": 781992, "source": "commit", "repo": "hpi-swa/trufflesqueak", "text": "Warn about failing JVMCI version check on CI", "tokens": 11} {"id": 782096, "source": "commit", "repo": "hpi-swa/trufflesqueak", "text": "Remove back-jump detection from no-jump case and drop a redundant assertion to reduce interpreter overhead.", "tokens": 22} {"id": 782222, "source": "commit", "repo": "hpi-swa/trufflesqueak", "text": "Avoid unnecessary allocations of int[] in BitBlt", "tokens": 12} {"id": 782366, "source": "commit", "repo": "hpi-swa/trufflesqueak", "text": "Check for overflows in (Bytes|Shorts|Words)Objects And signal with primitive failures", "tokens": 20} {"id": 783360, "source": "commit", "repo": "hypertrack/live-app-android", "text": "Adds utility method for trackingAction Took 17 hours 11 minutes", "tokens": 16} {"id": 784240, "source": "commit", "repo": "icij/extract", "text": "fix(extractor): use an OCR language set after construction", "tokens": 12} {"id": 784274, "source": "commit", "repo": "icij/extract", "text": "fix(extract): do not finalize root when the parse was cancelled", "tokens": 14} {"id": 784311, "source": "commit", "repo": "icij/extract", "text": "fix(ocr): serialize shared temp-resource spill, guard OCR submit rejection", "tokens": 16} {"id": 784366, "source": "commit", "repo": "icij/extract", "text": "build: decrease no imput timeout to 1h", "tokens": 12} {"id": 784482, "source": "commit", "repo": "icij/extract", "text": "adds a QueueFilter the aim is to take already extracted documents and avoid to extract them again", "tokens": 20} {"id": 784606, "source": "commit", "repo": "icij/extract", "text": "Don't break base64-encoded data into lines", "tokens": 13} {"id": 784719, "source": "commit", "repo": "idelice/jls", "text": "added warm context for test files (single module) + inverted index for better reference lookups", "tokens": 19} {"id": 784749, "source": "commit", "repo": "idelice/jls", "text": "Update installation instructions in README Removed npm from the prerequisites and installation instructions.", "tokens": 15} {"id": 785085, "source": "commit", "repo": "igvteam/igv", "text": "Save alpha transparency for overlaid tracks in session", "tokens": 12} {"id": 785300, "source": "commit", "repo": "igvteam/igv", "text": "Fix alignment renderer problem when reads overhang contig", "tokens": 11} {"id": 785426, "source": "commit", "repo": "igvteam/igv", "text": "Added \"dumpIndex\" method for TDF debugging git-svn-id: https://igv.googlecode.com/svn/trunk@1215 17392f64-ead8-4cea-ae29-09b3ab513800", "tokens": 65} {"id": 785497, "source": "commit", "repo": "iluwatar/30-seconds-of-java", "text": "feat: Add SafeCastSnippet utility (#267)", "tokens": 13} {"id": 785717, "source": "commit", "repo": "im-pro-at/cncgcodecontroller", "text": "Added 250000 baud rate to dropdown menu (Marlin default baud rate)", "tokens": 23} {"id": 786135, "source": "commit", "repo": "inaturalist/inaturalistandroid", "text": "Observation viewer fixes (#116) + new observation editor + fix #108", "tokens": 20} {"id": 786889, "source": "commit", "repo": "Incendo/cloud-minecraft", "text": "brigadier: Allow specifying a custom brigadier suggestions provider", "tokens": 12} {"id": 786932, "source": "commit", "repo": "Incendo/cloud-minecraft", "text": "\u2728 Add pagination to MinecraftHelp, move minecraft-extras to it's own package", "tokens": 20} {"id": 787280, "source": "commit", "repo": "influxdata/influxdb-client-java", "text": "LabelsApi: orgID parameter has to be pass as second argument (#57)", "tokens": 19} {"id": 787464, "source": "commit", "repo": "influxdata/influxdb-java", "text": "Added an option to enable dropping of new points written after action queue exhaustion. (#689) 1. Added an option to drop the points being written after BatchProcessor#queue is exhausted. 2. Added an option to plug in a handler which will be invoked if above happens.", "tokens": 62} {"id": 787821, "source": "commit", "repo": "influxdata/influxdb-java", "text": "Changing client insertion This is a minor change to how the 'client' object is built. This makes changing this file for Java 1.6 support more obvious..", "tokens": 35} {"id": 787844, "source": "commit", "repo": "influxdata/influxdb-java", "text": "Use builder pattern to construct BatchPoints and Points, adjust impl and tests.", "tokens": 17} {"id": 787890, "source": "commit", "repo": "ing-bank/INGenious", "text": "Allowed shake action to execute for IOS devices (#342) * Allowed shake action to execute for IOS devices * Allow shake for IOS devices in LambdaTest", "tokens": 40} {"id": 787907, "source": "commit", "repo": "ing-bank/INGenious", "text": "Fix CLI --help bugs (#303) * Update RunCommand.java", "tokens": 17} {"id": 788025, "source": "commit", "repo": "ing-bank/INGenious", "text": "Upgrade dashboard latest summary report to SUMMARY_HTML_V2", "tokens": 14} {"id": 788226, "source": "commit", "repo": "innovativeonlineindustries/industrial-foregoing", "text": "Fixed black hole units losing the nbt of items when stored in controllers, closes #1435", "tokens": 23} {"id": 788502, "source": "commit", "repo": "innovativeonlineindustries/industrial-foregoing", "text": "Retranslating everything, updating translation to v1.10.1-176", "tokens": 21} {"id": 788515, "source": "commit", "repo": "innovativeonlineindustries/industrial-foregoing", "text": "Made the Filter check for entities that are in MIP", "tokens": 12} {"id": 788562, "source": "commit", "repo": "innovativeonlineindustries/industrial-foregoing", "text": "Mob Crusher doesn't void items if full, instead it will reduce the item lifespan to 1 minute, closes #188", "tokens": 31} {"id": 788589, "source": "commit", "repo": "innovativeonlineindustries/industrial-foregoing", "text": "Fixed BHU being derpy with the new ItemHandler for big stacks", "tokens": 15} {"id": 789351, "source": "commit", "repo": "irmen/pyrolite", "text": "serpent dependency updated to 1.12 bump version to 4.10", "tokens": 20} {"id": 790057, "source": "commit", "repo": "itzg/mc-image-helper", "text": "feat: option to ignore all mods for auto-curseforge (#675)", "tokens": 17} {"id": 790166, "source": "commit", "repo": "itzg/mc-image-helper", "text": "neoforge: handle malformed version entry in maven metadata (#367)", "tokens": 16} {"id": 790208, "source": "commit", "repo": "itzg/mc-image-helper", "text": "cf: clarify why some mods need manual download", "tokens": 10} {"id": 790215, "source": "commit", "repo": "itzg/mc-image-helper", "text": "fetch: correctly handle NOT_MODIFIED status when output to directory (#249)", "tokens": 18} {"id": 790269, "source": "commit", "repo": "itzg/mc-image-helper", "text": "sync: better exception reporting when interpolate fails (#138)", "tokens": 14} {"id": 790470, "source": "commit", "repo": "iyzico/iyzipay-java", "text": "Automatic commit by iyzico-ci v2.0.136", "tokens": 17} {"id": 790620, "source": "commit", "repo": "iyzico/iyzipay-java", "text": "Asya Kat\u0131l\u0131m Bankas\u0131 A.\u015e debit card updated.", "tokens": 22} {"id": 790633, "source": "commit", "repo": "iyzico/iyzipay-java", "text": "Automatic commit by iyzico-ci v1.1.20", "tokens": 16} {"id": 790921, "source": "commit", "repo": "j-easy/easy-random", "text": "populate fields of direct abstract superclass when populating concrete subclass (fixes #204)", "tokens": 20} {"id": 790970, "source": "commit", "repo": "j-easy/easy-random", "text": "throw ObjectGenerationException when a Randomizer can not be created (fixes #131)", "tokens": 20} {"id": 791056, "source": "commit", "repo": "j-easy/easy-random", "text": "fix issue #66 : raw collections should be generated empty. Random Beans should not make assumptions or guess what type of elements it should generate for a raw collection type.", "tokens": 37} {"id": 791245, "source": "commit", "repo": "jabref/jabref", "text": "CSL4LibreOffice - I [Bibliography formatting] (#13074) * Introduce bibliography body formats (fix code from https://github.com/JabRef/jabref/pull/13050) * Get hanging indent working * Remove redundant AI comment * Fix JabRef formatting infra * Remove redundant comment * Temp commit * Revert \"Temp commit\" This reverts commit 1174ca06148ea4329127ec3f5861712645310d5f. * Remove unused constant * Rename adapter, remove redundant comment * Remove commented code * Swap order of conditions * wip * wip * Selective override of preferences * Use list instead of enum * Rename variables * Rename with lambda * Add setters * Fix bindings introduced in https://github.com/JabRef/jabref/pull/12784 * Simplify button logic * Shift to OO Panel, complete pref behavior * Add more style options * Replace unused variables * Rename variables * Remove default indent * Remove unused import * Add comment * Add property button disable condition * Localization keys * Fix tests, add changelog entries * Add links to changelog entries * Refine comment * Add note ---------", "tokens": 266} {"id": 791261, "source": "commit", "repo": "jabref/jabref", "text": "Fix link to contribution guide (#12064)", "tokens": 13} {"id": 791340, "source": "commit", "repo": "jabref/jabref", "text": "Remove DuplicateSearchTest (#7875)", "tokens": 12} {"id": 791539, "source": "commit", "repo": "jabref/jabref", "text": "Used ComponentAdaptor to always store movements and size changes", "tokens": 12} {"id": 791557, "source": "commit", "repo": "jabref/jabref", "text": "Refactor L10n script for new class structure", "tokens": 11} {"id": 791730, "source": "commit", "repo": "jamesmudd/jhdf", "text": "Switch Java distribution to zulu temurin doesn't have java 8 arm64", "tokens": 20} {"id": 791977, "source": "commit", "repo": "jamesmudd/jhdf", "text": "Update Azure Pipelines build badge to only look at master", "tokens": 12} {"id": 792094, "source": "commit", "repo": "jamesmudd/jhdf", "text": "Initial B tree node implementation This is not yet complete", "tokens": 11} {"id": 792156, "source": "commit", "repo": "jaquadro/storagedrawers", "text": "FTB Chunks / FTB Teams integration", "tokens": 13} {"id": 792314, "source": "commit", "repo": "jaquadro/storagedrawers", "text": "Fix quantify text sometimes flashing to full opacity at edge of render distance", "tokens": 17} {"id": 792802, "source": "commit", "repo": "jarvis2f/telegram-files", "text": "\ud83d\udd16 0.1.15", "tokens": 10} {"id": 792809, "source": "commit", "repo": "jarvis2f/telegram-files", "text": "\u2728 feat: Add support for dynamic NGINX port configuration and update related files.(#34)", "tokens": 25} {"id": 792852, "source": "commit", "repo": "jarvis2f/telegram-files", "text": "\u26a1\ufe0f fix:Fix file download status update logic to avoid unnecessary error messages.", "tokens": 18} {"id": 792996, "source": "commit", "repo": "java-aid/hackerrank-solutions", "text": "Uploaded consecutive 1s in binary number tutorial Uploaded video tutorial for consecutive 1s in binary number", "tokens": 23} {"id": 793142, "source": "commit", "repo": "java9-modularity/gradle-modules-plugin", "text": "Update README with Kotlin DSL fixes: https://github.com/java9-modularity/gradle-modules-plugin/issues/81", "tokens": 29} {"id": 793543, "source": "commit", "repo": "javadev/leetcode-in-java", "text": "Added tasks 1984, 1985, 2001, 2002, 2003.", "tokens": 33} {"id": 793847, "source": "commit", "repo": "javadev/underscore-java", "text": "Add U.update(map1, map2).", "tokens": 13} {"id": 793960, "source": "commit", "repo": "javadev/underscore-java", "text": "Prepare for the version 1.20.", "tokens": 11} {"id": 794047, "source": "commit", "repo": "javadev/underscore-java", "text": "Add support for the repeat(), pad(), padLeft(), padRight().", "tokens": 15} {"id": 794294, "source": "commit", "repo": "javagl/jgltf", "text": "Set byte stride for buffer view to align accessor data", "tokens": 11} {"id": 794461, "source": "commit", "repo": "javagl/jgltf", "text": "Updated KHR_technique_webgl implementation", "tokens": 10} {"id": 794947, "source": "commit", "repo": "jbake-org/jbake", "text": "fix failing tests with zulu jdk 7 see https://github.com/orientechnologies/orientdb/issues/5855", "tokens": 34} {"id": 795040, "source": "commit", "repo": "jbake-org/jbake", "text": "Revert reversion of pull request (without risky DB version change)", "tokens": 15} {"id": 795053, "source": "commit", "repo": "jbake-org/jbake", "text": "Override JBake properties from plugin configuration This change allows to override JBake properties or define custom properties which can be used in the templates, e.g.: br.com.ingenieux jbake-maven-plugin ... true bar To make this possible an update to JBake 2.4.0 was necessary. This fixes #3 and resolves #11.", "tokens": 142} {"id": 795093, "source": "commit", "repo": "jbake-org/jbake", "text": "Fixes #164. Outputs combined title inc. subtitle. Modified test to cover this.", "tokens": 22} {"id": 795479, "source": "commit", "repo": "jbangdev/jbang", "text": "fix: Fixed download URL in `jbang` script (#1021)", "tokens": 17} {"id": 795527, "source": "commit", "repo": "jbangdev/jbang", "text": "fix: Make sure `URLRef` uses proper caching", "tokens": 12} {"id": 795553, "source": "commit", "repo": "jbangdev/jbang", "text": "fix: use shell comment in direct run example (#500)", "tokens": 15} {"id": 795566, "source": "commit", "repo": "jbangdev/jbang", "text": "fix: Default alias name when creating a new alias (#436)", "tokens": 16} {"id": 795948, "source": "commit", "repo": "jcarolus/android-chess", "text": "fixed play button bug. TelnetSocket temporary fix.", "tokens": 13} {"id": 795961, "source": "commit", "repo": "jcarolus/android-chess", "text": "in ICS, able to long press destination square for confirm move dialog", "tokens": 15} {"id": 796274, "source": "commit", "repo": "jcbvm/i18n-editor", "text": "Refactored SettingsBundle and added support to store windows state.", "tokens": 12} {"id": 796313, "source": "commit", "repo": "jchambers/pushy", "text": "Clarify that serialization of custom properties is implementation-dependent", "tokens": 11} {"id": 796375, "source": "commit", "repo": "jchambers/pushy", "text": "Updated teh README for 0.13.4.", "tokens": 14} {"id": 796469, "source": "commit", "repo": "jchambers/pushy", "text": "Check event loop group we're acutally using to cut down on warnings.", "tokens": 18} {"id": 796628, "source": "commit", "repo": "jchambers/pushy", "text": "Keep a static reference to the UTF-8 `Charset` rather than repeatedly getting it by name.", "tokens": 21} {"id": 796687, "source": "commit", "repo": "jchambers/pushy", "text": "Added the ApnsConnectionListener interface; made ApnsConnection not directly dependent on a PushManager.", "tokens": 23} {"id": 796703, "source": "commit", "repo": "jchambers/pushy", "text": "Added the beginnings of a PushManagerFactory.", "tokens": 11} {"id": 796816, "source": "commit", "repo": "jdbc-observations/datasource-proxy", "text": "Switch oraclejdk8 to openjdk8 in travis", "tokens": 11} {"id": 796827, "source": "commit", "repo": "jdbc-observations/datasource-proxy", "text": "Fix memory leak in slow query listener Generate a key for `ExecutionInfo` and pass it to the `Runnable` that performs slow query check. This change prevents hard reference from the `Runnable` to `ExecutionInfo`; so that when `afterQuery` removes `ExecutionInfo` from `inExecution` map, the `ExecutionInfo` will have no more reference in the slow query listener. (cherry picked from commit 15443081eb92399f213e8c32af676eb5350ea92c)", "tokens": 120} {"id": 796883, "source": "commit", "repo": "jdbc-observations/datasource-proxy", "text": "Add TracingCondition to skip logic at runtime", "tokens": 10} {"id": 797065, "source": "commit", "repo": "jdbc-observations/datasource-proxy", "text": "implement ExecutionType matcher - statement() - batchStatement() - prepared() - barchPrepared() - etc.", "tokens": 23} {"id": 797090, "source": "commit", "repo": "jdbc-observations/datasource-proxy", "text": "Implement and organize ParameterHolder related classes and assertions", "tokens": 11} {"id": 797341, "source": "commit", "repo": "jdeath/homeassistant-addons", "text": "Updater bot : trilliumnext updated to v0.101.3", "tokens": 18} {"id": 797431, "source": "commit", "repo": "jdeath/homeassistant-addons", "text": "Updater bot : stirling-pdf updated to 0.41.0", "tokens": 18} {"id": 797546, "source": "commit", "repo": "jdeath/homeassistant-addons", "text": "Add files via upload Initial commit of WG Easy", "tokens": 12} {"id": 797992, "source": "commit", "repo": "jenkinsci/amazon-ecs-plugin", "text": "Use `jenkins.baseline` to reduce bom update mistakes (#368)", "tokens": 18} {"id": 798026, "source": "commit", "repo": "jenkinsci/amazon-ecs-plugin", "text": "Depends on fine-grained aws-java-sdk artifacts", "tokens": 17} {"id": 798359, "source": "commit", "repo": "jenkinsci/ansible-plugin", "text": "Added vaultTmpPath option (#133) (#134) * Resolve issue #133 Added vaultTmpPath option to set a different temporary path, rather than the default workspace,for temporary files generated by interacting with the vault * Test modified to get temp path from system property java.io.tmpdir, maybe fix Windows test * Fixed test in Windows environment, moved vaultTmpPath 'not presence check' to the right test", "tokens": 91} {"id": 798615, "source": "commit", "repo": "jenkinsci/ansicolor-plugin", "text": "Allow escape sequences to span multiple lines and support default fg/bg colors (#137) * Reproduce #135 in a test * Fix #137 by closing open tags at the end of lines and reopening them * Close whole AnsiHtmlOutputStream instead of inidividual tags and minor cleanup * Support color maps that set default foreground/background colors * Track character offsets correctly for multi-byte characters * Handle multi-byte characters correctly instead of truncating them * Add Japanese text to non-ascii test case * Remove unused code * Remove unnecessary implementation of readResolve * Address review feedback and add changelog entry", "tokens": 132} {"id": 798670, "source": "commit", "repo": "jenkinsci/ansicolor-plugin", "text": "ExtColors: adapted to recent negative/inverse changes", "tokens": 12} {"id": 798694, "source": "commit", "repo": "jenkinsci/ansicolor-plugin", "text": "Ensure backwards compatibility with plugin format from 0.4.1", "tokens": 14} {"id": 798904, "source": "commit", "repo": "jenkinsci/bitbucket-branch-source-plugin", "text": "Add OAuth token to http clone link (#810) Problem was introduced in #796. Fixes #808.", "tokens": 28} {"id": 798918, "source": "commit", "repo": "jenkinsci/bitbucket-branch-source-plugin", "text": "Remove java.level from pom (#625)", "tokens": 12} {"id": 798957, "source": "commit", "repo": "jenkinsci/bitbucket-branch-source-plugin", "text": "add max pagelen of 100 to /refs/branches call (#277)", "tokens": 21} {"id": 799146, "source": "commit", "repo": "jenkinsci/bitbucket-branch-source-plugin", "text": "[JENKINS-36029] Work in progress", "tokens": 13} {"id": 799315, "source": "commit", "repo": "jenkinsci/blueocean-plugin", "text": "Impersonate SYSTEM for addEndpoint (#1245)", "tokens": 15} {"id": 799351, "source": "commit", "repo": "jenkinsci/blueocean-plugin", "text": "Adding some classNames to ExtensionRenderer (#909) * task/jenkins-41833-extension-classes * Add some classNames to ExtensionRenderer and the ability to specify additional classes from client code * task/jenkins-41833-extension-classes * Bump version of js-extensions for publish * task/jenkins-41833-extension-classes * Make a small fix suggested by @scherler, bump version again", "tokens": 99} {"id": 799401, "source": "commit", "repo": "jenkinsci/blueocean-plugin", "text": "Update README.md (#635)", "tokens": 10} {"id": 799430, "source": "commit", "repo": "jenkinsci/blueocean-plugin", "text": "task/jenkins 37715 npm shrinkwrap (#493) * [JENKINS-37715] fix a peerDep conflict in slint-plugin-react that was preventing build of shrinkwrap for dashboard; make some minor style refinements that are needed to pass the revised rules * [JENKINS-37715] eliminate a peer dep conflict on js-test which wasn't used anyway * [JENKINS-37715] roll back eslint-plugin-react to 4.0.1 for compat w/ jenkins-js-eslint-config; revert recent rules changes to pass lint * [JENKINS-37715] remove the ^ operator from all devDep versions; create shrinkwrap * [JENKINS-37715] personalization: remove the ^ operator from all devDep versions and use \"latest\" per current install; create shrinkwrap * [JENKINS-37715] web: remove the ^ operator from all devDep versions and use \"latest\" per current install; create shrinkwrap * [JENKINS-37715] config: remove the ^ operator from all devDep versions and use \"latest\" per current install; create shrinkwrap; add editor config * [JENKINS-37715] fix className that got lost during merge", "tokens": 277} {"id": 799474, "source": "commit", "repo": "jenkinsci/blueocean-plugin", "text": "[feature/JENKINS-36211] remove legacy console log comments. Better comments on the code, so it is clear what we are doing", "tokens": 32} {"id": 799882, "source": "commit", "repo": "jenkinsci/build-monitor-plugin", "text": "The footer link now leads to my blog with articles on software development and delivery.", "tokens": 18} {"id": 799889, "source": "commit", "repo": "jenkinsci/build-monitor-plugin", "text": "The headline tells the name of the committer(s) of the builds in progress (if they're known) - closes #164 Refactored the way a correct headline is determined to better support #202 and #243 after #250 (this will also help with #249)", "tokens": 69} {"id": 799956, "source": "commit", "repo": "jenkinsci/build-monitor-plugin", "text": "(fix) Due to a bug that crept into style.css error dialogs were not shown. This commit fixes the problem and should help investigate issue #171", "tokens": 38} {"id": 799993, "source": "commit", "repo": "jenkinsci/build-monitor-plugin", "text": "(fix) Font size slider didn't work in IE11. Closes #149", "tokens": 22} {"id": 800241, "source": "commit", "repo": "jenkinsci/build-pipeline-plugin", "text": "[FIXED JENKINS-22146] now preventing infinite recursions when building pipelines with circular/diamond-shaped project dependencies.", "tokens": 29} {"id": 800509, "source": "commit", "repo": "jenkinsci/build-pipeline-plugin", "text": "Initial commit of the 1.0.0 version of the plugin. This is a direct port from the Centrum SVN repository which will be archived off now that we have open sourced the code.", "tokens": 46} {"id": 800610, "source": "commit", "repo": "jenkinsci/cobertura-plugin", "text": "CoveragePaintDetails is made immutable in preparation for the flyweight pattern", "tokens": 14} {"id": 801096, "source": "commit", "repo": "jenkinsci/code-coverage-api-plugin", "text": "140: Now matching all files instead of just java files", "tokens": 15} {"id": 801107, "source": "commit", "repo": "jenkinsci/code-coverage-api-plugin", "text": "Show diff in coverage for change request builds It is convinient to see the code coverage diff right in Jenkins. If our build is going for a multibranch change request job - we take the target branch commit that is used for our build. Then we search for the last fixed amount of builds the build that was built for this commit. If we find it - we check if it has code coverage information. If it has lines coverage - we calculate diff between the current code coverage and this target branch build coverage.", "tokens": 104} {"id": 801201, "source": "commit", "repo": "jenkinsci/configuration-as-code-plugin", "text": "make plugin CSP compliant (#2551)", "tokens": 13} {"id": 801368, "source": "commit", "repo": "jenkinsci/configuration-as-code-plugin", "text": "fix readability alerts reported by LGTM (#849)", "tokens": 13} {"id": 801371, "source": "commit", "repo": "jenkinsci/configuration-as-code-plugin", "text": "fix view configuration button and cleanup css styling (#843)", "tokens": 14} {"id": 801429, "source": "commit", "repo": "jenkinsci/configuration-as-code-plugin", "text": "Initiate compatibility page structure Based on Jesse's document for Pipeline, created after a comment in the note document during Jenkins Contributor Summit.", "tokens": 34} {"id": 801791, "source": "commit", "repo": "jenkinsci/credentials-plugin", "text": "Use inline-block for caution message", "tokens": 10} {"id": 802137, "source": "commit", "repo": "jenkinsci/docker-build-step-plugin", "text": "update glassfish javax.json from 1.0.4 to 1.1.4 https://mvnrepository.com/artifact/org.glassfish/javax.json", "tokens": 37} {"id": 802516, "source": "commit", "repo": "jenkinsci/docker-plugin", "text": "Permit only jenkins user to login when authorized keys is used", "tokens": 13} {"id": 802677, "source": "commit", "repo": "jenkinsci/docker-plugin", "text": "Service locator is not used in code and doesn't work.", "tokens": 15} {"id": 802775, "source": "commit", "repo": "jenkinsci/docker-workflow-plugin", "text": "Test with Java 21 Java 21 was released Sep 19, 2023. We want to announce full support for Java 21 in early October and would like the most used plugins to be compiled and tested with Java 21. The acceptance test harness and plugin bill of materials tests are already passing with Java 21. This is a further step to improve plugin readiness for use with Java 21 and for development with Java 21. The change intentionally tests only two Java configurations, Java 17 and Java 21 because we believe that the risk of a regression that only affects Java 11 is low. We generate Java 11 byte code with the Java 17 and the Java 21 builds, so we're already testing Java 11 byte code.", "tokens": 175} {"id": 802810, "source": "commit", "repo": "jenkinsci/docker-workflow-plugin", "text": "[JENKINS-58732] Complete cleanup of pipeline-model-definition dep (#230)", "tokens": 24} {"id": 802849, "source": "commit", "repo": "jenkinsci/docker-workflow-plugin", "text": "[JENKINS-58732] Sketch of extraction", "tokens": 14} {"id": 803407, "source": "commit", "repo": "jenkinsci/ec2-plugin", "text": "[maven-release-plugin] prepare release ec2-1.24", "tokens": 18} {"id": 803619, "source": "commit", "repo": "jenkinsci/email-ext-plugin", "text": "Fix JENKINS-54363 Check for valid MailAccount", "tokens": 14} {"id": 803772, "source": "commit", "repo": "jenkinsci/email-ext-plugin", "text": "Update src/test/java/hudson/plugins/emailext/plugins/ContentBuilderTest.java", "tokens": 22} {"id": 803785, "source": "commit", "repo": "jenkinsci/email-ext-plugin", "text": "[FIXED JENKINS-8590] added option for controlling the firing for MatrixProject.", "tokens": 21} {"id": 803813, "source": "commit", "repo": "jenkinsci/email-ext-plugin", "text": "[FIXED HUDSON-6193] Override \"Hudson URL\"only when \"override global settings\" is checked.", "tokens": 27} {"id": 804350, "source": "commit", "repo": "jenkinsci/ghprb-plugin", "text": "config was still broken. Also fixed null pointer when there are no credentials set up yet.", "tokens": 19} {"id": 804456, "source": "commit", "repo": "jenkinsci/ghprb-plugin", "text": "pass revision to build as git RevisionParameterAction", "tokens": 10} {"id": 804522, "source": "commit", "repo": "jenkinsci/git-client-plugin", "text": "Adapt remote branch listing test to CLI git 2.48.0 (#1242) * Adapt GitAPITest for CLI git 2.48.0 Fetch from CLI git 2.48.0 and later return origin/HEAD https://github.blog/open-source/git/highlights-from-git-2-48/ says: > With Git 2.48, if the remote has a default branch but refs/remotes/origin/HEAD > is missing locally, then a fetch will update it. This test was unintentionally testing the behavior of CLI git before 2.48.0. Other tests in GitClientFetchTest were testing that origin/HEAD was reported as a branch. * Show names/sha1 of detected branches on failure When the assertion fails, show the details of the set of branches so that the test failure has more information about the failure conditions. Thanks to @darinpope for the question that prompted the improvement * Remove unused cliGitCommand from GitAPITest", "tokens": 222} {"id": 804558, "source": "commit", "repo": "jenkinsci/git-client-plugin", "text": "Use container agent for CI build (#880) * Use container agent for CI build https://github.com/jenkinsci/bom/pull/1338#issuecomment-1198016897 notes that there is an automated test failure in the bill of materials and plugin compatibility tests. This change is trying to duplicate that failure on ci.jenkins.io. * Exclude ssh tests on ci.jenkins.io Kubernetes agents Unclear why the tests fail with a connection timeout on those agents and only on those agents. No issue on virtual machine based agents. No issue on static agents at my home. No issue on any agents except the agents on ci.jenkins.io. * Exclude JSR-305 dependency from packaging No need to bundle the JSR-305 transitive dependency from spotbugs-annotation into the final hpi file. The spotbugs annotations are optional and the JSR-305 annotations should also be optional. They have not been included in previous releases of the plugin. * Test JDK 17 with Jenkins 2.346.1 LTS, not 2.342 weekly * Do not fork tests on multi-core machines * Remove unnecessary exclusion", "tokens": 253} {"id": 804562, "source": "commit", "repo": "jenkinsci/git-client-plugin", "text": "moved testTrackingSubmoduleBranches to GItAPITestUpdateCliGit", "tokens": 14} {"id": 805277, "source": "commit", "repo": "jenkinsci/git-plugin", "text": "GitUtils.fixupNames never return null", "tokens": 10} {"id": 805373, "source": "commit", "repo": "jenkinsci/git-plugin", "text": "Git executable in a tool instead of the descriptor Implementing of this makes it possible to use different paths in slaves. This also makes it easier to extend Git plugin as it doesn't call any methods from GitSCM.DescriptorImpl. Before this change GitSCM used getGitExe from GitSCM.DescriptorImpl. Old settings will be migrated.", "tokens": 70} {"id": 805402, "source": "commit", "repo": "jenkinsci/gitea-plugin", "text": "Migrate from Commons Lang 2 to Commons Lang 3 (#159)", "tokens": 17} {"id": 805547, "source": "commit", "repo": "jenkinsci/github-branch-source-plugin", "text": "Make readResolve protected (#1546)", "tokens": 11} {"id": 805551, "source": "commit", "repo": "jenkinsci/github-branch-source-plugin", "text": "Use `CredentialsProvider.findCredentialByIdInItem`", "tokens": 12} {"id": 805608, "source": "commit", "repo": "jenkinsci/github-branch-source-plugin", "text": "Also apply an `owner` to `lookupScanCredentials`", "tokens": 13} {"id": 805991, "source": "commit", "repo": "jenkinsci/github-oauth-plugin", "text": "Simplify calls to Arrays.asList with too few arguments", "tokens": 11} {"id": 806019, "source": "commit", "repo": "jenkinsci/github-oauth-plugin", "text": "Remove the dependency to java.util.Base64 Generate a random string satisfying the specification's requirements without using Base64 so that the plugin can be used with installations using Java 7", "tokens": 42} {"id": 806265, "source": "commit", "repo": "jenkinsci/github-plugin", "text": "[JENKINS-73133] Adapt GitHub for Jetty 12 (EE 8)", "tokens": 23} {"id": 806337, "source": "commit", "repo": "jenkinsci/github-plugin", "text": "grammar: the test failed -- not the testing", "tokens": 10} {"id": 806821, "source": "commit", "repo": "jenkinsci/gitlab-branch-source-plugin", "text": "[maven-release-plugin] prepare release gitlab-branch-source-0.0.6-beta-1", "tokens": 25} {"id": 807194, "source": "commit", "repo": "jenkinsci/gradle-plugin", "text": "Automatically download chrome driver when running on CI (#253) * Automatically download chrome driver when running on CI * Do not try to download chrome driver on Windows", "tokens": 35} {"id": 807416, "source": "commit", "repo": "jenkinsci/gradle-plugin", "text": "[FIXED JENKINS-15166] gradleName \"lost\" due to refactoring of web UI", "tokens": 22} {"id": 807575, "source": "commit", "repo": "jenkinsci/groovy-sandbox", "text": "Changed the recorder format to differentiate static methods call vs instance call.", "tokens": 14} {"id": 807627, "source": "commit", "repo": "jenkinsci/hashicorp-vault-plugin", "text": "Adds support for using job-specific policies (#223) * Fixes #214, adds support for separating job policies * Add configuration to credentials to enable using limited policies * Fix handling of TTL in child tokens * Add ability to disable folders or jobs from overriding policies * Use StringSubstitutor for templating policies * Fix flaky test ---------", "tokens": 70} {"id": 807947, "source": "commit", "repo": "jenkinsci/http-request-plugin", "text": "Replace usages of Guava CharStreams with Apache Commons IO", "tokens": 12} {"id": 808203, "source": "commit", "repo": "jenkinsci/jacoco-plugin", "text": "Print out version of JaCoCo plugin that is used This helps with analyzing reported issues", "tokens": 18} {"id": 808249, "source": "commit", "repo": "jenkinsci/jacoco-plugin", "text": "Add Jenkinsfile Let's see if this creates the build-config on ci.jenkins.io", "tokens": 20} {"id": 808319, "source": "commit", "repo": "jenkinsci/jacoco-plugin", "text": "Revert \"[maven-release-plugin] prepare for next development iteration\" This reverts commit 12059bb231f30907a5cef4807cacb05186aa2a40.", "tokens": 55} {"id": 808417, "source": "commit", "repo": "jenkinsci/jacoco-plugin", "text": "Renamed a lot of stuff from emma to jacoco", "tokens": 11} {"id": 808668, "source": "commit", "repo": "jenkinsci/jenkins", "text": "[FIX JENKINS-10477] Use build display name in executors list", "tokens": 19} {"id": 808879, "source": "commit", "repo": "jenkinsci/jenkins", "text": "pass more structured logger git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9388 71c3de6d-444a-0410-be80-ed276b4c234a", "tokens": 69} {"id": 808998, "source": "commit", "repo": "jenkinsci/jenkins-test-harness", "text": "Clean up `InboundAgent.Options` & `.Builder`", "tokens": 14} {"id": 809106, "source": "commit", "repo": "jenkinsci/jenkins-test-harness", "text": "Upgrade htmlunit to 2.36.0", "tokens": 12} {"id": 809358, "source": "commit", "repo": "jenkinsci/jenkins-test-harness", "text": "doc improvement git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11723 71c3de6d-444a-0410-be80-ed276b4c234a Originally-Committed-As: 9afcf286a3787ec37a9ef4f3e479e99cb99c31dc", "tokens": 109} {"id": 809692, "source": "commit", "repo": "jenkinsci/jenkinsfile-runner", "text": "Check for null in bootstrap.workflowParameters It is defined with `@CheckForNull`", "tokens": 16} {"id": 809944, "source": "commit", "repo": "jenkinsci/jira-plugin", "text": "Update README.md Removing issuestats because of hstove/issue_stats#48.", "tokens": 22} {"id": 809954, "source": "commit", "repo": "jenkinsci/jira-plugin", "text": "Add JIRA version creation as a build step.", "tokens": 11} {"id": 810008, "source": "commit", "repo": "jenkinsci/jira-plugin", "text": "Surround SCM url in Jira comment with brackets even when wiki style comments are off, as Jira's URL rendering generated invalid links by accounting following parenthesis to be part of the url. The source of the problem: https://jira.atlassian.com/browse/JRA-5981", "tokens": 62} {"id": 810067, "source": "commit", "repo": "jenkinsci/jira-plugin", "text": "[HUDSON-6007] Added French localization use html entity", "tokens": 16} {"id": 810086, "source": "commit", "repo": "jenkinsci/jira-plugin", "text": "fixed NPE when remote communication fails (#1097)", "tokens": 13} {"id": 810133, "source": "commit", "repo": "jenkinsci/kubernetes-cd-plugin", "text": "[maven-release-plugin] prepare release kubernetes-cd-1.0.0", "tokens": 20} {"id": 810399, "source": "commit", "repo": "jenkinsci/lockable-resources-plugin", "text": "Ban JUnit 4 imports (#819)", "tokens": 12} {"id": 810420, "source": "commit", "repo": "jenkinsci/lockable-resources-plugin", "text": "Multiple resource lock example (#587)", "tokens": 10} {"id": 810546, "source": "commit", "repo": "jenkinsci/lockable-resources-plugin", "text": "Update README.md: Refresh list of maintainers", "tokens": 11} {"id": 810726, "source": "commit", "repo": "jenkinsci/mcp-server-plugin", "text": "fix: incorrect sse message url Use a slash leading path as sse message endpoint when config transport. Also make the init method lazy to get the correct jenkins full url.", "tokens": 36} {"id": 810747, "source": "commit", "repo": "jenkinsci/mcp-server-plugin", "text": "Add new tool to return test result action content if any available (#72) * Add new tool to return test result action content if any available ---------", "tokens": 31} {"id": 810882, "source": "commit", "repo": "jenkinsci/performance-plugin", "text": "Fix LoadRunner timezone and DST offset (#154)", "tokens": 14} {"id": 811073, "source": "commit", "repo": "jenkinsci/performance-plugin", "text": "Add classname attribute to URI when parsing JUnit test results. Jenkins-24653 Fixes JENKINS-24653", "tokens": 28} {"id": 811634, "source": "commit", "repo": "jenkinsci/pipeline-utility-steps-plugin", "text": "[JENKINS-34927] Close streams of extracted files", "tokens": 15} {"id": 811747, "source": "commit", "repo": "jenkinsci/plugin-installation-manager-tool", "text": "Enable JUnit v5 (#417)", "tokens": 10} {"id": 811756, "source": "commit", "repo": "jenkinsci/plugin-installation-manager-tool", "text": "[maven-release-plugin] prepare release 2.11.1", "tokens": 17} {"id": 811989, "source": "commit", "repo": "jenkinsci/plugin-installation-manager-tool", "text": "[JENKINS-58104] Create CLI option and ability to get UC from environment variable", "tokens": 22} {"id": 812044, "source": "commit", "repo": "jenkinsci/plugin-installation-manager-tool", "text": "[JENKINS-57800] Reverse modules in parent pom.xml", "tokens": 18} {"id": 812164, "source": "commit", "repo": "jenkinsci/remoting", "text": "[FIXED JENKINS-47132] Single quote must be doubled", "tokens": 17} {"id": 812252, "source": "commit", "repo": "jenkinsci/remoting", "text": "Better way to handle things that can never happen. It also prevents confusing IDE dataflow analysis", "tokens": 19} {"id": 812342, "source": "commit", "repo": "jenkinsci/remoting", "text": "Log out exceptions that happen in copy threads. This could be useful in trying to track down when things break in special ways.", "tokens": 26} {"id": 812406, "source": "commit", "repo": "jenkinsci/remoting", "text": "[maven-release-plugin] prepare release hudson-1_234 git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10752 71c3de6d-444a-0410-be80-ed276b4c234a", "tokens": 82} {"id": 812456, "source": "commit", "repo": "jenkinsci/remoting", "text": "implemented unexport of pipes. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1368 71c3de6d-444a-0410-be80-ed276b4c234a", "tokens": 72} {"id": 812810, "source": "commit", "repo": "jenkinsci/role-strategy-plugin", "text": "The next version is 2.2.0", "tokens": 11} {"id": 812835, "source": "commit", "repo": "jenkinsci/role-strategy-plugin", "text": "Must be on 1.420+ to even build.", "tokens": 15} {"id": 812992, "source": "commit", "repo": "jenkinsci/slack-plugin", "text": "Introduce maven-checkstyle-plugin to validate no star imports (#521)", "tokens": 17} {"id": 812993, "source": "commit", "repo": "jenkinsci/slack-plugin", "text": "Clarify the messaging around the failure notification options (#519)", "tokens": 14} {"id": 813307, "source": "commit", "repo": "jenkinsci/ssh-agents-plugin", "text": "[JENKINS-56147] Overwrite remoting.jar only when necessary. (#116) [FIX JENKINS-56147] Overwrite remoting.jar only when necessary.", "tokens": 45} {"id": 813337, "source": "commit", "repo": "jenkinsci/ssh-agents-plugin", "text": "[JENKINS-19465] - Fix indenting as @jglick suggested", "tokens": 18} {"id": 813369, "source": "commit", "repo": "jenkinsci/ssh-agents-plugin", "text": "Fix constructor chaining and constructor targeted by Jelly", "tokens": 10} {"id": 813433, "source": "commit", "repo": "jenkinsci/ssh-agents-plugin", "text": "[FIX JENKINS-19104] Force upgrade to newer ssh-credentials - Not strictly necessary, but better for everyone", "tokens": 27} {"id": 813696, "source": "commit", "repo": "jenkinsci/throttle-concurrent-builds-plugin", "text": "Update the core dependency to 1.609.3", "tokens": 14} {"id": 813871, "source": "commit", "repo": "jenkinsci/warnings-ng-plugin", "text": "Upgrade commons-beanutils 1.9.4", "tokens": 12} {"id": 814028, "source": "commit", "repo": "jenkinsci/warnings-ng-plugin", "text": "Refactoring of package structure. Moved graphs out of core. Since the graph package will be marked deprecated soon it makes sense to exclude from tooling. Fixed also some bugs: - unhealthy spelling - encoding was missing for steps", "tokens": 47} {"id": 814166, "source": "commit", "repo": "jenkinsci/warnings-ng-plugin", "text": "Fixed warning and initialize configuration with null graph.", "tokens": 10} {"id": 814185, "source": "commit", "repo": "jenkinsci/warnings-ng-plugin", "text": "[FIXED HUDSON-6466] Fixed display of #days and #build values in configuration view.", "tokens": 24} {"id": 814287, "source": "commit", "repo": "jetbrains/intellij-samples", "text": "Updating to JDK 17, but it doesn't compile in IntelliJ IDEA 2021.2.1", "tokens": 26} {"id": 814583, "source": "commit", "repo": "jetbrains/intellij-samples", "text": "Added simple Spring example. Forced me to fix some problems I accidentally introduced when I added Gradle", "tokens": 20} {"id": 814756, "source": "commit", "repo": "jetbrains/js-graphql-intellij-plugin", "text": "[graphql] WEB-68322 do not block thread from Dispatchers.Default GitOrigin-RevId: c567a5bca238d20f77e8028b11ad98e5a5d52826", "tokens": 66} {"id": 814857, "source": "commit", "repo": "jetbrains/js-graphql-intellij-plugin", "text": "Update GraphQLSettingsConfigurable to the modern UI DSL", "tokens": 10} {"id": 815026, "source": "commit", "repo": "jetbrains/js-graphql-intellij-plugin", "text": "Ensured that all exceptions thrown during schema construction are caught and reported in the schemas panel (#164)", "tokens": 23} {"id": 815268, "source": "commit", "repo": "jhy/jsoup", "text": "Don't copy request data or body on newRequest() Enables multi-step forms, or requests after a form submission, without sending data from earlier submissions. Fixes #1778", "tokens": 41} {"id": 815300, "source": "commit", "repo": "jhy/jsoup", "text": "Added support for tracking newlines in CharacterReader So that parse errors can be reported more intuitively.", "tokens": 22} {"id": 815319, "source": "commit", "repo": "jhy/jsoup", "text": "Simplified isContentForTagData Loop was showing up during profiling; not needed with just two options", "tokens": 20} {"id": 815338, "source": "commit", "repo": "jhy/jsoup", "text": "Added Element#closest And Evaluator enabled select and selectFirst.", "tokens": 14} {"id": 815411, "source": "commit", "repo": "jhy/jsoup", "text": "Merge ahielg:master for attribute fix Fixes #746", "tokens": 16} {"id": 815500, "source": "commit", "repo": "jhy/jsoup", "text": "Javadoc update for DescendableLinkedList Fixes #103", "tokens": 14} {"id": 815666, "source": "commit", "repo": "jingsewu/open-wes", "text": "fix: address Codacy issues - unhandled promises and unnecessary optional chains - Add void operator to 8 fire-and-forget async calls to explicitly mark unhandled promises (loadInitialStationData, getApiData, handleChange, changeLanguage, destroy, fetchStations, onPressEnterLocal, scanSku) - Remove unnecessary optional chains where values are guaranteed non-null: store.chooseArea, message(), workLocationViews.find(), putWallArea.putWallTagConfigDTO", "tokens": 102} {"id": 815763, "source": "commit", "repo": "jingsewu/open-wes", "text": "optimize: remove the adding stocktake order on stocktake workstation.", "tokens": 15} {"id": 815868, "source": "commit", "repo": "jingsewu/open-wes", "text": "fix: add dictionary init sql english language.", "tokens": 10} {"id": 816070, "source": "commit", "repo": "jitseb/npclib", "text": "Punctuation and spelling fix.", "tokens": 10} {"id": 816306, "source": "commit", "repo": "jixxed/ed-odyssey-materials-helper", "text": "FIX: Focused Weapon on Burst and Pulse laser BP", "tokens": 18} {"id": 816440, "source": "commit", "repo": "jixxed/ed-odyssey-materials-helper", "text": "fix eddn schemaref url for live", "tokens": 10} {"id": 816867, "source": "commit", "repo": "jmetal/jmetal", "text": "Improving code quality. Issue ' if/else/for/while/do statements should always use curly braces' applied to the classes in the jmetal.operators package", "tokens": 36} {"id": 817157, "source": "commit", "repo": "jncrmx/discord-game-sdk4j", "text": "Note about Rich Presence This should help people that just want to include a rich presence into their applications to get started much more quickly.", "tokens": 31} {"id": 817330, "source": "commit", "repo": "joey-zhou/xiaozhi-esp32-server-java", "text": "fix: resolve issues #119 #120", "tokens": 13} {"id": 817514, "source": "commit", "repo": "john-paul-r/essential-commands", "text": "Adjust the bed command so that teleportation follows the respawn strategy. (#285) * Adjusted the bed command so that teleportation follows the respawn strategy. * Adjusted teleportation position in special cases according to the height of the block. * Correction of world variables involved in the calculation.", "tokens": 64} {"id": 817636, "source": "commit", "repo": "john-paul-r/essential-commands", "text": "Expand getText overloads & use where applicable. Add lang-in-lang interpolation. (`l:lang.key`)", "tokens": 26} {"id": 817655, "source": "commit", "repo": "john-paul-r/essential-commands", "text": "Add existingTeleportRequest check for `/tpahere` (Resolves #111)", "tokens": 21} {"id": 817958, "source": "commit", "repo": "joml-ci/joml", "text": "Revert Unsafe usage for Vector4f/Matrix4f It's not safe under C2 on a JDK8. Also see: https://github.com/JOML-CI/JOML/issues/101", "tokens": 48} {"id": 818071, "source": "commit", "repo": "joml-ci/joml", "text": "Add sample package and Matrix4x3dc JavaDocs Also upgrade maven-compiler-plugin version.", "tokens": 21} {"id": 818149, "source": "commit", "repo": "joml-ci/joml", "text": "Optimize Intersection.intersectSweptSphereTriangle a bit Also fix that tests against the edges work with radii other than 1.0", "tokens": 30} {"id": 818363, "source": "commit", "repo": "jonafanho/minecraft-transit-railway", "text": "Fix: Bogie in the wrong position when riding trains", "tokens": 15} {"id": 818739, "source": "commit", "repo": "jonafanho/minecraft-transit-railway", "text": "First commit for the C1141A train", "tokens": 12} {"id": 818930, "source": "commit", "repo": "jopt-simple/jopt-simple", "text": "For #68, Javadoc'ing BuiltinHelpFormatter.", "tokens": 14} {"id": 818972, "source": "commit", "repo": "jopt-simple/jopt-simple", "text": "Preserve training order for parser. Previous test was broken, hiding that the parser was also.", "tokens": 21} {"id": 819172, "source": "commit", "repo": "jorelali/commandapi", "text": "Add 1.20.5 to the version supported table", "tokens": 14} {"id": 819181, "source": "commit", "repo": "jorelali/commandapi", "text": "Make permissions work Tests are still failing though and I have no idea why. In-game tests, however, seem to confirm that everything works. I am not sure how to continue.", "tokens": 38} {"id": 819536, "source": "commit", "repo": "jozufozu/flywheel", "text": "String theory - Assume group/version are behind properties in subproject.init - Force each subproject to manually specify their base archive name - Don't generate mod/api artifact ids, just write them out by hand - Remove DependentProject", "tokens": 48} {"id": 819640, "source": "commit", "repo": "jozufozu/flywheel", "text": "Instancing with Layouts - InstancedArraysComponent now fully uses Layouts. - Trivial to get the glsl type name of a given Element. - Also quite easy to get the attribute count without actually creating the attribute list. - IndirectComponent is WIP because unpacking is hard. - Reorganize so all the unpacking stuff is in one loop.", "tokens": 74} {"id": 819657, "source": "commit", "repo": "jozufozu/flywheel", "text": "Context for Tickable/Dynamic visuals - Add VisualFrameContext for DynamicVisual#beginFrame - Add VisualTickContext for TickableVisual#tick - Move checks for update limiting to within the update calls themselves - Provide update limiting/culling primitives within (B)E Visuals - Remove methods from *Visual interfaces related to update limiting - Add thenMap and andMap to Plan - Add Plan primitive to transform context - Used in Visual update dispatch", "tokens": 95} {"id": 819739, "source": "commit", "repo": "jozufozu/flywheel", "text": "Patch to stop the java.util.ConcurrentModificationException.", "tokens": 13} {"id": 819887, "source": "commit", "repo": "jpenilla/minimotd", "text": "Make virtual hosts case-insensitive (fixes #115)", "tokens": 14} {"id": 820129, "source": "commit", "repo": "jpenilla/tabtps", "text": "release: Version 1.3.18", "tokens": 11} {"id": 820587, "source": "commit", "repo": "jruby/joni", "text": "Add ALLOW_NESTED_REPEAT syntax option Not all languages allow nested repeats (/a***/, /a{1}{1,}/, etc) in their regular expression handling. This adds an additional Syntax behavior to control whether nested repeats should be allowed. The default behavior, GNU_REGEX_BV, was updated to allow nested repeats. This also required modifying the logic that looks at the return value of QuantifierNode.setQuantifier to update the repeat's target even when the repeat option given was \"{1}\" or \"{1,1}\".", "tokens": 122} {"id": 820939, "source": "commit", "repo": "jruby/jruby-maven-plugins", "text": "better scraping of version from html index page", "tokens": 11} {"id": 820956, "source": "commit", "repo": "jruby/jruby-maven-plugins", "text": "adding default gem.path and gem.home for JrubyMojo", "tokens": 14} {"id": 821239, "source": "commit", "repo": "jscep/jscep", "text": "[maven-release-plugin] prepare release jscep-2.5.2", "tokens": 18} {"id": 821429, "source": "commit", "repo": "jscep/jscep", "text": "Made some refactoring changes prior to next release.", "tokens": 10} {"id": 821463, "source": "commit", "repo": "jscep/jscep", "text": "Replaces Commons Codec URLEncoder with JRE encoder.", "tokens": 11} {"id": 821560, "source": "commit", "repo": "jsondb/jsondb-core", "text": "Fix travisci config to use the gradlew path changes", "tokens": 12} {"id": 821652, "source": "commit", "repo": "jsondb/jsondb-core", "text": "Change to 3 octet version, remove the hash part", "tokens": 13} {"id": 821891, "source": "commit", "repo": "jsorrell/carpetskyadditions", "text": "Refactor README into multiple files. Add a progression walkthrough.", "tokens": 14} {"id": 821919, "source": "commit", "repo": "jsorrell/carpetskyadditions", "text": "Fix Piglin Brute spawning changes affecting default worlds", "tokens": 12} {"id": 821935, "source": "commit", "repo": "jsorrell/carpetskyadditions", "text": "Add ancient city portal to README, remove old screenshot, and update pack.png", "tokens": 18} {"id": 822105, "source": "commit", "repo": "jtang613/GhidrAssist", "text": "Internal \"add_document_to_chat\" tool.", "tokens": 13} {"id": 822318, "source": "commit", "repo": "juanjuandog/FinSight-AI", "text": "Initial FinSight AI research platform", "tokens": 10} {"id": 822326, "source": "commit", "repo": "juliand665/dynamic-fps", "text": "Update NeoForge to 26.2.0.0-beta", "tokens": 15} {"id": 822341, "source": "commit", "repo": "juliand665/dynamic-fps", "text": "Update NeoForge module to 26.1", "tokens": 10} {"id": 822582, "source": "commit", "repo": "juliand665/dynamic-fps", "text": "Loom 1.4.5", "tokens": 10} {"id": 823028, "source": "commit", "repo": "junjunguo/pocketmaps", "text": "Added Quickbuttons instead latLon textinput on navi-input-panel. Allow to delete location from selection. Dont delete locations on navi stop.", "tokens": 33} {"id": 823165, "source": "commit", "repo": "justauth/justauth", "text": "ci: add upload ossrh snapshotRepository config", "tokens": 12} {"id": 823219, "source": "commit", "repo": "jvondermarck/dinosaur-exploder", "text": "feat: add Spotless code formatting check and commenting workflow", "tokens": 12} {"id": 823414, "source": "commit", "repo": "jvondermarck/dinosaur-exploder", "text": "feat: enhance CreditsMenu with loading and error handling; add Bulgarian translations", "tokens": 20} {"id": 823416, "source": "commit", "repo": "jvondermarck/dinosaur-exploder", "text": "Update src/main/java/com/dinosaur/dinosaurexploder/model/CollisionHandler.java", "tokens": 30} {"id": 824288, "source": "commit", "repo": "kafka-ops/julie", "text": "fix: issue with connector and subject permissions being ignored when more than one (#415) * fix issue with connector permissions being ignored when more than one * fix problem with rbac permissions where in case of defining more than one subject it would not properly create them", "tokens": 53} {"id": 824336, "source": "commit", "repo": "kafka-ops/julie", "text": "Fix: stupid error in checking server labels when creating a connector (#325) * ammend error in checking server labels when creating a connector * simplify test coverage * remove stale2 * ammend conector it tests", "tokens": 44} {"id": 824356, "source": "commit", "repo": "kafka-ops/julie", "text": "Support Connector deployment for Kafka Connect (#234) * add pipes to have a kafka connect container for testing add basic methods for add, list and delete connectors add some dummy test for start stop connectors add less waits for status to apply return error codes as exeptions for the status api shorten generic methods in the base http client add generic structure to handle access control and item rules within the components sections Add backwards compatible test for connect descriptor changes add code and test for retrieving artefacts for kafka connect introduced the kafka servers config value and refactor all config constants out start building out the connect management part finished the building blocks for artefact connect management write in initial usage of the kafka connect manager fix wrong parameter usage write in proper create and update test for the functionality revert config and constants file move add support for having multiple clients for artefacts, because people can and usually have more than one cluster for such stuff add logging add some notes in the documentation * final touches * accept the britisch and american form for artefact ammend inconsistency on artifact comparation when using remote cluster state recovery", "tokens": 228} {"id": 824407, "source": "commit", "repo": "kafka-ops/julie", "text": "Add support for absolute paths when fetching schemas from disk (#184) * add support for absolute path * docs update", "tokens": 25} {"id": 824758, "source": "commit", "repo": "kagof/intellij-pokemon-progress", "text": "extracts the plugin description to its own html file", "tokens": 11} {"id": 825389, "source": "commit", "repo": "karatelabs/karate", "text": "implement doc keyword for HTML template rendering - Add 'doc' keyword to StepExecutor for * doc 'template.html' syntax - Wire doc output to LogContext embed system for report integration - Add embed collection to LogContext (matching logs pattern) - Return rendered HTML from KarateJs.doc() for embedding - Create StepDocTest with 4 tests covering string/map syntax and variable substitution - Disable flaky ProcessTest.testExecWithOptionsViaJs and add TODO in PROCESS_BUILDER.md - Update V1_BASELINE.csv for java-008 (testUsersDoc) and java-009 (skipped UI) \ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "tokens": 148} {"id": 825520, "source": "commit", "repo": "karatelabs/karate", "text": "Exposing getLogger() in the karate API", "tokens": 11} {"id": 825706, "source": "commit", "repo": "karatelabs/karate", "text": "re-rewording doc after doh moment", "tokens": 11} {"id": 825946, "source": "commit", "repo": "kdn251/interviews", "text": "Add problem source URL at FiveHundredFactorial", "tokens": 10} {"id": 825994, "source": "commit", "repo": "kdn251/interviews", "text": "Remove unused methods from BasicRemains.java", "tokens": 11} {"id": 826019, "source": "commit", "repo": "kdn251/interviews", "text": "Fix spacing on the \"Bitmasks\" heading", "tokens": 11} {"id": 826192, "source": "commit", "repo": "kennycason/kumo", "text": "up version to 1.7 + fix --version command", "tokens": 13} {"id": 826567, "source": "commit", "repo": "kiooeht/modthespire", "text": "Convert StS version specification to String rather than Date", "tokens": 11} {"id": 826699, "source": "commit", "repo": "kiooeht/modthespire", "text": "Don't continue when an error occurs while patching", "tokens": 12} {"id": 827735, "source": "commit", "repo": "kittehorg/kittehircclientlib", "text": "Don't dump exception chain if message exception", "tokens": 10} {"id": 827784, "source": "commit", "repo": "kittehorg/kittehircclientlib", "text": "Lay down groundwork for documentation with mkdocs", "tokens": 10} {"id": 828235, "source": "commit", "repo": "klikli-dev/occultism", "text": "feat: two miner upgrades (#1003) * Raw silver/iesnium block Crushing raw ores blocks Tiered miners recipe Increase spirits life Minor fix * Miner chance to weight * Update Apotheosis integration", "tokens": 52} {"id": 828603, "source": "commit", "repo": "kneesnap/froglord", "text": "[SC] Reduce performance impact of JavaFX logging.", "tokens": 11} {"id": 828660, "source": "commit", "repo": "kneesnap/froglord", "text": "[HB] Create PC July Build image name list.", "tokens": 15} {"id": 828688, "source": "commit", "repo": "kneesnap/froglord", "text": "[SC] Added ability to change selected map textures.", "tokens": 12} {"id": 828843, "source": "commit", "repo": "kneesnap/froglord", "text": "Improve arc segment editor to allow editing length too.", "tokens": 11} {"id": 829449, "source": "commit", "repo": "knowm/xchange", "text": "revert - fixed maven warning: \"bootstrap class path not set in conjunction with ...\"", "tokens": 18} {"id": 829479, "source": "commit", "repo": "knowm/xchange", "text": "Fixes incidental incorrect hmac signature for Bitfinex Changes the minimum width for the signature in hexadecimal base from 64 to 96, because the algorithm use 384 bit keys, this way leading zeros don't get trimmed anymore.", "tokens": 54} {"id": 829606, "source": "commit", "repo": "knuddelsgmbh/jtokkit", "text": "feat: do not expose internal nullability of maxTokens in interface", "tokens": 13} {"id": 829744, "source": "commit", "repo": "kobylynskyi/graphql-java-codegen", "text": "Bump version to 5.2.0 - release", "tokens": 12} {"id": 829984, "source": "commit", "repo": "kobylynskyi/graphql-java-codegen", "text": "Improve project structure (#52) * Improve project structure #43 * Improve project structure #43 * Configs in \"graphqlSchemas\" should be optional #51 * Add missing file #43 * Fix module name #43", "tokens": 51} {"id": 830203, "source": "commit", "repo": "kohsuke/args4j", "text": "Massaged the contribution from @andrewgaul. The hidden() switch that always hides it from the usage screen is pointless, as it can be trivially achieved by not writing any usage. I think the underlying issue the change was trying to address is that being able to show different subset of options is often useful. Such a use case can be already seen in ExampleMode. In this change, I introduced a generalized version of ExampleMode called OptionHandlerFilter, which allows the caller to specify the subset of options. The printUsage method is extended to support this parameter, and in this way the caller can control the subset of options to print them.", "tokens": 138} {"id": 830336, "source": "commit", "repo": "kohsuke/args4j", "text": "bumping up to 2.0.7", "tokens": 11} {"id": 830354, "source": "commit", "repo": "kohsuke/args4j", "text": "This commit was generated by cvs2svn to compensate for changes in r134, which included commits to RCS files with non-trunk default branches.", "tokens": 34} {"id": 830611, "source": "commit", "repo": "kong/unirest-java", "text": "closes #191. fixed somewhere along the way. File size does not change", "tokens": 18} {"id": 830681, "source": "commit", "repo": "kong/unirest-java", "text": "some prefactoring of the headers to simplify the HttpRespose constructor so we can start to make it easier to add new functionality to it", "tokens": 29} {"id": 830984, "source": "commit", "repo": "kostyasha/github-integration-plugin", "text": "[scmsource] Allow queue item folding to happen", "tokens": 12} {"id": 831020, "source": "commit", "repo": "kostyasha/github-integration-plugin", "text": "Labels as environment variable (#207) * Add pull request labels as an environment variable. The contents will be a comma-separated string of all the labels * Add line in documentation to mention the labels environment variable * Style fix", "tokens": 48} {"id": 831356, "source": "commit", "repo": "kousen/java_latest", "text": "Remove unnecessary blank line in AstroGateway class An unnecessary blank line was removed in the AstroGateway class, located in com.kousenit.astro package. This change specifically related to the line before the declaration of the final objectMapper object which increases the code cleanliness and readability.", "tokens": 61} {"id": 831366, "source": "commit", "repo": "kousen/java_latest", "text": "Update Jackson library version to 2.16.0-rc1 Upgraded the version of the Jackson library in the Gradle library versions file from 2.15.3 to 2.16.0-rc1. This is to incorporate the newer features and improvements available in the release candidate version, while also preparing for its final release.", "tokens": 74} {"id": 831629, "source": "commit", "repo": "kousen/junit5_workshop", "text": "Remove unused CSS and JS files from the HTML report. Deleted `coverage.css` and `highlight.min.js` as they are no longer needed, reducing report bloat. This change helps streamline the project and eliminates unused dependencies.", "tokens": 52} {"id": 831771, "source": "commit", "repo": "kousen/spring-and-spring-boot", "text": "Remove local Claude settings from version control The .claude/settings.local.json file contains personal permissions and preferences that should not be shared across the repository. Added it to .gitignore to prevent future accidental commits. \ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code)", "tokens": 62} {"id": 831823, "source": "commit", "repo": "kousen/spring-and-spring-boot", "text": "Refactor JdbcClientOfficerDAOTest to use the JdbcClient to retrieve the ids of all the officers in the test database. Replaced duplicate 'findById' calls in JdbcClientOfficerDAOTest.java with a centralized method for code simplicity and efficiency. Removed redundant and unused IntStream imports, thereby enhancing code clarity and readability. The data retrieval operation is now handled directly by querying 'Officer.class', resulting in a cleaner and straightforward query process.", "tokens": 95} {"id": 832288, "source": "commit", "repo": "krabcode/lazygui", "text": "load state sorted, name changed gradient pos loaded from json", "tokens": 12} {"id": 832309, "source": "commit", "repo": "krabcode/lazygui", "text": "fixed mouse click pos bug on buttons synchronized the main window and event subscriber lists mock toolbar", "tokens": 18} {"id": 832385, "source": "commit", "repo": "kyoripowered/adventure", "text": "chore(api): Further refactor (including `text` package) to remove deprecations and use modern language features", "tokens": 23} {"id": 832556, "source": "commit", "repo": "kyoripowered/adventure", "text": "api: Nullability enforcement on builders, aiming to fail-fast", "tokens": 17} {"id": 832627, "source": "commit", "repo": "kyoripowered/adventure", "text": "api: Don't generate bridge methods for StyleImpl fields", "tokens": 13} {"id": 832868, "source": "commit", "repo": "kyoripowered/adventure-platform", "text": "Fix CraftBukkitFacet on 1.20.2", "tokens": 13} {"id": 833209, "source": "commit", "repo": "lacuna/bifurcan", "text": "Fix the generative tests broken by PR #41 (redux) (#45) * Use https repository for usethesource.io This repository is necessary to get the io.usethesource.capsule test dependency. Since maven 3.8.1 HTTP repositories are blocked by default. See https://maven.apache.org/docs/3.8.1/release-notes.html * fix DiffList linear and forked methods * Reset the slice when doing a linear set op on a DiffList. I believe it needs to be reset because the new underlying collection is the result of applying the old slice, so it should never be sliced again. This resolves the error in test-linear-list that shrinks to [:concat [0 0]] [:diff-wrap] [:linear] [:remove-last] [:set 0 0] * Maintain linear property in DiffList on prefix, suffix and slice while slicing. * Clean up formatting on my change a bit ---------", "tokens": 216} {"id": 833316, "source": "commit", "repo": "lacuna/bifurcan", "text": "fix formatting, add initial implementation of FloatMap", "tokens": 10} {"id": 833409, "source": "commit", "repo": "Ladysnake/Cardinal-Components-API", "text": "Bump version to 7.3.1", "tokens": 10} {"id": 833461, "source": "commit", "repo": "Ladysnake/Cardinal-Components-API", "text": "Add load and unload callbacks on components, closes #120", "tokens": 14} {"id": 834222, "source": "commit", "repo": "lambdaurora/spruceui", "text": ":bug: Fix missing Fabric API dependency in mod's manifest.", "tokens": 15} {"id": 834423, "source": "commit", "repo": "Lambdua/openai4j", "text": "Add vscode and bin/obj folders to gitignore (#152)", "tokens": 16} {"id": 834547, "source": "commit", "repo": "langgraph4j/langgraph4j", "text": "docs(mkdocs): reorganize navigation structure and add \"What's new in 1.9\" section", "tokens": 24} {"id": 834621, "source": "commit", "repo": "langgraph4j/langgraph4j", "text": "build(javelit): bump to next version 1.8.11", "tokens": 18} {"id": 834657, "source": "commit", "repo": "langgraph4j/langgraph4j", "text": "build: bump to next dev version 1.8-SNAPSHOT", "tokens": 14} {"id": 835016, "source": "commit", "repo": "lavalink-devs/youtube-source", "text": "Capture dollar sign (#109) fixes c548b3da https://discord.com/channels/1082302532421943407/1343974517621653645/1343974517621653645", "tokens": 85} {"id": 835137, "source": "commit", "repo": "lavalink-devs/youtube-source", "text": "Throw exception if no clients support format loading.", "tokens": 11} {"id": 835556, "source": "commit", "repo": "leibnitz27/cfr", "text": "OOOPS TYPO in switch expressions.", "tokens": 11} {"id": 835630, "source": "commit", "repo": "leibnitz27/cfr", "text": "Fix issue with get class rewriter - can't always assume constpool args", "tokens": 17} {"id": 835692, "source": "commit", "repo": "leibnitz27/cfr", "text": "0_79 git-svn-id: file:///Users/lee/SVNrep/decompiler/trunk@949 c820dd76-da7a-4b58-9bdb-1b1215dfe356", "tokens": 60} {"id": 835715, "source": "commit", "repo": "leibnitz27/cfr", "text": "tweak switch block contiguity checking. git-svn-id: file:///Users/lee/SVNrep/decompiler/trunk@812 c820dd76-da7a-4b58-9bdb-1b1215dfe356", "tokens": 64} {"id": 835823, "source": "commit", "repo": "leibnitz27/cfr", "text": "Inner class construction tests git-svn-id: file:///Users/lee/SVNrep/decompiler/trunk@340 c820dd76-da7a-4b58-9bdb-1b1215dfe356", "tokens": 60} {"id": 835832, "source": "commit", "repo": "leibnitz27/cfr", "text": "Consume 'spare' stackdelta so we don't miss merges git-svn-id: file:///Users/lee/SVNrep/decompiler/trunk@302 c820dd76-da7a-4b58-9bdb-1b1215dfe356", "tokens": 71} {"id": 835868, "source": "commit", "repo": "leibnitz27/cfr", "text": "generic iter tests git-svn-id: file:///Users/lee/SVNrep/decompiler/trunk@141 c820dd76-da7a-4b58-9bdb-1b1215dfe356", "tokens": 58} {"id": 836652, "source": "commit", "repo": "leonmangler/supervanish", "text": "Bump version to v6.1.5", "tokens": 10} {"id": 836655, "source": "commit", "repo": "leonmangler/supervanish", "text": "Update SilentOpenChest for 1.15", "tokens": 12} {"id": 836696, "source": "commit", "repo": "leonmangler/supervanish", "text": "Update to v5.9.7: Fix NoSuchMethodError for MC1.8 in TablistPacketMgr", "tokens": 23} {"id": 836716, "source": "commit", "repo": "leonmangler/supervanish", "text": "Revert \"Dynmap Hook Chat Improvement (Unable to test)\" (#5)", "tokens": 19} {"id": 836761, "source": "commit", "repo": "leonmangler/supervanish", "text": "Change version for final release of 5.3.2", "tokens": 13} {"id": 836961, "source": "commit", "repo": "lgooddatepicker/lgooddatepicker", "text": "Update pom.xml Change so a Linux user could build the project. Someone in windows should build it also without any problems.", "tokens": 27} {"id": 836982, "source": "commit", "repo": "lgooddatepicker/lgooddatepicker", "text": "Feature Request #25 List of changes proposed by BlakeTNC -Renamed Area enums to DateArea and TimeArea in DatePickerSettings and TimePickerSettings respectively, to be able to differentiate them. - Added javadoc comment to TimeArea (copied from DateArea) - Default color for TimePickerTextInvalidTime set to Color.red - Imported TimeArea in TimePicker.java and BasicDemo.java and removed prefixes used to reference it. - Renamed \"TextFieldBackground areas\" in both DateArea and TimeArea in the settings classes.", "tokens": 113} {"id": 837089, "source": "commit", "repo": "li2109/langtorch", "text": "Not use raw type in OpenAITokenUsageInterceptor", "tokens": 10} {"id": 837139, "source": "commit", "repo": "li2109/langtorch", "text": "Adding OpenAIService modules with and without API key", "tokens": 10} {"id": 837199, "source": "commit", "repo": "li2109/langtorch", "text": "Change to use private constructor in OpenAIService and create instance with static factory method instead", "tokens": 17} {"id": 837242, "source": "commit", "repo": "li2109/langtorch", "text": "Change input type of runAsync function in Capability interface", "tokens": 12} {"id": 837341, "source": "commit", "repo": "linlinjava/litemall", "text": "[release]: v0.9.0", "tokens": 10} {"id": 837350, "source": "commit", "repo": "lisawray/groupie", "text": "Add a GitHub Actions workflow to run tests and lint.", "tokens": 12} {"id": 837423, "source": "commit", "repo": "lisawray/groupie", "text": "Update readme to mention kotlin synthetic caching bug #235", "tokens": 13} {"id": 837496, "source": "commit", "repo": "lisawray/groupie", "text": "Clarify how to use legacy ViewHolders in README", "tokens": 11} {"id": 837554, "source": "commit", "repo": "lisawray/groupie", "text": "Enforce that you can't add null groups to the adapter", "tokens": 14} {"id": 837623, "source": "commit", "repo": "llamalad7/mixinextras", "text": "Fix: Resolve VerifyError due to obscure WrapWithCondition/ModifyReceiver + Redirect interaction. A WrapWithCondition or a ModifyReceiver which captures its target args when applied to a Redirect which doesn't but has sugar would mistakenly load the sugar params instead of the args. The handlerArgMap needed to be trimmed to remove trailing args before adding the enclosing method's params. Notably, this interaction could also occur when the applied Redirect captures the enclosing params rather than has sugar, but in this case the interaction is coincidentally benign, with the corresponding inner captured params being loaded instead of the original params.", "tokens": 135} {"id": 837682, "source": "commit", "repo": "llamalad7/mixinextras", "text": "README: Recommend 0.4.0", "tokens": 11} {"id": 837789, "source": "commit", "repo": "llamalad7/mixinextras", "text": "Fix: Make `Identifier`s aware of their role in the expression. Resolves some strange false matches.", "tokens": 22} {"id": 838012, "source": "commit", "repo": "ln-zap/zap-android", "text": "Update translations, added icon for nodes (#427)", "tokens": 13} {"id": 838111, "source": "commit", "repo": "ln-zap/zap-android", "text": "Bump version to 0.3.8-beta (#286)", "tokens": 17} {"id": 838127, "source": "commit", "repo": "ln-zap/zap-android", "text": "Warn user about old LND version (#263)", "tokens": 14} {"id": 838202, "source": "commit", "repo": "ln-zap/zap-android", "text": "Update features in readme (#172)", "tokens": 10} {"id": 838340, "source": "commit", "repo": "ln-zap/zap-android", "text": "Subscription to invoices - part 4 - will now work while updating - fixed a bug that caused wrong linking of invoices. Invoice list is now sorted correctly.", "tokens": 35} {"id": 838419, "source": "commit", "repo": "ln-zap/zap-android", "text": "support upper case encoded bech32, fix reset all for Android 9", "tokens": 17} {"id": 838487, "source": "commit", "repo": "loiane/crud-angular-spring", "text": "refactor(courses): enhance course name uniqueness validation * Introduced a new method to find courses by name, including soft-deleted ones. * Updated validation logic to ensure course names are unique across all courses. * Removed unused validation class for lesson collections. * Updated tests to reflect changes in repository and service methods. * Added configuration to disable public API documentation.", "tokens": 76} {"id": 839190, "source": "commit", "repo": "lothrazar/cyclic", "text": "add my username to my license and import current forge 1.9 MDK licenses", "tokens": 20} {"id": 839205, "source": "commit", "repo": "lothrazar/cyclic", "text": "my bad, looks like i dont need reflection. also moved to postInit", "tokens": 16} {"id": 839442, "source": "commit", "repo": "ls1intum/artemis", "text": "Development: Highlight non-graded AI feedback in blue in code editor (#12235)", "tokens": 23} {"id": 839575, "source": "commit", "repo": "ls1intum/artemis", "text": "Development: Bump version to 6.5.4", "tokens": 12} {"id": 839619, "source": "commit", "repo": "ls1intum/artemis", "text": "General: Fix a bug that caused the first breadcrumb item to be two-lined in Safari (#5680)", "tokens": 28} {"id": 839667, "source": "commit", "repo": "ls1intum/artemis", "text": "Use UTC timezone in cypress (#3925)", "tokens": 14} {"id": 839773, "source": "commit", "repo": "ls1intum/artemis", "text": "Update Bamboo version (#1289)", "tokens": 13} {"id": 840144, "source": "commit", "repo": "lucko/helper", "text": "Add NmsVersion utility and add method handle / proxy utils", "tokens": 13} {"id": 840223, "source": "commit", "repo": "lucko/helper", "text": "cleanup handling of addon plugins in DummyHelperPlugin", "tokens": 10} {"id": 840469, "source": "commit", "repo": "luckperms/luckperms", "text": "Store result of primary group calculation in CachedMetaData", "tokens": 10} {"id": 840599, "source": "commit", "repo": "luckperms/luckperms", "text": "Primary groups should come first, not last, when ordering groups for inheritance (#500)", "tokens": 21} {"id": 841281, "source": "commit", "repo": "LunaDeerMC/Dominion", "text": "fix: add symbol property to ChestButton and update ChestListView to filter items by symbol", "tokens": 20} {"id": 841294, "source": "commit", "repo": "LunaDeerMC/Dominion", "text": "fix #118: update player dominion map removal logic in DominionCache", "tokens": 16} {"id": 841351, "source": "commit", "repo": "LunaDeerMC/Dominion", "text": "set event priority to LOWEST for player input and logout event handlers", "tokens": 15} {"id": 841397, "source": "commit", "repo": "LunaDeerMC/Dominion", "text": "fix cant delete dominion if owner not online", "tokens": 10} {"id": 841517, "source": "commit", "repo": "LunarClient/Apollo", "text": "Fix - Velocity & Bungee Platform (#59) * Fix - Velocity Platform Fix registering of apollo players on velocity, handle incoming apollo packets from clients, add non world / entity based modules * abstract incoming packet handling and register all the modules except tnt cooldown * Fix plugin message handling on bungee ---------", "tokens": 63} {"id": 841632, "source": "commit", "repo": "LunarClient/Apollo", "text": "finish saturation doc & add callout to tntcountdown doc", "tokens": 15} {"id": 842316, "source": "commit", "repo": "lushen124/universal-fe-randomizer", "text": "Added basic support for skill randomization (except for Ike, for some reason).", "tokens": 19} {"id": 842382, "source": "commit", "repo": "lushen124/universal-fe-randomizer", "text": "Removed Silence Sword from the weapon pool, since it doesn't work properly.", "tokens": 19} {"id": 842444, "source": "commit", "repo": "lushen124/universal-fe-randomizer", "text": "Added option in the UI to randomize Julia if desired.", "tokens": 15} {"id": 842949, "source": "commit", "repo": "lwjglgamedev/vulkanbook", "text": "Update to Java 15 Added also a hint on how to execute the projects.", "tokens": 18} {"id": 843069, "source": "commit", "repo": "lwjglx/lwjgl3-awt", "text": "Delete OpenGL contexts when disposing canvases", "tokens": 11} {"id": 843278, "source": "commit", "repo": "maddevsio/mad-location-manager", "text": "Changed MadgwickAHRS. Fixed for demo application", "tokens": 14} {"id": 843544, "source": "commit", "repo": "magefree/mage", "text": "[ZNR] Implemented Kitesail Cleric", "tokens": 12} {"id": 843720, "source": "commit", "repo": "magefree/mage", "text": "* Gideon's Phalanx, Kytheon's Tactics and Send to Sleep - Fixed that the spell mastery condition is only checked once during resolution of the spell.", "tokens": 45} {"id": 844228, "source": "commit", "repo": "malte0811/ferritecore", "text": "Change expected package name for Lithium, see #173", "tokens": 15} {"id": 844263, "source": "commit", "repo": "malte0811/ferritecore", "text": "Fix version replacement caching on Fabric, closes #78", "tokens": 12} {"id": 844363, "source": "commit", "repo": "malte0811/ferritecore", "text": "Make loader-specific code in Mixin config work", "tokens": 10} {"id": 845390, "source": "commit", "repo": "mapbox/mapbox-java", "text": "bump okhttp to 4.9.0 (#1271)", "tokens": 17} {"id": 845433, "source": "commit", "repo": "mapbox/mapbox-java", "text": "Updated SNAPSHOT link in README (#1126)", "tokens": 13} {"id": 845436, "source": "commit", "repo": "mapbox/mapbox-java", "text": "removed typo in bannerview class docs (#1111)", "tokens": 14} {"id": 845557, "source": "commit", "repo": "mapbox/mapbox-java", "text": "removed wiki to place docs in doc folder and fixed readme image (#645)", "tokens": 18} {"id": 846083, "source": "commit", "repo": "maplibre/maplibre-navigation-android", "text": "Check for null raw location before setting bearing (#476)", "tokens": 15} {"id": 846104, "source": "commit", "repo": "maplibre/maplibre-navigation-android", "text": "Activate LocationEngine in onCreate (#321) * Activate location engine in onCreate * Remove timber import", "tokens": 25} {"id": 847187, "source": "commit", "repo": "markusfisch/pielauncher", "text": "Replace CLOCK_TICK with CONTEXT_CLICK Or `HapticFeedbackConstants.KEYBOARD_TAP` below Android M. Because apparently, `HapticFeedbackConstants.CLOCK_TICK` isn't actually available on some devices (e.g. Fairphone 4). Simplifies defining private haptic feedback constants a bit.", "tokens": 74} {"id": 847254, "source": "commit", "repo": "markusfisch/pielauncher", "text": "Scroll below toolbar in all activities Match the look and feel of the app drawer.", "tokens": 18} {"id": 847300, "source": "commit", "repo": "markusfisch/pielauncher", "text": "Keep scroll reference in its own field Required to avoid modifying y, which interferes with isTap(). Before this, isTap() could incorrectly fire for very short swipes when overscrolling. The scrolling modified the y coordinate which modified the distance the finger had travelled to be within the touch slop when it really was moved much further.", "tokens": 72} {"id": 847336, "source": "commit", "repo": "markusfisch/pielauncher", "text": "Hide unimportant settings in welcome screen And focus on what's really important. Nobody wants to deal with unimportant things at the first start.", "tokens": 33} {"id": 847509, "source": "commit", "repo": "markusfisch/pielauncher", "text": "Suppress static leak lint warning for AsyncTask This AsyncTask is *meant* to keep its parent instance around while it's running. There's nothing wrong with keeping the instance for a short while.", "tokens": 44} {"id": 847588, "source": "commit", "repo": "markusfisch/shadereditor", "text": "Advance version number to 2.34.2", "tokens": 13} {"id": 847618, "source": "commit", "repo": "markusfisch/shadereditor", "text": "Check if setting a wallpaper is supported/allowed And show a message otherwise.", "tokens": 17} {"id": 847746, "source": "commit", "repo": "markusfisch/shadereditor", "text": "Advance version number to 2.10.5", "tokens": 13} {"id": 847769, "source": "commit", "repo": "markusfisch/shadereditor", "text": "Put Abstract before SamplerPropertiesFragment Because it's an abstract class and so its name should reflect that. Like it is with all other abstract classes.", "tokens": 32} {"id": 848290, "source": "commit", "repo": "martinpaljak/ant-javacard", "text": "Add version to the .jar; add guards for some questionable features", "tokens": 16} {"id": 848326, "source": "commit", "repo": "martinpaljak/ant-javacard", "text": "Release v24.04.08", "tokens": 11} {"id": 848331, "source": "commit", "repo": "martinpaljak/ant-javacard", "text": "Make sure UTC is used or timestamps will be off", "tokens": 12} {"id": 848366, "source": "commit", "repo": "martinpaljak/ant-javacard", "text": "Set version to 23.08.30-SNAPSHOT", "tokens": 15} {"id": 848570, "source": "commit", "repo": "martinpaljak/ant-javacard", "text": "Works with 3.0.5 without any changes!", "tokens": 14} {"id": 848574, "source": "commit", "repo": "martinpaljak/ant-javacard", "text": "Make CAP files relative to project folder. Otherwise they are created in parent project folder, if nesting projects.", "tokens": 23} {"id": 849103, "source": "commit", "repo": "mastercard/client-encryption-java", "text": "Adding status badge for GA Build & Test", "tokens": 10} {"id": 849136, "source": "commit", "repo": "mastercard/client-encryption-java", "text": "Next version is v1.3.2", "tokens": 11} {"id": 849651, "source": "commit", "repo": "maximiliananzinger/pgdp2223-tests", "text": "[W11H03] Network Tests (#277) Unlike Felix I don\u2019t create a new http server. These tests are more simple in nature but less effective.", "tokens": 103} {"id": 849663, "source": "commit", "repo": "maximiliananzinger/pgdp2223-tests", "text": "[W10H02] Added computeScores() test near the boundaries (#251) Some implementations of `computeScores()` may run into an overflow in this test.", "tokens": 101} {"id": 849710, "source": "commit", "repo": "maximiliananzinger/pgdp2223-tests", "text": "[W08H03] Fixed performance (#180) `Collections.sort` is getting called unnecessarily. This PR fixes the unnecessary call and improves the performance of the tests.", "tokens": 41} {"id": 849761, "source": "commit", "repo": "maximiliananzinger/pgdp2223-tests", "text": "add w6h1 tests add tests for methods from easy of week 6", "tokens": 17} {"id": 850069, "source": "commit", "repo": "maxmaeder/drivebackupv2", "text": "WebDAV: Make sure to specify content length", "tokens": 11} {"id": 850193, "source": "commit", "repo": "maxmaeder/drivebackupv2", "text": "Verification format pattern doesn't contain illegal characters.", "tokens": 12} {"id": 850332, "source": "commit", "repo": "maxmaeder/drivebackupv2", "text": "Changed setup steps to include restarting the server", "tokens": 10} {"id": 850421, "source": "commit", "repo": "maze-runnar/interview-preparation-kit", "text": "Added Code for Minimum Swaps in Js", "tokens": 10} {"id": 850436, "source": "commit", "repo": "maze-runnar/interview-preparation-kit", "text": "Rename fibonacci_numbers.java to Fibonacci_numbers.java", "tokens": 15} {"id": 850603, "source": "commit", "repo": "mcdcorp/opentest", "text": "fix(actor): Appium(AssertElementNotVisible) doesn't work as expected in absense of swipe argument.", "tokens": 25} {"id": 851954, "source": "commit", "repo": "mcphackers/retromcp-java", "text": "refactor: Allow merge mappings task in prod.", "tokens": 11} {"id": 851983, "source": "commit", "repo": "mcphackers/retromcp-java", "text": "Revert \"Use JAVA_HOME option if set for running the game\" This reverts commit 6f8a0516019e06badcce48e3d368db920a926238.", "tokens": 56} {"id": 852177, "source": "commit", "repo": "mcphackers/retromcp-java", "text": "Updated dependency management. Remove duplicate dependencies (Tiny Remapper).", "tokens": 14} {"id": 852406, "source": "commit", "repo": "mcxr-org/mcxr", "text": "update to 1.17.1", "tokens": 10} {"id": 853478, "source": "commit", "repo": "meilisearch/meilisearch-java", "text": "centralize the serialization/deserialization logic (#36) * add JSON handling * add GsonJsonHandler * add JacksonJsonHandler * add JsonB Handler * add Unit Tests for Jackson and Gson JsonHandler", "tokens": 42} {"id": 853691, "source": "commit", "repo": "mekanism/mekanism", "text": "Centered Security Desk Lock Textures", "tokens": 10} {"id": 853733, "source": "commit", "repo": "mekanism/mekanism", "text": "Move evap controller and resistive heater over to vanilla update packets", "tokens": 16} {"id": 853774, "source": "commit", "repo": "mekanism/mekanism", "text": "Cleanup more duplicate code that can be extracted to intermediary interfaces", "tokens": 13} {"id": 854189, "source": "commit", "repo": "meraki-analytics/orianna", "text": "Clean up SearchableLists and being integrating MatchReference into Match", "tokens": 15} {"id": 854241, "source": "commit", "repo": "meraki-analytics/orianna", "text": "up jackson version, add pipeline configuration, fix some serialization issues", "tokens": 13} {"id": 854846, "source": "commit", "repo": "mercedes-benz/dna", "text": "Delete .github/secret_scanning.yml (#2696)", "tokens": 18} {"id": 854879, "source": "commit", "repo": "mercedes-benz/dna", "text": "Added probes for the i3postgress for the foss", "tokens": 14} {"id": 855259, "source": "commit", "repo": "mercedes-benz/sechub", "text": "Automatically delete create temp folders #4129", "tokens": 12} {"id": 855465, "source": "commit", "repo": "mercedes-benz/sechub", "text": "Update zap-addons and add the official release of sarif reporting #1757", "tokens": 24} {"id": 855700, "source": "commit", "repo": "mercedes-benz/sechub", "text": "Prevent flaky tests #99 - scheduler jobs can be already started at integration tests so we test no longer to \"READY_FOR_START\" but also accept \"STARTED\" - changed assert api so its possible to define multiple acceptable states for job", "tokens": 50} {"id": 855911, "source": "commit", "repo": "Metaphoriker/pathetic", "text": "Added PathState MAX_ITERATIONS_REACHED", "tokens": 10} {"id": 856028, "source": "commit", "repo": "methusalah/OpenRTS", "text": "replace fr.pinsterest.com by pinterest.com better for users from other countries", "tokens": 21} {"id": 856216, "source": "commit", "repo": "methusalah/OpenRTS", "text": "add trivial TestNG Test ignore possible testNG output", "tokens": 10} {"id": 856276, "source": "commit", "repo": "methusalah/OpenRTS", "text": "Work on physic actor wip", "tokens": 10} {"id": 856293, "source": "commit", "repo": "methusalah/OpenRTS", "text": "WIP refactor Ce commit ne compile pas", "tokens": 11} {"id": 856346, "source": "commit", "repo": "methusalah/OpenRTS", "text": "fix #27 fix bug on particles life add particle builder unknown element error message add smoke trail to missiles for testing purpose refactor actor drawing for more readability", "tokens": 34} {"id": 856691, "source": "commit", "repo": "mezz/justenoughitems", "text": "Fix IRecipeRegistry#removeRecipe #833", "tokens": 12} {"id": 857251, "source": "commit", "repo": "michaelwuensch/bitbanana", "text": "Translated using Weblate (German) Currently translated at 100.0% (916 of 916 strings) Translation: BitBanana/App strings Translate-URL: https://hosted.weblate.org/projects/bitbanana/app-strings/de/", "tokens": 56} {"id": 857368, "source": "commit", "repo": "michaelwuensch/bitbanana", "text": "Translated using Weblate (Ukrainian) Currently translated at 100.0% (734 of 734 strings) Translation: BitBanana/App strings Translate-URL: https://hosted.weblate.org/projects/bitbanana/app-strings/uk/", "tokens": 59} {"id": 857485, "source": "commit", "repo": "michaelwuensch/bitbanana", "text": "Bump version to 0.6.5", "tokens": 10} {"id": 857616, "source": "commit", "repo": "microsoft/azure-devops-intellij", "text": "Add a working sample of a pending changes gatherer", "tokens": 11} {"id": 857686, "source": "commit", "repo": "microsoft/azure-devops-intellij", "text": "Merged PR 190871: Passing server context for workspace mapping browse Passig server context for workspace mapping browse Related work items: #938230", "tokens": 40} {"id": 857894, "source": "commit", "repo": "microsoft/azure-devops-intellij", "text": "sort out dependencies to make sure openapi doesn't depend on any impl modules", "tokens": 17} {"id": 857921, "source": "commit", "repo": "microsoft/azure-devops-intellij", "text": "create web project wizard (in progress) + minor fixes", "tokens": 12} {"id": 858123, "source": "commit", "repo": "microsoft/azure-maven-plugins", "text": "move waitUntilDeploymentReady to DeployWebAppTask", "tokens": 10} {"id": 858467, "source": "commit", "repo": "microsoft/azure-maven-plugins", "text": "Add binding informations (#337)", "tokens": 10} {"id": 858471, "source": "commit", "repo": "microsoft/azure-maven-plugins", "text": "merge artifact handler changes to develop (#290) * extract artifact handler interface and ftp impl to lib module for function and web app to share (#268) * refactor functions change to align with that artifact handler interface defined in lib (#274) * rename interface and implementation to align java rules (#276) * refactor webapp to align artifact handler interface changes in lib (#275) * implement zipDeploy in BaseDeployTarget thanks to SDK change (#284) * add sort import module in checkstyle (#286) * add unused import module to checkstyle (#288) * upgrade lib and webapp to next release snapshot", "tokens": 137} {"id": 858522, "source": "commit", "repo": "microsoft/botbuilder-java", "text": "Added Teams meeting start/end (#1260) * Added Teams meeting start/end * Switched to using OffsetDateTime instead of String for Teams meeting models * Accept case insensitive properties in JSON * Corrected unit test after case insensitive JSON change * Corrected MeetingEndEventDetails superclass * Added TeamsInfo.getMeetingInfo overload to allow optional meetingId", "tokens": 77} {"id": 858539, "source": "commit", "repo": "microsoft/botbuilder-java", "text": "Add Pom.xml to compile all samples. (#1142)", "tokens": 17} {"id": 858585, "source": "commit", "repo": "microsoft/botbuilder-java", "text": "Luis-v3, switched to JUnit 4 to get Maven unit tests running, code formatting (#1017)", "tokens": 28} {"id": 858865, "source": "commit", "repo": "microsoft/botbuilder-java", "text": "Add cobertura-maven-plugin back to rot pom.xml, including outputDirectory and aggregate settings.", "tokens": 22} {"id": 858969, "source": "commit", "repo": "microsoft/copilot-for-eclipse", "text": "feat: Added Ollama as a BYOK model provider (#387) * Added Language server API to support Ollama. * Added Ollama URL configuration dialog. * Add support for Ollama provider configuration and management * Add tests for Ollama provider configuration and model management * Address comments. * Address comments.", "tokens": 59} {"id": 859068, "source": "commit", "repo": "microsoft/copilot-for-eclipse", "text": "fix - Exceptions when closing Eclipse IDE (#1556)", "tokens": 15} {"id": 859088, "source": "commit", "repo": "microsoft/copilot-for-eclipse", "text": "fix: Set model apply to always (#1494)", "tokens": 14} {"id": 859098, "source": "commit", "repo": "microsoft/copilot-for-eclipse", "text": "fix: Prompt user to restart when sub-agent is toggled (#1449)", "tokens": 20} {"id": 859132, "source": "commit", "repo": "microsoft/copilot-for-eclipse", "text": "fix - Improves NES related issues (#1307) - fix #1306: using position to track indentation line - fix #1275: if completion items are identical to original texts, fallback to NES - fix #1273 - fix #1272: Older versions of Eclipse(<=4.36) had an issue where, after setting autoScale in eclipse.ini, the lineNumberRulerColumn would be obscured. This issue was fixed in 4.37(eclipse-platform/eclipse.platform.ui#3158). <=4.36:", "tokens": 138} {"id": 859174, "source": "commit", "repo": "microsoft/copilot-for-eclipse", "text": "fix - consider product customization for whatsnew preferences This fixes regression from commit 83214c14f9c28fbee491dfb8adef388a9c902ccf reported at https://github.com/eclipse-copilot/eclipse-copilot/issues/45. The main point is that the values that need to be **stored** in the configuration scope should be **read** via `Platform.getPreferencesService()`. The `IPreferencesService` includes by default (no scopes given) **all** scopes (also config, instance and product relevant here). The `CopilotPreferenceInitializer` doesn't need to set any values in the configuration scope, if nothing is set, defaults hard-coded in the code can be used used and set to the instance defaults, if config scope has custom value, this will be used for the instance scope as default. This way the `GeneralPreferencesPage` will always show the \"right\" value for reading from the workspace scope and for writing it will write to both workspace and config scope. Note also that this patch fixes the plugin id used to store preferences, it reverts the code to the original state where the preferences from `com.microsoft.copilot.eclipse.ui` bundle were used. To verify the fix with product customization, start Eclipse with extra application argument `-pluginCustomization /tmp/pluginCustomization.ini` and the file content like below: ``` com.microsoft.copilot.eclipse.ui/autoShowWhatsNew=false com.microsoft.copilot.eclipse.ui/lastUsedCopilotPluginVersion=0.11 com.microsoft.copilot.eclipse.ui/copilotQuickStartVersion=1 ``` That should not show any \"what's new\" dialog. Fixes https://github.com/eclipse-copilot/eclipse-copilot/issues/45", "tokens": 391} {"id": 859292, "source": "commit", "repo": "microsoft/copilot-for-eclipse", "text": "build - Update CLS to 1.327.0 (#808)", "tokens": 20} {"id": 859315, "source": "commit", "repo": "microsoft/copilot-for-eclipse", "text": "fix - Connect document when compare editor closed. (#728)", "tokens": 15} {"id": 859363, "source": "commit", "repo": "microsoft/copilot-for-eclipse", "text": "fix - Store model id instead of name (#561)", "tokens": 14} {"id": 859593, "source": "commit", "repo": "microsoft/gctoolkit", "text": "Fix breaking test (#231) * refactor: add/fix tests * feature: Fixing tests * refactor: remove redundant versions of toKBytes methods after merge with main * refactor: fix broken test for ZGC * refactor: fix breaking test", "tokens": 51} {"id": 859616, "source": "commit", "repo": "microsoft/gctoolkit", "text": "refactor: setup for releasing to maven central:", "tokens": 10} {"id": 859618, "source": "commit", "repo": "microsoft/gctoolkit", "text": "build: roll back to version 2.0.5", "tokens": 13} {"id": 859952, "source": "commit", "repo": "microsoft/hydralab", "text": "Disable draft PR trigger CI (#554)", "tokens": 11} {"id": 859964, "source": "commit", "repo": "microsoft/hydralab", "text": "Bugfix: uninstall app before XCTest to clear data (#533)", "tokens": 17} {"id": 859980, "source": "commit", "repo": "microsoft/hydralab", "text": "Update screen recorder for tests of android_client, to make sure the screen recording is performed correctly (#469) * Update screen recorder for tests of android_client, to make sure the screen recording is performed correctly. * Add compatibility in code for android client tests * Update command for device action usage. * Abstract retry logic into ADBOperateUtil.pullFileToDir; * Update var name with log * Update flag * Update related gradle plugin config", "tokens": 93} {"id": 860025, "source": "commit", "repo": "microsoft/hydralab", "text": "[Perf] Add test case name and description to the performance test chart (#413) * [Perf] Add test case name and description to the perf test chart * Resolve comments", "tokens": 38} {"id": 860121, "source": "commit", "repo": "microsoft/hydralab", "text": "[Refactor] Rename DeviceTestTask to TestRun (#223) * Rename DeviceTestTask to TestRun * Rename all", "tokens": 26} {"id": 860152, "source": "commit", "repo": "microsoft/hydralab", "text": "Fix Find By Name For Android (#165) * Fix Find By Name For Android * Tested and fix root win driver logic * Change structure * Fix", "tokens": 35} {"id": 860285, "source": "commit", "repo": "microsoft/LangChain4j-for-Beginners", "text": "Update README.md to enhance Quick Start section with new topics", "tokens": 13} {"id": 860294, "source": "commit", "repo": "microsoft/LangChain4j-for-Beginners", "text": "Refactor document directory resolution logic in SimpleReaderDemo", "tokens": 10} {"id": 860940, "source": "commit", "repo": "microsoft/malmo", "text": "Update launchClient.sh add mkdir for config folder", "tokens": 12} {"id": 861060, "source": "commit", "repo": "microsoft/mssql-jdbc", "text": "Version update to 13.5.1 preview release (#2947)", "tokens": 19} {"id": 861088, "source": "commit", "repo": "microsoft/mssql-jdbc", "text": "Issue#2550 - Fixed getGeneratedKeys functionality for execute API (#2554) * Issue#2550 - Fixed getGeneratedKeys functionality for execute API * Adapted the test for working with jdk8 * Fixed indenetation * Enable thre new TCGenKeys tests for AzureDW * Incorporated review comments. * Incorporated review comments * Incorporated review comments * Add a test for PreparedStatement * Adding a fix and test case for issue # 2587 * Added a new test for execute API with set no count", "tokens": 119} {"id": 861172, "source": "commit", "repo": "microsoft/mssql-jdbc", "text": "Fixed Polling and Tests for ICR If we get end-of-stream on a read() within a poll(), return false and treat that as a disconnected socket. Logging and arraycopy fix Adding check to ensure setting idle timeout doesn't silently fail Simplify / Fix minimize idle network tracker fixed icr tests, formatting", "tokens": 65} {"id": 861224, "source": "commit", "repo": "microsoft/mssql-jdbc", "text": "Fix getImportedKeys() returning duplicate rows if multiple FKs have the same name (#1092) * fixed for github #1091 dup rows", "tokens": 36} {"id": 861264, "source": "commit", "repo": "microsoft/mssql-jdbc", "text": "Fix | Add test dependency of 'slf4j-nop' to ignore slf4j log messages in JUnit tests (#841)", "tokens": 30} {"id": 861332, "source": "commit", "repo": "microsoft/mssql-jdbc", "text": "new property for cancelTimeout to cancel the query timeout", "tokens": 11} {"id": 861435, "source": "commit", "repo": "microsoft/mssql-jdbc", "text": "make 'sendBulkCopyCommand()' throw exception", "tokens": 10} {"id": 861776, "source": "commit", "repo": "microsoft/semantic-kernel-java", "text": "Java: merge dsgrieve/java-v1-api into java-v1 (#4405) Work on 01, 02, 03, 04 examples of the SK-v1 API ---------", "tokens": 52} {"id": 861825, "source": "commit", "repo": "microsoft/semantic-kernel-java", "text": "Java: Fix invoking Action planner not copying the invocation state (#1957) - Fix bug with ActionPlanner not copying the invocation state when the plan is invoked - Improve the pretty printing of plans - Cleanup ActionPlan returned by completion before parsing it - Allow ActionPlanner to invoke native functions", "tokens": 61} {"id": 861836, "source": "commit", "repo": "microsoft/semantic-kernel-java", "text": "Java - Waitskill added (#1674) ### Motivation and Context ### Description Based on the [wait_skill.py](https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/core_skills/wait_skill.py) I implemented the WaitSkill by using Mono of Project Reactor. ### Contribution Checklist - [x] The code builds clean without any errors or warnings - [x] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) - [ ] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with `dotnet format` - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone :smile:", "tokens": 315} {"id": 861845, "source": "commit", "repo": "microsoft/semantic-kernel-java", "text": "Add settings retrieval through properties file and env vars (#1361) ### Motivation and Context Add settings retrieval through properties file and env vars ### Description Adds util.Settings to load settings values from a properties file or from the environment. Also, the ability to have different client settings in the properties file and load them by their specific schema Id: ```yaml client.azureopenai.key: \"AZURE_OPEN_AI_KEY\" client.azureopenai.endpoint: \"AZURE_OPEN_AI_ENDPOINT\" client.azureopenai.deploymentname: \"AZURE_OPEN_AI_DEPLOYMENT_NAME\" client.myazureopenai.key: \"AZURE_OPEN_AI_KEY\" client.myazureopenai.endpoint: \"AZURE_OPEN_AI_ENDPOINT\" client.myazureopenai.deploymentname: \"AZURE_OPEN_AI_DEPLOYMENT_NAME\" ``` By calling `Settings.getAzureOpenAISettingsFromFile(CONF_PROPERTIES)` the user would be able to load the Azure settings using the default schema id, as shown in the block at the top. By calling `Settings.getAzureOpenAISettingsFromFile(CONF_PROPERTIES, \"myazureopenai\")` the user would be able to load a different Azure configuration by just adding the second block to the properties file. ### Contribution Checklist - [ ] The code builds clean without any errors or warnings - [ ] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) - [ ] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with `dotnet format` - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone :smile: ---------", "tokens": 439} {"id": 861925, "source": "commit", "repo": "microsoft/typespec", "text": "[http-client-csharp] Fix spread model parameter matching to use wire name (#10111) ## Problem When generating convenience methods with spread model construction, parameters were matched between the convenience method and the model constructor by C# name. This fails when: - **\\@clientName\\ renames** a property (e.g., spec name \\model\\ \u2192 C# name \\OverrideModelName\\) - **\\@encodedName\\ wire names leak** into parameter names (e.g., \\ ool_resources\\ vs \\ oolResources\\) - **PascalCase vs camelCase** differences between the convenience parameter and constructor parameter Unmatched parameters fell back to \\default\\ (null), causing \\NullReferenceException\\ during serialization when \\Optional.IsCollectionDefined(null)\\ returns \\ rue\\ for null collections. This was discovered while migrating \\Azure.AI.Agents.Persistent\\ to the new \\@azure-typespec/http-client-csharp\\ emitter \u2014 172 out of 261 tests failed with NRE in serialization. ## Fix Match spread parameters by their **wire (serialized) name** (\\WireInfo.SerializedName\\) instead of C# name. Both the convenience parameter and model constructor parameter share the same wire name since they represent the same JSON field. Uses \\TryAdd\\ to handle potential duplicate wire names gracefully. ## Validation - Generator builds with 0 errors - Regenerated \\Azure.AI.Agents.Persistent\\ \\ThreadRuns.cs\\ \u2014 all spread parameters now properly forwarded (previously 5 parameters were \\default\\, now only \\\u0007dditionalBinaryDataProperties\\ is \\default\\ which is correct) ---------", "tokens": 357} {"id": 862029, "source": "commit", "repo": "microsoft/typespec", "text": "[EngSys] Update pipelines to use ubuntu-24 and azsdk-pool (#7399)", "tokens": 27} {"id": 862129, "source": "commit", "repo": "microsoft/typespec", "text": "Migrate cadl-ranch engine and supporting package (#4127) https://github.com/microsoft/typespec/issues/4015 ---------", "tokens": 35} {"id": 862152, "source": "commit", "repo": "microsoft/typespec", "text": "[@typespec/openapi3] Add $ref to Response Object (#3894) Per the requirement in [Issue 3601](https://github.com/microsoft/typespec/issues/3601), the 'useRef' plugin must be respected and used correctly. This PR does that. **Before Changes** ![image](https://github.com/user-attachments/assets/be4bdeb3-4c1e-4f4a-a1ed-75abfee3f98c) **After Changes** ![image](https://github.com/user-attachments/assets/55978f2b-25d4-4e85-91a1-4b313ade62de) ---------", "tokens": 173} {"id": 862373, "source": "commit", "repo": "microsoft/vscode-gradle", "text": "Fix SchemaStore links to use `www.schemastore.org` (#1674)", "tokens": 21} {"id": 862391, "source": "commit", "repo": "microsoft/vscode-gradle", "text": "enhancement - Activate the extension when gradle files are in sub-folders of the workspace (#1570)", "tokens": 25} {"id": 862918, "source": "commit", "repo": "microsoftgraph/msgraph-sdk-java", "text": "- codegen-update: adds missing default constructor for method request builders", "tokens": 16} {"id": 863087, "source": "commit", "repo": "microsoftgraph/msgraph-sdk-java", "text": "Renamed String UTF-8 to JSON_ENCODING. Changed error statement in logError and client exception to contain Unsupported encoding problem:", "tokens": 26} {"id": 863135, "source": "commit", "repo": "microsoftgraph/msgraph-sdk-java", "text": "Update failing unit tests - Updated \"getItemByPath\" to \"itemByPath\" - Moved location for ManualExtensionsTests - Added the @Ignore tag to the CUstomRequestTests as it is a functional test, which should not be run automatically Fixes failing tests reported in #2", "tokens": 58} {"id": 863850, "source": "commit", "repo": "MindustryTool/MindustryToolMod", "text": "test,feat(ui): add nested tests & filter redesign Add comprehensive test coverage for nested Dynamic component lifecycles in DynamicComponentTest, including independent inner switching, cascading disposal, zombie effect suppression, re-expansion, batched signal updates, and container-wrapped nesting. Redesign and implement the BrowserFilterDialog: - Replace legacy Styles.togglet buttons with consistent WebStyles filter chip and clear button styles - Add static signal caching for tag and planet data to eliminate redundant API calls - Implement viewport-based dynamic column calculation for responsive layouts - Refactor loading/error state handling in both SchematicBrowserDialog and MapBrowserDialog Update the shared browser common specification to match the new filter dialog requirements, and remove outdated redesign proposal and task files from the openspec changes directory.", "tokens": 163} {"id": 864046, "source": "commit", "repo": "MindustryTool/MindustryToolMod", "text": "fix(autoplay): use unit acceleration for camera smoothing The camera interpolation was incorrectly using unit.speed instead of unit.accel for lerpDelta calculations, causing unnatural camera movement. Using acceleration provides smoother and more appropriate camera following behavior.", "tokens": 51} {"id": 864047, "source": "commit", "repo": "MindustryTool/MindustryToolMod", "text": "refactor: unify dialog access and fix null handling in features - Replace direct dialog.show() calls with dialog().ifPresent(Dialog::show) in MapBrowserFeature and SchematicBrowserFeature for consistent access - Add null check before accessing selectedTeam data in TeamResourceFeature to prevent potential NPE - Move selectedTeam initialization to WorldLoadEvent to ensure proper timing - Adjust crash report formatting in Main to include timestamp and improve readability", "tokens": 84} {"id": 864068, "source": "commit", "repo": "MindustryTool/MindustryToolMod", "text": "feat(chat): add customizable script editor for pretty chat transformations - Replace hardcoded transformation functions with JavaScript scripts that can be edited in-game - Add script storage and management methods in PrettyChatConfig - Implement script editor dialog with reset and save functionality - Update transformation logic to execute scripts using the mod's script engine - Add support for command prefixes (/t, /a) to preserve chat commands - Add new \"rainbow\" transformation script as an example - Update UI to indicate desktop-only functionality", "tokens": 103} {"id": 864165, "source": "commit", "repo": "MindustryTool/MindustryToolMod", "text": "chore: update version to v1.15.0 in mod.hjson", "tokens": 18} {"id": 864177, "source": "commit", "repo": "MindustryTool/MindustryToolMod", "text": "feat(player-connect): update, remove room", "tokens": 11} {"id": 864238, "source": "commit", "repo": "MindustryVN/MindustryToolMod", "text": "feat: add bridge flow rate and hud hide options Add real-time tactical flow rate and resource indicator badges to bridge conveyors, phase conveyors, duct bridges, and liquid bridges. Add options to hide the title bar and drag handle in the team resource HUD overlay, automatically expanding content and saving screen space. Update visualizer and team resource settings views with new controls. Add i18n bundle entries across all supported languages. Fix minor compile and test teardown issues in translation tests.", "tokens": 111} {"id": 864289, "source": "commit", "repo": "MindustryVN/MindustryToolMod", "text": "refactor(browser): update search header UI and add webstyles design docs Refine the BrowserSearchHeader's search bar layout: move the zoom icon inside the search card, adjust border radius from unit(5) to unit(3), add gap and padding for improved internal spacing. Add complete design specifications, task lists, proposals, and decision documents for the shadcn/ui-inspired WebStyles semantic palette and button variant overhaul.", "tokens": 93} {"id": 864359, "source": "commit", "repo": "MindustryVN/MindustryToolMod", "text": "refactor: move TapListener to services package for shared usage The TapListener class was previously located in the godmode feature package but is used by multiple features (godmode, smartdrill, smartupgrade). Moving it to a common services package improves code organization and reusability across the codebase.", "tokens": 66} {"id": 864725, "source": "commit", "repo": "Minecraft-Transit-Railway/Minecraft-Transit-Railway", "text": "Seat entity no longer moves with player when riding", "tokens": 11} {"id": 864929, "source": "commit", "repo": "MinecraftFreecam/Freecam", "text": "build(forge,neoforge): reset 'bundled' src dirs Avoid Gradle & the IDE from looking for `src/bundled/java` (etc).", "tokens": 34} {"id": 865064, "source": "commit", "repo": "MinecraftFreecam/Freecam", "text": "fix(fabric): use correct fabric-api modid In 1.19.2, Fabric API switched to modid `fabric-api`. In 26.1, the `fabric` alias will be dropped.", "tokens": 49} {"id": 865140, "source": "commit", "repo": "MinecraftFreecam/Freecam", "text": "Initial multiversion + drop architectury + switch to Kotlin DSL", "tokens": 17} {"id": 865257, "source": "commit", "repo": "MinecraftFreecam/Freecam", "text": "Move notifications into transition sub-category They seem transition-related?", "tokens": 14} {"id": 865330, "source": "commit", "repo": "minelittlepony/minelittlepony", "text": "Fix ponies having the wrong position when riding. Fixes #331", "tokens": 17} {"id": 865442, "source": "commit", "repo": "minelittlepony/minelittlepony", "text": "Mson loads models from a different directory now", "tokens": 10} {"id": 865670, "source": "commit", "repo": "minelittlepony/minelittlepony", "text": "Update ru_ru.lang (#89) Inaccuracies. :)", "tokens": 19} {"id": 865703, "source": "commit", "repo": "minelittlepony/minelittlepony", "text": "Fixed UI thread not being updated with new file drops", "tokens": 11} {"id": 865716, "source": "commit", "repo": "minelittlepony/minelittlepony", "text": "Moved it up one more. That looks better.", "tokens": 11} {"id": 865927, "source": "commit", "repo": "minimallycorrect/tickthreading", "text": "Don't crash if scheduleLeakCheck fails for #597", "tokens": 15} {"id": 866106, "source": "commit", "repo": "minimallycorrect/tickthreading", "text": "Only maintain a single TickNextTick list", "tokens": 10} {"id": 866200, "source": "commit", "repo": "minimallycorrect/tickthreading", "text": "Log issues captured by TT via TT logger - don't want Forge blamed for TT issues.", "tokens": 24} {"id": 866295, "source": "commit", "repo": "mioclient/oyvey-ported", "text": "chore(gradle-upload): change upload name to 'oyvey'", "tokens": 16} {"id": 866380, "source": "commit", "repo": "mioclient/oyvey-ported", "text": "fix: fabric.mod.json repo url", "tokens": 10} {"id": 866419, "source": "commit", "repo": "misterpemodder/shulkerboxtooltip", "text": "Release 5.4.1+26.2", "tokens": 13} {"id": 866504, "source": "commit", "repo": "misterpemodder/shulkerboxtooltip", "text": "Initial port to Minecraft 1.21.4", "tokens": 12} {"id": 866553, "source": "commit", "repo": "misterpemodder/shulkerboxtooltip", "text": "Release 4.1.0-alpha.1+1.20.6", "tokens": 19} {"id": 866573, "source": "commit", "repo": "misterpemodder/shulkerboxtooltip", "text": "Update mod icon (cherry picked from commit f2420be82f724b430cc2db81c808841a06fa178c)", "tokens": 46} {"id": 866901, "source": "commit", "repo": "mizosoft/methanol", "text": "Dependency Updates (#130) * Dependency Updates * Run Gradle & tests on potentially different JDKs * Add localhost as a subject name * Make sure compilation/test/related tasks are run on Java 17+ for spring-boot-test * StorageExtension touch-ups * Remove temp-added @RepeatArguments * Workflow refactorings - Remove coveralls for now - Add Dependency Submission action - Workflow touch-ups", "tokens": 89} {"id": 867093, "source": "commit", "repo": "mizosoft/methanol", "text": "Use cached thread pools in store tests to avoid starvation", "tokens": 14} {"id": 867174, "source": "commit", "repo": "mizosoft/methanol", "text": "Refactor tests - Use DiskStore in TCK tests. - Put StoreContext & ResolvedStoreConfig in their own files. - Share some stuff between JUnit 5 tests & the TCK. - Some other pedantic refactorings.", "tokens": 49} {"id": 867361, "source": "commit", "repo": "mjedynak/builder-generator-idea-plugin", "text": "cell renderer lazy init (issue #12)", "tokens": 11} {"id": 867549, "source": "commit", "repo": "mkirsche/jasmine", "text": "Fixed bug with rounding negative SV lengths", "tokens": 10} {"id": 867635, "source": "commit", "repo": "mkotsur/restito", "text": "Version 1.1.2-SNAPSHOT", "tokens": 10} {"id": 867959, "source": "commit", "repo": "mkpaz/atlantafx", "text": "Remove top padding from Checkbox and Radio labels (#115) Replaces the artificial top padding on Checkbox and Radio controls that was used to center label text with the TOP-LEFT alignment property, which hopefully has the same effect.", "tokens": 56} {"id": 868237, "source": "commit", "repo": "mkpaz/atlantafx", "text": "Replace maven-frontend-plugin with sass-cli-maven-plugin Use Maven wrapper around Dart SASS binary instead of downloading and installing NodeJS / NPM locally. This also eliminates dependency from Grunt and its modules.", "tokens": 51} {"id": 868250, "source": "commit", "repo": "mobclub/sharesdk-for-android", "text": "Update Sharesdk Update Sharesdk For Android To 2.8.1", "tokens": 17} {"id": 868338, "source": "commit", "repo": "mobends/mobends", "text": "The second skin layer is now scaled and positioned more correctly.", "tokens": 14} {"id": 868523, "source": "commit", "repo": "mobends/mobends", "text": "Gained access to the layer renderers using reflection.", "tokens": 13} {"id": 868541, "source": "commit", "repo": "mockbukkit/mockbukkit", "text": "BlockData and BlockState for CreakingHeart and ChiseledBookshelf (#1471) * Add support for ChiseledBookshelf * Add support for CreakingHeart * fixup! Add support for ChiseledBookshelf * Add support for CreakingHeart", "tokens": 59} {"id": 868727, "source": "commit", "repo": "mockbukkit/mockbukkit", "text": "Return CreatureSpawnerMock from BlockStateMock#mockState", "tokens": 12} {"id": 868948, "source": "commit", "repo": "mockbukkit/mockbukkit", "text": "Add method to add mock players to server.", "tokens": 10} {"id": 868983, "source": "commit", "repo": "mockito/mockito", "text": "Revert to use Java version 15 on CI", "tokens": 11} {"id": 869299, "source": "commit", "repo": "mockito/mockito", "text": "Fixed issue 252. Made the exception & javadocs clearer.", "tokens": 15} {"id": 869323, "source": "commit", "repo": "mockito/mockito", "text": "Fixed issue 149 Added new feature: 'deep stubbing' that can be useful for more complex stubbing (mostly in the ase of legacy code) --HG-- extra : convert_revision : svn%3Aaa2aecf3-ea3e-0410-9d70-716747e7c967/trunk%401816", "tokens": 92} {"id": 869592, "source": "commit", "repo": "modelcontextprotocol/java-sdk", "text": "fix: typo MCP_SESSION_ID, keep consistent style with other identifiers (#564)", "tokens": 21} {"id": 869909, "source": "commit", "repo": "ModelEngine-Group/app-platform", "text": "[frontend] solve the problem of abnormal display when clicking to stop the conversation. (#497)", "tokens": 24} {"id": 870679, "source": "commit", "repo": "mohamed-taman/springy-store-microservices", "text": "edit code snippets to support for ./mvnw", "tokens": 11} {"id": 871539, "source": "commit", "repo": "mojohaus/build-helper-maven-plugin", "text": "Bump file-management from 3.0.0 to 3.1.0", "tokens": 19} {"id": 871613, "source": "commit", "repo": "mojohaus/build-helper-maven-plugin", "text": "Reformatted source to fix checkstyle reported errors.", "tokens": 10} {"id": 871626, "source": "commit", "repo": "mojohaus/build-helper-maven-plugin", "text": "Added Shield for License and Maven Central.", "tokens": 10} {"id": 871747, "source": "commit", "repo": "mojohaus/build-helper-maven-plugin", "text": "[MBUILDHELPER-12] Allow parsing of OSGI compatible version strings. git-svn-id: file:///home/tiste/MOJOHAUS-TO-GIT/SVN-MOJO-WIP/trunk/mojo/build-helper-maven-plugin@10036 52ab4f32-60fc-0310-b215-8acea882cd1b", "tokens": 92} {"id": 871823, "source": "commit", "repo": "monkeywie/proxyee", "text": "fix: request msg leak (#242)", "tokens": 11} {"id": 871931, "source": "commit", "repo": "morenoh149/react-native-contacts", "text": "fix: TurboModule parser doesn't accept any ts utility", "tokens": 15} {"id": 871957, "source": "commit", "repo": "morenoh149/react-native-contacts", "text": "fix: ios id", "tokens": 11} {"id": 872783, "source": "commit", "repo": "mortuusars/Exposure", "text": "Viewfinder seems to be where it should.", "tokens": 10} {"id": 873246, "source": "commit", "repo": "moyangzhan/langchain4j-aideepin", "text": "fix: i18n review round 2 \u2014 hardcoded Chinese in controllers, Bean Validation, OSS config - Replace hardcoded Chinese in AuthController (register/active/reset responses) - Replace Chinese in UserController modifyPassword response - Replace Chinese BaseException infoValues in AliyunOssFileHelper and McpController - Replace Chinese in MailSendNode output - Convert Bean Validation messages to English (LoginReq, WfComponentReq, ConversationController) - Convert UserService IllegalStateException messages to English", "tokens": 102} {"id": 873340, "source": "commit", "repo": "mp911de/logstash-gelf", "text": "Polishing #254 Reformat code. Add author tag.", "tokens": 13} {"id": 873460, "source": "commit", "repo": "mp911de/logstash-gelf", "text": "Guard GelfTCPSSLSender.closeSocketChannel against uninitialized SSLEngine #111 Do not interact with SSLEngine if SSLEngine is not available. This can happen if the sender is closed without establishing a connection prior closing. Original pull request: #112.", "tokens": 58} {"id": 873627, "source": "commit", "repo": "mp911de/logstash-gelf", "text": "Logback appender should use formatted message Logback appender should use the formatted message instead of the plain one.", "tokens": 22} {"id": 873640, "source": "commit", "repo": "mp911de/logstash-gelf", "text": "JUL log messages with a resource bundle are now parsed correctly", "tokens": 13} {"id": 873649, "source": "commit", "repo": "mp911de/logstash-gelf", "text": "Increased log4j2 version to 2.0-rc1", "tokens": 16} {"id": 874872, "source": "commit", "repo": "mrtjp/projectred", "text": "Switched to actual nei sources. - Buildfile done, execute initialsetup for dev env, and quickbuild to use dev env for quick release jar.", "tokens": 33} {"id": 875050, "source": "commit", "repo": "msemys/esjc", "text": "maintenance: use 'is' matcher for event ids comparison", "tokens": 12} {"id": 875197, "source": "commit", "repo": "msemys/esjc", "text": "maintenance: disabled all groups of checks (javadoc)", "tokens": 11} {"id": 875348, "source": "commit", "repo": "MSPaintIDE/MSPaintIDE", "text": "Added Discord RPC support, including displaying project, language, and the most recent edited or opened file, as well as duration opened", "tokens": 27} {"id": 875845, "source": "commit", "repo": "mtedone/podam", "text": "Fill also read-only non-primitive fields", "tokens": 10} {"id": 876021, "source": "commit", "repo": "mthmulders/mcs", "text": "chore(build): Use Maven Wrapper on GitHub Actions (#746)", "tokens": 17} {"id": 876258, "source": "commit", "repo": "mthmulders/mcs", "text": "build: Don't need a Chocolatey API key here", "tokens": 15} {"id": 876400, "source": "commit", "repo": "MTVehicles/MinetopiaVehicles", "text": "feat: add vehicle edit subcommand part 2 -added autocompletion -added boolean command such as glowing, fuelenabled and trunkenabled -refactoring", "tokens": 32} {"id": 876409, "source": "commit", "repo": "MTVehicles/MinetopiaVehicles", "text": "Skript updates Fix existing effects/expressions, add conditions", "tokens": 14} {"id": 876897, "source": "commit", "repo": "multilang-depends/depends", "text": "cache expressions to file, complelely", "tokens": 10} {"id": 877084, "source": "commit", "repo": "multilang-depends/depends", "text": "could hanlde candidate type in entity inferer", "tokens": 12} {"id": 877392, "source": "commit", "repo": "mwanji/toml4j", "text": "Limited the range of characters bare keys can accept", "tokens": 11} {"id": 877473, "source": "commit", "repo": "mwanji/toml4j", "text": "Added javadoc. Better null-handling and return empty containers instead of null.", "tokens": 16} {"id": 877799, "source": "commit", "repo": "mzmine/mzmine", "text": "Add parameters to select whether MSP file(s) should contain retention times and ANOVA p-values", "tokens": 24} {"id": 878786, "source": "commit", "repo": "nagyesta/lowkey-vault", "text": "chore: Final maintenance before JDK upgrade (#1601) - Validate Gradle wrapper in new workflow - Simplify .github exclusion patterns in workflows - Add .pom files to trusted artifacts in Gradle verification metadata - Upgrade Abort-Mission dependencies to 6.0.94 - Introduce release notes template {patch}", "tokens": 67} {"id": 878916, "source": "commit", "repo": "nagyesta/lowkey-vault", "text": "Triggering a release {patch} (#221)", "tokens": 13} {"id": 879393, "source": "commit", "repo": "nasa-ammos/aerie", "text": "MPSSEQ-1045-editAddActivityInCSV", "tokens": 15} {"id": 879640, "source": "commit", "repo": "NASA-AMMOS/plandev", "text": "Update the test to remove the deprecated methods. [AERIE-2021]", "tokens": 20} {"id": 879798, "source": "commit", "repo": "NASA-AMMOS/plandev", "text": "Remove extra junit-jupiter-api JAR The presence of two versions of junit-jupiter-api was causing problems with Java 9 module-based build products, which got upset at seeing two different providers for the same module.", "tokens": 47} {"id": 879887, "source": "commit", "repo": "NASA-AMMOS/plandev", "text": "save and delete state files to source explorer", "tokens": 10} {"id": 880587, "source": "commit", "repo": "nemproject/nem", "text": "bump version to 0.6.76", "tokens": 11} {"id": 881015, "source": "commit", "repo": "netease-kit/nim-uikit-android", "text": "android uikit 4.6.0", "tokens": 10} {"id": 881159, "source": "commit", "repo": "nette-intellij/intellij-latte", "text": "Latte block formatting: fix multiline macro formatting", "tokens": 10} {"id": 881167, "source": "commit", "repo": "nette-intellij/intellij-latte", "text": "LatteFileViewProvider: TemplateDataElement is static [maybe fixes #27]", "tokens": 18} {"id": 881620, "source": "commit", "repo": "ngageoint/geopackage-android", "text": "Database types and values, create custom feature tables, column max support, column type improvements", "tokens": 18} {"id": 882186, "source": "commit", "repo": "nikitacartes/easyauth", "text": "Add publish to Modrinth and Curseforge", "tokens": 10} {"id": 882218, "source": "commit", "repo": "nikitacartes/easyauth", "text": "Fixed fetching a knowingly invalid MySQL database column", "tokens": 11} {"id": 882452, "source": "commit", "repo": "nulab/zxcvbn4j", "text": "refactor: define reused values as constants, streamline displayTime conditions, and simplify format method in TimeEstimates", "tokens": 22} {"id": 882918, "source": "commit", "repo": "nurtak/objectgraphvisualization", "text": "type > endpointType, EA project file", "tokens": 10} {"id": 883265, "source": "commit", "repo": "nyaacat/rpgitems-reloaded", "text": "Fix debug command throwing error when there's no item in hand Fix enchantment command can't add enchantment when item has no enchantment", "tokens": 27} {"id": 883396, "source": "commit", "repo": "nyaacat/rpgitems-reloaded", "text": "Add requireHurtByEntity parameter to power beam", "tokens": 11} {"id": 883543, "source": "commit", "repo": "nyaacat/rpgitems-reloaded", "text": "add minium and maxium range for ranged power", "tokens": 12} {"id": 883590, "source": "commit", "repo": "nyaacat/rpgitems-reloaded", "text": "Add switch to hide default power descriptions. /rpgitem {itemName} switchpowertext true/false /rpgitem {itemName} lore/description will still be shown This can be used to fully customize item description Address #62 #91 #72", "tokens": 57} {"id": 883660, "source": "commit", "repo": "objectify/objectify", "text": "Bump the joda time version to 2.10.13 Closes out issue #386", "tokens": 23} {"id": 883903, "source": "commit", "repo": "objectify/objectify", "text": "Fixed a problem translating primitive numbers git-svn-id: https://objectify-appengine.googlecode.com/svn/branches/fluent@919 79e2b5ea-dad9-11de-b64b-7d26b27941e2", "tokens": 67} {"id": 883919, "source": "commit", "repo": "objectify/objectify", "text": "Test change: You are allowed to register conflicting fields, they work now. git-svn-id: https://objectify-appengine.googlecode.com/svn/branches/fluent@882 79e2b5ea-dad9-11de-b64b-7d26b27941e2", "tokens": 74} {"id": 884660, "source": "commit", "repo": "ochotonida/artifacts", "text": "Added helium flamingo overlay offset config option", "tokens": 12} {"id": 884849, "source": "commit", "repo": "ochotonida/artifacts", "text": "Update 1.18.1-4.0.0", "tokens": 15} {"id": 885220, "source": "commit", "repo": "ocr4all/larex", "text": "TextViewer: keep line selected after reselecting it", "tokens": 12} {"id": 885672, "source": "commit", "repo": "ocr4all/ocr4all", "text": "Removed functionality that created a backup file when renaming files", "tokens": 11} {"id": 885981, "source": "commit", "repo": "oculix-org/Oculix", "text": "API Sikulix finally removed (refactor of classes that used Sikulix methods) - the pop... features are in SX now (popAt() added) did some smoke tests: no errors.", "tokens": 44} {"id": 886193, "source": "commit", "repo": "oculix-org/Oculix", "text": "fixed: issue #271: Windows: App.Open() did not work, if .exe given as parameter from commandline", "tokens": 29} {"id": 886299, "source": "commit", "repo": "oculix-org/Oculix", "text": "revised: IDE: handle plain Python files including images , testing on Windows [ci skip]", "tokens": 20} {"id": 886423, "source": "commit", "repo": "oculix-org/SikuliX1", "text": "ongoing: cosmetics [ci skip]", "tokens": 10} {"id": 886513, "source": "commit", "repo": "oculix-org/SikuliX1", "text": "revised: canHandleFileEnding: back to original implementation", "tokens": 12} {"id": 886599, "source": "commit", "repo": "oculix-org/SikuliX1", "text": "added: android: IDE Test: can produce a complete device dump for debugging.", "tokens": 17} {"id": 886613, "source": "commit", "repo": "oculix-org/SikuliX1", "text": "fixed: download page: show build stamp and travis build number", "tokens": 13} {"id": 886720, "source": "commit", "repo": "oddlama/vane", "text": "fix(trifles): Don't place backpacks or shulkerboxes with the trowel", "tokens": 24} {"id": 886779, "source": "commit", "repo": "oddlama/vane", "text": "feat(docs-generator): improve prose text layouting", "tokens": 12} {"id": 887112, "source": "commit", "repo": "odota/parser", "text": "build: depend on released clarity 5.0.0 Claude-Session: https://claude.ai/code/session_019JQCZmYJ8a9FaPkZG81rLe", "tokens": 49} {"id": 887113, "source": "commit", "repo": "odota/parser", "text": "perf: entity filter on by default, cached lookups, tracked singletons - Entity filter is on by default (-Dopendota.entityFilter=false disables it). Adds the bare CDOTA_Item class, which pre-2026 replays use for many items; without it starting items and purchases went missing. Drops the Source 1 DT_* names. - The four singleton entities are tracked via @OnEntityCreated / @OnEntityDeleted instead of scanning all entities every tick. - Field path cache per class id with precomputed indexed names. Misses are cached only when the name does not run through a polymorphic pointer, the only place where S2 resolution depends on entity state. - Ability and item lookups go through the cache; hero combat log names are computed once per hero class; ability tracking uses a nested map. - Ward handlers are restricted to ward classes. - CreateParsedDataBlob skips entry types the teamfight pass ignores. Output is byte-identical to current master (clarity 4.0.1) on 11 Dota 2 replays (2016-2026), line and blob mode. Blob mode on a 187 MB replay vs. master: 3.14 s -> 1.68 s, allocation 13.1 GB -> 4.48 GB per parse. Claude-Session: https://claude.ai/code/session_019JQCZmYJ8a9FaPkZG81rLe", "tokens": 336} {"id": 887774, "source": "commit", "repo": "omnilaboratory/obandroid", "text": "change start node model to neutrino", "tokens": 10} {"id": 887980, "source": "commit", "repo": "oneuiproject/oneui-core", "text": "lib: preference: res: merge sesl attrs values", "tokens": 11} {"id": 888096, "source": "commit", "repo": "oneuiproject/oneui-core", "text": "lib: core: ResourcesCompat: minor adjustments", "tokens": 10} {"id": 888138, "source": "commit", "repo": "oneuiproject/oneui-core", "text": "lib: appcompat: DialogTitle: merge sesl", "tokens": 10} {"id": 888776, "source": "commit", "repo": "opacapp/opacclient", "text": "MeaningDetector class to detect the meanings of search fields from their titles based on lists in JSON files", "tokens": 24} {"id": 888884, "source": "commit", "repo": "opacapp/opacclient", "text": "Load meta data earlier (#86) [needs testing]", "tokens": 13} {"id": 888927, "source": "commit", "repo": "opacapp/opacclient", "text": "OCLC2011: Search-Request", "tokens": 12} {"id": 889156, "source": "commit", "repo": "opencollab-incubator/Boar", "text": "Let the player decide their velocity in this case.", "tokens": 11} {"id": 889259, "source": "commit", "repo": "opencollab-incubator/Boar", "text": "Oopsie, fixed player eye height.", "tokens": 10} {"id": 889352, "source": "commit", "repo": "opencollab-incubator/Boar", "text": "Fixed weird issue with rewind, actually validate swimming status.", "tokens": 14} {"id": 889458, "source": "commit", "repo": "opencollab-incubator/Boar", "text": "\"Fixed\" (work-around) for sprinting de-sync.", "tokens": 18} {"id": 889495, "source": "commit", "repo": "opencollab-incubator/Boar", "text": "bruteforce jumping, don't force it on player.", "tokens": 15} {"id": 889650, "source": "commit", "repo": "opencryptoproject/jcmathlib", "text": "feat: add deferred initialization to UT applet", "tokens": 10} {"id": 889834, "source": "commit", "repo": "opencubicchunks/cubicchunks", "text": "Populator event in vanilla compatibility generator (#432) * Custom vanilla compatability generators * Moving 'registerForCompatibilityGenerator' to API * public->private for 'customPopulatorsForFlatCubicGenerator' * Cube specific random * What should stay now stays", "tokens": 53} {"id": 889924, "source": "commit", "repo": "opencubicchunks/cubicchunks", "text": "Add all missing block replacers (#213) * Add swamplands replacer * Add taiga and mutated savanna replacers * Clean up creating BlockReplacer providers", "tokens": 40} {"id": 890026, "source": "commit", "repo": "opencubicchunks/cubicchunks", "text": "Add missing Nullable annotations to GeneratorPipeline.", "tokens": 10} {"id": 890154, "source": "commit", "repo": "opencubicchunks/cubicchunks", "text": "I think I fixed a bug related to the yet-to-be-merged populators, but I can't be sure. =(", "tokens": 31} {"id": 890600, "source": "commit", "repo": "opennative/open-native", "text": "set allowSyntheticDefaultImports to allow React default import", "tokens": 11} {"id": 891922, "source": "commit", "repo": "oshi/oshi", "text": "Site work (#2848) * [pom] Drop content from scm publish as that is the default * [GHA] Modernize the site page action * Ignore the ddl files * Fix invalid javadocs * Bump fluido to 2.1.0", "tokens": 56} {"id": 892881, "source": "commit", "repo": "ozlerhakan/poiji", "text": "bumped up version v5.1.0", "tokens": 10} {"id": 893071, "source": "commit", "repo": "ozlerhakan/poiji", "text": "update readme for new version 2.6.0", "tokens": 12} {"id": 893669, "source": "commit", "repo": "palatable/lambda", "text": "Update README.md Removed travis build badge from README", "tokens": 11} {"id": 894539, "source": "commit", "repo": "paranoiduser/codewars-handbook", "text": "feat(6-kyu): https://www.codewars.com/kata/finding-arrows-in-a-string Closes #173", "tokens": 33} {"id": 894545, "source": "commit", "repo": "paranoiduser/codewars-handbook", "text": "build(deps): bump actions/checkout from 3.0.2 to 3.1.0 Bumps [actions/checkout](https://github.com/actions/checkout) from 3.0.2 to 3.1.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/2541b1294d2704b0964813337f33b291d3f8596b...93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ...", "tokens": 219} {"id": 894615, "source": "commit", "repo": "paranoiduser/codewars-handbook", "text": "feat(6-kyu): https://www.codewars.com/kata/sieve-of-eratosthenes", "tokens": 27} {"id": 894729, "source": "commit", "repo": "paranoiduser/codewars-handbook", "text": "https://www.codewars.com/kata/wasd-movement", "tokens": 15} {"id": 894762, "source": "commit", "repo": "paranoiduser/codewars-handbook", "text": "https://www.codewars.com/kata/sum-of-odd-numbers", "tokens": 18} {"id": 894978, "source": "commit", "repo": "parawanderer/OpenTagViewer", "text": "Pin the merged FindMy.py, and use the key index it now hands back The BLE work needs RollingKeyPairSource.current_mac_addresses(), contributed by Ulrich Barrot (@ubrt) and merged as parawanderer/FindMy.py#1. This moves all four pin sites off the personal fork and onto 254a7624, which carries it. The same bump also brings the keychain-export work that landed on that branch meanwhile - including the fix for #140, where a recovered peer was addressed by its escrow label instead of the bottle's id and every share came back unreadable. Two things the app was getting wrong against that API: A bare current_mac_addresses() searches with no margin, so an accessory whose true index has drifted below where alignment believes it is is simply absent from its own candidate set - no error, no match, \"not found nearby\" for a tag sitting on the desk. FindMy.py's own is_from takes 12 hours; so does this now. And the call discarded the indices the map exists to provide. A sighting is an observation of the same kind as a decrypted report, so it now feeds back through update_alignment and is persisted the same way, which collapses the next scan from a 12-hour range to three keys.", "tokens": 296} {"id": 894982, "source": "commit", "repo": "parawanderer/OpenTagViewer", "text": "Compare the switch against the navigation bar in one coordinate system The geometric assertion measured the switch with getLocationOnScreen and the navigation bar with decor.getHeight() - a screen position against a height. Those coincide only when the decor view starts at y=0, which it does on the Pixel 9 and does not on the managed aosp-atd device, so CI reported a 54px overlap on a device whose inset is zero and which therefore has no navigation bar to overlap with. Also written down: on aosp-atd the systemBars bottom inset is 0, so both assertions in this test are vacuously true on the emulator CI runs. It earns its keep on a device that has a navigation bar. A green CI run is not evidence this screen is fine, and the comment now says so. Checked on both: green on aosp-atd, green on a Pixel 9, and still red on the Pixel 9 with the fix reverted - \"reserves 0px, needs 63px\".", "tokens": 228} {"id": 895172, "source": "commit", "repo": "parawanderer/OpenTagViewer", "text": "Rule out the derived key, and report the record's key as unsourced \u00a75's master EC key derives to 50545af9, not the 20fb99a6 a record names, and that key is in neither the zone's two keys nor the 133 keychain keys. So every source the document describes has been read and none holds it.", "tokens": 87} {"id": 895372, "source": "commit", "repo": "patka/cassandra-migration", "text": "Add ability to choose execution profile (by configuration parameter) \u2026 (#52) * Add ability to choose execution profile (by configuration parameter) used for schema migration statements. Profiles concept is described here https://docs.datastax.com/en/developer/java-driver/4.0/manual/core/configuration/.", "tokens": 71} {"id": 895715, "source": "commit", "repo": "peergos/nabu", "text": "In the case when no peers are provided, make bitswap try connected peers before resorting to DHT findProviders", "tokens": 27} {"id": 895841, "source": "commit", "repo": "peergos/nabu", "text": "Expand bloom filter test to demonstrate false positive rate increase", "tokens": 12} {"id": 896017, "source": "commit", "repo": "perplexhub/rsql-jpa-specification", "text": "Update Snapshot Repository URL (#189)", "tokens": 11} {"id": 896032, "source": "commit", "repo": "perplexhub/rsql-jpa-specification", "text": "Support for fuction call (#137)", "tokens": 12} {"id": 896206, "source": "commit", "repo": "petitparser/java-petitparser", "text": "Implement type casting, permutation, choice widening, and strongly-typed grammar productions (Tasks 3.5 to 3.8)", "tokens": 32} {"id": 896635, "source": "commit", "repo": "phoenix616/inventorygui", "text": "Add ability to get an element by its character", "tokens": 10} {"id": 897290, "source": "commit", "repo": "pholser/junit-quickcheck", "text": "removing unnecessary type args on an Arrays.asList() call", "tokens": 12} {"id": 897292, "source": "commit", "repo": "pholser/junit-quickcheck", "text": "tests to demonstrated rejection of types with type variables.", "tokens": 12} {"id": 897951, "source": "commit", "repo": "pikamug/quests", "text": "Restore multiple mob-spawn per action, fixes #1632", "tokens": 15} {"id": 897967, "source": "commit", "repo": "pikamug/quests", "text": "Prevent duplication of Brew Item objective in memory, fixes #1582", "tokens": 17} {"id": 898368, "source": "commit", "repo": "plaid/plaid-java", "text": "add missing phone numbers to identity (#74)", "tokens": 11} {"id": 898626, "source": "commit", "repo": "playtikaoss/testcontainers-spring-boot", "text": "chore(deps): update quay.io/keycloak/keycloak docker tag to v22.0.4 (#1549) | datasource | package | from | to | | ---------- | ------------------------- | ------ | ------ | | docker | quay.io/keycloak/keycloak | 22.0.3 | 22.0.4 |", "tokens": 79} {"id": 898628, "source": "commit", "repo": "playtikaoss/testcontainers-spring-boot", "text": "chore(deps): update victoriametrics/victoria-metrics docker tag to v1.94.0 (#1552) | datasource | package | from | to | | ---------- | -------------------------------- | ------- | ------- | | docker | victoriametrics/victoria-metrics | v1.93.5 | v1.94.0 |", "tokens": 76} {"id": 898645, "source": "commit", "repo": "playtikaoss/testcontainers-spring-boot", "text": "chore(deps): update mongo docker tag to v7.0.1 (#1478)", "tokens": 22} {"id": 898763, "source": "commit", "repo": "playtikaoss/testcontainers-spring-boot", "text": "Upgrade to Keycloak 12.0.4 (#628) The following things have been done: - updated to Keycloak 12.0.4 - removed fixed version from test realm file - introduced property to configure authBasePath - cleaned up default value handling a bit - default container command now binds to all interfaces - changed the wait strategy to listen for port Also the multiplier of the startup time has been removed as its intended purpose is not clear and is totally non transparent to the end user. It initially looked like a bug that the configured startup timeout did not match before noticing it was actually doubled all the time.", "tokens": 131} {"id": 898855, "source": "commit", "repo": "poetix/protonpack", "text": "Added `Indexed.mapping` and `Indexed.map` It would be more idiomatic to map in a stream a indexed value this way. Closes #47", "tokens": 35} {"id": 899432, "source": "commit", "repo": "potoyang/spring-in-action-v5-translate", "text": "16.2.2 polished", "tokens": 10} {"id": 899476, "source": "commit", "repo": "potoyang/spring-in-action-v5-translate", "text": "Update 13.2.1-pei-zhi-eureka.md", "tokens": 21} {"id": 899612, "source": "commit", "repo": "PragmaTech-GmbH/spring-test-profiler", "text": "feat(report): include outsourced JS to report", "tokens": 12} {"id": 900172, "source": "commit", "repo": "projectdiscovery/nuclei-burp-plugin", "text": "documentation: Add Tab support for the template generator window #2 * updated the productivity (mouse/keyboard) shortcuts", "tokens": 25} {"id": 900521, "source": "commit", "repo": "psambit9791/jdsp", "text": "Implemented and tested Trianglar, Tukey, Bartlett and Bartlett-Hann windows", "tokens": 26} {"id": 900757, "source": "commit", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "Fix #232 - Symfony Service Validator scan all file types on Mars", "tokens": 20} {"id": 900897, "source": "commit", "repo": "pulse00/symfony-2-eclipse-plugin", "text": "added apache commons compress library * This will be used to uncompress symfony library * We used this instead of default java.util.zip package to have a way to retrieve file permissions stored in the archive", "tokens": 43} {"id": 901355, "source": "commit", "repo": "pulse00/twig-eclipse-plugin", "text": "added (p)html file extensions made file extension check less strict", "tokens": 14} {"id": 901461, "source": "commit", "repo": "pulse00/twig-eclipse-plugin", "text": "fixed comment region bug, synced updatesite to 1.0.69", "tokens": 17} {"id": 901535, "source": "commit", "repo": "pulse00/twig-eclipse-plugin", "text": "added feature to auto-close twig tags", "tokens": 10} {"id": 901559, "source": "commit", "repo": "purpurmc/purpur", "text": "Updated Upstream (Paper) Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@042abf65 [ci/skip] Add missing period to README.md (#14068) PaperMC/Paper@53cd8f0d [ci/skip] Test client-id in one of the app-token actions PaperMC/Paper@7e6f626d [ci/skip] Make pr-review-status run through signal action PaperMC/Paper@dff5410a [ci/skip] Update update-projects-action actions PaperMC/Paper@21053009 [ci/skip] Only run review status checks on our org PaperMC/Paper@1569b8dc Remove unnecessary extra copy of item stack template result PaperMC/Paper@75c0b485 Skip entity data fixer schema validation during startup", "tokens": 194} {"id": 902045, "source": "commit", "repo": "pxlsspace/pxls", "text": "Add .DS_Store and *.swp to .gitignore", "tokens": 16} {"id": 902051, "source": "commit", "repo": "pxlsspace/pxls", "text": "Add icy donator gradient chat color (#622) * add the color * fix checking for wrong permission", "tokens": 24} {"id": 902085, "source": "commit", "repo": "pxlsspace/pxls", "text": "Fix panels in fullscreen mode having a minimum width (#570) Since they cover the whole screen, they may as well shrink down, even if the screen is unreasonably small.", "tokens": 39} {"id": 902125, "source": "commit", "repo": "pxlsspace/pxls", "text": "Add configurable custom emoji (#452) * Add configurable custom emoji. * Add customEmoji to the reference.conf. * Make changes suggested by netux. * Add note about where emoji must be stored in reference.conf. * Fix bug with capitalized emojis appearing in typeahead twice, and add seperate customEmoji css to deal with non square images. * Fix bug where having no emoji in emoji picker still shows custom category and add css to handle non-square emoji in the emoji picker.", "tokens": 104} {"id": 902161, "source": "commit", "repo": "pxlsspace/pxls", "text": "Improve Typeahead and update emojis to support Unicode 13.0 (#372) * Fix Typeahead JSDocs to use \"{type} argname\" format * Update emoji-button and emojiDB to their latest version. * Fix the emoji picker having an incorrect z-index, among other small fixes. * emoji-button.min.js is now using my fork of emoji-button https://github.com/netux/emoji-button/tree/pxls * bumped Twemoji to 13.0.0 * use Twemoji style for the emoji picker * fixed some style issues * Render emoji along with its name on typeahead This changes a bit the way Typeahead works to retrieve both the key (emoji name) and value (emoji code), as well as adding callback functions for custom rendering of typeahead entries on the list and custom insertion of data on the text box. * Allow for scrolling on the typeahead * Pass emojis on faction tags through twemoji * Fix error when selecting an entry, running the typeahead again, and stepping the next entry * Make selected entry on Typeahead scroll into view * Fix emoji picker emojis overflowing to the preview section below * Remove unnecessary .entry-container from Typeahead", "tokens": 271} {"id": 902249, "source": "commit", "repo": "pxlsspace/pxls", "text": "Add a chat option to disable the rotating banner", "tokens": 10} {"id": 903167, "source": "commit", "repo": "qiniu/java-sdk", "text": "add comment for ResourcesCensor to use resourceCensor [ci skip]", "tokens": 16} {"id": 903367, "source": "commit", "repo": "QmDeve/QmBlurView", "text": "build: pin ndkVersion 27.3.13750724 for core native build", "tokens": 26} {"id": 903473, "source": "commit", "repo": "QmDeve/QmBlurView", "text": "Rename IMG_20251023_184722.jpg to progressiveBlurView.jpg", "tokens": 29} {"id": 903509, "source": "commit", "repo": "qmetry/qaf", "text": "Code enhancements Support to have customization (by overriding methods) for RuntimeScenario generator.", "tokens": 17} {"id": 903564, "source": "commit", "repo": "qmetry/qaf", "text": "continue on exception during meta-data filter processing", "tokens": 10} {"id": 903666, "source": "commit", "repo": "qmetry/qaf", "text": "support to trigger element listener on find element command", "tokens": 10} {"id": 903669, "source": "commit", "repo": "qmetry/qaf", "text": "Closed #276 Support to locate element using extJs Provided additional locator strategies * extDom : to locate element by [ExtJS dom query](https://docs.sencha.com/extjs/6.2.0/classic/Ext.dom.Query.html) * extComp : to locate element by [ExtJS component query](https://docs.sencha.com/extjs/6.2.0/classic/Ext.ComponentQuery.html)", "tokens": 104} {"id": 903986, "source": "commit", "repo": "qos-ch/slf4j", "text": "[license] Update copyright year to 2017", "tokens": 13} {"id": 904118, "source": "commit", "repo": "qos-ch/slf4j", "text": "- added a section on \"logging consolidation via SLF4J\" As Thorbj\u00f8rn pointed out in revision 1319 as, the section on \"gradual migration to JCL\" stuck out like a sore thumb. - Reverted 1320 because the reference to \"isDebugEnabled\" method in log4j is redundant. The FAQ entry on \"logging performance\" contains the same information.", "tokens": 87} {"id": 904164, "source": "commit", "repo": "qos-ch/slf4j", "text": "Moving XLogger to org.slf4j.ext package", "tokens": 13} {"id": 904250, "source": "commit", "repo": "qos-ch/slf4j", "text": "SLF4J target JDK 1.4, updated parent pom.xml accordingly", "tokens": 17} {"id": 904932, "source": "commit", "repo": "querz/nbt", "text": "move NBTUtil / tests for NBTUtil / fix custom tags", "tokens": 13} {"id": 905031, "source": "commit", "repo": "quickcarpet/quickcarpet", "text": "Update to 21w42a", "tokens": 10} {"id": 905362, "source": "commit", "repo": "quickcarpet/quickcarpet", "text": "Fix /log tps showing incorrect TPS", "tokens": 10} {"id": 905580, "source": "commit", "repo": "raeleus/skin-composer", "text": "Add events to menu bar in Scene Composer.", "tokens": 11} {"id": 905677, "source": "commit", "repo": "raeleus/skin-composer", "text": "Resolved crash bug when erasing a value in Nine Patch Dialog", "tokens": 16} {"id": 905833, "source": "commit", "repo": "raeleus/skin-composer", "text": "Updated drawables dialog to use the new skin.", "tokens": 11} {"id": 905902, "source": "commit", "repo": "rafaskb/typing-label", "text": "Pretty clean fix for the 1.10.1 run.color change. This only works with libGDX 1.10.1-SNAPSHOT at the moment, and shouldn't be merged into the main branch yet.", "tokens": 52} {"id": 905903, "source": "commit", "repo": "rafaskb/typing-label", "text": "Update Gradle to 7.2, regexodus to 0.1.12 . Updating Gradle allows developers to build typing-label using Java 15 or 16. This also cleans up an error emitted when closing TypingLabelTest. It should be possible for JitPack to build this, too.", "tokens": 69} {"id": 906098, "source": "commit", "repo": "raiman/sikulix1", "text": "revised: tessdata: should be extracted with a new build (in synch with the libs)", "tokens": 23} {"id": 906463, "source": "commit", "repo": "randoop/randoop", "text": "Pull changes from call-avoidance into master", "tokens": 10} {"id": 906505, "source": "commit", "repo": "randoop/randoop", "text": "Add handling of unexpected execeptions when calling Class.forName()", "tokens": 15} {"id": 906994, "source": "commit", "repo": "react-native-share/react-native-share", "text": "feat: support discord share for android and ios (#1525)", "tokens": 16} {"id": 907066, "source": "commit", "repo": "react-native-share/react-native-share", "text": "fix(whatsapp): iOS Whatsapp images share (#1006)", "tokens": 16} {"id": 907333, "source": "commit", "repo": "react-native-share/react-native-share", "text": "Fix open method signiture for react-native-windows", "tokens": 13} {"id": 907386, "source": "commit", "repo": "react-native-share/react-native-share", "text": "updateRN 0.14.0 new native module Api", "tokens": 15} {"id": 907466, "source": "commit", "repo": "react-native-video/react-native-video", "text": "feat(android): add settings button to control video playback speed (#4211)", "tokens": 19} {"id": 907665, "source": "commit", "repo": "react-native-video/react-native-video", "text": "Update README.md (#2076) You only need to perform linking for React Native < 0.60", "tokens": 26} {"id": 907726, "source": "commit", "repo": "react-native-video/react-native-video", "text": "Fix issue with embedded Bundle videos in Release configuration", "tokens": 11} {"id": 907759, "source": "commit", "repo": "react-native-video/react-native-video", "text": "Add fix for multiple onEnd notifications on iOS", "tokens": 10} {"id": 907886, "source": "commit", "repo": "react-native-webrtc/react-native-webrtc", "text": "android: disable UVC enumerator on Android 14 Ref: https://github.com/jiangdongguo/AndroidUSBCamera/pull/647", "tokens": 37} {"id": 907887, "source": "commit", "repo": "react-native-webrtc/react-native-webrtc", "text": "release 118.0.2 9e7ccc8 android: add media projection service ( Calinteodor 2024-02-29 14:55:05 +0200) 50a51c1 docs: Add foreground service type perms to android docs (#1509) ( davidliu 2024-02-23 18:39:51 +0900)", "tokens": 111} {"id": 907950, "source": "commit", "repo": "react-native-webrtc/react-native-webrtc", "text": "ios: sanitize inoput to addIceCandidate", "tokens": 11} {"id": 908114, "source": "commit", "repo": "react-native-webrtc/react-native-webrtc", "text": "api: fix sLD/sRD to match standard", "tokens": 14} {"id": 908273, "source": "commit", "repo": "react-native-webrtc/react-native-webrtc", "text": "Fix syntax warning by removing extraneous doublequote", "tokens": 11} {"id": 908414, "source": "commit", "repo": "ReaJason/MemShellParty", "text": "fix(ui): hide urlPatternField for customizer", "tokens": 11} {"id": 908588, "source": "commit", "repo": "ReaJason/MemShellParty", "text": "fix(ui): packResult not changed when regenerate", "tokens": 11} {"id": 909067, "source": "commit", "repo": "redis/jedis", "text": "Added JavaDoc for GeoRadiusResponse (#3542) Also added hashCode()", "tokens": 17} {"id": 909152, "source": "commit", "repo": "redis/jedis", "text": "Added Rawable interface (#2370) * Added Raw interface Jedis should have a common interface to represent all commands and keywords (and, perhaps, arguments). Closest thing we currently have is `ProtocolCommand` interface. But the problem is that it contains the word COMMAND which would be misleading to use for something other than commands. One option is to rename the existing interface. But this would be a breaking change and so it can't be available before at least Jedis 4.0. Even that can be received negatively by the users who could be using the existing interface. Having a parent interface, on the other hand, does not have such issues and can be included in upcoming non-major release. I went with name `Raw`, instead of other names like `ProtocolKeyword` or `ProtocolArgument`, because it is short and fits nicely with our go to method `getRaw()`. * dedicated package I have also put it in a separate package because with growing number of classes, we'd be able to put some classes in that package. * Rawable `Raw` in now `Rawable`. Idea courtesy goes to @gkorland.", "tokens": 246} {"id": 909279, "source": "commit", "repo": "redis/jedis", "text": "Remove opendk as it's not present", "tokens": 11} {"id": 909323, "source": "commit", "repo": "redis/jedis", "text": "Apply \"Java Convention\" to met Jedis's preferred source code Convention", "tokens": 17} {"id": 909335, "source": "commit", "repo": "redis/jedis", "text": "Fix BinaryJedis.eval() method bug (argument) * append unit test for BinaryJedis", "tokens": 19} {"id": 909654, "source": "commit", "repo": "redis/lettuce", "text": "Polishing #1011 Refactor nullability check as RedisClusterNode is expected to be never null. Add author tags. Original pull request: #1013", "tokens": 34} {"id": 909883, "source": "commit", "repo": "redis/redis-om-spring", "text": "fix: resolve NPE in getTTLForEntity() for entities without standard J\u2026 (#726) * fix: resolve NPE in getTTLForEntity() for entities without standard JavaBean getters Remove ClassLoader.getSystemClassLoader() from RedisJSONKeyValueAdapter.getTTLForEntity() which fails on JDK 25 for Spring-managed classes. Use entity.getClass() directly instead, consistent with SimpleRedisDocumentRepository. Add null-safety for ObjectUtils.getGetterForField() which returns null for entities without standard getters (Groovy classes, records, non-standard naming). When no getter is found, fall back to direct field access via ReflectionUtils.makeAccessible(). Extract shared helper ObjectUtils.getNumericFieldValue() used by both adapters. Downgrade MetamodelGenerator diagnostic from ERROR to WARNING for missing getters since the runtime now handles getter-less fields gracefully. * fix: batch ReferenceTest saveAll to prevent pipeline socket timeout on CI The @BeforeEach saves 10,000 entities with 10 references each, producing 110,000+ pipeline commands in a single saveAll(). On GitHub Actions runners the TCP socket times out before the pipeline buffer can flush. Batch into groups of 1,000 to keep individual pipelines manageable. * fix: handle null TTL field value in getter path of getNumericFieldValue The getter path cast the return value directly to Number without a null check, so a null Long TTL field would NPE. Unify both getter and direct field access paths through the same instanceof null-safe check.", "tokens": 318} {"id": 909885, "source": "commit", "repo": "redis/redis-om-spring", "text": "docs: clarify FT.AGGREGATE cursor ID reuse behavior and simplify resolveCursorId (#708) Redis reuses the same cursor ID across FT.CURSOR READ calls until exhaustion. Added Javadoc to cursor() methods explaining this behavior and recommending .limit() for predictable pagination. Simplified resolveCursorId() with clearer guard clause and documentation. Added test for cursor iteration without .limit().", "tokens": 88} {"id": 909930, "source": "commit", "repo": "redis/redis-om-spring", "text": "docs: remove outdated preview release language from README Updated README to reflect that Redis OM Spring is now production-ready at version 1.0.4, removing the \"preview release\" terminology that was no longer accurate.", "tokens": 46} {"id": 910120, "source": "commit", "repo": "redis/redis-om-spring", "text": "fix: rename RedisTemplate Bean from redisTemplate to redisOMTemplate to prevent collisions (resolved gh-316)", "tokens": 24} {"id": 910164, "source": "commit", "repo": "redis/redis-om-spring", "text": "release: 0.8.3-SNAPSHOT", "tokens": 11} {"id": 910240, "source": "commit", "repo": "redis/redis-om-spring", "text": "refactor: implement all id and crud operations without requiring Set for JSON operations", "tokens": 16} {"id": 910267, "source": "commit", "repo": "redis/redis-om-spring", "text": "docs: update release badge for v0.5.0", "tokens": 13} {"id": 910433, "source": "commit", "repo": "redlime/speedrunigt", "text": "support any% ssg & nullable timeline map", "tokens": 10} {"id": 910687, "source": "commit", "repo": "refinedmods/refinedstorage", "text": "docs: support for mc 1.18.2", "tokens": 13} {"id": 910694, "source": "commit", "repo": "refinedmods/refinedstorage", "text": "Fix data parameter desyncs, causing side buttons to not work sometimes. Fixes #3449 API break", "tokens": 24} {"id": 910725, "source": "commit", "repo": "refinedmods/refinedstorage", "text": "fix detector crashing when dyed and deactivating powered state (#2974)", "tokens": 21} {"id": 910906, "source": "commit", "repo": "refinedmods/refinedstorage", "text": "changes to the ore dict list related to changing stacks", "tokens": 12} {"id": 911302, "source": "commit", "repo": "refinedmods/refinedstorage2", "text": "chore: prepare release v2.0.0-milestone.3.14", "tokens": 18} {"id": 911372, "source": "commit", "repo": "refinedmods/refinedstorage2", "text": "refactor: introduce helper interface on API level for storage container items An effort to abstract away IDs.", "tokens": 20} {"id": 911594, "source": "commit", "repo": "relativitymc/vmp-fabric", "text": "build: 1.21.2-rc1", "tokens": 13} {"id": 911603, "source": "commit", "repo": "relativitymc/vmp-fabric", "text": "build: 1.21.1", "tokens": 10} {"id": 911798, "source": "commit", "repo": "relativitymc/vmp-fabric", "text": "Adds a list of optimizations in README.md [ci skip]", "tokens": 14} {"id": 912296, "source": "commit", "repo": "remmintan/minefortress", "text": "Removing current hire sync handler on close hire menu screen", "tokens": 13} {"id": 912445, "source": "commit", "repo": "remmintan/minefortress", "text": "Add Furnance screen (cherry picked from commit 8877924a39b03ccef85e420e68693baec056cd3a)", "tokens": 48} {"id": 912450, "source": "commit", "repo": "remmintan/minefortress", "text": "Add Patrons names (cherry picked from commit 67d27b07c48ed4910d9a8e46b48c801131e711a7)", "tokens": 52} {"id": 912474, "source": "commit", "repo": "remmintan/minefortress", "text": "Remove old world mixins that replaced with renderers (cherry picked from commit da68fda7d36ba660bd243feb3791f1f5052e7eb6)", "tokens": 50} {"id": 912497, "source": "commit", "repo": "remmintan/minefortress", "text": "Add requirement id as an optional metadatada field (cherry picked from commit abea9afdf66cdb764260ce8956ddcd3740d2a6e7)", "tokens": 49} {"id": 912584, "source": "commit", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "Updated exercise 4.3.33", "tokens": 10} {"id": 912631, "source": "commit", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "Updated exercise 2.5.21", "tokens": 10} {"id": 912652, "source": "commit", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "Updated exercise 4.2.46 and related experiments", "tokens": 14} {"id": 912725, "source": "commit", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "Added exercise 6.48 and finished maxflow section", "tokens": 13} {"id": 912797, "source": "commit", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "Added exercise 5.4.17", "tokens": 10} {"id": 912855, "source": "commit", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "Added exercise 4.4.45", "tokens": 10} {"id": 912955, "source": "commit", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "Added exercise 3.3.34", "tokens": 10} {"id": 912958, "source": "commit", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "Added exercise 3.3.30 and fixed bugs in 3.3.26", "tokens": 21} {"id": 913003, "source": "commit", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "Added exercise 2.4.15", "tokens": 10} {"id": 913073, "source": "commit", "repo": "reobf/Programmable-Hatches-Mod", "text": "No longer rely on file name to ensure that target mod is loaded in mixin.", "tokens": 17} {"id": 913152, "source": "commit", "repo": "reposense/reposense", "text": "[#2103] Refactor `parser` package for greater organisation of classes (#2104) Classes in the `parser` package as of now are not properly organised, with exceptions, types and parser classes being found in the same directory level. This does not follow the convention established by other packages, whereby logically similar classes are further grouped into sub-packages. Let's move to refactor the `parser` package to ensure that it follows the overall structure of the other packages and to increase the level of organisation within the `parser` package.", "tokens": 120} {"id": 913224, "source": "commit", "repo": "reposense/reposense", "text": "[#1774] Fix unintended behavior related to --since d1 (#1776) The use of Instant.ofEpochMilli(Long.MIN_VALUE) as the arbitrary first commit date now fails shallow cloning for testSinceBeginningDateRangeWithShallowCloning system test. In addition, using this arbitrary date in convertToGitDateRangeArgs when converting timezone results in an overflow causing sinceDate to be greater than untilDate. Thus, no commit results are retrieved, leading to failing system tests. Also, the arbitrary first commit date is in UTC. However, in the convertToGitDateRangeArgs method, the zoneId used for the conversion is from the config, which may be different. This leads to an erroneous timezone conversion. Finally, using --since d1 with --period results in an unintended date range because the --period and the arbitrary commit date from --since d1 are used to calculate the until date as the actual earliest commit date is not immediately available. Let's change Instant.ofEpochMilli() to use 0 so that the arbitrary date is 1970-01-01 and the overflow of the sinceDate can be avoided. At the same time, let's convert the arbitrary date to the correct timezone within the ArgsParser class and add a component test for parsing --since d1 to check that the correct timezone is used for each RepoConfiguration before cloning any repos. Finally, let's raise a warning when --since d1 is being used with --period.", "tokens": 310} {"id": 913351, "source": "commit", "repo": "reposense/reposense", "text": "[#960] panels.scss: refactor common panel style (#1104) The JS/HTML code of each component has already rested in its own file, but all the CSS are in one file. Let's refactor the common components shared across panels to a common file for scalability and readability.", "tokens": 68} {"id": 913452, "source": "commit", "repo": "reposense/reposense", "text": "[#584] Cypress: front-end test failing due to timeouts (#595) By default, Cypress use 4000ms as the timeout value for DOM-based commands. However, using the default timeout value may result in frontend test failing, when the CI is experiencing heavier load. Let's increase the timeout value to 30000ms.", "tokens": 90} {"id": 913607, "source": "commit", "repo": "restfb/restfb", "text": "start development 2025.16.0", "tokens": 13} {"id": 913684, "source": "commit", "repo": "restfb/restfb", "text": "Issue #1260: unsupported_type added to messaging attachment", "tokens": 15} {"id": 913695, "source": "commit", "repo": "restfb/restfb", "text": "Issue #1230 - incoming wabp sticker", "tokens": 14} {"id": 913704, "source": "commit", "repo": "restfb/restfb", "text": "Issue #1114 - remove deprecated permissions", "tokens": 11} {"id": 913727, "source": "commit", "repo": "restfb/restfb", "text": "Issue #1094: prepare 3.10.0", "tokens": 16} {"id": 913900, "source": "commit", "repo": "restfb/restfb", "text": "Issue #472 - messenger api welcome message container added", "tokens": 14} {"id": 914010, "source": "commit", "repo": "restfb/restfb", "text": "[maven-release-plugin] prepare release restfb-project-1.6.6", "tokens": 20} {"id": 914198, "source": "commit", "repo": "retera/reterasmodelstudio", "text": "Fix shift enter in object editor, fix animation chooser interval, fix CASC caching", "tokens": 17} {"id": 914297, "source": "commit", "repo": "retro64mod/retro64mod", "text": "Update de_de.json Proofread and assisted by Square789", "tokens": 20} {"id": 914303, "source": "commit", "repo": "retro64mod/retro64mod", "text": "Update pl_pl.json Added \"si\u0119\" for better Polish grammar", "tokens": 18} {"id": 914340, "source": "commit", "repo": "retro64mod/retro64mod", "text": "Bumped version to 1.0.10", "tokens": 11} {"id": 914684, "source": "commit", "repo": "revxrsal/lamp", "text": "Fix the order of functions in the Either type", "tokens": 10} {"id": 914686, "source": "commit", "repo": "revxrsal/lamp", "text": "Fixed parent code check not working as intended on paths such as \"aa\" and \"aabbb\"", "tokens": 21} {"id": 914838, "source": "commit", "repo": "rfresh2/xaeroplus", "text": "downscale text feature by minimap size multiplier", "tokens": 10} {"id": 915212, "source": "commit", "repo": "rfresh2/xaeroplus", "text": "Mixin 0.7.11 compatibility", "tokens": 10} {"id": 915226, "source": "commit", "repo": "rfresh2/xaeroplus", "text": "remap loaded chunks on obsidian roof setting changes", "tokens": 10} {"id": 915384, "source": "commit", "repo": "rieckpil/blog-tutorials", "text": "enrich REST Assured example with an integration test", "tokens": 12} {"id": 915743, "source": "commit", "repo": "rieckpil/testing-spring-boot-applications-masterclass", "text": "downgrade to Selenium 4.3.0 Temporary workaround to investigate the flakiness with 4.4.0", "tokens": 26} {"id": 915774, "source": "commit", "repo": "rieckpil/testing-spring-boot-applications-masterclass", "text": "disable web tests on ARM64 due to missing support in Selenium image", "tokens": 16} {"id": 915832, "source": "commit", "repo": "rieckpil/testing-spring-boot-applications-masterclass", "text": "use Java 16 and Spring Boot 2.5.0", "tokens": 15} {"id": 915853, "source": "commit", "repo": "rieckpil/testing-spring-boot-applications-masterclass", "text": "update to Spring Boot 2.4.0", "tokens": 11} {"id": 916084, "source": "commit", "repo": "rikkaapps/rikkax", "text": "Remove resetTitle since it seems not necessary now", "tokens": 10} {"id": 916633, "source": "commit", "repo": "ripmeapp/ripme", "text": "Added better url sanitization for DeviantartRipper and some unit tests", "tokens": 19} {"id": 916807, "source": "commit", "repo": "ripmeapp/ripme", "text": "Added IntelliJ `.idea` folder and `*.iml` to .gitignore.", "tokens": 20} {"id": 917345, "source": "commit", "repo": "rmlio/rmlmapper-java", "text": "SolidTarget, SolidResourceTarget, SolidAclTarget: improvements Implemented toString(), changed Boolean to boolean", "tokens": 23} {"id": 917562, "source": "commit", "repo": "rmlio/rmlmapper-java", "text": "logical-source: implement Web of Things data retrieval adds Private Security Data reading, Web of Things Web API access, Web API custom header authentication", "tokens": 33} {"id": 917668, "source": "commit", "repo": "rmlio/rmlmapper-java", "text": "add comment map in Executor and moved ProvenancedTerm", "tokens": 13} {"id": 917770, "source": "commit", "repo": "RoastSlav/quickdrop", "text": "chore(funding): remove FUNDING.yml file", "tokens": 13} {"id": 917806, "source": "commit", "repo": "RoastSlav/quickdrop", "text": "fix: stop leaking the backend port when only X-Forwarded-Proto is forwarded", "tokens": 17} {"id": 917809, "source": "commit", "repo": "RoastSlav/quickdrop", "text": "fix: declare the active locale in the html lang attribute All 23 page templates hardcoded lang=\"en\", so a page served in any of the other seven shipped languages still advertised itself as English. Screen readers pick pronunciation and voice from this attribute, and browser translation prompts key off it, so the effect was invisible in manual testing -- the visible text translates correctly either way -- while being exactly wrong for the users the i18n support exists to serve. Binds th:lang to #locale.language, the same expression settings.html already uses to pick its editor locale. The static lang=\"en\" stays alongside it as the natural templating fallback and is overwritten at render. LocaleRenderingTest covers the rendered output for German and Japanese plus the English fallback, and adds a structural check over every page template so a newly added page copying the old hardcoded attribute fails rather than silently regressing. Note the rendering assertions anchor on the opening tag: the language picker emits data-lang=\"en\" on every page regardless of locale, which contains the substring lang=\"en\" and makes the looser assertion pass vacuously. Fragments are excluded -- they are included into a host page and have no element of their own.", "tokens": 265} {"id": 917889, "source": "commit", "repo": "RoastSlav/quickdrop", "text": "fix: handle new admin event types in switch expressions Add ADMIN_LOGIN, ADMIN_LOGIN_FAIL, ADMIN_LOGOUT, ADMIN_SETTINGS_CHANGE to exhaustive switch arms in NotificationService (\u2192 false / empty string, since admin events never trigger notifications) and FileActionLogDTO (\u2192 lowercase string mapping for display).", "tokens": 73} {"id": 917920, "source": "commit", "repo": "RoastSlav/quickdrop", "text": "feat: enhance code documentation \u2014 add comprehensive Javadoc comments across multiple classes for improved clarity and maintainability", "tokens": 19} {"id": 917986, "source": "commit", "repo": "RoastSlav/quickdrop", "text": "Add preview stack styling for PDF and JSON previews in file view", "tokens": 14} {"id": 918248, "source": "commit", "repo": "rohannagar/jmail", "text": "Add changelog notes for upcoming v1.6.2", "tokens": 12} {"id": 918515, "source": "commit", "repo": "RohitKushvaha01/Xed-Editor", "text": "Corrected Assembly name in languages.json; Change translate of \"terminal_runtime\" on Russian; Fix raw strings in rust.tmLanguage.json (#908) * Added asm textmate language * Change translate of \"terminal_runtime\" on Russian * Corrected name of Assembly in languages.json * Fix raw strings in rust.tmLanguage.json * Fix asm.tmLanguage.json", "tokens": 88} {"id": 918570, "source": "commit", "repo": "RohitKushvaha01/Xed-Editor", "text": "docs(keybinds): improve keybind docs with kbd tags and categories (#700)", "tokens": 21} {"id": 918669, "source": "commit", "repo": "RohitKushvaha01/Xed-Editor", "text": "Translated using Weblate (Indonesian) Currently translated at 31.7% (96 of 302 strings) Translation: Xed Editor/Xed Editor Translate-URL: https://hosted.weblate.org/projects/xed-editor/xed-editor/id/", "tokens": 62} {"id": 919294, "source": "commit", "repo": "rubenlagus/telegrambots", "text": "fix minor issues for previous commit fix issue #755", "tokens": 13} {"id": 920287, "source": "commit", "repo": "ryandw11/customstructures", "text": "Updated to WE 7.0 and required Y [!] Updated to WorldEdit 7.0 version [+] Now this plugin requires Ymin and Ymax to spawn.", "tokens": 39} {"id": 920571, "source": "commit", "repo": "saml-toolkits/java-saml", "text": "Add missing call to postProcessXml in other Metadata constructor", "tokens": 11} {"id": 920713, "source": "commit", "repo": "saml-toolkits/java-saml", "text": "Adds # support in HttpRequest query string parsing HttpRequest.getEncodedParameter() will now return the corrent value for the last parameter before the #. Example: foo=bar#ignore now returns 'bar' and not 'bar#ignore' for the 'foo' parameter.", "tokens": 57} {"id": 920971, "source": "commit", "repo": "samuel-oliveira/java_nfe", "text": "Versao 4.00.44", "tokens": 13} {"id": 920989, "source": "commit", "repo": "samuel-oliveira/java_nfe", "text": "[maven-release-plugin] prepare release java-nfe-4.00.39", "tokens": 22} {"id": 921253, "source": "commit", "repo": "samuel-oliveira/java_nfe", "text": "Configuracoes de proxy Adicionado mecanismos para se configurar o proxy", "tokens": 18} {"id": 921444, "source": "commit", "repo": "sarxos/webcam-capture", "text": "Avoid secondary image creation in case screen resolution is already desired resolution", "tokens": 13} {"id": 921711, "source": "commit", "repo": "sarxos/webcam-capture", "text": "Remove memory leak on resetDriver() when handle TERM signal enabled fixes #14", "tokens": 18} {"id": 922050, "source": "commit", "repo": "sashirestela/simple-openai", "text": "refactor SimpleOpenAI into a base class + a class with OpenAI specific logic", "tokens": 15} {"id": 922688, "source": "commit", "repo": "scireum/s3ninja", "text": "Temporarily renames problematic test cases to disable them for testing \ud83e\udd2b", "tokens": 15} {"id": 922689, "source": "commit", "repo": "scireum/s3ninja", "text": "Attempts to properly disable groovy testing \ud83d\udd2b", "tokens": 10} {"id": 922812, "source": "commit", "repo": "scireum/s3ninja", "text": "Upgrades Sirius thus switching to Java 17 \ud83d\ude80", "tokens": 15} {"id": 922864, "source": "commit", "repo": "scireum/s3ninja", "text": "Adapts code to new properties files \ud83d\udc85", "tokens": 10} {"id": 922920, "source": "commit", "repo": "scireum/s3ninja", "text": "Extends test case to check user meta data \ud83d\udc68\u200d\ud83c\udfeb SIRI-163", "tokens": 19} {"id": 922922, "source": "commit", "repo": "scireum/s3ninja", "text": "Revises file filtering \ud83d\ude37 SIRI-163", "tokens": 12} {"id": 923091, "source": "commit", "repo": "scribejava/scribejava", "text": "[maven-release-plugin] prepare release scribejava-8.2.0", "tokens": 18} {"id": 923326, "source": "commit", "repo": "scribejava/scribejava", "text": "Fix #683 - Extract HTTP client logic into providers", "tokens": 13} {"id": 923527, "source": "commit", "repo": "scrin/ruuvicollector", "text": "Fixed option parsing, removed debug statements #70", "tokens": 11} {"id": 923904, "source": "commit", "repo": "seansegal/tincisnotcatan", "text": "Smaller roll dice modal, buggy trade response modal", "tokens": 12} {"id": 924073, "source": "commit", "repo": "seansegal/tincisnotcatan", "text": "added the concept of a user to the networking library and had CatanAPI implement a general API interface to supply the users with needed methods", "tokens": 28} {"id": 924075, "source": "commit", "repo": "seansegal/tincisnotcatan", "text": "Correct intersections highlight for settlement, city build", "tokens": 10} {"id": 924173, "source": "commit", "repo": "seansegal/tincisnotcatan", "text": "first draft of chat with networking done, refactored to separate chat logic from general logic", "tokens": 17} {"id": 924327, "source": "commit", "repo": "seart-group/ghs", "text": "Add localhost-only NGINX endpoint for exposing basic status information See: https://nginx.org/en/docs/http/ngx_http_stub_status_module.html", "tokens": 44} {"id": 924345, "source": "commit", "repo": "seart-group/ghs", "text": "Update `GitRepoDto` to include newly introduced field", "tokens": 11} {"id": 924433, "source": "commit", "repo": "seart-group/ghs", "text": "Replacing `@Getter` with `size` method Yes I am aware I can make it fluent, but for some reason the editor decides to spit out warnings if I don't put a class-level `@Getter`. Since the rest of the members should not be accessible, I think that this is acceptable.", "tokens": 65} {"id": 924491, "source": "commit", "repo": "seart-group/ghs", "text": "Using `no-cache` flag for `apk add`", "tokens": 13} {"id": 924587, "source": "commit", "repo": "seart-group/ghs", "text": "Specification refactoring Now instead of a single SearchCriteria, we introduce a general Criteria interface with three subtypes: - KeyCriteria - KeyValueCriteria - NestedKeyValueCriteria We use each of these to: 1. Check conditions on columns 2. Check column values 3. Check values of nested columns", "tokens": 62} {"id": 924791, "source": "commit", "repo": "segmentio/analytics-android", "text": "Refactor Options handling Previously if you sent `All: false`, we'd only use the tracking plan to figure out if the track event should be sent to integrations. This updates is so that the Options object takes precedence over all else. The event tracking plan cannot override options and only fill in missing pieces.", "tokens": 65} {"id": 925013, "source": "commit", "repo": "segmentio/analytics-android", "text": "prepare for release [2.0.2]", "tokens": 11} {"id": 925024, "source": "commit", "repo": "segmentio/analytics-android", "text": "Only cache json value if operation is supported. It may not be for immutable maps.", "tokens": 18} {"id": 925122, "source": "commit", "repo": "seize-the-dave/jscep", "text": "Start up Jetty once per test class instead of once per test.", "tokens": 15} {"id": 925348, "source": "commit", "repo": "selenide/selenide", "text": "speed up the slowest collections tests In most tests, we don't really need to wait 4 seconds. There is only a few tests where we do want to test the \"waiting\".", "tokens": 42} {"id": 925405, "source": "commit", "repo": "selenide/selenide", "text": "#1780 add check `$.shouldHave(partialText)` for checking a substring + fix existing integration tests that assumed that `$.shouldHave(text)` checks a substring", "tokens": 42} {"id": 925544, "source": "commit", "repo": "selenide/selenide", "text": "fixed typo & added new test for option and SetSelected", "tokens": 12} {"id": 926028, "source": "commit", "repo": "sendbird/sendbird-android", "text": "Update SDK to 3.0.38.", "tokens": 12} {"id": 926038, "source": "commit", "repo": "sendbird/sendbird-android", "text": "Glide bug fix (java.lang.IllegalArgumentException: You cannot start a load for a destroyed activity)", "tokens": 23} {"id": 926162, "source": "commit", "repo": "sendgrid/sendgrid-java", "text": "fix: pom.xml to reduce vulnerabilities (#694) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JAVA-ORGAPACHEHTTPCOMPONENTS-1048058", "tokens": 57} {"id": 926320, "source": "commit", "repo": "sendgrid/sendgrid-java", "text": "Reverts back to running prism in background.", "tokens": 11} {"id": 926361, "source": "commit", "repo": "sendgrid/sendgrid-java", "text": "Version Bump v3.1.0: PR #158, Solves #138 [Enhancement] allow using custom Client, http proxy support", "tokens": 33} {"id": 926740, "source": "commit", "repo": "shadows-of-fire/apotheosis", "text": "Fix entity inventories being duplicated Closes #1473", "tokens": 12} {"id": 926894, "source": "commit", "repo": "shadows-of-fire/apotheosis", "text": "Only auto aggro on closest player if config is enabled", "tokens": 13} {"id": 927158, "source": "commit", "repo": "shafthq/shaft_engine", "text": "fix: keep the Appium lock checksums and portable guidance gate green Update the approved Appium lock digests for fast-uri 3.1.8, and keep owner-commit guidance in the shaft profile so the portable playbook stays inside its size and token policy.", "tokens": 57} {"id": 927223, "source": "commit", "repo": "shafthq/shaft_engine", "text": "[CE] Native Headroom (agent-90) + self-improve skill Integrate managed headroom-ai pin with CE max-savings defaults (agent-90, beacon off, memory injection disabled, Ponytail XOR OUTPUT_SHAPER) plus a lean Task Observer\u2013informed self-improve skill wrapping learning.py. Fixes #5613", "tokens": 84} {"id": 927433, "source": "commit", "repo": "shafthq/shaft_engine", "text": "[codex] Remember Memory and graphify CLI workflow (#2943) Remember Memory and graphify CLI workflow", "tokens": 25} {"id": 927478, "source": "commit", "repo": "shafthq/shaft_engine", "text": "Fix CI \"no file found\" exception when uploading Allure HTML artifact (#2285) * Initial plan * Fix workflow no-file-found exception for Allure HTML report Use glob pattern *AllureReport.html to match both timestamped (yyyy-MM-dd_HH-mm-ss-SSS_AllureReport.html, default when allure.accumulateReports=true) and plain AllureReport.html filenames in all CI workflow rename steps. ---------", "tokens": 101} {"id": 927746, "source": "commit", "repo": "shopify/mobile-buy-sdk-android", "text": "Version Bump: 18.0.0", "tokens": 11} {"id": 927794, "source": "commit", "repo": "shopify/mobile-buy-sdk-android", "text": "Revert \"Submodule update\" This reverts commit dfb14a3c73cde60a5f03bdbef1fbc8b1aeb58631.", "tokens": 45} {"id": 927858, "source": "commit", "repo": "shopify/mobile-buy-sdk-android", "text": "Increase buy3 version number to 3.0.4 (#417)", "tokens": 18} {"id": 927926, "source": "commit", "repo": "shopify/mobile-buy-sdk-android", "text": "Add customer API interceptor (#285)", "tokens": 10} {"id": 927981, "source": "commit", "repo": "shopify/mobile-buy-sdk-android", "text": "Task/use longs for ids (#164)", "tokens": 13} {"id": 928512, "source": "commit", "repo": "silentchaos512/silent-gear", "text": "Fix set_parts loot function. Allows materials and modifiers to be set.", "tokens": 16} {"id": 928565, "source": "commit", "repo": "silentchaos512/silent-gear", "text": "Update changelog 2.6.29", "tokens": 10} {"id": 928652, "source": "commit", "repo": "silentchaos512/silent-gear", "text": "Cache example outputs for gear recipes (#259), fix invalid example items", "tokens": 16} {"id": 928801, "source": "commit", "repo": "silentchaos512/silent-gear", "text": "Running on 1.14.2", "tokens": 11} {"id": 928818, "source": "commit", "repo": "silentchaos512/silent-gear", "text": "Giving up on login packets for now, no idea what to do", "tokens": 16} {"id": 929078, "source": "commit", "repo": "sinkillerj/projecte", "text": "Make tooltips reference what the keybinds are set to", "tokens": 11} {"id": 929088, "source": "commit", "repo": "sinkillerj/projecte", "text": "Improve world transmutation lookup speed when there are a lot of transmutations and prioritize state specific ones over ones that ignore the state", "tokens": 29} {"id": 929259, "source": "commit", "repo": "sinkillerj/projecte", "text": "Null and type check all getTIleEntity calls, cleaner solution later. Closes a bunch of tickets", "tokens": 22} {"id": 929286, "source": "commit", "repo": "sinkillerj/projecte", "text": "Unhard-code the mod id and mod name where they've been hardcoded", "tokens": 17} {"id": 929456, "source": "commit", "repo": "sinkillerj/projecte", "text": "Bump API. Add some clarifying comments. Also fix the Gem Density duplication bug #761", "tokens": 22} {"id": 929582, "source": "commit", "repo": "Sinytra/Connector", "text": "Fix running Fabric and Forge Kotlin adapters simultaneously Put Kotlin libs on PLUGIN layer so that they are available to KFF", "tokens": 25} {"id": 929623, "source": "commit", "repo": "Sinytra/Connector", "text": "Check LoadingModList#hasErrors instead of LoadingModList#getModLoadingIssues != empty (#1830) this makes Connector only check for true mod loading errors instead of non-fatal warnings, which prevents difficult-to-debug crashes due to Connector not running early setup despite the game continuing to launch", "tokens": 64} {"id": 929807, "source": "commit", "repo": "Sinytra/Connector", "text": "Update adapter definition to 1.9.9 Fixes #633", "tokens": 16} {"id": 929860, "source": "commit", "repo": "Sinytra/Connector", "text": "Propagate context classloader to default forkjoin thread factory Patch mixin conflicts related to Slight GUI Modifications Fixes #269", "tokens": 27} {"id": 930013, "source": "commit", "repo": "Sinytra/Connector", "text": "Set display test to IGNORE_ALL_VERSION Connector is optional for both sides", "tokens": 18} {"id": 930295, "source": "commit", "repo": "sirjonasxx/g-earth", "text": "fixes part 2, SOCKS now implemented", "tokens": 10} {"id": 930382, "source": "commit", "repo": "sirjonasxx/g-earth", "text": "authentication for extensions as suggested by LittleJ", "tokens": 10} {"id": 930886, "source": "commit", "repo": "skynetcap/solanaj", "text": "Remove protobuf-javalite dependency from pom.xml and update solanaj version to 1.25.1 in README.md for consistency with the latest release.", "tokens": 36} {"id": 930921, "source": "commit", "repo": "skynetcap/solanaj", "text": "Update project version to 1.19.0 This commit updates the Maven project version from 1.18.2 to 1.19.0. Adjustments were made in both the pom.xml and README.md files to reflect this change.", "tokens": 57} {"id": 930923, "source": "commit", "repo": "skynetcap/solanaj", "text": "Update ConfirmedTransaction.java Added Blocktime to transaction. Needed for sorting txs.", "tokens": 18} {"id": 930945, "source": "commit", "repo": "skynetcap/solanaj", "text": "Enhance WebSocket functionality and add tests - Implement custom ping mechanism in SubscriptionWebSocketClient - Add JavaDocs to WebSocket-related classes and methods - Create SubscriptionWebSocketClientTest for connection and message handling - Implement WebsocketTest for account subscriptions and multiple subscriptions - Add AccountNotificationEventListener and LogNotificationEventListener - Update pom.xml with new dependencies and plugin configurations", "tokens": 67} {"id": 931325, "source": "commit", "repo": "skynetcap/solanaj", "text": "feat: message header, acount adresses sorting, exceptions", "tokens": 16} {"id": 931479, "source": "commit", "repo": "skytasul/beautyquests", "text": ":bug: Fixed play time no longer working", "tokens": 10} {"id": 931529, "source": "commit", "repo": "skytasul/beautyquests", "text": ":bug: Fixed a bug with \"fill buckets\" stage < 1.17", "tokens": 19} {"id": 931621, "source": "commit", "repo": "skytasul/beautyquests", "text": "Fix comparison method * fixed \"material\" comparison method * added message in case of null in DB * if item name is too long, it will be split and put at the beginning of item's lore", "tokens": 42} {"id": 931959, "source": "commit", "repo": "slackapi/java-slack-sdk", "text": "feat: add workflow.featured.{add|list|remove|set} methods (#1542)", "tokens": 25} {"id": 932013, "source": "commit", "repo": "slackapi/java-slack-sdk", "text": "Upgrade GSON to 2.11.0", "tokens": 11} {"id": 932481, "source": "commit", "repo": "slackhq/astra", "text": "Rework HPA scaledown lock to be more fair (#1018)", "tokens": 17} {"id": 932918, "source": "commit", "repo": "slackhq/kaldb", "text": "Redaction Refactor (#1278)", "tokens": 10} {"id": 932965, "source": "commit", "repo": "slackhq/kaldb", "text": "Add full text search to `SchemaAwareLogDocumentBuilder`. (#449) Add full text search to SchemaAwareLogDocumentBuilder. Also, fixed a bug in lucene field definition. Added new tests. Pre-fixed internal fields with '_' following ES conventions. Moved Type into reserved field. Updated tests.", "tokens": 63} {"id": 933184, "source": "commit", "repo": "slimeknights/mantle", "text": "Fix wrong damage source in sweep attacks along with extra sound", "tokens": 13} {"id": 933256, "source": "commit", "repo": "slimeknights/mantle", "text": "Further generalize a couple of the UI methods Want to use them for the casting tank which lacks player access but wants sound. So using transfer result as a unifying return for them. Transfer result also has this helpful new getSound method to ease that. Technically a breaking change, but old version never released", "tokens": 64} {"id": 933419, "source": "commit", "repo": "slimeknights/mantle", "text": "Fix fluid renderer handling of light Fluid renderer now uses fluid light in calculations Fluid renderer no longer mixes up sky and block light coordinates", "tokens": 27} {"id": 933685, "source": "commit", "repo": "slimeknights/tinkersconstruct", "text": "Reorder attributes on godspeed to be in ascending order", "tokens": 13} {"id": 933777, "source": "commit", "repo": "slimeknights/tinkersconstruct", "text": "add slight variation for slime metal guards", "tokens": 10} {"id": 933862, "source": "commit", "repo": "slimeknights/tinkersconstruct", "text": "Improved modifier requirements Maintained the previous change of not automatically calling this in Tool#validate() Updated ModifierRecipeLookup#checkRequirements(ItemStack,IModifierToolStack), called primarily when a modifier is removed to make sure they are all still valid New signature for ModifierRecipeLookup#addRequirements() Old check and add requirements methods kept to prevent a binary breaking change, though functionality will be very limited.", "tokens": 82} {"id": 933908, "source": "commit", "repo": "slimeknights/tinkersconstruct", "text": "Increment minimum Forge version Also rename property so its more clear", "tokens": 12} {"id": 934131, "source": "commit", "repo": "slimeknights/tinkersconstruct", "text": "we dont want GT errors ever, wording from sunstrike", "tokens": 14} {"id": 934371, "source": "commit", "repo": "sniffy/sniffy", "text": "https://github.com/sniffy/sniffy/issues/388 No request method and response code shown for main non-AJAX request", "tokens": 30} {"id": 934416, "source": "commit", "repo": "sniffy/sniffy", "text": "sniffy-ui bumped to 3.1.3", "tokens": 13} {"id": 934427, "source": "commit", "repo": "sniffy/sniffy", "text": "Send Sniffy-Inject-Html-Enabled: false header in XHR requests", "tokens": 16} {"id": 934519, "source": "commit", "repo": "sniffy/sniffy", "text": "Version changed to 3.1.0-SNAPSHOT", "tokens": 12} {"id": 935156, "source": "commit", "repo": "spair/imgui-java", "text": "[Example] Migrate example to the new module", "tokens": 10} {"id": 935286, "source": "commit", "repo": "spair/imgui-java", "text": "[fixes #3] Fix binding for input fields - InputFloat3 - InputFloat4 - InputInt3 - InputInt4", "tokens": 27} {"id": 935873, "source": "commit", "repo": "spongepowered/mixin", "text": "Raise exception when ModifyVariable handler args incorrect, closes #232", "tokens": 16} {"id": 935944, "source": "commit", "repo": "spongepowered/mixin", "text": "Bump version to 0.6.9 for MC 1.12 fix", "tokens": 18} {"id": 936021, "source": "commit", "repo": "spongepowered/mixin", "text": "Fix usage of asterisk (matchAll) selectors for injector targets", "tokens": 15} {"id": 936075, "source": "commit", "repo": "spongepowered/mixin", "text": "Begin compatibility level support, java 8 must now be explicitly enabled", "tokens": 15} {"id": 936124, "source": "commit", "repo": "spongepowered/mixin", "text": "Add exclusion for synthetic static fields in pre-processor, closes #43", "tokens": 16} {"id": 936271, "source": "commit", "repo": "spongepowered/noise", "text": "Update version to 1.0.1-SNAPSHOT for development", "tokens": 14} {"id": 936622, "source": "commit", "repo": "spongepowered/sponge", "text": "Actually test the results from the tested methods.", "tokens": 10} {"id": 936641, "source": "commit", "repo": "spongepowered/sponge", "text": "Don't call asICommandSource() when no one implements it. Fixes SpongePowered/SpongeForge#1333", "tokens": 26} {"id": 936735, "source": "commit", "repo": "spongepowered/sponge", "text": "Update HikariCP to fix \"Failed to get/set network timeout\" spam", "tokens": 17} {"id": 936859, "source": "commit", "repo": "spongepowered/spongeapi", "text": "Allow WorldProperties to be named. Closes #2419.", "tokens": 15} {"id": 936962, "source": "commit", "repo": "spongepowered/spongeapi", "text": "Fix project importing because someone screwed up refactoring.", "tokens": 12} {"id": 937135, "source": "commit", "repo": "spongepowered/spongeapi", "text": "Add new DelayableData for Repeaters. Closes #910.", "tokens": 18} {"id": 937177, "source": "commit", "repo": "spongepowered/spongeapi", "text": "Add BlockRay for getting all blocks intersecting a line Closes #687 With help from @gratimax", "tokens": 26} {"id": 937412, "source": "commit", "repo": "spongepowered/spongeforge", "text": "Ignore collision box checks for multipart entities, should fix issues where the Hydra from TwilightForest gets deleted because of the collision box check.", "tokens": 30} {"id": 937506, "source": "commit", "repo": "spongepowered/spongeforge", "text": "Update Forge and remove special handling of Minecraft plugin container Fixes SpongePowered/SpongeCommon#1073", "tokens": 22} {"id": 937645, "source": "commit", "repo": "spongepowered/spongeforge", "text": "Hook FML's block and item registry to SpongeModGameRegistry. This commit allows plugins and mods to access any registered block or item through FML. In order to access a mod item or block you simply pass \"modid:name\". For example, in order to access the MoCreatures mod cat medallion, you would do the following : game.getRegistry().getType(ItemType.class, \"mocreatures:medallion\"); If you do not pass a prefix to id, sponge will assume vanilla which uses the \"minecraft:\" prefix.", "tokens": 119} {"id": 937808, "source": "commit", "repo": "spongepowered/spongevanilla", "text": "Update SpongeCommon for various updates including a refined PhaseTracker with enhanced BlockTransaction processing. Along with PhaseTracker sidedness.", "tokens": 25} {"id": 937831, "source": "commit", "repo": "spongepowered/spongevanilla", "text": "Move UseItemStackEvent implementation to SpongeCommon The entire implementation is now contained in SpongeCommon, so we can simply delete the corresponding SpongeVanilla code", "tokens": 27} {"id": 938368, "source": "commit", "repo": "spotify-web-api-java/spotify-web-api-java", "text": "ModelObject Sorting IIIb ~ Refactor files for previous commit", "tokens": 14} {"id": 938568, "source": "commit", "repo": "spotify-web-api-java/spotify-web-api-java", "text": "Add search request url creation (required param only)", "tokens": 12} {"id": 938688, "source": "commit", "repo": "sqlancer/sqlancer", "text": "Implement TLPWhereGenerator interfaces for SQLite3", "tokens": 10} {"id": 939167, "source": "commit", "repo": "srgantmoomoo/postman", "text": "work on adding setting command. fix some bug that some dude put in a pr bruh bruh bruh bruh bruhb bruhbruhbruh bruh. bruh.", "tokens": 41} {"id": 939249, "source": "commit", "repo": "srgantmoomoo/postman", "text": "fixes to settings/config. autocrystals stuffs.", "tokens": 13} {"id": 939472, "source": "commit", "repo": "srgantmoomoo/postman", "text": "autoDisconnect and criticals. more chestStealer fixes.", "tokens": 14} {"id": 939926, "source": "commit", "repo": "Stonewuu/ai-fusion-video", "text": "fix: wire image storage into NewAPI strategy", "tokens": 10} {"id": 940061, "source": "commit", "repo": "stripe/stripe-java", "text": "Bump version to 26.11.0", "tokens": 12} {"id": 940228, "source": "commit", "repo": "stripe/stripe-java", "text": "Codegen for openapi c9e407e", "tokens": 13} {"id": 940728, "source": "commit", "repo": "structurizr/onpremises", "text": "Fixes some issues with review links never/always showing.", "tokens": 12} {"id": 941245, "source": "commit", "repo": "sunagatov/online-store", "text": "BE check-list for USER/AUTH endpoints was made", "tokens": 13} {"id": 941300, "source": "commit", "repo": "sunagatov/online-store", "text": "Online-store Purchase product feature was added.", "tokens": 12} {"id": 941359, "source": "commit", "repo": "sventorben/keycloak-home-idp-discovery", "text": "chore(deps): Update Keycloak dependencies to 26.1.3", "tokens": 16} {"id": 941440, "source": "commit", "repo": "sventorben/keycloak-home-idp-discovery", "text": "docs: Streamline README and link to official documentation website", "tokens": 12} {"id": 941484, "source": "commit", "repo": "sventorben/keycloak-home-idp-discovery", "text": "feat: Improve logging for better debuggability Closes #131", "tokens": 15} {"id": 941505, "source": "commit", "repo": "sventorben/keycloak-home-idp-discovery", "text": "chore(release): prepare release v19.0.0", "tokens": 14} {"id": 941523, "source": "commit", "repo": "sventorben/keycloak-home-idp-discovery", "text": "chore: Fix compatibility tests with Keycloak.X latest", "tokens": 11} {"id": 941663, "source": "commit", "repo": "sweng-epfl/public", "text": "Clarify the solution of Q1 in Evolution", "tokens": 10} {"id": 941746, "source": "commit", "repo": "symgraph/GhidrAssistMCP", "text": "Fix various markdown linting warnings in readme.md", "tokens": 10} {"id": 941763, "source": "commit", "repo": "symgraph/GhidrAssistMCP", "text": "Adds initial multi-program awareness to tools.", "tokens": 11} {"id": 941939, "source": "commit", "repo": "tabulapdf/tabula-java", "text": "adds test for #78, confirms that the fix works", "tokens": 14} {"id": 942188, "source": "commit", "repo": "tamboui/tamboui", "text": "fix: address review feedback on ScrollableElement - Rename getState() to state() per project naming conventions - Remove broken scrollable(ScrollbarElement, ...) factory method that silently treated the scrollbar as a child element - Improve javadoc: document keyboard/mouse bindings, fix param docs - Replace Stream with Java 8 compatible loop for totalRequiredHeight - Add ScrollableElementTest with 13 tests covering: rendering, scroll position on key/mouse events, up/down indicators, edge cases (empty area, empty children, all content fits), preferredSize", "tokens": 113} {"id": 942220, "source": "commit", "repo": "tamboui/tamboui", "text": "build: add /format command to fix formatting on a pr directly", "tokens": 14} {"id": 942412, "source": "commit", "repo": "tamboui/tamboui", "text": "fix: Use separate thread for key events The fix in #109 only worked with the Panama backend, because setting timeout to 0 meant non-blocking. But with JLine, this just waits indefinitely. Therefore, the solution was making things worse with the JLine backend. This commit reworks the fix so that we read key events in a separate, dedicated thread. The main loop with then prioritize key events, for responsiveness, before rendering events. Therefore, if a render is slow, the key events will still be processed.", "tokens": 114} {"id": 942544, "source": "commit", "repo": "tamboui/tamboui", "text": "feat: jbang enable all the demos and readme", "tokens": 11} {"id": 942616, "source": "commit", "repo": "tcplugins/tcwebhooks", "text": "Remove WebHookCacheKey, and implement re-keying of conflicting ids", "tokens": 14} {"id": 942796, "source": "commit", "repo": "tcplugins/tcwebhooks", "text": "Return correct templateText for non-branch executions/previews.", "tokens": 15} {"id": 942994, "source": "commit", "repo": "tcplugins/tcwebhooks", "text": "tcWebHooks - Fix for builds without feature branch support silently failing to trigger webhooks. - Fix for broken link on build specific webhook page which would then complain that it could not find the project. git-svn-id: https://svn.code.sf.net/p/tcplugins/code/tcWebHooks/branches/0.9.x.x@157 1e73634f-3015-4432-a249-9c159a3a9991", "tokens": 120} {"id": 943011, "source": "commit", "repo": "tcplugins/tcwebhooks", "text": "tcWebHooks - Implemented XML and Empty payload formats - Moved most formats to inherit from generic format. - Starting to look at artifacts (not working yet) - Previous build information added (not tested yet) - Some UI changes to implement Fixed/Broken builds (not working yet) - Code changes to implement Fixed/Broken builds (not tested yet) - Removed WebHookNotificator, as it was legacy and not used. git-svn-id: https://svn.code.sf.net/p/tcplugins/code/tcWebHooks/branches/0.8.x.x@72 1e73634f-3015-4432-a249-9c159a3a9991", "tokens": 167} {"id": 943058, "source": "commit", "repo": "teamgalacticraft/galacticraft", "text": "feat: rotated banner patterns (#556) * feat: add rotated versions of the creeper, thing and skull banner patterns * feat: add rotated versions of the flow, flower, globe, guster and piglin banner patterns * chore: rename rotated banner patterns to sideways banner patterns Also use the normalizeName method to generate banner pattern translations for each color * feat: add sideways version of the rocket banner pattern * feat: add sideways version of the rocket banner pattern Part 2 * feat: add extra 2 rotations of the rocket banner pattern and change to using sinister/inverted names", "tokens": 131} {"id": 943085, "source": "commit", "repo": "teamgalacticraft/galacticraft", "text": "feat: falling meteors (#514) * feat: add falling meteor * fix: spawn meteor particles only on client side * feat: add meteor falling * feat: clean up some stuff * chore: spotless * feat: move meteor falling to server tick * fix: fix meteor throw chance, oops * feat: more of fixups * fix: reduce falling meteor client tracking range * feat: add meteor spawn multiplier * fix: assign blank loot table to falling meteor * feat: use max heat state for falling meteor entity * chore: use division directly * fix: set meteor spawn multiplier minimum value to epsilon ---------", "tokens": 137} {"id": 943124, "source": "commit", "repo": "teamgalacticraft/galacticraft", "text": "fix: prevent cakes/moon cheese wheels from being eaten while wearing a mask/in a non-breathable environment", "tokens": 36} {"id": 943430, "source": "commit", "repo": "teamgalacticraft/galacticraft", "text": "Added moon berries, fixed vines (once and for all), GUI fixes,", "tokens": 21} {"id": 943537, "source": "commit", "repo": "teammidnightdust/midnightcontrols", "text": "feat: disable analog movement based on server-ip", "tokens": 11} {"id": 943702, "source": "commit", "repo": "teammidnightdust/midnightcontrols", "text": "MidnightControls 1.5.0 - Hints, Legacy Icons, LibGUI - Add hints when controller is available, but not enabled (Closes #81) - Add optional Legacy controller icon pack (thanks @Ivanoks) - Add LibGUI compatibility - Fix #75 (Swift Sneak enchantment not working, thanks @andrewaramsay) - Fix crawling being too fast - Minify assets by @Madis0 and @RaptaG", "tokens": 102} {"id": 943735, "source": "commit", "repo": "teammidnightdust/midnightcontrols", "text": "MidnightControlsConfig: Changed some default settings to be \"safe\" in the sense that the features that can be considered \"cheating\" in multiplayer servers are now disabled by default.", "tokens": 38} {"id": 943751, "source": "commit", "repo": "teammidnightdust/midnightcontrols", "text": "Add max values to axes, fixes #41.", "tokens": 14} {"id": 944160, "source": "commit", "repo": "TeamOpenSmartGlasses/AugmentOS", "text": "soniox track transcription subcription owner on transcript / translation streams", "tokens": 17} {"id": 944198, "source": "commit", "repo": "TeamOpenSmartGlasses/AugmentOS", "text": "continue work, wifi, ui, bootreceiver, connection reliability", "tokens": 14} {"id": 944420, "source": "commit", "repo": "techreborn/techreborn", "text": "Fix https://github.com/TechReborn/TechReborn/issues/2055", "tokens": 22} {"id": 944428, "source": "commit", "repo": "techreborn/techreborn", "text": "Minor fix to enchanted golden apple's centrifuge recipe", "tokens": 18} {"id": 944656, "source": "commit", "repo": "techreborn/techreborn", "text": "Revert \"Revert \"Fix bucket issues\"\" This reverts commit d5b880387a9ee152ddb687b347ac0ab490fb1af7. # Conflicts: # src/main/java/techreborn/items/tools/ItemFluidbucket.java", "tokens": 73} {"id": 945163, "source": "commit", "repo": "terraformersmc/modmenu", "text": "Update mod to Minecraft 1.21.3 (#795)", "tokens": 17} {"id": 945383, "source": "commit", "repo": "terraformersmc/modmenu", "text": "v1.8.6 - Only count non-library, root (without a parent) mods in the main menu count. (#89) * A few changes: * Change ModMenu.LIBRARY_MODS to a set from a list. * Change the mod count to only include root non-library mods. And exclude \"minecraft\". * Split the mod list counts up into root mods, children, root libraries, and their children. * Move \"(%s children\" down into the per-parent icons. * Collapse 5/5 to 5. * First draft of plurality. * Minor cleanup * Center text when filter options hidden, re-add text when filter options are shown, fix rendering bug with buttons (not related to PR), add tooltip to config button (not related to PR)", "tokens": 171} {"id": 945933, "source": "commit", "repo": "testcontainers/testcontainers-java", "text": "Ensure service/ambassador container cleanup happens at the end of test methods rather than being delayed until JVM shutdown", "tokens": 26} {"id": 946246, "source": "commit", "repo": "the3deer/android-3d-model-viewer", "text": "Create PRIVACY-POLICY.md", "tokens": 10} {"id": 946509, "source": "commit", "repo": "thealgorithms/java", "text": "Add Merge Intervals algorithm (#5516)", "tokens": 12} {"id": 946519, "source": "commit", "repo": "thealgorithms/java", "text": "refactor: `ArrayLeftRotationTest` (#5389)", "tokens": 15} {"id": 946533, "source": "commit", "repo": "thealgorithms/java", "text": "refactor: cleanup `CombSort` (#5303) refactor: cleanup CombSort", "tokens": 20} {"id": 946564, "source": "commit", "repo": "thealgorithms/java", "text": "chore: generate coverage report and upload it to codecov (#5098)", "tokens": 17} {"id": 946571, "source": "commit", "repo": "thealgorithms/java", "text": "Use explicit cast to `int` in `FractionalKnapsack` (#4971)", "tokens": 23} {"id": 947047, "source": "commit", "repo": "theholywaffle/teamspeak-3-java-api", "text": "Also edit the table explaining TS3Config in README.md", "tokens": 13} {"id": 947271, "source": "commit", "repo": "theonedev/onedev", "text": "feat: remove redundant message for pr branch comparing and display a link for quick compare.", "tokens": 18} {"id": 947602, "source": "commit", "repo": "theonedev/onedev", "text": "Adjust default system logger level to INFO instead of WARN.", "tokens": 14} {"id": 948245, "source": "commit", "repo": "thombergs/code-examples", "text": "polishing spring-cloud-contract consumer example", "tokens": 10} {"id": 948415, "source": "commit", "repo": "timtebeek/spring-security-samples", "text": "Add http command to file a leave request; update docs to use jwt().jwt", "tokens": 17} {"id": 948560, "source": "commit", "repo": "tkowalcz/tjahzi", "text": "Fix typo in README.md (#137)", "tokens": 12} {"id": 948661, "source": "commit", "repo": "tkowalcz/tjahzi", "text": "Added note about which HTTP API/URL Tjahzi calls when configured with host/port.", "tokens": 19} {"id": 948694, "source": "commit", "repo": "tkowalcz/tjahzi", "text": "FastThreadLocal only makes sens when accessed by thread we control (it needs to be a FastThreadLocalThread).", "tokens": 25} {"id": 948787, "source": "commit", "repo": "tkowalcz/tjahzi", "text": "Removed logger - not working on this for now.", "tokens": 11} {"id": 948820, "source": "commit", "repo": "tlaplus/tlaplus", "text": "Raise warning when definition or declaration appears as Record field name. Alert users when record field names clash with existing definitions or declarations in TLA+. The primary purpose is to help users understand that field names in records are strings and won't automatically reference similarly named definitions. This commit refactors the existing implementation into a dedicated linting pass over the specification. The linting pass executes after level checking, although this particular lint does not depend on level checking data. Linting can be disabled by passing the -G flag to SANY. Amends previous commits part of Github issue #1184 https://github.com/tlaplus/tlaplus/issues/1184 [Feature][TLC]", "tokens": 145} {"id": 948848, "source": "commit", "repo": "tlaplus/tlaplus", "text": "Collect and report distinct states, values, and actions during simulation into TLCGet(\"stats\"). Enabled with: -Dtlc2.tool.Simulator.extendedStatistics=true and Exact/Non-probabilistic (think expensive!!!) statistics with: -Dtlc2.tool.Simulator.extendedStatistics.naive=true [Feature][TLC]", "tokens": 76} {"id": 948888, "source": "commit", "repo": "tlaplus/tlaplus", "text": "pcalTLAGenerator.translate() mutates the PCal AST for some inputs leading to an incorrect pcal checksum. [Bug][TLC]", "tokens": 31} {"id": 949000, "source": "commit", "repo": "tlaplus/tlaplus", "text": "Update Ubuntu's package index to avoid 404s during package install. [Bug][Toolbox]", "tokens": 24} {"id": 949063, "source": "commit", "repo": "tlaplus/tlaplus", "text": "Started implementing a Decompose Proof command, attaching it to Ctl+Shift+A. Also some commenting of a couple of tlatools classes. git-svn-id: svn+ssh://svn.msr-inria.inria.fr/var/lib/svn/repository/tla/trunk/tla2-inria@29905 76a6fc44-f60b-0410-a9a8-e67b0e8fc65c", "tokens": 114} {"id": 949217, "source": "commit", "repo": "tmseidel/ai-git-bot", "text": "fix(issue #435): acknowledge opened pull requests Add a best-effort eyes reaction to newly opened pull requests across supported providers. Remove the unrelated issue-assignment acknowledgement.", "tokens": 41} {"id": 949247, "source": "commit", "repo": "tmseidel/ai-git-bot", "text": "fix(gitea): write PR workflow changes to the source repository Resolve the authoritative Gitea PR head before preparing writable workspaces so fork branches cannot write to a same-named branch in the target repository. Reject fork offer-as-pr before pushing, preserve other providers and merge-time promotion, and propagate failed writes to workflow results. Add regression coverage for fork isolation, lifecycle routing and failure reporting.", "tokens": 81} {"id": 949369, "source": "commit", "repo": "tmseidel/ai-git-bot", "text": "fix(review): include current diff in bot follow-ups", "tokens": 14} {"id": 949555, "source": "commit", "repo": "tmseidel/ai-git-bot", "text": "refactor: Updated documentation & refactored a small piece to eliminate code-duplication and a semantically incorrect call", "tokens": 22} {"id": 949738, "source": "commit", "repo": "tom5454/customplayermodels", "text": "Blockbench plugin update 0.6.6_pre2 Animation support Beta (Closes #142) Only works from Blockbench to CPM (you can't edit CPM animations yet)", "tokens": 42} {"id": 949757, "source": "commit", "repo": "tom5454/customplayermodels", "text": "CPM SVC compat 1.0.1 Fixed crash with 1.19 Forge", "tokens": 21} {"id": 949764, "source": "commit", "repo": "tom5454/customplayermodels", "text": "0.4.5a Updated translations (#252) Added: auto-save interval setting Fixed links opening the Wiki Viewer on the First Start Guide Fixed missing translations on some config tooltips Fixed crash with 1.19 forge servers Fixed screenshot not working in fabric (Closes #253) Fixed some changes not updating the editor (Closes #250) Fixed crash with animated textures Fixed scaling not working in some cases (Closes #257, #202) Published web editor and viewer source code.", "tokens": 113} {"id": 949948, "source": "commit", "repo": "tom5454/toms-storage", "text": "1.2.12 Update Closes #23 Closes #20", "tokens": 17} {"id": 949956, "source": "commit", "repo": "tom5454/toms-storage", "text": "1.2.4 Update Fixed lag with Inventory Hoppers #11", "tokens": 18} {"id": 950247, "source": "commit", "repo": "tomdodd4598/nuclearcraft", "text": "Clarified bearing tooltip info regarding connection of dynamo coils", "tokens": 16} {"id": 950268, "source": "commit", "repo": "tomdodd4598/nuclearcraft", "text": "Revert \"Update TileFissionComputerPort.java OpenComputers new methods\"", "tokens": 16} {"id": 950455, "source": "commit", "repo": "tomdodd4598/nuclearcraft", "text": "Uploaded a pt-BR.lang file", "tokens": 10} {"id": 950487, "source": "commit", "repo": "tomdodd4598/nuclearcraft", "text": "Updated to 1.7f Updated to 1.7f", "tokens": 15} {"id": 950497, "source": "commit", "repo": "tomdodd4598/nuclearcraft", "text": "Update zh_CN.lang and fix a typo I think \"itemGroup.tabNR\" should be \"itemGroup.tabNC\" . en_US.lang and others have the same problem as well.", "tokens": 45} {"id": 950790, "source": "commit", "repo": "tomsik68/mclauncher-api", "text": "We can now install a MCDownload version with libraries and JSON stuff.", "tokens": 15} {"id": 950936, "source": "commit", "repo": "tonivade/claudb", "text": "open version 1.6.0 again", "tokens": 10} {"id": 950944, "source": "commit", "repo": "tonivade/claudb", "text": "working on #30, fixed the input stream error, working now in command parser", "tokens": 18} {"id": 951188, "source": "commit", "repo": "tonivade/purefun", "text": "Enhance Finisher with new methods for matching and collection transformations", "tokens": 13} {"id": 951195, "source": "commit", "repo": "tonivade/purefun", "text": "Add dropWhile and takeWhile methods to ImmutableArray and ImmutableList", "tokens": 13} {"id": 951995, "source": "commit", "repo": "toon-format/toon-java", "text": "Refactor ObjectEncoder and Flatter Classes, for better maintainability after the spec 2.0.1 update with key-folding (#57) * Simplification of the Flatten Class * Simplification of the Object Encoder without the mutation of the siblings list. use an extra list for the keys that had been flattened before in a blockedKey * move to flatten methode for key folding out of the encodeKeyValuePair methode * clean up the ObjectEncoder * adding test for ObjectEncoder * remove out-comment code * adding test to enhance test coverage * adding message in changelog", "tokens": 122} {"id": 952001, "source": "commit", "repo": "toon-format/toon-java", "text": "chore: update changelog version to 0.1.3", "tokens": 13} {"id": 952306, "source": "commit", "repo": "tootallnate/java-websocket", "text": "TooTallNate#171 fix 100% CPU issue", "tokens": 19} {"id": 952336, "source": "commit", "repo": "tootallnate/java-websocket", "text": "Removing toLowerCase Is there a reason all of the header fields are being lower cased? This actually caused requests I was making to a server I don't have control over to fail.", "tokens": 39} {"id": 952572, "source": "commit", "repo": "tordanik/osm2world", "text": "Support step_count for multi-segment ways", "tokens": 10} {"id": 952631, "source": "commit", "repo": "tordanik/osm2world", "text": "Prevent exceptions when attempting to log stats for failed runs", "tokens": 11} {"id": 952915, "source": "commit", "repo": "tordanik/osm2world", "text": "triangulate surface areas only once", "tokens": 10} {"id": 952999, "source": "commit", "repo": "tordanik/osm2world", "text": "bugfix related to orthographic tile boundaries in POVRay", "tokens": 11} {"id": 953033, "source": "commit", "repo": "torquebox/jruby-maven-plugins", "text": "fix 'file does not exists' typo in tests and RSpecMojo", "tokens": 15} {"id": 953039, "source": "commit", "repo": "torquebox/jruby-maven-plugins", "text": "fix initialize IT by using old rake version", "tokens": 11} {"id": 953144, "source": "commit", "repo": "torquebox/jruby-maven-plugins", "text": "move rspec to use common test code from runit", "tokens": 12} {"id": 953556, "source": "commit", "repo": "tr7zw/item-nbt-api", "text": "Bump to 2.6.0-SNAPSHOT", "tokens": 11} {"id": 953567, "source": "commit", "repo": "tr7zw/item-nbt-api", "text": "Bump to 2.5.0-SNAPSHOT since the API will change compared to 2.4.1", "tokens": 24} {"id": 954194, "source": "commit", "repo": "trekawek/coffee-gb", "text": "Fix Android ROM switching persistence Preserve the Android persistence store across profile reloads and resets, release menu-owned pauses when replacing a session, and automatically accept managed autosave resumes. Add device and controller regressions plus release-state reflection verification.", "tokens": 54} {"id": 954474, "source": "commit", "repo": "trekawek/coffee-gb", "text": "Add built-in webcam capture for the Game Boy Camera (#60) The Pocket Camera sensor could only read from an image file kept fresh by an external command (ffmpeg). This adds a real webcam feed with no external tooling, via the sarxos webcam-capture library. - core: a small CameraSource interface (getFrame -> BufferedImage) that the front end registers on PocketCamera; the camera prefers it over the image file, then the file, then the synthetic test pattern. The core stays free of any capture dependency. The frame scale/luminance step is factored into a shared toLuma() helper. - swing: WebcamCameraSource opens the default webcam in async mode (a cheap non-blocking getImage() per capture), picking the smallest supported resolution that still covers the 128x112 sensor. A \"Use webcam as camera\" toggle in the Game menu wires it in and closes it again; if no webcam opens it reports the error and unchecks. Verified end to end: with a synthetic CameraSource the Game Boy Camera's SHOOT viewfinder renders the live frame dithered in camera style. Refs #60 Claude-Session: https://claude.ai/code/session_01J1wLWscyUGS7CFwc3CjJR8", "tokens": 286} {"id": 954499, "source": "commit", "repo": "trekawek/coffee-gb", "text": "Guard the mealybug scores in CI with per-test baselines MealybugRomTest now asserts each test's diff-pixel count against its known baseline instead of requiring an exact match: the pixel-perfect tests (m2_win_en_toggle, m3_obp0_change, m3_scx_low_3_bits) are locked at 0 and the rest cannot regress silently. The profile joins the CI workflow; when accuracy work improves a score, the baseline should be tightened in the same commit. Claude-Session: https://claude.ai/code/session_01J1wLWscyUGS7CFwc3CjJR8", "tokens": 156} {"id": 954560, "source": "commit", "repo": "trekawek/coffee-gb", "text": "New options in the menu: scale, grayscale, reset, GB type.", "tokens": 18} {"id": 954568, "source": "commit", "repo": "trekawek/coffee-gb", "text": "Improve the serial endpoint emulation. Data is now transffered byte-by-byte. The clock mode (external/internal) and clock speed it respected. This fixed Tetris game. Before this commit, the serial interrupt was constantly triggered, which made it impossible to start the game.", "tokens": 65} {"id": 954601, "source": "commit", "repo": "trekawek/coffee-gb", "text": "Don't wait for the first freqDivider in sound modes.", "tokens": 14} {"id": 954784, "source": "commit", "repo": "triumphteam/triumph-gui", "text": "Caching reflection methods for ItemNBT for performance", "tokens": 10} {"id": 954822, "source": "commit", "repo": "triumphteam/triumph-gui", "text": "Small code clean up, release 1.0", "tokens": 11} {"id": 955101, "source": "commit", "repo": "tryghost/ghost-android", "text": "Structural changes to better support translation. - Untranslatable strings now live in a separate file, dont_translate.xml - Login-related strings are now in strings.xml - Add a small utility function for testing a specific locale", "tokens": 47} {"id": 955500, "source": "commit", "repo": "tsantalis/refactoringminer", "text": "ASTDiff: Update test results related to java docs (empty return tags)", "tokens": 16} {"id": 955736, "source": "commit", "repo": "tsantalis/refactoringminer", "text": "Excluding classes generated using FreeMarker template, such as the classes found in commit https://github.com/apache/drill/commit/b2bbd9941be6b132a83d27c0ae02c935e1dec5dd", "tokens": 64} {"id": 955774, "source": "commit", "repo": "ttdyce/nhentai-nhviewer", "text": "Call RefreshCookieActivity on start as manual mode", "tokens": 10} {"id": 955846, "source": "commit", "repo": "ttdyce/nhentai-nhviewer", "text": "Add disable splash screen & disable check for update in setting options", "tokens": 14} {"id": 956050, "source": "commit", "repo": "turkraft/spring-filter", "text": "Need your support to improve this cool project!", "tokens": 10} {"id": 956521, "source": "commit", "repo": "twilio/twilio-java", "text": "[Librarian] Regenerated @ fd9f0e2297602a7e027807ed01d1a6daa364f79f", "tokens": 48} {"id": 956962, "source": "commit", "repo": "twilio/video-quickstart-android", "text": "Video Android 5.7.0 (#523)", "tokens": 14} {"id": 957030, "source": "commit", "repo": "twilio/video-quickstart-android", "text": "Validate builds with circle ci (#339)", "tokens": 11} {"id": 957055, "source": "commit", "repo": "twilio/video-quickstart-android", "text": "2.0.0-preview7 Updates (#219) * Update to 2.0.0-preview7 * Update javadoc link", "tokens": 32} {"id": 957065, "source": "commit", "repo": "twilio/video-quickstart-android", "text": "Update primary video view to wrap content (#201) * Update primary video view to wrap content * Update video invite module to use wrap content for primary video", "tokens": 33} {"id": 957086, "source": "commit", "repo": "twilio/video-quickstart-android", "text": "Add note about the 2.0 branch", "tokens": 10} {"id": 957510, "source": "commit", "repo": "twiliodeved/api-snippets", "text": "remove guava list usage from 8.x snippets", "tokens": 11} {"id": 957522, "source": "commit", "repo": "twiliodeved/api-snippets", "text": "Update send_sms.5.x.php", "tokens": 11} {"id": 957826, "source": "commit", "repo": "twiliodeved/api-snippets", "text": "Updating code snippets that contain access manager dependency for video", "tokens": 11} {"id": 957976, "source": "commit", "repo": "twitch4j/twitch4j", "text": "docs: update readme with new modules, fix badges (#965) * docs: fix badges, add eventsub and cache-api to module list * docs: update readme module list ---------", "tokens": 40} {"id": 958033, "source": "commit", "repo": "twitch4j/twitch4j", "text": "feat: add unofficial shoutout pubsub topic (#660)", "tokens": 17} {"id": 958038, "source": "commit", "repo": "twitch4j/twitch4j", "text": "chore: deprecate hosts due to twitch announcement (#642)", "tokens": 16} {"id": 958086, "source": "commit", "repo": "twitch4j/twitch4j", "text": "feat: add chat event for single message deletion (#470)", "tokens": 15} {"id": 958150, "source": "commit", "repo": "twitch4j/twitch4j", "text": "docs: add cheermotes and codes markdown docs (#212) * docs: add cheermotes and codes markdown docs * docs: fix cheermotes and codes markdown docs", "tokens": 44} {"id": 958743, "source": "commit", "repo": "typemeta/funcj", "text": "Codec for Map.", "tokens": 10} {"id": 958851, "source": "commit", "repo": "uber-archive/phabricator-jenkins-plugin", "text": "Make sure lint results follow phab api specs (#191) * Make sure lint results follow phab api specs * Clean up a bit * Add test * Fix and clean up tests * Make description optional as well", "tokens": 45} {"id": 959133, "source": "commit", "repo": "uber/nullaway", "text": "Defensively thread path into NestedTypeVarSubstitutionRepairVisitor (#1683) This addresses step 2 of https://github.com/uber/NullAway/issues/1680#issuecomment-5219151033 ## Summary by CodeRabbit * **Bug Fixes** * Improved nullability analysis for generic method invocations, including nested type arguments. * Ensured analysis uses the correct source location when repairing nested nullability information. * Improved consistency of argument type checking in generic method calls. ", "tokens": 140} {"id": 959152, "source": "commit", "repo": "uber/nullaway", "text": "Add support for filtering null objects from streams (#1597) Fixes #1578 Fixes #1594 Now, if we have a `Stream<@Nullable Foo>` `s` and the code invokes `s.filter(Objects::nonNull)`, the result type is `Stream`. This works for any method that has an appropriate library model or any method annotated `@Contract(null -> false)`. This PR does not handle lambdas, e.g., `s.filter(x -> x != null)`; we can add such support in a follow-up if it comes up often. Main support is in `StreamNullabilityPropagator.onOverrideMethodType`. To identify filtering methods, we add a new `Handler` method `isSingleArgNullImpliesFalseMethod` and implement in `LibraryModelsHandler` and `ContractHandler`. ## Summary by CodeRabbit * **New Features** * Stream filter operations now refine element nullability when using null-rejecting predicates (including contract- or library-model-backed predicates). * Call-site invocation context is now propagated to nullability handlers, enabling more precise, site-aware inference and special-case detection of single-arg null->false methods. * **Tests** * Added tests validating stream filter refinement, contract-based and library-model predicates, custom predicates, and non-refining filters. ", "tokens": 323} {"id": 959290, "source": "commit", "repo": "uber/nullaway", "text": "Bug fixes for array subtyping at returns / parameter passing (#980) In certain places we were bailing out for types without type arguments, but those bailouts are wrong now that we check array subtyping. Also, for identifiers, we now get the type from the `Symbol` which is more reliable.", "tokens": 69} {"id": 959335, "source": "commit", "repo": "uber/nullaway", "text": "Fix compatibility issue when building on JDK 17 but running on JDK 8 (#779) Error Prone ran into a similar issue in https://github.com/google/error-prone/issues/3895. We re-use the same fix, and also add a CI job to test this case. We could avoid this problem by only building releases on JDK 11, but might as well fix to avoid that requirement.", "tokens": 93} {"id": 959371, "source": "commit", "repo": "uber/nullaway", "text": "Generalize support for castToNonNull methods, using library models (#614) This allows for `castToNonNull` methods taking additional arguments, such as a custom message or a specific logger object to be monitored, in order to detect and warn about values known statically to be non-null flowing into them, and also for special treatment during initialization. See #594 for more details. Since these more complex `castToNonNull` method definitions require custom library models, we still should support the basic identity `castToNonNull` configuration through `-XepOpt:NullAway:CastToNonNullMethod`, simply for ease of use. Also, please note that NullAway can't use the more complex `castToNonNull` method signatures for automated suppressions, since doing so would require being able to synthesize their non-casted arguments. In the future, we could detect the single-argument `castToNonNull` equivalently whether it is added by the CLI flag or via a library model, but, for now, the mechanisms are disjoint and the library models are only really taken into account for our `checkCastToNonNullTakesNullable` check. Using casts as fix suggestions _requires_ passing the CLI flag. A good portion of this diff is library models and handler plumbing.", "tokens": 266} {"id": 959742, "source": "commit", "repo": "uber/rides-android-sdk", "text": "[Gradle Release Plugin] - new version commit: 'v0.8.1-SNAPSHOT'.", "tokens": 22} {"id": 959744, "source": "commit", "repo": "uber/rides-android-sdk", "text": "Fixed auth code flow bug, added more tests, better docs", "tokens": 13} {"id": 959868, "source": "commit", "repo": "ulisesbocchio/jasypt-spring-boot", "text": "Enhance GitHub Actions for PR support and concurrency Updated GitHub Actions workflow to support pull requests and improved concurrency handling. Added PR-safe checkout steps and adjusted conditions for artifact checkout.", "tokens": 35} {"id": 959979, "source": "commit", "repo": "ulisesbocchio/jasypt-spring-boot", "text": "Add OpenJDK version 11 to travis Travis tests should be run with the current JAVA LTS version.", "tokens": 22} {"id": 959998, "source": "commit", "repo": "ulisesbocchio/jasypt-spring-boot", "text": "Bootstrapping Jasypt for spring-cloud environments. Spring cloud defines a **[Bootstrap phase](http://cloud.spring.io/spring-cloud-static/spring-cloud.html#_the_bootstrap_application_context)** wherein it creates a context from configurations in boostrap.properties (or .yml) files. However it fails if Jasypt is used to decrypt encrypted text in boostrap.properties.

Consider the following scenario where the [config-server itself is bootstrapped](https://cloud.spring.io/spring-cloud-config/multi/multi__embedding_the_config_server.html) - so that the config-server is trying to pull configurations from config-repo during the bootstrap phase. However the password for config-repo is encrypted with Jasypt, but Jasypt decrypts the properties at a later stage only (after boostrap phase). ``` spring.cloud.config.server.bootstrap=true spring.application.name=config-server spring.cloud.config.server.git.uri=https://bitbucket.org/fahim-experiment/config-repo spring.cloud.config.server.git.username=myusername@somewhere.com spring.cloud.config.server.git.password=ENC(GarNzpLDDoIJ3Y5lDabAllQuV74tNFbj) jasypt.encryptor.algorithm=PBEWithMD5AndDES jasypt.encryptor.password=passphrase ``` As a solution, Jasypt can be bootstrapped in a spring-cloud based application, so that encrypted text will have decrypted by the time config-server is trying to pull from config-repo. PoC to replicate the issue [here](https://github.com/fahimfarookme/jasypt-bootstrap-issue/tree/master/issue) and the solution [here](https://github.com/fahimfarookme/jasypt-bootstrap-issue/tree/master/fix).", "tokens": 436} {"id": 960011, "source": "commit", "repo": "ulisesbocchio/jasypt-spring-boot", "text": "Feature/resolver (#39) * resolver and detector", "tokens": 12} {"id": 960033, "source": "commit", "repo": "ulisesbocchio/jasypt-spring-boot", "text": "Replace StringEnctyptor Initialization code by name to avoid instantiation of FactoryBean beans", "tokens": 18} {"id": 960049, "source": "commit", "repo": "ulisesbocchio/jasypt-spring-boot", "text": "EncryptablePropertySource as a way of importing unique encryptable sources", "tokens": 13} {"id": 960055, "source": "commit", "repo": "ulisesbocchio/jasypt-spring-boot", "text": "comments around differences between jasypt-spring-boot and jasypt-spring-boot-starter", "tokens": 20} {"id": 960172, "source": "commit", "repo": "umple/umple", "text": "Update to TXL files in build DIR", "tokens": 11} {"id": 960319, "source": "commit", "repo": "umple/umple", "text": "event names associated to autotransitions should not be distinct", "tokens": 12} {"id": 960368, "source": "commit", "repo": "umple/umple", "text": "Added line number support for active object multilingual code snippets git-svn-id: http://umple.googlecode.com/svn/trunk@4702 6ebf9d09-8eb1-0036-9d08-68c07d1b990a", "tokens": 69} {"id": 960371, "source": "commit", "repo": "umple/umple", "text": "Reverting r4610 since generated files and test files were missing git-svn-id: http://umple.googlecode.com/svn/trunk@4611 6ebf9d09-8eb1-0036-9d08-68c07d1b990a", "tokens": 72} {"id": 960630, "source": "commit", "repo": "unnamed/creative", "text": "feat(serializer-minecraft): allow lenient reader", "tokens": 10} {"id": 960767, "source": "commit", "repo": "unnamed/creative", "text": "feat(central): support more export types, clean up code", "tokens": 13} {"id": 960868, "source": "commit", "repo": "unnamed/creative", "text": "docs: add more documentation and example resource pack skeleton", "tokens": 11} {"id": 960976, "source": "commit", "repo": "unnamed/creative", "text": "feat: add BlockModel properties, extract common parts from block and item models (specifically, the elements)", "tokens": 23} {"id": 961089, "source": "commit", "repo": "unnamed/hephaestus-engine", "text": "refactor!(api): make ModelReader#read not throw IOException", "tokens": 14} {"id": 961277, "source": "commit", "repo": "unnamed/hephaestus-engine", "text": "tests: add test display name, add helper methods and classes to reduce boilerplate code", "tokens": 17} {"id": 961282, "source": "commit", "repo": "unnamed/hephaestus-engine", "text": "docs(readme): add installation section, add gradle section", "tokens": 12} {"id": 961318, "source": "commit", "repo": "unnamed/hephaestus-engine", "text": "tests: add BBModelReaderTest (wip)", "tokens": 13} {"id": 961524, "source": "commit", "repo": "unnamed/hephaestus-engine", "text": "gradle: upgrade to 7.0.2", "tokens": 11} {"id": 962166, "source": "commit", "repo": "valentinacupac/banking-kata-java", "text": "#74 REST API - Contract Testing - Provider tests", "tokens": 14} {"id": 962445, "source": "commit", "repo": "validator/validator", "text": "fix(svg): Allow \u201crect\u201d without \u201cwidth\u201d or \u201cheight\u201d Fixes https://github.com/validator/validator/issues/1988", "tokens": 34} {"id": 962453, "source": "commit", "repo": "validator/validator", "text": "feat: Allow Make dirname on hidden/tel/url/email/password/submit inputs Fixes https://github.com/validator/validator/issues/1613", "tokens": 37} {"id": 962490, "source": "commit", "repo": "validator/validator", "text": "build.py: pass javaTargetVersion to ant builds", "tokens": 13} {"id": 962528, "source": "commit", "repo": "validator/validator", "text": "Docker: Image moved to https://ghcr.io/validator/validator The Docker image is now published in the GitHub container registry at https://ghcr.io/validator/validator The image is no longer available from Docker Hub.", "tokens": 47} {"id": 962564, "source": "commit", "repo": "validator/validator", "text": "AppVeyor: Build with Nu Html Checker web UI", "tokens": 15} {"id": 962664, "source": "commit", "repo": "validator/validator", "text": "Update links to HTML Standard in error messages. Use multipage version for SPEC_LINK_URI because one-page version can freeze browsers PR: https://github.com/validator/validator/pull/273", "tokens": 47} {"id": 962845, "source": "commit", "repo": "validator/validator", "text": "made message emitter handle required-but-missing attribute reporting I forgot to commit this after I made the related jing changes. --HG-- extra : convert_revision : svn%3Ac6dcca6c-c432-0410-a79e-3fbb6554aff1/trunk%40366", "tokens": 79} {"id": 962930, "source": "commit", "repo": "valterc/ki2", "text": "Add graphical datatypes (#282) * Work on graphical datatypes * Work on visual data types * Optimized rendered datatype * Improved data type views * Improved views * Karoo ext nonsense * format code", "tokens": 48} {"id": 962999, "source": "commit", "repo": "valterc/ki2", "text": "Fix device election (#143)", "tokens": 10} {"id": 963406, "source": "commit", "repo": "vectorwing/farmersdelight", "text": "Add `forge:tools/shields` to `offhand_equipment`", "tokens": 16} {"id": 963499, "source": "commit", "repo": "vectorwing/farmersdelight", "text": "Add form field for confirming if it's Forge", "tokens": 12} {"id": 963678, "source": "commit", "repo": "vectorwing/farmersdelight", "text": "Make Wild Crops proliferate when bone-mealed", "tokens": 16} {"id": 964504, "source": "commit", "repo": "vimasig/bozar", "text": "Better pom.xml & Java 16", "tokens": 10} {"id": 964758, "source": "commit", "repo": "vincenzopalazzo/material-ui-swing", "text": "Released first version of code with an goo solution for TabbedPane style", "tokens": 16} {"id": 964788, "source": "commit", "repo": "vincenzopalazzo/material-ui-swing", "text": "Fixed but into JButton and JSpinner button I change the father MaterialButtonUI from MetalButtonUI to BasicButtonUI", "tokens": 26} {"id": 964841, "source": "commit", "repo": "vincenzopalazzo/material-ui-swing", "text": "Added new fix another problem - Issue fixed https://github.com/atarw/material-ui-swing/issues/73 - issue fixed https://github.com/atarw/material-ui-swing/issues/77 - fixed error print the graphics in some component - Create a component MaterialManagerListner for manager a listener for not duplicate code", "tokens": 77} {"id": 965072, "source": "commit", "repo": "virtuslab/git-machete-intellij-plugin", "text": "Update Gradle wrapper to 7.6 (#1355)", "tokens": 15} {"id": 965115, "source": "commit", "repo": "virtuslab/git-machete-intellij-plugin", "text": "gh instead of hub (#1179) * migrate hub to gh", "tokens": 16} {"id": 965347, "source": "commit", "repo": "virtuslab/git-machete-intellij-plugin", "text": "[frontendGraph] Extract frontendGraphApi module from frontendGraphImpl", "tokens": 14} {"id": 965957, "source": "commit", "repo": "vkcom/vk-java-sdk", "text": "Fix Log4j RCE vulnerability (#249)", "tokens": 14} {"id": 966034, "source": "commit", "repo": "vkcom/vk-java-sdk", "text": "Add 'getChatPreview' method to 'messages'", "tokens": 11} {"id": 966356, "source": "commit", "repo": "vmware/vsphere-automation-sdk-java", "text": "Update DRaaS bindings. (#155) * Update DRaaS bindings. * Remove empty profile.", "tokens": 26} {"id": 966434, "source": "commit", "repo": "vmware/vsphere-automation-sdk-java", "text": "Updating latest java vmc-draas bindings (31a5cdc)", "tokens": 18} {"id": 966443, "source": "commit", "repo": "vmware/vsphere-automation-sdk-java", "text": "Updating latest java vmc bindings (36342e0)", "tokens": 16} {"id": 966562, "source": "commit", "repo": "vojtechhabarta/typescript-generator", "text": "Remove support for Jackson version 1 (#884)", "tokens": 13} {"id": 966615, "source": "commit", "repo": "vojtechhabarta/typescript-generator", "text": "Support for default values of class properties (#578)", "tokens": 13} {"id": 966638, "source": "commit", "repo": "vojtechhabarta/typescript-generator", "text": "Mappings for Jackson2 serializers and deserializers on properties (#498) - `serializerTypeMappings` and `deserializerTypeMappings` parameters", "tokens": 32} {"id": 966852, "source": "commit", "repo": "vojtechhabarta/typescript-generator", "text": "fast-classpath-scanner updated to 2.0.17 (refs #128)", "tokens": 22} {"id": 967138, "source": "commit", "repo": "w3stling/rssreader", "text": "Add mapping for the xml:lang attribute in Atom feeds (#281)", "tokens": 18} {"id": 967455, "source": "commit", "repo": "waffle/waffle", "text": "[pom] Bump copyright date in pom to 2021", "tokens": 15} {"id": 968121, "source": "commit", "repo": "warmuuh/milkman", "text": "fixed invalidation bug for var highlighting. fixed popup behavior", "tokens": 11} {"id": 968328, "source": "commit", "repo": "WeaponMechanics/WeaponMechanics", "text": "feat: fire projectiles and scope/flying hotfix (#608) * Feature: add incendiary projectile support + small fix in ScopeHandler Two new configurations: - Incendiary_Projectile, set's projectiles ablaze - Extinguish_In_Water, extinguishes projectiles on contact with water Fixed: - when players scope, their flying speed was doubled * Make command registration idempotent This makes WeaponMechanicsCommand.registerCommands() safe to call more than once by guarding registration with an AtomicBoolean * Make command registration idempotent This makes WeaponMechanicsCommand.registerCommands() safe to call more than once by guarding registration with an AtomicBoolean * revert: wm command boolean; this is now handled by MechanicsPlugin ---------", "tokens": 157} {"id": 968424, "source": "commit", "repo": "WeaponMechanics/WeaponMechanics", "text": "add placeholders to mechanics (for commands)", "tokens": 10} {"id": 968578, "source": "commit", "repo": "WeaponMechanics/WeaponMechanics", "text": "Permissions to use guns (+messages)", "tokens": 12} {"id": 968652, "source": "commit", "repo": "WeaponMechanics/WeaponMechanics", "text": "(Needs testing) Added custom name and gravity to metadata packet.", "tokens": 14} {"id": 968719, "source": "commit", "repo": "WeaponMechanics/WeaponMechanics", "text": "Bit of refactoring so packet listener classes end in ``Listener`` and normal event classes to ``Listeners``", "tokens": 25} {"id": 968893, "source": "commit", "repo": "webcompere/system-stubs", "text": "Add syntax highlighting to Readme.md Improve readability.", "tokens": 11} {"id": 969418, "source": "commit", "repo": "weisj/darklaf", "text": "Ensure default buttons don't get lost after theme change. Ensure sliders are properly layed out after theme change. Ensure title pane foreground color is correct after theme change.", "tokens": 37} {"id": 969827, "source": "commit", "repo": "weisj/jsvg", "text": "Show a missing image icon if image could not be loaded Resolves #2", "tokens": 15} {"id": 970323, "source": "commit", "repo": "weliem/blessed-android", "text": "Make sure getPeripheral never returns null anymore", "tokens": 10} {"id": 970531, "source": "commit", "repo": "wesjd/anvilgui", "text": "Fix XP issue for 1.17.1", "tokens": 13} {"id": 970535, "source": "commit", "repo": "wesjd/anvilgui", "text": "[skipci] add relocation information to the readme", "tokens": 11} {"id": 970608, "source": "commit", "repo": "wesjd/anvilgui", "text": "bump all versions for changes to the abstraction package", "tokens": 10} {"id": 970742, "source": "commit", "repo": "whirvis/jraknet", "text": "Switched from SLF4J to Log4J2", "tokens": 11} {"id": 970835, "source": "commit", "repo": "whirvis/jraknet", "text": "Fixed \"HEAD\", \"ORIGIN\" mixup", "tokens": 10} {"id": 970894, "source": "commit", "repo": "whirvis/jraknet", "text": "Updated some javadocs The custom map classes didn't have any documentation for them, so I made some (mostly copying the Java HashMap docs with minor changes) and redeployed version 2.6.3 with those docs since no code was changed. Don't worry if your maven plugin doesn't update the jars for 2.6.3, as no actual code was changed except for some documentation.", "tokens": 86} {"id": 970900, "source": "commit", "repo": "whirvis/jraknet", "text": "Major JavaDoc overhaul I didn't like how the JavaDocs for JRakNet didn't correspond with the Java JavaDoc format, so I manually rewrote every JavaDoc declaration and tried to make them as close to the standard as possible. Some actual implementation was probably modified but I can't remember anything off the top of my head.", "tokens": 68} {"id": 970991, "source": "commit", "repo": "whirvis/jraknet", "text": "Got login working, however there are many bugs I managed to get login working however there are still many bugs in the RakNetSession, they seem to be with ACK, NACK, and resending times. I will receive two packets then from then on nothing else finishes, it all just breaks from there. I must figure out what is wrong before I can continue with protocol implementation.", "tokens": 78} {"id": 971191, "source": "commit", "repo": "wildmountainfarms/solarthing", "text": "Added action-node module, refactor many imports to new package", "tokens": 13} {"id": 971421, "source": "commit", "repo": "wildmountainfarms/solarthing", "text": "SolarMain no longer imports any gson, added @JsonExplicit annotation", "tokens": 15} {"id": 971737, "source": "commit", "repo": "williamfiset/algorithms", "text": "Update KnapsackUnbounded.java", "tokens": 10} {"id": 971915, "source": "commit", "repo": "willowtreeapps/hyperion-android", "text": "Bump version to 0.9.28.", "tokens": 12} {"id": 972036, "source": "commit", "repo": "willowtreeapps/hyperion-android", "text": "Allows host app to wrap and delegate to plugins", "tokens": 10} {"id": 972653, "source": "commit", "repo": "wisp-forest/owo-lib", "text": "[ui] allow specifying percentage of remaining space a given SpacerComponent should expand into", "tokens": 18} {"id": 972674, "source": "commit", "repo": "wisp-forest/owo-lib", "text": "[endec] quote field names in deserializer error messages", "tokens": 12} {"id": 972728, "source": "commit", "repo": "wisp-forest/owo-lib", "text": "[ui] implement data-driven nine patch textures, rename NinePatchRenderer to NinePatchTexture and deprecate old name for removal", "tokens": 28} {"id": 972893, "source": "commit", "repo": "wisp-forest/owo-lib", "text": "add TagInjector for adding to tags at runtime", "tokens": 10} {"id": 973145, "source": "commit", "repo": "wkgcass/vproxy", "text": "fix run-tests-in-docker script", "tokens": 10} {"id": 973309, "source": "commit", "repo": "wkgcass/vproxy", "text": "rename smart-service-delegate to smart-node-delegate", "tokens": 13} {"id": 973487, "source": "commit", "repo": "woaiys3/deepseek-harness-android-app", "text": "v1.6.5: sync dsh-patches/overlay/lib/node_modules/@deepseek-ai/dsh/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/types/invariant.d.ts", "tokens": 55} {"id": 973780, "source": "commit", "repo": "woodser/monero-java", "text": "organize todos Former-commit-id: c4aec90524db853572795289f3e9718906dfdf4d", "tokens": 47} {"id": 973923, "source": "commit", "repo": "woodser/monero-java", "text": "update readme Former-commit-id: f1544feda38d01e511e8ec4066575370f9a5c202", "tokens": 46} {"id": 973945, "source": "commit", "repo": "woodser/monero-java", "text": "get blocks by height passes again Former-commit-id: 9fe00fc194548f4b0d35a269cde897f614100184", "tokens": 51} {"id": 973980, "source": "commit", "repo": "woodser/monero-java", "text": "cleanup Former-commit-id: 927f03ba6fa4bf2d1a4fc0f487adb5f85f63b226", "tokens": 43} {"id": 974101, "source": "commit", "repo": "woowacourse/prolog", "text": "feature: change EssayAnswerList API response order", "tokens": 12} {"id": 974269, "source": "commit", "repo": "wpilibsuite/gradlerio", "text": "Fix tools classifiers (#612)", "tokens": 10} {"id": 974283, "source": "commit", "repo": "wpilibsuite/gradlerio", "text": "Upgrade to Native Utils 2022.8.2 (#586) * Upgrade to 2022.8.2 * Fix changed function names", "tokens": 36} {"id": 974324, "source": "commit", "repo": "wpilibsuite/gradlerio", "text": "Add new image versions (#458) Also add support for wildcard versions.", "tokens": 17} {"id": 974601, "source": "commit", "repo": "wpilibsuite/gradlerio", "text": "Automatically add any libraries under libs/ or modules/", "tokens": 12} {"id": 974637, "source": "commit", "repo": "wrandelshofer/fastdoubleparser", "text": "Use zulu 24-ea.", "tokens": 11} {"id": 975011, "source": "commit", "repo": "wrandelshofer/fastdoubleparser", "text": "Adds comparison to C version. Removes tip for Java VM switches.", "tokens": 14} {"id": 975225, "source": "commit", "repo": "xdagger/xdagj", "text": "update version to 0.5.2", "tokens": 10} {"id": 975294, "source": "commit", "repo": "xdagger/xdagj", "text": "update version to 0.4.7", "tokens": 10} {"id": 975681, "source": "commit", "repo": "xfl03/jmccc", "text": "bump maven gpg plugin to 1.6", "tokens": 11} {"id": 975970, "source": "commit", "repo": "xmlet/htmlflow", "text": "- Fix setIndentation for HtmlView, removing newlines of HtmlContinuationSyncStatic when indentation is false. - HtmlWithoutIndentation replace Web templates definition through lambdas by standard functions.", "tokens": 36} {"id": 976072, "source": "commit", "repo": "xmlet/htmlflow", "text": "Announce Spring-based pet clinic with HtmlFlow.", "tokens": 13} {"id": 976100, "source": "commit", "repo": "xmlet/htmlflow", "text": "Follows Miguel's recommendations", "tokens": 11} {"id": 976133, "source": "commit", "repo": "xmlet/htmlflow", "text": "Updates HtmlApiFaster to version 1.0.5.", "tokens": 15} {"id": 976461, "source": "commit", "repo": "Xujiayao/Discord-MC-Chat", "text": "Initialize CommandManager after loading configurations and change shutdown and reload logic", "tokens": 13} {"id": 976675, "source": "commit", "repo": "xvik/dropwizard-guicey", "text": "[Gradle Release Plugin] - new version commit: '6.0.0-beta.2-SNAPSHOT'.", "tokens": 25} {"id": 976997, "source": "commit", "repo": "xxdark/ssvm", "text": "Rework SupplyingClassLoaderInstaller to allow easy chaining of multiple sources And add utils for loading from common sources", "tokens": 22} {"id": 977251, "source": "commit", "repo": "xxdark/ssvm", "text": "Allow thread manager to work with frames without execution context", "tokens": 11} {"id": 977379, "source": "commit", "repo": "yash-srivastava/Overdrive-release", "text": "feat(liveview): reduce the stream indicator to a bare dot The video stage already states what is happening, so the top-left pill repeated it. What remains is a 10dp dot with no text or container, carrying its state through aria-label. Clearing the stage on 'live' no longer depends on the indicator being present in the DOM.", "tokens": 77} {"id": 977476, "source": "commit", "repo": "yash-srivastava/Overdrive-release", "text": "feat: Enable RTL (right-to-left) support for Arabic language - Add android:supportsRtl=\"true\" to application manifest - Enables system-level RTL layout mirroring for Arabic and other RTL languages - All layout files already use RTL-safe attributes (marginStart/End, paddingStart/End) - No layout changes needed - existing UI patterns are RTL-compatible This prepares the app for complete Arabic language support alongside the existing partial translations. Professional Arabic translations for 152 missing strings can now be obtained via Crowdin and will automatically render with proper RTL text direction.", "tokens": 132} {"id": 977520, "source": "commit", "repo": "yash-srivastava/Overdrive-release", "text": "New translations en.json (Finnish) [ci skip]", "tokens": 16} {"id": 977528, "source": "commit", "repo": "yash-srivastava/Overdrive-release", "text": "New translations en.json (Russian) [ci skip]", "tokens": 13} {"id": 977538, "source": "commit", "repo": "yash-srivastava/Overdrive-release", "text": "New translations en.json (Greek) [ci skip]", "tokens": 15} {"id": 977571, "source": "commit", "repo": "yash-srivastava/Overdrive-release", "text": "Update20.7 web th.json", "tokens": 10} {"id": 977720, "source": "commit", "repo": "yegor256/cactoos", "text": "(#1169) Apply PECS for `iterable.Sorted'", "tokens": 17} {"id": 977772, "source": "commit", "repo": "yegor256/cactoos", "text": "(#1305) Remove Sorted collection decorator", "tokens": 12} {"id": 977923, "source": "commit", "repo": "yegor256/cactoos", "text": "#600 added test to show correct result of int value when handling int-overflowing long values.", "tokens": 23} {"id": 978482, "source": "commit", "repo": "yegor256/takes", "text": "#589: Make the constructors of FkHitRefresh compliant with ConstructorOnlyInitializesOrCallOtherConstructors", "tokens": 25} {"id": 978658, "source": "commit", "repo": "yegor256/takes", "text": "#67 fixed by TkText and TkHTML refactoring", "tokens": 12} {"id": 978709, "source": "commit", "repo": "yizzuide/milkomeda", "text": "refactor(atom): Move the redisson configuration to the top layer", "tokens": 14} {"id": 979029, "source": "commit", "repo": "yizzuide/milkomeda", "text": " (ice): extract handler meta data.", "tokens": 12} {"id": 979369, "source": "commit", "repo": "yuriy-budiyev/code-scanner", "text": "Fix regression (#27) Fix inverted code scan fix -__-", "tokens": 16} {"id": 979482, "source": "commit", "repo": "yworks/yguard", "text": "Update gradle.properties 3.0.0-SNAPSHOT to indicate breaking changes (license etc) and also start following the -SNAPSHOT convention.", "tokens": 30} {"id": 979484, "source": "commit", "repo": "yworks/yguard", "text": "Refactor source tree (#74) * Remove retroguard module and GPL header in all retroguard module files. * Properly use generatedSources * Use correct directory in generateSources task. * Migrate com.yworks.yguard.common to com.yworks.common * Unify Version from replace and shrink tasks. * Move logging utils from shrinker to com.yworks.logging for consolidation * Move shrink tasks to com.yworks.yshrink * Consolidate ant packages. * Consolidate ant packages. Take two. * com.yworks.util.graph is pretty important. Move it to an own package. * com.yworks.compiler is not as important. Move to utils. * Import yguard generics test cases. * Import yguard annotations testcase. * The rest of these test cases are gibberish left over from past times.", "tokens": 172} {"id": 979530, "source": "commit", "repo": "yworks/yguard", "text": "Add information about assembleBundleDist and update usage instructions for docs.", "tokens": 15} {"id": 979749, "source": "commit", "repo": "zalando/intellij-swagger", "text": "Improved OpenAPI 3 $ref auto completion This commit adds $ref value auto completion to applicable places. Fixes #213", "tokens": 26} {"id": 979788, "source": "commit", "repo": "zalando/intellij-swagger", "text": "Fixed a potential NPE in file reference Fixes #170", "tokens": 13} {"id": 980200, "source": "commit", "repo": "zalando/logbook", "text": "Development 1.12.0-SNAPSHOT", "tokens": 11} {"id": 980279, "source": "commit", "repo": "zalando/logbook", "text": "Removed runtime dependency from httpclient+servlet to core", "tokens": 11} {"id": 980356, "source": "commit", "repo": "zalando/nakadi", "text": "evict cache value only if load is successful (#1534) at the moment if value was evicted and load from database fails cache wont have a value, that will create unavailability on the publishing path. the commit changes that behaviour to have value ecivted from the cache only in case the value was successfully loaded.", "tokens": 71} {"id": 980395, "source": "commit", "repo": "zalando/nakadi", "text": "Break a long line into 2 to respect the style guide (#1271)", "tokens": 20} {"id": 980475, "source": "commit", "repo": "zalando/nakadi", "text": "Don't allow schema root object type to be array Don't allow the root object type in schema for business and data category to be of type array", "tokens": 32} {"id": 980494, "source": "commit", "repo": "zalando/nakadi", "text": "aruha-1496: disallow to post event type with null compatability mode", "tokens": 20} {"id": 980498, "source": "commit", "repo": "zalando/nakadi", "text": "ARUHA-1500: adjustments after review;", "tokens": 12} {"id": 980537, "source": "commit", "repo": "zalando/nakadi", "text": "ARUHA-882 Use batch publishing in HilaRebalanceAT", "tokens": 15} {"id": 980569, "source": "commit", "repo": "zalando/nakadi", "text": "aruha-531 fix cursor conversion and improve exception handling Several corner cases would lead to 500s. With these improvements, better error messages should be displayed with 422, to help the user figure out what is wrong with the request.", "tokens": 57} {"id": 980679, "source": "commit", "repo": "zalando/nakadi", "text": "ARUHA-344: move migration to different place", "tokens": 12} {"id": 980741, "source": "commit", "repo": "zalando/nakadi", "text": "ARUHA-202: created new exception type", "tokens": 11} {"id": 980761, "source": "commit", "repo": "zalando/nakadi", "text": "ARUHA-113 change input to array", "tokens": 10} {"id": 980827, "source": "commit", "repo": "zalando/nakadi", "text": "ARUHA-32 fix after merge from master", "tokens": 10} {"id": 980888, "source": "commit", "repo": "zalando/opentracing-toolbox", "text": "Add test case for GH-391", "tokens": 10} {"id": 980956, "source": "commit", "repo": "zalando/opentracing-toolbox", "text": "Added explicit log4j-api dependency to overrule spring bom", "tokens": 14} {"id": 981042, "source": "commit", "repo": "zalando/opentracing-toolbox", "text": "Changed ordering of wrapping Tracer should run as soon as possible", "tokens": 13} {"id": 982286, "source": "commit", "repo": "zeljkoobrenovic/sokrates", "text": "Drop the unused Lato font stylesheet link from report head", "tokens": 14} {"id": 982931, "source": "commit", "repo": "zfdang/zsmth-android", "text": "small post content modification; log exception back trace", "tokens": 10} {"id": 983213, "source": "commit", "repo": "zhouwg/kantv", "text": "ijkavformat/ijksegment: log error", "tokens": 11} {"id": 983471, "source": "commit", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "fix(webview): keep render pure and clean up effects per react-doctor - useCompletionDropdown: drop ref writes from the provider-switch render adjustment; cancel the pending debounce and in-flight search in a provider-keyed effect cleanup (also covers unmount) - MessageList: sync loadingEarlierHistoryRef from state in an effect instead of mutating it during render; convert the session-switch reset to a render-time setState adjustment and add button role/keyboard support to the collapsed-messages indicator - HistoryItemEditor: return a cleanup that clears the focus setTimeout Resolves the 4 react-doctor errors (3x no-ref-current-in-render, 1x effect-needs-cleanup).", "tokens": 151} {"id": 983529, "source": "commit", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "fix(streaming): let in-flight message frames reach the webview instead of starving them Streaming tool_use / tool_result blocks intermittently failed to render during active streaming, with text appending to the wrong assistant message; both symptoms recovered after the turn ended. Root cause: StreamMessageCoalescer dropped every frame whose sequence differed from the latest updateSequence. Because schedulePush bumps updateSequence on every dispatch and JSON serialization runs off-EDT, any enqueue arriving during the serialization window made the in-flight frame look stale, so updateMessages frames were discarded one after another during dense streaming. Structural blocks only travel via updateMessages, while text deltas (onContentDelta) keep flowing unthrottled and carry no segment routing, so the frontend appended them to whichever assistant it last knew about. Only the onStreamEnd flush escaped the drop, which is why everything looked correct again once the turn finished. Fix: order frames against the highest sequence actually pushed, not against updateSequence. A frame whose sequence is >= the last pushed one carries a monotonic superset of what the webview already shows, so pushing it is always forward progress; only genuinely out-of-order frames (a late invokeLater landing after a newer push) are dropped. This matches the frontend __minAcceptedUpdateSequence guard, which already applies the same rule on its side. Also unblock tail transport on long conversations: lastDeliveredSnapshot was gated on pushSequence == updateSequence, a condition that almost never held while newer data stayed queued, so the tail prefix baseline froze, tail updates never engaged, and every push kept paying full- payload serialization cost. Now updated unconditionally on every successful push. Finally mark ClaudeSession.Message.content / raw volatile: the streaming handler reassigns them on every assistant update while the coalescer serializes the same Message off-EDT (enqueue only shallow-copies the list), so without volatile the serializer could publish a snapshot predating a just-reassigned tool_use block.", "tokens": 432} {"id": 983782, "source": "commit", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "feat(status-panel): change file click behavior and restore diff icon - File name click now opens file directly in IDEA instead of showing diff view - Add dedicated diff icon button next to undo button for comparing changes - Improve user experience by separating file opening and diff viewing actions", "tokens": 56} {"id": 983805, "source": "commit", "repo": "zhukunpenglinyutong/jetbrains-cc-gui", "text": "refactor: improve action classes thread safety and input validation - Use InputValidatorEx in RenameTabAction to provide detailed error messages - Add getActionUpdateThread() method to all Action classes for thread safety - Add JavaDoc comment explaining MAX_TAB_NAME_LENGTH constant - Ensure consistent implementation across all Action classes", "tokens": 61} {"id": 984032, "source": "commit", "repo": "zmilla93/slimtrade", "text": "fixed text areas not appearing on chat scanner for certain themes", "tokens": 15} {"id": 984362, "source": "commit", "repo": "znsio/teswiz", "text": "Update README with latest commit ID - 9abfc5b581", "tokens": 17} {"id": 984532, "source": "commit", "repo": "znsio/teswiz", "text": "fixed config file name for android tests in BrowserStack Github action workflow", "tokens": 14} {"id": 984729, "source": "commit", "repo": "znsio/teswiz", "text": "terminate / close the app on the device after test execution completes", "tokens": 13} {"id": 984831, "source": "commit", "repo": "zpeanut/hydrogen", "text": "remove dropshadow setting, make minecraft font default for hud", "tokens": 12} {"id": 984882, "source": "commit", "repo": "zpeanut/hydrogen", "text": "update build.gradle to 1.9.1", "tokens": 12} {"id": 984956, "source": "commit", "repo": "zpeanut/hydrogen", "text": "add future esp modes, add suffix settings to modules (incomplete)", "tokens": 16} {"id": 985441, "source": "review", "repo": "AugmentOS-Community/AugmentOS", "text": "Agreed. The default scheme handler could target another installed build. I removed this unqualified standalone helper; the attended operator integration uses the existing verified original-PID/lifetime native URL carrier under the selected app reservation. No bundle-name-only targeting or alternative launcher was added.", "tokens": 58} {"id": 985505, "source": "review", "repo": "Azure-Samples/azure-search-openai-demo-java", "text": "I guess you are still working on this as there are some missing logic like extracting the search keywords from the conversation + use the right semantic function for the chat UI.", "tokens": 34} {"id": 985559, "source": "review", "repo": "Breus/json-masker", "text": "I think this method of matching uses byte trie a bit less efficient, for example if we have json path `$.json.path.key` and we're inside ``` { \"json\": { \"path\": { \"key1\": \"do not mask\", \"key2\": \"do not mask\", ... \"keyX\": \"do not mask\", \"key\": \"mask\" } } } ``` then we repeatedly match full prefix. Is it possible to store a reference to the currently matched `TrieNode` (if any) in the `MaskingState`? This is a good idea. Implementation-wise, I cannot backtrack the current node reference as the child nodes do not have a reference to a parent node. Introducing the reference to the parent node in the trie node specifically for this use case does not seem justified. Therefore, I will store the reference to the trie node on the dequeue together with the reference to the path component for all elements.", "tokens": 197} {"id": 985570, "source": "review", "repo": "Breus/json-masker", "text": "I don't know why, but this line of code looks so odd \ud83d\ude02 It is though. I will think about how to make the reference representation comprehensible. Done.", "tokens": 40} {"id": 985574, "source": "review", "repo": "Breus/json-masker", "text": "Perhaps add that in this case it might be added as an **optional** feature (it won't affect the existing API) ```suggestion 5. The `null` type (value) will remain unmasked, but we make the API extendable to be able to support that if someone requests it, providing a good reason. ```", "tokens": 69} {"id": 985592, "source": "review", "repo": "Breus/json-masker", "text": "I don't see this being used? Am I blind? Yup, removed those (along with 30 other unused imports \ud83d\ude05)", "tokens": 32} {"id": 985664, "source": "review", "repo": "Breus/json-masker", "text": "Keeping OCD [in check](https://github.com/Breus/json-masker/pull/96/files#diff-e8659d668c0ffdcb0d5d6fa250b0d23ad7e2947f9d5eb2d8575b4e2b04065179R74) \ud83d\ude05", "tokens": 95} {"id": 985715, "source": "review", "repo": "Breus/json-masker", "text": "Mapped to what? This comment confused me more than that it helped me", "tokens": 17} {"id": 985724, "source": "review", "repo": "Breus/json-masker", "text": "Woah, this looks so odd. Didn't even know this was possible in Java \ud83d\ude02 Yeah, I didn't quite get why it needs to be done like that, I tried to do it on the whole field and it said something along the lines of \"outer type can never be null for static inner class\". While it kinda makes sense to apply it to inner type, I also don't get how that outer type can ever be null. I always thought that these outer types are kind of a namespace for static classes, you can import such class directly if you want, but can leave it be for more clarity (I.e. `Entry` vs `Map.Entry`), I always preferred the second, but it's so ugly with these annotations there \ud83d\ude05", "tokens": 164} {"id": 985883, "source": "review", "repo": "CommandAPI/CommandAPI", "text": "We need an `of(S, String)` method for backwards compatibility Added in d2efc99", "tokens": 25} {"id": 985902, "source": "review", "repo": "CommandAPI/CommandAPI", "text": "Unnecessary new line, please revert. I have a series of diffing tools that I use to compare NMS versions and this will trip it up.", "tokens": 30} {"id": 986159, "source": "review", "repo": "CommandAPI/CommandAPI", "text": "Is this a typo? ```suggestion * Represents the Spigot platform, uses module commandapi-spigot ```", "tokens": 21} {"id": 986363, "source": "review", "repo": "CommandAPI/CommandAPI", "text": "```suggestion * @param defaultValue The String returned when no argument is found for the node name ```", "tokens": 20} {"id": 986546, "source": "review", "repo": "FallingColors/HexMod", "text": "does the visibility here need to be changed to private?", "tokens": 12} {"id": 986636, "source": "review", "repo": "FallingColors/HexMod", "text": "using Math.max() here would be more readable, i.e. `positiveBlock.setX(Math.max( herePos.getX(), positiveBlock.getX() ));` Thanks! Made it more readable now.", "tokens": 47} {"id": 986644, "source": "review", "repo": "FallingColors/HexMod", "text": "This is a breaking change. Do any addons throw this mishap? If so, there should be a fallback constructor taking no arguments. What would be displayed via the fallback constructor? No / placeholder pattern? GitHub search shows no matches except for HexMod and forks thereof, so I doubt that this would break addons. However, it is technically ABI-breaking, so some fallback would be safest. Probably just the old message?", "tokens": 90} {"id": 986678, "source": "review", "repo": "FallingColors/HexMod", "text": "Can we just get rid of this, since we don't need it as a payload anymore? Yeah, probably Removed!", "tokens": 26} {"id": 986885, "source": "review", "repo": "FallingColors/HexMod", "text": "If we expect pigment to never be null now, we should remove the `@Nullable` annotation here. It would even be worth considering adding a `@NotNull` instead, just to highlight the change.", "tokens": 42} {"id": 987223, "source": "review", "repo": "Ladysnake/Cardinal-Components-API", "text": "small inconsistency: you are mixing `code` or `link` for vanilla classes.", "tokens": 20} {"id": 987265, "source": "review", "repo": "LunarClient/Apollo", "text": "I think we should have a clear \"global\" toggle, instead of making them do all 3 (Especially since if we add another \"type\" in the future which defaults to `true` [which we would want it to], we might be accidentally re-enabling stats for people who wanted it off) Will add a global toggle, those 3 will stay since if server owners toggled all categories we don't want to send requests with no data in them.", "tokens": 101} {"id": 987408, "source": "review", "repo": "MinecraftFreecam/Freecam", "text": "parchment version bump can be backported, or merged early. IMO waiting for a full release of 1.20.5 shouldn't be necessary to merge this to main, we can always bump again later.", "tokens": 48} {"id": 987736, "source": "review", "repo": "NASA-AMMOS/plandev", "text": "I'd actually recommend making the function take `_old_model_id` and `_new_model_id`, but that's inspired by my proposal to essentially make this function check if two models are compatible and not how compatible the plan is with the new model. If this is checking intends to check the latter, then the current params make sense. Good point, updated in 53b9451ce11cd2e6458c3974ef676ad53f3b1cfe.", "tokens": 121} {"id": 987749, "source": "review", "repo": "NASA-AMMOS/plandev", "text": "Might be worth asserting three additional pieces of information: 1) that there is only one activity after the first run: `BiteBanana` 2) that the activityId of `BiteBanana` is never the same (that is, that the goal is placing a _new_ `BiteBanana` each loop) 3) that the activityId of `GrowBanana` is the same (that is, that the coex goal is not placing a new `GrowBanana` each loop) If I had to pick only one of these, I'd pick (2), since that id changing proves the thesis that the prior activity is being deleted and replaced. Without that check, you would get the same results if the activity wasn't deleted and the goal was marked as satisfied because of the activity already in the plan (though I understand satisfaction works differently for Procedural Goals). (1) and (2) also apply for `createsOneActivitySteadyState_AtBeginning`, though not as strongly, since the CoEx not placing anything is pretty strong evidence that the prior activity is being deleted. Good point", "tokens": 244} {"id": 987845, "source": "review", "repo": "NASA-AMMOS/plandev", "text": "In both the `up` and the `down`, these need to now be numbers instead of strings", "tokens": 21} {"id": 988169, "source": "review", "repo": "PaperMC/adventure", "text": "Same here, `toString()`? Same as above", "tokens": 11} {"id": 988517, "source": "review", "repo": "PaperMC/adventure", "text": "Instead of duplicating this logic, we should refactor the original method in `NamedTextColor` to be something like `public @NotNull C nearestColorTo(final @NotNull List values, final @NotNull TextColor any)` - have the existing method in that class call it with `nearestColorTo(VALUES, any)` and have this new class call it as well.", "tokens": 82} {"id": 988567, "source": "review", "repo": "PaperMC/adventure", "text": "actually, should this instead be `pointersSupplier`? im not sure, there's a lot of places we just use `builder` outside, any thoughts? as much as inconsistency is the spice of life, this would match our `Component` builder methods better. @kashike what do you think? ok, I think we're fine with this, I'm happy to just get this PR wrapped up", "tokens": 88} {"id": 988678, "source": "review", "repo": "TuxCoding/FastLogin", "text": "http://pastebin.com/jYbgFW17 this is my server log fastlogin is use your newest source code to build not player is null player.getAddress() is null (i split code to find out it)", "tokens": 49} {"id": 988679, "source": "review", "repo": "TuxCoding/FastLogin", "text": "Yeah I saw it by attaching the debugger. Weird behaviour. I'll fix that.", "tokens": 23} {"id": 988698, "source": "review", "repo": "TuxCoding/FastLogin", "text": "Please re-use the floodgate player, that saves us an additional lookup.", "tokens": 18} {"id": 988746, "source": "review", "repo": "TuxCoding/FastLogin", "text": "Use the player variable from above directly. Moved to & fixed in #876", "tokens": 18} {"id": 989036, "source": "review", "repo": "advanced-rocketry/advancedrocketry", "text": "The calculation and assignment for averageTemperature was calculated just before this line, is it getting calculated somewhere else now?", "tokens": 23} {"id": 989124, "source": "review", "repo": "adyen/adyen-java-api-library", "text": "```suggestion * Copyright (c) 2026 Adyen B.V. ``` Updated", "tokens": 22} {"id": 989153, "source": "review", "repo": "adyen/adyen-java-api-library", "text": "This is consistent with the `id` field since it is a `readOnly` field. No need to set the flag.", "tokens": 26} {"id": 989371, "source": "review", "repo": "agricraft/agricraft", "text": "This will need a SideOnly(Side.CLIENT) annotation", "tokens": 14} {"id": 989522, "source": "review", "repo": "aikar/commands", "text": "Can't we keep brackets on one line for cases like this? That should be fixed with https://github.com/aikar/commands/pull/116/commits/919f940a4f39255490e9691717fbd360b8923083 and https://github.com/aikar/commands/pull/116/commits/14a4487337471e91791328877003d909d3be31b3", "tokens": 139} {"id": 989570, "source": "review", "repo": "aikar/commands", "text": "bot owner should prob return true here this would ensure permission based commands still work in PM. Good idea", "tokens": 23} {"id": 989670, "source": "review", "repo": "aimacode/aima-java", "text": "Is there a cleaner way to do this without repeating the conditional block twice? I am not sure about an alternative way for this. This is because alternate evaluations of both queues need to be done for the algorithm.", "tokens": 45} {"id": 989783, "source": "review", "repo": "aimacode/aima-java", "text": "would: this.parents = new ArrayList<>(parents); not be simpler?", "tokens": 18} {"id": 989829, "source": "review", "repo": "aimacode/aima-java", "text": "I'm not sure it is worth worrying about renaming (especially since the default implementation ignores the issue). COuldn't we do without this complication?", "tokens": 41} {"id": 989877, "source": "review", "repo": "aionnetwork/aion", "text": "should replace these with the id/ips of the actual avntestnet seed nodes", "tokens": 20} {"id": 989964, "source": "review", "repo": "aionnetwork/aion", "text": "should we check the key? Objects.requireNonNull(key); Yes, we should. I will make the update. Okay, make sure the other operation methods get checked.", "tokens": 35} {"id": 989998, "source": "review", "repo": "aionnetwork/aion", "text": "As mentioned above, I'm confused regarding the necessity for the `? :` operator.", "tokens": 23} {"id": 990208, "source": "review", "repo": "aionnetwork/aion", "text": "Is there a reason we shouldn't return block details for non-main-chain blocks? There is no reason why we shouldn't but since the change is specifically designed for the dashboard I added the check since the dashboard only displays mainchain blocks. Sounds reasonable", "tokens": 55} {"id": 990213, "source": "review", "repo": "aionnetwork/aion", "text": "check the old database has no staking difficulty case", "tokens": 11} {"id": 990592, "source": "review", "repo": "akto-api-security/akto", "text": "verify in AgenticAssetsPage.jsx if this edit will be affecting the top list cards .", "tokens": 22} {"id": 990773, "source": "review", "repo": "akto-api-security/akto", "text": "this file changes are needed in cyborg yeah. build was failing so added here as well.", "tokens": 21} {"id": 990777, "source": "review", "repo": "akto-api-security/akto", "text": "can workRemaining be 0 and lag > 0, won't satisfy this condition then Yes, reachable: e.g. the consumer loses its partition while the engine stays alive -> workRemaining=0, lag>0, nothing progresses, and it spun to max runtime. Fixed in 9b00e21adf: stall no longer requires workRemaining > 0 (every record finishes or times out within the per-test timeout < 420s, so no progress means stuck unless done), and it's checked after completion. workRemaining==0 stays only as a gate before the lag query (lag==0 already implies it). Also treats expectedRecords==0 as complete, since an empty topic never gets a commit and lag stays -1 - otherwise an empty run would stall-exit-restart until max runtime.", "tokens": 182} {"id": 990871, "source": "review", "repo": "alphawallet/alpha-wallet-android", "text": "Is it possible for this to get into an infinite recursion state? > Is it possible for this to get into an infinite recursion state? This is a signal to the OS to re-create the underlying activity and re-populate the fragment. It happens if the user has paged out from the application while on this page, done something memory intensive like playing a game, watching youtube, navigation etc and paged back in. While they were doing their other activity the OS scavenged the objects in the class, so now they're back, the objects are all null pointers. After the OS re-instantiates the Activity and Fragment the viewodel will have been initialised again. Really, the Android OS should provide a formal way to deal with this! If they don't already and I don't know about it.", "tokens": 177} {"id": 990877, "source": "review", "repo": "alphawallet/alpha-wallet-android", "text": "This can have the boolean removed - it's now always CustomViewSettings.primaryChain", "tokens": 19} {"id": 991030, "source": "review", "repo": "amplitude/amplitude-android", "text": "I kinda like leaving this set when the variable is declared, but either way is fine. oh that actually makes sense and looks cleaner", "tokens": 27} {"id": 991231, "source": "review", "repo": "apace100/origins-fabric", "text": "The \"compare_to\" parameter is an integer, so this needs to be changed to `data.getInt(\"compare_to\")`", "tokens": 28} {"id": 991340, "source": "review", "repo": "apollographql/federation-jvm", "text": "```suggestion // we haven't seen an explicit maxAge argument, set the maxAge to defaultMaxAge. ``` Because it's all the same case, I find this easier to read", "tokens": 39} {"id": 991729, "source": "review", "repo": "artipie/artipie", "text": "Mistake: test doesn't change \"John\" user, it creates a new user \"Mark\" Suggest to use variable: final String username = \"Mark\";", "tokens": 36} {"id": 991805, "source": "review", "repo": "artipie/artipie", "text": "Disable this test on windows, github win actions do not have docker", "tokens": 14} {"id": 992085, "source": "review", "repo": "assert-kth/sorald", "text": "Correct link: #getclass-should-not-be-used-for-synchronization-sonar-rule-3067", "tokens": 31} {"id": 992342, "source": "review", "repo": "auth0/auth0-java", "text": "**All** these entity methods that have a `resourceServerId` as a parameter, I'm checking the API docs and it says that it could be either the id or the identifier (audience) value. Assert this is true and in that case, rename to `resourceServerIdOrIdentifier` and explain this in the javadoc. done", "tokens": 70} {"id": 992402, "source": "review", "repo": "auth0/auth0-java", "text": "This can be the \"generic job error\" class, which is currently returned in two scenarios: - export users jobs (this PR's methods) - email verification jobs (methods already exist) Please refactor this class so it contains only this properties (all strings): - id - status - type - connection As mentioned in other comment, the server would respond with a status code `200` if job was found so there's no need to check it. Any failure status code would end up in the request's error callback.", "tokens": 110} {"id": 992437, "source": "review", "repo": "auth0/auth0-java", "text": "Comments normally end with a `.` in this file.", "tokens": 14} {"id": 992543, "source": "review", "repo": "auth0/auth0-java", "text": "I moved the `withOrganization` method closer to the other public builder methods for readability/organization purposes. The `withClock` method is not removed, the only functional change is making the `withOrganization` method `public`.", "tokens": 48} {"id": 992592, "source": "review", "repo": "auth0/auth0-java", "text": "We can use inheritance and extend generic Page<> class. For reference, refer ClientsPage class", "tokens": 21} {"id": 992651, "source": "review", "repo": "auth0/java-jwt", "text": "this method is still not formatted according to the rest of the file. Please run the code formatter or do it manually. Thanks sorry, my local eclipse is configured for tabs for other repos. did it manually, thank you.", "tokens": 47} {"id": 992669, "source": "review", "repo": "auth0/java-jwt", "text": "Remove this test as it's already present here `shouldThrowOnInvalidIssuer()`", "tokens": 18} {"id": 992803, "source": "review", "repo": "auth0/jwks-rsa-java", "text": "```suggestion If you need to detect this scenario, check that the cause matches an `IOException`. ```", "tokens": 22} {"id": 992828, "source": "review", "repo": "auth0/lock.android", "text": "idk if this is the best way (but it's certainly the easiest)", "tokens": 18} {"id": 992858, "source": "review", "repo": "auth0/lock.android", "text": "`AuthorizeResult` can easily answer this question", "tokens": 10} {"id": 992975, "source": "review", "repo": "auth0/lock.android", "text": "``` java boolean showEmail = false; boolean showUsername = false; if (lockWidget.getConfiguration().isUsernameRequired()) { showEmail = true; showUsername = true; } else if (lockWidget.getConfiguration().getUsernameStyle() == UsernameStyle.USERNAME) { showUsername = true; } else if (lockWidget.getConfiguration().getUsernameStyle() == UsernameStyle.EMAIL || lockWidget.getConfiguration().getUsernameStyle() == UsernameStyle.DEFAULT) { showEmail = true; } ``` vs ``` java Configuration configuration = lockWidget.getConfiguration(); boolean showEmail = configuration.isUsernameRequired() || configuration.getUsernameStyle() == UsernameStyle.EMAIL || configuration.getUsernameStyle() == UsernameStyle.DEFAULT boolean showUsername = configuration.isUsernameRequired() || configuration.getUsernameStyle() == UsernameStyle.USERNAME ```", "tokens": 172} {"id": 993246, "source": "review", "repo": "aya-prover/aya-dev", "text": "What does Agda/Arend do? They don't have it. I think the fuel can reduce unnecessary loops because we only need to traverse each edge for the number of vertexes times in this graph (according to Warshall\u2019s algorithm of finding transitive closures)", "tokens": 62} {"id": 993611, "source": "review", "repo": "aya-prover/aya-dev", "text": "Can use `onEach` Next PR", "tokens": 10} {"id": 993731, "source": "review", "repo": "aztechmc/modern-industrialization", "text": "Current MI doesn't need this. Do you?", "tokens": 13} {"id": 993774, "source": "review", "repo": "aztechmc/modern-industrialization", "text": "This has made me realize the codec for `PipeEndpointType` is in the `ItemNetworkNode` class, which is a bit odd. Especially since this is no longer only used for item pipes. Maybe we should move it to `PipeEndpointType` and rename it to `CODEC`?", "tokens": 60} {"id": 993888, "source": "review", "repo": "azure/azure-functions-java-worker", "text": "I believe JDK will be enough for Java Tools, or move the tools to here.", "tokens": 19} {"id": 994045, "source": "review", "repo": "azure/azure-functions-java-worker", "text": "Any reason this log is removed? This was added to make it easier to get java version in kusto logs specifically for consumption apps as they use placeholders. I suggest we retain this. we can check the version by using log here https://github.com/Azure/azure-functions-java-worker/blob/86e4db1ce8870710290a5d17e11164a1dc568227/src/main/java/com/microsoft/azure/functions/worker/broker/JavaMethodExecutors.java#L9, and from applens we can also tell the version. My concern is that put it in invocation is not a good place, when cx is having thousands rps, this can be kind of annoying and it may impact the throughput and performance when the rps is high as we need to run getJavaverion very frequently and log them to host from stdout. So if we have a way to tell the java version, let's just save the resources as much as possible. Understand your concern. I feel it is better to retain it with a lower log level. This log specifically informs not only the java version but also the java path which is useful for the customer and us. Some customers had reached out asking how to get this information. The time we would save with one log is quite miniscule. Feel free to combine java version with the next log if it saves time. I moved the log to function load request handler as function load is far fewer than function invocation.", "tokens": 336} {"id": 994137, "source": "review", "repo": "azure/azure-sdk-for-android", "text": "Is it a common pattern to name the options bags with ? I see we have other types like `ListBlobsOptions` so I'm not sure what's common in Java land. Yeah theres a design guideline to name the options bag ClientTypeActionOptions", "tokens": 66} {"id": 994218, "source": "review", "repo": "azure/azure-sdk-for-android", "text": "```suggestion // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. package com.azure.android.communication.chat.signaling; ```", "tokens": 38} {"id": 994229, "source": "review", "repo": "azure/azure-sdk-for-android", "text": "I see, so if user set `context` and `userToken` then we create `SignalingClient` which enables real time notification, I feel like, it might be bit hard for users to discover this relationship, what do you think? How about a builder method name that better communicate this? Something like `realtimeNotificationParams(context, userToken)` and we could improve the error message in `startRealtimeNotifications()` method i.e. instead of \"Signaling client not initialized\" we could say \"Realtime notification parameters (context, userToken) are not set\"?", "tokens": 120} {"id": 994245, "source": "review", "repo": "azure/azure-sdk-for-android", "text": "Are they are required? Yes they are required", "tokens": 10} {"id": 994256, "source": "review", "repo": "azure/azure-sdk-for-android", "text": "```suggestion - Introduce new class `CommunicationAccessToken`. ```", "tokens": 13} {"id": 994404, "source": "review", "repo": "azure/azure-sdk-for-android", "text": "nit; We should be consistent when using `real time`/`realtime`. It looks like Firebase uses the latter (one word), so we probably should adopt that across our code and docs.", "tokens": 41} {"id": 994480, "source": "review", "repo": "azure/azure-sdk-for-android", "text": "We might want to collapse both lists into one as they're almost identical. ```suggestion - Added the following methods to `ChatAsyncClient` and `ChatClient`: - `startPushNotifications` - `stopPushNotifications` - `handlePushNotification` - `addPushNotificationHandler` - `removePushNotificationHandler` ```", "tokens": 65} {"id": 994551, "source": "review", "repo": "azure/azure-sdk-for-android", "text": "Back when this class was named `RegistrationKeyStore` we were also closing the `FileOutputStream`, is ther a particular reason that was removed? ```suggestion bos.write(bytes); bos.close(); fos.close(); ``` The try-with-resources statement ensures that each resource is closed at the end of the statement. Any object that implements java.lang.AutoCloseable, which includes all objects which implement java.io.Closeable, can be used as a resource. So actually the bos.clost() could be removed as well. Oh you're right, I don't know how I missed that. Removing both closing statements should be fine.", "tokens": 135} {"id": 994700, "source": "review", "repo": "azure/azure-sdk-for-java", "text": "Should check that at least one of `durationHistogram` or `tokenUsageHistogram` is enabled before building `baseAttributes` to prevent wasted CPU", "tokens": 31} {"id": 994734, "source": "review", "repo": "azure/azure-sdk-for-java", "text": "Agreed that the trailing quote is a source documentation typo. This JavaDoc is generated from the AKS TypeSpec source, so a direct generated-Java edit would not persist. It is documentation-only and does not affect API behavior; the source text should be corrected separately.", "tokens": 56} {"id": 994832, "source": "review", "repo": "azure/azure-sdk-for-java", "text": "Correct, and the PR's guarantee did not hold for those two. `LOGGER.logExceptionAsError` logs at error level regardless of what `LoggingUtil.logTokenError` decided, so ClientAssertionCredential and AzurePipelinesCredential still emitted an error line and double-wrapped the exception. Both now call `IdentityUtil.rethrowIfShutdownSignal(e)` between the two, so a cancellation reaches the caller as the original exception with no second log. `CredentialShutdownSignalTests.cancellationIsNotRewrappedAndLoggedAsAnAuthenticationError` asserts the thrown instance is the cancellation itself; against the previous commit it fails with `RuntimeException: RuntimeException: ...`, which is exactly the double wrap the error log accompanied. Checkstyle's ThrowFromClientLogger rule requires throws in instance methods to go through the logger, which is why the rethrow lives in a static utility method rather than inline in each catch block.", "tokens": 191} {"id": 994852, "source": "review", "repo": "azure/azure-sdk-for-java", "text": "[P2] Drop responses without a current invocation instead of buffering them for future calls This multicast buffer retains responses when no listener is subscribed. Reproduced sequence: invocation \"reuse\" times out; its late successful response arrives while no invocation is pending; a later call uses \"reuse\" again. That new call immediately returns the buffered `old-result` even though its response has never arrived, and it still sends the new request afterward. There are no simultaneous duplicate invocations in this reproduction. Route each response only to an existing pending registration and discard unmatched IDs. JS resolveInvocation returns false for an unknown ID rather than storing the frame for later. This should be tested separately from concurrent duplicates because it crosses a completed/timed-out invocation lifetime. Fixed. Responses are now routed only to an existing pending invocation. Responses with no matching registration are discarded rather than buffered for future calls.", "tokens": 194} {"id": 995043, "source": "review", "repo": "azuread/azure-activedirectory-library-for-android", "text": "needs to be 1.13.1", "tokens": 11} {"id": 995409, "source": "review", "repo": "azuread/azure-activedirectory-library-for-android", "text": "Slightly confused by this; the javadoc for this method describes the cache as unused, but now we're updating the cache ```java /** * Developer is using refresh token call to do refresh without cache usage. * App context or activity is not needed. Async requests are created, so this * needs to be called at UI thread. */ ``` The repercussions of this change aren't entirely clear to me. Previously this method was used in the `acquireTokenByRefreshToken` flow where IIRC _nothing_ was cached. Now that caching is being added, won't this change the flow of the code thru ADAL for consumers of this API upon subsequent use due to the newly cached RT now being saved in the cache? Is there any scenario we may not be considering whereby customers may be _relying_ on ADAL not caching this token? Synced offline; this change should be fine. But docs should be updated Addressed. Updated docs.", "tokens": 197} {"id": 995429, "source": "review", "repo": "azuread/azure-activedirectory-library-for-android", "text": "```suggestion ##---------------Begin: proguard configuration for crypto classes -------- -keep,includedescriptorclasses class com.google.crypto.tink.subtle.Ed25519Sign { *; } ```", "tokens": 46} {"id": 995587, "source": "review", "repo": "azuread/microsoft-authentication-library-for-android", "text": "Is this the message that comes back from the server? The format looks strange. This is a placeholder when the test slice didn't work fine before. Done. Updated with \"missing registration_required\" which is more generic. So the test slice returns \"missing registration_required\" or we can't test? I see @nilo-ms [only checks that is not nil](https://github.com/AzureAD/microsoft-authentication-library-for-objc/pull/2648/files). Maybe do that also here? I am saying this that once we remove the ignore above this test will automatically start working. We can leave it to fix it then. Also just in case, this one is about MFA. Yep. missing mfa_required", "tokens": 163} {"id": 995657, "source": "review", "repo": "azuread/microsoft-authentication-library-for-android", "text": "@copilot you have instructions on dynamically acquiring the latest msal version as part of the copilot instructions files. Please utilize this logic, rather than hard coding 8.1.1 anywhere in these new guidance files. We do not want to have to constantly update the versions in these files constantly.", "tokens": 64} {"id": 995886, "source": "review", "repo": "azuread/microsoft-authentication-library-for-java", "text": "The error code might be common, but the message is better to come from each individual source so that there is more context? Does .NET have error messages for each source? If so we could probably just copy them.", "tokens": 46} {"id": 996010, "source": "review", "repo": "azuread/microsoft-authentication-library-for-java", "text": "Can you use a static certificate instead? Like in MISE? That way you can assert on the the well known hash too. The variables are already static, or are you saying to just create one locally and add it to the repo?", "tokens": 49} {"id": 996229, "source": "review", "repo": "azuread/microsoft-authentication-library-for-java", "text": "Addressed in d3a8917 (same fix as the other thread on this method): added the `END_DOCUMENT` check to reject trailing tokens after the root object, and removed the parser message from the exception so the raw claims payload is never surfaced. A new test asserts the exception message does not contain the payload.", "tokens": 70} {"id": 996516, "source": "review", "repo": "bergerhealer/traincarts", "text": "I don't know about this being static, I feel like it shouldn't since plugin itself is already static. Agreed, generally I leave such things local and access them using Traincarts.plugin.getEconomy(). Ideally I would send an instance of Traincarts along I changed this in commit 75ea6594", "tokens": 72} {"id": 996535, "source": "review", "repo": "bernie-g/geckolib", "text": "This is one thing I would say to remove, I use the GUI myself to easily shutdown the test server when testing.", "tokens": 25} {"id": 996546, "source": "review", "repo": "bernie-g/geckolib", "text": "Dose not use the the `@Share` value like the other injection. Fixed", "tokens": 17} {"id": 996633, "source": "review", "repo": "bloxbean/cardano-client-lib", "text": "Ordering is not supported in Koios", "tokens": 10} {"id": 996640, "source": "review", "repo": "bloxbean/cardano-client-lib", "text": "We don't need PREVIEW and PREPOD here. Only TESTNET networkId is enough. So NetworkId enum will have two values TESTNET, MAINNET where TESTNET is for all testnets", "tokens": 45} {"id": 996754, "source": "review", "repo": "bloxbean/cardano-client-lib", "text": "Reference inputs are added as usual to the transaction right? Yes. The extension adds the protocol's reference inputs itself at build time (params/coordination UTxO, registry node, global state, published scripts), so the verbs don't take them. Anything you add with `readFrom(...)` goes through the usual `ReferenceInputIntent` path into the same body; duplicates are dropped, and the redeemer indexes are computed over the ledger-sorted set after balancing. For reference, the extension's materializer is itself a `Tx` and just calls `readFrom` for the protocol UTxOs, e.g. in `Cip113TransactionMaterializer`: ```java readFrom(service.coordinationUtxo()); // params / coordination UTxO readFrom(node.getUtxo()); // the policy's registry node readFrom(published.get()); // a script published on chain, referenced not witnessed ``` `Cip113BuildExtension.finish` then hands those intents to the build via `context.addPreparedIntent(...)`, so they are applied by the same `ReferenceInputIntent` as the caller's own `readFrom`, without touching the authored `Tx`. Covered by `Cip113EndToEndIT.step19_callerReferenceInputsAreAppliedAsUsual`.", "tokens": 292} {"id": 996814, "source": "review", "repo": "boxbeam/RedLib", "text": "Add a description \"Increase the level of this enchantment on an item, ensuring it does not exceed the maximum level\"", "tokens": 24} {"id": 996914, "source": "review", "repo": "braintree/android-card-form", "text": "```suggestion buildToolsVersion '29.0.3' ```", "tokens": 15} {"id": 997114, "source": "review", "repo": "braintree/braintree-android-drop-in", "text": "Looks like we lost the `setReorderingAllowed(true)` here. I don't know that we need it, but wanted to call that out. Yeah it didn't seem like it was needed. It has more to do with animations / transitions. Wanted to save those for last to clear the way for us to reach feature parity without thinking about animating.", "tokens": 80} {"id": 997178, "source": "review", "repo": "braintree/braintree-android-drop-in", "text": "Nitpick - but the indentation looks off here for the `override` and `public void` lines Ah yeah those get collapsed in the IDE so didn't notice the weird indent. Should be fixed now.", "tokens": 42} {"id": 997458, "source": "review", "repo": "broadinstitute/picard", "text": "Similarly, a unit test for this would be good.", "tokens": 12} {"id": 997591, "source": "review", "repo": "broadinstitute/picard", "text": "You might feel differently, but. I wouldn't be adding more `File` inputs when you could be using `PicardHtsPath` instead. Or `Path` if you're feeling like being on the awkward out of date but not TOO out of date format. I guess it's weird to have a tool partially converted though. It looks like changing these away from `File` causes a number of other problems, especially `PicardHtsPath`. But even `Path` causes a few downstream changes that would probably be fixed by writing `mypath.toFile()` in a bunch of places. If you think this is a worthwhile pursuit, I can try to hunt down the appropriate changes for this. But it might be best saved for a full rewrite where all of the inputs are appropriately updated. If it's a pain we can put it off. Thanks for taking a look.", "tokens": 183} {"id": 997650, "source": "review", "repo": "broadinstitute/picard", "text": "Should we have separate locations for picard ? We can change them if we want. Since we're using the same service account and set of permissions I figured it was easiest to put them in the same place where permissions and bucket lifecycles are already configured. They shouldn't conflict with each other in any way that I can think of.", "tokens": 70} {"id": 997878, "source": "review", "repo": "brunoborges/javaevolved", "text": "Revert this change @copilot . Keep the jbang command only. Remember: the jar is not uploaded to the repo!", "tokens": 25} {"id": 997960, "source": "review", "repo": "byronka/minum", "text": "Separating the wheat from the chaff is such a pain with AI, I really don't even want to take the time. In this case, if I were going to hold the AI to a standard of excellence, I would suggest that the error message not merely include that the compressed size should be smaller than the uncompressed, but also that I would want to see what those two were, specifically. From all I am seeing, for at least this project, the pains outweigh the gains - I have no interest in taking the time to seek the bits of good amongst the slop.", "tokens": 131} {"id": 998132, "source": "review", "repo": "cambridge-cares/theworldavatar", "text": "The frontend itself does NOT include the mock server. Please note that organisation of source code files and directory naming is not a 1-1 correspondence of the application architecture. It is entirely possible to have `backend`, `next_app_marie`, and `mock_backend` at the same directory level; it is purely my personal choice to group `next_app_marie` and `mock_backend` together in the same folder.", "tokens": 94} {"id": 998309, "source": "review", "repo": "cambridge-cares/theworldavatar", "text": "Please fix the extension of this file. It should be `.sparql` rather than `.txt.txt`. This also applies to several files. Thank you for the reminder. This issue is addressed in commit [ffcb33006f28f2ae53754a62a6e8324b44330d7a]", "tokens": 84} {"id": 998334, "source": "review", "repo": "cambridge-cares/theworldavatar", "text": "Why did you re-add this file? Please remove this. You don't need this folder at all. There should not be any customised services required. Sorry I just saw this in some project and mistakenly thought it was neseccary here. Noe this was removed in commit [14e158788f09d3bbcddf04f3eefa1c6e04cb7368] Sorry, I just saw some other project has this, I mistakenly thought it was necessary here. This was addressed in commit [14e158788f09d3bbcddf04f3eefa1c6e04cb7368]", "tokens": 158} {"id": 998545, "source": "review", "repo": "cambridge-cares/theworldavatar", "text": "use deeplink to navigate to the main screen, the current way too implicit and easy to cause bug", "tokens": 21} {"id": 998548, "source": "review", "repo": "cambridge-cares/theworldavatar", "text": "ideally should put in string.xml, and get the string with activity.getString(). Adding as string resource is a practice for multilingual support", "tokens": 30} {"id": 998585, "source": "review", "repo": "cambridge-cares/theworldavatar", "text": "You may want to update this as well, as it is now also outdated. Updated.", "tokens": 19} {"id": 998828, "source": "review", "repo": "citerus/dddsample-core", "text": "This would be improved even more if replaced with something like ``` assertThat(orderEvents).containsExactly(he2, he4, he1, he3); ``` Done. As a first step, I used the automated script to make the changes. After that, I will use the AssertJ maven plugin to generate the Domain Driven Assertions. And as a final step, I should review all the assertions to exploit all the full power of AssertJ.", "tokens": 93} {"id": 998837, "source": "review", "repo": "citerus/dddsample-core", "text": "Was this deleted because it's included in the Spring Boot yaml config? If yes, some of the specific log level overrides for classes and packages should be migrated. I found that we are using the logback by spring boot default. Let me check it. I added the log level in application.yml.", "tokens": 62} {"id": 998868, "source": "review", "repo": "classgraph/classgraph", "text": "I'll merge this, but why did you invoke this method twice? Why not just use the value of `rootPath`? Ooops. That was an oversight. You fixed this, didn't you? Thank you for that! I did, no problem!", "tokens": 56} {"id": 998876, "source": "review", "repo": "cloudinary/cloudinary_java", "text": "You should use `StringUtils.isRemoteUrl()` instead of duplicating the code (it was already duplicated, but this is a good chance to fix it)", "tokens": 31} {"id": 998930, "source": "review", "repo": "cloudinary/cloudinary_java", "text": "Is that needed because of the test-cloud change? no \"sample\" in that cloud? Yes. This can probably be fixed in the cloud somehow however we agreed it's more reliable to not have any assumptions about pre-existing resources. Sample can be deleted even after it's created so it wasn't a great idea to begin with...", "tokens": 76} {"id": 999029, "source": "review", "repo": "codedabble-dev/java-snapshot-testing", "text": "I think this method in unnecessary. This can be done in `reporter ` if we use `.add()`. That way we have a single method ``` expect(\"blah\") .reporter(Foo.class) .reporter(Bar.class) .toMatchSnapshot(); ``` If we want to override the lot perhaps we can introduce `reporters` to as a varargs: ``` expect(\"blah\") .reporters(Foo.class, Bar.class) .toMatchSnapshot(); `` Hmm. I wanted to have the 'reporter' method replace all existing reporters. That means if we chain the calls, only the last one will take effect. I'm not sure if changing 'reporter' method to be additive is the right approach since the most common use of this method would probably be to replace the default reporter with a custom one. If we make the method additive, users would have to explicitly clear existing default reporters and then add their custom one. I think a varargs reporters makes sense. So I'll remove the 'extraReporters' and 'reporter' methods and change the existing plural 'reporters' method to accept a varargs reporters instead of a list. Does that sound good ? Yep, sounds good to me", "tokens": 260} {"id": 999310, "source": "review", "repo": "col-e/recaf", "text": "Because our parser is a hacky pile of substringing mess, I don't think we actually need to escape `\"` for now. This should work as-is.", "tokens": 38} {"id": 999473, "source": "review", "repo": "col-e/recaf", "text": "The comment for logback-classic still applies and should either not be updated, or fixed. Running `gradlew build` and attempting to run the created jar fails: ``` SLF4J: A SLF4J service provider failed to instantiate: org.slf4j.spi.SLF4JServiceProvider: Provider ch.qos.logback.classic.spi.LogbackServiceProvider not found SLF4J: No SLF4J providers were found. SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details. Exception in thread \"main\" java.lang.ClassCastException: class org.slf4j.helpers.NOPLoggerFactory cannot be cast to class ch.qos.logback.classic.LoggerContext (org.slf4j.helpers.NOPLoggerFactory and ch.qos.logback.classic.LoggerContext are in unnamed module of loader 'app') at me.coley.recaf.util.logging.Logging.addFileAppender(Logging.java:83) at me.coley.recaf.Main.setupLogging(Main.java:85) at me.coley.recaf.Main.main(Main.java:39) ``` Now it's fixed", "tokens": 289} {"id": 999488, "source": "review", "repo": "col-e/recaf", "text": "Javadocs here and other public methods that are missing docs.", "tokens": 12} {"id": 999734, "source": "review", "repo": "conveyal/r5", "text": "The only change to the GraphQL code is to the schema class, where the `AIR` mode is added. This GraphQL version bump is probably not necessary to support that change. But it seems reasonable to keep up with more recent versions. We should explore the separate question of whether R5 even needs a GraphQL API - I think this was related to Conveyal's Modeify project, and might even be an unused prototype. I will revert the version update, so it can be done in a more controlled way. There is no need to do it as part of this PR.", "tokens": 122} {"id": 999821, "source": "review", "repo": "conveyal/r5", "text": "The Envelope is still called \"distanceTableZone\" even though everything has been changed to \"cost\".", "tokens": 23} {"id": 999898, "source": "review", "repo": "conveyal/r5", "text": "Same as above, we can use the helper `getFormField` here. So ```java Integer.parseInt(getFormField(formFields, \"zoom\", false)) ```", "tokens": 35} {"id": 1000244, "source": "review", "repo": "cosium/git-code-format-maven-plugin", "text": "Why are you adding `commons-codec`? Without it I get: ``` [ERROR] COMPILATION ERROR : [ERROR] maven-git-code-format/src/test/java/com/cosium/code/format/AbstractTest.java:[16,39] package org.apache.commons.codec.digest does not exist ``` jgit 4.9 was pulling it in transitively and 5.4 no longer does Ok make sense", "tokens": 100} {"id": 1000293, "source": "review", "repo": "cottonmc/libgui", "text": "```suggestion * Returns whether the parent panel of this widget should be expanded to fit this widget. ```", "tokens": 21} {"id": 1000328, "source": "review", "repo": "cottonmc/libgui", "text": "Please fix the import order (the other libgui imports are ordered below mc)", "tokens": 17} {"id": 1000493, "source": "review", "repo": "countly/countly-sdk-android", "text": "no begin session? we have to manually trigger it? It is because lifecylye not started yet ![image](https://github.com/Countly/countly-sdk-android/assets/57103426/1a094511-8c14-4746-93e8-2fe06876af68)", "tokens": 86} {"id": 1000560, "source": "review", "repo": "cqfn/aibolit", "text": "```suggestion if new_class_name not in considered_classes: ``` Didn't change", "tokens": 21} {"id": 1000638, "source": "review", "repo": "cqfn/aibolit", "text": "Shouldn't we check that `STATEMENT_EXPRESSION` is the last statement in method budy?", "tokens": 22} {"id": 1000654, "source": "review", "repo": "cqfn/aibolit", "text": "consider renaming the method, for example: ```suggestion def split_dataset_by_pattern_value(X, pattern_idx): ```", "tokens": 29} {"id": 1000798, "source": "review", "repo": "cqfn/aibolit", "text": "Thank you for these new tests! @ivanovmg , look. The check ```python if node.node_type == ASTNodeType.MEMBER_REFERENCE ``` is unneccesary, since var_changes list constains objects of ASTNodeType.MEMBER_REFERENCE. Look the code snippets, where the algorithm fills the var_changes list ``` python # Find variables affected by assignments for node in ast.get_proxy_nodes(ASTNodeType.ASSIGNMENT): var_changes.add(node.expressionl) for node in ast.get_proxy_nodes(ASTNodeType.MEMBER_REFERENCE): if self._variable_is_affected(node): var_changes.add(node) # addding MEMBER_REFERENCE ``` # Find variables affected by assignments for node in ast.get_proxy_nodes(ASTNodeType.ASSIGNMENT): var_changes.add(node.expressionl) # expressionl is ASTNodeType.MEMBER_REFERENCE too! To conclue, all objects in var_changes are gurantee to have .member propertie Ok then. Thank you!", "tokens": 238} {"id": 1000799, "source": "review", "repo": "cqfn/aibolit", "text": "Is there a particular reason to run `check` instead of `--version`? Oh, I get it, maybe because the bot suggested against using ``--version``. Reverted it", "tokens": 39} {"id": 1000810, "source": "review", "repo": "cqfn/aibolit", "text": "Open question: do we have to freeze these to the specific versions, like in `requirements.txt` right now?", "tokens": 25} {"id": 1000978, "source": "review", "repo": "cqfn/jpeek", "text": "@rexim ok, value for this class and the other won't be ``Nan``, but why is it ``0.0d``, how did you calculate this? @amihaiemil According to [the definition of SCOM](https://github.com/yegor256/jpeek/blob/fc4437faaff683cfecb073cb7e04f3418cdefca9/src/main/resources/org/jpeek/metrics/SCOM.xsl#L38): > \"0\" indicates no cohesion at all (i.e. every method deals with an independent set of attributes) Which is absolutly true for both of the samples. Both of them have a single method that deals with its own attributes and a sinlge ctor that doesn't deal with any attributes at all. No cohesion whatsoever. You can take those methods and move them to another classes and the ctors won't notice a thing.", "tokens": 227} {"id": 1001053, "source": "review", "repo": "cqfn/jpeek", "text": "Just got curious. Would it really be necessary to create a new XML wrapper, if the documentation to [`Xembler.applyQuietly(...)`](https://www.xembly.org/apidocs-0.22/org/xembly/Xembler.html#applyQuietly(org.w3c.dom.Node)) explicitly states that the returned `Node` is the same object as supplied? Which in turn implies that the whole document is mutable. Apparently mutating the `Node` returned by `node()` with `Xembler` doesn\u2019t work that way, since `node()` clones whatever DOM nodes the `XMLDocument` impl returned by `XSLDocument.transform(...)` contains. Constructing a new `XMLDocument` seems to be the way.", "tokens": 169} {"id": 1001105, "source": "review", "repo": "cqfn/jpeek", "text": "@HDouss I think that is better we have one matcher for each operation, something like this: ``` set, new AllOf( new IsIterableContaining( new IsEqual(one) ), new IsIterableContaining( new IsEqual(two) ), new IsIterableContaining( new IsEqual(three) ), new IsIterableWithSize( new IsEqual(3) ) ) ``` @paulodamaso The problem here, is that we cannot know what if the set (1-2-3) is the first one in the list, (4-5) is the second, and (6) is the third. That will make a big constraint on the future implementation. So the idea is: the list contains a set (1-2-3) without knowing wich set exactly in the list (and so on..) @paulodamaso what do you think? @HDouss I don't see the problem, we would be using set the same way we are currently using, but we would just change ``` new HasValuesMatching<>( set -> { return set.contains(five) && set.contains(four) && set.size() == 2; } ) ``` to avoid the imperative code. @paulodamaso maybe I am misunderstanding something. Your suggested approach takes a well defined set (which is an element of the list) and applies matchers on that set. In my approach, the `AllOf` is applied on the list. The affirmation succeeds if one of the elements of the list (so, any set without knowing which one in advance) returns true giving the function. The matchers are applied to the list, and not to a particular item of the list. Applying matchers on a particular item on the list implies the problem I stated in my previous comment. @paulodamaso Please note that `HasValuesMatching` is a matcher for the list, and not the set. @HDouss Right, now I understand, thanks for the explanation. Just remove `return` statement and the curly braces, we don't need them because we have just one statement on each lambda function.", "tokens": 444} {"id": 1001628, "source": "review", "repo": "crafttweaker/crafttweaker", "text": "Here no loader? -> They are global? Preprocessors are global as of now, yes. The issue is that the loader itself is determined through a preprocessor, so if the `#loader` preprocessor is not global, then how would you determine the loader?", "tokens": 54} {"id": 1001742, "source": "review", "repo": "crafttweaker/crafttweaker", "text": "Does this already work or does it need an `.absolutePath` or smth? The returned path is already absolute", "tokens": 25} {"id": 1001784, "source": "review", "repo": "crafttweaker/crafttweaker", "text": "For readability, I'd put this Line just above the `results.addtLoadresult)` call. Or does that constructor behave differently if the List/Map is filled?", "tokens": 38} {"id": 1001930, "source": "review", "repo": "crossoverjie/cim", "text": "```suggestion @Resource ``` We will use `@Resource` uniformly, and the existing `@Autowired` also needs to be replaced.", "tokens": 27} {"id": 1002056, "source": "review", "repo": "cucumber/cucumber-eclipse", "text": "I don't see any files that would match this path expression. Ah. Found it. https://github.com/cucumber/cucumber-eclipse/blob/main/io.cucumber.eclipse.targetdefinition/cucumber.eclipse.targetdefinition.target Wouldn't that be `**/*.target`? That might work as well I just used what github uses in the docu as an example to match al JS files: https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#running-your-pull_request-workflow-based-on-files-changed-in-a-pull-request", "tokens": 142} {"id": 1002351, "source": "review", "repo": "cucumber/cucumber-jvm", "text": "This would be a `DataTableEntryDefinitionBody`. Not to be confused with the `TableRowDefinitionBody`, `TableCellDefinitionBody` and actual `DataTableDefinitionBody`. See [`JavaDataTableTypeDefinition`](https://github.com/cucumber/cucumber-jvm/blob/master/java/src/main/java/io/cucumber/java/JavaDataTableTypeDefinition.java#L71) for the full set.", "tokens": 92} {"id": 1002372, "source": "review", "repo": "cucumber/cucumber-jvm", "text": "I don't mean to keep going on about this but please use spaces for indentation rather then tabs. We've documented the settings to configure your IDE here: https://github.com/cucumber/cucumber-jvm/blob/master/CONTRIBUTING.md#contributing And we also provide a .editorconfig file that most IDEs will pick up automatically. https://github.com/cucumber/cucumber-jvm/blob/master/.editorconfig", "tokens": 91} {"id": 1002619, "source": "review", "repo": "cucumber/cucumber-jvm", "text": "This means the structure of the configuration and code aren't quite in alignment anymore. It also has the potential to explode should other configuration options for the naming strategy be used.", "tokens": 37} {"id": 1002875, "source": "review", "repo": "cyclopsmc/integrateddynamics", "text": "```suggestion \"info_book.integrateddynamics.tutorials.saving_state.text4\": \"Read the two &lButtons&r with &lRedstone Readers&r as &9Boolean&0 &lRedstone&r cards named &oOn&r and &oOff&r. Next, define a new &lVariable Card&r named &oPrevious&r using the &lGet Or Default&r operator on the history card with index &60&0 and default value &9False&0, so that it also works while the history is still empty. Now define another &lVariable Card&r named &oState&r as &oOn&r &lOr&r (&oPrevious&r &lAnd&r &lNot&r &oOff&r), and place it in the &lDelayer&r's top slot. Place all referenced cards in a &lVariable Store&r. Finally, create a second &lVariable Card&r named &oState&r in the same way, and insert it into a &lRedstone Writer&r that is targeting a &lRedstone Lamp&r. The lamp will now stay on after pressing &oOn&r, until you press &oOff&r.\", ``` Besides the suggestion above, also clarify what \"in the same way\" means above. Applied in 84818ba, and replaced \"in the same way\" with what it actually means: \"create a second Variable Card named State by building that same Or expression once more in the Logic Programmer, as the first one has to stay in the Delayer\". --- _Generated by [Claude Code](https://claude.ai/code)_", "tokens": 374} {"id": 1002938, "source": "review", "repo": "daniel-frak/keycloak-user-migration", "text": "Why do we need the user check to be this robust? Are there cases where the original version does not work? I rollback all cypress changes.", "tokens": 31} {"id": 1003050, "source": "review", "repo": "datadog/java-dogstatsd-client", "text": "Is it expected to use `telemetryClientChannel` and not `clientChannel`? I fixed the wrong line \ud83e\udd26", "tokens": 24} {"id": 1003091, "source": "review", "repo": "datadog/java-dogstatsd-client", "text": "Almost missed this in the review! I was going to say the processing thread in the non-blocking scenario was going to get pegged, but with this we're good. \ud83d\udc4d", "tokens": 39} {"id": 1003228, "source": "review", "repo": "dbos-inc/dbos-transact-java", "text": "Can we update the test to recover _from_ a step? Stop the workflow after step one then recover, verifying that it completes step two without re-executing step one. Added a test", "tokens": 42} {"id": 1003293, "source": "review", "repo": "dbos-inc/dbos-transact-java", "text": "@kraftp this (along with making pre/postInvokeWF static) is the change I mentioned in my [response above](https://github.com/dbos-inc/dbos-transact-java/pull/69#discussion_r2323519662)", "tokens": 65} {"id": 1003321, "source": "review", "repo": "dbos-inc/dbos-transact-java", "text": "this really feels like we should specify both return and exception types or neither", "tokens": 15} {"id": 1003386, "source": "review", "repo": "dbos-inc/dbos-transact-java", "text": "Isn't this called `withOptionalTimeout` on `WorkflowOptions`? should be consistent Coalescing with the comment below, maybe there should be just one.", "tokens": 36} {"id": 1003666, "source": "review", "repo": "denizenscript/denizen", "text": "Will throw an NPE if the map doesn't have an `entity` key, but in this case - `MapTag#getObjectAs`", "tokens": 30} {"id": 1003675, "source": "review", "repo": "denizenscript/denizen", "text": "Paper has not released a .4 yet as far as I can see?", "tokens": 17} {"id": 1003681, "source": "review", "repo": "denizenscript/denizen", "text": "Should match the format used by other tags, something along the lines of `Returns the player's skin model, either X or Y.`", "tokens": 30} {"id": 1003766, "source": "review", "repo": "denizenscript/denizen", "text": "This doesn't really set it, just adds new ones - need to remove old explored locations (Can probably one-line it with `List#forEach`, e.g. `getExploredLocations().forEach(snifer::remove)`)", "tokens": 54} {"id": 1003783, "source": "review", "repo": "denizenscript/denizen", "text": "Bit of an edge-case, but might be better to construct the item here (and still cache it for `matches`), as it can be modified by external plugins if the event code has a `wait` or some other delay", "tokens": 48} {"id": 1003963, "source": "review", "repo": "denizenscript/denizen", "text": "these properties should probably all have `false` set as a nullable default to avoid cluttering the property output too much", "tokens": 24} {"id": 1004241, "source": "review", "repo": "denizenscript/denizen", "text": "Missing another space here - generally we recommend using an IDE like Intellji IDEA which can help with the formatting/do it for you, a lot easier than managing it manually.", "tokens": 38} {"id": 1004273, "source": "review", "repo": "denizenscript/denizen", "text": "This could be put in a field for `matches` optimization (`getContext` should still access it directly though).", "tokens": 25} {"id": 1004426, "source": "review", "repo": "devoxx/DevoxxGenieIDEAPlugin", "text": "Can you replace the tabs with spaces? Maybe this applies to all files, did not check it. Done. I checked all places where I had added/edited code and did a reformat with spaces. Should be good now. It's probably a good idea to add some kind of a style enforcer like .editorconfig Good suggestion, will put it on my list", "tokens": 75} {"id": 1004698, "source": "review", "repo": "direwolf20-mc/buildinggadgets", "text": "```suggestion *

Note that this factory method does not verify that {@code offsetDirection} is valid. Use {@link #create(BlockPos, BlockPos, Axis)} if this is required.

```", "tokens": 45} {"id": 1004871, "source": "review", "repo": "direwolf20-mc/buildinggadgets", "text": "Not sure we need to log this much? It's registration after all, if weird things happen it might come from it", "tokens": 26} {"id": 1005112, "source": "review", "repo": "doist/recyclerviewextensions", "text": "We already got the `viewHolder` and are passing it as an argument to the other methods here in `onDraw`. But inside of `handleScroll` we access it through `mTracker.getViewHolder()`. Should we also pass it there? (Maybe with a null-check around it here, because we don't do anything without it in `handleScroll`.)", "tokens": 80} {"id": 1005172, "source": "review", "repo": "dropbox/dropbox-sdk-java", "text": "@cakoose - Thanks for your feedback! Have updated the pull request with the change.", "tokens": 20} {"id": 1005178, "source": "review", "repo": "dropbox/dropbox-sdk-java", "text": "We can just add a new function and don't break existing public function signiture. this shouldn't break the existing public signature; it just overloads the method with another. The original signature is unchanged in the method above", "tokens": 47} {"id": 1005184, "source": "review", "repo": "dropbox/dropbox-sdk-java", "text": "I'm looking for feedback in Auth.java and AuthActivity.java, where I added support in Short Live Token and PKCE in android.", "tokens": 31} {"id": 1005450, "source": "review", "repo": "eclipse-repairnator/repairnator", "text": "You removed the `this` in `InspectorSerializer` but not here. indeed", "tokens": 17} {"id": 1005632, "source": "review", "repo": "eclipse-repairnator/repairnator", "text": "Another design option is to add a new class \"JenkinsLauncher extends Launcher\". Better separation of responsibilities? Yes, That's true :) . It's fixed in the latest commits .", "tokens": 46} {"id": 1005701, "source": "review", "repo": "eclipse-repairnator/repairnator", "text": "What about using https://github.com/repairnator/failingProject/ instead? (sent you an invitation) Done!", "tokens": 26} {"id": 1005931, "source": "review", "repo": "emilyploszaj/trinkets", "text": "This code makes the code harder to read and change for no reason", "tokens": 14} {"id": 1005962, "source": "review", "repo": "emilyploszaj/trinkets", "text": "Same notes here as equip callback, indent the lambda and document the link properly. additionally, \"unequip\" should be preferred over \"un-equip\" Same reply", "tokens": 35} {"id": 1006307, "source": "review", "repo": "esoxjem/movieguide", "text": "Incorrect import It is unused, but will remove it.", "tokens": 13} {"id": 1006326, "source": "review", "repo": "eugenp/tutorials", "text": "I would expect `assertNull(emailNode)` and no L33, 24, and 36", "tokens": 25} {"id": 1006402, "source": "review", "repo": "eugenp/tutorials", "text": "Needs to be formatted as per the standard - this uses tabs Done, please check.", "tokens": 18} {"id": 1006447, "source": "review", "repo": "eugenp/tutorials", "text": "This looks like a UnitTest not a LiveTest", "tokens": 11} {"id": 1006579, "source": "review", "repo": "eugenp/tutorials", "text": "Let's include a counter in the message key and value to distinguish between the messages that are being sent made changes", "tokens": 24} {"id": 1006686, "source": "review", "repo": "eugenp/tutorials", "text": "The placeholder file is fine since this is a new module, but we won't know the final URL until the article is published. Better to omit this, and either your editor or the team will update it after it goes live.", "tokens": 48} {"id": 1006711, "source": "review", "repo": "eugenp/tutorials", "text": "```suggestion public class FluxManualTest { ```", "tokens": 10} {"id": 1006728, "source": "review", "repo": "eugenp/tutorials", "text": "Since we don't want to delay the entire CI suite with these intentional sleep demonstrations, let's rename to ManualTest suffix so it doesn't run as part of the regular CI build automatically Makes sense, changed", "tokens": 50} {"id": 1006830, "source": "review", "repo": "eugenp/tutorials", "text": "Should have 4 space indent when compared to the statement it is contained in: ```suggestion logger.info(\"\"\" ========== RESULT ({} ms) ========== Recommended: {} Reasoning: {} Callback stats: beforeLlmCall: {} afterLlmCall: {} afterToolResult: {} \"\"\", ``` applied", "tokens": 61} {"id": 1006889, "source": "review", "repo": "eugenp/tutorials", "text": "Why is this here? It's configured differently from the test container and not mentioned in the code or article - I would remove it if it's unused", "tokens": 33} {"id": 1006998, "source": "review", "repo": "exercism/java", "text": "This blurb should be about the concept, not about the exercise. Could you try to think of a small blurb that just describes the `null` concept?", "tokens": 32} {"id": 1007114, "source": "review", "repo": "exercism/java", "text": "```suggestion The method should add the new card to the collection if it isn't already present, and should return a `boolean` ```", "tokens": 29} {"id": 1007129, "source": "review", "repo": "exercism/java", "text": "```suggestion Create the method `getAverageScoreOfStudents(List studentScores, int numberOfStudents)` that takes a `List` of studentScores and a `int` of numberOfStudents. This method should get the average score of the number of students passed. The number of students is guaranteed to be lower than the size of the list of scores. ```", "tokens": 82} {"id": 1007378, "source": "review", "repo": "exercism/java", "text": "```suggestion public void testTenLetters199Addends() throws UnsolvablePuzzleException { ``` Can you rename the method too", "tokens": 31} {"id": 1007392, "source": "review", "repo": "exercism/java", "text": "```suggestion @DisplayName( \"Complex graph, some shortcuts, cross-down and cross-up, \" + \"cousins several times removed, with unrelated family tree\" ) ``` This change will fix the checkstyle error. The line length needs to be under 120 characters, which is why the tests were failing. Thank you for catching this! I've fixed the long display name by breaking it into multiple lines as suggested. The checkstyle error should now be resolved. Thanks for the guidance!", "tokens": 107} {"id": 1007393, "source": "review", "repo": "exercism/java", "text": "Looks pretty good! Just one nitpick - we should double quote the `$BASE_BRANCH` ```suggestion MERGE_BASE=$(git merge-base HEAD origin/\"$BASE_BRANCH\") ``` Thanks!", "tokens": 44} {"id": 1007680, "source": "review", "repo": "fabienrenaud/java-json-benchmark", "text": "nit: use single line comment style. Done, amended in 604f78f (losing code navigation in IDE though).", "tokens": 33} {"id": 1007738, "source": "review", "repo": "fabricmc/fabric-loom", "text": "Better name for this? Or even remove it and just use singletonMap", "tokens": 15} {"id": 1007753, "source": "review", "repo": "fabricmc/fabric-loom", "text": "No this is awful, this is for downloading files. Again please keep the PR minimal. I was testing custom manifests. Will remove", "tokens": 30} {"id": 1007918, "source": "review", "repo": "fabricmc/fabric-loom", "text": "Iirc `empty()` suffices as the convention here Yep, I was unsure if this was the case, just added this to be sure. \ud83d\udc4d", "tokens": 31} {"id": 1007958, "source": "review", "repo": "fabricmc/fabric-loom", "text": "There's something weird with the indents in this method (mixed tabs and spaces?) Humm, looks like we dont check this, will reformat all the groovy to use tabs separately.", "tokens": 41} {"id": 1008099, "source": "review", "repo": "fabricmc/fabric-loom", "text": "Should probably be a `@SuppressWarnings` annotation instead", "tokens": 10} {"id": 1008161, "source": "review", "repo": "fabricmc/fabric-loom", "text": "I dont think this applies to any files?", "tokens": 10} {"id": 1008171, "source": "review", "repo": "fabricmc/fabric-loom", "text": "```suggestion @IgnoreIf({ !os.linux }) ```", "tokens": 15} {"id": 1008550, "source": "review", "repo": "facebook/stetho", "text": "you can avoid copying into a local variable just for the sake of adding `final` ... by adding `final` to the parameter, e.g. ``` private boolean doesElementMatch(final String query, final Object element) { ```", "tokens": 49} {"id": 1008692, "source": "review", "repo": "facebook/stetho", "text": "what happens with all these tab characters? does IntelliJ convert them to spaces or what?", "tokens": 18} {"id": 1008918, "source": "review", "repo": "facebook/stetho", "text": "I don't think it's possible to get rid of allocations for every element since we don't know how many `@ViewDebug.ExportedProperty` annotated fields and methods there are at compile time. Though I agree, a `Set` is probably not the best way to do this.", "tokens": 62} {"id": 1008940, "source": "review", "repo": "facebook/stetho", "text": "Consider forwarding stdin unconditionally. What you have will be sufficient for most plugins, but now that we have a full-duplex transport, it seems unnecessarily restrictive.", "tokens": 36} {"id": 1009047, "source": "review", "repo": "facebook/stetho", "text": "this should probably be either `Descriptor` or just `Descriptor` actually ... it'd be great if we could somehow make it so that this is some form like `Descriptor`, so that `AbstractChainedDescriptor` can enforce type safety better It may be best to leave `ChainedDescriptor#setSuper` as accepting a raw `Descriptor` and do the `` thing only in the derived class. (java generics are weird ... that might even work)", "tokens": 102} {"id": 1009155, "source": "review", "repo": "faforever/downlords-faf-client", "text": "This all should be moved to the game service. Additionally don't make it blocking with the get function rather it should return the chained completable future. Actually scratch this. Looking at the current pattern we have it is fine to have this in replayService. However it should be made non blocking, by chaining the futures. Also it would be nice to inherit the things last rating limits and password from the last hosted game I specifically didn't bring over rating limits etc because if I'm hosting from someone else's replay I probably don't have the same requirements - as it happens I don't see the password or rating limits in the replay data, so it looks like I couldn't get that anyway. That is why I said not from the replay data but from the last game that the player hosted. In the game service there is a function to enhance with the last game password that could be extended Can we consider this a follow up to this feature perhaps? It opens questions like, what if the player hasn't hosted a game yet during this play session (I assume use the current default), but also what if they have played a game but don't want the password and rating limitations to apply to this hosting session? Should we offer UI to set password and rating limits when hosting from this gesture? (I'd prefer not as its extra friction for the user, but there's probably a conversation there).", "tokens": 302} {"id": 1009192, "source": "review", "repo": "faforever/downlords-faf-client", "text": "Can setReceiver just be added to the setup function? Can. But then the `checkTabHasNoAvatar` test will fail. In that case you could just set the avatar to null and call setReceiver again Thanks for explain", "tokens": 46} {"id": 1009200, "source": "review", "repo": "faforever/downlords-faf-client", "text": "This should all be sent as a single message so that it doesn't get broken up by other messages", "tokens": 22} {"id": 1009398, "source": "review", "repo": "faforever/downlords-faf-client", "text": "Making these properties will remove the need to use the Screen static methods which could cause issues in tests.", "tokens": 21} {"id": 1009462, "source": "review", "repo": "faforever/downlords-faf-client", "text": "I think all that is needed is to add a .when(showing) to the derived value we are binding from the watchedReplaysProperty. I don't think the onAttached/onDetached is needed. Replaced fix with suggestion. Did a brief manual test, seems to work just as well.", "tokens": 65} {"id": 1009917, "source": "review", "repo": "flightstats/hub", "text": "I don't quite follow this class's construction. Why does it have static property variables that aren't final. Is there a way to change stuff around so that it doesn't need them? PDXDDT-799 tracks this.", "tokens": 54} {"id": 1009928, "source": "review", "repo": "flightstats/hub", "text": "can we swap the order of the words in this property and do `isTtlEnforced`?", "tokens": 20} {"id": 1009955, "source": "review", "repo": "flightstats/hub", "text": "You shouldn't need to annotate ```@Inject``` on things with ```@Provides```. Guice should be assuming that. True. This is the pattern hub has been using, but you're right that it's unnecessary. I think this won't conflict with Manjula's branch, so I've killed them all.", "tokens": 75} {"id": 1009992, "source": "review", "repo": "flightstats/hub", "text": "does this work? Spaces in key does not look right. Yep. At the end of the day, it's just a string.", "tokens": 30} {"id": 1010087, "source": "review", "repo": "flightstats/hub", "text": "tryUntilSuccees? This matches what's in the callback server. It is the number of tries it'll make, so I think plural makes sense. I'd go for `try` singular if it were a boolean, though.", "tokens": 55} {"id": 1010247, "source": "review", "repo": "flightstats/hub", "text": "Is there a reason this one wasn't changed? Updated compile() to implementation()", "tokens": 18} {"id": 1010297, "source": "review", "repo": "floci-io/floci-az", "text": "Fixed in cf61b6b (parent fix ef2a1d7). The official .NET administration signature now takes precedence for the complete root entity path, including children such as /orders-servicebus/Subscriptions/processor. Non-.NET AtomPub requests with an explicit /{account}-servicebus/... prefix still use terminal suffix routing. Added topic-child regression coverage; ServiceBusServiceTest passes 22/22.", "tokens": 100} {"id": 1010596, "source": "review", "repo": "floci-io/floci-oci", "text": "Fair point, thanks. Added `FunctionsDetachedInvokeIntegrationTest`: it mocks `FunctionsService`, sends a signed detached invoke to a Phoenix host, holds the worker until the 202 has been received, then asserts the worker saw the caller's tenancy and region. Removing the `withCurrentContext` wrapper from the controller makes it fail with the default tenancy and region. Added in fd26092.", "tokens": 93} {"id": 1010616, "source": "review", "repo": "floci-io/floci", "text": "Fixed, at both ends. The race itself: `DeleteLogStream` and `DeleteLogGroup` now remove the stream record before its events, and `PutLogEvents` checks the stream again under the index lock. A put that passes the second check holds the lock before the delete's event sweep starts, so its events are swept; a put after it finds no stream and returns `ResourceNotFoundException`. `aStreamDeletedAfterThePutChecksItLeavesNoEventsBehind` deletes the stream between the two checks and fails without the change. The refill: an event whose stream exists under no reading of its key is now deleted rather than indexed under a guessed group, as `DeleteLogStream` would have done. Only an older Floci can have left one. `anIndexRefilledFromTheStoreStillTellsTheGroupsApart` now includes your case (`/app`, deleted stream `logs::gone`) and the mirror one.", "tokens": 202} {"id": 1010992, "source": "review", "repo": "gaigresearch/tabletopgames", "text": "It seems a bit repetitive adding these (and misleading since the method is called addTunableParameter, but this is not tunable). I wonder if there's an easy way to get around it... (a note for the future) I played with a few options here. Initially I tried reducing boilerplate by not having these as local properties, but that meant any use of a parameter had to call params.getParameterValue(name)...which was horrendous, and self-defeating. Two specific points: 1) Parameters with a default value but no list of options **are** still tunable, so I don't think the method is ill-named. A custom-JSON file can still be used to specify a range of epsilon if you really wanted to. 2) This is still a significant reduction in boilerplate code compared to the previous version, in which default values were manually set up in code at one point, and possible values set up at another. I'm not saying this is perfect - but it feels more natural to me to set up all the parameter details in a single place in the constructor (plus, I admit, add them to the _reset() method if you want consumers to access them via a local public property). (Open to ideas though!) Yeah those are good points. Not sure what would be better, maybe we'll find something else later.", "tokens": 301} {"id": 1011034, "source": "review", "repo": "gaigresearch/tabletopgames", "text": "Yes. I've missed this too.", "tokens": 10} {"id": 1011197, "source": "review", "repo": "gaigresearch/tabletopgames", "text": "What happens if there is no piece there? We should throw an error or do something?", "tokens": 19} {"id": 1011552, "source": "review", "repo": "gdgahmedabad/awesome-learning-resources", "text": "I think this is not a course but useful tutorials. Please correct me if I am wrong! If this is tutorial link then please include it under \"useful_links\" section!", "tokens": 40} {"id": 1011839, "source": "review", "repo": "geforce132/securitycraft", "text": "This is incorrect. You need to return VoxelShapes.fullCube() when the Cage Trap is not disguised, otherwise return super.", "tokens": 31} {"id": 1011996, "source": "review", "repo": "geforce132/securitycraft", "text": "This is unchanged to en_us, please remove. I don't have to remove it. Yes, this is usually how pull requests go. The reviewer requests something, and the author discusses/adapts. As this line is the same as the original in en_us, we don't need it to be here as it is unnecessary data. If the line is not present here, Minecraft will fall back onto the one in the english language file, which is the same anyways.", "tokens": 103} {"id": 1012038, "source": "review", "repo": "geforce132/securitycraft", "text": "Please revert the indentation changes. Our convention is tabs, not spaces.", "tokens": 15} {"id": 1012121, "source": "review", "repo": "geforce132/securitycraft", "text": "```suggestion \"option.generic.smartModuleCooldown.description\": \"Mennyi ideig nem adhatnak meg jelsz\u00f3t a j\u00e1t\u00e9kosok hib\u00e1s k\u00f3d ut\u00e1n? (Tickekben megadva, 20 tick = 1 m\u00e1sodperc; Okos modul sz\u00fcks\u00e9ges)\", ```", "tokens": 93} {"id": 1012243, "source": "review", "repo": "geysermc/geyser", "text": "This should also add 1.21.130 Doesn't 898 already do that though? nope This should be fixed.", "tokens": 33} {"id": 1012295, "source": "review", "repo": "geysermc/geyser", "text": "Seems like an odd place for a constant like this - might want to put it in a util class. @onebeastchris what do you think? Agreed - i'd honesty just dump it into BedrockItemBuilder", "tokens": 47} {"id": 1012367, "source": "review", "repo": "geysermc/geyser", "text": "We should probably do a null-check here", "tokens": 10} {"id": 1012394, "source": "review", "repo": "geysermc/geyser", "text": "Personally i'd rather move this to InputCache too", "tokens": 13} {"id": 1012698, "source": "review", "repo": "geysermc/mcprotocollib", "text": "```suggestion url 'https://repo.opencollab.dev/main/' ```", "tokens": 19} {"id": 1012776, "source": "review", "repo": "geysermc/packconverter", "text": "```suggestion **This project also does not convert custom items fully, it will only convert the textures, but does not create any Geyser mappings.** ```", "tokens": 31} {"id": 1012951, "source": "review", "repo": "gitlab4j/gitlab4j-api", "text": "Prefer not to override ```toString()``` like this, these often become out of sync. An option here would be to implement```toString()``` using something like this: ``` @Override public String toString() { return (new org.gitlab4j.api.utils.JacksonJson().marshal(this)); } ``` This way the output is always in-sync with the class and outputs strings in the expected format, specifically the dates. We could also consider adding a singleton JacksonJson instance to use for this and elsewhere. For example, the SystemHookManager class has it's own private instance of JacksonJson, which could use the singleton instance also.", "tokens": 133} {"id": 1012953, "source": "review", "repo": "gitlab4j/gitlab4j-api", "text": "If the format is not valid, why not throw a ```GitLabApiException``` indicating an invalid format? The user may be wanting something totally different than \"tar.gz\" and just misspelled it, which should result in an exception.", "tokens": 50} {"id": 1012998, "source": "review", "repo": "gitlab4j/gitlab4j-api", "text": "This should be deprecated not removed. I updated my patch. It was a mistake.", "tokens": 18} {"id": 1013090, "source": "review", "repo": "gitlab4j/gitlab4j-api", "text": "Please add a value in the example file `package-files.json`. This way we are sure the serialisation/deserialisation code works (tested in the `TestGitLabApiBeans` unit test)", "tokens": 44} {"id": 1013186, "source": "review", "repo": "gluufederation/oxauth", "text": "This should be at top: 1) method 2) parameters 3) body Rearranged the details as requested", "tokens": 26} {"id": 1013235, "source": "review", "repo": "gluufederation/oxauth", "text": "Big inner ifs leads to unmaintainable code over time. Just exit earlier, like ``` if (cacheData == null) { log.debug(\"The authentication request has expired for deviceCode: '{}'\", deviceCode); return response(error(400, TokenErrorResponseType.EXPIRED_TOKEN, \"The authentication request has expired\"), oAuth2AuditLog); } ```", "tokens": 77} {"id": 1013321, "source": "review", "repo": "gmu-swe/phosphor", "text": "Instead of boxing to the java.lang.WrapperType, can we either pass the primitives directly or use a phosphor wrapper? the java.lang wrappers can introduce a higher overhead and risk of taint tag loss, since some of those classes can't be modified by phosphor at all (e.g. java.lang.character) - in which case we store the taint tag for that object in a hash map, which is a lot slower. Using the phosphor wrapper type guarantees that we keep the taint and value together.", "tokens": 114} {"id": 1013417, "source": "review", "repo": "gnembon/fabric-carpet", "text": "you know that we will need to rewrite the hollow sphere from this from O(n^3) to a O(n^2) algorithm that is currently in java for draw... but we can do that later. u do realise that ur algorithm for the DrawCommand.java has O(n^3) right... im resarcing rasterization algorithms rn. true, that should use rather trig functions over angles, roughly the way I generate sphere meshes in shapes at https://github.com/gnembon/fabric-carpet/blob/7645312856c1c5970bd5b47970c07a381fc75c75/src/main/java/carpet/script/utils/ShapesRenderer.java#L851 which is definitely rendering at 2D. Don't worry about that here - do whatever is valid and we will continue to work on it as it goes. ![image](https://user-images.githubusercontent.com/53367549/100114508-cbc80e80-2e71-11eb-9b71-892be6da0d8b.png) I believe that this justifies the bruteforce code. Best I could come up with was caching already printed shapes, so u can spam same shape over and over and it's very fast.", "tokens": 330} {"id": 1013558, "source": "review", "repo": "gnembon/fabric-carpet", "text": "I suggest not include implementation details in the documentation, but add information that might be important to the implementer ```suggestion * `'on_move'`: executes every time an entity changes position, invoked just after it has been moved to the new position. Required arguments: `entity, velocity, pos1, pos2` ```", "tokens": 68} {"id": 1013574, "source": "review", "repo": "gnembon/fabric-carpet", "text": "This is just aesthetic and very personal opinion, but I think it would be nice to have those (and the queries) inside an `ability` or `abilities` \"section\" (so it would end up `modify(e, 'ability', 'walk_speed')`). To do those I _think_ you just have to expect a `ListValue` inside the lambda of the `ability`/`abilities` map key instead of a single value, should just be adding a switch on string in there. What do you think? I'll fix all these thing tomorrow. Thank you for the review! abilities is an internal thing. From the outsider, its yet another attributes of players in particular. Hence I don't think there is a need of grouping them under 'abilities' So, is it ok as it is now, with a modify action for each of the abilities?", "tokens": 190} {"id": 1013616, "source": "review", "repo": "gnembon/fabric-carpet", "text": "```suggestion * `'@'` - a URL will be opened when the text below it is clicked. * `'&'` - some text will be copied to clipboard when the text below it is clicked. ``` Use \"a\" instead of \"an\" before \"URL\" ([Writing Explained](https://writingexplained.org/a-vs-an-difference)). Capitalize \"URL\" because it is an acronym. Use \"some text\" instead of \"a text\" as \"text\" is not necessarily atomic. I'll do the first two, not doing the third one because it's referring to the text given in the parameter, and that's the way it's mentioned in the rest of options (I'll add a `that`, because I forgot it in both).", "tokens": 181} {"id": 1013648, "source": "review", "repo": "gnembon/fabric-carpet", "text": "to be honest, that is not necessary and kind of ugly, as u can simply put a Component as a arguments. but maybe some will enjoy in it as it is sometimes useful/handy if u want to add click events to some components together. so i will leave it here.", "tokens": 61} {"id": 1013754, "source": "review", "repo": "gnembon/fabric-carpet", "text": "why do you need that? Can you explain what's wrong with it? here is some shulkers block s render code in net.minecraft.client.renderer.blockentity.ShulkerBoxRenderer it get its block state from its level. ``` public void render(ShulkerBoxBlockEntity shulkerBoxBlockEntity, float f, PoseStack poseStack, MultiBufferSource multiBufferSource, int i, int j) { Direction direction = Direction.UP; if (shulkerBoxBlockEntity.hasLevel()) { BlockState blockState = shulkerBoxBlockEntity.getLevel().getBlockState(shulkerBoxBlockEntity.getBlockPos()); if (blockState.getBlock() instanceof ShulkerBoxBlock) { direction = blockState.getValue(ShulkerBoxBlock.FACING); } } ``` but other block entities get it more directly: here is beds ``` public void render(BedBlockEntity bedBlockEntity, float f, PoseStack poseStack, MultiBufferSource multiBufferSource, int i, int j) { Material material = Sheets.BED_TEXTURES[bedBlockEntity.getColor().getId()]; Level level = bedBlockEntity.getLevel(); if (level != null) { BlockState blockState = bedBlockEntity.getBlockState(); ``` so i have to use a mixin to fix that. as there is not a real shulker box in the world. i read others block entities code. only shulker box write it that way. (if only you can change shulker box`s code, then this file is no longer needed.) problem is you are changing the vanilla code for some use of some mod. If you change this, does it mess up rendering of shulker boxes in some other places? what about in the inventory? All in all, carpet should strive to preserve vanilla implementation at all cost, even if it ends up in ugly code, or causing things to not be perfect. i tried. and i did not find any problem in rendering at all. and i think is the one who write that code forget that he could get it directly. XD If you insist against that minor tweaks to the shulker, I'll try to find some other ways. fixed this in another way. this time no vanilla code changed.", "tokens": 439} {"id": 1013877, "source": "review", "repo": "gotify/android", "text": "How about specifying what priority is meant with \"min\", \"default\", .., so maybe `min priority messages (<1)`, `low priority messages (1-3)`, `normal priority messages (4-7)` and `high priority messages (>7)` Good idea! Otherwise its not immediately obvious which channel maps to which priorities. I just made the change!", "tokens": 81} {"id": 1013929, "source": "review", "repo": "gotify/android", "text": "Use try-with-resources. ```suggestion try (MessagingDatabase db = new MessagingDatabase(this)) { String registeredAppName = db.getAppFromId(message.getAppid()); if (registeredAppName.isEmpty()) { Log.i(\"Forward message to \" + registeredAppName); GotifyPushNotificationKt.notifyClient(this, registeredAppName, message); return; } } showNotification( message.getId(), message.getTitle(), message.getMessage(), message.getPriority(), message.getExtras()); ``` ok done", "tokens": 109} {"id": 1013932, "source": "review", "repo": "gotify/android", "text": "These crashes should still be logged. We can", "tokens": 10} {"id": 1013959, "source": "review", "repo": "gotify/android", "text": "What's _unprecise_ about relative timestamps? As I understand it the difference here is between `relative` and `absolute` timestamps. So for me it would make more sense naming this option `Show absolute timestamps` instead of `Precise date by default` I completely agree with you, to be honest I named it like that only because the boolean variable that was already there was named `preciseDate` and I just wanted to stay coherent. If it's fine to everyone it can be changed to be *relative*/*absolute* time instead of *precise*.", "tokens": 129} {"id": 1013992, "source": "review", "repo": "gotify/android", "text": "```suggestion authentications: Array, ``` Resolved as well in cebf7f4afeda8a5b343de719f95d01a5bea750e3", "tokens": 49} {"id": 1014036, "source": "review", "repo": "gotify/android", "text": "On first start I had some issues becase the library was not found in GotifyApplication.kt. But I'm not sure if the \"runtimeOnly\" could have been the issue or if this was just everday IDE craziness. But it worked again after running it once. I'll change the tinylog-impl dependency to implementation. It's the way documented in their docs. This problem is still very likely unrelated, I did have similar problems after some dependency updates in previous PRs but they disappeared after clearing the cache. Where have you found this? Here it says to use \"implementation\" for Kotlin using Gradle (Groovy): https://tinylog.org/v2/download/#kotlin But it doesn't really have much of an impact. I meant that the the impl-dependency should be defined via implementation instead of runtimeOnly according to the tinylog docs. I've originally got this from an older project, and there tinylog had probably other docs (:.", "tokens": 204} {"id": 1014261, "source": "review", "repo": "graphql-java/graphql-java", "text": "same question as above on null versus AbortExectionException", "tokens": 13} {"id": 1014282, "source": "review", "repo": "graphql-java/graphql-java", "text": "I changed visibility to be the same as master", "tokens": 10} {"id": 1014406, "source": "review", "repo": "graphql-java/graphql-java", "text": "I think this annotation reads better in the IDEA rather than a comment. Maybe we can use it later in some way but honestly its just a more type safe way of saying the same as we try to say in the comment Nice idea. Makes it more official than a comment", "tokens": 55} {"id": 1014649, "source": "review", "repo": "graphql-java/graphql-java", "text": "Is there a particular reason for updating Gradle in this PR?", "tokens": 13} {"id": 1014677, "source": "review", "repo": "graphql-java/graphql-java", "text": "See now we use the cheaper `getTypeOrNull` methods internally", "tokens": 14} {"id": 1014869, "source": "review", "repo": "graphql-java/graphql-java", "text": "same hear ... about not return null for lists.", "tokens": 11} {"id": 1014937, "source": "review", "repo": "guilds-plugin/guilds", "text": "gradle wrapper is currently at version '6.1.1', can be updated with ``` gradlew wrapper --version 6.1.1 ``` in terminal the command is actually ``` gradlew wrapper --gradle-version 6.1.1 ```", "tokens": 53} {"id": 1014962, "source": "review", "repo": "gurkenlabs/litiengine", "text": "in this case, you could also assert equality of `lowerBound` and `currentValue2`. actually, it doesn't even make sense to test against `lowerbound` as it's being retrieved before setting the lower bound (test was still green when commenting out the setter). I changed it to instead make a direct `assertEquals(currentValueX, number.getLowerBound())`. This also simplifies understanding and avoids using `compareTo()` you're right, sorry I overlooked that at first.", "tokens": 105} {"id": 1015168, "source": "review", "repo": "hangarmc/hangar", "text": "```suggestion login: 'Se connecter', ```", "tokens": 13} {"id": 1015182, "source": "review", "repo": "hangarmc/hangar", "text": "```suggestion new: \"Ce projet est nouveau et ne sera pas montr\u00e9 aux autres avant qu'une version ne soit t\u00e9l\u00e9vers\u00e9e. Si une version n'est pas t\u00e9l\u00e9vers\u00e9e apr\u00e8s une longue p\u00e9riode de temps, le projet sera supprim\u00e9.\", ```", "tokens": 98} {"id": 1015231, "source": "review", "repo": "hangarmc/hangar", "text": "```suggestion //jdbi.setSqlLogger(myLogger); // for debugging sql statements ```", "tokens": 21} {"id": 1015798, "source": "review", "repo": "hernanponcedeleon/dat3m", "text": "I found this rather confusing. My first impression was that \"true = +\" and I was confused when I saw `makePlusX` in the factory get `false` as parameter. Rather than sign it might be more clear to call it `isNegative` Technically, the cleanest variant is to use an `enum Sign { POSITIVE, NEGATIVE; }` I think. But I can also change the boolean to a `isNegative` Changed to `isNegative`", "tokens": 97} {"id": 1015874, "source": "review", "repo": "hernanponcedeleon/dat3m", "text": "I would probably do `Preconditions.checkState(nextColorIndex < KELLY_COLORS.length - 1, \"Not enough colors\")` rather than doing the silent wraparound. In practice it won't matter (no one shows so many relations), but I think it is better to be notified if we ever run into this problem. That is certainly not the behavior I want dartagnan to have. Even if the user requested many relations, we should handle this case and thus I made the wrap around on purpose. That being said, we could log a warning the let the user know it might not be a good idea to request that many relations. Logging a warning is fine.", "tokens": 145} {"id": 1015968, "source": "review", "repo": "hernanponcedeleon/dat3m", "text": "I think switch would look better here, insread of many ifs", "tokens": 16} {"id": 1016231, "source": "review", "repo": "hpi-swa/trufflesqueak", "text": "`SqueakImageWriter.write()` is behind a `@TruffleBoundary`, so it is not part of the Truffle compilation. Therefore, it doesn't make sense to call `CompilerDirectives.transferToInterpreterAndInvalidate()` here. and in the other setter I added those because I saw that `headerFlags` were marked `@CompilationFinal` and thought that there would be the possibility of some code making assumptions of the value staying constant. Should we remove the annotation since it is not necessary? Some values we do want to consider `@CompilationFinal`, so it might make sense to keep headerFlags marked as such. The problem here is that the callee of the getter is different to the setter. So when the value is set, the wrong callee is invalidated and the methods that have the getter compiled in aren't invalidated. We can use an assumption for more fine-grained control: an assumption check is free in compiled code, invalidating an assumption causes all compiled code checking the assumption to be invalidated. It probably makes sense to use a CyclicAssumption for the headerFlags, invalidate it in the setter, and check it in all methods that read the field. Do you want to give this a try? Here's what you could start with in `SqueakImageFlags`: ```java private final CyclicAssumption headerFlagsAssumption = new CyclicAssumption(\"constant headerFlags\"); ``` I think I did what you had in mind in the latest commit...", "tokens": 303} {"id": 1016332, "source": "review", "repo": "hpi-swa/trufflesqueak", "text": "Maybe `SavedExecutionState` could implement `Closable`, so we can use it in a try-with-resources statement? Something like: ``` try (var _ = image.suspendNormalExecution()) { // ... } ``` Great idea! Unfortunately, native image doesn't like the try-with-resource shortcut on the fast path and checkstyle doesn't like underscore as a variable name. The code is all set to handle it whenever those restrictions change! Indeed, try-with-resources statements seem to use `Throwable.addSuppressed()` for exceptions thrown in the block, and that method is blocklisted because it's non-trivial and may allocate an `ArrayList`.", "tokens": 140} {"id": 1016376, "source": "review", "repo": "hub4j/github-api", "text": "```suggestion assertThat(event.getChanges().getTitle(), nullValue()); ```", "tokens": 16} {"id": 1016513, "source": "review", "repo": "hub4j/github-api", "text": "Well, this is was a bug. Nice pickup! Thanks for reviewing this PR \ud83c\udf89", "tokens": 20} {"id": 1016550, "source": "review", "repo": "hub4j/github-api", "text": "```suggestion // the repository information provided here is so limited ```", "tokens": 13} {"id": 1016676, "source": "review", "repo": "hub4j/github-api", "text": "You could also add a check that the repository in the parameter is a template repository. Done. I have included several unit tests to verify the behavior. Do you think the handled exception is appropriate? ```java @Preview(BAPTISTE) public GHCreateRepositoryBuilder fromTemplateRepository(GHRepository templateRepository) { Objects.requireNonNull(templateRepository, \"templateRepository cannot be null\"); if (!templateRepository.isTemplate()) { throw new IllegalArgumentException(\"The provided repository is not a template repository.\"); } return fromTemplateRepository(templateRepository.getOwnerName(), templateRepository.getName()); } ``` Unit Test ```java /** * Test create repository with template repository null. */ @Test public void testCreateRepositoryFromTemplateRepositoryNull() throws IOException { cleanupRepository(GITHUB_API_TEST_ORG + '/' + GITHUB_API_TEST); GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); assertThrows(NullPointerException.class, () -> { org.createRepository(GITHUB_API_TEST) .fromTemplateRepository(null) .owner(GITHUB_API_TEST_ORG) .create(); }); } /** * Test create repository when repository template is not a template. */ @Test public void testCreateRepositoryWhenRepositoryTemplateIsNotATemplate() throws IOException { cleanupRepository(GITHUB_API_TEST_ORG + '/' + GITHUB_API_TEST); GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); GHRepository templateRepository = org.getRepository(GITHUB_API_TEMPLATE_TEST); assertThrows(IllegalArgumentException.class, () -> { org.createRepository(GITHUB_API_TEST) .fromTemplateRepository(templateRepository) .owner(GITHUB_API_TEST_ORG) .create(); }); } ```", "tokens": 368} {"id": 1016680, "source": "review", "repo": "hub4j/github-api", "text": "@gsmet Ugh. The events api is all over the place. The `added` action has a `role_name` and states that `permission` is obsolete. But the `edited` action has `permission` and `old_permission`, with no note about either of those being obsolete. And they both are returned under the `changes` parameter. https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=added#member https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=edited#member I guess this class is okay. It is incomplete, but the other fields can be added later without causing a breaking change. I did some tests for permission and old_permission wasn\u2019t there. I need to check for role_name though. I will have a look. Yeah so that's what I thought, `role_name` wasn't in the payload I obtained... They might change it at some point, I don't know. I'll have a look at adding `role_name` for a future version but it's going to be untested.", "tokens": 252} {"id": 1016836, "source": "review", "repo": "hypixeldev/publicapi", "text": "You leaked your API key here? ```suggestion \"key\": \"\", ``` It's a random v4 uuid intentionally to indicate that it's dashed Ah, my bad haha. Makes sense to include this, though", "tokens": 47} {"id": 1016837, "source": "review", "repo": "hypixeldev/publicapi", "text": "This should first try to use `displayname`, if it's null, then last element of `knownAliases`, if there's none, then `playername`, and then `username`. Should we bother checking `playername` since its meant to be a lowercase variant? If we're not checking `knownAliasesLower` as well, I don't see the need to check this one. Do you know of any players who only have a `playername` and no `displayname`? Yes, there are players with no displayname. Not sure if we should check `playername` and `username`, but I guess lowercase name is better than nothing. About `knownAliasesLower`, I think if there's no `knownAliases`, then there would be no `knownAliasesLower` too.", "tokens": 169} {"id": 1016993, "source": "review", "repo": "iluwatar/30-seconds-of-java", "text": "```suggestion return SPHERERADIUS_IN_KM * c; ``` More readable. Cannot rename to SPHERERADIUS_IN_KM because of Checkstyle (https://checkstyle.sourceforge.io/config_naming.html#AbbreviationAsWordInName) as its a local variable, not a class field and I think in this repo we usually keep snippets limited to only methods.", "tokens": 78} {"id": 1017024, "source": "review", "repo": "iluwatar/30-seconds-of-java", "text": "I don't like using an external buffer outside the sorting method. It doesn't look clean and is more difficult to understand. For example the implementation presented [here](https://www.baeldung.com/java-merge-sort) could be better. okay, thank you for reviewing, i'll trying different way. thank's for reference", "tokens": 75} {"id": 1017356, "source": "review", "repo": "incendo/cloud", "text": "We should probably determine the input outside of the stream, as we end up doing a lot of unnecessary work otherwise. ```suggestion final String input; if (context.commandInput().isEmpty(true /* ignoreWhitespace */)) { input = \"\"; } else { input = context.commandInput().skipWhitespace().remainingInput(); } return suggestions.map(suggestion -> { ```", "tokens": 74} {"id": 1017394, "source": "review", "repo": "influxdata/influxdb-client-java", "text": "Add `final` modifier: ```suggestion public void setLimit(@Nullable final Integer limit) { ```", "tokens": 21} {"id": 1017481, "source": "review", "repo": "influxdata/influxdb-client-java", "text": "Please use `generic` interface: ```suggestion public List getRow() { ```", "tokens": 20} {"id": 1017489, "source": "review", "repo": "influxdata/influxdb-client-java", "text": "Please, can you keep also this constructor\u2026 just for backward compatibility.", "tokens": 15} {"id": 1017638, "source": "review", "repo": "influxdata/influxdb-java", "text": "is it also possible to test against expected Exception message ? No problem, 0254cbcec68ae936a42446fd2f5d01e7f38fd9ff", "tokens": 50} {"id": 1017986, "source": "review", "repo": "itzg/mc-image-helper", "text": "Theres no validation on the outputDirectory. If you pass a directory that doesn't exist, it produces an obfuscated `NoSuchFileException`. I would add a brief check before you Load the manifest, checking if the directory exists, either creating the directory or exiting with an error ```suggestion if (Files.isDirectory(Path.of(...))) {} final VanillaManifest prevManifest = Manifests.load(outputDirectory, VanillaManifest.ID, VanillaManifest.class); ``` This is actually bit of a Java-ism since exceptions are not just annoying, they're powerful. In this case, why bother preemptively checking if the directory exists if the final file operation at the OS level is always going to be checking and throw an `IOException`? Catching and wrapping exceptions is the way to de-obfuscate an exception, much like `fmt.Errorf(\"... %w\")` in Go. Now if the operation were to break things by creating a file when the path actually should have been a directory, then a preemptive conditional makes sense.", "tokens": 223} {"id": 1018238, "source": "review", "repo": "jabref/jabref", "text": "Let's analyze: can this value be ever null or empty? I didn't found a place where a null is set, and there is always some default value, so this check is redundant. And `if` is also redundant", "tokens": 49} {"id": 1018296, "source": "review", "repo": "jabref/jabref", "text": "\ud83e\udd16 Generated with [Claude Code](https://claude.com/claude-code) Fixed: pushes plain BibTeX, no JabRef metadata. 67ceeed7288921b1d97bb00e22bb2c869322eeb7", "tokens": 69} {"id": 1018321, "source": "review", "repo": "jabref/jabref", "text": "This is good. Let's keep this. Yes, this is nice, as all context is in the description with links!", "tokens": 27} {"id": 1018358, "source": "review", "repo": "jabref/jabref", "text": "Reviewed, but I kept the explicit checks here. These branches call `XMLStreamWriter` methods that throw checked `XMLStreamException`; `Optional.ifPresent` lambdas cannot propagate it without unchecked wrapping. The exporter tests pass.", "tokens": 48} {"id": 1018533, "source": "review", "repo": "jabref/jabref", "text": "P2 \u2014 Add a regression test for actual search matching This test verifies that SearchQuery normalizes the DOI URL and preserves the original expression, but it does not verify that searching an actual BibEntry with the full DOI URL returns the expected entry. Could we add a regression test covering the actual search/matching behavior for a DOI URL? Yeah, good point. Just checking the parsed string doesn't really test the actual case. I'll add a BibEntry with a DOI and check that the full URL matches it properly.", "tokens": 116} {"id": 1018676, "source": "review", "repo": "java9-modularity/gradle-modules-plugin", "text": "I'd rename `bashScript` to `scriptContent` and `updatedBashScript` to `updatedScriptContent` (as it's used both for Bash and Bat scripts). PS. Ha, I see it's the same as in the already existing `replaceLibsPlaceHolder` method. Anyway, I think it might be worth improving in both places.", "tokens": 82} {"id": 1018976, "source": "review", "repo": "jbake-org/jbake", "text": "Great. I think the cache stuff can be replaced with ``` - name: Setup Gradle uses: gradle/actions/setup-gradle@v5 ``` See https://github.com/gradle/actions/blob/main/docs/setup-gradle.md for details. Yup, makes sense. I updated the commit - https://github.com/jbake-org/jbake/pull/791/commits/61a12e3bae8c47d94ead1335e52dfd81ec118857", "tokens": 122} {"id": 1018985, "source": "review", "repo": "jbangdev/jbang", "text": "should have \"converter=CommaSeparatedConverter.class\"", "tokens": 12} {"id": 1019068, "source": "review", "repo": "jbangdev/jbang", "text": "Is there a way you chose a different name here than the name of the provider itself? (\"linuxdistro\" vs \"nixdistro\")", "tokens": 30} {"id": 1019117, "source": "review", "repo": "jbangdev/jbang", "text": "Same here. solved by ca23d2880668d0958bc9ac40636fbf837e6fff78", "tokens": 41} {"id": 1019355, "source": "review", "repo": "jcbvm/i18n-editor", "text": "_PreviousTranslationErrorMenuItem_ has been copied/pasted from _ExpandTranslationsMenuItem_ and will require a unique ID.", "tokens": 28} {"id": 1019437, "source": "review", "repo": "jchambers/pushy", "text": "It doesn't seem like we need to make the connection count unique per push manager. We could just name the connection like this: this.name = String.format(\"ApnsConnection-%s-%d\", listener.getName(), ApnsConnection.connectionCounter.getAndIncrement()); So in our logs we would see: \"ApnsConnection-Sandbox-1\" \"ApnsConnection-Enterprise-2\" \"ApnsConnection-Sandbox-3\" versus \"ApnsConnection-Sandbox-1\" \"ApnsConnection-Enterprise-1\" \"ApnsConnection-Sandbox-2\" Which seems like it will work great and doesn't involve the more complex static methods for keeping a mapping of push manager -> connection count.", "tokens": 149} {"id": 1019541, "source": "review", "repo": "jchambers/pushy", "text": "Good news! Looks like Apple fixed the delivery-after-rejection issue upstream!", "tokens": 19} {"id": 1019567, "source": "review", "repo": "jchambers/pushy", "text": "I get why we want to define version numbers for things like `alpAgent` in properties, since we use them in several places in here, and we definitely want to be consistent. Would it make more sense to inline `alpn-api.version`, though? It looks like we only use it in one place. I'm very open to arguments that, since it's sensitive to the version of Netty we're using, the ALPN API version and Netty version should be close to each other for readability.", "tokens": 109} {"id": 1019647, "source": "review", "repo": "jchambers/pushy", "text": "If I'm reading this right (and I may be missing something!), it seems like we're never actually _cancelling_ these futures, right? We're just waiting for them to finish on their own? Yes. I think: 1. canceling these futures may cause `ApnsChannelPool.this.metricsListener.handleConnectionCreationFailed()` on line 168 called but it is not a abnormal creation failure; 1. cancelling these futures have no effect on the underlying connecting APNs process; 1. it looks safe for waiting for them to finish on their own, because these channel will be closed finally; In that case, I wonder if we'd be better-served by using a [`PromiseCombiner`](https://netty.io/4.1/api/io/netty/util/concurrent/PromiseCombiner.html) rather than maintaining our own countdown: ```java final Promise waitForPendingCreateChannelFuturesPromise = new DefaultPromise<>(ApnsChannelPool.this.executor); final PromiseCombiner combiner = new PromiseCombiner(ApnsChannelPool.this.executor); for (final Future future : pendingCreateChannelFutures) { combiner.add(future); } combiner.finish(waitForPendingCreateChannelFuturesPromise); // Wait for waitForPendingCreateChannelFuturesPromise to finish, then move on to other operations ``` I think that will simplify things a lot and also clarify that we're just waiting for things to wrap up to control the order of operations rather than actively changing the state of pending operations. Seem legit? Also, please let me acknowledge that `waitForPendingCreateChannelFuturesPromise` is a terrible name and can certainly be refined ;) `PromiseCombiner` sounds cool. Let me fix it. > Also, please let me acknowledge that `waitForPendingCreateChannelFuturesPromise` is a terrible name and can certainly be refined ;) I think the name is OK. It maybe a little long but pretty descriptive.", "tokens": 427} {"id": 1019725, "source": "review", "repo": "jdi-testing/jdi-light", "text": "We have a rule that we don't use get at the beginning of a method. Please check it elsewhere too ![image](https://user-images.githubusercontent.com/74856431/214813205-1a4d640a-ebc8-495d-a08d-9e3d2f6a63ba.png) https://jdi-family.atlassian.net/wiki/spaces/JDIL/pages/47349767/Pages+and+elements+management\\", "tokens": 133} {"id": 1019775, "source": "review", "repo": "jdi-testing/jdi-light", "text": "The value must be compared with true or false as we already have custom error message This is misleading: [Pages and elements management. Not-allowed](https://jdi-family.atlassian.net/wiki/spaces/JDIL/pages/47349767/Pages+and+elements+management#Not-allowed) > Do not use [Matchers.is](http://matchers.is/)(true/false) in the asserts. A ternary operator should be used instead. Probably we need to add that this is only for cases without custom messages. Fixed", "tokens": 126} {"id": 1019789, "source": "review", "repo": "jdi-testing/jdi-light", "text": ":) 'inline or not'? Fixed", "tokens": 10} {"id": 1020012, "source": "review", "repo": "jenkinsci/ansicolor-plugin", "text": "Is this a new minimum version? Where is this used? This would be the new minimum version. This property appears to be used in the parent pom for dependencies (the `org.jenkins-ci.plugins:plugin:2.25` version). The updated dependency on `workflow-step-api` requires the Jenkins version as the base, and the tests fail with lots of classloading errors if at least this version isn't used. There _may_ be some hackery that can done to avoid bringing in the new workflow API version for https://github.com/jenkinsci/ansicolor-plugin/pull/109/files#diff-8c1fae68c810376b2cd62d70313c4c3cR72 , but I am not confident in my Jenkins plugin development knowledge to make a decision on this stuff. I think that's OK, we can bump things, but we need to document the minimum new requirement clearly in CHANGELOG and README and probably increment a major version of the plugin in this PR.", "tokens": 235} {"id": 1020099, "source": "review", "repo": "jenkinsci/bitbucket-branch-source-plugin", "text": "This line will fail if the job already got \"disabled\" (e.g. due to not building feature branches that are also build in a Pull Request). The job will forever be stuck in Bitbucket as \"In Progress\" and the user will never be able to merge it.", "tokens": 58} {"id": 1020149, "source": "review", "repo": "jenkinsci/bitbucket-branch-source-plugin", "text": "Are these changes simply mandated by an `scm-api` update to a released version, before proceeding with your changes?", "tokens": 28} {"id": 1020286, "source": "review", "repo": "jenkinsci/bitbucket-branch-source-plugin", "text": "The added md5Hex call looked surprising but I now see you just moved it from the BitbucketBuildStatus constructor. looks like it was added to avoid issues with longer names https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/15", "tokens": 54} {"id": 1020495, "source": "review", "repo": "jenkinsci/blueocean-plugin", "text": "I believe the `augmentCapabilities` is baked into `Fetch.fetchJSON` by default", "tokens": 20} {"id": 1020585, "source": "review", "repo": "jenkinsci/blueocean-plugin", "text": "This only checks for the previous run URL bcause I couldn't find a way to get any other runs except for \"latestRun\". Except for this problem I think everything else is ok.", "tokens": 42} {"id": 1020607, "source": "review", "repo": "jenkinsci/blueocean-plugin", "text": "@jtnord Build is failing as jacoco wants 100% class coverage. > [WARNING] Rule violated for bundle blueocean-rest-impl: classes missed count is 1.00, but expected maximum is 0.00", "tokens": 55} {"id": 1020614, "source": "review", "repo": "jenkinsci/blueocean-plugin", "text": "@olamy This should always be true, no? We do not want to disable this check. ohh gloupss I changed the code but not this one. Fixed! Well we have more problems now.... jenkins.branch.OrganizationFolder from branch-api is marked as @Restricted({NoExternalUse.class}) and we use it. As it's external, I cannot move it. problem fixed with upgrade branch-api to 2.0.20", "tokens": 104} {"id": 1020934, "source": "review", "repo": "jenkinsci/blueocean-plugin", "text": "Note that #2503 may have helped, but the test was dubious to begin with. In fact CloudBees is experimenting with disabling Internet access during PCT runs, to reduce flakiness, which I think would cause this test to hang.", "tokens": 58} {"id": 1021003, "source": "review", "repo": "jenkinsci/build-monitor-plugin", "text": "Maybe instead of extracting a constant we could extract a factory method producing a `PathToAsset`, taking `base` as its parameter?", "tokens": 28} {"id": 1021017, "source": "review", "repo": "jenkinsci/build-monitor-plugin", "text": "Can we extract this into a function (like `sanitiseHTML` or something like that) and chain with `fetchJobViews` perhaps? `fetchJobViews().then(sanitiseHTML).then(function(response) {...`", "tokens": 59} {"id": 1021119, "source": "review", "repo": "jenkinsci/build-pipeline-plugin", "text": "Was this accidental? Looks like this should be reverted", "tokens": 11} {"id": 1021126, "source": "review", "repo": "jenkinsci/build-pipeline-plugin", "text": "See https://github.com/jenkinsci/job-dsl-plugin.", "tokens": 16} {"id": 1021249, "source": "review", "repo": "jenkinsci/code-coverage-api-plugin", "text": "I'd really like to see javadoc comments for at least all the public methods OK, I will add javadoc comments for all classes and methods this week.", "tokens": 32} {"id": 1021278, "source": "review", "repo": "jenkinsci/code-coverage-api-plugin", "text": "It is not correct, because implementations are in external plugins. Links should be provided so that the guideline is explicit about that", "tokens": 27} {"id": 1021312, "source": "review", "repo": "jenkinsci/code-coverage-api-plugin", "text": "shouldn't be needed, run: `mvn incrementals:incrementalify` https://github.com/jenkinsci/incrementals-tools but our plugin is currently not released, so we need this to download the checks dependencies That\u2019s automatically added by the maven profile that incrementals adds behind the scenes can you fix this please? ok, done now.", "tokens": 74} {"id": 1021411, "source": "review", "repo": "jenkinsci/code-coverage-api-plugin", "text": "It makes sense to use constants in the expressions for the whole test so this is better understandable. Something like JACOCO_LARGE_MISSED_LINES, JACOCO_SMLL_COVERES_LINE. Then you can let Java sum up these values for you.", "tokens": 57} {"id": 1021537, "source": "review", "repo": "jenkinsci/code-coverage-api-plugin", "text": "This should be actually handled by the formatter It added this regarding to formatDelta(...) directly below. What is your suggestion here? Moving both methods to the formatter? No, seems that I looked at the wrong class. This is fine here.", "tokens": 49} {"id": 1021834, "source": "review", "repo": "jenkinsci/configuration-as-code-plugin", "text": "is this still required? nope. Just resolved the merge conflict", "tokens": 14} {"id": 1021864, "source": "review", "repo": "jenkinsci/configuration-as-code-plugin", "text": "aren't we missing a test for overriding the strategy via config file? Do you mean overriding it via the CasC file? How can I get the value if there are multiple files which have different name? yeah, shouldn't this be set automatically by the SelfConfigurator? (serially) I'm not 100% sure @jetersen seemed to be suggesting it could be done that way IMO, the strategy setting is above the CasC file. We need the strategy name before trying to merging them. I think not a blocker anyway if you can resolve the other issues, we should be able to ship", "tokens": 134} {"id": 1021881, "source": "review", "repo": "jenkinsci/configuration-as-code-plugin", "text": "I don't see any reason to add the binary of these plugins, just include them as test dependencies (which I believe most of them are) in the pom of the integrations project Only scm api plugin is there but the rests are properly transitive dependencies already. https://github.com/jenkinsci/configuration-as-code-plugin/blob/faba0f7d0cf8e34015199edeae2a3e1270ee20f9/integrations/pom.xml#L291-L295 See the reason here: https://github.com/jenkinsci/configuration-as-code-plugin/pull/1791#discussion_r762444212 For some reason GitHub cannot properly link to the comment at least I cannot find the comment. its in a resolved conversation which breaks linking i've unresolved", "tokens": 194} {"id": 1022029, "source": "review", "repo": "jenkinsci/configuration-as-code-plugin", "text": "Using Jenkins.getInstanceOrNull() changes the semantics from \"Jenkins isn't available\" to \"the URI isn't supported.\" Unless there's a known requirement for this method to be callable before Jenkins initialization, I'd prefer Jenkins.get() because it fails fast and surfaces lifecycle issues rather than masking them.", "tokens": 68} {"id": 1022193, "source": "review", "repo": "jenkinsci/credentials-plugin", "text": "No author tags, and real javadoc comments for all non override methods (protected and above) and all fields (private and above) I'll fix those up I went through and removed author tags as asked. You had a couple yourself :relaxed: Done, done :+1:", "tokens": 58} {"id": 1022276, "source": "review", "repo": "jenkinsci/credentials-plugin", "text": "Potentially wrong term What would you suggest? Still undefined due to lack of followup for the last 8 months.", "tokens": 27} {"id": 1022420, "source": "review", "repo": "jenkinsci/credentials-plugin", "text": "BTW it is irritating that the refactoring tool insists on moving nested classes around.", "tokens": 22} {"id": 1022490, "source": "review", "repo": "jenkinsci/docker-plugin", "text": "Good idea, I think exclusive should be good for this. So if exclusive = false then it's Normal-Mode, if true then its Exclusive-Mode.", "tokens": 35} {"id": 1022508, "source": "review", "repo": "jenkinsci/docker-plugin", "text": "Help page is here src/main/webapp/help/system-config/master-slave/usage.html Jellly: hudson/slaves/DumbSlave/configure-entries.jelly Existed form: lib/form/slave-mode.jelly Just reuse form and change variable to real Mode object.", "tokens": 68} {"id": 1022683, "source": "review", "repo": "jenkinsci/docker-plugin", "text": "Not a problem, can be changed later. I don't expect that somebody will implement this outside this plugin.", "tokens": 24} {"id": 1022765, "source": "review", "repo": "jenkinsci/docker-plugin", "text": "if you pull a layer there will be this nice `[====> ]` progress indicator. So the status will be the same with an updated progress until the layer was pulled completely. I thought it would be enough to log every status once and not the progress.", "tokens": 55} {"id": 1022880, "source": "review", "repo": "jenkinsci/docker-plugin", "text": "Code style: This plugin code doesn't use `this` except where it's necessary. ==> 9a7c9952b35c1ca4595827b95dc4ca4fd45691b8", "tokens": 60} {"id": 1022906, "source": "review", "repo": "jenkinsci/docker-plugin", "text": "Please add text that explains that this has no effect on the Jenkins functionality - these are not labels for the Jenkins Slave Node, these are only _docker_ labels that can be seen via `docker inspect` etc. It would also be nice if you could give some hints or examples regarding what a user might use this for. e.g. what are you using it for? Good documentation _really_ helps with the usability of software :grin:", "tokens": 98} {"id": 1022968, "source": "review", "repo": "jenkinsci/docker-plugin", "text": "Please add a LF at the end of the file.", "tokens": 13} {"id": 1023017, "source": "review", "repo": "jenkinsci/docker-plugin", "text": "```suggestion 2.346.1 ```", "tokens": 21} {"id": 1023036, "source": "review", "repo": "jenkinsci/docker-plugin", "text": "@MarkEWaite I removed these two tests because the base class (`Cloud`) now throws an `IllegalArgumentException` that does not allow the creation of `DockerCloud`. The warning log message will now never be generated. Thanks @car-roll ! Has the base class been extended to handle upgrades on systems that already have a Docker cloud named with an empty string? If not, that seems like it will be needed in order to not break upgrades. So the base class has not been extended to support empty string Cloud names, but support is still there as I did not touch the `readResolve` in `DockerCloud`. Just to clarify what I meant, I believe the code that these two tests are testing (`testConstructorWithEmptyName` and `testConstructorWithNullName`) are testing the constructor itself https://github.com/jenkinsci/docker-plugin/blob/ccec39ca5e6f72ff98e7d1d33367dd104603df4c/src/main/java/com/nirima/jenkins/plugins/docker/DockerCloud.java#L136 However, with this new jenkins version, we are now failing on the `super(name)` call, so that log message will now never be called. Test-wise, I do not think I can reproduce this scenario with the new Jenkins version. The only time now we will have to deal with a null name constructor should be in existing cloud names, which is tested in `testCopyConstructor`.", "tokens": 323} {"id": 1023115, "source": "review", "repo": "jenkinsci/docker-workflow-plugin", "text": "All of these whitelists are in a subsequent `script-security` release, which I needed to update to in order to update `workflow.version`, which in turn I needed to do for reasons explained above to @amuniz.", "tokens": 49} {"id": 1023261, "source": "review", "repo": "jenkinsci/docker-workflow-plugin", "text": "I think it would be a little clearer to use a `/` string. Also, do we need to make sure we don't trim mismatched quotes like `'foo\"`? Maybe better to use something like this: ```suggestion dockerfile = dockerfile.replaceAll(/^('|\")(.*)(\\1)$/, \"$2\") ```", "tokens": 74} {"id": 1023267, "source": "review", "repo": "jenkinsci/docker-workflow-plugin", "text": "Imports to facilitate changes to test ```suggestion import org.hamcrest.collection.IsMapWithSize; ``` It seems we might be limited to hamcrest 1.3? MapWithSize seems not part of hamcrest 1.3: http://hamcrest.org/JavaHamcrest/javadoc/1.3/ Is it feasible to use a different/newer hamcrest here?", "tokens": 84} {"id": 1023297, "source": "review", "repo": "jenkinsci/docker-workflow-plugin", "text": "incorrect formatting, missing `id` and `subsystem`", "tokens": 13} {"id": 1023300, "source": "review", "repo": "jenkinsci/docker-workflow-plugin", "text": "Right now this branch always runs, because `String.contains(\"\")` is always true. I think you meant something like this: ```suggestion if (variable.getKey().contains(\"\\\"\") || variable.getValue().contains(\" \")) { ``` It was intended to search for spaces in the the key, but as you pointed out this is already handled by the `WindowsUtil` function", "tokens": 76} {"id": 1023428, "source": "review", "repo": "jenkinsci/ec2-plugin", "text": "why is this if statement required? while this would probably work a couple of suggestions but feel free to ignore if maintainers just want the quick fix... 1. The current constructor isn't a 'correct' `DataBoundConstructor`, it has 'mandatory' fields that aren't used in databinding, i.e. `spotBlockReservationDurationStr` is bound to `spotBlockReservationDuration` This could be solved by deprecating the existing constructor, fixing the parameters in a new constructor and updating any calling code / views. 2. It would be good to extend the test to verify that this works and it doesn't get broken in the future, here's the existing test: https://github.com/jenkinsci/ec2-plugin/blob/master/src/test/java/hudson/plugins/ec2/ConfigurationAsCodeTest.java I kinda agree with @timja fix the databound constructor. Make if follow java beans standards not even sure why it takes in strings when stapler and jelly have full support for numbers. btw while your at it make the data bound constructor only have mandatory fields and use data bound setters for optional fields. See https://issues.jenkins-ci.org/browse/JENKINS-57513", "tokens": 262} {"id": 1023483, "source": "review", "repo": "jenkinsci/ec2-plugin", "text": "Adding `@PowerMockIgnore({\"javax.crypto.*\", \"org.hamcrest.*\", \"javax.net.ssl.*\", \"com.sun.org.apache.xerces.*\", \"javax.xml.*\", \"org.xml.*\"})` as seen AmazonEC2CloudUnitTest.java and EC2StepTest.java in might resolve the test failure oh hey I actually forgot about this PR... let me try that, thanks!", "tokens": 102} {"id": 1023497, "source": "review", "repo": "jenkinsci/ec2-plugin", "text": "would [form:dropdownDescriptorSelector](https://reports.jenkins.io/core-taglib/jelly-taglib-ref.html#form:dropdownDescriptorSelector) do all of this in one shot? [code](https://github.com/jenkinsci/jenkins/blob/53f300d5ec07eb5efa3774d3f12455615d2f3450/core/src/main/resources/lib/form/dropdownDescriptorSelector.jelly)", "tokens": 116} {"id": 1023749, "source": "review", "repo": "jenkinsci/ec2-plugin", "text": "not related to the bug fix here , but added a `help` for this option", "tokens": 19} {"id": 1023790, "source": "review", "repo": "jenkinsci/ec2-plugin", "text": "```suggestion Our goal here is to call the EC2RetentionStrategy#check, which invokes the EC2AbstractSlave#idleTimeout. To make it possible, the Computer#getIdleStartMilliseconds() should return a value that is matches, (Current time - IdleStartTime) > Idle Termination Minutes. The mock based setup doesn't allow us to force old value to be returned for `Computer#getIdleStartMilliseconds()`, ```", "tokens": 94} {"id": 1023802, "source": "review", "repo": "jenkinsci/email-ext-plugin", "text": "I always like this idiom better for resources: ``` try { final BufferedReader = new BufferedReader(new FileReader(build.getLogFile())); try { return getContent(reader, args); } finally { reader.close(); } } catch (IOException ex) { LOGGER.log(Level.SEVERE, null, ex); return \"\"; } ```", "tokens": 68} {"id": 1023837, "source": "review", "repo": "jenkinsci/email-ext-plugin", "text": "I would rather have this be an option somehow rather than do it for all HTML emails.", "tokens": 20} {"id": 1023992, "source": "review", "repo": "jenkinsci/email-ext-plugin", "text": "The only checked exception that can be thrown is `JsonProcessingException` so why catch the generic exception? It adds no benefit in this scenario and is generally a bad practice (anti-pattern).", "tokens": 40} {"id": 1024148, "source": "review", "repo": "jenkinsci/embeddable-build-status-plugin", "text": "For that URL, you have to be authenticated, courtesy of @PresetData(PresetData.DataSet.NO_ANONYMOUS_READACCESS)", "tokens": 32} {"id": 1024204, "source": "review", "repo": "jenkinsci/ghprb-plugin", "text": "To reiterate: publishedURL is not a job-level setting but a system setting.", "tokens": 20} {"id": 1024227, "source": "review", "repo": "jenkinsci/ghprb-plugin", "text": "A much cleaner way would be to ignore all comments from the bot user. Indeed that was the case in the past (see https://github.com/janinko/ghprb/issues/25), but the `repo.isMe()` check was removed in 1b0767ce2bfb709bab8e3cde6c11d54205487aea, so someone could now rely on that behavior. I'm not 100% happy with the check I introduced, as I imagine it could fail if text/character encoding or some other issues prevent the string from being equal. @valdisrigdon Do you think it is better to change that again?", "tokens": 155} {"id": 1024240, "source": "review", "repo": "jenkinsci/ghprb-plugin", "text": "To answer @valdisrigdon, if you ever delete the build description and save the config then it will be lost, and the only way to get it back would be to recreate it manually. @pdpi your value was set, I am assuming, because it was the first time installing and running the plugin, so it was saved to the xml file, then once you delete the field it would remain blank.", "tokens": 89} {"id": 1024403, "source": "review", "repo": "jenkinsci/ghprb-plugin", "text": "However, it should be !(build.getProject() intanceof MatrixProject) since children jobs return false when checking if its an instance of a matrix project but return true for showMatrixStatus. I will fix this up as well as the parenthesis, and account for the null pointers on my next commit", "tokens": 63} {"id": 1024429, "source": "review", "repo": "jenkinsci/ghprb-plugin", "text": "`getParameter` will not return parameters which are defined by the trigger, that's the whole point of the security fix. You need to call the new `getAllParameters` method to get them, which is only available in very recent core. That's what I initially did in https://github.com/jenkinsci/ghprb-plugin/pull/336/commits/5d100239cf1b1484e2890a7f5e702288020e0225, but the approach did not convince other contributors.", "tokens": 129} {"id": 1024467, "source": "review", "repo": "jenkinsci/ghprb-plugin", "text": "Thanks for extracting that into a method. Awesome.", "tokens": 12} {"id": 1024728, "source": "review", "repo": "jenkinsci/git-client-plugin", "text": "Please move this import back to the prior position. Unsorted import statements are not as bad as conflicts being generated in other pull requests due to white space differences", "tokens": 32} {"id": 1024824, "source": "review", "repo": "jenkinsci/git-client-plugin", "text": "Does this also need a null pointer check? ```suggestion if (threads != 0) { ``` Even if we put a check on the null, we'd like to do nothing with the var and return the command itself. I believe in this case it would not make any difference if we catch it or not.", "tokens": 65} {"id": 1024842, "source": "review", "repo": "jenkinsci/git-client-plugin", "text": "Please remove the pure white space changes in the existing files. ```suggestion cliGitCommand.run(\"clone\", \"--reference\", f.getCanonicalPath(), \"--mirror\", repoURL, tempClonePath.toFile().getAbsolutePath()); ```", "tokens": 45} {"id": 1024926, "source": "review", "repo": "jenkinsci/git-client-plugin", "text": "Remove trailing slash from anchor in page ```suggestion listener.getLogger().println(HyperlinkNote.encodeTo(\"https://plugins.jenkins.io/git-client/#plugin-content-ssh-host-key-verification\", ```", "tokens": 47} {"id": 1024945, "source": "review", "repo": "jenkinsci/git-client-plugin", "text": "or more simply (and [faster](https://stackoverflow.com/a/55414113/12916)!) ```suggestion args = args.prepend(extraGitCommandArguments.toArray(new String[0])); ```", "tokens": 55} {"id": 1024967, "source": "review", "repo": "jenkinsci/git-client-plugin", "text": "the factory will have a reference to the outer object. does this cause issues if used on an agent? nope", "tokens": 24} {"id": 1025062, "source": "review", "repo": "jenkinsci/git-plugin", "text": "This seems like the right fix need more eyes on this", "tokens": 13} {"id": 1025092, "source": "review", "repo": "jenkinsci/git-plugin", "text": "There should also be a dedicated `help-submoduleBranches.html` file for this new option.", "tokens": 21} {"id": 1025161, "source": "review", "repo": "jenkinsci/git-plugin", "text": "Here you should wonder: 1. Why abstract? 1. Will you allow the rest of plugins to consume this extension? Or is it something that will be part only of the git plugin? 1. Is some sort of UI needed? Will you offer a new UI? If this extension is something that will never extended by other plugins, then: 1. Annotate it as `@Restricted(NoExternalUse.class)` as in https://github.com/jenkinsci/git-plugin/blob/c0e8144da63e3c8ccea7f00f7438b6e70aac9b00/src/main/java/jenkins/plugins/git/traits/GitBrowserSCMSourceTrait.java#L110 1. There is no need to make it abstract. Use abstract classes when you want them to be extended. If there is some expected offered UI, you should implement the Descriptor. See the `Describable/Descriptor pattern` section in https://wiki.jenkins.io/display/JENKINS/Defining+a+new+extension+point", "tokens": 237} {"id": 1025286, "source": "review", "repo": "jenkinsci/git-plugin", "text": "Needs to require the git client plugin version that fixes the null pointer exception in `UnsupportedCommand`. ```suggestion 3.4.2 ```", "tokens": 35} {"id": 1025295, "source": "review", "repo": "jenkinsci/git-plugin", "text": "This needs the same path change for Windows ```suggestion assertThat(r.getGitTool(), containsString(SystemUtils.IS_OS_WINDOWS ? \"updated\\\\git.exe\" : \"updated/git\")); ```", "tokens": 43} {"id": 1025419, "source": "review", "repo": "jenkinsci/git-plugin", "text": "```suggestion Checkout from the git client plugin source repository using https protocol, username/password credentials, and a non-default branch. The git plugin supports username/password credentials provided by the link:https://plugins.jenkins.io/credentials[credentials plugin]. ```", "tokens": 54} {"id": 1025486, "source": "review", "repo": "jenkinsci/git-plugin", "text": "temporary to test with https://github.com/jenkinsci/git-client-plugin/pull/1107 The git client plugin dependency on the master branch is now updated to [git client plugin 4.7.0](https://plugins.jenkins.io/git-client/releases/#version_4.7.0) that includes the test fixes for autosign. Thanks again for making these improvements! @MarkEWaite yeah. thanks for the ping ;) I update that here. But I still have one issue with with auto sign I need to figure out. ``` Expected: is but: was [ERROR] Errors: [ERROR] CredentialsUserRemoteConfigTest.checkoutWithValidCredentials:273->Object.wait:328->Object.wait:-2 \u00bb TestTimedOut test timed out after 180 seconds ``` well this looks to be a flaky test I would be happy to approve the deletion of that test if it is flaky. If I feel it is deeply important, I can rewrite it to not be flaky. Let's not spend your time or mine on a flaky test that might block this pull request. When I looked through other test runs, I didn't see other cases of that test failing, so I assume it was a one-time flake. If in the future it fails more consistently, I'll delete it.", "tokens": 293} {"id": 1025522, "source": "review", "repo": "jenkinsci/git-plugin", "text": "Proposed alternate phrasing ```suggestion * Limit the number of commits that will be retrieved when the multibranch Pipeline is cloned. * When shallow clone is enabled, a single commit will be retrieved instead of retrieving all commits. * If more commits are needed, set the depth to a larger value.", "tokens": 64} {"id": 1025633, "source": "review", "repo": "jenkinsci/github-branch-source-plugin", "text": "I think we need to special-case github.com, since it uses `https://api.github.com` instead of `https://github.com/api/v3`. I am also still a little concerned that automatically computing the API URI might be problematic if customers try to do something tricky with proxies.", "tokens": 68} {"id": 1025678, "source": "review", "repo": "jenkinsci/github-branch-source-plugin", "text": "@alexanderrtaylor Ditto Thanks for pointing this out. I will change it to be more specific", "tokens": 26} {"id": 1025807, "source": "review", "repo": "jenkinsci/github-branch-source-plugin", "text": "With proxying turned on this was going out to GitHub to get this.", "tokens": 17} {"id": 1026097, "source": "review", "repo": "jenkinsci/github-branch-source-plugin", "text": "Is the version actually required here? I thought the `plugin-pom` would define it. Build fails without it. ``` [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] 'dependencies.dependency.version' for org.kohsuke:access-modifier-suppressions:jar is missing. @ org.jenkins-ci.plugins:github-branch-source:${changelist}, /Users/danielbeck/Repositories/github.com/daniel-beck/github-branch-source-plugin/pom.xml, line 91, column 17 ``` I guess ```suggestion ${access-modifier-checker.version} ``` would work. https://github.com/jenkinsci/github-branch-source-plugin/pull/917/commits/8a892e3fe5143da19b1f320d3d3e7d664f515dc1", "tokens": 212} {"id": 1026187, "source": "review", "repo": "jenkinsci/github-oauth-plugin", "text": "Git**H**ub BTW \"github-files\" Actually I follow the notation _mostly_ used in the rest of the project. Do you want: 1) change on mine only 2) change all other also 3) nothing I caution on changing too many interfaces unrelated to your change. I think you should keep your naming consistent with the rest of the project. If the desire is to rename the classes then that should be treated as a completely separate change. I imagine there will be upgrade hell from many users who script configurations that would be affected by these kinds of class changes.", "tokens": 205} {"id": 1026237, "source": "review", "repo": "jenkinsci/github-plugin", "text": "Better omitted from this PR since it does not contribute to the change.", "tokens": 15} {"id": 1026396, "source": "review", "repo": "jenkinsci/github-plugin", "text": "Please use the released version. Otherwise it may be hard to triangulate migration causes, etc.", "tokens": 22} {"id": 1026550, "source": "review", "repo": "jenkinsci/github-plugin", "text": "User should see real configuration that would be applied, if it 4 fields, then 4.", "tokens": 21} {"id": 1026697, "source": "review", "repo": "jenkinsci/github-plugin", "text": "@lanwen Considering that there are project-specific secrets, another solution would be to parse the payload twice as the validation would be dependent on the repo which is specified inside the payload, thus making it required to parse the message before validating. Do you think this sounds like an acceptable solution or do you have any other idea how to approach this?", "tokens": 72} {"id": 1026793, "source": "review", "repo": "jenkinsci/github-plugin", "text": "> You have to restart Jenkins in order to find the plugin in the installed plugins list. This hasn't been true for a long time. _Updating_ requires restarts, _installing_ does not.", "tokens": 46} {"id": 1026817, "source": "review", "repo": "jenkinsci/github-plugin", "text": "Better to throw an `IOException`. Good catch, I think I updated some of the changes to throw, and clearly not others. I'll update this position.", "tokens": 35} {"id": 1026974, "source": "review", "repo": "jenkinsci/gitlab-branch-source-plugin", "text": "The display name of GitLab Group is not updated but the description is updated. :/ what? \ud83d\ude2d So you can get some absurd long names \ud83d\ude06 @baymac if user has given the group a display name or description it does not override This works for groups: ![image](https://user-images.githubusercontent.com/1661688/63983122-a0674000-cac5-11e9-9a5d-6c89293379d2.png)", "tokens": 127} {"id": 1027249, "source": "review", "repo": "jenkinsci/gradle-plugin", "text": "\ud83e\udd14 If you use normalization, I suppose you can remove the reproducible JARs here again, right? Good point! Yes, when using inputs normalization this logic is not needed. Removed, to keep things simple.", "tokens": 43} {"id": 1027574, "source": "review", "repo": "jenkinsci/hashicorp-vault-plugin", "text": "In azure-keyvault plugin I used a block scoped step not the environment option and secrets were hidden fine: https://github.com/jenkinsci/azure-keyvault-plugin#declarative", "tokens": 39} {"id": 1027763, "source": "review", "repo": "jenkinsci/http-request-plugin", "text": "StringUtils.isBlank() would be better so that it would filter out blank strings Using StringUtils.isBlank() would mean it's not possible to send a body containing only whitechars. Whatever the semantic of such a body could be. Maybe for counting whitespaces and returning the number of chars ;)", "tokens": 62} {"id": 1027970, "source": "review", "repo": "jenkinsci/jenkins-test-harness", "text": "BTW you can use `@Issue` Just tried, but too late. np", "tokens": 17} {"id": 1027978, "source": "review", "repo": "jenkinsci/jenkins-test-harness", "text": "https://github.com/jenkinsci/jenkins-test-harness/blob/d3dacb2a75d1aeede2952f051ab6a9d1a8287526/src/main/java/org/jvnet/hudson/test/WarExploder.java#L105-L115", "tokens": 82} {"id": 1028076, "source": "review", "repo": "jenkinsci/jenkins-test-harness", "text": "Make this into a `static` nested class.", "tokens": 11} {"id": 1028160, "source": "review", "repo": "jenkinsci/jenkins-test-harness", "text": "Compare to https://github.com/jenkinsci/jenkins-test-harness/blob/82e2d5783c785c95755717b25920b54544f5fd9a/src/main/java/org/jvnet/hudson/test/JenkinsRule.java#L344 and https://github.com/jenkinsci/jenkins-test-harness/blob/82e2d5783c785c95755717b25920b54544f5fd9a/src/main/java/org/jvnet/hudson/test/JenkinsRule.java#L698", "tokens": 160} {"id": 1028423, "source": "review", "repo": "jenkinsci/jenkins", "text": "@janfaracik I assume that it was an intentional decision to not display the dropdown menu on node names in the console log. Are you OK with this change that enables the dropdown menu on node names in the console log? Just to clarify, the dropdown functionality was already present in the console log. The chevron icon was hidden, but hovering and clicking in that area would still open the dropdown. This PR makes the existing interactive area visible while fixing the hover area overlap. If the preferred UX is to keep the dropdown hidden in the console log, I'm happy to adjust the implementation to address the overlap without exposing the chevron. I was wondering about the status of this PR. > I was wondering about the status of this PR. I'm waiting for an answer from @janfaracik. @geerligs have you tested the pull request yourself and confirmed that it works as expected for you? If not, could you use the [incremental build](https://github.com/jenkinsci/jenkins/pull/27029/checks?check_run_id=85129227615) and do that test? Hello Mark, I just tested the incremental build, works perfectly. When hovering over the node, I see the chevron shows: \"image\" When not hovering the chevron is not shown: \"image\" -- Han N.B. I am happy you're still active in the Jenkins community after retirement!", "tokens": 440} {"id": 1028514, "source": "review", "repo": "jenkinsci/jenkins", "text": "Fixing https://github.com/jenkinsci/jenkins/blob/d076aeb66b68af42c61568676bf29dba9ae3cee8/core/src/main/java/jenkins/model/Jenkins.java#L399 would be better. Unfortunately that would break a lot of tests. Maybe https://github.com/jenkinsci/jenkins-test-harness/pull/344 could be revisited seriously. > would be better This is consistent with what we're already doing with security realm and authorization strategy. And I really don't want to deal with > [breaking] a lot of tests for this.", "tokens": 151} {"id": 1028924, "source": "review", "repo": "jenkinsci/jira-plugin", "text": "Please add LOGGER.warn that the specified version was not found", "tokens": 13} {"id": 1028972, "source": "review", "repo": "jenkinsci/jira-plugin", "text": "to the top and more meaningful variable name :-) (and maybe the actual regex in a constant?)", "tokens": 21} {"id": 1029086, "source": "review", "repo": "jenkinsci/jira-plugin", "text": "FYI This is a dead link @halkeye thanks buddy good catch!", "tokens": 17} {"id": 1029134, "source": "review", "repo": "jenkinsci/jira-plugin", "text": "is it related to this project? I don't think we have javascript files. This is how codeStyle saves configuration.", "tokens": 28} {"id": 1029419, "source": "review", "repo": "jenkinsci/lockable-resources-plugin", "text": "More clear if you add `@CheckForNull` in the field rather that using `@Nullable` here.", "tokens": 20} {"id": 1029423, "source": "review", "repo": "jenkinsci/lockable-resources-plugin", "text": "Moving this field here makes it hidden to static serialized state (needed for restart-ability).", "tokens": 20} {"id": 1029477, "source": "review", "repo": "jenkinsci/lockable-resources-plugin", "text": "Okay, I'm honestly not sure: what if we're unreserving multiple resources and multiple job contexts can be unqueued and run? This seems to be taken from unlockNames, so maybe there's something I'm missing that makes that okay -- or perhaps this is something that is missing too. Would like to know the answer before we merge though (not sure if it's a bug or a subtlety here). Yeah, this is a hacked down version of what's in `unlockNames` - it can definitely use more thought. See other comments, but yeah, what's actually happening is it's getting the first queued context that can be satisfied. I have no idea what it *should* do if there are multiple contexts that could be satisfied now...and frankly, I'm not gonna worry about that, since this won't work any differently than `unlockNames` does already. This whole thing is ripe for a refactor, but I am *not* doing that today. =) So here's a thought: what if we do this a bit at a time? Basically we have the list of resources and a function that runs in a while loop and invokes this (or a slightly modified version of this) until it runs out of resources it can free or blocked items? Should be basically just a big for loop that is a lot simpler and sidesteps most of the nastiness of this? I'm fine with that, but I think I'd rather do that in a followup PR - we've got a fix for a common painpoint here now, and I'm a little nervous re: changing behavior for unlocking/unreserving to a loop when we could just get this fix out first. Mmm, yeah, you're right.", "tokens": 386} {"id": 1029577, "source": "review", "repo": "jenkinsci/lockable-resources-plugin", "text": "```suggestion skipIfLocked, selectStrategy); ```", "tokens": 11} {"id": 1029653, "source": "review", "repo": "jenkinsci/lockable-resources-plugin", "text": "I think, this method can be set to deprecated. in that case also no external use, so we can remove it in the future I've added the annotations to that method.", "tokens": 38} {"id": 1029759, "source": "review", "repo": "jenkinsci/performance-plugin", "text": "For fix tests on travis add the next options \"-o modules.jmeter.version=3.1 -o modules.jmeter.path=PATH_TO_WORKSPACE\" like here PerformanceTestBuildTest#testFlow#L40", "tokens": 51} {"id": 1029834, "source": "review", "repo": "jenkinsci/pipeline-utility-steps-plugin", "text": "what are you trying to test here? that `Now` is higher than `changed` or what exactly?", "tokens": 23} {"id": 1029899, "source": "review", "repo": "jenkinsci/pipeline-utility-steps-plugin", "text": "is it really just a warning? `listener.error()` ?", "tokens": 14} {"id": 1029916, "source": "review", "repo": "jenkinsci/pipeline-utility-steps-plugin", "text": "introduce a property `workflow-step-api-plugin.version` so that there is no risk of this getting out of synch with the primary artifact", "tokens": 32} {"id": 1029961, "source": "review", "repo": "jenkinsci/pipeline-utility-steps-plugin", "text": "Will not be honored in this PR since I lack write permission to the repo.", "tokens": 18} {"id": 1030164, "source": "review", "repo": "jenkinsci/plugin-installation-manager-tool", "text": "I don't think prefixing it is needed when there's only one version being passed, it makes parsing it by tools more difficult, and adds more information than is needed ```suggestion System.out.println(properties.getProperty(\"project.version\")); ```", "tokens": 54} {"id": 1030349, "source": "review", "repo": "jenkinsci/plugin-installation-manager-tool", "text": "I think this is clearer ```suggestion private boolean useArchiveFirst = false; ```", "tokens": 17} {"id": 1030366, "source": "review", "repo": "jenkinsci/remoting", "text": "Is it really a warning? I suppose it's a valid behavior when somebody updates jars on the remote side (e.g. plugin update) It is, when you update a jar, it should have different checksum and therefore be stored on different location so this code path will not be executed. This warning is a signal that what we found cached as `ABC` (by location) is in fact `DEF` (by checksum). This can be caused by manipulating the cache dir (what this PR addresses), bug in remoting that cached jar on wrong location or change of checksum algorithm. In all these cases it is undesirable to load the jar blindly. Agreed", "tokens": 144} {"id": 1030389, "source": "review", "repo": "jenkinsci/remoting", "text": "what's wrong with `readAhead.clone()`? Should be fine too", "tokens": 17} {"id": 1030439, "source": "review", "repo": "jenkinsci/remoting", "text": "7? 7 for now, Remoting is on Java 7, will update later to 8", "tokens": 23} {"id": 1030643, "source": "review", "repo": "jenkinsci/remoting", "text": "Name it differently, since it is not a \"URL\" (only host:port)? The CLI parameter is called `-direct` or `-directConnection`.", "tokens": 37} {"id": 1030868, "source": "review", "repo": "jenkinsci/remoting", "text": "I think this also needs to cover `directConnection`, where neither `-jnlpUrl` nor `-url` is used yet we are running an inbound agent. https://github.com/jenkinsci/kubernetes-plugin/pull/1451#issuecomment-1775147649 \u21d2 #689 Indeed, somehow I missed testing this mode during all the other manual testing I did. Thanks for fixing this so quickly.", "tokens": 96} {"id": 1030945, "source": "review", "repo": "jenkinsci/remoting", "text": "can you look at this? Yes sure, I've reordered `close()` and `terminate()` to assign `closeRequestCause` before the `closeRequested` volatile write, so a thread that observes the flag as true also observes the cause.", "tokens": 56} {"id": 1031057, "source": "review", "repo": "jenkinsci/role-strategy-plugin", "text": "https://javadoc.jenkins.io/hudson/model/Item.html#getFullName-- should be used", "tokens": 23} {"id": 1031173, "source": "review", "repo": "jenkinsci/role-strategy-plugin", "text": "```suggestion [ platform: \"linux\", jdk: \"8\" ], [ platform: \"windows\", jdk: \"8\" ], [ platform: \"linux\", jdk: \"11\", javaLevel: '8' ] ```", "tokens": 50} {"id": 1031449, "source": "review", "repo": "jenkinsci/slack-plugin", "text": "this is the spotbugs issue, you're building a new object but not assigning it anywhere you should be calling this constructor instead with your builder: ``` private SlackNotifier(SlackNotifierBuilder slackNotifierBuilder) { ```", "tokens": 45} {"id": 1031451, "source": "review", "repo": "jenkinsci/slack-plugin", "text": "```suggestion if (StringUtils.isEmpty(iconEmoji)) { ```", "tokens": 14} {"id": 1031823, "source": "review", "repo": "jenkinsci/ssh-agents-plugin", "text": "```suggestion * @param overwrite @{code true} to overwrite the file if it already exists. If @{false} and the file exists an @{code IOException} will be thrown. ``` NIT: Javadoc style guides prefer [lower case](https://www.oracle.com/uk/technical-resources/articles/java/javadoc-tool.html#@param)", "tokens": 80} {"id": 1031932, "source": "review", "repo": "jenkinsci/throttle-concurrent-builds-plugin", "text": "Do we really need to change the version? I don't see real dependencies from Jenkins core. I also recommend to avoid 1.509.4 at least. See https://groups.google.com/forum/#!topic/jenkinsci-dev/9fMrUsVh6zU", "tokens": 66} {"id": 1031972, "source": "review", "repo": "jenkinsci/throttle-concurrent-builds-plugin", "text": "Should be 1.4.1. https://github.com/jenkinsci/jenkins/blob/jenkins-1.596.1/pom.xml#L99", "tokens": 39} {"id": 1032106, "source": "review", "repo": "jenkinsci/warnings-ng-plugin", "text": "![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Do not access Object.prototype method 'hasOwnProperty' from target object.](https://app.codacy.com/manual/uhafner/warnings-ng-plugin/pullRequest?prid=4663559)", "tokens": 73} {"id": 1032185, "source": "review", "repo": "jenkinsci/warnings-ng-plugin", "text": "Es w\u00e4re leichter lesbar, wenn die private Methoden jeweils unter den jeweiligen public tests w\u00e4ren und nicht so abwechselnd.", "tokens": 50} {"id": 1032328, "source": "review", "repo": "jenkinsci/warnings-ng-plugin", "text": "```suggestion (safely processed on the agents responsible for the builds rather than natively on the controller) ```", "tokens": 23} {"id": 1032396, "source": "review", "repo": "jenkinsci/warnings-ng-plugin", "text": "```suggestion new IssueReportScanner(expandedPattern, reportEncoding, followSymlinks(), createParser(), !isEmptyFileValid())); ``` Resolved", "tokens": 28} {"id": 1032460, "source": "review", "repo": "jenkinsci/warnings-ng-plugin", "text": "\ud83d\udc4b Hello! This seems to be a breaking behavioral change; can it be rolled back and reintroduced in a dedicated major release? Alternatively, can the docs be updated to say that `tools` isn't actually optional, i.e. clarify that you need one of `tool` or `tools`? Thanks! I wonder why someone should call the recorder without tools. But if that should be better documented, please file a PR for the documentation (or for the help files). > I wonder why someone should call the recorder without tools. The issue is that [the docs for the step show both of these as \"(Optional)\"](https://www.jenkins.io/doc/pipeline/steps/warnings-ng/#recordissues-record-compiler-warnings-and-static-analysis-results:~:text=tool-,tools%20(optional),-Array%20/%20List%20of). I think the \"(Optional)\" is generated from the code, so I assume it can't really be changed (since technically you only need one or the other). If that's the case\u2014and please correct me if I'm wrong\u2014I will just see about adding a sentence to the doc clarifying this relationship and the fact that exactly one of them is required. Thanks!", "tokens": 281} {"id": 1032529, "source": "review", "repo": "jenkinsci/warnings-ng-plugin", "text": "```suggestion when(result.getErrorMessages()).thenReturn(Lists.immutable.empty()); when(result.getInfoMessages()).thenReturn(Lists.immutable.empty()); ```", "tokens": 34} {"id": 1032544, "source": "review", "repo": "jenkinsci/warnings-ng-plugin", "text": "Wouldn't `buildWithResult()` of the parent class already work?", "tokens": 16} {"id": 1032560, "source": "review", "repo": "jenkinsci/warnings-ng-plugin", "text": "```suggestion report.logError(\"Removing existing result action with ID '%s' (duplicate ID: restart or configuration error?)\", getId()); ``` Can you remove this method? It makes no sense anymore. Create the selector inline where it is needed. See line 127.", "tokens": 59} {"id": 1032621, "source": "review", "repo": "jenkinsci/warnings-ng-plugin", "text": "This is the same code as in line 233. Can't you move the `if (issueMessage.contains(\"\\n\"))` inside the extra method where the fallback is always line 233? Yes, you're right. I'll move the `if (issueMessage.contains(\"\\n\"))` check inside `formatMultiLineMessage()` and let `formatDetails()` delegate all non-blank messages to that method. This will also remove the duplicated fallback rendering.", "tokens": 101} {"id": 1032724, "source": "review", "repo": "jhy/jsoup", "text": "Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji. **Problem**: While wrapping the caught exception into a custom one, information about the caught exception is being lost, including information about the stack trace of the exception. **Fix**: If the caught exception object does not contain sensitive information, consider passing it as the "rootCause" or inner exception parameter to the constructor of the new exception before throwing the new exception. (Note that not all exception constructors support inner exceptions. Use a wrapper exception that supports inner exceptions.) [Learn more](https://www.ibm.com/support/pages/best-practice-catching-and-re-throwing-java-exceptions) Updated, thanks", "tokens": 175} {"id": 1033039, "source": "review", "repo": "juliand665/dynamic-fps", "text": "tiny nitpick: i'd write \"that call\" instead of \"calling\" here", "tokens": 18} {"id": 1033152, "source": "review", "repo": "kafka-ops/julie", "text": "I think we can take the default value out of here as the default value will come anyhow from the CLI class. From what I found, no default value actually appears to break a few unit tests. So would potentially require some refactor against your tests to remove it.", "tokens": 56} {"id": 1033397, "source": "review", "repo": "karatelabs/karate", "text": "move this (and the para) to the \"Chrome section\" \"image\" Ok.", "tokens": 91} {"id": 1033462, "source": "review", "repo": "karatelabs/karate", "text": "this is good. can you update the description to `mock server path prefix (context-path)`", "tokens": 22} {"id": 1033785, "source": "review", "repo": "kittehorg/kittehircclientlib", "text": "Why `_ENTRY`? I blame IDEA on this one. T'was the recommendation!", "tokens": 19} {"id": 1033807, "source": "review", "repo": "kittehorg/kittehircclientlib", "text": "`@Nonnull` for both parameters. Done.", "tokens": 10} {"id": 1034001, "source": "review", "repo": "kittehorg/kittehircclientlib", "text": "Ideally using a paste service, such as https://paste.gg. ```diff **Stacktrace** + +```java Paste the stacktrace you get here. +``` ``` apperantly you need write access to use [comment suggestions](https://help.github.com/articles/incorporating-feedback-in-your-pull-request/), silly I'm not (yet) convinced of the need to keep it off-github. especially since github supports details tags that can be used in templates to hide long snippets.", "tokens": 115} {"id": 1034077, "source": "review", "repo": "knowm/xchange", "text": "is this extra method necessary? I think we do need it. why? is using the already single line body not sufficient? Still Pending - Will review it later, Busy with another assignment.", "tokens": 40} {"id": 1034118, "source": "review", "repo": "knowm/xchange", "text": "why was this pulled out of the `BinanceWebsocketTransaction` That's just small optimisation, to avoid mapping an object twice. As that observable is shared for both subscriptions of order book updates and order book.", "tokens": 43} {"id": 1034170, "source": "review", "repo": "knowm/xchange", "text": "remove this line, again was not addressed Method was removed", "tokens": 12} {"id": 1034476, "source": "review", "repo": "knowm/xchange", "text": "why not `BigDecimal`? Right, BigDecimal is the appropriate type", "tokens": 13} {"id": 1034515, "source": "review", "repo": "knuddelsgmbh/jtokkit", "text": "Could you add the maxTokens parameter in this and the below usage example \ud83d\ude42? Also an additional note about the caveat we talked about regarding encoding-roundtrips would be great @tox-p I've added `maxTokens` to the usage example. I haven't mentioned the caveat we discussed, as our current solution solves it.", "tokens": 72} {"id": 1034587, "source": "review", "repo": "knuddelsgmbh/jtokkit", "text": "`max(1,` to make sure `0` length lists can grow as well", "tokens": 19} {"id": 1034615, "source": "review", "repo": "knuddelsgmbh/jtokkit", "text": "not sure what happened with the formatting here before :/", "tokens": 12} {"id": 1034673, "source": "review", "repo": "kobylynskyi/graphql-java-codegen", "text": "This was moved out from generated `ResponseProjection` classes because the code is identical for all of them.", "tokens": 22} {"id": 1034723, "source": "review", "repo": "kobylynskyi/graphql-java-codegen", "text": "This is just my OCD speaking, but shouldn't we terminate the file with line feed?", "tokens": 21} {"id": 1035018, "source": "review", "repo": "kostyasha/github-integration-plugin", "text": "That doesn't make much sense in English. =)", "tokens": 13} {"id": 1035040, "source": "review", "repo": "kostyasha/github-integration-plugin", "text": "> Won't the call to get() here throw an exception if no triggers match (when all events evaluate to a null cause)? Also thinking about it. They are called but their result not used as it filtered and ignored. That only a performance question.", "tokens": 55} {"id": 1035263, "source": "review", "repo": "lavalink-devs/youtube-source", "text": "this should be moved into the if on line 87", "tokens": 13} {"id": 1035289, "source": "review", "repo": "lavalink-devs/youtube-source", "text": "This seems liable to failing. Please add an if guard before applying cipherUrl and pass.", "tokens": 21} {"id": 1035325, "source": "review", "repo": "lavalink-devs/youtube-source", "text": "```suggestion log.debug(\"All configured clients failed, attempting TVHTML5 with itag 18\"); ```", "tokens": 25} {"id": 1035335, "source": "review", "repo": "leibnitz27/cfr", "text": "Should the closing `}` in line 67 be a separator as well? Same for ClassFileDumperAnonymousInner.java, ClassFileDumperEnum.java and ClassFileDumperInterface.java.", "tokens": 38} {"id": 1035534, "source": "review", "repo": "lisawray/groupie", "text": "it seems to me you can leverage the current implementation of `Section.removeAll` and just do ``` if (children.isEmpty()) { return; } removeAll(new ArrayList<>(children)); ``` Which would have the same effect. If you agree, can you please modify the PR. Thanks for your review :) I'll change to it.", "tokens": 71} {"id": 1035831, "source": "review", "repo": "ls1intum/artemis", "text": "Fixed in 15a358037f4eb296929089a6d52da6a40978b7bf. Route and citation navigation now share parseLectureDeepLink, which ignores absent, blank, and whitespace timestamps while preserving numeric/string zero. Helper and citation regressions cover both cases; all 3,248 affected-module tests pass.", "tokens": 92} {"id": 1036023, "source": "review", "repo": "ls1intum/artemis", "text": "@FelixTJDietrich [medium] This condition removes both audited recovery endpoints when generation is disabled, although ordinary programming edits and pushes still acquire non-expiring mutation slots. If a writer crashes holding one, subsequent writes remain blocked and the documented recovery URLs return 404. The controller already supports recovery without `GenerationJobService` through its mutation-service fallback. I missed this earlier; please keep the recovery resource available on core nodes with generation disabled and update the activation test that currently expects its absence.
\ud83e\udd16 Prompt for AI agents In `src/main/java/de/tum/cit/aet/artemis/hyperion/web/admin/AdminHyperionGenerationResource.java`, the generation flag disables recovery for non-expiring slots still acquired by ordinary writers. Remove the generation-only condition while retaining administrator authorization, and update activation coverage to require the recovery resource on generation-disabled core nodes.
", "tokens": 194} {"id": 1036085, "source": "review", "repo": "ls1intum/artemis", "text": "Partly fixed in 627ca2a. I added the other local credentials that `.gitignore` lists and that were missing (`src/test/playwright/.auth`, `src/test/playwright/ssh-keys/known_hosts`, the `playwright-*override.yml` compose overrides), next to the existing `application-local*.yml`, `id_*`, `known_hosts` and `local-secrets.*` entries. I did not exclude `.env` generally: the root `.env` is tracked (it says \"DO NOT add secrets\" and only pins public image versions) and the Gradle build reads it (`gradle/env.gradle`), so dropping it would change the build and the version pins the tests use. A fresh clone, which is how the scanner builds, contains only tracked files anyway. I verified the final rule set on a decoy tree: the local secrets and the untracked `.env` variants named in `.gitignore` are dropped, while `.env`, `.github`, `application-localci.yml`, `application-localvc.yml` and `deployment/docker/artemis/config/prod.env` stay.", "tokens": 257} {"id": 1036115, "source": "review", "repo": "ls1intum/artemis", "text": "Valid, fixed in 9d8fc69 with your wording: the constant now says that `testAccount()` sets the `isTestUser` flag. Nothing else in the sources or the documentation refers to `artemis.mail.test-account-login-patterns` any more.", "tokens": 61} {"id": 1036209, "source": "review", "repo": "ls1intum/artemis", "text": "Valid. The server message is now the generic technical text 'The uploaded file is not a readable PDF'; the user-facing wording stays in the invalidPdf translations only (76046118ce4).", "tokens": 50} {"id": 1036412, "source": "review", "repo": "luckperms/luckperms", "text": "```suggestion this.channel.basicConsume(queue, true, this.sub, tag -> {}); ```", "tokens": 23} {"id": 1036477, "source": "review", "repo": "magefree/mage", "text": "don't forget to add the ability word and the hint like with the other vivid cards", "tokens": 22} {"id": 1036485, "source": "review", "repo": "magefree/mage", "text": "you can create a spell filter with `ChosenSubtypePredicate` instead of creating a custom triggered ability", "tokens": 20} {"id": 1036541, "source": "review", "repo": "magefree/mage", "text": "use `FILTER_CONTROLLED_PERMANENT_ARTIFACT` since it doesn't need to have the \"other\" predicate", "tokens": 25} {"id": 1036598, "source": "review", "repo": "magefree/mage", "text": "This is should be a reflexive triggered ability, not directly part of the tap to add mana. I'm not sure I understand the request, could you please elaborate? I have been struggling with this effect because of the lack of reference in other cards for mana ability with a reflexive trigger ability. I created the `ReflexiveTriggeredAbility()` inside `ShaunAndRebeccaMillEffect`, because it was the only way I found to fire the ability immediatly. I got my inspiration from [Magus Lucea Kane](https://scryfall.com/card/40k/7/magus-lucea-kane) second ability.", "tokens": 150} {"id": 1036786, "source": "review", "repo": "magefree/mage", "text": "btw, future refactor, I think player gained life watcher should become a game default watcher", "tokens": 20} {"id": 1036890, "source": "review", "repo": "magefree/mage", "text": "Also it's better to clean old files too like ``` java Files.deleteIfExists(textBulkPath); // TODO: cleaning outdated file format, remove after few releases, 2026-05-07 Files.deleteIfExists(Paths.get(getBulkTempFileName(\"json.gz\"))); Files.deleteIfExists(Paths.get(getBulkTempFileName(\"json\"))); try (GZIPInputStream in = new GZIPInputStream(Files.newInputStream(zippedBulkPath)); ```", "tokens": 96} {"id": 1037067, "source": "review", "repo": "mapbox/mapbox-java", "text": "removed unnecessary `Serialized` annotations. `toJson` and `fromGson` should work, because we don't use any custom model, just Lists", "tokens": 32} {"id": 1037099, "source": "review", "repo": "mapbox/mapbox-java", "text": "This is not a valid use case for `annotations`, we should remove the commas `\",\"` from the `annotationsStr`. `annotations` doesn't accept trailing empty values. fixed", "tokens": 40} {"id": 1037133, "source": "review", "repo": "mapbox/mapbox-java", "text": "do we need a separate method for a formatter? There is only a single line of code, so I would prefer just to use `DateTimeFormatter.ofPattern(ISO_8601_PATTERN)`inside `formatDateTimeToIso8601 ` method or we might have an input param to save a method and make it more flexible ``` private static DateTimeFormatter provideDateTimeFormatter(String format) { return DateTimeFormatter.ofPattern(format); } ``` Seems that it's redundant with implementation using `java.util.Date`. I'll move body to method", "tokens": 119} {"id": 1037234, "source": "review", "repo": "mapbox/mapbox-java", "text": "```suggestion * Exclude certain road types from routing. ```", "tokens": 12} {"id": 1037236, "source": "review", "repo": "mapbox/mapbox-java", "text": "builder! \ud83d\ude04 ```suggestion StringBuilder sb = new StringBuilder() .append(baseUrl()) .append(\"/directions/v5\") .append(String.format(\"/%s\", user())) ... ``` \ud83d\ude05", "tokens": 45} {"id": 1037259, "source": "review", "repo": "mapbox/mapbox-java", "text": "Let's not add this if we're deprecating `Builder#excludeList`, these are the counterpart APIs. Let's instruct developers to migrate to the `Exclude` type instead.", "tokens": 42} {"id": 1037369, "source": "review", "repo": "mapbox/mapbox-java", "text": "```suggestion /* * Returns the toll cost for a small sized vehicle. * * return toll cost */ ```", "tokens": 25} {"id": 1037428, "source": "review", "repo": "mapbox/mapbox-java", "text": "```suggestion * The name of the junction. Optionally included if data is available. ```", "tokens": 20} {"id": 1037525, "source": "review", "repo": "maplibre/maplibre-navigation-android", "text": "Wouldn't it be easier to use a for(i= routeProgress.legIndex() + 1 ; ...)? That way we don't need sublists. In general since returning null is acceptable, I am not sure if we shouldn't just return null if the next leg has no steps or < 2 steps? But I guess both approaches would be fine as this seems to be an edge case either way. > Wouldn't it be easier to use a for(i= routeProgress.legIndex() + 1 ; ...)? That way we don't need sublists. Sure. Make sense! > In general since returning null is acceptable, I am not sure if we shouldn't just return null if the next leg has no steps If we return `NULL` the bearing is set to `0`, this means the puck and camera is turn around to zero position, and will turn back for next step. This also happens on the last position. Maybe we should store the latest bearing and re-use them instead of return a `0` bearing. In this case we don't need the loop-stuff. What do you think? How about we use the actual bearing of the location? Or yeah, we could use the last bearing, I think this should be fine for most cases as well. I like the idea of fallback to the real location. But this is often not route matched and we have also the issue #63. So I would implement the last bearing usage for now, but I think we can improve this later after some other topics to the location.", "tokens": 340} {"id": 1037557, "source": "review", "repo": "maplibre/maplibre-navigation-android", "text": "Correct! Can be `NULL`. > The Intent supplied to Context. startService, as given. This may be null if the service is being restarted after its process has gone away, and it had previously returned anything except START_STICKY_COMPATIBILITY.", "tokens": 59} {"id": 1037702, "source": "review", "repo": "maximiliananzinger/pgdp2223-tests", "text": "Muss es hier nicht j - 1 sein, weil j hier schon um 1 inkrementiert worden ist (Westermann ist traurig :()? Auf jeden Fall muss j in der Position Klammer und in der Expected Klammer einheitlich sein. Ja\u2026. Hab nach deinem review schnell was ungetest per Handy ver\u00e4ndert, sollte jetzt alles passen. \ud83d\udc4d", "tokens": 128} {"id": 1037728, "source": "review", "repo": "maximiliananzinger/pgdp2223-tests", "text": "\"image\" Isn't it line 38?", "tokens": 89} {"id": 1037773, "source": "review", "repo": "maximiliananzinger/pgdp2223-tests", "text": "```suggestion assertTrue(move.value() > (new int[]{6, -1, 5})[move.y()]); ``` Why does the value of the new piece need to just equal the existing piece? Doesn't it have to be greater than the existing piece? You're right, that's an oversight on my side.", "tokens": 73} {"id": 1037833, "source": "review", "repo": "maximiliananzinger/pgdp2223-tests", "text": "```suggestion @ParameterizedTest @MethodSource public void combinationsTest(combination) { Function lock = getLock(combination); byte[] result = TrialOfTheDreams.lockPick(lock); for (int i = 0; i < combination.length; i++) { assertEquals(combination[i], result[i]); } } private static Stream combinationsTest { return Stream.of( arguments( new byte[] {Byte.MAX_VALUE}, new byte[] {-128, 127}, new byte[] {25, 8, 30}, new byte[] {25, -8, 30}, new byte[0] )); } ``` You should also avoid code repetition by using tests from source. This suggestions comes with imports.", "tokens": 171} {"id": 1037867, "source": "review", "repo": "maximiliananzinger/pgdp2223-tests", "text": "Der kann raus: https://zulip.in.tum.de/#narrow/stream/1525-PGdP-W11H03/topic/handshake.20ConnectionException", "tokens": 49} {"id": 1037964, "source": "review", "repo": "meilisearch/meilisearch-java", "text": "```suggestion /** * Add or replace a document * * @param data the serialized document ```", "tokens": 19} {"id": 1037980, "source": "review", "repo": "meilisearch/meilisearch-java", "text": "```suggestion * @return a map with health status of MeiliSearch ```", "tokens": 18} {"id": 1038065, "source": "review", "repo": "meilisearch/meilisearch-java", "text": "```suggestion * @param rankingRules array that contain the data with the new ranking rules ```", "tokens": 19} {"id": 1038101, "source": "review", "repo": "meilisearch/meilisearch-java", "text": "These status types have been changed https://github.com/meilisearch/specifications/blob/main/text/0060-tasks-api.md#3-type-field-enum \ud83c\udf68 This makes me think a little about the real value of these `DocumentHandler` tests since [we prefer integration tests](https://github.com/meilisearch/integration-guides/blob/main/resources/build-integration.md#5-tests) \ud83e\udd14 You are right, all the code in the `/api` folder is part of the duplicate code we were talking about. I really need to create an issue about it. And yes all these tests are actually mocked I totally forgot to edit them.", "tokens": 148} {"id": 1038390, "source": "review", "repo": "meilisearch/meilisearch-java", "text": "```suggestion TasksQuery query = new TasksQuery().setCanceledBy(new int[] {9, 15}); ```", "tokens": 28} {"id": 1038444, "source": "review", "repo": "meilisearch/meilisearch-java", "text": "Did it for consistency, but adding documents is not needed for testing index settings; long term, we should probably switch everything to `createEmptyIndex` whenever possible", "tokens": 33} {"id": 1038784, "source": "review", "repo": "mekanism/mekanism", "text": "Realistically we might want this to check all chemical tanks, and just take the first chemical tank that has a valid chemical in it. Sounds reasonable for the validation stage. Would you also want it to continue searching if the chemical is valid but the extraction fails or should that bail out? Probably keep searching, because if there is say something in an input tank and output and the input is first, it may fail when the output would succeed That's a good point, yeah. No additional change needed then, that's already what the latest code does.", "tokens": 121} {"id": 1038832, "source": "review", "repo": "mekanism/mekanism", "text": "shouldn't we make these just use the stack? I was wondering about that, so I will go ahead and so so, even though we don't care about the actual amount and we don't have data components for chemicals.", "tokens": 51} {"id": 1039006, "source": "review", "repo": "mercadopago/sdk-java", "text": "Al\u00e9m de validar se o header existe, tamb\u00e9m deveria validar se o valor dele est\u00e1 correto. Por exemplo, o header `Authorization` deve conter `Bearer ACCESS_TOKEN`. Concordo. Valida\u00e7\u00f5es realizadas.", "tokens": 74} {"id": 1039024, "source": "review", "repo": "mercadopago/sdk-java", "text": "```suggestion if (Objects.nonNull(MercadoPagoConfig.getProxy())) { httpClientBuilder.setProxy(MercadoPagoConfig.getProxy()); } if (Objects.nonNull(MercadoPagoConfig.getRetryHandler())) { httpClientBuilder.setRetryHandler(MercadoPagoConfig.getRetryHandler()); } else { DefaultHttpRequestRetryHandler retryHandler = new DefaultHttpRequestRetryHandler(DEFAULT_RETRIES, false); httpClientBuilder.setRetryHandler(retryHandler); } ``` Feito.", "tokens": 91} {"id": 1039059, "source": "review", "repo": "mercadopago/sdk-java", "text": "N\u00e3o encontrei no Postman nem na API Reference Se voc\u00ea ficar uma chamada com esses campos a API aceita, creio que seja falha na API Reference.", "tokens": 55} {"id": 1039408, "source": "review", "repo": "mercedes-benz/sechub", "text": "Might be possible the failing rest doc test is caused by this changed response status. By the title of the failing test I assume a response status 200 is expected, but with this change 204 is the new expected status.", "tokens": 50} {"id": 1039409, "source": "review", "repo": "mercedes-benz/sechub", "text": "```suggestion If the validation is successfull the severity of that finding will be set to \"critical\" because the finding is confirmed. ``` done", "tokens": 29} {"id": 1039420, "source": "review", "repo": "mercedes-benz/sechub", "text": "Thanks for fixing this - I wasn't aware about https://stackoverflow.com/questions/55288931/how-exactly-spring-http-multipart-enabled-is-different-from-spring-servlet-multi#55289470", "tokens": 61} {"id": 1039431, "source": "review", "repo": "mercedes-benz/sechub", "text": "Java does auto cast int to long values and this totally uncritical here. Please either just remove the cast or change maximumSecondsToWaitForPDSSolutionAlive to long and do not cast this. By the way ONE_SECOND_IN_MILLISECONDS is also an int and should be treated same way. yes you are right but the IDE will complain about implicit casting I don't like to suppress warnings when not needed I will change it to long then", "tokens": 91} {"id": 1039563, "source": "review", "repo": "mercedes-benz/sechub", "text": "usually it's `private final ...`", "tokens": 10} {"id": 1039609, "source": "review", "repo": "mercedes-benz/sechub", "text": "```suggestion void runAndWaitForActiveScan(long remainingScanDurationInMillis) throws ClientApiException { ``` Why we do we return here no long result like for the others? the remaining scan duration is given as parameter as well?", "tokens": 46} {"id": 1039825, "source": "review", "repo": "mercedes-benz/sechub", "text": "Hm.. The crypto access could be a field inside the InMemory cache - it is not really necessary to create a new access object for every cache data. Being a internal class the usage could be here: ``` InMemoryCache.this.cryptoAccess.seal(...) ``` The InMemory class has the same generic so the crypto access object will match.", "tokens": 70} {"id": 1039997, "source": "review", "repo": "mercedes-benz/sechub", "text": "Hmm... you rely on the assumption that the protocol will always contain the colon at the end. Maybe this would be easier/more resilient: ```suggestion if (!protocol){ throw new Error('No protocol defined!'); } if (protocol.startsWith('https') { return 443; } else if (protocol.startsWith('http') { return 80; } else { throw new Error('Accepted protocols are \"http\" and \"https\"'); } ```", "tokens": 106} {"id": 1040088, "source": "review", "repo": "mercedes-benz/sechub", "text": "why only check for `undefined` ? you could also check for `null` `if (newUsernamel)`", "tokens": 25} {"id": 1040205, "source": "review", "repo": "mezz/justenoughitems", "text": "```suggestion jei.tooltip.ingredient.list.disabled.how.to.fix=Klicke auf %s, um es zu aktivieren. ```", "tokens": 40} {"id": 1040253, "source": "review", "repo": "mezz/justenoughitems", "text": "please keep one function call per line, so this should be on its own line: ```java T castContainer = handlerClass.cast(containerScreen); ``` I use this style for clarity and to help narrow down errors in stack traces.", "tokens": 50} {"id": 1040262, "source": "review", "repo": "mezz/justenoughitems", "text": "This should be `getHeight` not `getWidth`", "tokens": 11} {"id": 1040524, "source": "review", "repo": "microsoft/azure-maven-plugins", "text": "the returned object is `AuthenticationResult` while the method is `authorize`. rename the method to `authenticate`", "tokens": 24} {"id": 1040654, "source": "review", "repo": "microsoft/azure-maven-plugins", "text": "get what? It will be better to name it more detail. equals: az account show(we change the term 'show' to 'get')", "tokens": 33} {"id": 1040726, "source": "review", "repo": "microsoft/azure-maven-plugins", "text": "why we move Context from Messager -> Message? IMO. I think it would be easies to understand if it's similar to AzureTelemeter/AzureTelemetry AzureMessage <-> AzureTelemetry, they manage contexts AzureMessager <-> AzureTelemeter, they send/show message/telemetry data.", "tokens": 65} {"id": 1040963, "source": "review", "repo": "microsoft/azure-maven-plugins", "text": "make `getOrCreateConnectionString` Nullable or throw an exception if manager is null?", "tokens": 18} {"id": 1041194, "source": "review", "repo": "microsoft/copilot-for-eclipse", "text": "Will need another PR to full refactor the Message reference in `ui.chat`", "tokens": 17} {"id": 1041315, "source": "review", "repo": "microsoft/copilot-for-eclipse", "text": "In current code, options is just created before this function, so it won't have any children to dispose. Is this for defensive purpose? Yes, but still workable after remove. Removed", "tokens": 40} {"id": 1041318, "source": "review", "repo": "microsoft/copilot-for-eclipse", "text": "Seems like can be replaced by ModelUtils.formatReasoningEffort()? These two functions are for different purpose: - formatReasoningEffort: format Low, Medium, High - resolveReasoningEffortDescription: format description for the related reasoning effort. Unified the function position and updated function name for better understanding.", "tokens": 61} {"id": 1041517, "source": "review", "repo": "microsoft/gctoolkit", "text": "My old eyes find 10_000 much easier to read. done...", "tokens": 22} {"id": 1041584, "source": "review", "repo": "microsoft/gctoolkit", "text": "I'm still torn between this single character convention inside lambdas. I know Oracle started this trend when they first introduced these things but I'm always haveing to go back and go 'What's an s again?' I don't think it's necessary for the GCLogFile isUnified(String) method to throw IOException. If that's true, then this try-catch ugliness goes away. this is all currently being collapsed as it's logic that is repeated in a few places", "tokens": 113} {"id": 1041620, "source": "review", "repo": "microsoft/gctoolkit", "text": "Spoke to Kirk about these 3 methods, it's part of a refactoring to make Vertx an impl of a bus as opposed to being the bus. Makes sense so I'm OK with this here (as long as we raise an issue to complete the refacror)", "tokens": 62} {"id": 1041794, "source": "review", "repo": "microsoft/gctoolkit", "text": "I'll accept this but... what do you think about introducing \"Unknown\" and return that instead of returning null?", "tokens": 27} {"id": 1041963, "source": "review", "repo": "microsoft/hydralab", "text": "Can we specify the exceptions that are thrown? I assume there are some exceptions that should be caught by the codes that invoke the `execLocalCommandWithResult`. Otherwise, some exceptions might be missed. Good idea, done.", "tokens": 47} {"id": 1041994, "source": "review", "repo": "microsoft/hydralab", "text": "Please pass the same args for `killProcessByCommandStr()` which dose not call the function `getFullCommand()` Fixed and verified", "tokens": 28} {"id": 1042056, "source": "review", "repo": "microsoft/hydralab", "text": "How can we know whether the test app is debuggable build? Can we add a check here or in advance so that we should disable the heap dump for signed app. I think this needs to be done at the top of strategy configurations, @taoran6 do we have the flag to indicate that the test app is debuggable / non-debuggable? There is no flag of the strategy configurations to indicate that. I think it's better to check the debuggability at runtime. because the app to be inspected may not be the uploaded test app. (eg: System service app) Sounds good, I'll check the debuggable flag in this inspector.", "tokens": 139} {"id": 1042201, "source": "review", "repo": "microsoft/hydralab", "text": "Please add Xcode and iTunes into the capability list, and verify the Xcode on Mac agent and check iTunes on Windows agent. Will do this in another PR.", "tokens": 40} {"id": 1042344, "source": "review", "repo": "microsoft/malmo", "text": "Tiny nitpick - I saw the Rpc class has the timeout as a member, whereas here it's hard-coded. I'll change to follow the same pattern.", "tokens": 37} {"id": 1042377, "source": "review", "repo": "microsoft/mssql-jdbc", "text": "Need to have tests which use addBatch and preapreMethod exec and cause constrain voilations in the middle of the batch e.g. 5th batch out of a 10 record batch causing PK violation. Post that, how do the update counts look like. The bahavior should be same as prepareMethod prepare for update counts. The test can do both mode executions and compare update counts here. As discussed, in the EXEC case where all SQL statements are combined into a single comma-separated statement, the behavior matches that of a normal SQLStatement. If a violation occurs, all subsequent statements fail as well. The update count has been handled accordingly.", "tokens": 144} {"id": 1042813, "source": "review", "repo": "microsoft/semantic-kernel-java", "text": "Is there any harm in leaving this as it was and just checking isDisabled() at the point where the header is added?", "tokens": 26} {"id": 1042936, "source": "review", "repo": "microsoft/typespec", "text": "Fixed across `a895dad26` and Azure/azure-sdk-for-net#63225 commit `fede841fabe`. MTG now defaults to conservative CLR name, type, and accessor compatibility for effective mapped-base properties and exposes a focused `TypeFactory.IsLastContractModelBasePropertyCompatibleCore` hook for downstream-owned shape changes. MPG overrides that hook only for its known inheritable management types, including the established `type` \u2192 `ResourceType` mapping; ARM-specific policy is no longer inferred by MTG. `ModelProviderTests` passes 210/210, MPG `ManagementTypeFactoryTests` passes 22/22, and Front Door plus Network regeneration/build/ApiCompat pass with the local MTG reference. - by copilot", "tokens": 184} {"id": 1043276, "source": "review", "repo": "microsoft/typespec", "text": "commit 37a4940", "tokens": 10} {"id": 1043535, "source": "review", "repo": "microsoft/vscode-gradle", "text": "`rpc.MessageConnection` provide an `onError` listerner. I'm not sure when & how this connection might occur error, so I think we can collect Telemetry here to get more insight", "tokens": 44} {"id": 1043547, "source": "review", "repo": "microsoft/vscode-gradle", "text": "Move to `src/constant.ts`", "tokens": 10} {"id": 1043602, "source": "review", "repo": "microsoft/vscode-gradle", "text": "Throwing `IllegalArgumentException` here causes the generic `catch (Exception e)` below to send the error via `ErrorMessageBuilder.build(e)`, which surfaces as a generic gRPC `UNKNOWN`/`INTERNAL` on the client. The TS side then caches a `\"Failed to load dependencies\"` hint, which is indistinguishable from a real build failure. For the \"project path not found\" case, prefer `responseObserver.onError(ErrorMessageBuilder.build(e, Status.NOT_FOUND))` (or just return an empty `DependencyItem`) so the extension can differentiate this from a real failure and present a better message. Bonus: combined with the composite-build fix above, this becomes the legitimate signal for \"this Gradle project really doesn't exist in any build\".", "tokens": 163} {"id": 1044105, "source": "review", "repo": "mkotsur/restito", "text": "Oh, I just mean: Setup: ``` When /foo Then OK200 and sequence STRINGfoo1, STRINfoo2 When /bar Then OK200 and sequence STRINGbar1, STRINGbar2, STRINGbar3 ``` Checks: ``` Get /foo expect STRINGfoo1 Get /bar expect STRINGbar1 Get /foo expect STRINGfoo2 ... ``` And so on...", "tokens": 90} {"id": 1044496, "source": "review", "repo": "mockbukkit/mockbukkit", "text": "Would it otherwise be possible to require a name parameter string in the annotation, which you could use here? You could have it be optional in the annotation, and then require it only for certain fields, throwing some kind of exception when the test starts. That could possibly clarify where this name comes from, or what do you think? Added, pure optional behaviour. In most of my tests, I don't care what a player is called, I just care I have a player object ;). But if it's necessary, you can name them however you want.", "tokens": 117} {"id": 1044500, "source": "review", "repo": "mockbukkit/mockbukkit", "text": "```suggestion else if (type.isAssignableFrom(PluginMock.class)) ```", "tokens": 16} {"id": 1044758, "source": "review", "repo": "mockito/mockito", "text": "Not quite sure, why not most specific anymore? Fixed in new commit, I originally based off a different branch I think", "tokens": 25} {"id": 1044892, "source": "review", "repo": "mockito/mockito", "text": "Updated, as these were now released in 4.11.0, not 5.0.0 FYI, seems you're missing the 4.11.0 tag in the repo. Ah yes good point. With regards to the tag, `v4.11.0` was released: https://github.com/mockito/mockito/releases/tag/v4.11.0", "tokens": 91} {"id": 1044902, "source": "review", "repo": "mockito/mockito", "text": "In a sense there [is already a test](https://github.com/mockito/mockito/blob/a9595f559cf4acdaed92371537ced982e30f508d/src/test/java/org/mockito/MockitoTest.java#L164) for this case, but as Mockito currently doesn't compile with something like `options.compilerArgs << \"-Xlint:unchecked\" << \"-Werror\"`, the build currently doesn't fail on it. The changes in this PR are relevant for users that do compile with those flags.", "tokens": 140} {"id": 1045088, "source": "review", "repo": "mockito/mockito", "text": "Drive by: I noticed the initial FR and this PR when googling whether mockito already supported this functionality. One note i'd drop is it may be worth having both a variant with and without argument comparison. or (if technically feasible) perhaps one that only counts invocations with arguments that conform to the relevant ArgumentMatchers rather than strict comparisons to one another. eg: ```java doAnswer(inv -> { if(inv.getMatchedInvocationCount() == 2) { // doThing() } return null; }) .when(myMock) .mockedMethod(argThat(x -> x%2 == 0)) myMock.mockedMethod(1); // no doThing(), didn't match myMock.mockedMethod(2); // no doThing(), 1st invocation with matching args myMock.mockedMethod(4); // doThing(), 2nd invocation with matching args ``` This is useful for example when testing pagination/continuation logic.", "tokens": 204} {"id": 1045103, "source": "review", "repo": "modelcontextprotocol/java-sdk", "text": "The Flux above provides the means to synchronize actions. Something else is at fault. The role of the latch is to ensure that the expected number of output messages are produced in result of the (simulated) incoming message. I've added additional `public void simulateIncomingMessage(McpSchema.JSONRPCMessage message, int expectedResponseMessagesCount)` signature that would allow the test to specify the expected output message (could be 0 for some tests).", "tokens": 92} {"id": 1045206, "source": "review", "repo": "modelcontextprotocol/java-sdk", "text": "IMO make this an instance field with a constructor overload. e.g. ```java McpSyncClient(McpAsyncClient delegate) { this(delegate, new ObjectMapper()); } McpSyncClient(McpAsyncClient delegate, ObjectMapper objectMapper) ``` Makes sense. Made changes based on how the objectMapper is initialized in SSE client transport.", "tokens": 64} {"id": 1045310, "source": "review", "repo": "modelcontextprotocol/java-sdk", "text": "```suggestion * @param call Deprecated. Use the {@link AsyncToolSpecification#callTool} * instead. ```", "tokens": 24} {"id": 1045438, "source": "review", "repo": "modelcontextprotocol/java-sdk", "text": "**[suggestion]** remove this test, it's a special case of `testRequestHandlerThrowsMcpErrorWithJsonRpcError`", "tokens": 27} {"id": 1045444, "source": "review", "repo": "modelcontextprotocol/java-sdk", "text": "No `|` type in Java, so add the `task` here instead of `GetTaskRequest | CallToolResult`, an `Either` type will change much code, and `Object` loses type safety. I was adding a `CallToolAuxResult` and I found the `JSONRPCResponse` has a `JSONRPCError`, so I will follow the same design. it should be `JSONRPCResponse | JSONRPCError`, but the current shape seems pratical.", "tokens": 97} {"id": 1045570, "source": "review", "repo": "modelcontextprotocol/java-sdk", "text": "With 1 filter, Mono.empty() stays empty; with 2+, empty is coerced to false: (e.g..defaultIfEmpty(Boolean.FALSE)). Not sure what downstream implications this might have. It will be cleaner to either remove the if (filters.size() == 1) optimization or use the same defaultIfEmpty strategy empty is equivalent to false; there are no semantic differences it's not designed for end user consumption but rather for the SDK, so I feel we're safe here. Updated the comment on the `.isVisible` method to document this. Perhaps something like: ``` java if (filters.size() == 1) { McpAsyncListFilter filter = filters.get(0); return (transportContext, primitive) -> filter.isVisible(transportContext, primitive) .defaultIfEmpty(Boolean.FALSE); } ```", "tokens": 184} {"id": 1045648, "source": "review", "repo": "modificationstation/stationapi", "text": "Wouldn't `Floats.constrainToRange(light[i], emission, 1)` make more sense here? Or do I not understand the algorithm. The idea is to lerp between normal light (without emission) and with full brightness, that's why I used lerp here It is just a bit more than using minimum value in some range, it actually changes shading of face from normal shading up to lit shading depending on light intensity", "tokens": 96} {"id": 1045765, "source": "review", "repo": "mojang/brigadier", "text": "Why did you unindent HTML elements? Sigh. That was IntelliJs autoformatter. I surrounded the ones I wrote with formatter off tags to prevent that, but it seems I missed some. Thanks, I will restore that :)", "tokens": 50} {"id": 1045826, "source": "review", "repo": "mojang/brigadier", "text": "```suggestion * @return the last child command context builder ```", "tokens": 13} {"id": 1045899, "source": "review", "repo": "mojang/brigadier", "text": "Should rather return a combined view of requirements here.", "tokens": 11} {"id": 1045968, "source": "review", "repo": "mojang/datafixerupper", "text": "`List` and `Lists.newArrayListWithCapacity` Guava can potentually be dropped as a dependency in the future (most usages are `Lists.newArrayList` and such) (see #25), so I'll try using `new ArrayList<>` for new code :) Ok, but don't use concrete types as variable types. :+1:", "tokens": 77} {"id": 1046012, "source": "review", "repo": "mojang/datafixerupper", "text": "I think this uses an `ArrayMap` intentionally to keep element order consistent? Probably so. It's possible to preserve element order using `Object2ObjectLinkedOpenHashMap` instead. I'm not sure whether this method is actually supposed to guarantee it (the return type is plain `Map`, which itself makes no ordering promise), but it's safer to keep behavior consistent with what's there now. If this only gets used on the rare ImmutableMap.Builder fallback path, the performance cost of switching from not linked `HashMap` should be negligible.", "tokens": 120} {"id": 1046020, "source": "review", "repo": "mojohaus/aspectj-maven-plugin", "text": "```suggestion * Weaves all main classes using the AspectJ Compiler Plugin. ```", "tokens": 20} {"id": 1046050, "source": "review", "repo": "morenoh149/react-native-contacts", "text": "I think I've got a fix - https://github.com/rt2zz/react-native-contacts/pull/48 Have tested but only on older versions of android (and am going on holiday very soon so might not have time to test properly for a week or so). Anyway - looks like it gets the data back fine. I'll at least try and do some performance testing tomorrow.", "tokens": 90} {"id": 1046078, "source": "review", "repo": "morenoh149/react-native-contacts", "text": "Thank you for your PR. This section should actually go on line 99, under Installation > Manual > Android > Proguard Done", "tokens": 30} {"id": 1046119, "source": "review", "repo": "moxy-community/moxy", "text": "Companion objects should be at the end of class, as per kotlin style guide", "tokens": 17} {"id": 1046153, "source": "review", "repo": "mp911de/logstash-gelf", "text": "Have you considered using `Layout#LINE_SEP`? `System.lineSeparator()` is available since Java 1.7.", "tokens": 26} {"id": 1046311, "source": "review", "repo": "mzmine/mzmine", "text": "add top level desc that this is preferred over the JFreechart chart ffactory ```java /** * This is the preferred alternative to {@link ChartFactory} and generated observable versions of * the same charts and plots as {@link FxJFreeChart} and {@link FxXYPlot} that already come with * observability, optimized reduced chart draw events, and more. */ ```", "tokens": 81} {"id": 1046370, "source": "review", "repo": "mzmine/mzmine", "text": "also set the domain axis label to groupingColumn. Here or in the constructor of boxPlot", "tokens": 19} {"id": 1046502, "source": "review", "repo": "mzmine/mzmine", "text": "just call the method once, it is quite expensive. done", "tokens": 13} {"id": 1046552, "source": "review", "repo": "mzmine/mzmine", "text": "This sounds like the actual file will be overwritten. \"Replace existing library?\" \"A library with the name %s already exists. Creating a new library with the same name will remove the current library from the project and add a library only containing the new entries.\" Good idea to be more precise. Is it good like this? \"image\"", "tokens": 135} {"id": 1046579, "source": "review", "repo": "mzmine/mzmine", "text": "remnant from lipid dashboard?", "tokens": 10} {"id": 1046662, "source": "review", "repo": "mzmine/mzmine", "text": "Potential room for speed up: the lipid chains could store their expected mz so it is not recalculated on every scan there is a lot of potential for improvements in this method. The list of fragments is generated for every input with the same arguments so that could be cached", "tokens": 59} {"id": 1046766, "source": "review", "repo": "mzmine/mzmine", "text": "i think this is not needed. it only adds additional menu items. it only adds addtional menu items which can simply be added to AcadamicWorkspace and FullWorkspace. also see FxMenuUtil.addToSubMenuIfAvailable Agreed; ApplicationMenus is removed in the prepared patch. FullWorkspace creates a fresh MCP menu through its normal menu builder. Pro supplies an Academic workspace decorator for the same purpose, including rebuilding an already active Academic menu. Community no longer needs a global menu-contribution registry.", "tokens": 112} {"id": 1046776, "source": "review", "repo": "mzmine/mzmine", "text": "this looks like it should be handled with an enum rather than strings, or? Agreed. The prepared patch uses the existing VersionCheckResultType enum through VersionCheckResult. String values are now produced only at the bridge JSON boundary; the update service no longer uses string status constants.", "tokens": 55} {"id": 1046846, "source": "review", "repo": "mzmine/mzmine", "text": "i dont unterstand. this PR explicitly adds the user defined initial wizard parameters and then does not add them the results? why?", "tokens": 28} {"id": 1046848, "source": "review", "repo": "mzmine/mzmine", "text": "from what i understand this is not the \"current\" setting (as in the latest) but the initial user setting, or? then call it that", "tokens": 31} {"id": 1047048, "source": "review", "repo": "nashtech-garage/yas", "text": "we should undo this change. This should be handled in other PRs", "tokens": 14} {"id": 1047151, "source": "review", "repo": "nashtech-garage/yas", "text": "`res` is an instance of Response, so throwing the response is not appropriate. Create an Error and throw it instead. I've created and returned the Error instead of throwing raw res", "tokens": 39} {"id": 1047179, "source": "review", "repo": "nashtech-garage/yas", "text": "Do we need to handle hard delete record in case? If not I think we can filter them here. ```java .filter((key, value) -> value == null || value.getAfter() != null) ``` Ignore, this case we will store hard delete records.", "tokens": 58} {"id": 1047396, "source": "review", "repo": "nemproject/nem", "text": "```suggestion Makes the queried node request the blockchain height from every node in its active peer list, and returns the maximum height observed. ```", "tokens": 29} {"id": 1047775, "source": "review", "repo": "objectionary/eo", "text": "The inputs got swapped against their names during the move. In `string/low-cased.eo` it was `can-convert-already-lower-cased-text` \u2190 `\"HeLlO\"` and `can-convert-text-to-lower-case` \u2190 `\"HELLO\"`; here it is `already-lower-cased` \u2190 `\"HELLO\"` and `text-to-lower-case` \u2190 `\"HeLlO\"`. Same for the two `up-cased` tests below. Nothing breaks, because both inputs produce the same expectation \u2014 which is the point: the names carry no information either way, so the swap is invisible and will stay in the file forever. Worth restoring the original pairing so that `git log --follow` on these tests shows a move and not a move-plus-edit.", "tokens": 181} {"id": 1047888, "source": "review", "repo": "objectionary/eo", "text": "The javadoc does not say what the caller gets when the block runs to the end of the file. `after` can return `spans.size()`, which is exactly what the loop in `Eo` relies on to terminate, and that contract is worth one sentence here since it is the only reason the caller needs no bounds check of its own.", "tokens": 73} {"id": 1047952, "source": "review", "repo": "objectionary/eo", "text": "The range check lives in `checked-port` at the call site (line 197), but `htons` itself still silently truncates \u2014 the exact failure this PR closes, just moved one level in. `htons` is public and the test on line 282 calls it directly, so I dataized it out of range: `htons 70000` -> `70-11` (a bogus in-range port, 4464), `htons 65536` -> `00-00` (port 0), `htons -1` -> `FF-FF`. Any caller other than the guarded socket path gets the corruption back. Guarding inside `htons` would cover both paths and let `checked-port` fold away; as it stands the atom's own contract is still unsafe.", "tokens": 197} {"id": 1048105, "source": "review", "repo": "objectionary/eo", "text": "No test exercises an octal escape with regular text on both sides (e.g. \"ab\\\\377cd\"), which is the path that actually depends on appendText flushing the buffer in the right order relative to the raw byte write. Both new tests here and in the yaml pack use a bare \\\\377 with nothing around it.", "tokens": 75} {"id": 1048117, "source": "review", "repo": "objectionary/eo", "text": "This covers a compile-scope XMIR changing content. There's no test for a compile-scope XMIR disappearing entirely between two lint runs (removed from `this.compile.withXmir()`) \u2014 a different edge of the same fix.", "tokens": 55} {"id": 1048122, "source": "review", "repo": "objectionary/eo", "text": "Combining `created && Files.notExists(test)` into one boolean loses which half failed - if this ever regresses, the failure message just says the boolean was false, not whether the file was never created in the first place or never removed. Two separate assertions (or a `Matchers.allOf`) would keep the two claims distinguishable in a failure report.", "tokens": 81} {"id": 1048206, "source": "review", "repo": "objectionary/eo", "text": "`eo.coverageFile` now names two different things that have to agree and are set by two different mechanisms: this `@Parameter`, read by Maven from `-D` or the pom, and the system property of the forked test JVM, which surefire sets from its own ``. A user who passes `-Deo.coverageFile=/tmp/x` on the command line moves the mojo's idea of the file, and moves the tests' idea only if surefire happens to forward it. That coupling is the whole feature and it is invisible from either side. At minimum this javadoc should say that the value must match what surefire gives the tests, and name where that is configured. Better, when the file is missing this goal could say so \u2014 right now `recorded()` silently returns nothing and the user gets an empty tracefile with no hint that the two halves disagreed. The field name is worth a look too: `hits` against a property called `eo.coverageFile`, and `FakeMaven` in `MjLcovTest` has to say `.with(\"hits\", \u2026)` because of it.", "tokens": 242} {"id": 1048247, "source": "review", "repo": "objectionary/eo", "text": "Good extraction \u2014 the duplicated walk was the thing that would have gone wrong first. One note on cost: this parses each document again on every call, so with two clues every `.xmir` in eo-runtime is read and DOM-built twice, and three times once the third clue lands. `documents()` is already private and side-effect free, so memoising it in the field would make that flat.", "tokens": 88} {"id": 1048307, "source": "review", "repo": "objectionary/eo", "text": "@morphqdd try to use Threads instead: https://github.com/yegor256/cactoos/blob/560a72612ad8d872cedf715c481a87f544b1b5c1/src/main/java/org/cactoos/experimental/Threads.java#L27", "tokens": 84} {"id": 1048348, "source": "review", "repo": "objectionary/eo", "text": "This follows the existing behavior-oriented test naming convention in this directory (`can-...`). Comparable names are at least as descriptive/long, for example `can-recover-from-bytes-of-wrong-size-when-converting-to-i64` in `bytes/as-i64.eo`, so I\u2019m retaining the explicit XOR diagnostic behavior here.", "tokens": 86} {"id": 1048385, "source": "review", "repo": "ochotonida/artifacts", "text": "This class didn't move to common, so gloves will not render in first person for people running Trinkets on NeoForge. I also don't see the first person glove rendering implemented for Accessories. ArmRenderHandler handles first person glove rendering on NeoForge using RenderArmEvent, you should have something similar for Trinkets/Accessories and factor out the common code. > This class didn't move to common, so gloves will not render in first person for people running Trinkets on NeoForge. Ah that is a problem that will need to be adjusted for Trinkets, Accessories providers a built-in method to render Accessories in First person but such needs to be implemented which I will do. I look into refactoring such to be callable from either the mixin on fabric or the event on neoforge while using Accessories API for such.", "tokens": 185} {"id": 1048648, "source": "review", "repo": "opacapp/opacclient", "text": "Ja, die Anpassungen kommen nicht von uns und es sind noch andere Fehler drin. Wird noch korrigiert ;)", "tokens": 48} {"id": 1048694, "source": "review", "repo": "opacapp/opacclient", "text": "\"nach letzter R\u00fcckgabe\"?", "tokens": 13} {"id": 1048747, "source": "review", "repo": "opencollab-incubator/Boar", "text": "Change this back... the default value is 1.0e-4, Boar said \"it can't handle any offset smaller than 5.0E-5\" not 5.0e-5 is the suggested and default value. i don't think so. the default value on my server causes a bunch of false positives just when i'm running why do we even need to process o<5.0E-5? > i don't think so. the default value on my server causes a bunch of false positives just when i'm running btw 1.0e-4 is more lenient 5.0E-5, so if you set it to 5.0E-5 it will flag more. 1.0e-4 will flagged if the position differ by 0.0001 and for 5.0e-5 it's if the position differ by 0.00005 just change it back maybe set it to 1.0e-3 while we at it too, probably best to be more lenient than 1.0e-4 oh sh... i didn't notice that it was -5 there yes, that will work, since there were offset values \u200b\u200blike 1.2207031E-4", "tokens": 286} {"id": 1048753, "source": "review", "repo": "opencubicchunks/cubicchunks", "text": "Removing this check makes it slower Reintroduced", "tokens": 10} {"id": 1048816, "source": "review", "repo": "opencubicchunks/cubicchunks", "text": "Don't do this kind of formatting. This will cause a lot of unnecessary changes when renaming variables, and IDEA formatter will remove it anyway. Is there a way to tell IDEA to ignore nice clean _lined up_ code. :C I guess it can be done. We can discuss universal eclipse/idea formatting settings later", "tokens": 70} {"id": 1048927, "source": "review", "repo": "opencubicchunks/cubicchunks", "text": "I would suggest making ICubicWorldGenerator extend the forge IWorldGenerator (is that the name?) and use WorldGenerators registered with Forge. This would allow other kods to do something like this: ```java ModWorldGenerator implements IWorldGenerator ModWorldGeneratorCubicChunks extends ModWorldGenerator implements ICubicWorldGenerator // in (pre)init: GameRegistry.registerWorldGenerator(hasCubicChunks ? new ModWorldGenerator() : new ModWorldGeneratorCubicChunks()); ``` This would also make it possibe to have default implementation of IWorldGenerator in ICubicWorldGenerator for vanilla worlds. And if the mod requires cubic chunks, and the code isn't only for compatibility - there would ne no hasCubicChunks check. This way I should make worldGenerators and worldGeneratorIndex fields inside Forge GameRegistry public, strip it from generators, which are not implementing our interface and create our own list. The problem is that Access Transformers won't work on Forge fields/methods. The only way is to use reflection. @Barteks2x will this work? ``` List forgeWorldGenerators = ReflectionUtil.getFieldValueSrg(GameRegistry.class, \"worldGenerators\"); Map forgeWorldGeneratorIndex = ReflectionUtil.getFieldValueSrg(GameRegistry.class, \"worldGeneratorIndex\"); ``` Other way would be to call the forge computeSortedGeneratorList and then access already sorted list", "tokens": 294} {"id": 1049044, "source": "review", "repo": "opencubicchunks/cubicchunks", "text": "make the class abstract and make this an abstract method", "tokens": 11} {"id": 1049214, "source": "review", "repo": "opencubicchunks/cubicchunks", "text": "This is still broken because reserveForKey marks the old entry as unused after new value for it is reserved. So it's going to be free to be reallocated for next entries in a batch write.", "tokens": 43} {"id": 1049338, "source": "review", "repo": "opentok/opentok-android-sdk-samples", "text": "Maybe we should have a finally block to make sure stream is closed ? this is 1:1 Java code translation (so needs to be updated in Java code as well). It looks like `steram.close()` can also throw `IOException`, so this requires a bit more testing. I would leave this for now and unify this behavior later. agreed.", "tokens": 75} {"id": 1049544, "source": "review", "repo": "oshi/oshi", "text": "I'm not sure of the purpose of this method. The only time you use it is to check if it's empty; a list of map entries seems incorrect. Should this be a map of connectorID to EDID?", "tokens": 49} {"id": 1049627, "source": "review", "repo": "palatable/lambda", "text": "Not sure what your intellij config is for lambda. I haven't changed the import settings", "tokens": 19} {"id": 1049798, "source": "review", "repo": "pholser/junit-quickcheck", "text": "I don't use `*` imports in the project except in `static` imports. Please expand this out.", "tokens": 24} {"id": 1049817, "source": "review", "repo": "phybros/servertap", "text": "What's this for? I couldn't get `com.fasterxml.jackson.core.jackson-databind` to satisfy without it. Weird. It just comes down from maven central automatically on my machine. And in Github actions... Maybe it's a weird versioning thing. Probably fine to explicitly include it here", "tokens": 70} {"id": 1049908, "source": "review", "repo": "plaid/plaid-java", "text": "I don't know java well enough to understand if this empty class is necessary? me neither tbh - copied from https://github.com/plaid/plaid-java/blob/03ef882fc417ab729da308ab5098feea3d493574/src/main/java/com/plaid/client/request/TransactionsGetRequest.java#L78", "tokens": 95} {"id": 1050118, "source": "review", "repo": "playtikaoss/testcontainers-spring-boot", "text": "can we use ```LocalStackContainer.Service``` in properties instead of converting it from String? also it will have a validation up on missing service Fixed.", "tokens": 32} {"id": 1050422, "source": "review", "repo": "polyhedraldev/terra", "text": "Why do we not relocate this? (Unless `shadedApi` does that automatically?)", "tokens": 20} {"id": 1050590, "source": "review", "repo": "primefaces/primefaces", "text": "Why string here and not object? bad copy/paste :D", "tokens": 14} {"id": 1050602, "source": "review", "repo": "primefaces/primefaces", "text": "I think this could cause a collision if two files with the same name are uploaded simultaniously: 1. `test.jpg` is uploaded 2. It gets saved in a temporary file with a randomized name, e.g. `/tmp/test3887755495119540932` (fine) 3. Then it's moved according to its original filename: `/tmp/test.jpg` (problematic, could exist already because of another request, some other program writing temporary files, etc.) Really what i think should happen is that the tempFile name is taken as is (we can expect it to be unique because of the random name) and the file extension gets appended", "tokens": 160} {"id": 1050735, "source": "review", "repo": "primefaces/primefaces", "text": "```suggestion if (FacetUtils.shouldRenderFacet(messageFacetComponent)) { ```", "tokens": 17} {"id": 1050878, "source": "review", "repo": "primefaces/primefaces", "text": "i dont like the \"Default is...\" should we remove it? but we have to add a new field then like \"implicitDefaultValue\" as we manage some defaults in JS directly, not via StateHelper Agreed a lot of this I was just taking from the primefaces.taglib.xml descriptions but you are right we should add an `implicitDefaultValue`?", "tokens": 73} {"id": 1051244, "source": "review", "repo": "qiniu/android-sdk", "text": "`recoderDnsCache` => `recorderDnsCache`", "tokens": 15} {"id": 1051247, "source": "review", "repo": "qiniu/android-sdk", "text": "`DnsPrefrtcherTransaction` => `DnsPrefetcherTransaction`", "tokens": 16} {"id": 1051354, "source": "review", "repo": "qos-ch/slf4j", "text": "Maybe: ```suggestion // this fails when test is executed from the module path // because the module declaration does not declare // `uses System.LoggerFinder` return ServiceLoader.load(System.LoggerFinder.class).stream() .filter(finder \u2192 finder instanceof SLF4JSystemLoggerFinder) .findAny() .orElseThrow(); ``` Note: this `orElseThrow` requires JDK 10.", "tokens": 84} {"id": 1051372, "source": "review", "repo": "qos-ch/slf4j", "text": "Since https://github.com/bndtools/bnd/issues/5789 was closed should we add the uses constraints back? But I haven't read Peter Kriens answer in full detail. Basically it says, that the tool does not support emitting uses twice (automatically generated) but in this particular case they are not necessary either (as there won't be ever any other bundle exporting those packages from the uses directive). Therefore I removed the manually copied uses constraints.", "tokens": 105} {"id": 1051503, "source": "review", "repo": "randoop/randoop", "text": "Could you make a separate pull request that introduces the `updateStats()` method? Then this pull request may modify it, but the changes in this pull request will be smaller.", "tokens": 36} {"id": 1051652, "source": "review", "repo": "randoop/randoop", "text": "JDK classes in what format? Probably Class.getName format or field descriptor format, but I'm not sure.", "tokens": 24} {"id": 1051773, "source": "review", "repo": "randoop/randoop", "text": "Where is \"colon/JVM-descriptor form\" documented? Please provide a URL or other reference. (For example, method descriptors are defined in JVMS section 4.3.3, and Randoop fully-qualified signatures are defined at https://randoop.github.io/randoop/manual/#fully-qualified-signature.) If you made it up, then I suggest using a standard format instead. It is odd that one signature format is used for adding a method replacement (namely, Randoop fully-qualified signatures, defined at https://randoop.github.io/randoop/manual/#fully-qualified-signature), but a *different* signature format is used for excluding one. I think that difference is likely to confuse users. What is the benefit of using a different format? Another benefit of using an existing format is the ability to just call `MethodSignature.of()`, which will eliminate more than half of this pull request.", "tokens": 192} {"id": 1051847, "source": "review", "repo": "react-native-google-cast/react-native-google-cast", "text": "I think the parameter could be optional, defaulting to false. ```suggestion async endCurrentSession(stopCasting: boolean = false): Promise { ```", "tokens": 34} {"id": 1052175, "source": "review", "repo": "react-native-video/react-native-video", "text": "it would be pretty easier to to move this prop inside: (controlsStyles)[https://thewidlarzgroup.github.io/react-native-video/component/props#controlsstyles] Can you please move it ? Can I suggest another behavior: showSubtitleButton -> default true If true display the subtitle button only when subtitle track are available If false never display the subtitle button (it is maybe already the case, but would be great to clarify it in the doc) I couldn't agree more. Let me do it.", "tokens": 113} {"id": 1052389, "source": "review", "repo": "react-native-video/react-native-video", "text": "idk why but i get 404 error when this link ends with \"/\". Could we remove last character \"/\" to be sure it wouldn't throw error?", "tokens": 35} {"id": 1052395, "source": "review", "repo": "react-native-video/react-native-video", "text": "```suggestion yarn android:tv --device ```", "tokens": 11} {"id": 1052543, "source": "review", "repo": "react-native-webrtc/react-native-webrtc", "text": "`PermissionHelperActivity` seems very invasive to me because it \"replaces\" the `Activity` which effectively requests the permissions by calling `getUserMedia`. Moreover, on my Samsung S8 it looks really ugly because my `Activity` gets fully replaced by a white full-screen rectangle which has a tiny dialog in the center. And the replacing happens with a sliding animation! Google mentions a \"headless fragment\" which attaches to an `Activity` and is able to request runtime permissions. Given that `WebRTCModule` appears in source code to be able to give us a `currentActivity` to which it is attached, have \"headless fragments\" been explored as an alternative to `PermissionHelperActivity`? A headless fragment instead of `PermissionHelperActivity` is exactly what we need here! Interesting! I was not aware of that, sorry. Also, FWIW, my Google Plxel does it the sane way, that is, it doesn't replace the entire screen with a white full-blown view. \ud83d\ude1e", "tokens": 219} {"id": 1052590, "source": "review", "repo": "react-native-webrtc/react-native-webrtc", "text": "```suggestion [s appendString:@\"}]\"]; ```", "tokens": 13} {"id": 1052595, "source": "review", "repo": "react-native-webrtc/react-native-webrtc", "text": "Isn't NSDate too \"heavy\" for this? I tnow it doesn't directly translate, but this what the WebRTC sample does: `int64_t timeStampNs = CMTimeGetSeconds(CMSampleBufferGetPresentationTimeStamp(sampleBuffer)) * NSEC_PER_SEC;` The WebRTC code is just reading the time stamp from the CMSampleBufferRef, which we don't have. It's either we compute it on the client side and send it as part of the message, or compute it here. I chose the latest. Fixed. I replaced the implementation to use `mach_time` instead of `NSDate`", "tokens": 141} {"id": 1052687, "source": "review", "repo": "react-native-webrtc/react-native-webrtc", "text": "This should not be blocking, if we can help it. Just like addStream wasn't. It is not really possible since we need to return an RTCRtpSender object on the web API that could potentially be created with this call. Ok. If it becomes a problem we can probably create a \"shell\" sender while the operation happens in the background, but likely it won't be a problem since one usually has few local tracks anyway. Right.", "tokens": 94} {"id": 1052704, "source": "review", "repo": "react-native-webrtc/react-native-webrtc", "text": "I see no entity emitting this? WebRTCModule.peerConnectionRemoveTrack now does.", "tokens": 18} {"id": 1052860, "source": "review", "repo": "react-native-webrtc/react-native-webrtc", "text": "This is not safe to do if there are any peer connections or local tracks still sctive. There is even a `dispose()` method that it's not being called here. Wasn't aware of the dispose method. Regarding safety, I don't see any way to check for ongoing tracks/connections and implement guard rails. Calling `releaseWebrtc` in such state would be a program error obviously.", "tokens": 88} {"id": 1052953, "source": "review", "repo": "redis/jedis", "text": "Semantic was if no consumer is provided just propagate the messages as before to client, agree that it is more conciser to always require a push consumer.", "tokens": 32} {"id": 1053066, "source": "review", "repo": "redis/jedis", "text": "Do we need this or it is optional?", "tokens": 10} {"id": 1053737, "source": "review", "repo": "refinedmods/refinedstorage", "text": "`patternAvailable` is a weird name for a method that checks if two pattern slots AREN'T available... its supposed to return the opposite, sorry! commited that change", "tokens": 40} {"id": 1053927, "source": "review", "repo": "refinedmods/refinedstorage2", "text": "Can these be removed now somehow? At the moment I was not able to configure the parchment version via version catalog, opened a bug in the fabric loom gradle plugin about that https://github.com/FabricMC/fabric-loom/issues/782 In that case, maybe put a TODO comment on there with a link to your issue. I had a thought, how to get rid of the versions there, you can also only define a version in the catalog and use it in a string interpolation, we should still add that TODO with the link. Not sure if it should be at the position where the version is defined, or at the position where it's used. That's even better. Probably in the position where it's used, I think..? Could you check if that is ok like that?", "tokens": 172} {"id": 1054058, "source": "review", "repo": "refinedmods/refinedstorage2", "text": "```suggestion .requires(getDyeItem(color)) ```", "tokens": 14} {"id": 1054152, "source": "review", "repo": "refinedmods/refinedstorage2", "text": "Maybe put a waiting time here to ensure that it never reaches >10", "tokens": 16} {"id": 1054204, "source": "review", "repo": "refinedmods/refinedstorage2", "text": "I guess the mixin needs to be updated here", "tokens": 10} {"id": 1054269, "source": "review", "repo": "reneargento/algorithms-sedgewick-wayne", "text": "This looks like a distinct tree shape indeed. I would just adjust the number of spaces in this 3-node - it should have 1 space instead of 2, like the other 3-nodes.", "tokens": 44} {"id": 1054294, "source": "review", "repo": "reposense/reposense", "text": "```suggestion commit as unknown as DailyCommit; ``` Is it better to typecast to `unknown` instead of `any` here? Actually I realised that this typecast wasn't doing anything \ud83d\ude05 since it doesn't change the underlying type of the object, but creates a new object with the new type. I originally wanted to typecast this to have the correct type when creating the `User` object. For now the `obj` in `new User(obj)` has the `any` type - changing this will require some refactoring which I'll do in a separate PR as mentioned above.", "tokens": 126} {"id": 1054322, "source": "review", "repo": "reposense/reposense", "text": "Just a comment regarding format consistency. I think the semicolons are missing here. Actually, the current eslint rules do not seem to enforce the presence of semicolons, which can be discussed in a separate issue Thanks for pointing this out! Just fixed the semicolons in the latest commits. Just checked the ESLint rules that we're adding in #1912 - the ruleset does enforce semicolons for regular statements (the [semi](https://typescript-eslint.io/rules/semi/) rule), but not for TypeScript `interface`s and `type`s specifically, as you mentioned. We can enforce this via the [member-delimiter-style](https://typescript-eslint.io/rules/member-delimiter-style) rule, i.e. just adding the following to `.eslintrc.json`. ``` \"rules\": { \"@typescript-eslint/member-delimiter-style\": \"error\" } ``` Will open up a separate issue about this where we can investigate rules like the above one. Thanks!", "tokens": 218} {"id": 1054421, "source": "review", "repo": "reposense/reposense", "text": "Thanks for fixing this part of the code with null checks!", "tokens": 13} {"id": 1054552, "source": "review", "repo": "reposense/reposense", "text": "Should this `DELIMTER` pattern be stored in the `BlurbMarkdownParser` instead? It seems specific to the blurbs use case? I wanted to follow the pattern used in `CsvParser` whereby the delimiter is stored in the abstract class, but perhaps I can move it to the concrete class to reduce coupling? Yes, I believe the other concrete MarkdownParsers will have different delimiter patterns, eg. `\"(.*)\"` for blurbs for authors, so we can decouple them. @gok99 Sure thing, will refactor!", "tokens": 118} {"id": 1054568, "source": "review", "repo": "reposense/reposense", "text": "`fromYaml`? I initially wanted to follow the same interface as `JsonParser`, but in retrospect it might have been better to declare another abstract `YamlParser` that implements similar interface methods as `JsonParser`. I could probably work on this in the upcoming weeks if I have some time; anyone is welcome to jump in and refactor the code if this feature is needed urgently!", "tokens": 80} {"id": 1054870, "source": "review", "repo": "rmlio/rmlmapper-java", "text": "You mentioned that the partially namespaced tree wasn't investigated yet. The files are here, could you try to add the RML mapping rules so we have a full test case as well? Maybe it is not hard to support partially namespaced tree as well? Yes, I created the file for testing, but as of today I don't know how to create a `doMapping` that fails. I will not have time soon to investigate this, but at least the file is here for further investigations. however this should not be so hard, just need a precise attention. I can remove this file if you prefer. Lets keep the file and we can figure this out later. Will make an internal issue about this.", "tokens": 150} {"id": 1055178, "source": "review", "repo": "samuel-oliveira/java_nfe", "text": "Por que Ele se aplica somente ao Cancelamento?", "tokens": 18} {"id": 1055224, "source": "review", "repo": "sarxos/webcam-capture", "text": "platform dependent API should not involved directly in main Webcam", "tokens": 11} {"id": 1055285, "source": "review", "repo": "sashirestela/simple-openai", "text": "- Add an entry for Gemini Vertex on the `Table of Contents` section, above Gemini Google. - Add an entry for Gemini Vertex on the `Support for OpenAI-compatible API Providers` section, above Gemini Google. Be sure to add the correct information and avoid copy-paste. - Add indication to include the dependency to googleauth with a Maven example. In a previous revision I observed the following: > - Add an entry for Gemini Vertex on the Support for OpenAI-compatible API Providers section, above Gemini Google. Be sure to add the correct information and avoid copy-paste. > - Add indication to include the dependency to googleauth with a Maven example. The last sentence about dependency needs to be completed", "tokens": 146} {"id": 1055354, "source": "review", "repo": "scireum/s3ninja", "text": "if possible we should stick to GA releases here... done", "tokens": 15} {"id": 1055749, "source": "review", "repo": "seart-group/ghs", "text": "I think I remember now why we used to use `createOrUpdateRepo`, and I don't think we can use it here. I can explain it in more detail to you personally, but as of right now I think we should use the repository directly, so revert this change. I'll swing by the office so you can explain it later :)", "tokens": 74} {"id": 1056040, "source": "review", "repo": "segmentio/analytics-android", "text": "Would it be a backward-compatibility issue? Not 100% sure but probably it's the client job to specify which context should be used to access the storage area - device or user... Perhaps we can do better - we can extend the `Builder` [class](https://github.com/segmentio/analytics-android/blob/master/analytics/src/main/java/com/segment/analytics/Analytics.java#L1061) good callout. once we get the test plan i will try to run it via multiple scenarios to make sure nothing breaks \ud83d\udc4d I don't think it is client responsibility think of which context can be specified, given that any needed check can be done on the library side and also any type of context can be obtained. Context class itself has those api to get application context or to get context with device protected storage reference. It just doesn't make sense to burden clients with all those decisions. I'll just move prefs to device protected storage as a migration step. > I don't think it is client responsibility think of which context can be specified Yeah, maybe it's not the client's responsibility... It mostly depends on what type of data the segment library keeps in the shared preferences. According to https://android-developers.googleblog.com/2016/04/developing-for-direct-boot.html > All sensitive, private information, like the full message history and a read/write access token, should still be saved in credential protected storage. Regarding > I'll just move prefs to device protected storage as a migration step. This is going to be tricky since we should take into account that the credential protected storage can be inaccessible (yet).", "tokens": 373} {"id": 1056192, "source": "review", "repo": "selenide/selenide", "text": "I think the lines 67,69,70 are \"tests that are bound to implementation\", which should be avoided in general. I agree. We could check not the exact size, but onle the needed properties.", "tokens": 49} {"id": 1056350, "source": "review", "repo": "selenide/selenide", "text": "```suggestion $(\"#submit\").doubleClick(usingDefaultMethod().force()) ```", "tokens": 16} {"id": 1056395, "source": "review", "repo": "selenide/selenide", "text": "If we introduce typed method let's deprecate or even remove this one (which accept `String`). What do you think? To this case everyone can define their `default` behaviour for scrollIntoView via initialization and in this case it solves previous comment concern. done.", "tokens": 57} {"id": 1056465, "source": "review", "repo": "semver4j/semver4j", "text": "That's not necessary in favor of construct object with not-null parameters. To reduce copy-paste I'll use here as declaration for reasons.. It is a good practice to: 1 - Annotate all class variables. 2 - Annotate all methods returns. 3 - Annotate all methods params. 4 - Nullable annotation does not applies to primitive since all primitives are non null. 5 - A class variable is the one who dictates the class constructor. You don't need to look at class constructor every time to deduce that a variable is nullable or not. 6 - Even if variable is created with direcly associated value, it must be annotated since it can be changed. 6a - Even if `final`, it is usefull to be anotated in favor of method's return. A variable with `new` association is clearly not null, but things like `Potato.class.getCanonicalName()` are not. The use of single pattern is better than mixed. Also, reason 1 enforces annotation. For that statement, applies reasons 1 & 5. Thank you for your clarification. This also gives a good documentation. That would be useful in the future.", "tokens": 253} {"id": 1056641, "source": "review", "repo": "shadows-of-fire/apotheosis", "text": "```suggestion \"xOff\": integer, // [Optional] || The X offset of the mining area. Default: 0 \"yOff\": integer // [Optional] || The Y offset of the mining area. Default: 0 ```", "tokens": 49} {"id": 1056674, "source": "review", "repo": "shafthq/shaft_engine", "text": "Inlined the lookup: `paint.setColor(Objects.requireNonNullElse(UIManager.getColor(\"Component.infoForeground\"), Color.GRAY))` \u2014 the temporary variable is gone. _\ud83e\udd16 Addressed by [Claude Code](https://claude.com/claude-code)_", "tokens": 57} {"id": 1056890, "source": "review", "repo": "shopify/mobile-buy-sdk-android", "text": "Can we call this DefaultAddressService? ditto for all the implementations of the interfaces", "tokens": 17} {"id": 1057053, "source": "review", "repo": "shopify/mobile-buy-sdk-android", "text": "nit: `getHandler` -> `handler`", "tokens": 11} {"id": 1057076, "source": "review", "repo": "shopify/mobile-buy-sdk-android", "text": "I am working on adding share CartViewModel so that cart data will be consistent throughout the app.", "tokens": 21} {"id": 1057139, "source": "review", "repo": "sinkillerj/projecte", "text": "The exception should not be thrown if you check for `hasEMC` before using `getEMC`. ;)", "tokens": 25} {"id": 1057163, "source": "review", "repo": "sinkillerj/projecte", "text": "Don't know anymore. Might not be needed anymore, because I added the null check to the oredict function. The isOre function did crash for air blocks.", "tokens": 36} {"id": 1057179, "source": "review", "repo": "sinkillerj/projecte", "text": "This makes the Archangel more powerful in a pedestal? Yes. In your version it is so useless. Now it about the same as in original mod (maybe still not so powerful). Its not good practice to sneak changes like this in with a big PR like this, without announcing them.", "tokens": 70} {"id": 1057369, "source": "review", "repo": "slackapi/java-slack-sdk", "text": "This link doesn't work - is it going to go live when docs are distributed? Yes, it is. I'll publish the first beta version (= 0.99.0) today. So, the link will be alive within a few hours.", "tokens": 56} {"id": 1057389, "source": "review", "repo": "slackapi/java-slack-sdk", "text": "**views.publish** API -> **`views.publish`** method \"per user\" -> \"on a per-user basis\"", "tokens": 31} {"id": 1057631, "source": "review", "repo": "slackapi/java-slack-sdk", "text": "You can test one of the public methods that internally calls getJsonWithGsonAnonymInnerClassHandling instead of trying to run the private method using reflection APIs.", "tokens": 34} {"id": 1057843, "source": "review", "repo": "slackapi/java-slack-sdk", "text": "\ud83e\udee1 praise: Farewell to this `scripts` but I'm hoping upstreamed runs can have more stable packagings-", "tokens": 31} {"id": 1057965, "source": "review", "repo": "slackhq/astra", "text": "I'm still looking over this and not sure I have all of the context, yet, but a couple comments as I read through it. It seems like this would silently truncate data in the case of narrowing conversions such as `long` -> `int` where the value exceeds `Integer.MAX_VALUE`, `double` -> `float`, etc. Also, I didn't see handling of conversions that would result in runtime exceptions such as `NumberFormatException` if there was an attempt to convert an invalid string to a numeric value. Loss of precision is expected. Handling exceptions is a good one. I will add more unit tests for both of these cases. It's not just a loss of precision but arithmetic overflow and such where the converted value is meaningless. I expect there will have to be some kind of handling for fields that cannot be converted to the target type when the `FieldConflictPolicy` is `CONVERT_FIELD_VALUE` or `CONVERT_AND_DUPLICATE_FIELD`, but that seems like something that could be worked out later. Good callout on handling exceptions. Fixed up the code to handle exceptions and added more tests. Also, added tests to account for loss in precision and not errors. The converted values are meaningless, but leaving them as is for now. We can add an additional tag like converted fields etc.. to the document in a future iteration. That way users can avoid these documents in the query if needed.", "tokens": 301} {"id": 1057987, "source": "review", "repo": "slackhq/astra", "text": "These should have better descriptions, with regards to what \"stored,\" \"indexed,\" and \"analyzed\" mean for this specific context. It's also unclear what happens when the values for `storeNumericDocValue` and `isStored` disagree with each other. We should also indicate which of these fields are prerequisites for each other (ie analyzed requires stored to be set). Updated the descriptions.", "tokens": 88} {"id": 1058034, "source": "review", "repo": "slackhq/astra", "text": "Keeps grpc/micrometer consistent with what ships in Armeria. Please make this a comment in the code so we can update it when we update armeria next. Done.", "tokens": 39} {"id": 1058180, "source": "review", "repo": "slackhq/astra", "text": "More cruft? Similar to https://github.com/slackhq/kaldb/pull/598#discussion_r1263043770, carryover from the existing client. We probably would be fine to downgrade these to debug, though they aren't called all that often so they're not generating a huge amount of logs.", "tokens": 78} {"id": 1058227, "source": "review", "repo": "slackhq/astra", "text": "We have this code comment in the class today. Is returning two different values for different exceptions helpful? ``` // in case the method fails to calculate we return -1 so don't update the old value if (dirSize > 0) { approximateDirectoryBytes.set(dirSize); } ``` I guess you need it for the test", "tokens": 71} {"id": 1058326, "source": "review", "repo": "slackhq/astra", "text": "Consider being more descriptive for these variables - \"size\" has several meanings depending on what's being measured (ie, `ingestSizeInBytes` is significantly different than `sizeInBytesOnDisk`, which is also slightly different to the `luceneIndexSizeInBytes` due to metadata we ship along with Lucene). Since this isn't a required param in the constructor, set a sensible default value (ie, `null`, `0`, `-1`) so that it's apparent if someone doesn't set it and then tries to read it what they should expect.", "tokens": 124} {"id": 1058346, "source": "review", "repo": "slackhq/astra", "text": "Something you should keep in mind is HashMap `entrySet` isn't guaranteed to have any order. If order is important for any of the assignment logic you should look into using a different map implementation, or a list.", "tokens": 45} {"id": 1058531, "source": "review", "repo": "slimeknights/mantle", "text": "Update java docs a bit, its not just Tinkers", "tokens": 12} {"id": 1058560, "source": "review", "repo": "slimeknights/mantle", "text": "`implements IHTML` is redundant for each child page content as the base PageContent already implements it, and should probably be excluded.", "tokens": 29} {"id": 1058578, "source": "review", "repo": "slimeknights/mantle", "text": "I vaguely recall something about our books not handling trailing newlines well for whatever reason. I don't recall if its text components or text data that had the issue. Generally if we want to force a linebreak, a newline by itself is used as that is special cased. Im putting an empty tag here since I use the gap of a flex box to space my elements, so this would double the gap", "tokens": 90} {"id": 1058754, "source": "review", "repo": "slimeknights/tinkersconstruct", "text": "Probably want a cooldown similarly to the blue slime sling, I assume a click macro could use this to fly. Not sure orange or green needs a cooldown. Probably a good idea for safety for both, and consistency", "tokens": 48} {"id": 1058813, "source": "review", "repo": "slimeknights/tinkersconstruct", "text": "Why is the modifier terminology page in the tools section? Why not in the modifiers section?", "tokens": 19} {"id": 1058913, "source": "review", "repo": "slimeknights/tinkersconstruct", "text": "I feel like this could be merged into one of the existing JEI images, that large slot I'm sure we used by now. Perhaps the one we use for modifiers?", "tokens": 36} {"id": 1058952, "source": "review", "repo": "slimeknights/tinkersconstruct", "text": "Lets cache this in the recipe object instead of recreating it each time.", "tokens": 17} {"id": 1059328, "source": "review", "repo": "spongepowered/sponge", "text": "Reasoning why this was above was due to the expectations of what the \"unchanged\" original intentions would otherwise perform. I'm not 100% sure that the side effectual cases that are with the tile entity being potentially null here (since the if statement that this check/logic was otherwise taken from) already performs that check.", "tokens": 71} {"id": 1059410, "source": "review", "repo": "spongepowered/sponge", "text": "This is the implementation, you could toss the immutable map to not add another Guava dep.", "tokens": 21} {"id": 1059420, "source": "review", "repo": "spongepowered/sponge", "text": "Looking at the methods on this class - I see no reason for the `AbstractDataBuilder` and the `MapCanvas.Builder` to be the same class. They do not interact with each other in any way - I think they should be separated.", "tokens": 53} {"id": 1059578, "source": "review", "repo": "spongepowered/sponge", "text": "All caps per the spec @kashike put into place `accessor$HELPER`", "tokens": 18} {"id": 1059703, "source": "review", "repo": "spongepowered/sponge", "text": "I almost prefer a fail fast (it compiles down to the same thing anyways) like ```java if (!ShouldFire.CHUNK_EVENT_GENERATED) { return; } // throw event ```", "tokens": 40} {"id": 1060056, "source": "review", "repo": "spongepowered/spongeapi", "text": "Change this back to `Double`, using int is an impl detail.", "tokens": 15} {"id": 1060175, "source": "review", "repo": "spongepowered/spongeapi", "text": "If you want to link something, link the MC wiki on bees instead of a meme ;) gabi's killing our fun @Zidane :( Some might say he's being a... buzzkill? I'll see myself out.", "tokens": 60} {"id": 1060336, "source": "review", "repo": "spongepowered/spongeapi", "text": "For this to be true, `Resource` should actually implement `AutoClosable`. ...though do we really need to provide Java 102 in our javadocs?", "tokens": 35} {"id": 1060370, "source": "review", "repo": "spongepowered/spongeapi", "text": "The Java version required to run gradle does not necessarily have to be the Java version used to compile -- this is just for buildscript plugins (iirc originally checkstyle) to run. Should we optimize for the majority ? I'm thinking most people clone the repo to tinker/contribute so they probably want to build it. Any thoughts ? Well, you can build either way -- if you're running on an older Java version, Gradle will try to detect the Java 17 JVM or if necessary download it -- it's easier to be more lenient rather than making devs muck around with their environment variables. Ah, didn't know that. Followup question: what is the check used for ? Woudn't it be best to remove and let gradle handle the java version then ? I'm not sure why we are specifically enforcing 11 I believe I added that check because newer versions of Checkstyle require J11 and Gradle didn't yet support toolchains on the checkstyle task at the time (it does now, so that could be configured to use the project toolchain instead and this check could be removed) I see we are not using the checkstyle plugin directly but we're relying on indra which has the toolchain version set (https://github.com/SpongePowered/SpongeAPI/blob/api-10/build.gradle.kts#L258). Shouldn't it take care of it ?", "tokens": 299} {"id": 1060385, "source": "review", "repo": "spongepowered/spongeapi", "text": "This is leaking impl details, please remove this method Wdym it's impl detail. It's must have method if we make limits (from 0 to 1) for progress arg in sendBlockProgress The server doesn't need any knowledge of the current progress. This is leaking impl details by forcing implmentations to track the progress Server doesn't have any knowledge of the current progress. It resets only progress that was sent by `sendBlockProgress()` so the only knowledge server has is that some plugins used `sendBlockProgress()` I think `resetBlockProgress` is necessary because we need a way to remove the crack. Notes: 1. setting progress to 0 does not remove, it just means you began cracking the block. 2. as discussed on discord, we will not track progress, however we need to keep somewhere a map of blockpos to destruction id", "tokens": 190} {"id": 1060425, "source": "review", "repo": "spongepowered/spongeforge", "text": "\"SpongeModded\" no...please", "tokens": 12} {"id": 1060714, "source": "review", "repo": "spongepowered/spongeforge", "text": "@gabizou It does, [see here](https://github.com/SpongePowered/Sponge/pull/173/files#diff-d1e54a67a6e6054ffea2c372f361a87cR394)", "tokens": 65} {"id": 1060801, "source": "review", "repo": "spongepowered/spongeforge", "text": "Need to make an issue on the API then. Originally added in https://github.com/SpongePowered/SpongeAPI/pull/363", "tokens": 30} {"id": 1060937, "source": "review", "repo": "spongepowered/spongeforge", "text": "just return the location without storing it in a local variable", "tokens": 12} {"id": 1061028, "source": "review", "repo": "spongepowered/spongevanilla", "text": "IMHO, we should show a different warning for each. A major version mismach should probably be an error (assuming that the plugin is using Semver), while anything else should just be a warning. We don't enforce the usage of semver, so I'm not sure if the warning should be really an error in this case. Maybe it could be logged at level `ERROR`, but would still be allowed to load. A lot of the warnings/errors in SpongeVanilla could use some improvements (some could use additional information, others should be likely errors instead of warnings). We can improve all these messages together at a later point - for now this should do the job.", "tokens": 139} {"id": 1061088, "source": "review", "repo": "spotify-web-api-java/spotify-web-api-java", "text": "```suggestion *

We make the request to obtain the authorization URI that will allow us, after the redirection, to obtain the code we need to ```", "tokens": 33} {"id": 1061260, "source": "review", "repo": "sqlancer/sqlancer", "text": "In SQL, strings are typically in single quotes. Are you sure that QuestDB uses double quotes?", "tokens": 21} {"id": 1061280, "source": "review", "repo": "sqlancer/sqlancer", "text": "Perhaps it would be helpful to add an assert here to check that the value is either \"Yes\" or (presumably) \"No\"? Having an assert would help in case this changes in future versions (e.g., to \"True\").", "tokens": 52} {"id": 1061629, "source": "review", "repo": "sqlancer/sqlancer", "text": "I think we have some auxiliary methods for fetching rows (used by other test oracles). Can we perhaps re-use any of these here? @luliqwerty Try to find if we can re-use some auxiliary methods for fetching rows in other test oracles. Hello @mrigger @JensonSung I can't find a suitable method to get rows you mentioned. The confusing method is CERTOracle.getRow(), which is used to get the count of rows. Can you give me some advice or maybe we can just use the way I used to do. I think there could be one in https://github.com/sqlancer/sqlancer/blob/main/src/sqlancer/ComparatorHelper.java. If not, we could stick to the current implementation. Current implementation can reuse the method `getResultSetFirstColumnAsString`.", "tokens": 180} {"id": 1061680, "source": "review", "repo": "sqlancer/sqlancer", "text": "Hmm, why does this happen? Is this something that we should avoid generating instead? I err towards adding this as expected error. The root cause is if the database was created without specifying UTF8 encoding, then specifying `COLLATE` later will be invalid. e.g. ``` CREATE DATABASE database7 TEMPLATE template0; CREATE UNLOGGED TABLE t3(c0 TEXT COLLATE \"pg_c_utf8\" UNIQUE) INHERITS(t2, t1); ``` The other fix option would be enforcing UTF8 encoding in [PostgresProvider](https://github.com/sqlancer/sqlancer/blob/8a5ea5d586b34d8908cd146518c370732f0eb7fe/src/sqlancer/postgres/PostgresProvider.java#L363) instead of making it randomized, but I feel like it will lead to less diverse behaviors.", "tokens": 208} {"id": 1061735, "source": "review", "repo": "stripe/stripe-java", "text": "So this is tricky. We have a custom deserializer for that class. When you're renaming, you're breaking the custom deserializer. Is this expected? Is this part of autogen already too? cc @ob-stripe who can explain this better than I would. Changed to `NextActionRedirectToUrl`", "tokens": 66} {"id": 1061786, "source": "review", "repo": "stripe/stripe-java", "text": "I don't understand where that one is coming from but it should not be a parameter at all.", "tokens": 22} {"id": 1061878, "source": "review", "repo": "stripe/stripe-java", "text": "Minor but I have a preference for keeping \"ephemeral key\" since it's the object name. No strong feels though Fixed.", "tokens": 27} {"id": 1062147, "source": "review", "repo": "stripe/stripe-java", "text": "We should also generate the preview API version + set `Stripe-Version` header", "tokens": 17} {"id": 1062172, "source": "review", "repo": "stripe/stripe-java", "text": "We're doing the version change in this PR too? Java tests have a few places that check versions in readme and changelog, wanted to make it happy. Should be fine to merge.", "tokens": 39} {"id": 1062247, "source": "review", "repo": "stripe/stripe-java", "text": "```suggestion The public preview SDKs are different version of the same package as the stable SDKs. These versions are appended with `-beta.X` such as `25.1.0-beta.1`. To install, choose the version that includes support for the preview feature you are interested in by reviewing the [releases page](https://github.com/stripe/stripe-java/releases/) and then use it [installation steps above](#installation). ```", "tokens": 102} {"id": 1062262, "source": "review", "repo": "stripe/stripe-java", "text": "IMO this feels like more than a deprecation to me- we didn't remove the argument, but now it's unused internally. Sure, the compiler won't fail, but otherwise it's the same as removing it. IMO we should remove it here or make it continue to work and hardcode its value for our usecases. I'll remove it since we're planning on doing a major release anyway.", "tokens": 87} {"id": 1062403, "source": "review", "repo": "sunagatov/online-store", "text": "now you can get rid of Mappers.getMapper(ShoppingSessionDtoConverter.class); because of component model", "tokens": 26} {"id": 1062422, "source": "review", "repo": "sunagatov/online-store", "text": "pls use costant here from mapstruct package. done, thanks", "tokens": 15} {"id": 1062469, "source": "review", "repo": "sunagatov/online-store", "text": "I think you can just define variables such as page, size, sortAttribute, sortDirection on the line 36 instead of putting `PAGE.getIntValue()`, `SIZE.getIntValue()`, `SORT_ATTRIBUTE.getStringValue()`, `SORT_DIRECTION.getStringValue()` as parameters. It will more clear and nice.", "tokens": 65} {"id": 1062511, "source": "review", "repo": "sunagatov/online-store", "text": "Maybe it would be better to set 'attempts' to 0 instead of removing entity at all ? Fixed", "tokens": 23} {"id": 1062520, "source": "review", "repo": "sunagatov/online-store", "text": "why is it not error log? `+`", "tokens": 11} {"id": 1062583, "source": "review", "repo": "sunagatov/online-store", "text": "your query is straightforward so it does not require any database-specific features, it is preferable to use JPQL for its database portability and higher level of abstraction. Also u can remove @Param here cause its not mandatory", "tokens": 47} {"id": 1062726, "source": "review", "repo": "sunagatov/online-store", "text": "I think you should create an additional method in the product class that contains \"...repository.existsById(producrId)\" Yes, I agree \ud83d\udc4d I think I'll leverage yours [`getProductEntityById`](https://github.com/Sunagatov/Iced-Latte/pull/246/commits/e611c7288c49c80bc05b255205e492372784b365#diff-6b53a46d0a231c949bcbe37bc56b1c557f1bc2120b295828b3db3eb8161de41dR41) Fixed", "tokens": 177} {"id": 1062869, "source": "review", "repo": "sweng-epfl/public", "text": "But since we will introduce asynchronicity later -> But since we will introduce asynchronicity later in the course", "tokens": 25} {"id": 1062888, "source": "review", "repo": "sweng-epfl/public", "text": "```suggestion Aside from the split architecture, apps also interact with the ecosystem through Push notifications. These are automated messages sent to the user by an app's cloud side. Each OS (e.g., Android, iOS) has its own push notification service with a specific API that apps can use, and they each operate a push engine in the cloud. ``` (the app doesn't have to be open at all, I think this makes it consistent with the mobile/cloud split explained earlier)", "tokens": 105} {"id": 1063264, "source": "review", "repo": "teamgalacticraft/galacticraft", "text": "It would probably be best to use `Constant.LOGGER.info` rather than `System.out.println`.", "tokens": 25} {"id": 1063267, "source": "review", "repo": "teamgalacticraft/galacticraft", "text": "I don't think this was great before, but this is not much better. I havent modified that file? only line endings....", "tokens": 33} {"id": 1063495, "source": "review", "repo": "teamgalacticraft/galacticraft", "text": "It is better to use more descriptive names rather than single characters, but I do appreciate that it can be hard to find what variables represent/should be called sometimes. https://github.com/TeamGalacticraft/Galacticraft/blob/624d9bdc2543f2f9af45d9401ae954020546ee98/src/main/java/dev/galacticraft/mod/client/render/entity/feature/OxygenMaskRenderLayer.java#L92", "tokens": 113} {"id": 1063572, "source": "review", "repo": "teamgalacticraft/galacticraft", "text": "It would be slightly more efficient to swap the order of these around to avoid having to calculate bottom if top is true and we are going to return 0 anyway.", "tokens": 34} {"id": 1063774, "source": "review", "repo": "teamgalacticraft/galacticraft", "text": "Please could you change this from `SLIME_DEATH` to `SLIMELING_DEATH`, because the former is more ambiguous. Again, `slime` should be replaced with `slimeling` in all the other places too.", "tokens": 48} {"id": 1063816, "source": "review", "repo": "teamgalacticraft/galacticraft", "text": "I really don't think some of the line breaks here improve readability. Putting each of the arguments on their own line looks much clearer to me. ```suggestion (frame.minX + frame.maxX) / 2, (frame.minY + frame.maxY) / 2, (frame.minZ + frame.maxZ) / 2 ```", "tokens": 73} {"id": 1063878, "source": "review", "repo": "teamgalacticraft/galacticraft", "text": "This can be rearranged slightly, making it a bit clearer that the return value is always `false` when `isFree` is `false`. ```suggestion return isFree && (oxygenWorld || this.level.isBreathable(pos)); ```", "tokens": 56} {"id": 1063888, "source": "review", "repo": "teamgalacticraft/galacticraft", "text": "It might be good to make this into a private helper method.", "tokens": 14} {"id": 1063916, "source": "review", "repo": "techa03/goodskill", "text": "Codacy found an issue: [JUnit tests should include assert() or fail()](https://app.codacy.com/manual/275688448/goodsKill/pullRequest?prid=5766634)", "tokens": 54} {"id": 1063991, "source": "review", "repo": "techreborn/techreborn", "text": "Did you have a chance to test how this will work when part of network is in unloaded chunk? Yes, you need to be very careful here as it if a cable is on the edge of a chunk boarder its going to start loading the adjacent chunks causing all sorts of issues. There is a way to check if a pos is in a loaded chunk but, id guess there is some more work to do around this.", "tokens": 88} {"id": 1063997, "source": "review", "repo": "techreborn/techreborn", "text": "use filter to check for null node's", "tokens": 10} {"id": 1064185, "source": "review", "repo": "testcontainers/testcontainers-java", "text": "We probably need `container.getProjectId()`, as \"test\" is a magical constant here Yep, I think we need to add this for all our gcloud TC implementations \ud83d\ude2c", "tokens": 39} {"id": 1064389, "source": "review", "repo": "testcontainers/testcontainers-java", "text": "Let's use assertj instead. Done", "tokens": 10} {"id": 1064521, "source": "review", "repo": "testcontainers/testcontainers-java", "text": "```suggestion public AzureEventhubsEmulatorContainer withConfig(final Transferable config) { ``` Should I update the Azurite config too similarly? It feels wrong to use two different approaches... Using transferable for the config file makes sense because the json file can be built programmatically. I do not expect the same for the certificates. WDYT? To be honest I don't see the big difference but this might be just because I am not that familiar with these two types and the exact intent behind them (hopefully I will learn now). We can generate (or download from a secure place) a Java `KeyStore` without ever writing it to file, also if you want to generate a configuration json, it is a small step to write it to a temp file and then simply create a `MountableFile` with it. Or is the difference more nuanced? `MountableFile` allows to copy files from host. Meanwhile `Transferable`, the interface it allows to pass a string that can be generated programmatically. Besides, it also accepts `MountableFile` because it implements `Transferable`. Using `Transferable`, the API would be flexible enough for the user to choose. Okay, thank you for the explanation!", "tokens": 251} {"id": 1064607, "source": "review", "repo": "testcontainers/testcontainers-java", "text": "The `try` block should start from here. Done in https://github.com/testcontainers/testcontainers-java/pull/11101/commits/9d24f30ce4de6f1b7fe8ec798a0c78e3918cf6ee", "tokens": 69} {"id": 1064740, "source": "review", "repo": "thealgorithms/java", "text": "```suggestion if (array.length == 0) { ``` By the way: the `null` check _should_ happen at the level of `SortAlgorithm`. Thanks. Yes, in other places this is on level before. Moved there.", "tokens": 53} {"id": 1064763, "source": "review", "repo": "thealgorithms/java", "text": "This is not verified anywhere. Maybe the input type should be `Set`? Or maybe this statement is not needed. I think what we are aiming for it to mimic the [`itertools.combinations`](https://docs.python.org/3/library/itertools.html#itertools.combinations) from python.", "tokens": 74} {"id": 1064796, "source": "review", "repo": "thealgorithms/java", "text": "```suggestion private int leonardoLevelTracker = 0; private int leonardoHeapSize = 0; private final List leonardoHeap = new ArrayList(); ``` Furthermore: - is that true that `leonardoHeapSize == leonardoHeap.size()`? If yes, I would remove `leonardoHeapSize`, - please consider renaming these members - the `leonardo` prefix is redundant.", "tokens": 101} {"id": 1064856, "source": "review", "repo": "thealgorithms/java", "text": "I think `supersequence` is a one word, so only the first S should be capitalized Fixed.", "tokens": 22} {"id": 1064977, "source": "review", "repo": "thealgorithms/java", "text": "Will be better to improve these tests using `@ParameterizedTest` and using additional record or class with data for TestCase. There are a lot of examples in repository Done!", "tokens": 34} {"id": 1065021, "source": "review", "repo": "thealgorithms/java", "text": "Do you also want to add this file? If so, you also needs tests for it", "tokens": 19} {"id": 1065162, "source": "review", "repo": "thealgorithms/java", "text": "THESE ARE MY CHANGES", "tokens": 10} {"id": 1065177, "source": "review", "repo": "thealgorithms/java", "text": "please remove this file @krishna-medapati > please remove this file @krishna-medapati Done! I've removed the file,Thank you!", "tokens": 41} {"id": 1065365, "source": "review", "repo": "tlaplus/tlaplus", "text": "I'm not super happy with the name \"invlevel\", but can't think of anything better.", "tokens": 23} {"id": 1065426, "source": "review", "repo": "tlaplus/tlaplus", "text": "Makes it impossible to use `this`.", "tokens": 10} {"id": 1065491, "source": "review", "repo": "tlaplus/tlaplus", "text": "`$TemporalWhile` is also a nonexistent built-in operator and should be removed from the table.", "tokens": 23} {"id": 1065777, "source": "review", "repo": "tootallnate/java-websocket", "text": "Do you even need to cache it anymore? Should the user not be able to send each cycle specific data? I believe that the cache is used only for the default implementation. If the user overrides this method, the frame will not be cached. I think most people will not be overriding the default implementation, so a cache could be useful. Atleast that's what I thought, though I can change it if you like. Yes, missed it.", "tokens": 93} {"id": 1065801, "source": "review", "repo": "tootallnate/java-websocket", "text": "Even though the Deflater Javadoc says the same, the implementation actually also accepts DEFAULT_COMPRESSION, which is -1. The getter above would then return -1 as well.", "tokens": 36} {"id": 1065851, "source": "review", "repo": "tree-sitter/java-tree-sitter", "text": "Side note: GitHub currently implicitly includes the matrix arguments in the job `name`, e.g. \"Test package (windows-latest, 25, true)\". Is that ok or would you prefer if `name` was more descriptive?", "tokens": 53} {"id": 1065907, "source": "review", "repo": "tsantalis/refactoringminer", "text": "@Verdone Can you give an example of receiver class in Go? What would happen if this class has not been created yet? `ModuleContainer` allows to store nested classes, and we use the concept of nested classes in TypeScript https://github.com/tsantalis/RefactoringMiner/blob/master/src/main/java/gr/uom/java/xmi/decomposition/TypeScriptOperationBody.java#L198 > Can you give an example of receiver class in Go? > > What would happen if this class has not been created yet? @tsantalis receiverClass is an erroneous name since Go relies on structs and composition instead of classes and class inheritance. I've addressed that in the latest commit, sorry about that. I will share an example of a receiver. Here, `Counter` is the receiver's base type and `c` is the receiver variable. `Increment` is bound to `Counter`. UMLClass already has an `isStruct` flag for this case: ``` type Counter struct { n int } func (c *Counter) Increment() { c.n++ } ``` To my knowledge there are 3 types of receivers: 1. Receiver Argument: A method is a function with a special receiver block placed between the func keyword and the method name. 2. Value Receiver: Operates on a copy of the struct; it cannot modify the original data. 3. Pointer Receiv,er: Uses *Type as the receiver; it allows the method to modify the original struct and avoids copying large data.
> ModuleContainer allows to store nested classes, and we use the concept of nested classes in TypeScript I checked and I think that the situation `ModuleContainer`'s nested-class resolution exists to solve should not happen for a Go receiver, by the language's own grammar and scoping rules: - A method's receiver clause is grammatically reachable only from sourceFile()'s top-level loop (methodDecl(), `GoParser.java:264-283`), never from block()/statement(). - So, a receiver can never bind to a locally-scoped struct the way TypeScript's `ModuleContainer` handles classes nested in a function body. Go _does_ allow local type declarations, just not local method declarations.", "tokens": 497} {"id": 1065947, "source": "review", "repo": "twilio/twilio-java", "text": "This looks mis-spelled? and should be camel-case", "tokens": 15} {"id": 1066212, "source": "review", "repo": "twilio/twilio-java", "text": "why did we remove this The previous idea was to move our API from preview to beta and public as backend API moves, but we can not track that, so to keep simple we will have only Beta", "tokens": 42} {"id": 1066308, "source": "review", "repo": "twilio/video-quickstart-android", "text": "Isn't it possible to use just `map` function? Like `val codecEntries = enumClass.enumConstants.map { \"$it\" }`", "tokens": 33} {"id": 1066315, "source": "review", "repo": "twilio/video-quickstart-android", "text": "Configuring git user is not required, so please remove.", "tokens": 13} {"id": 1066366, "source": "review", "repo": "twilio/video-quickstart-android", "text": "The logic here is very similar to `isPrivateImageFormatSupportedForCameraId` ... Can you consolidate this logic into one method `isCameraIdSupported` ... Additionally can add these changes to `quickstartKotlin` and the multiparty quickstart.", "tokens": 52} {"id": 1066445, "source": "review", "repo": "twilio/voice-quickstart-android", "text": "Add `TextView` with the follow information: > Dial a client name or phone number. Leaving the field empty results in an automated response.", "tokens": 30} {"id": 1066643, "source": "review", "repo": "twiliodeved/api-snippets", "text": "@acamino Why was this marked as not testable before?", "tokens": 15} {"id": 1066826, "source": "review", "repo": "twiliodeved/api-snippets", "text": "There is no real benefit on extracting the `value` variable, furthermore if that's the case we don't need to use a concrete type, we can rely on `var` and let the compiler to infer the type for us. \ud83d\ude09 I would write this part of the example as follows: ```csharp Console.WriteLIne(attributes[\"foo\"]); ```", "tokens": 79} {"id": 1067055, "source": "review", "repo": "twiliodeved/api-snippets", "text": "I see `.on()` and `.addEventListener()` ... maybe just use one throughout?", "tokens": 20} {"id": 1067107, "source": "review", "repo": "twitch4j/twitch4j", "text": "This could be replaced by `sb.setCharAt(sb.length() - 1, ' ')`", "tokens": 27} {"id": 1067222, "source": "review", "repo": "twitch4j/twitch4j", "text": "```suggestion api(group = \"com.github.philippheuer.events4j\", name = \"events4j-core\", version = \"0.9.6\") api(group = \"com.github.philippheuer.events4j\", name = \"events4j-handler-simple\", version = \"0.9.6\") api(group = \"com.github.philippheuer.events4j\", name = \"events4j-handler-spring\", version = \"0.9.6\") api(group = \"com.github.philippheuer.events4j\", name = \"events4j-handler-reactor\", version = \"0.9.6\") ```", "tokens": 158} {"id": 1067550, "source": "review", "repo": "uber-archive/phabricator-jenkins-plugin", "text": "Remove anonymous inner class. Make the EntityResolver a private static final constant that is initialized at the beginning", "tokens": 21} {"id": 1068262, "source": "review", "repo": "umple/umple", "text": "Although this seems to work, any div should be inside the body tag, so the end body tag just above needs to be below the end of this div", "tokens": 32} {"id": 1068363, "source": "review", "repo": "validator/validator", "text": "This same URL appears in at least 32 different files. Maybe we should consider creating a constants class to hold it? Assuming there are enough strings with similar frequency to make it worthwhile.", "tokens": 40} {"id": 1068485, "source": "review", "repo": "vectorwing/farmersdelight", "text": "This line seems to have the wrong ID (duplicated from `honey_glazed_ham`, seems to be `shepherds_pie`). It might error when loading the lang.", "tokens": 45} {"id": 1068523, "source": "review", "repo": "vectorwing/farmersdelight", "text": "I think `builtInRegistryHolder()` is marked for deprecation. You can use `heldStack.is(ForgeTags.BUCKETS_WATER)` here instead, a field from a few lines above. oh yeah Aside from this, the PR looks fine. I can merge after it.", "tokens": 61} {"id": 1068710, "source": "review", "repo": "virtuslab/git-machete-intellij-plugin", "text": "A high-level sanity check... obviously the result of `getProject()` is fixed/immutable for the given instance of `GitRepository` right? \ud83d\ude05 yup, the method `getProject` is `@NotNull` in the `Repository` interface, in the implementation `RepositoryImpl` and as a field: \"image\"", "tokens": 144} {"id": 1068831, "source": "review", "repo": "virtuslab/git-machete-intellij-plugin", "text": "This was the culprit... the expression always evaluated to false, coz `expr substr` is some weird stuff that doesn't always work, see [SC2308](https://github.com/koalaman/shellcheck/wiki/SC2308#substr)", "tokens": 68} {"id": 1068935, "source": "review", "repo": "virtuslab/git-machete-intellij-plugin", "text": "Life's so much easier without PowerMock :trollface:", "tokens": 15} {"id": 1069084, "source": "review", "repo": "virtuslab/git-machete-intellij-plugin", "text": "This change is so minuscule, not worth mentioning in the changelog", "tokens": 17} {"id": 1069143, "source": "review", "repo": "vkcom/vk-java-sdk", "text": "Already exists in CallbackApi. May be need to be changed to public and reused here or create enum instead Strings in CallbackApi. That helps to prevent code dublication.", "tokens": 38} {"id": 1069168, "source": "review", "repo": "vmware/vsphere-automation-sdk-java", "text": "We have followed a 80 char line length limit in all the samples. Lets keep it consistent to any new changes as well.", "tokens": 29} {"id": 1069179, "source": "review", "repo": "vmware/vsphere-automation-sdk-java", "text": "change me maintainer also to our team dl", "tokens": 10} {"id": 1069203, "source": "review", "repo": "vojtechhabarta/typescript-generator", "text": "not sure about this one this is probably a breaking change, since @JsonTypeName would no longer have priority over @JsonSubTypes.Type, and all typenames would be included", "tokens": 37} {"id": 1069231, "source": "review", "repo": "waffle/waffle", "text": "Even better, you could make this a link with `[http://support.microsoft.com/kb/946358](http://support.microsoft.com/kb/946358)`.", "tokens": 49} {"id": 1069266, "source": "review", "repo": "waffle/waffle", "text": "Shouldn't the class be marked as final for immutability?", "tokens": 15} {"id": 1069390, "source": "review", "repo": "weisj/jsvg", "text": "The spec only allows one light source child, so extending `ContainerNode` is actually not needed. Instead inherit from `AbstractFilterPrimitive` and implement `Container should only have one light source. Using the first one.\"); } else { lightSource = (LightSource) node; } } } ````", "tokens": 132} {"id": 1069577, "source": "review", "repo": "williamfiset/algorithms", "text": "remove all the isNotEqualTo statements. Checking against isEqualTo is enough", "tokens": 15} {"id": 1069604, "source": "review", "repo": "willowtreeapps/hyperion-android", "text": "Is this info necessary since the `Choreographer` spits out dropped frame info into logcat, or is this something for convenience? This does tell you refresh rate, so it's a little more info, but food for thought. I wrote it for debugging and it seemed useful, but if the data is redundant I'd rather take it out.", "tokens": 76} {"id": 1069687, "source": "review", "repo": "wisp-forest/owo-lib", "text": "As in compressed with gzip/whatever? Why would a Codeck want to care about this? As in the the data should be as small as possible but still hold onto some form of structure as in not intended to be human readable but still can be read in a sense based on order or something", "tokens": 60} {"id": 1069824, "source": "review", "repo": "wpilibsuite/gradlerio", "text": "Is there any reason for the Gson dependency here? It is a sample dependency in the common project that is not a dependency in either the robot or coprocessor project.", "tokens": 34} {"id": 1069840, "source": "review", "repo": "wpilibsuite/gradlerio", "text": "copy-paste error with `smartDashboardVersion` and `shuffleboardVersion` Fixed", "tokens": 18} {"id": 1070005, "source": "review", "repo": "yash-srivastava/Overdrive-release", "text": "@yash-srivastava How should i handle this? I don't have telegram so i can't test it but can this instead use the normal startDaemon method instead of duplicating the code here? I can also update this code to allow self hosted options but it will make it more complex and it is already quite a lot of code. We cant replace the zroklib.so as I have custom built it in-order to consume the proxy whenever its set at the system level. The default library was not reading the system proxies. But to your question the telegram daemon runs as a shell process while the normal startDaemon is in app process hence they dont share same process id. The way i have set up this PR, the behavior should be the same when not using the self hosted option i.e. still using the normal libzrok.so. This does mean the apk size has gone up because now it has libzrok.so and libzrok2.so. I do not know how libzrok2.so will behave with the system proxies. Is that something that would block this feature from being added? For the startDaemon method, i see that telegram uses a [SURVEILLANCE_IPC_PORT](https://github.com/yash-srivastava/Overdrive-release/blob/main/app/src/main/java/com/overdrive/app/daemon/telegram/SurveillanceCommandHandler.java#L102-L110) to talk to the surveillance service. Should it not do the same thing to connect to the DaemonStartupManager? This could simplify the telegram code a lot. I tested initially the zrok by default dont use the system proxies and yes it will be a blocker because firstly its increasing the size of the app and secondly with the proxy it will not run as expected. The DaemonStartupManager is a kotlin which requires the app to be running in order to operate but when the vehicle is off it can aggressively kill the app process, while the daemon process can survive. Ok thanks. Ill close this PR. Hopefully it can be revisited if you can make the same change to zrok2 in the future.", "tokens": 483} {"id": 1070080, "source": "review", "repo": "yegor256/cactoos", "text": "@marceloamadeu can you replac this with the `HasSize` matcher?", "tokens": 21} {"id": 1070217, "source": "review", "repo": "yegor256/cactoos", "text": "@andreoss Change it to `TextIs` @fabriciofx Done. Why do we have `TextHasString`?", "tokens": 23} {"id": 1070252, "source": "review", "repo": "yegor256/cactoos", "text": "@kokodyn why is xor true if the list is empty? I would have said false, but purely intuitively, because there is nothing, so it can't be true\u2026 maybe you have some sources that recommends to do that? Xor for empty list should be false. This is correct answer.", "tokens": 67} {"id": 1070369, "source": "review", "repo": "yegor256/cactoos", "text": "@baudoliver7 I think the todo should be explicit about the fact that not only collection should be covered but all of the package. I would propose to add a similar todo into each and every package of cactoos in the current PR! @victornoel Ok", "tokens": 52} {"id": 1070660, "source": "review", "repo": "yegor256/takes", "text": "@dalifreire are you sure that these new fields can go to equals? Do we have any tests for it?", "tokens": 28} {"id": 1070838, "source": "review", "repo": "yegor256/takes", "text": "@marceloamadeu Rewrite here too", "tokens": 11} {"id": 1071072, "source": "review", "repo": "zalando/logbook", "text": "Isn't the default implementation doing pretty much the same?", "tokens": 13} {"id": 1071267, "source": "review", "repo": "zalando/logbook", "text": "A local integration test with a real network roundtrip would be give me more confidence. Good point. I can handle with that. \ud83d\udc4d", "tokens": 29} {"id": 1071435, "source": "review", "repo": "zalando/logbook", "text": "See my comment above on log level and wording. Also: why log the exception class explicitly (instead of passing the exception as the last argument)? > why log the exception class explicitly (instead of passing the exception as the last argument)? Can't remember why I did this to be honest. Changed to passing the whole exception as in other places", "tokens": 72} {"id": 1071439, "source": "review", "repo": "zalando/logbook", "text": "Isn't it better/possible to use the [`Monitoring`](https://api.ktor.io/ktor-server/ktor-server-core/io.ktor.server.application/-application-call-pipeline/-application-phase/-monitoring.html) phase similarly to what's used for the `logbook-ktor-client` module ? Fixed in a58913b.", "tokens": 93} {"id": 1071446, "source": "review", "repo": "zalando/logbook", "text": "Not sure if it makes sense to capture only TimeoutException here, or try to log the request either way. On one hand, if the exchange failed prior to the sending, it may create a false assumption that the request happened. On the other hand, there can be other use cases, when the exchange failed after the request is sent, that are not related to timeouts. Plus, it looks like `io.netty.handler.timeout` package is not in the classpath, addressing TimeoutException would require adjustements to the dependency tree. I'm not super familiar with Netty; just asking out of curiosity. Looking at the `TimeoutException` inheritance tree: ``` java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException io.netty.channel.ChannelException io.netty.handler.timeout.TimeoutException ``` Would it make sense to generalize error handling to `ChannelException`? Seems like `io.netty.channel.ChannelException` is also not in the classpath. But I imagine it's not much farther away from catching any runtime exception at this point. Makes sense. What if we generalize it to `RuntimeException` then? In case the request is sent successfully, but any exception happens then (timeout, connection closed, etc.), we still want to log the request. This way, we won't need to change the classpath. So no condition for exceptions like here https://github.com/zalando/logbook/pull/2000/commits/77432d29014a57e8f6acd2252f58744df7845779 ? Yes, I think it's the easiest way to fix it \ud83d\udc4d", "tokens": 370} {"id": 1071616, "source": "review", "repo": "zalando/nakadi", "text": "Can we provide a more specific message than just \"problem with cursors\"? Sure, earlier there was just an empty exception being thrown. Will come up with better message. done", "tokens": 36} {"id": 1071694, "source": "review", "repo": "zalando/nakadi", "text": "Do I get it right, that using `null` for partition results in random partitioning? `If a valid partition number is specified that partition will be used when sending the record. If no partition is specified but a key is present a partition will be chosen using a hash of the key. If neither key nor partition is present a partition will be assigned in a round-robin fashion.` https://kafka.apache.org/23/javadoc/org/apache/kafka/clients/producer/ProducerRecord.html#ProducerRecord-java.lang.String-java.lang.Integer-K-V- yes, for the moment I chose that approach.", "tokens": 141} {"id": 1071971, "source": "review", "repo": "zalando/nakadi", "text": "Copy-paste from above. Can/should we check the actual validation result, not just that it's not empty? That is a good tip. I've provided better messages from the validator and extra use cases as well.", "tokens": 48} {"id": 1072030, "source": "review", "repo": "zalando/nakadi", "text": "```suggestion if ((lastDeadLetterOffset != null && this.lastDeadLetterOffset == null) || (lastDeadLetterOffset == null && this.lastDeadLetterOffset != null)) { return new Partition(eventType, partition, session, nextSession, state, 0, lastDeadLetterOffset); } ``` In both cases we reset failed commit count to 0, and use the given value of `lastDeadLetterOffset` (either it is `null` or not).", "tokens": 102} {"id": 1072219, "source": "review", "repo": "zalando/problem-spring-web", "text": "Not really, unfortunately. Maybe a static, package-private factory that has a meaningful name?", "tokens": 20} {"id": 1072275, "source": "review", "repo": "zalando/problem", "text": "> Unmodifiable? Shouldn't be needed since it's `private`.", "tokens": 18} {"id": 1072287, "source": "review", "repo": "zalando/problem", "text": "On a second though, just leave it with the linear search for now. I'll change it in a separate PR. I just realized that we could simplify the jackson module as well: https://github.com/zalando/problem/blob/master/jackson-datatype-problem/src/main/java/org/zalando/problem/StatusTypeDeserializer.java done.", "tokens": 79} {"id": 1072431, "source": "review", "repo": "zalando/riptide", "text": "Personally I'd prefer to set this header manually in my riptide call, but that could be a good fallback.", "tokens": 26} {"id": 1072454, "source": "review", "repo": "zalando/riptide", "text": "Or is this used to support array like structures?", "tokens": 11} {"id": 1072604, "source": "review", "repo": "zalando/riptide", "text": "Static imports for the `Mockito` stuff?", "tokens": 10} {"id": 1072652, "source": "review", "repo": "zalando/riptide", "text": "I'd invert both ifs. :)", "tokens": 11} {"id": 1072728, "source": "review", "repo": "zalando/riptide", "text": "We can add a test that actually verifies that we actually gzip the body.", "tokens": 16} {"id": 1072734, "source": "review", "repo": "zalando/riptide", "text": "What about Spring Boot 1.x?", "tokens": 10} {"id": 1072778, "source": "review", "repo": "zalando/riptide", "text": "This may find nothing and return `null` which means we replace the argument with `null` and then startup with a broken setup. Shouldn't this be throwing if e.g. metrics is enabled but no `MeterRegistry` was found.", "tokens": 50} {"id": 1072917, "source": "review", "repo": "zalando/riptide", "text": "Shouldn't the Jackson version be changed to the 3.x version? I see, that you switched it, so can the variable then be removed instead?", "tokens": 34}