idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
337,026 | public void disconnected(ClientDescriptor clientDescriptor) {<NEW_LINE>// cleanup all invalidation requests waiting for a ack from this client<NEW_LINE>Set<Integer> invalidationIds = clientsWaitingForInvalidation.keySet();<NEW_LINE>for (Integer invalidationId : invalidationIds) {<NEW_LINE>clientInvalidated(clientDescriptor, invalidationId);<NEW_LINE>}<NEW_LINE>// cleanup all invalidation request this client was blocking on<NEW_LINE>for (Iterator<Map.Entry<Integer, InvalidationHolder>> it = clientsWaitingForInvalidation.entrySet().iterator(); it.hasNext(); ) {<NEW_LINE>Map.Entry<Integer, InvalidationHolder> next = it.next();<NEW_LINE>ClientDescriptor clientDescriptorWaitingForInvalidation = next.getValue().clientDescriptorWaitingForInvalidation;<NEW_LINE>if (clientDescriptorWaitingForInvalidation != null && clientDescriptorWaitingForInvalidation.equals(clientDescriptor)) {<NEW_LINE>it.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lockManager.sweepLocksForClient(clientDescriptor, configuration.isWriteBehindConfigured() ? null : heldKeys -> heldKeys.forEach(stateService.getStore(storeIdentifier)::remove));<NEW_LINE>liveIterators.remove(clientDescriptor);<NEW_LINE>removeEventListener(clientDescriptor<MASK><NEW_LINE>connectedClients.remove(clientDescriptor);<NEW_LINE>} | , stateService.getStore(storeIdentifier)); |
619,495 | public void initialize(String nodeId, ResourceWatcherService resourceWatcher, IngestService ingestServiceArg) throws IOException {<NEW_LINE>configDatabases.initialize(resourceWatcher);<NEW_LINE>geoipTmpDirectory = geoipTmpBaseDirectory.resolve(nodeId);<NEW_LINE>Files.walkFileTree(geoipTmpDirectory, new FileVisitor<>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {<NEW_LINE>try {<NEW_LINE>LOGGER.info("deleting stale file [{}]", file);<NEW_LINE>Files.deleteIfExists(file);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.warn(<MASK><NEW_LINE>}<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult visitFileFailed(Path file, IOException e) {<NEW_LINE>if (e instanceof NoSuchFileException == false) {<NEW_LINE>LOGGER.warn("can't delete stale file [" + file + "]", e);<NEW_LINE>}<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult postVisitDirectory(Path dir, IOException exc) {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (Files.exists(geoipTmpDirectory) == false) {<NEW_LINE>Files.createDirectories(geoipTmpDirectory);<NEW_LINE>}<NEW_LINE>LOGGER.debug("initialized database node service, using geoip-databases directory [{}]", geoipTmpDirectory);<NEW_LINE>ingestServiceArg.addIngestClusterStateListener(this::checkDatabases);<NEW_LINE>this.ingestService = ingestServiceArg;<NEW_LINE>} | "can't delete stale file [" + file + "]", e); |
1,603,821 | public static QueryIncomeTrendResponse unmarshall(QueryIncomeTrendResponse queryIncomeTrendResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryIncomeTrendResponse.setRequestId<MASK><NEW_LINE>queryIncomeTrendResponse.setSuccess(_ctx.booleanValue("QueryIncomeTrendResponse.Success"));<NEW_LINE>queryIncomeTrendResponse.setCode(_ctx.stringValue("QueryIncomeTrendResponse.Code"));<NEW_LINE>queryIncomeTrendResponse.setMessage(_ctx.stringValue("QueryIncomeTrendResponse.Message"));<NEW_LINE>queryIncomeTrendResponse.setPageNumber(_ctx.integerValue("QueryIncomeTrendResponse.PageNumber"));<NEW_LINE>queryIncomeTrendResponse.setPageSize(_ctx.integerValue("QueryIncomeTrendResponse.PageSize"));<NEW_LINE>queryIncomeTrendResponse.setTotal(_ctx.longValue("QueryIncomeTrendResponse.Total"));<NEW_LINE>List<Data> model = new ArrayList<Data>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryIncomeTrendResponse.Model.Length"); i++) {<NEW_LINE>Data data = new Data();<NEW_LINE>data.setAdSlotName(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].AdSlotName"));<NEW_LINE>data.setAdSlotId(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].AdSlotId"));<NEW_LINE>data.setClickTimes(_ctx.longValue("QueryIncomeTrendResponse.Model[" + i + "].ClickTimes"));<NEW_LINE>data.setShowTimes(_ctx.longValue("QueryIncomeTrendResponse.Model[" + i + "].ShowTimes"));<NEW_LINE>data.setAdSlotHitTimes(_ctx.longValue("QueryIncomeTrendResponse.Model[" + i + "].AdSlotHitTimes"));<NEW_LINE>data.setThisMonEstIncomeRate(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].ThisMonEstIncomeRate"));<NEW_LINE>data.setBizDate(_ctx.longValue("QueryIncomeTrendResponse.Model[" + i + "].BizDate"));<NEW_LINE>data.setAccEstIncomeRate(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].AccEstIncomeRate"));<NEW_LINE>data.setThisYearEstIncomeRate(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].ThisYearEstIncomeRate"));<NEW_LINE>data.setAdSlotRequests(_ctx.longValue("QueryIncomeTrendResponse.Model[" + i + "].AdSlotRequests"));<NEW_LINE>data.setMediaName(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].MediaName"));<NEW_LINE>data.setAdSlotType(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].AdSlotType"));<NEW_LINE>data.setMediaId(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].MediaId"));<NEW_LINE>data.setThisDaysEstIncomeRate(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].ThisDaysEstIncomeRate"));<NEW_LINE>data.setEndTime(_ctx.longValue("QueryIncomeTrendResponse.Model[" + i + "].EndTime"));<NEW_LINE>data.setStartTime(_ctx.longValue("QueryIncomeTrendResponse.Model[" + i + "].StartTime"));<NEW_LINE>data.setAdSlotShowRate(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].AdSlotShowRate"));<NEW_LINE>data.setEcpmRate(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].EcpmRate"));<NEW_LINE>data.setThisDaysEstIncome(_ctx.longValue("QueryIncomeTrendResponse.Model[" + i + "].ThisDaysEstIncome"));<NEW_LINE>data.setChannelName(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].ChannelName"));<NEW_LINE>data.setAdSlotClickRate(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].AdSlotClickRate"));<NEW_LINE>data.setEstimatedIncome(_ctx.longValue("QueryIncomeTrendResponse.Model[" + i + "].EstimatedIncome"));<NEW_LINE>data.setAccessStatus(_ctx.longValue("QueryIncomeTrendResponse.Model[" + i + "].AccessStatus"));<NEW_LINE>data.setChannelId(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].ChannelId"));<NEW_LINE>data.setEcpm(_ctx.longValue("QueryIncomeTrendResponse.Model[" + i + "].Ecpm"));<NEW_LINE>data.setAdSlotHitRate(_ctx.stringValue("QueryIncomeTrendResponse.Model[" + i + "].AdSlotHitRate"));<NEW_LINE>model.add(data);<NEW_LINE>}<NEW_LINE>queryIncomeTrendResponse.setModel(model);<NEW_LINE>return queryIncomeTrendResponse;<NEW_LINE>} | (_ctx.stringValue("QueryIncomeTrendResponse.RequestId")); |
77,277 | private void updateMockExpectConfigs(MockConfig mockConfig, List<MockExpectConfigWithBLOBs> list, SqlSession sqlSession) {<NEW_LINE>int batchCount = 0;<NEW_LINE>for (MockExpectConfigWithBLOBs mockExpect : list) {<NEW_LINE>MockExpectConfig expectInDb = this.findMockExpectConfigByMockConfigIdAndExpectNum(mockConfig.getId(), mockExpect.getExpectNum());<NEW_LINE>if (expectInDb == null) {<NEW_LINE>mockExpect.setId(UUID.randomUUID().toString());<NEW_LINE>mockExpect.setMockConfigId(mockConfig.getId());<NEW_LINE>mockExpect.setCreateTime(System.currentTimeMillis());<NEW_LINE>mockExpect.setUpdateTime(System.currentTimeMillis());<NEW_LINE>mockExpect.setCreateUserId(SessionUtils.getUserId());<NEW_LINE>mockExpectConfigMapper.insert(mockExpect);<NEW_LINE>} else {<NEW_LINE>mockExpect.<MASK><NEW_LINE>mockExpect.setId(expectInDb.getId());<NEW_LINE>mockExpect.setUpdateTime(System.currentTimeMillis());<NEW_LINE>mockExpectConfigMapper.updateByPrimaryKeyWithBLOBs(mockExpect);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (batchCount % 300 == 0) {<NEW_LINE>sqlSession.flushStatements();<NEW_LINE>}<NEW_LINE>} | setMockConfigId(mockConfig.getId()); |
883,670 | protected long[] cleanupPalette(long[] blockStates, ListTag<CompoundTag> palette) {<NEW_LINE>// create mapping of old --> new indices<NEW_LINE>Map<Integer, Integer> allIndices = new HashMap<>(palette.size());<NEW_LINE>for (int i = 0; i < 4096; i++) {<NEW_LINE>int paletteIndex = getPaletteIndex(i, blockStates);<NEW_LINE>allIndices.put(paletteIndex, paletteIndex);<NEW_LINE>}<NEW_LINE>// remove unused indices from palette<NEW_LINE>int oldIndex = 0;<NEW_LINE>for (int i = 0; i < palette.size(); i++) {<NEW_LINE>if (!allIndices.containsKey(oldIndex)) {<NEW_LINE>palette.remove(i);<NEW_LINE>i--;<NEW_LINE>} else {<NEW_LINE>allIndices.put(oldIndex, i);<NEW_LINE>}<NEW_LINE>oldIndex++;<NEW_LINE>}<NEW_LINE>// add air to the palette if it doesn't contain air<NEW_LINE>if (!paletteContainsAir(palette)) {<NEW_LINE>CompoundTag air = new CompoundTag();<NEW_LINE><MASK><NEW_LINE>palette.add(air);<NEW_LINE>}<NEW_LINE>return adjustBlockStateBits(palette, blockStates, allIndices);<NEW_LINE>} | air.putString("Name", "minecraft:air"); |
874,525 | public static int insertPopsForAllParameters(MethodVisitor mv, String desc) {<NEW_LINE>String descSequence = Utils.getParamSequence(desc);<NEW_LINE>if (descSequence == null) {<NEW_LINE>// nothing to do, there are no parameters<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>int count = descSequence.length();<NEW_LINE>for (int dpos = count - 1; dpos >= 0; dpos--) {<NEW_LINE>char ch = descSequence.charAt(dpos);<NEW_LINE>switch(ch) {<NEW_LINE>case 'O':<NEW_LINE>case 'I':<NEW_LINE>case 'Z':<NEW_LINE>case 'F':<NEW_LINE>case 'S':<NEW_LINE>case 'C':<NEW_LINE>case 'B':<NEW_LINE>mv.visitInsn(POP);<NEW_LINE>break;<NEW_LINE>// long - double slot<NEW_LINE>case 'J':<NEW_LINE>case // double - double slot<NEW_LINE>'D':<NEW_LINE>mv.visitInsn(POP2);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unexpected character: " + ch + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return count;<NEW_LINE>} | " from " + desc + ":" + dpos); |
911,155 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String gatewayName, String connectionName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (gatewayName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (connectionName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, accept, context);<NEW_LINE>} | this.client.mergeContext(context); |
1,659,004 | private void initRestOfGroupDependencies(Class<? extends ITestOrConfiguration> annotationClass) {<NEW_LINE>//<NEW_LINE>// Init groups depended upon<NEW_LINE>//<NEW_LINE>ITestOrConfiguration annotation = getAnnotationFinder().findAnnotation(getConstructorOrMethod(), annotationClass);<NEW_LINE>ITestOrConfiguration classAnnotation = getAnnotationFinder().findAnnotation(getConstructorOrMethod().getDeclaringClass(), annotationClass);<NEW_LINE>Map<String, Set<String>> xgd = calculateXmlGroupDependencies(m_xmlTest);<NEW_LINE>List<String<MASK><NEW_LINE>for (String g : getGroups()) {<NEW_LINE>Set<String> gdu = xgd.get(g);<NEW_LINE>if (gdu != null) {<NEW_LINE>xmlGroupDependencies.addAll(gdu);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setGroupsDependedUpon(getStringArray(null != annotation ? annotation.getDependsOnGroups() : null, null != classAnnotation ? classAnnotation.getDependsOnGroups() : null), xmlGroupDependencies);<NEW_LINE>String[] methodsDependedUpon = getStringArray(null != annotation ? annotation.getDependsOnMethods() : null, null != classAnnotation ? classAnnotation.getDependsOnMethods() : null);<NEW_LINE>// Qualify these methods if they don't have a package<NEW_LINE>for (int i = 0; i < methodsDependedUpon.length; i++) {<NEW_LINE>String m = methodsDependedUpon[i];<NEW_LINE>if (!m.contains(".")) {<NEW_LINE>m = MethodHelper.calculateMethodCanonicalName(m_methodClass, methodsDependedUpon[i]);<NEW_LINE>methodsDependedUpon[i] = m != null ? m : methodsDependedUpon[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setMethodsDependedUpon(methodsDependedUpon);<NEW_LINE>} | > xmlGroupDependencies = Lists.newArrayList(); |
1,530,518 | private Tuple<String, Map<String, Object>> extractMapping(String type, Map<String, Object> root) throws MapperParsingException {<NEW_LINE>if (root.size() == 0) {<NEW_LINE>if (type != null) {<NEW_LINE>return new Tuple<>(type, root);<NEW_LINE>} else {<NEW_LINE>throw new MapperParsingException("malformed mapping, no type name found");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String rootName = root.keySet().iterator().next();<NEW_LINE>Tuple<String, Map<String, Object>> mapping;<NEW_LINE>if (type == null || type.equals(rootName) || mapperService.resolveDocumentType(type).equals(rootName)) {<NEW_LINE>mapping = new Tuple<>(rootName, (Map<String, Object><MASK><NEW_LINE>} else {<NEW_LINE>mapping = new Tuple<>(type, root);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.mapperService.discoverTableMapping(mapping.v1(), mapping.v2());<NEW_LINE>} catch (SyntaxException | ConfigurationException | IOException e) {<NEW_LINE>logger.error("Failed to expand mapping", e);<NEW_LINE>}<NEW_LINE>return mapping;<NEW_LINE>} | ) root.get(rootName)); |
1,654,238 | public void redraw() {<NEW_LINE>if (!preDraw()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// TimerUtil.timerStart(getClass().getName() + ".redraw()");<NEW_LINE>IMetaMember selectedMember = parent.getSelectedMember();<NEW_LINE>if (selectedMember == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Compilation selectedCompilation = selectedMember == null ? null : selectedMember.getSelectedCompilation();<NEW_LINE>List<CodeCacheEvent> eventsOfSelectedMember = new ArrayList<>();<NEW_LINE>Color fillColour;<NEW_LINE><MASK><NEW_LINE>for (CodeCacheEvent event : codeCacheData.getEvents()) {<NEW_LINE>if (!showEvent(event)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final Compilation eventCompilation = event.getCompilation();<NEW_LINE>final IMetaMember compilationMember = eventCompilation.getMember();<NEW_LINE>if (eventCompilation != null) {<NEW_LINE>if (selectedMember != null && selectedMember.equals(compilationMember)) {<NEW_LINE>eventsOfSelectedMember.add(event);<NEW_LINE>} else {<NEW_LINE>long addressOffset = event.getNativeAddress() - lowAddress;<NEW_LINE>double scaledAddress = (double) addressOffset / (double) addressRange;<NEW_LINE>double scaledSize = (double) event.getNativeCodeSize() / (double) addressRange;<NEW_LINE>int latestCompilationIndex = compilationMember.getCompilations().size() - 1;<NEW_LINE>if (eventCompilation.getIndex() == latestCompilationIndex) {<NEW_LINE>fillColour = LATEST_COMPILATION;<NEW_LINE>} else {<NEW_LINE>fillColour = NOT_LATEST_COMPILATION;<NEW_LINE>}<NEW_LINE>double x = scaledAddress * width;<NEW_LINE>double y = 0;<NEW_LINE>double w = scaledSize * width;<NEW_LINE>plotCompilation(x, y, w, paneHeight, fillColour, eventCompilation, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (CodeCacheEvent event : eventsOfSelectedMember) {<NEW_LINE>long addressOffset = event.getNativeAddress() - lowAddress;<NEW_LINE>double scaledAddress = (double) addressOffset / (double) addressRange;<NEW_LINE>double scaledSize = (double) event.getNativeCodeSize() / (double) addressRange;<NEW_LINE>double x = scaledAddress * width;<NEW_LINE>double y = 0;<NEW_LINE>double w = scaledSize * width;<NEW_LINE>final Compilation eventCompilation = event.getCompilation();<NEW_LINE>if (event.getCompilation().equals(selectedCompilation)) {<NEW_LINE>fillColour = COLOR_SELECTED_COMPILATION;<NEW_LINE>} else {<NEW_LINE>fillColour = COLOR_OTHER_MEMBER_COMPILATIONS;<NEW_LINE>}<NEW_LINE>plotCompilation(x, y, w, paneHeight, fillColour, eventCompilation, true);<NEW_LINE>plotMarker(x, paneHeight, eventCompilation);<NEW_LINE>}<NEW_LINE>// TimerUtil.timerEnd(getClass().getName() + ".redraw()");<NEW_LINE>} | double paneHeight = pane.getHeight(); |
1,690,971 | private RunningDevService startContainer(DockerStatusBuildItem dockerStatusBuildItem, String connectionName, DevServicesConfig devServicesConfig, LaunchMode launchMode, boolean useSharedNetwork, Optional<Duration> timeout) {<NEW_LINE>if (!devServicesConfig.enabled) {<NEW_LINE>// explicitly disabled<NEW_LINE>log.debug("Not starting devservices for " + (isDefault(connectionName) ? "default redis client" : connectionName) + " as it has been disabled in the config");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String configPrefix = getConfigPrefix(connectionName);<NEW_LINE>boolean needToStart = !ConfigUtils.isPropertyPresent(configPrefix + RedisConfig.HOSTS_CONFIG_NAME);<NEW_LINE>if (!needToStart) {<NEW_LINE>log.debug("Not starting devservices for " + (isDefault(connectionName) ? "default redis client" : connectionName) + " as hosts have been provided");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!dockerStatusBuildItem.isDockerAvailable()) {<NEW_LINE>log.warn("Please configure quarkus.redis.hosts for " + (isDefault(connectionName) ? "default redis client" : connectionName) + " or get a working docker instance");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DockerImageName dockerImageName = DockerImageName.parse(devServicesConfig.imageName.orElse(REDIS_6_ALPINE)).asCompatibleSubstituteFor(REDIS_6_ALPINE);<NEW_LINE>Supplier<RunningDevService> defaultRedisServerSupplier = () -> {<NEW_LINE>QuarkusPortRedisContainer redisContainer = new QuarkusPortRedisContainer(dockerImageName, devServicesConfig.port, launchMode == DEVELOPMENT ? devServicesConfig.serviceName : null, useSharedNetwork);<NEW_LINE><MASK><NEW_LINE>redisContainer.start();<NEW_LINE>String redisHost = REDIS_SCHEME + redisContainer.getHost() + ":" + redisContainer.getPort();<NEW_LINE>return new RunningDevService(Feature.REDIS_CLIENT.getName(), redisContainer.getContainerId(), redisContainer::close, configPrefix + RedisConfig.HOSTS_CONFIG_NAME, redisHost);<NEW_LINE>};<NEW_LINE>return redisContainerLocator.locateContainer(devServicesConfig.serviceName, devServicesConfig.shared, launchMode).map(containerAddress -> {<NEW_LINE>String redisUrl = REDIS_SCHEME + containerAddress.getUrl();<NEW_LINE>return new RunningDevService(Feature.REDIS_CLIENT.getName(), containerAddress.getId(), null, configPrefix + RedisConfig.HOSTS_CONFIG_NAME, redisUrl);<NEW_LINE>}).orElseGet(defaultRedisServerSupplier);<NEW_LINE>} | timeout.ifPresent(redisContainer::withStartupTimeout); |
396,704 | public com.amazonaws.services.codecommit.model.InvalidSystemTagUsageException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.codecommit.model.InvalidSystemTagUsageException invalidSystemTagUsageException = new com.amazonaws.services.codecommit.model.InvalidSystemTagUsageException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return invalidSystemTagUsageException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,762,681 | public static GetMqSofamqMessageByIdResponse unmarshall(GetMqSofamqMessageByIdResponse getMqSofamqMessageByIdResponse, UnmarshallerContext _ctx) {<NEW_LINE>getMqSofamqMessageByIdResponse.setRequestId(_ctx.stringValue("GetMqSofamqMessageByIdResponse.RequestId"));<NEW_LINE>getMqSofamqMessageByIdResponse.setResultCode(_ctx.stringValue("GetMqSofamqMessageByIdResponse.ResultCode"));<NEW_LINE>getMqSofamqMessageByIdResponse.setResultMessage(_ctx.stringValue("GetMqSofamqMessageByIdResponse.ResultMessage"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setBody(_ctx.stringValue("GetMqSofamqMessageByIdResponse.Data.Body"));<NEW_LINE>data.setBodyCrc(_ctx.longValue("GetMqSofamqMessageByIdResponse.Data.BodyCrc"));<NEW_LINE>data.setBornHost(_ctx.stringValue("GetMqSofamqMessageByIdResponse.Data.BornHost"));<NEW_LINE>data.setBornTimestamp(_ctx.longValue("GetMqSofamqMessageByIdResponse.Data.BornTimestamp"));<NEW_LINE>data.setInstanceId<MASK><NEW_LINE>data.setMsgId(_ctx.stringValue("GetMqSofamqMessageByIdResponse.Data.MsgId"));<NEW_LINE>data.setReconsumeTimes(_ctx.longValue("GetMqSofamqMessageByIdResponse.Data.ReconsumeTimes"));<NEW_LINE>data.setStoreHost(_ctx.stringValue("GetMqSofamqMessageByIdResponse.Data.StoreHost"));<NEW_LINE>data.setStoreSize(_ctx.longValue("GetMqSofamqMessageByIdResponse.Data.StoreSize"));<NEW_LINE>data.setStoreTimestamp(_ctx.longValue("GetMqSofamqMessageByIdResponse.Data.StoreTimestamp"));<NEW_LINE>data.setTopic(_ctx.stringValue("GetMqSofamqMessageByIdResponse.Data.Topic"));<NEW_LINE>List<PropertyListItem> propertyList = new ArrayList<PropertyListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetMqSofamqMessageByIdResponse.Data.PropertyList.Length"); i++) {<NEW_LINE>PropertyListItem propertyListItem = new PropertyListItem();<NEW_LINE>propertyListItem.setName(_ctx.stringValue("GetMqSofamqMessageByIdResponse.Data.PropertyList[" + i + "].Name"));<NEW_LINE>propertyListItem.setValue(_ctx.stringValue("GetMqSofamqMessageByIdResponse.Data.PropertyList[" + i + "].Value"));<NEW_LINE>propertyList.add(propertyListItem);<NEW_LINE>}<NEW_LINE>data.setPropertyList(propertyList);<NEW_LINE>getMqSofamqMessageByIdResponse.setData(data);<NEW_LINE>return getMqSofamqMessageByIdResponse;<NEW_LINE>} | (_ctx.stringValue("GetMqSofamqMessageByIdResponse.Data.InstanceId")); |
657,112 | public boolean install(String displayName, String description, String[] dependencies, String account, String password) {<NEW_LINE>// This needs to be adjusted for a production implementation!<NEW_LINE>//<NEW_LINE>// Determine the JVM used to invoke this installer and use it as<NEW_LINE>// runtime for the service<NEW_LINE>String javaHome = System.getProperty("java.home");<NEW_LINE>String javaBinary = javaHome + "\\bin\\java.exe";<NEW_LINE>// Assumption: This is started as:<NEW_LINE>//<NEW_LINE>// java -jar <pathToJar><NEW_LINE>//<NEW_LINE>// This is not portable, as it assumes, that this establishes a CL hierachy,<NEW_LINE>// that starts with one ClassLoader that loads the main jar (this service<NEW_LINE>// implementation) and its childs are resposible for loading referenced<NEW_LINE>// jars.<NEW_LINE>URLClassLoader cl = (URLClassLoader) Win32Service.class.getClassLoader();<NEW_LINE>URL jarPath = cl.getURLs()[0];<NEW_LINE>try {<NEW_LINE>File jar = new File(jarPath.toURI());<NEW_LINE>return (install(displayName, description, dependencies, account, password, javaBinary + " -jar \"" + jar<MASK><NEW_LINE>} catch (URISyntaxException ex) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | .getAbsolutePath() + "\"")); |
1,302,465 | public void clusterChanged(ClusterChangedEvent changedEvent) {<NEW_LINE>try (ThreadContext.StoredContext stored = contextSupplier.get()) {<NEW_LINE>final RestoreInProgress.Entry prevEntry = restoreInProgress(changedEvent.previousState(), uuid);<NEW_LINE>final RestoreInProgress.Entry newEntry = restoreInProgress(changedEvent.state(), uuid);<NEW_LINE>if (prevEntry == null) {<NEW_LINE>// When there is a master failure after a restore has been started, this listener might not be registered<NEW_LINE>// on the current master and as such it might miss some intermediary cluster states due to batching.<NEW_LINE>// Clean up listener in that case and acknowledge completion of restore operation to client.<NEW_LINE>clusterService.removeListener(this);<NEW_LINE>listener.onResponse(new RestoreSnapshotResponse((RestoreInfo) null));<NEW_LINE>} else if (newEntry == null) {<NEW_LINE>clusterService.removeListener(this);<NEW_LINE>ImmutableOpenMap<ShardId, RestoreInProgress.ShardRestoreStatus> shards = prevEntry.shards();<NEW_LINE>assert prevEntry.state().completed() : "expected completed snapshot state but was " + prevEntry.state();<NEW_LINE>assert RestoreService.completed(shards) : "expected all restore entries to be completed";<NEW_LINE>RestoreInfo ri = new RestoreInfo(prevEntry.snapshot().getSnapshotId().getName(), prevEntry.indices(), shards.size(), shards.size() <MASK><NEW_LINE>RestoreSnapshotResponse response = new RestoreSnapshotResponse(ri);<NEW_LINE>logger.debug("restore of [{}] completed", prevEntry.snapshot().getSnapshotId());<NEW_LINE>listener.onResponse(response);<NEW_LINE>} else {<NEW_LINE>// restore not completed yet, wait for next cluster state update<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | - RestoreService.failedShards(shards)); |
294,942 | private void completeObjectProperty(CompletionRequest request, Map<String, List<JsElement>> addedItems) {<NEW_LINE>List<String> expChain = ModelUtils.resolveExpressionChain(request.result.getSnapshot(), request.anchor, false);<NEW_LINE>if (!expChain.isEmpty()) {<NEW_LINE>Map<String, List<JsElement>> toAdd = getCompletionFromExpressionChain(request, expChain);<NEW_LINE>if (request.cancelSupport.isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FileObject fo = request.result.getSnapshot()<MASK><NEW_LINE>if (fo != null) {<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>Collection<IndexedElement> fromUsages = Index.get(request.result.getSnapshot().getSource().getFileObject()).getUsagesFromExpression(expChain);<NEW_LINE>for (IndexedElement indexedElement : fromUsages) {<NEW_LINE>if (!fo.equals(indexedElement.getFileObject()) || !indexedElement.getName().equals(request.prefix)) {<NEW_LINE>addPropertyToMap(request, addedItems, indexedElement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long end = System.currentTimeMillis();<NEW_LINE>LOGGER.log(Level.FINE, String.format("Counting cc based on usages took: %dms", (end - start)));<NEW_LINE>}<NEW_LINE>addedItems.putAll(toAdd);<NEW_LINE>}<NEW_LINE>} | .getSource().getFileObject(); |
720,955 | ChannelBuffer serialize(final byte server_version) {<NEW_LINE>if (server_version < RegionClient.SERVER_VERSION_095_OR_ABOVE) {<NEW_LINE>throw new UnsupportedOperationException(server_version + " is not supported by " + this.getClass().getName());<NEW_LINE>}<NEW_LINE>MutationProto.Builder incr = MutationProto.newBuilder().setRow(Bytes.wrap(key)).setMutateType(MutationProto.MutationType.INCREMENT);<NEW_LINE>for (int i = 0; i < qualifiers.length; i++) {<NEW_LINE>final MutationProto.ColumnValue.QualifierValue qualifier = MutationProto.ColumnValue.QualifierValue.newBuilder().setQualifier(Bytes.wrap(this.qualifiers[i])).setValue(Bytes.wrap(Bytes.fromLong(this.amounts[i]))).build();<NEW_LINE>final MutationProto.ColumnValue column = MutationProto.ColumnValue.newBuilder().setFamily(Bytes.wrap(family)).addQualifierValue(qualifier).build();<NEW_LINE>incr.addColumnValue(column);<NEW_LINE>}<NEW_LINE>if (!durable) {<NEW_LINE>incr.setDurability(MutationProto.Durability.SKIP_WAL);<NEW_LINE>}<NEW_LINE>final MutateRequest req = MutateRequest.newBuilder().setRegion(region.toProtobuf()).setMutation(incr.<MASK><NEW_LINE>return toChannelBuffer(MUTATE, req);<NEW_LINE>} | build()).build(); |
356,127 | public int minDistance(String word1, String word2) {<NEW_LINE>int s1 = word1.length();<NEW_LINE>int s2 = word2.length();<NEW_LINE>int[][] dp = new int[s1 + 1][s2 + 1];<NEW_LINE>for (int i = 1; i <= s1; i++) {<NEW_LINE>dp[i][0] = i;<NEW_LINE>}<NEW_LINE>for (int j = 1; j <= s2; j++) {<NEW_LINE>dp[0][j] = j;<NEW_LINE>}<NEW_LINE>for (int i = 1; i <= s1; i++) {<NEW_LINE>for (int j = 1; j <= s2; j++) {<NEW_LINE>if (word1.charAt(i - 1) == word2.charAt(j - 1)) {<NEW_LINE>dp[i][j] = dp[i - 1][j - 1];<NEW_LINE>} else {<NEW_LINE>dp[i][j] = Math.min(Math.min(dp[i - 1][j - 1], dp[i - 1][j]), dp[i][j - 1]) + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | return dp[s1][s2]; |
355,223 | public CodegenExpression makeCodegen(CodegenClassScope classScope, CodegenMethodScope parent, SAIFFInitializeSymbolWEventType symbols) {<NEW_LINE>CodegenMethod method = parent.makeChild(FilterSpecParam.EPTYPE, this.getClass(), classScope);<NEW_LINE>CodegenExpression get = exprIdentNodeEvaluator.getGetter().eventBeanGetCodegen(ref("event"), method, classScope);<NEW_LINE>method.getBlock().declareVar(ExprFilterSpecLookupable.EPTYPE, "lookupable", localMethod(lookupable.makeCodegen(method, symbols, classScope))).declareVar(ExprFilterSpecLookupable.EPTYPE_FILTEROPERATOR, "op", enumValue(FilterOperator.class<MASK><NEW_LINE>CodegenExpressionNewAnonymousClass param = newAnonymousClass(method.getBlock(), FilterSpecParam.EPTYPE, Arrays.asList(ref("lookupable"), ref("op")));<NEW_LINE>CodegenMethod getFilterValue = CodegenMethod.makeParentNode(FilterValueSetParam.EPTYPE, this.getClass(), classScope).addParam(FilterSpecParam.GET_FILTER_VALUE_FP);<NEW_LINE>param.addMethod("getFilterValue", getFilterValue);<NEW_LINE>getFilterValue.getBlock().declareVar(EventBean.EPTYPE, "event", exprDotMethod(ref("matchedEvents"), "getMatchingEventByTag", constant(resultEventAsName))).declareVar(EPTypePremade.OBJECT.getEPType(), "value", constantNull()).ifRefNotNull("event").assignRef("value", get).blockEnd();<NEW_LINE>if (isMustCoerce) {<NEW_LINE>getFilterValue.getBlock().assignRef("value", numberCoercer.coerceCodegenMayNullBoxed(cast(EPTypePremade.NUMBER.getEPType(), ref("value")), EPTypePremade.NUMBER.getEPType(), method, classScope));<NEW_LINE>}<NEW_LINE>getFilterValue.getBlock().methodReturn(FilterValueSetParamImpl.codegenNew(ref("value")));<NEW_LINE>method.getBlock().methodReturn(param);<NEW_LINE>return localMethod(method);<NEW_LINE>} | , filterOperator.name())); |
264,169 | public C deserialize(JsonParser jsonParser, DeserializationContext ctx) throws IOException, JsonProcessingException {<NEW_LINE>try {<NEW_LINE>if (jsonParser.isExpectedStartArrayToken()) {<NEW_LINE>T[] array = (T[]) jsonParser.readValueAs(TarrayClass);<NEW_LINE>return classC.getConstructor(new Class<?>[] { TarrayClass }).newInstance(new Object[] { array });<NEW_LINE>}<NEW_LINE>if (useCollectionClassForMessage) {<NEW_LINE>JsonToken jsonToken = jsonParser.nextToken();<NEW_LINE>// Some hacky assumptions here that the container<NEW_LINE>// class has a public 'message' Field on it that we<NEW_LINE>// can set.<NEW_LINE>if (JsonToken.FIELD_NAME.equals(jsonToken)) {<NEW_LINE>jsonToken = jsonParser.nextToken();<NEW_LINE><MASK><NEW_LINE>C containerInstance = classC.newInstance();<NEW_LINE>Field f = classC.getField("message");<NEW_LINE>f.set(containerInstance, message);<NEW_LINE>return containerInstance;<NEW_LINE>}<NEW_LINE>throw new IOException("Failed to parse");<NEW_LINE>} else {<NEW_LINE>// occurs if there's an error<NEW_LINE>T singleInstance = jsonParser.readValueAs(classT);<NEW_LINE>T[] array = (T[]) Array.newInstance(classT, 1);<NEW_LINE>array[0] = singleInstance;<NEW_LINE>return classC.getConstructor(new Class<?>[] { TarrayClass }).newInstance(new Object[] { array });<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IOException("Failed to dynamically instantiate classes", e);<NEW_LINE>}<NEW_LINE>} | String message = jsonParser.getValueAsString(); |
324,331 | private void collectHeaders() {<NEW_LINE>mNearMeCount = 0;<NEW_LINE>mHeaders.clear();<NEW_LINE>if (mSearchResultsMode)<NEW_LINE>return;<NEW_LINE>int headerId = 0;<NEW_LINE>int prev = -1;<NEW_LINE>for (CountryItem ci : mItems) {<NEW_LINE>switch(ci.category) {<NEW_LINE>case CountryItem.CATEGORY_NEAR_ME:<NEW_LINE>if (ci.category != prev) {<NEW_LINE>headerId = CountryItem.CATEGORY_NEAR_ME;<NEW_LINE>mHeaders.put(headerId, mActivity.getString(R.string.downloader_near_me_subtitle));<NEW_LINE>prev = ci.category;<NEW_LINE>}<NEW_LINE>mNearMeCount++;<NEW_LINE>break;<NEW_LINE>case CountryItem.CATEGORY_DOWNLOADED:<NEW_LINE>if (ci.category != prev) {<NEW_LINE>headerId = CountryItem.CATEGORY_DOWNLOADED;<NEW_LINE>mHeaders.put(headerId, mActivity.getString(R.string.downloader_downloaded_subtitle));<NEW_LINE>prev = ci.category;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>int prevHeader = headerId;<NEW_LINE>headerId = CountryItem.CATEGORY_AVAILABLE * HEADER_ADS_OFFSET + ci.name.charAt(0);<NEW_LINE>if (headerId != prevHeader)<NEW_LINE>mHeaders.put(headerId, ci.name.substring(0<MASK><NEW_LINE>prev = ci.category;<NEW_LINE>}<NEW_LINE>ci.headerId = headerId;<NEW_LINE>}<NEW_LINE>} | , 1).toUpperCase()); |
1,253,749 | private boolean prepareDataCell(CrosstabCell data, int column, int availableHeight, int xOffset) throws JRException {<NEW_LINE>int rowY = rowYs.get(rowIdx);<NEW_LINE>JRFillCrosstabCell cell = crossCells[data.getRowTotalGroupIndex()][data.getColumnTotalGroupIndex()];<NEW_LINE>JRFillCellContents contents = cell == null ? null : cell.getFillContents();<NEW_LINE>if (contents == null || contents.getWidth() <= 0 || contents.getHeight() <= 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean overflow = availableHeight < rowY + contents.getHeight();<NEW_LINE>if (!overflow) {<NEW_LINE>boolean leftEmpty = startColumnIndex != 0 && !isRepeatRowHeaders();<NEW_LINE>boolean topEmpty = startRowIndex != 0 && !isRepeatColumnHeaders();<NEW_LINE>setCountVars(rowIdx + startRowIndex, column);<NEW_LINE>setGroupVariables(rowGroups, data.getRowBucketValues());<NEW_LINE>setGroupVariables(columnGroups, data.getColumnBucketValues());<NEW_LINE>setMeasureVariables(data);<NEW_LINE>boolean firstOnRow = leftEmpty && column == startColumnIndex;<NEW_LINE>contents = contents.getBoxContents(firstOnRow && getRunDirectionValue() == RunDirectionEnum.LTR, firstOnRow && getRunDirectionValue() == RunDirectionEnum.<MASK><NEW_LINE>contents = contents.getWorkingClone();<NEW_LINE>contents.evaluate(JRExpression.EVALUATION_DEFAULT);<NEW_LINE>contents.prepare(availableHeight - rowY);<NEW_LINE>if (interactive) {<NEW_LINE>contents.setPrintProperty(CrosstabInteractiveJsonHandler.PROPERTY_COLUMN_INDEX, Integer.toString(column));<NEW_LINE>contents.addHtmlClass("jrxtdatacell");<NEW_LINE>}<NEW_LINE>preparedRow.add(contents);<NEW_LINE>overflow = contents.willOverflow();<NEW_LINE>if (!overflow) {<NEW_LINE>contents.setX(columnXOffsets[column] - columnXOffsets[startColumnIndex] + xOffset);<NEW_LINE>contents.setY(rowY + yOffset);<NEW_LINE>// this test is probably not needed, but using it just to be safe<NEW_LINE>int // this test is probably not needed, but using it just to be safe<NEW_LINE>rowCellHeight = contents.isLegacyElementStretchEnabled() ? contents.getPrintHeight() : Math.max(contents.getPrintHeight(), contents.getHeight());<NEW_LINE>if (rowCellHeight > preparedRowHeight) {<NEW_LINE>preparedRowHeight = rowCellHeight;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return overflow;<NEW_LINE>} | RTL, topEmpty && rowIdx == 0); |
1,437,898 | public static Condition convHas2Condition(HasContainer has, HugeType type, HugeGraph graph) {<NEW_LINE>P<?> p = has.getPredicate();<NEW_LINE>E.checkArgument(p != null, "The predicate of has(%s) is null", has);<NEW_LINE>BiPredicate<?, ?> bp = p.getBiPredicate();<NEW_LINE>Condition condition;<NEW_LINE>if (keyForContainsKeyOrValue(has.getKey())) {<NEW_LINE><MASK><NEW_LINE>} else if (bp instanceof Compare) {<NEW_LINE>condition = convCompare2Relation(graph, type, has);<NEW_LINE>} else if (bp instanceof RelationType) {<NEW_LINE>condition = convRelationType2Relation(graph, type, has);<NEW_LINE>} else if (bp instanceof Contains) {<NEW_LINE>condition = convIn2Relation(graph, type, has);<NEW_LINE>} else if (p instanceof AndP) {<NEW_LINE>condition = convAnd(graph, type, has);<NEW_LINE>} else if (p instanceof OrP) {<NEW_LINE>condition = convOr(graph, type, has);<NEW_LINE>} else {<NEW_LINE>// TODO: deal with other Predicate<NEW_LINE>throw newUnsupportedPredicate(p);<NEW_LINE>}<NEW_LINE>return condition;<NEW_LINE>} | condition = convContains2Relation(graph, has); |
125,666 | public SkyValue compute(SkyKey skyKey, Environment env) throws PackageLookupFunctionException, InterruptedException {<NEW_LINE>PathPackageLocator pkgLocator = PrecomputedValue.PATH_PACKAGE_LOCATOR.get(env);<NEW_LINE>StarlarkSemantics semantics = PrecomputedValue.STARLARK_SEMANTICS.get(env);<NEW_LINE>PackageIdentifier packageKey = (PackageIdentifier) skyKey.argument();<NEW_LINE>String packageNameErrorMsg = LabelValidator.validatePackageName(packageKey.getPackageFragment().getPathString());<NEW_LINE>if (packageNameErrorMsg != null) {<NEW_LINE>return PackageLookupValue.invalidPackageName("Invalid package name '" + packageKey + "': " + packageNameErrorMsg);<NEW_LINE>}<NEW_LINE>if (deletedPackages.get().contains(packageKey)) {<NEW_LINE>return PackageLookupValue.DELETED_PACKAGE_VALUE;<NEW_LINE>}<NEW_LINE>if (!packageKey.getRepository().isMain()) {<NEW_LINE>return computeExternalPackageLookupValue(skyKey, env, packageKey);<NEW_LINE>}<NEW_LINE>if (packageKey.equals(LabelConstants.EXTERNAL_PACKAGE_IDENTIFIER)) {<NEW_LINE>return semantics.getBool(BuildLanguageOptions.EXPERIMENTAL_DISABLE_EXTERNAL_PACKAGE) ? PackageLookupValue.NO_BUILD_FILE_VALUE : computeWorkspacePackageLookupValue(env);<NEW_LINE>}<NEW_LINE>// Check .bazelignore file under main repository.<NEW_LINE>IgnoredPackagePrefixesValue ignoredPatternsValue = (IgnoredPackagePrefixesValue) env.<MASK><NEW_LINE>if (ignoredPatternsValue == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (isPackageIgnored(packageKey, ignoredPatternsValue)) {<NEW_LINE>return PackageLookupValue.DELETED_PACKAGE_VALUE;<NEW_LINE>}<NEW_LINE>return findPackageByBuildFile(env, pkgLocator, packageKey);<NEW_LINE>} | getValue(IgnoredPackagePrefixesValue.key()); |
1,173,666 | public void update() {<NEW_LINE>MinecraftServer server = mod.getServer();<NEW_LINE>if (server == null) {<NEW_LINE>this.online = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ServerPlayerEntity player = server.getPlayerManager().getPlayer(uuid);<NEW_LINE>if (player == null) {<NEW_LINE>this.online = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.gamemode = GAMEMODE_MAP.get(player.interactionManager.getGameMode());<NEW_LINE>if (this.gamemode == null)<NEW_LINE>this.gamemode = Gamemode.SURVIVAL;<NEW_LINE>StatusEffectInstance invis = <MASK><NEW_LINE>this.invisible = invis != null && invis.getDuration() > 0;<NEW_LINE>this.name = Text.of(player.getName().getString());<NEW_LINE>this.online = true;<NEW_LINE>Vec3d pos = player.getPos();<NEW_LINE>this.position = new Vector3d(pos.getX(), pos.getY(), pos.getZ());<NEW_LINE>this.sneaking = player.isSneaking();<NEW_LINE>try {<NEW_LINE>this.world = mod.getUUIDForWorld(player.getWorld());<NEW_LINE>} catch (IOException e) {<NEW_LINE>this.world = UNKNOWN_WORLD_UUID;<NEW_LINE>}<NEW_LINE>} | player.getStatusEffect(StatusEffects.INVISIBILITY); |
1,397,521 | public ManagedDataSource build(MetricRegistry metricRegistry, String name) {<NEW_LINE>final Properties dbProperties = new Properties();<NEW_LINE>properties.forEach(dbProperties::setProperty);<NEW_LINE>final PoolProperties poolConfig = new PoolProperties();<NEW_LINE>poolConfig.setAbandonWhenPercentageFull(abandonWhenPercentageFull);<NEW_LINE>poolConfig.setAlternateUsernameAllowed(alternateUsernamesAllowed);<NEW_LINE>poolConfig.setCommitOnReturn(commitOnReturn);<NEW_LINE>poolConfig.setRollbackOnReturn(rollbackOnReturn);<NEW_LINE>poolConfig.setDbProperties(dbProperties);<NEW_LINE>poolConfig.setDefaultAutoCommit(autoCommitByDefault);<NEW_LINE>poolConfig.setDefaultCatalog(defaultCatalog);<NEW_LINE>poolConfig.setDefaultReadOnly(readOnlyByDefault);<NEW_LINE>poolConfig.setDefaultTransactionIsolation(defaultTransactionIsolation.get());<NEW_LINE>poolConfig.setDriverClassName(driverClass);<NEW_LINE>poolConfig.setFairQueue(useFairQueue);<NEW_LINE>poolConfig.setIgnoreExceptionOnPreLoad(ignoreExceptionOnPreLoad);<NEW_LINE>poolConfig.setInitialSize(initialSize);<NEW_LINE>poolConfig.setInitSQL(initializationQuery);<NEW_LINE>poolConfig.setLogAbandoned(logAbandonedConnections);<NEW_LINE>poolConfig.setLogValidationErrors(logValidationErrors);<NEW_LINE>poolConfig.setMaxActive(maxSize);<NEW_LINE>poolConfig.setMaxIdle(maxSize);<NEW_LINE>poolConfig.setMinIdle(minSize);<NEW_LINE>getMaxConnectionAge().map(Duration::toMilliseconds).ifPresent(poolConfig::setMaxAge);<NEW_LINE>poolConfig.setMaxWait((int) maxWaitForConnection.toMilliseconds());<NEW_LINE>poolConfig.setMinEvictableIdleTimeMillis((int) minIdleTime.toMilliseconds());<NEW_LINE>poolConfig.setName(name);<NEW_LINE>poolConfig.setUrl(url);<NEW_LINE>poolConfig.setUsername(user);<NEW_LINE>poolConfig.setPassword(user != null && password == null ? "" : password);<NEW_LINE>poolConfig.setRemoveAbandoned(removeAbandoned);<NEW_LINE>poolConfig.setRemoveAbandonedTimeout((int) removeAbandonedTimeout.toSeconds());<NEW_LINE>poolConfig.setTestWhileIdle(checkConnectionWhileIdle);<NEW_LINE>validationQuery.ifPresent(poolConfig::setValidationQuery);<NEW_LINE>poolConfig.setTestOnBorrow(checkConnectionOnBorrow);<NEW_LINE>poolConfig.setTestOnConnect(checkConnectionOnConnect);<NEW_LINE>poolConfig.setTestOnReturn(checkConnectionOnReturn);<NEW_LINE>poolConfig.setTimeBetweenEvictionRunsMillis((int) evictionInterval.toMilliseconds());<NEW_LINE>poolConfig.setValidationInterval(validationInterval.toMilliseconds());<NEW_LINE>getValidationQueryTimeout().map(x -> (int) x.toSeconds()).ifPresent(poolConfig::setValidationQueryTimeout);<NEW_LINE><MASK><NEW_LINE>jdbcInterceptors.ifPresent(poolConfig::setJdbcInterceptors);<NEW_LINE>return new ManagedPooledDataSource(poolConfig, metricRegistry);<NEW_LINE>} | validatorClassName.ifPresent(poolConfig::setValidatorClassName); |
682,091 | /*<NEW_LINE>* attach and install edges between clusters.<NEW_LINE>* essentially, class2() for interclust edges.<NEW_LINE>*/<NEW_LINE>@Unused<NEW_LINE>@Reviewed(when = "15/11/2020")<NEW_LINE>@Original(version = "2.38.0", path = "lib/dotgen/cluster.c", name = "interclexp", key = "6g2m2y44x66lajznvnon2gubv", definition = "void interclexp(graph_t * subg)")<NEW_LINE>public static void interclexp(ST_Agraph_s subg) {<NEW_LINE>ENTERING("6g2m2y44x66lajznvnon2gubv", "interclexp");<NEW_LINE>try {<NEW_LINE>ST_Agraph_s g;<NEW_LINE>ST_Agnode_s n;<NEW_LINE>ST_Agedge_s e, prev, next;<NEW_LINE>g = dot_root(subg);<NEW_LINE>for (n = agfstnode(subg); n != null; n = agnxtnode(subg, n)) {<NEW_LINE>e = AGMKOUT(e);<NEW_LINE>merge_chain(subg, e<MASK><NEW_LINE>safe_other_edge(e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (ND_rank(aghead(e)) > ND_rank(agtail(e))) {<NEW_LINE>make_interclust_chain(g, agtail(e), aghead(e), e);<NEW_LINE>prev = e;<NEW_LINE>continue;<NEW_LINE>} else /* backward edges */<NEW_LINE>{<NEW_LINE>make_interclust_chain(g, aghead(e), agtail(e), e);<NEW_LINE>prev = e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>LEAVING("6g2m2y44x66lajznvnon2gubv", "interclexp");<NEW_LINE>}<NEW_LINE>} | , ED_to_virt(prev), false); |
1,305,702 | static void mergeIntoSource(Map<String, Object> source, Map<String, Object> mappingUpdate, List<String> path) {<NEW_LINE>for (Map.Entry<String, Object> updateEntry : mappingUpdate.entrySet()) {<NEW_LINE>String key = updateEntry.getKey();<NEW_LINE>Object updateValue = updateEntry.getValue();<NEW_LINE>if (source.containsKey(key)) {<NEW_LINE>Object sourceValue = source.get(key);<NEW_LINE>if (sourceValue instanceof Map && updateValue instanceof Map) {<NEW_LINE>// noinspection unchecked<NEW_LINE>mergeIntoSource((Map) sourceValue, (Map) updateValue, Lists2.concat(path, key));<NEW_LINE>} else {<NEW_LINE>if (sourceValue == null) {<NEW_LINE>// mainly to handle BWC. Ideally there should not be null-valued entries.<NEW_LINE>source.put(key, updateValue);<NEW_LINE>} else if (updateAllowed(key, sourceValue, updateValue)) {<NEW_LINE>source.put(key, updateValue);<NEW_LINE>} else if (!isUpdateIgnored(path) && !Objects.equals(sourceValue, updateValue)) {<NEW_LINE>String fqKey = String.join(".", path) + '.' + key;<NEW_LINE>throw new IllegalArgumentException("Can't overwrite " + fqKey + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>source.put(key, updateValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "=" + sourceValue + " with " + updateValue); |
514,038 | @Path("/{queryname}/drillacross")<NEW_LINE>public SaikuQuery drillacross(@PathParam("queryname") String queryName, @FormParam("position") String position, @FormParam("drill") String returns) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("TRACK\t" + "\t/query/" + queryName + "/drillacross\tPOST");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String[] positions = position.split(":");<NEW_LINE>List<Integer> cellPosition = new ArrayList<>();<NEW_LINE>for (String p : positions) {<NEW_LINE>Integer pInt = Integer.parseInt(p);<NEW_LINE>cellPosition.add(pInt);<NEW_LINE>}<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>JavaType ct = mapper.getTypeFactory().constructCollectionType(ArrayList.class, String.class);<NEW_LINE>JavaType st = mapper.getTypeFactory().uncheckedSimpleType(String.class);<NEW_LINE>Map<String, List<String>> levels = mapper.readValue(returns, mapper.getTypeFactory().constructMapType(Map.class, st, ct));<NEW_LINE>return olapQueryService.drillacross(queryName, cellPosition, levels);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error(<MASK><NEW_LINE>String error = ExceptionUtils.getRootCauseMessage(e);<NEW_LINE>throw new WebApplicationException(Response.serverError().entity(error).build());<NEW_LINE>}<NEW_LINE>} | "Cannot execute query (" + queryName + ")", e); |
29,241 | private void loadNode249() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_TotalRequestCount, new QualifiedName(0, "TotalRequestCount"), new LocalizedText("en", "TotalRequestCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.ServiceCounterDataType, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_TotalRequestCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_TotalRequestCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_TotalRequestCount, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), true)); |
1,325,026 | private Formula compileBranchFormula(ControlFlowNode node, List<ControlFlowNode> cutoffNodes, List<String> quantifiedMetavars) {<NEW_LINE>quantifiedMetavars = shallowCopy(quantifiedMetavars);<NEW_LINE>Formula formula;<NEW_LINE><MASK><NEW_LINE>int line = statement.getPosition().getLine();<NEW_LINE>formula = new Branch(statement.getParent(), metavars);<NEW_LINE>ArrayList<Operation> ops = new ArrayList<>();<NEW_LINE>if (operations.containsKey(line)) {<NEW_LINE>ops.addAll(operations.get(line));<NEW_LINE>}<NEW_LINE>if (ops.size() > 0) {<NEW_LINE>formula = new And(formula, new ExistsVar("_v", new SetEnv("_v", ops)));<NEW_LINE>}<NEW_LINE>// Mark first occurences of metavars as quantified before compiling inner formulas<NEW_LINE>List<String> newMetavars = getUnquantifiedMetavarsUsedIn(node.getStatement(), quantifiedMetavars);<NEW_LINE>quantifiedMetavars.addAll(newMetavars);<NEW_LINE>Formula lhs = compileFormulaInner(node.next().get(0), cutoffNodes, quantifiedMetavars);<NEW_LINE>Formula rhs = compileFormulaInner(node.next().get(1), cutoffNodes, quantifiedMetavars);<NEW_LINE>if (lhs != null && rhs != null) {<NEW_LINE>formula = new And(formula, new And(new ExistsNext(lhs), new ExistsNext(rhs)));<NEW_LINE>} else if (lhs != null) {<NEW_LINE>formula = new And(formula, new ExistsNext(lhs));<NEW_LINE>} else if (rhs != null) {<NEW_LINE>formula = new And(formula, new ExistsNext(rhs));<NEW_LINE>}<NEW_LINE>// Actually quantify the new metavars<NEW_LINE>Collections.reverse(newMetavars);<NEW_LINE>for (String varname : newMetavars) {<NEW_LINE>formula = new ExistsVar(varname, formula);<NEW_LINE>}<NEW_LINE>return formula;<NEW_LINE>} | CtElement statement = node.getStatement(); |
1,746,810 | public CategoricalDistribution jointDistribution(Proposition... propositions) {<NEW_LINE>ProbabilityTable d = null;<NEW_LINE>final Proposition <MASK><NEW_LINE>final LinkedHashSet<RandomVariable> vars = new LinkedHashSet<RandomVariable>(conjProp.getUnboundScope());<NEW_LINE>if (vars.size() > 0) {<NEW_LINE>RandomVariable[] distVars = new RandomVariable[vars.size()];<NEW_LINE>vars.toArray(distVars);<NEW_LINE>final ProbabilityTable ud = new ProbabilityTable(distVars);<NEW_LINE>final Object[] values = new Object[vars.size()];<NEW_LINE>ProbabilityTable.Iterator di = new ProbabilityTable.Iterator() {<NEW_LINE><NEW_LINE>public void iterate(Map<RandomVariable, Object> possibleWorld, double probability) {<NEW_LINE>if (conjProp.holds(possibleWorld)) {<NEW_LINE>int i = 0;<NEW_LINE>for (RandomVariable rv : vars) {<NEW_LINE>values[i] = possibleWorld.get(rv);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>int dIdx = ud.getIndex(values);<NEW_LINE>ud.setValue(dIdx, ud.getValues()[dIdx] + probability);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>distribution.iterateOverTable(di);<NEW_LINE>d = ud;<NEW_LINE>} else {<NEW_LINE>// No Unbound Variables, therefore just return<NEW_LINE>// the singular probability related to the proposition.<NEW_LINE>d = new ProbabilityTable();<NEW_LINE>d.setValue(0, prior(propositions));<NEW_LINE>}<NEW_LINE>return d;<NEW_LINE>} | conjProp = ProbUtil.constructConjunction(propositions); |
858,102 | public void exitIf_switchport(If_switchportContext ctx) {<NEW_LINE>if (ctx.NO() != null) {<NEW_LINE>for (Interface iface : _currentInterfaces) {<NEW_LINE>iface.setSwitchportMode(SwitchportMode.NONE);<NEW_LINE>iface.setSwitchport(false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (Interface iface : _currentInterfaces) {<NEW_LINE>iface.setSwitchport(true);<NEW_LINE>// setting the switch port mode only if it is not already set<NEW_LINE>if (iface.getSwitchportMode() == null || iface.getSwitchportMode() == SwitchportMode.NONE) {<NEW_LINE>SwitchportMode defaultSwitchportMode = _configuration<MASK><NEW_LINE>iface.setSwitchportMode((defaultSwitchportMode == SwitchportMode.NONE || defaultSwitchportMode == null) ? Interface.getUndeclaredDefaultSwitchportMode(_configuration.getVendor()) : defaultSwitchportMode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getCf().getDefaultSwitchportMode(); |
1,545,140 | static void runColumnRebuild(RebuildColumnCommandArgs params, RebuildColumnBase ri) throws IOException, ServerConfigurationException, JsonException {<NEW_LINE>String rootDirectory = params.tablePath + Files.SEPARATOR + ".." + Files.SEPARATOR + "..";<NEW_LINE>final Properties properties = new Properties();<NEW_LINE>final String configurationFileName = "/server.conf";<NEW_LINE>final File configurationFile = new File(new File(rootDirectory, PropServerConfiguration.CONFIG_DIRECTORY), configurationFileName);<NEW_LINE>try (InputStream is = new FileInputStream(configurationFile)) {<NEW_LINE>properties.load(is);<NEW_LINE>}<NEW_LINE>final Log log = LogFactory.getLog("recover-var-index");<NEW_LINE>PropServerConfiguration configuration = readServerConfiguration(rootDirectory, properties, log, new BuildInformationHolder());<NEW_LINE>ri.of(params.<MASK><NEW_LINE>try {<NEW_LINE>ri.rebuildPartitionColumn(params.partition, params.column);<NEW_LINE>} catch (CairoException ex) {<NEW_LINE>log.error().$(ex.getFlyweightMessage()).$();<NEW_LINE>}<NEW_LINE>} | tablePath, configuration.getCairoConfiguration()); |
445,181 | public void marshalConfigToProperties() {<NEW_LINE>if (DEBUG_LOGGING) {<NEW_LINE>logger.debug("marshalConfigToProperties({})", profileName);<NEW_LINE>}<NEW_LINE>loadedProps.put(KEY_LAST_PROFILE, profileName);<NEW_LINE>putProperty(loadedProps, KEY_SOURCE_LOCATIONS, StringUtil.listToText(sourceLocations, S_COMMA));<NEW_LINE>putProperty(loadedProps, KEY_CLASS_LOCATIONS, StringUtil.listToText(classLocations, S_COMMA));<NEW_LINE>putProperty(loadedProps, KEY_LAST_SANDBOX_EDITOR_PANES, StringUtil.listToText(editorPanes, S_COMMA));<NEW_LINE>putProperty(loadedProps, KEY_SHOW_JIT_ONLY_MEMBERS, Boolean.toString(showOnlyCompiledMembers));<NEW_LINE>putProperty(loadedProps, KEY_SHOW_JIT_ONLY_CLASSES, Boolean.toString(showOnlyCompiledClasses));<NEW_LINE>putProperty(loadedProps, KEY_SHOW_HIDE_INTERFACES<MASK><NEW_LINE>putProperty(loadedProps, KEY_SHOW_NOTHING_MOUNTED, Boolean.toString(showNothingMounted));<NEW_LINE>putProperty(loadedProps, KEY_SANDBOX_INTEL_MODE, Boolean.toString(intelMode));<NEW_LINE>putProperty(loadedProps, KEY_TRIVIEW_TRILINK_MOUSE_FOLLOW, Boolean.toString(mouseFollow));<NEW_LINE>putProperty(loadedProps, KEY_TRIVIEW_LOCAL_ASM_LABELS, Boolean.toString(localAsmLabels));<NEW_LINE>saveTieredCompilationMode();<NEW_LINE>saveCompressedOopsMode();<NEW_LINE>saveBackgroundCompilationMode();<NEW_LINE>saveOnStackReplacementMode();<NEW_LINE>if (lastLogDir != null) {<NEW_LINE>putProperty(loadedProps, KEY_LAST_LOG_DIR, lastLogDir);<NEW_LINE>}<NEW_LINE>putProperty(loadedProps, KEY_SANDBOX_FREQ_INLINE_SIZE, Integer.toString(freqInlineSize));<NEW_LINE>putProperty(loadedProps, KEY_SANDBOX_MAX_INLINE_SIZE, Integer.toString(maxInlineSize));<NEW_LINE>putProperty(loadedProps, KEY_SANDBOX_PRINT_ASSEMBLY, Boolean.toString(printAssembly));<NEW_LINE>putProperty(loadedProps, KEY_SANDBOX_DISABLE_INLINING, Boolean.toString(disableInlining));<NEW_LINE>putProperty(loadedProps, KEY_SANDBOX_COMPILER_THRESHOLD, Integer.toString(compileThreshold));<NEW_LINE>putProperty(loadedProps, KEY_SANDBOX_EXTRA_VM_SWITCHES, extraVMSwitches);<NEW_LINE>putProperty(loadedProps, KEY_NO_PROMPT_HSDIS, Boolean.toString(noPromptHsdis));<NEW_LINE>} | , Boolean.toString(hideInterfaces)); |
801,347 | private void createGetSizeMethod(ClassWriter cw, Map<String, BField> fields, String className) {<NEW_LINE>MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "size", "()I", null, null);<NEW_LINE>mv.visitCode();<NEW_LINE>int sizeVarIndex = 1;<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>mv.visitMethodInsn(INVOKESPECIAL, MAP_VALUE_IMPL, "size", "()I", false);<NEW_LINE>mv.visitVarInsn(ISTORE, sizeVarIndex);<NEW_LINE>int requiredFieldsCount = 0;<NEW_LINE>for (BField optionalField : fields.values()) {<NEW_LINE>String fieldName = optionalField.name.value;<NEW_LINE>if (isOptionalRecordField(optionalField)) {<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>mv.visitFieldInsn(GETFIELD, className, getFieldIsPresentFlagName(fieldName), getTypeDesc(booleanType));<NEW_LINE>Label l3 = new Label();<NEW_LINE>mv.visitJumpInsn(IFEQ, l3);<NEW_LINE><MASK><NEW_LINE>mv.visitLabel(l3);<NEW_LINE>} else {<NEW_LINE>requiredFieldsCount += 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mv.visitIincInsn(sizeVarIndex, requiredFieldsCount);<NEW_LINE>mv.visitVarInsn(ILOAD, sizeVarIndex);<NEW_LINE>mv.visitInsn(IRETURN);<NEW_LINE>mv.visitMaxs(0, 0);<NEW_LINE>mv.visitEnd();<NEW_LINE>} | mv.visitIincInsn(sizeVarIndex, 1); |
1,004,581 | private RetCode doValidation(final Reporter reporter, final List<File> files) throws IOException, ProcessingException {<NEW_LINE>final File <MASK><NEW_LINE>final String uri = schemaFile.toURI().normalize().toString();<NEW_LINE>JsonNode node;<NEW_LINE>node = MAPPER.readTree(schemaFile);<NEW_LINE>if (!syntaxValidator.schemaIsValid(node)) {<NEW_LINE>System.err.println("Schema is invalid! Aborting...");<NEW_LINE>return SCHEMA_SYNTAX_ERROR;<NEW_LINE>}<NEW_LINE>final JsonSchema schema = factory.getJsonSchema(uri);<NEW_LINE>RetCode ret = ALL_OK, retcode;<NEW_LINE>for (final File file : files) {<NEW_LINE>node = MAPPER.readTree(file);<NEW_LINE>retcode = reporter.validateInstance(schema, file.toString(), node);<NEW_LINE>if (retcode != ALL_OK)<NEW_LINE>ret = retcode;<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | schemaFile = files.remove(0); |
1,020,756 | public static Tradable fromProto(protobuf.BsqSwapSellerAsMakerTrade bsqSwapSellerAsMakerTrade) {<NEW_LINE>var proto = bsqSwapSellerAsMakerTrade.getBsqSwapTrade();<NEW_LINE>var uid = ProtoUtil.stringOrNullFromProto(proto.getUid());<NEW_LINE>if (uid == null) {<NEW_LINE>uid = UUID<MASK><NEW_LINE>}<NEW_LINE>return new BsqSwapSellerAsMakerTrade(uid, Offer.fromProto(proto.getOffer()), Coin.valueOf(proto.getAmount()), proto.getTakeOfferDate(), proto.hasPeerNodeAddress() ? NodeAddress.fromProto(proto.getPeerNodeAddress()) : null, proto.getMiningFeePerByte(), proto.getMakerFee(), proto.getTakerFee(), BsqSwapProtocolModel.fromProto(proto.getBsqSwapProtocolModel()), ProtoUtil.stringOrNullFromProto(proto.getErrorMessage()), State.fromProto(proto.getState()), ProtoUtil.stringOrNullFromProto(proto.getTxId()));<NEW_LINE>} | .randomUUID().toString(); |
138,864 | private boolean isPackage(String result) {<NEW_LINE>int classIdx = getClassIndex(result);<NEW_LINE>if (classIdx >= 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String resourceName = result.<MASK><NEW_LINE>boolean isPackage = true;<NEW_LINE>InputStream is = getResource(resourceName);<NEW_LINE>if (// cannot just test for null; need to read from "is" to avoid bug<NEW_LINE>is != null) {<NEW_LINE>// with sun.plugin.cache.EmptyInputStream on JRE 1.5 plugin<NEW_LINE>try // http://sourceforge.net/tracker/index.php?func=detail&aid=1478460&group_id=36382&atid=416703<NEW_LINE>{<NEW_LINE>isPackage = (is.read() < 0);<NEW_LINE>} catch (IOException e) {<NEW_LINE>// ignore<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>is.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return isPackage;<NEW_LINE>} | replace('.', '/') + ".class"; |
1,212,765 | public okhttp3.Call sdkGenLanguagesGetCall(final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/sdk-gen/languages";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE><MASK><NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | localVarHeaderParams.put("Content-Type", localVarContentType); |
445,236 | public String cloneTemplate(Template templateIn) {<NEW_LINE>Template newOne = templateIn.cloneNewTemplate(templateIn);<NEW_LINE>String name = BundleUtil.getStringFromBundle("page.copy") + " " + templateIn.getName();<NEW_LINE>newOne.setName(name);<NEW_LINE>newOne.setUsageCount(new Long(0));<NEW_LINE>newOne.setCreateTime(new Timestamp(new Date().getTime()));<NEW_LINE>dataverse.<MASK><NEW_LINE>templates.add(newOne);<NEW_LINE>Template created;<NEW_LINE>try {<NEW_LINE>created = engineService.submit(new CreateTemplateCommand(newOne, dvRequestService.getDataverseRequest(), dataverse));<NEW_LINE>saveDataverse("");<NEW_LINE>// "The template has been copied";<NEW_LINE>String msg = BundleUtil.getStringFromBundle("template.clone");<NEW_LINE>JsfHelper.addFlashMessage(msg);<NEW_LINE>return "/template.xhtml?id=" + created.getId() + "&ownerId=" + dataverse.getId() + "&editMode=METADATA&faces-redirect=true";<NEW_LINE>} catch (CommandException ex) {<NEW_LINE>// "Template could not be copied. "<NEW_LINE>JH.addMessage(FacesMessage.SEVERITY_FATAL, BundleUtil.getStringFromBundle("template.clone.error"));<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>} | getTemplates().add(newOne); |
1,116,306 | private DeploymentRoutingStatus deploymentStatus(String upstreamName) {<NEW_LINE>Instant changedAt = clock.instant();<NEW_LINE>Path path = deploymentStatusPath(upstreamName);<NEW_LINE>Optional<byte[]> <MASK><NEW_LINE>if (data.isEmpty()) {<NEW_LINE>return new DeploymentRoutingStatus(RoutingStatus.in, "", "", changedAt);<NEW_LINE>}<NEW_LINE>String agent = "";<NEW_LINE>String reason = "";<NEW_LINE>RoutingStatus status = RoutingStatus.out;<NEW_LINE>if (data.get().length > 0) {<NEW_LINE>// Compatibility with old format, where no data is stored<NEW_LINE>Slime slime = SlimeUtils.jsonToSlime(data.get());<NEW_LINE>Cursor root = slime.get();<NEW_LINE>status = asRoutingStatus(root.field("status").asString());<NEW_LINE>agent = root.field("agent").asString();<NEW_LINE>reason = root.field("cause").asString();<NEW_LINE>changedAt = Instant.ofEpochSecond(root.field("lastUpdate").asLong());<NEW_LINE>}<NEW_LINE>return new DeploymentRoutingStatus(status, agent, reason, changedAt);<NEW_LINE>} | data = curator.getData(path); |
1,036,211 | public void fetchPlaylists() {<NEW_LINE>if (DatabaseHelper.get().getLoggedOpsCount() == 0) {<NEW_LINE>Log.d(TAG, "Hatchet sync - fetching playlists");<NEW_LINE>User.getSelf().done(new DoneCallback<User>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDone(User user) {<NEW_LINE>String requestId = InfoSystem.get(<MASK><NEW_LINE>if (requestId != null) {<NEW_LINE>mCorrespondingRequestIds.add(requestId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>Log.d(TAG, "Hatchet sync - sending logged ops before fetching playlists");<NEW_LINE>HatchetAuthenticatorUtils hatchetAuthUtils = (HatchetAuthenticatorUtils) AuthenticatorManager.get().getAuthenticatorUtils(TomahawkApp.PLUGINNAME_HATCHET);<NEW_LINE>InfoSystem.get().sendLoggedOps(hatchetAuthUtils);<NEW_LINE>}<NEW_LINE>} | ).resolvePlaylists(user, true); |
1,430,653 | public void handleMessage(ReleaseMessage message, String channel) {<NEW_LINE>logger.info("message received - channel: {}, message: {}", channel, message);<NEW_LINE>String releaseMessage = message.getMessage();<NEW_LINE>if (!Topics.APOLLO_RELEASE_TOPIC.equals(channel) || Strings.isNullOrEmpty(releaseMessage)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> keys = STRING_SPLITTER.splitToList(releaseMessage);<NEW_LINE>// message should be appId+cluster+namespace<NEW_LINE>if (keys.size() != 3) {<NEW_LINE>logger.error("message format invalid - {}", releaseMessage);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String appId = keys.get(0);<NEW_LINE>String cluster = keys.get(1);<NEW_LINE>String <MASK><NEW_LINE>List<GrayReleaseRule> rules = grayReleaseRuleRepository.findByAppIdAndClusterNameAndNamespaceName(appId, cluster, namespace);<NEW_LINE>mergeGrayReleaseRules(rules);<NEW_LINE>} | namespace = keys.get(2); |
130,742 | public Path chooseTemporaryMountPoint(VaultSettings vaultSettings, Path parentDir) {<NEW_LINE>String basename = vaultSettings<MASK><NEW_LINE>// regular<NEW_LINE>Path mountPoint = parentDir.resolve(basename);<NEW_LINE>if (Files.notExists(mountPoint)) {<NEW_LINE>return mountPoint;<NEW_LINE>}<NEW_LINE>// with id<NEW_LINE>mountPoint = parentDir.resolve(basename + " (" + vaultSettings.getId() + ")");<NEW_LINE>if (Files.notExists(mountPoint)) {<NEW_LINE>return mountPoint;<NEW_LINE>}<NEW_LINE>// with id and count<NEW_LINE>for (int i = 1; i < MAX_TMPMOUNTPOINT_CREATION_RETRIES; i++) {<NEW_LINE>mountPoint = parentDir.resolve(basename + "_(" + vaultSettings.getId() + ")_" + i);<NEW_LINE>if (Files.notExists(mountPoint)) {<NEW_LINE>return mountPoint;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.error("Failed to find feasible mountpoint at {}{}{}_x. Giving up after {} attempts.", parentDir, File.separator, basename, MAX_TMPMOUNTPOINT_CREATION_RETRIES);<NEW_LINE>return null;<NEW_LINE>} | .mountName().get(); |
1,314,119 | boolean unloadConnector(BlockPos pos, @Nullable IImmersiveConnectable iicToRemove) {<NEW_LINE>++version;<NEW_LINE>IImmersiveConnectable <MASK><NEW_LINE>if (iicToRemove != existingIIC) {<NEW_LINE>// Out of order case, same as in loadConnector<NEW_LINE>WireLogger.logger.info("Tried to remove {} at {} from {}, skipping", iicToRemove, pos, this);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Preconditions.checkState(existingIIC != null, "Unloading connector at %s in net %s, but no connector is stored", pos, this);<NEW_LINE>Preconditions.checkState(!existingIIC.isProxy(), "Unloading connector at %s in %s, but %s is already a proxy", pos, this, existingIIC);<NEW_LINE>connectors.put(pos, proxyProvider.createFor(existingIIC));<NEW_LINE>for (LocalNetworkHandler h : handlers.values()) h.onConnectorUnloaded(pos, existingIIC);<NEW_LINE>for (ConnectionPoint cp : existingIIC.getConnectionPoints()) if (connections.containsKey(cp))<NEW_LINE>removeHandlersFor(existingIIC);<NEW_LINE>return true;<NEW_LINE>} | existingIIC = connectors.get(pos); |
1,104,320 | public void voteUpComment(final RequestContext context) {<NEW_LINE><MASK><NEW_LINE>final JSONObject requestJSONObject = context.requestJSON();<NEW_LINE>final String dataId = requestJSONObject.optString(Common.DATA_ID);<NEW_LINE>final JSONObject currentUser = Sessions.getUser();<NEW_LINE>final String userId = currentUser.optString(Keys.OBJECT_ID);<NEW_LINE>if (!Role.ROLE_ID_C_ADMIN.equals(currentUser.optString(User.USER_ROLE)) && voteQueryService.isOwn(userId, dataId, Vote.DATA_TYPE_C_COMMENT)) {<NEW_LINE>context.renderMsg(langPropsService.get("cantVoteSelfLabel"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int vote = voteQueryService.isVoted(userId, dataId);<NEW_LINE>if (Vote.TYPE_C_UP == vote) {<NEW_LINE>voteMgmtService.voteCancel(userId, dataId, Vote.DATA_TYPE_C_COMMENT);<NEW_LINE>} else {<NEW_LINE>voteMgmtService.voteUp(userId, dataId, Vote.DATA_TYPE_C_COMMENT);<NEW_LINE>final JSONObject comment = commentQueryService.getComment(dataId);<NEW_LINE>final String commenterId = comment.optString(Comment.COMMENT_AUTHOR_ID);<NEW_LINE>if (!VOTES.contains(userId + dataId) && !userId.equals(commenterId)) {<NEW_LINE>final JSONObject notification = new JSONObject();<NEW_LINE>notification.put(Notification.NOTIFICATION_USER_ID, commenterId);<NEW_LINE>notification.put(Notification.NOTIFICATION_DATA_ID, dataId + "-" + userId);<NEW_LINE>notificationMgmtService.addCommentVoteUpNotification(notification);<NEW_LINE>}<NEW_LINE>VOTES.add(userId + dataId);<NEW_LINE>}<NEW_LINE>context.renderJSON(StatusCodes.SUCC).renderJSONValue(Vote.TYPE, vote);<NEW_LINE>} | context.renderJSON(StatusCodes.ERR); |
1,014,095 | public Mono<ClientResponse> filter(ClientRequest clientRequest, ExchangeFunction next) {<NEW_LINE><MASK><NEW_LINE>String serviceId = originalUrl.getHost();<NEW_LINE>if (serviceId == null) {<NEW_LINE>String message = String.format("Request URI does not contain a valid hostname: %s", originalUrl.toString());<NEW_LINE>if (LOG.isWarnEnabled()) {<NEW_LINE>LOG.warn(message);<NEW_LINE>}<NEW_LINE>return Mono.just(ClientResponse.create(HttpStatus.BAD_REQUEST).body(message).build());<NEW_LINE>}<NEW_LINE>Set<LoadBalancerLifecycle> supportedLifecycleProcessors = LoadBalancerLifecycleValidator.getSupportedLifecycleProcessors(loadBalancerFactory.getInstances(serviceId, LoadBalancerLifecycle.class), RequestDataContext.class, ResponseData.class, ServiceInstance.class);<NEW_LINE>String hint = getHint(serviceId, loadBalancerFactory.getProperties(serviceId).getHint());<NEW_LINE>RequestData requestData = new RequestData(clientRequest);<NEW_LINE>DefaultRequest<RequestDataContext> lbRequest = new DefaultRequest<>(new RequestDataContext(requestData, hint));<NEW_LINE>supportedLifecycleProcessors.forEach(lifecycle -> lifecycle.onStart(lbRequest));<NEW_LINE>return choose(serviceId, lbRequest).flatMap(lbResponse -> {<NEW_LINE>ServiceInstance instance = lbResponse.getServer();<NEW_LINE>if (instance == null) {<NEW_LINE>String message = serviceInstanceUnavailableMessage(serviceId);<NEW_LINE>if (LOG.isWarnEnabled()) {<NEW_LINE>LOG.warn(message);<NEW_LINE>}<NEW_LINE>supportedLifecycleProcessors.forEach(lifecycle -> lifecycle.onComplete(new CompletionContext<>(CompletionContext.Status.DISCARD, lbRequest, lbResponse)));<NEW_LINE>return Mono.just(ClientResponse.create(HttpStatus.SERVICE_UNAVAILABLE).body(serviceInstanceUnavailableMessage(serviceId)).build());<NEW_LINE>}<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug(String.format("LoadBalancer has retrieved the instance for service %s: %s", serviceId, instance.getUri()));<NEW_LINE>}<NEW_LINE>LoadBalancerProperties.StickySession stickySessionProperties = loadBalancerFactory.getProperties(serviceId).getStickySession();<NEW_LINE>ClientRequest newRequest = buildClientRequest(clientRequest, instance, stickySessionProperties.getInstanceIdCookieName(), stickySessionProperties.isAddServiceInstanceCookie(), transformers);<NEW_LINE>supportedLifecycleProcessors.forEach(lifecycle -> lifecycle.onStartRequest(lbRequest, lbResponse));<NEW_LINE>return next.exchange(newRequest).doOnError(throwable -> supportedLifecycleProcessors.forEach(lifecycle -> lifecycle.onComplete(new CompletionContext<ResponseData, ServiceInstance, RequestDataContext>(CompletionContext.Status.FAILED, throwable, lbRequest, lbResponse)))).doOnSuccess(clientResponse -> supportedLifecycleProcessors.forEach(lifecycle -> lifecycle.onComplete(new CompletionContext<>(CompletionContext.Status.SUCCESS, lbRequest, lbResponse, new ResponseData(clientResponse, requestData)))));<NEW_LINE>});<NEW_LINE>} | URI originalUrl = clientRequest.url(); |
273,117 | public final void builtInTypeSpec(boolean addImagNode) throws RecognitionException, TokenStreamException {<NEW_LINE>returnAST = null;<NEW_LINE>ASTPair currentAST = new ASTPair();<NEW_LINE>AST builtInTypeSpec_AST = null;<NEW_LINE>AST bt_AST = null;<NEW_LINE>Token first = LT(1);<NEW_LINE>builtInType();<NEW_LINE>bt_AST = (AST) returnAST;<NEW_LINE>declaratorBrackets(bt_AST);<NEW_LINE><MASK><NEW_LINE>if (inputState.guessing == 0) {<NEW_LINE>builtInTypeSpec_AST = (AST) currentAST.root;<NEW_LINE>if (addImagNode) {<NEW_LINE>builtInTypeSpec_AST = (AST) astFactory.make((new ASTArray(2)).add(create(TYPE, "TYPE", first, LT(1))).add(builtInTypeSpec_AST));<NEW_LINE>}<NEW_LINE>currentAST.root = builtInTypeSpec_AST;<NEW_LINE>currentAST.child = builtInTypeSpec_AST != null && builtInTypeSpec_AST.getFirstChild() != null ? builtInTypeSpec_AST.getFirstChild() : builtInTypeSpec_AST;<NEW_LINE>currentAST.advanceChildToEnd();<NEW_LINE>}<NEW_LINE>builtInTypeSpec_AST = (AST) currentAST.root;<NEW_LINE>returnAST = builtInTypeSpec_AST;<NEW_LINE>} | astFactory.addASTChild(currentAST, returnAST); |
1,539,468 | protected Map<String, byte[]> loadClasses() throws IOException {<NEW_LINE>// iterate war entries<NEW_LINE>ByteArrayOutputStream out = new ByteArrayOutputStream();<NEW_LINE>byte[] buffer = new byte[8192];<NEW_LINE>EntryLoader loader = getEntryLoader();<NEW_LINE>ZipInputStream zis = new ZipInputStream(new FileInputStream(getPath().toFile()));<NEW_LINE>ZipEntry entry;<NEW_LINE>while ((entry = zis.getNextEntry()) != null) {<NEW_LINE>// verify entries are classes and valid files<NEW_LINE>// - skip intentional garbage / zip file abnormalities<NEW_LINE>if (shouldSkip(entry.getName()))<NEW_LINE>continue;<NEW_LINE>if (!loader.isValidFileEntry(entry))<NEW_LINE>continue;<NEW_LINE>if (loader.isValidClassEntry(entry)) {<NEW_LINE>out.reset();<NEW_LINE>byte[] in = IOUtil.toByteArray(zis, out, buffer);<NEW_LINE>// There is no possible way a "class" under 30 bytes is valid<NEW_LINE>if (in.length < 30)<NEW_LINE>continue;<NEW_LINE><MASK><NEW_LINE>if (name.startsWith(WAR_CLASS_PREFIX))<NEW_LINE>name = name.substring(WAR_CLASS_PREFIX.length());<NEW_LINE>loader.onClass(name, in);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>loader.finishClasses();<NEW_LINE>return loader.getClasses();<NEW_LINE>} | String name = entry.getName(); |
896,417 | protected StackManipulation toStackManipulation(MethodDescription instrumentedMethod, MethodDescription invokedMethod, TargetHandler.Resolved targetHandler) {<NEW_LINE>List<ArgumentLoader> argumentLoaders = new ArrayList<ArgumentLoader>();<NEW_LINE>for (ArgumentLoader.ArgumentProvider argumentProvider : argumentProviders) {<NEW_LINE>argumentLoaders.addAll(argumentProvider.resolve(instrumentedMethod, invokedMethod));<NEW_LINE>}<NEW_LINE>ParameterList<?> parameters = invokedMethod.getParameters();<NEW_LINE>if (parameters.size() != argumentLoaders.size()) {<NEW_LINE>throw new IllegalStateException(invokedMethod + " does not accept " + argumentLoaders.size() + " arguments");<NEW_LINE>}<NEW_LINE>Iterator<? extends ParameterDescription> parameterIterator = parameters.iterator();<NEW_LINE>List<StackManipulation> argumentInstructions = new ArrayList<StackManipulation>(argumentLoaders.size());<NEW_LINE>for (ArgumentLoader argumentLoader : argumentLoaders) {<NEW_LINE>argumentInstructions.add(argumentLoader.toStackManipulation(parameterIterator.next<MASK><NEW_LINE>}<NEW_LINE>return new StackManipulation.Compound(targetHandler.toStackManipulation(invokedMethod, assigner, typing), new StackManipulation.Compound(argumentInstructions), methodInvoker.toStackManipulation(invokedMethod, implementationTarget), terminationHandler.toStackManipulation(invokedMethod, instrumentedMethod, assigner, typing));<NEW_LINE>} | (), assigner, typing)); |
509,982 | private synchronized void initCygwinPrefix() {<NEW_LINE>if (cygwinPrefix != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>cygwinPrefix = "/cygdrive/";<NEW_LINE>final Shell shell = WindowsSupport.getInstance().getActiveShell();<NEW_LINE>if (shell == null || shell.type != ShellType.CYGWIN) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>final File cygpath = new File(shell.bindir, "cygpath.exe");<NEW_LINE>if (!cygpath.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ProcessBuilder pb = new // NOI18N<NEW_LINE>ProcessBuilder(// NOI18N<NEW_LINE>cygpath.getAbsolutePath(), // NOI18N<NEW_LINE>"-u", "c:");<NEW_LINE>ProcessUtils.ExitStatus res = ProcessUtils.execute(pb);<NEW_LINE>if (res.isOK()) {<NEW_LINE><MASK><NEW_LINE>if (output.length() > 1) {<NEW_LINE>cygwinPrefix = output.substring(0, output.length() - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String output = res.getOutputString(); |
1,098,273 | public Response makeResponse(FitNesseContext context, Request request) throws Exception {<NEW_LINE>String resource = request.getResource();<NEW_LINE>PageCrawler pageCrawler = context.getRootPage().getPageCrawler();<NEW_LINE>WikiPagePath path = PathParser.parse(resource);<NEW_LINE>WikiPage page = pageCrawler.getPage(path);<NEW_LINE>if (page == null)<NEW_LINE>return new NotFoundResponder().makeResponse(context, request);<NEW_LINE>this.context = context;<NEW_LINE>getVersionsFromRequest(request);<NEW_LINE>if (firstVersion.equals("") && secondVersion.equals("")) {<NEW_LINE>String message = "Compare failed because no input files were given. Select one or two please.";<NEW_LINE>return makeErrorResponse(context, request, message);<NEW_LINE>}<NEW_LINE>WikiPage firstVersionPage = page.getVersion(firstVersion);<NEW_LINE>WikiPage secondVersionPage;<NEW_LINE>if (secondVersion.equals(""))<NEW_LINE>secondVersionPage = page;<NEW_LINE>else<NEW_LINE><MASK><NEW_LINE>comparer.compare(firstVersion, firstVersionPage.getData().getContent(), secondVersion.equals("") ? "latest" : secondVersion, secondVersionPage.getData().getContent());<NEW_LINE>return makeValidResponse(request);<NEW_LINE>} | secondVersionPage = page.getVersion(secondVersion); |
176,225 | private void handleNewCall(String itemName, Class<? extends Item> itemType, NewChannelEvent event, AsteriskBindingConfig config) {<NEW_LINE>if (event.getCallerIdNum() == null || event.getExten() == null) {<NEW_LINE>logger.debug("calleridnum or exten is null -> handle new call aborted!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CallType call = new CallType(new StringType(event.getCallerIdNum()), new StringType(event.getExten()));<NEW_LINE>eventCache.put(<MASK><NEW_LINE>if (config.type.equals("active")) {<NEW_LINE>String reqCid = config.getCallerId();<NEW_LINE>String reqExt = config.getExtension();<NEW_LINE>if ((reqCid == null || (reqCid != null && reqCid.equals(event.getCallerIdNum().toString()))) && (reqExt == null || (reqExt != null && reqExt.equals(event.getExten().toString())))) {<NEW_LINE>if (itemType.isAssignableFrom(SwitchItem.class)) {<NEW_LINE>eventPublisher.postUpdate(itemName, OnOffType.ON);<NEW_LINE>} else if (itemType.isAssignableFrom(CallItem.class)) {<NEW_LINE>eventPublisher.postUpdate(itemName, call);<NEW_LINE>} else {<NEW_LINE>logger.warn("Handle call for item '{}' is undefined", itemName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | event.getUniqueId(), call); |
511,800 | public void paint(Graphics2D g, int x, int y, int w, int h) {<NEW_LINE>float scale = (float) h / (float) mMax;<NEW_LINE>g.setColor(Color.BLACK);<NEW_LINE>int by1 = h - (int) (y + minimum * scale);<NEW_LINE>int by2 = h - (int) (y + maximum * scale);<NEW_LINE>g.drawLine(x, by1, x + w, by1);<NEW_LINE>g.drawLine(x, by2, x + w, by2);<NEW_LINE>int q1 = h - (int) (y + Q1 * scale);<NEW_LINE>int q2 = h - (int) (y + median * scale);<NEW_LINE>int q3 = h - (int<MASK><NEW_LINE>int bh = (int) ((Q3 - Q1) * scale);<NEW_LINE>g.drawLine(x + w / 2, by1, x + w / 2, q1);<NEW_LINE>g.drawLine(x + w / 2, q3, x + w / 2, by2);<NEW_LINE>if (isReference) {<NEW_LINE>g.setColor(new Color(115, 118, 255));<NEW_LINE>} else if (isOptimized) {<NEW_LINE>g.setColor(new Color(197, 255, 153));<NEW_LINE>} else {<NEW_LINE>g.setColor(new Color(255, 88, 119));<NEW_LINE>}<NEW_LINE>g.fillRect(x, q3, w, bh);<NEW_LINE>g.setColor(Color.BLACK);<NEW_LINE>g.drawRect(x, q3, w, bh);<NEW_LINE>g.drawLine(x, q2, x + w, q2);<NEW_LINE>} | ) (y + Q3 * scale); |
1,132,690 | public void processImage(int sourceID, long frameID, final BufferedImage buffered, ImageBase input) {<NEW_LINE>System.out.flush();<NEW_LINE>synchronized (bufferedImageLock) {<NEW_LINE>original = ConvertBufferedImage.checkCopy(buffered, original);<NEW_LINE>work = ConvertBufferedImage.checkDeclare(buffered, work);<NEW_LINE>}<NEW_LINE>if (saveRequested) {<NEW_LINE>saveInputImage();<NEW_LINE>saveRequested = false;<NEW_LINE>}<NEW_LINE>final double timeInSeconds;<NEW_LINE>// TODO Copy all data that's visualized outside so that GUI doesn't lock<NEW_LINE>synchronized (this) {<NEW_LINE>// detector.setVerbose(System.out, BoofMiscOps.hashSet(BoofVerbose.RECURSIVE));<NEW_LINE>long before = System.nanoTime();<NEW_LINE>detector.process((T) input);<NEW_LINE>long after = System.nanoTime();<NEW_LINE>timeInSeconds = (after - before) * 1e-9;<NEW_LINE>}<NEW_LINE>// create a local copy so that gui and processing thread's dont conflict<NEW_LINE>synchronized (detected) {<NEW_LINE>this.detected.reset();<NEW_LINE>for (MicroQrCode d : detector.getDetections()) {<NEW_LINE>this.detected.<MASK><NEW_LINE>}<NEW_LINE>this.failures.reset();<NEW_LINE>for (MicroQrCode d : detector.getFailures()) {<NEW_LINE>if (d.failureCause.ordinal() >= QrCode.Failure.READING_BITS.ordinal())<NEW_LINE>this.failures.grow().setTo(d);<NEW_LINE>}<NEW_LINE>// System.out.println("Failed "+failures.size());<NEW_LINE>// for( QrCode qr : failures.toList() ) {<NEW_LINE>// System.out.println(" cause "+qr.failureCause);<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>controlPanel.polygonPanel.thresholdPanel.updateHistogram((T) input);<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>controls.setProcessingTimeS(timeInSeconds);<NEW_LINE>viewUpdated();<NEW_LINE>synchronized (detected) {<NEW_LINE>controlPanel.messagePanel.updateList(detected.toList(), failures.toList());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | grow().setTo(d); |
1,758,997 | public void installFocusable(final JComponent comp, final AnAction action, final int prevKeyCode, final int nextKeyCode, final boolean focusListOnLeft) {<NEW_LINE>comp.setFocusable(true);<NEW_LINE>comp.setFocusTraversalKeysEnabled(true);<NEW_LINE>comp.addKeyListener(new KeyAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void keyPressed(KeyEvent e) {<NEW_LINE>final JList list = UIUtil.findComponentOfType(myFlatWelcomeFrame.<MASK><NEW_LINE>if (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_SPACE) {<NEW_LINE>InputEvent event = e;<NEW_LINE>if (e.getComponent() instanceof JComponent) {<NEW_LINE>ActionLink link = UIUtil.findComponentOfType((JComponent) e.getComponent(), ActionLink.class);<NEW_LINE>if (link != null) {<NEW_LINE>event = new MouseEvent(link, MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), 0, 0, 1, false, MouseEvent.BUTTON1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>action.actionPerformed(AnActionEvent.createFromAnAction(action, event, ActionPlaces.WELCOME_SCREEN, DataManager.getInstance().getDataContext()));<NEW_LINE>} else if (e.getKeyCode() == prevKeyCode) {<NEW_LINE>focusPrev(comp);<NEW_LINE>} else if (e.getKeyCode() == nextKeyCode) {<NEW_LINE>focusNext(comp);<NEW_LINE>} else if (e.getKeyCode() == KeyEvent.VK_LEFT) {<NEW_LINE>if (focusListOnLeft) {<NEW_LINE>if (list != null) {<NEW_LINE>IdeFocusManager.getGlobalInstance().doForceFocusWhenFocusSettlesDown(list);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>focusPrev(comp);<NEW_LINE>}<NEW_LINE>} else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {<NEW_LINE>focusNext(comp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>comp.addFocusListener(new FocusListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void focusGained(FocusEvent e) {<NEW_LINE>comp.setOpaque(true);<NEW_LINE>comp.setBackground(WelcomeScreenConstants.getActionLinkSelectionColor());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void focusLost(FocusEvent e) {<NEW_LINE>comp.setOpaque(false);<NEW_LINE>// comp.setBackground(FlatWelcomeFrame.getMainBackground());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | getComponent(), JList.class); |
846,731 | protected void handle(final APIAttachBackupStorageToZoneMsg msg) {<NEW_LINE>final APIAttachBackupStorageToZoneEvent evt = new APIAttachBackupStorageToZoneEvent(msg.getId());<NEW_LINE>final BackupStorageVO svo = dbf.findByUuid(msg.getBackupStorageUuid(), BackupStorageVO.class);<NEW_LINE>String errStr = extpEmitter.preAttach(svo, msg.getZoneUuid());<NEW_LINE>if (errStr != null) {<NEW_LINE>evt.setError(err(BackupStorageErrors.ATTACH_ERROR, errStr));<NEW_LINE>bus.publish(evt);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>extpEmitter.beforeAttach(svo, msg.getZoneUuid());<NEW_LINE>attachHook(msg.getZoneUuid(), new Completion(msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success() {<NEW_LINE>BackupStorageZoneRefVO rvo = new BackupStorageZoneRefVO();<NEW_LINE>rvo.setBackupStorageUuid(svo.getUuid());<NEW_LINE>rvo.setZoneUuid(msg.getZoneUuid());<NEW_LINE>dbf.persist(rvo);<NEW_LINE>refreshVO();<NEW_LINE>extpEmitter.afterAttach(self, msg.getZoneUuid());<NEW_LINE>evt.setInventory(getSelfInventory());<NEW_LINE>logger.debug(String.format("successfully attached backup storage[uuid:%s, name:%s]", self.getUuid()<MASK><NEW_LINE>bus.publish(evt);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>logger.warn(errorCode.toString());<NEW_LINE>extpEmitter.failToAttach(svo, msg.getZoneUuid());<NEW_LINE>evt.setError(err(BackupStorageErrors.ATTACH_ERROR, errorCode, errorCode.getDetails()));<NEW_LINE>bus.publish(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | , self.getName())); |
348,191 | private void loadJweConfigOptions(Map<String, Object> props) {<NEW_LINE>keyManagementKeyAlgorithm = configUtils.getConfigAttribute(props, JwtUtils.CFG_KEY_KEY_MANAGEMENT_KEY_ALG);<NEW_LINE>contentEncryptionAlgorithm = configUtils.<MASK><NEW_LINE>keyManagementKeyAlias = configUtils.getConfigAttribute(props, JwtUtils.CFG_KEY_KEY_MANAGEMENT_KEY_ALIAS);<NEW_LINE>if (keyManagementKeyAlgorithm != null || contentEncryptionAlgorithm != null) {<NEW_LINE>if (keyManagementKeyAlias == null) {<NEW_LINE>Tr.warning(tc, "KEY_MANAGEMENT_KEY_ALIAS_MISSING", new Object[] { getId(), JwtUtils.CFG_KEY_KEY_MANAGEMENT_KEY_ALIAS, JwtUtils.CFG_KEY_KEY_MANAGEMENT_KEY_ALG, JwtUtils.CFG_KEY_CONTENT_ENCRYPTION_ALG });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getConfigAttribute(props, JwtUtils.CFG_KEY_CONTENT_ENCRYPTION_ALG); |
1,110,775 | private void init(AssetManager assetManager, int nbShadowMaps, int shadowMapSize) {<NEW_LINE>this.postshadowMat = new Material(assetManager, "Common/MatDefs/Shadow/PostShadow.j3md");<NEW_LINE>shadowFB = new FrameBuffer[nbShadowMaps];<NEW_LINE>shadowMaps = new Texture2D[nbShadowMaps];<NEW_LINE>dispPic = new Picture[nbShadowMaps];<NEW_LINE>lightViewProjectionsMatrices = new Matrix4f[nbShadowMaps];<NEW_LINE>shadowMapStringCache = new String[nbShadowMaps];<NEW_LINE>lightViewStringCache = new String[nbShadowMaps];<NEW_LINE>// DO NOT COMMENT THIS (It prevents the OSX incomplete read buffer crash.)<NEW_LINE>dummyTex = new Texture2D(<MASK><NEW_LINE>preshadowMat = new Material(assetManager, "Common/MatDefs/Shadow/PreShadow.j3md");<NEW_LINE>postshadowMat.setFloat("ShadowMapSize", shadowMapSize);<NEW_LINE>for (int i = 0; i < nbShadowMaps; i++) {<NEW_LINE>lightViewProjectionsMatrices[i] = new Matrix4f();<NEW_LINE>shadowFB[i] = new FrameBuffer(shadowMapSize, shadowMapSize, 1);<NEW_LINE>shadowMaps[i] = new Texture2D(shadowMapSize, shadowMapSize, Format.Depth);<NEW_LINE>shadowFB[i].setDepthTarget(FrameBufferTarget.newTarget(shadowMaps[i]));<NEW_LINE>// DO NOT COMMENT THIS (It prevents the OSX incomplete read buffer crash.)<NEW_LINE>shadowFB[i].addColorTarget(FrameBufferTarget.newTarget(dummyTex));<NEW_LINE>shadowMapStringCache[i] = "ShadowMap" + i;<NEW_LINE>lightViewStringCache[i] = "LightViewProjectionMatrix" + i;<NEW_LINE>postshadowMat.setTexture(shadowMapStringCache[i], shadowMaps[i]);<NEW_LINE>// quads for debugging purposes<NEW_LINE>dispPic[i] = new Picture("Picture" + i);<NEW_LINE>dispPic[i].setTexture(assetManager, shadowMaps[i], false);<NEW_LINE>}<NEW_LINE>setShadowCompareMode(shadowCompareMode);<NEW_LINE>setEdgeFilteringMode(edgeFilteringMode);<NEW_LINE>setShadowIntensity(shadowIntensity);<NEW_LINE>initForcedRenderState();<NEW_LINE>setRenderBackFacesShadows(isRenderBackFacesShadows());<NEW_LINE>} | shadowMapSize, shadowMapSize, Format.RGBA8); |
1,209,869 | public void marshall(LoadBalancerTlsCertificate loadBalancerTlsCertificate, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (loadBalancerTlsCertificate == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getSupportCode(), SUPPORTCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getLocation(), LOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getResourceType(), RESOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getLoadBalancerName(), LOADBALANCERNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getIsAttached(), ISATTACHED_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getDomainValidationRecords(), DOMAINVALIDATIONRECORDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getFailureReason(), FAILUREREASON_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getIssuedAt(), ISSUEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getIssuer(), ISSUER_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getKeyAlgorithm(), KEYALGORITHM_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getNotAfter(), NOTAFTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getNotBefore(), NOTBEFORE_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getRenewalSummary(), RENEWALSUMMARY_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getRevocationReason(), REVOCATIONREASON_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getRevokedAt(), REVOKEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getSerial(), SERIAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getSignatureAlgorithm(), SIGNATUREALGORITHM_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getSubject(), SUBJECT_BINDING);<NEW_LINE>protocolMarshaller.marshall(loadBalancerTlsCertificate.getSubjectAlternativeNames(), SUBJECTALTERNATIVENAMES_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | loadBalancerTlsCertificate.getDomainName(), DOMAINNAME_BINDING); |
1,067,675 | public void removeGroupMembers(String groupId, List<String> members, final IUIKitCallback<List<String>> callBack) {<NEW_LINE>if (members == null || members.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>V2TIMManager.getGroupManager().kickGroupMember(groupId, members, "", new V2TIMValueCallback<List<V2TIMGroupMemberOperationResult>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(int code, String desc) {<NEW_LINE>TUIGroupLog.e(TAG, "removeGroupMembers failed, code: " + code + "|desc: " + ErrorMessageConverter.convertIMError(code, desc));<NEW_LINE>callBack.onError(TAG, code, ErrorMessageConverter.convertIMError(code, desc));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(List<V2TIMGroupMemberOperationResult> v2TIMGroupMemberOperationResults) {<NEW_LINE>List<String> <MASK><NEW_LINE>for (int i = 0; i < v2TIMGroupMemberOperationResults.size(); i++) {<NEW_LINE>V2TIMGroupMemberOperationResult res = v2TIMGroupMemberOperationResults.get(i);<NEW_LINE>if (res.getResult() == V2TIMGroupMemberOperationResult.OPERATION_RESULT_SUCC) {<NEW_LINE>dels.add(res.getMemberID());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>callBack.onSuccess(dels);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | dels = new ArrayList<>(); |
806,544 | private boolean checkCoverage(double keyStart, double keyEnd, TreeMap<Double, Double> range) {<NEW_LINE>// range covered<NEW_LINE>AtomicReference<Double> previous = new AtomicReference<>();<NEW_LINE>AtomicReference<Double> toCheckStart <MASK><NEW_LINE>AtomicBoolean covered = new AtomicBoolean(true);<NEW_LINE>for (Map.Entry<Double, Double> entry : range.entrySet()) {<NEW_LINE>if (toCheckStart.get() >= keyEnd) {<NEW_LINE>covered.set(true);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (previous.get() == null) {<NEW_LINE>previous.set(entry.getValue());<NEW_LINE>if (keyStart < entry.getKey()) {<NEW_LINE>covered.set(false);<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>// we have atleast covered till "end" of this range.<NEW_LINE>toCheckStart.set(entry.getValue());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (previous.get() < entry.getKey()) {<NEW_LINE>// if this gap is part of range we are looking for then this cannot be covered.<NEW_LINE>if (StreamSegmentRecord.overlaps(new AbstractMap.SimpleEntry<>(previous.get(), entry.getKey()), new AbstractMap.SimpleEntry<>(toCheckStart.get(), keyEnd))) {<NEW_LINE>covered.set(false);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// move to check start to the end of the range.<NEW_LINE>toCheckStart.set(Math.max(previous.get(), entry.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>covered.compareAndSet(true, toCheckStart.get() >= keyEnd);<NEW_LINE>return covered.get();<NEW_LINE>} | = new AtomicReference<>(keyStart); |
1,480,194 | public void processMessage(final WebSocketMessage webSocketData) {<NEW_LINE>setDoTransactionNotifications(false);<NEW_LINE>final String mode = webSocketData.getNodeDataStringValue("mode");<NEW_LINE>final String favoritableId = webSocketData.getNodeDataStringValue("id");<NEW_LINE>final <MASK><NEW_LINE>if (mode == null) {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(422).message("Favorites Command: No mode given. Valid modes: add, remove").build(), true);<NEW_LINE>} else if (favoritableId == null) {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(422).message("Favorites Command: No favoritable id given").build(), true);<NEW_LINE>} else {<NEW_LINE>final App app = StructrApp.getInstance(webSocket.getSecurityContext());<NEW_LINE>try (final Tx tx = app.tx(true, true, true)) {<NEW_LINE>final Favoritable file = app.get(Favoritable.class, favoritableId);<NEW_LINE>if (file != null) {<NEW_LINE>final List<Favoritable> favorites = Iterables.toList(currentUser.getFavorites());<NEW_LINE>switch(mode) {<NEW_LINE>case "add":<NEW_LINE>{<NEW_LINE>favorites.add((Favoritable) file);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case "remove":<NEW_LINE>{<NEW_LINE>favorites.remove((Favoritable) file);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(422).message("Favorites Command: Invalid mode '" + mode + "'. Valid modes: add, remove").build(), true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>currentUser.setFavorites(favorites);<NEW_LINE>getWebSocket().send(MessageBuilder.finished().callback(callback).build(), true);<NEW_LINE>} else {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(422).message("Favorites Command: Favoritable with id '" + favoritableId + "'does not exist!").build(), true);<NEW_LINE>}<NEW_LINE>tx.success();<NEW_LINE>} catch (FrameworkException fex) {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(422).message("Favorites Command: Favoritable with id '" + favoritableId + "'does not exist!").build(), true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Principal currentUser = webSocket.getCurrentUser(); |
305,057 | private JPanel initBuckCellSection() {<NEW_LINE>JPanel panel = new JPanel(new BorderLayout());<NEW_LINE>panel.setBorder(IdeBorderFactory.createTitledBorder("Cells", true));<NEW_LINE>cellTableModel = new ListTableModel<>(CELL_NAME_COLUMN, ROOT_COLUMN, BUILD_FILENAME_COLUMN);<NEW_LINE>cellTableModel.setItems(buckCellSettingsProvider.getCells());<NEW_LINE>TableView<BuckCell> cellTable = new TableView<>(cellTableModel);<NEW_LINE>cellTable.setPreferredScrollableViewportSize(new Dimension(cellTable.getPreferredScrollableViewportSize().width, 8 * cellTable.getRowHeight()));<NEW_LINE>ToolbarDecorator decorator = ToolbarDecorator.createDecorator(cellTable).setAddAction((AnActionButton button) -> {<NEW_LINE>final FileChooserDescriptor dirChooser = FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle("Select root directory of buck cell");<NEW_LINE>Project project = buckProjectSettingsProvider.getProject();<NEW_LINE>FileChooser.chooseFile(dirChooser, project, BuckSettingsUI.this, project.getBaseDir(), file -> {<NEW_LINE>BuckCell buckCell = new BuckCell();<NEW_LINE>buckCell.setName(file.getName());<NEW_LINE>buckCell.setRoot(file.getPath());<NEW_LINE>cellTableModel.addRow(buckCell);<NEW_LINE>});<NEW_LINE>}).addExtraAction(new AnActionButton("Automatically discover cells", Actions.Find) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(AnActionEvent anActionEvent) {<NEW_LINE>discoverCells();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JBLabel label = new JBLabel("By default, commands take place in the topmost cell");<NEW_LINE>panel.<MASK><NEW_LINE>panel.add(decorator.createPanel(), BorderLayout.CENTER);<NEW_LINE>return panel;<NEW_LINE>} | add(label, BorderLayout.NORTH); |
424,899 | public final void onSubscribe(Subscription s) {<NEW_LINE>if (SubscriptionHelper.validate(this.upstream, s)) {<NEW_LINE>this.upstream = s;<NEW_LINE>if (s instanceof QueueSubscription) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>QueueSubscription<Nono> qs = (QueueSubscription<Nono>) s;<NEW_LINE>int m = qs.requestFusion(ANY);<NEW_LINE>if (m == SYNC) {<NEW_LINE>sourceMode = m;<NEW_LINE>queue = qs;<NEW_LINE>done = true;<NEW_LINE>downstream.onSubscribe(this);<NEW_LINE>drain();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (m == ASYNC) {<NEW_LINE>sourceMode = m;<NEW_LINE>queue = qs;<NEW_LINE>downstream.onSubscribe(this);<NEW_LINE>s.request(prefetch == Integer.MAX_VALUE ? Long.MAX_VALUE : prefetch);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (prefetch == Integer.MAX_VALUE) {<NEW_LINE>queue = new <MASK><NEW_LINE>downstream.onSubscribe(this);<NEW_LINE>s.request(Long.MAX_VALUE);<NEW_LINE>} else {<NEW_LINE>queue = new SpscArrayQueue<>(prefetch);<NEW_LINE>downstream.onSubscribe(this);<NEW_LINE>s.request(prefetch);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | SpscLinkedArrayQueue<>(bufferSize()); |
491,678 | public void decode(SearchHit hit, Supplier<Object> getter, BlockBuilder output) {<NEW_LINE><MASK><NEW_LINE>if (value == null) {<NEW_LINE>output.appendNull();<NEW_LINE>} else if (value instanceof Boolean) {<NEW_LINE>BOOLEAN.writeBoolean(output, (Boolean) value);<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>if (value.equals("true")) {<NEW_LINE>BOOLEAN.writeBoolean(output, true);<NEW_LINE>} else if (value.equals("false") || value.equals("")) {<NEW_LINE>BOOLEAN.writeBoolean(output, false);<NEW_LINE>} else {<NEW_LINE>throw new TrinoException(TYPE_MISMATCH, format("Cannot parse value for field '%s' as BOOLEAN: %s", path, value));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new TrinoException(TYPE_MISMATCH, format("Expected a boolean value for field %s of type BOOLEAN: %s [%s]", path, value, value.getClass().getSimpleName()));<NEW_LINE>}<NEW_LINE>} | Object value = getter.get(); |
1,211,064 | public boolean replace(String key, String oldValue, String newValue) {<NEW_LINE>Assert.notNull(key, KEY_MUST_NOT_BE_NULL);<NEW_LINE>Assert.notNull(oldValue, "'oldValue' must not be null.");<NEW_LINE><MASK><NEW_LINE>synchronized (this.updateMap) {<NEW_LINE>Stat currentStat = new Stat();<NEW_LINE>try {<NEW_LINE>byte[] bytes = this.client.getData().storingStatIn(currentStat).forPath(getPath(key));<NEW_LINE>if (oldValue.equals(IntegrationUtils.bytesToString(bytes, this.encoding))) {<NEW_LINE>updateNode(key, newValue, currentStat.getVersion());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (KeeperException.NoNodeException | KeeperException.BadVersionException e) {<NEW_LINE>// ignore, the node doesn't exist there's nothing to replace<NEW_LINE>return false;<NEW_LINE>}// ignore<NEW_LINE>catch (Exception e) {<NEW_LINE>throw new ZookeeperMetadataStoreException("Cannot replace value", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Assert.notNull(newValue, "'newValue' must not be null."); |
1,328,515 | private long pointCount(PointValues.PointTree pointTree, BiFunction<byte[], byte[], Relation> nodeComparator, Predicate<byte[]> leafComparator) throws IOException {<NEW_LINE>final int[] matchingNodeCount = { 0 };<NEW_LINE>// create a custom IntersectVisitor that records the number of leafNodes that matched<NEW_LINE>final IntersectVisitor visitor = new IntersectVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visit(int docID) {<NEW_LINE>// this branch should be unreachable<NEW_LINE>throw new UnsupportedOperationException("This IntersectVisitor does not perform any actions on a " + "docID=" + docID + " node being visited");<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visit(int docID, byte[] packedValue) {<NEW_LINE>if (leafComparator.test(packedValue)) {<NEW_LINE>matchingNodeCount[0]++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Relation compare(byte[] minPackedValue, byte[] maxPackedValue) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>pointCount(visitor, pointTree, matchingNodeCount);<NEW_LINE>return matchingNodeCount[0];<NEW_LINE>} | nodeComparator.apply(minPackedValue, maxPackedValue); |
365,794 | private void openFile() {<NEW_LINE>if (documentChanged) {<NEW_LINE>int ret = OptionPane.showConfirmDialog(parent, S.get("AsmPanDocumentChangedSave"), parent.getParentTitle(), OptionPane.YES_NO_OPTION);<NEW_LINE>if (ret == OptionPane.YES_OPTION) {<NEW_LINE>if (textFile == null) {<NEW_LINE>OptionPane.showMessageDialog(parent, S.get("AsmPanSaveFirstBeforeOpen"));<NEW_LINE>return;<NEW_LINE>} else<NEW_LINE>saveFile(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JFileChooser chooser = new JFileChooser();<NEW_LINE>FileNameExtensionFilter filter = new FileNameExtensionFilter(S.get("AsmPanAmsFileExtention"), "S", "asm");<NEW_LINE>chooser.setDialogTitle(parent.getParentTitle() + ": " + S.get("AsmPanReadAsmFile"));<NEW_LINE>chooser.setFileFilter(filter);<NEW_LINE>int ret = chooser.showOpenDialog(parent);<NEW_LINE>if (ret != JFileChooser.APPROVE_OPTION)<NEW_LINE>return;<NEW_LINE>textFile = chooser.getSelectedFile();<NEW_LINE>try {<NEW_LINE>BufferedReader reader = new BufferedReader(new FileReader(textFile));<NEW_LINE>StringBuilder s = new StringBuilder();<NEW_LINE>String st;<NEW_LINE>while ((st = reader.readLine()) != null) s.append<MASK><NEW_LINE>reader.close();<NEW_LINE>asmWindow.setText(s.toString());<NEW_LINE>} catch (IOException e) {<NEW_LINE>OptionPane.showMessageDialog(parent, S.get("AsmPanErrorReadingFile", textFile.getName()), parent.getParentTitle(), OptionPane.ERROR_MESSAGE);<NEW_LINE>textFile = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>asmWindow.setCaretPosition(0);<NEW_LINE>documentChanged = false;<NEW_LINE>assembler.reset();<NEW_LINE>if (!assembler.assemble()) {<NEW_LINE>asmWindow.setCaretPosition(assembler.getErrorPositions().get(0));<NEW_LINE>}<NEW_LINE>updateLineNumber();<NEW_LINE>} | (st).append("\n"); |
1,320,694 | private ClientCallback<ClientExchange> createReceiveCallback(final TransportRequest transportRequest, final URI url, final HttpHeaders headers, final XhrClientSockJsSession sockJsSession, final SettableListenableFuture<WebSocketSession> connectFuture) {<NEW_LINE>return new ClientCallback<>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void completed(final ClientExchange exchange) {<NEW_LINE>exchange.setResponseListener(new ClientCallback<ClientExchange>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void completed(ClientExchange result) {<NEW_LINE>ClientResponse response = result.getResponse();<NEW_LINE>if (response.getResponseCode() != 200) {<NEW_LINE>HttpStatusCode status = HttpStatusCode.valueOf(response.getResponseCode());<NEW_LINE>IoUtils.safeClose(result.getConnection());<NEW_LINE>onFailure(new HttpServerErrorException(status, "Unexpected XHR receive status"));<NEW_LINE>} else {<NEW_LINE>SockJsResponseListener listener = new SockJsResponseListener(transportRequest, result.getConnection(), <MASK><NEW_LINE>listener.setup(result.getResponseChannel());<NEW_LINE>}<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("XHR receive headers: " + toHttpHeaders(response.getResponseHeaders()));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>StreamSinkChannel channel = result.getRequestChannel();<NEW_LINE>channel.shutdownWrites();<NEW_LINE>if (!channel.flush()) {<NEW_LINE>channel.getWriteSetter().set(ChannelListeners.<StreamSinkChannel>flushingChannelListener(null, null));<NEW_LINE>channel.resumeWrites();<NEW_LINE>}<NEW_LINE>} catch (IOException exc) {<NEW_LINE>IoUtils.safeClose(result.getConnection());<NEW_LINE>onFailure(exc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void failed(IOException exc) {<NEW_LINE>IoUtils.safeClose(exchange.getConnection());<NEW_LINE>onFailure(exc);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void failed(IOException exc) {<NEW_LINE>onFailure(exc);<NEW_LINE>}<NEW_LINE><NEW_LINE>private void onFailure(Throwable failure) {<NEW_LINE>if (connectFuture.setException(failure)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (sockJsSession.isDisconnected()) {<NEW_LINE>sockJsSession.afterTransportClosed(null);<NEW_LINE>} else {<NEW_LINE>sockJsSession.handleTransportError(failure);<NEW_LINE>sockJsSession.afterTransportClosed(new CloseStatus(1006, failure.getMessage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | url, headers, sockJsSession, connectFuture); |
305,131 | private BIRNode.BIRFunction generateDefaultFunction(List<PackageID> imprtMods, BIRNode.BIRPackage pkg, String funcName, String initName) {<NEW_LINE>nextId = -1;<NEW_LINE>nextVarId = -1;<NEW_LINE>BIRNode.BIRVariableDcl retVar = new BIRNode.BIRVariableDcl(null, errorOrNilType, new Name("%ret"), VarScope.FUNCTION, VarKind.RETURN, "");<NEW_LINE>BIROperand retVarRef = new BIROperand(retVar);<NEW_LINE>BInvokableType funcType = new BInvokableType(Collections.emptyList(), null, errorOrNilType, null);<NEW_LINE>BIRNode.BIRFunction modInitFunc = new BIRNode.BIRFunction(null, new Name(funcName), 0, funcType, null, 0, VIRTUAL);<NEW_LINE>modInitFunc.localVars.add(retVar);<NEW_LINE>addAndGetNextBasicBlock(modInitFunc);<NEW_LINE>BIRNode.BIRVariableDcl boolVal = addAndGetNextVar(modInitFunc, symbolTable.booleanType);<NEW_LINE>BIROperand boolRef = new BIROperand(boolVal);<NEW_LINE>for (PackageID id : imprtMods) {<NEW_LINE>String initFuncName = MethodGenUtils.encodeModuleSpecialFuncName(initName);<NEW_LINE>addCheckedInvocation(modInitFunc, id, initFuncName, retVarRef, boolRef);<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>BIRNode.BIRBasicBlock lastBB = addCheckedInvocation(modInitFunc, pkg.packageID, currentInitFuncName, retVarRef, boolRef);<NEW_LINE>lastBB.terminator = new BIRTerminator.Return(null);<NEW_LINE>return modInitFunc;<NEW_LINE>} | currentInitFuncName = MethodGenUtils.encodeModuleSpecialFuncName(initName); |
708,006 | public String copyMail(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) {<NEW_LINE>String colName = mField.getColumnName();<NEW_LINE>log.info(colName + "=" + value);<NEW_LINE>if (value == null)<NEW_LINE>return "";<NEW_LINE>Integer R_MailText_ID = (Integer) value;<NEW_LINE>MMailText mailtext = new MMailText(ctx, R_MailText_ID.intValue(), null);<NEW_LINE>Integer userID = (Integer) mTab.getValue("AD_User_ID");<NEW_LINE>if (userID != null)<NEW_LINE>mailtext.setUser(userID.intValue());<NEW_LINE>Integer bpID = (Integer) mTab.getValue("C_BPartner_ID");<NEW_LINE>if (bpID != null)<NEW_LINE>mailtext.setBPartner(bpID.intValue());<NEW_LINE>String txt = mailtext.getMailText();<NEW_LINE>txt = Env.parseContext(ctx, WindowNo, txt, false, true);<NEW_LINE><MASK><NEW_LINE>return "";<NEW_LINE>} | mTab.setValue("Result", txt); |
912,650 | final DeleteApnsSandboxChannelResult executeDeleteApnsSandboxChannel(DeleteApnsSandboxChannelRequest deleteApnsSandboxChannelRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteApnsSandboxChannelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteApnsSandboxChannelRequest> request = null;<NEW_LINE>Response<DeleteApnsSandboxChannelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteApnsSandboxChannelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteApnsSandboxChannelRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Pinpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteApnsSandboxChannel");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteApnsSandboxChannelResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteApnsSandboxChannelResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
432,446 | public static <T> void pdist(T[] x, double[][] d, Distance<T> distance) {<NEW_LINE>int n = x.length;<NEW_LINE>if (d[0].length < n) {<NEW_LINE>IntStream.range(0, n).parallel().forEach(i -> {<NEW_LINE>T xi = x[i];<NEW_LINE>double[] di = d[i];<NEW_LINE>for (int j = 0; j < i; j++) {<NEW_LINE>di[j] = distance.d(xi, x[j]);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>IntStream.range(0, n).parallel().forEach(i -> {<NEW_LINE>T xi = x[i];<NEW_LINE>double<MASK><NEW_LINE>for (int j = 0; j < n; j++) {<NEW_LINE>di[j] = distance.d(xi, x[j]);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | [] di = d[i]; |
1,155,257 | public Tuple3<Boolean, Double, Map<String, String>>[] detect(MTable series, boolean detectLast) throws Exception {<NEW_LINE>double[] data = OutlierUtil.getNumericArray(series, selectedCol);<NEW_LINE>int length = data.length;<NEW_LINE>List<Double> listData = new ArrayList<>(length);<NEW_LINE>for (double v : data) {<NEW_LINE>if (Double.isNaN(v)) {<NEW_LINE>length -= 1;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>listData.add(v);<NEW_LINE>}<NEW_LINE>if (detectLast && length <= 4) {<NEW_LINE>return new Tuple3[] { Tuple3.of(false, null, null) };<NEW_LINE>}<NEW_LINE>if (length <= 3) {<NEW_LINE>Tuple3<Boolean, Double, Map<String, String>>[] results = new Tuple3[length];<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>results[i] = Tuple3.of(false, null, null);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}<NEW_LINE>double[] sortedData = new double[length];<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>sortedData[i] = listData.get(i);<NEW_LINE>}<NEW_LINE>Arrays.sort(sortedData);<NEW_LINE>final double Q1 = (sortedData[(int) Math.ceil(length * 0.25)] + sortedData[(int) Math.floor(length * 0.25)]) / 2;<NEW_LINE>final double Q3 = (sortedData[(int) Math.ceil(length * 0.75)] + sortedData[(int) Math.floor(length * 0.75)]) / 2;<NEW_LINE>final double IQR = Q3 - Q1;<NEW_LINE>int iStart = detectLast ? data.length - 1 : 0;<NEW_LINE>Tuple3<Boolean, Double, Map<String, String>>[] results = new Tuple3[data.length - iStart];<NEW_LINE>for (int i = iStart; i < data.length; i++) {<NEW_LINE>double outlier_score = ((data[i] < Q1) ? (data[i] - Q1) : (data[i] > Q3) ? data[i] - Q3 : 0.0) / IQR;<NEW_LINE>switch(direction) {<NEW_LINE>case BOTH:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case NEGATIVE:<NEW_LINE>outlier_score = -outlier_score;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (isPredDetail) {<NEW_LINE>results[i] = Tuple3.of(outlier_score > K, outlier_score, null);<NEW_LINE>} else {<NEW_LINE>results[i] = Tuple3.of(outlier_score > K, null, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | outlier_score = Math.abs(outlier_score); |
282,187 | private void internalPutIfAbsent(final byte[] key, final byte[] value, final CompletableFuture<byte[]> future, final int retriesLeft, final Errors lastCause) {<NEW_LINE>final Region region = this.pdClient.findRegionByKey(key, ErrorsHelper.isInvalidEpoch(lastCause));<NEW_LINE>final RegionEngine regionEngine = getRegionEngine(<MASK><NEW_LINE>final RetryRunner retryRunner = retryCause -> internalPutIfAbsent(key, value, future, retriesLeft - 1, retryCause);<NEW_LINE>final FailoverClosure<byte[]> closure = new FailoverClosureImpl<>(future, retriesLeft, retryRunner);<NEW_LINE>if (regionEngine != null) {<NEW_LINE>if (ensureOnValidEpoch(region, regionEngine, closure)) {<NEW_LINE>getRawKVStore(regionEngine).putIfAbsent(key, value, closure);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final PutIfAbsentRequest request = new PutIfAbsentRequest();<NEW_LINE>request.setKey(key);<NEW_LINE>request.setValue(value);<NEW_LINE>request.setRegionId(region.getId());<NEW_LINE>request.setRegionEpoch(region.getRegionEpoch());<NEW_LINE>this.rheaKVRpcService.callAsyncWithRpc(request, closure, lastCause);<NEW_LINE>}<NEW_LINE>} | region.getId(), true); |
1,821,690 | private CassandraOutputTableHandle createTable(ConnectorTableMetadata tableMetadata) {<NEW_LINE>ImmutableList.Builder<String> columnNames = ImmutableList.builder();<NEW_LINE>ImmutableList.Builder<Type<MASK><NEW_LINE>ImmutableList.Builder<ExtraColumnMetadata> columnExtra = ImmutableList.builder();<NEW_LINE>columnExtra.add(new ExtraColumnMetadata("id", true));<NEW_LINE>for (ColumnMetadata column : tableMetadata.getColumns()) {<NEW_LINE>columnNames.add(column.getName());<NEW_LINE>columnTypes.add(column.getType());<NEW_LINE>columnExtra.add(new ExtraColumnMetadata(column.getName(), column.isHidden()));<NEW_LINE>}<NEW_LINE>// get the root directory for the database<NEW_LINE>SchemaTableName table = tableMetadata.getTable();<NEW_LINE>String schemaName = cassandraSession.getCaseSensitiveSchemaName(table.getSchemaName());<NEW_LINE>String tableName = table.getTableName();<NEW_LINE>List<String> columns = columnNames.build();<NEW_LINE>List<Type> types = columnTypes.build();<NEW_LINE>StringBuilder queryBuilder = new StringBuilder(String.format("CREATE TABLE \"%s\".\"%s\"(id uuid primary key", schemaName, tableName));<NEW_LINE>for (int i = 0; i < columns.size(); i++) {<NEW_LINE>String name = columns.get(i);<NEW_LINE>Type type = types.get(i);<NEW_LINE>queryBuilder.append(", ").append(name).append(" ").append(toCassandraType(type, protocolVersion).name().toLowerCase(ENGLISH));<NEW_LINE>}<NEW_LINE>queryBuilder.append(") ");<NEW_LINE>// encode column ordering in the cassandra table comment field since there is no better place to store this<NEW_LINE>String columnMetadata = extraColumnMetadataCodec.toJson(columnExtra.build());<NEW_LINE>queryBuilder.append("WITH comment='").append(CassandraSession.PRESTO_COMMENT_METADATA).append(" ").append(columnMetadata).append("'");<NEW_LINE>// We need to create the Cassandra table before commit because the record needs to be written to the table.<NEW_LINE>cassandraSession.execute(queryBuilder.toString());<NEW_LINE>return new CassandraOutputTableHandle(connectorId, schemaName, tableName, columnNames.build(), columnTypes.build());<NEW_LINE>} | > columnTypes = ImmutableList.builder(); |
507,296 | private void chooseJITLog() {<NEW_LINE>FileChooser fc = new FileChooser();<NEW_LINE>fc.setTitle("Choose JIT log file");<NEW_LINE>String osNameProperty = System.getProperty("os.name");<NEW_LINE>// don't use ExtensionFilter on OSX due to JavaFX2 missing combo bug<NEW_LINE>if (osNameProperty != null && !osNameProperty.toLowerCase().contains("mac")) {<NEW_LINE>fc.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("Log Files", "*.log"), new FileChooser.ExtensionFilter("All Files", "*.*"));<NEW_LINE>}<NEW_LINE>String searchDir = getConfig().getLastLogDir();<NEW_LINE>if (searchDir == null) {<NEW_LINE>searchDir = System.getProperty("user.dir");<NEW_LINE>}<NEW_LINE>File dirFile = new File(searchDir);<NEW_LINE>if (!dirFile.exists() || !dirFile.isDirectory()) {<NEW_LINE>dirFile = new File(System.getProperty("user.dir"));<NEW_LINE>}<NEW_LINE>fc.setInitialDirectory(dirFile);<NEW_LINE>File <MASK><NEW_LINE>if (result != null) {<NEW_LINE>setJITLogFile(result);<NEW_LINE>JITWatchConfig config = getConfig();<NEW_LINE>if (JITWatchConstants.S_PROFILE_SANDBOX.equals(config.getProfileName())) {<NEW_LINE>logParser.getConfig().switchFromSandbox();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | result = fc.showOpenDialog(stage); |
1,854,168 | public DataSource createDataSource(Configuration dbConfig) throws PropertyVetoException, SQLException {<NEW_LINE>HikariDataSource ds = new HikariDataSource();<NEW_LINE>ds.setDriverClassName(dbConfig.getProperty("db.driver"));<NEW_LINE>ds.setJdbcUrl(dbConfig.getProperty("db.url"));<NEW_LINE>ds.setUsername(dbConfig.getProperty("db.user"));<NEW_LINE>ds.setPassword(dbConfig.getProperty("db.pass"));<NEW_LINE>ds.setAutoCommit(false);<NEW_LINE>ds.setConnectionTimeout(parseLong(dbConfig.getProperty("db.pool.timeout", "5000")));<NEW_LINE>ds.setMaximumPoolSize(parseInt(dbConfig.getProperty("db.pool.maxSize", "30")));<NEW_LINE>ds.setMinimumIdle(parseInt(dbConfig.getProperty("db.pool.minSize", "1")));<NEW_LINE>// NB! Now in milliseconds<NEW_LINE>ds.setIdleTimeout(parseLong(dbConfig.getProperty("db.pool.maxIdleTime", "0")));<NEW_LINE>ds.setLeakDetectionThreshold(parseLong(dbConfig.getProperty("db.pool.unreturnedConnectionTimeout", "0")));<NEW_LINE>ds.setValidationTimeout(parseLong(dbConfig.getProperty("db.pool.validationTimeout", "5000")));<NEW_LINE>// in seconds<NEW_LINE>ds.setLoginTimeout(parseInt(dbConfig.<MASK><NEW_LINE>// in ms<NEW_LINE>ds.setMaxLifetime(parseLong(dbConfig.getProperty("db.pool.maxConnectionAge", "0")));<NEW_LINE>if (dbConfig.getProperty("db.pool.connectionInitSql") != null) {<NEW_LINE>ds.setConnectionInitSql(dbConfig.getProperty("db.pool.connectionInitSql"));<NEW_LINE>}<NEW_LINE>// not used in HikariCP:<NEW_LINE>// db.pool.initialSize<NEW_LINE>// db.pool.idleConnectionTestPeriod<NEW_LINE>// db.pool.maxIdleTimeExcessConnections<NEW_LINE>// db.pool.acquireIncrement - HikariCP opens connections one at a time, as needed<NEW_LINE>// db.pool.cache.statements - HikariCP does not offer statement caching<NEW_LINE>// db.pool.idle.testInterval - HikariCP tests connections when they're leased, not on a timer<NEW_LINE>// db.pool.connection.threshold - HikariCP doesn't have a percentile idle threshold; db.pool.size.idle can be used to keep a fixed number of connections idle<NEW_LINE>// db.pool.threads - HikariCP does not use extra threads to "aid" connection release<NEW_LINE>// db.pool.maxStatements - HikariCP does not offer PreparedStatement caching<NEW_LINE>// db.pool.maxStatementsPerConnection - HikariCP does not offer PreparedStatement caching<NEW_LINE>// I could not find an analogue for HikariCP:<NEW_LINE>// ds.setAcquireRetryAttempts(parseInt(dbConfig.getProperty("db.pool.acquireRetryAttempts", "10")));<NEW_LINE>// ds.setAcquireRetryDelay(parseInt(dbConfig.getProperty("db.pool.acquireRetryDelay", "1000")));<NEW_LINE>// ds.setBreakAfterAcquireFailure(Boolean.parseBoolean(dbConfig.getProperty("db.pool.breakAfterAcquireFailure", "false")));<NEW_LINE>// ds.setTestConnectionOnCheckin(Boolean.parseBoolean(dbConfig.getProperty("db.pool.testConnectionOnCheckin", "true")));<NEW_LINE>// ds.setTestConnectionOnCheckout(Boolean.parseBoolean(dbConfig.getProperty("db.pool.testConnectionOnCheckout", "false")));<NEW_LINE>// ds.setMaxAdministrativeTaskTime(parseInt(dbConfig.getProperty("db.pool.maxAdministrativeTaskTime", "0")));<NEW_LINE>// ds.setNumHelperThreads(parseInt(dbConfig.getProperty("db.pool.numHelperThreads", "3")));<NEW_LINE>// ds.setDebugUnreturnedConnectionStackTraces(Boolean.parseBoolean(dbConfig.getProperty("db.pool.debugUnreturnedConnectionStackTraces", "false")));<NEW_LINE>// ds.setContextClassLoaderSource("library");<NEW_LINE>// ds.setPrivilegeSpawnedThreads(true);<NEW_LINE>if (dbConfig.getProperty("db.testquery") != null) {<NEW_LINE>ds.setConnectionTestQuery(dbConfig.getProperty("db.testquery"));<NEW_LINE>} else {<NEW_LINE>String driverClass = dbConfig.getProperty("db.driver");<NEW_LINE>if (driverClass.equals("com.mysql.jdbc.Driver")) {<NEW_LINE>ds.setConnectionTestQuery("/* ping */ SELECT 1");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// This check is not required, but here to make it clear that nothing changes for people<NEW_LINE>// that don't set this configuration property. It may be safely removed.<NEW_LINE>if (dbConfig.getProperty("db.isolation") != null) {<NEW_LINE>// TODO not yet migrated from c3p0 to Hikari CP:<NEW_LINE>// ds.setConnectionCustomizerClassName(PlayConnectionCustomizer.class.getName());<NEW_LINE>}<NEW_LINE>return ds;<NEW_LINE>} | getProperty("db.pool.loginTimeout", "0"))); |
1,371,075 | public void analyze(Analyzer analyzer) throws UserException {<NEW_LINE>super.analyze(analyzer);<NEW_LINE>for (LockTable lockTable : lockTables) {<NEW_LINE>String dbName = lockTable.getTableName().getDb();<NEW_LINE>String tableName = lockTable.getTableName().getTbl();<NEW_LINE>if (Strings.isNullOrEmpty(dbName)) {<NEW_LINE>dbName = analyzer.getDefaultDb();<NEW_LINE>} else {<NEW_LINE>dbName = ClusterNamespace.getFullName(analyzer.getClusterName(), dbName);<NEW_LINE>}<NEW_LINE>if (Strings.isNullOrEmpty(dbName)) {<NEW_LINE>ErrorReport.reportAnalysisException(ErrorCode.ERR_NO_DB_ERROR);<NEW_LINE>}<NEW_LINE>if (Strings.isNullOrEmpty(tableName)) {<NEW_LINE>ErrorReport.reportAnalysisException(ErrorCode.ERR_UNKNOWN_TABLE, tableName, dbName);<NEW_LINE>}<NEW_LINE>Database db = analyzer.<MASK><NEW_LINE>Table table = db.getTableOrAnalysisException(tableName);<NEW_LINE>// check auth<NEW_LINE>if (!Catalog.getCurrentCatalog().getAuth().checkTblPriv(ConnectContext.get(), dbName, tableName, PrivPredicate.SELECT)) {<NEW_LINE>ErrorReport.reportAnalysisException(ErrorCode.ERR_TABLEACCESS_DENIED_ERROR, "SELECT", ConnectContext.get().getQualifiedUser(), ConnectContext.get().getRemoteIP(), dbName + ": " + tableName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getCatalog().getDbOrAnalysisException(dbName); |
970,512 | public static // Generate a diagram based on a graphviz DOT diagram description.<NEW_LINE>InputStream createDiagram(String dot) {<NEW_LINE>if (dot == null || dot.isEmpty()) {<NEW_LINE>throw new NullPointerException("syntax: no graphviz definition provided");<NEW_LINE>}<NEW_LINE>// Adds a watermark to the dot graphic.<NEW_LINE>List<String> args <MASK><NEW_LINE>args.add("/usr/bin/dot");<NEW_LINE>args.add("-Glabel=\"Made on Cloud Run\"");<NEW_LINE>args.add("-Gfontsize=10");<NEW_LINE>args.add("-Glabeljust=right");<NEW_LINE>args.add("-Glabelloc=bottom");<NEW_LINE>args.add("-Gfontcolor=gray");<NEW_LINE>args.add("-Tpng");<NEW_LINE>StringBuilder output = new StringBuilder();<NEW_LINE>InputStream stdout = null;<NEW_LINE>try {<NEW_LINE>ProcessBuilder pb = new ProcessBuilder(args);<NEW_LINE>Process process = pb.start();<NEW_LINE>OutputStream stdin = process.getOutputStream();<NEW_LINE>stdout = process.getInputStream();<NEW_LINE>// The Graphviz dot program reads from stdin.<NEW_LINE>Writer writer = new OutputStreamWriter(stdin, "UTF-8");<NEW_LINE>writer.write(dot);<NEW_LINE>writer.close();<NEW_LINE>process.waitFor();<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.out.println(e);<NEW_LINE>}<NEW_LINE>return stdout;<NEW_LINE>} | = new ArrayList<String>(); |
1,717,001 | private void addCurrentRequests() {<NEW_LINE>addParagraphTitle(getString("Requetes_en_cours"), "hourglass.png");<NEW_LINE>final Map<JavaInformations, List<CounterRequestContext>> currentRequests = getRemoteCollector().getCurrentRequests();<NEW_LINE>if (currentRequests.isEmpty()) {<NEW_LINE>add(new JLabel(' ' + getString("Aucune_requete_en_cours")));<NEW_LINE>} else {<NEW_LINE>for (final Map.Entry<JavaInformations, List<CounterRequestContext>> entry : currentRequests.entrySet()) {<NEW_LINE>final JavaInformations javaInformations = entry.getKey();<NEW_LINE>final List<CounterRequestContext> contexts = entry.getValue();<NEW_LINE>final CounterRequestContextPanel firstContextPanel = new CounterRequestContextPanel(getRemoteCollector(), contexts.subList<MASK><NEW_LINE>add(firstContextPanel);<NEW_LINE>final MButton detailsButton = new MButton(getString(DETAILS_KEY), PLUS_ICON);<NEW_LINE>final JPanel detailsPanel = firstContextPanel.createDetailsPanel(contexts, detailsButton);<NEW_LINE>detailsButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>detailsPanel.setVisible(!detailsPanel.isVisible());<NEW_LINE>detailsPanel.validate();<NEW_LINE>changePlusMinusIcon(detailsButton);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>detailsPanel.setVisible(false);<NEW_LINE>add(detailsPanel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (0, 1), javaInformations); |
1,194,812 | public NetworkFirewallUnexpectedGatewayRoutesViolation unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>NetworkFirewallUnexpectedGatewayRoutesViolation networkFirewallUnexpectedGatewayRoutesViolation = new NetworkFirewallUnexpectedGatewayRoutesViolation();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("GatewayId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>networkFirewallUnexpectedGatewayRoutesViolation.setGatewayId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ViolatingRoutes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>networkFirewallUnexpectedGatewayRoutesViolation.setViolatingRoutes(new ListUnmarshaller<Route>(RouteJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RouteTableId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>networkFirewallUnexpectedGatewayRoutesViolation.setRouteTableId(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("VpcId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>networkFirewallUnexpectedGatewayRoutesViolation.setVpcId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return networkFirewallUnexpectedGatewayRoutesViolation;<NEW_LINE>} | class).unmarshall(context)); |
1,491,666 | private final void openStandardInfoWindow(final ActionEvent e) {<NEW_LINE>final String actionCommand = e.getActionCommand();<NEW_LINE>if (Check.isEmpty(actionCommand, true)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final IUserRolePermissions role = getUserRolePermissions();<NEW_LINE>final JFrame parentFrame = getParentFrame();<NEW_LINE>final int windowNo = getParentWindowNo();<NEW_LINE>if (actionCommand.equals(InfoBuilder.ACTION_InfoProduct) && role.hasPermission(IUserRolePermissions.PERMISSION_InfoWindow_Product)) {<NEW_LINE>InfoBuilder.showProduct(parentFrame, windowNo);<NEW_LINE>} else if (actionCommand.equals(InfoBuilder.ACTION_InfoBPartner) && role.hasPermission(IUserRolePermissions.PERMISSION_InfoWindow_BPartner)) {<NEW_LINE><MASK><NEW_LINE>} else if (actionCommand.equals(InfoBuilder.ACTION_InfoAsset) && role.hasPermission(IUserRolePermissions.PERMISSION_InfoWindow_Asset)) {<NEW_LINE>InfoBuilder.showAsset(parentFrame, windowNo);<NEW_LINE>} else if (actionCommand.equals(InfoBuilder.ACTION_InfoSchedule) && role.hasPermission(IUserRolePermissions.PERMISSION_InfoWindow_Schedule)) {<NEW_LINE>new org.compiere.apps.search.InfoSchedule(parentFrame, null, false);<NEW_LINE>} else // FR [ 1966328 ]<NEW_LINE>if (actionCommand.equals(InfoBuilder.ACTION_InfoMRP) && role.hasPermission(IUserRolePermissions.PERMISSION_InfoWindow_MRP)) {<NEW_LINE>final int m_menu_id = MMenu.getMenu_ID("MRP Info");<NEW_LINE>final AMenu menu = AEnv.getAMenu();<NEW_LINE>// async load<NEW_LINE>AMenuStartItem.startMenuItemById(m_menu_id, Services.get(IMsgBL.class).translate(Env.getCtx(), "MRP Info"), menu);<NEW_LINE>} else if (actionCommand.equals(InfoBuilder.ACTION_InfoCRP) && role.hasPermission(IUserRolePermissions.PERMISSION_InfoWindow_CRP)) {<NEW_LINE>final int m_menu_id = MMenu.getMenu_ID("CRP Info");<NEW_LINE>final AMenu menu = AEnv.getAMenu();<NEW_LINE>// async load<NEW_LINE>AMenuStartItem.startMenuItemById(m_menu_id, Services.get(IMsgBL.class).translate(Env.getCtx(), "CRP Info"), menu);<NEW_LINE>} else if (actionCommand.equals(InfoBuilder.ACTION_InfoOrder) && role.hasPermission(IUserRolePermissions.PERMISSION_InfoWindow_Order)) {<NEW_LINE>InfoBuilder.showOrder(parentFrame, windowNo, "");<NEW_LINE>} else if (actionCommand.equals(InfoBuilder.ACTION_InfoInvoice) && role.hasPermission(IUserRolePermissions.PERMISSION_InfoWindow_Invoice)) {<NEW_LINE>InfoBuilder.showInvoice(parentFrame, windowNo, "");<NEW_LINE>} else if (actionCommand.equals(InfoBuilder.ACTION_InfoInOut) && role.hasPermission(IUserRolePermissions.PERMISSION_InfoWindow_InOut)) {<NEW_LINE>InfoBuilder.showInOut(parentFrame, windowNo, "");<NEW_LINE>} else if (actionCommand.equals(InfoBuilder.ACTION_InfoPayment) && role.hasPermission(IUserRolePermissions.PERMISSION_InfoWindow_Payment)) {<NEW_LINE>InfoBuilder.showPayment(parentFrame, windowNo, "");<NEW_LINE>} else if (actionCommand.equals(InfoBuilder.ACTION_InfoCashLine) && role.hasPermission(IUserRolePermissions.PERMISSION_InfoWindow_CashJournal)) {<NEW_LINE>InfoBuilder.showCashLine(parentFrame, windowNo, "");<NEW_LINE>} else if (actionCommand.equals(InfoBuilder.ACTION_InfoAssignment) && role.hasPermission(IUserRolePermissions.PERMISSION_InfoWindow_Resource)) {<NEW_LINE>InfoBuilder.showAssignment(parentFrame, windowNo, "");<NEW_LINE>}<NEW_LINE>} | InfoBuilder.showBPartner(parentFrame, windowNo); |
81,940 | private void updateHeaders() {<NEW_LINE>Bundle b = new Bundle();<NEW_LINE>int screenNo = 0;<NEW_LINE>for (List<Pair<Pair<Scope, Dimension>, Formatter.Format>> screen : screens) {<NEW_LINE>int itemNo = 0;<NEW_LINE>String itemPrefix = screenNo + ".";<NEW_LINE>for (Pair<Pair<Scope, Dimension>, Formatter.Format> item : screen) {<NEW_LINE>b.putString(Wear.RunInfo.HEADER + itemPrefix + itemNo, context.getString(item.first.second.getTextId()));<NEW_LINE>itemNo++;<NEW_LINE>}<NEW_LINE>screenNo++;<NEW_LINE>}<NEW_LINE>pauseStep = false;<NEW_LINE>if (currentStep != null && currentStep.isPauseStep()) {<NEW_LINE>pauseStep = true;<NEW_LINE>b.putBoolean(Wear.RunInfo.PAUSE_STEP, true);<NEW_LINE>}<NEW_LINE>b.putIntegerArrayList(Wear.RunInfo.SCREENS, screenSizes);<NEW_LINE>// 5 seconds<NEW_LINE>b.putInt(<MASK><NEW_LINE>setData(Wear.Path.HEADERS, b);<NEW_LINE>} | Wear.RunInfo.SCROLL, 5); |
316,214 | private Intent createOpenFileIntent(OCFile file) {<NEW_LINE><MASK><NEW_LINE>Uri fileUri = getFileUri(file, MainApp.getAppContext().getResources().getStringArray(R.array.ms_office_extensions));<NEW_LINE>Intent openFileWithIntent = null;<NEW_LINE>int lastIndexOfDot = storagePath.lastIndexOf('.');<NEW_LINE>if (lastIndexOfDot >= 0) {<NEW_LINE>String fileExt = storagePath.substring(lastIndexOfDot + 1);<NEW_LINE>String guessedMimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExt);<NEW_LINE>if (guessedMimeType != null) {<NEW_LINE>openFileWithIntent = new Intent(Intent.ACTION_VIEW);<NEW_LINE>openFileWithIntent.setDataAndType(fileUri, guessedMimeType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (openFileWithIntent == null) {<NEW_LINE>openFileWithIntent = createIntentFromFile(storagePath);<NEW_LINE>}<NEW_LINE>if (openFileWithIntent == null) {<NEW_LINE>openFileWithIntent = new Intent(Intent.ACTION_VIEW);<NEW_LINE>openFileWithIntent.setDataAndType(fileUri, file.getMimeType());<NEW_LINE>}<NEW_LINE>openFileWithIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);<NEW_LINE>return openFileWithIntent;<NEW_LINE>} | String storagePath = file.getStoragePath(); |
1,638,130 | // Invokes the 9 relational predicates of Line vs Line.<NEW_LINE>private boolean lineLinePredicates_(int half_edge, int id_a, int id_b) {<NEW_LINE>boolean bRelationKnown = true;<NEW_LINE>if (m_perform_predicates[MatrixPredicate.InteriorInterior]) {<NEW_LINE>interiorLineInteriorLine_(half_edge, id_a, id_b, m_cluster_index_a, m_cluster_index_b);<NEW_LINE>bRelationKnown &= isPredicateKnown_(MatrixPredicate.InteriorInterior);<NEW_LINE>}<NEW_LINE>if (m_perform_predicates[MatrixPredicate.InteriorBoundary]) {<NEW_LINE>interiorLineBoundaryLine_(half_edge, id_a, id_b, m_cluster_index_a, m_cluster_index_b, MatrixPredicate.InteriorBoundary);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (m_perform_predicates[MatrixPredicate.InteriorExterior]) {<NEW_LINE>interiorLineExteriorLine_(half_edge, id_a, id_b, MatrixPredicate.InteriorExterior);<NEW_LINE>bRelationKnown &= isPredicateKnown_(MatrixPredicate.InteriorExterior);<NEW_LINE>}<NEW_LINE>if (m_perform_predicates[MatrixPredicate.BoundaryInterior]) {<NEW_LINE>interiorLineBoundaryLine_(half_edge, id_b, id_a, m_cluster_index_b, m_cluster_index_a, MatrixPredicate.BoundaryInterior);<NEW_LINE>bRelationKnown &= isPredicateKnown_(MatrixPredicate.BoundaryInterior);<NEW_LINE>}<NEW_LINE>if (m_perform_predicates[MatrixPredicate.BoundaryBoundary]) {<NEW_LINE>boundaryLineBoundaryLine_(half_edge, id_a, id_b, m_cluster_index_a, m_cluster_index_b);<NEW_LINE>bRelationKnown &= isPredicateKnown_(MatrixPredicate.BoundaryBoundary);<NEW_LINE>}<NEW_LINE>if (m_perform_predicates[MatrixPredicate.BoundaryExterior]) {<NEW_LINE>boundaryLineExteriorLine_(half_edge, id_a, id_b, m_cluster_index_a, MatrixPredicate.BoundaryExterior);<NEW_LINE>bRelationKnown &= isPredicateKnown_(MatrixPredicate.BoundaryExterior);<NEW_LINE>}<NEW_LINE>if (m_perform_predicates[MatrixPredicate.ExteriorInterior]) {<NEW_LINE>interiorLineExteriorLine_(half_edge, id_b, id_a, MatrixPredicate.ExteriorInterior);<NEW_LINE>bRelationKnown &= isPredicateKnown_(MatrixPredicate.ExteriorInterior);<NEW_LINE>}<NEW_LINE>if (m_perform_predicates[MatrixPredicate.ExteriorBoundary]) {<NEW_LINE>boundaryLineExteriorLine_(half_edge, id_b, id_a, m_cluster_index_b, MatrixPredicate.ExteriorBoundary);<NEW_LINE>bRelationKnown &= isPredicateKnown_(MatrixPredicate.ExteriorBoundary);<NEW_LINE>}<NEW_LINE>return bRelationKnown;<NEW_LINE>} | bRelationKnown &= isPredicateKnown_(MatrixPredicate.InteriorBoundary); |
1,196,918 | protected Result doInBackground(byte[]... params) {<NEW_LINE>final QRCodeReaderView view = viewRef.get();<NEW_LINE>if (view == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final PlanarYUVLuminanceSource source = view.mCameraManager.buildLuminanceSource(params[0], view.mPreviewWidth, view.mPreviewHeight);<NEW_LINE>final HybridBinarizer hybBin = new HybridBinarizer(source);<NEW_LINE>final <MASK><NEW_LINE>try {<NEW_LINE>return view.mQRCodeReader.decode(bitmap, hintsRef.get());<NEW_LINE>} catch (ChecksumException e) {<NEW_LINE>SimpleLog.d(TAG, "ChecksumException", e);<NEW_LINE>} catch (NotFoundException e) {<NEW_LINE>SimpleLog.d(TAG, "No QR Code found");<NEW_LINE>} catch (FormatException e) {<NEW_LINE>SimpleLog.d(TAG, "FormatException", e);<NEW_LINE>} finally {<NEW_LINE>view.mQRCodeReader.reset();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | BinaryBitmap bitmap = new BinaryBitmap(hybBin); |
551,651 | private void loadNode67() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfiguration_CertificateGroups_DefaultApplicationGroup_TrustList_Read_OutputArguments, new QualifiedName(0, "OutputArguments"), new LocalizedText("en", "OutputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultApplicationGroup_TrustList_Read_OutputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultApplicationGroup_TrustList_Read_OutputArguments, Identifiers.HasProperty, Identifiers.ServerConfiguration_CertificateGroups_DefaultApplicationGroup_TrustList_Read.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>Data</Name><DataType><Identifier>i=15</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE><MASK><NEW_LINE>} | this.nodeManager.addNode(node); |
1,327,288 | protected void populateShell() {<NEW_LINE>shell.setText(title);<NEW_LINE>shell.setLayout(formLayout(10, 10, 15));<NEW_LINE>Label iconLabel = new Label(shell, SWT.ICON);<NEW_LINE>iconLabel.setLayoutData(formData(new FormAttachment(0), null, new FormAttachment(0), null));<NEW_LINE>iconLabel.setImage(shell.getImage());<NEW_LINE>Label titleLabel = new Label(shell, SWT.NONE);<NEW_LINE>FontData sysFontData = shell.getFont().getFontData()[0];<NEW_LINE>titleLabel.setLayoutData(formData(new FormAttachment(iconLabel), null, new FormAttachment(0), null));<NEW_LINE>titleLabel.setFont(new Font(null, sysFontData.getName(), sysFontData.getHeight() + 3, sysFontData.getStyle() | SWT.BOLD));<NEW_LINE>titleLabel.addDisposeListener(e -> titleLabel.getFont().dispose());<NEW_LINE>titleLabel.setText(title2);<NEW_LINE>Text statsText = new Text(shell, SWT.MULTI | SWT.READ_ONLY);<NEW_LINE>statsText.setBackground(shell.getBackground());<NEW_LINE>statsText.setLayoutData(formData(new FormAttachment(iconLabel), new FormAttachment(100, -20), new FormAttachment(titleLabel), null));<NEW_LINE>statsText.setText(message);<NEW_LINE>statsText.pack();<NEW_LINE>Button button = createCloseButton();<NEW_LINE>Point buttonSize = button.getSize();<NEW_LINE>button.setLayoutData(formData(buttonSize.x, buttonSize.y, null, new FormAttachment(100), new FormAttachment(statsText, 0, <MASK><NEW_LINE>shell.pack();<NEW_LINE>} | SWT.BOTTOM), null)); |
699,097 | private void loadData(@NonNull final KPIDataResult.Builder data, @NonNull final TimeRange timeRange) {<NEW_LINE>logger.trace("Loading data for {}", timeRange);<NEW_LINE>//<NEW_LINE>// Create query evaluation context<NEW_LINE>final Evaluatee evalCtx = // Fallback to user context<NEW_LINE>Evaluatees.mapBuilder().put("MainFromMillis", toESQueryString(data.getRange().getFrom())).put("MainToMillis", toESQueryString(data.getRange().getTo())).put("FromMillis", toESQueryString(timeRange.getFrom())).put("ToMillis", toESQueryString(timeRange.getTo())).build().andComposeWith(Evaluatees.ofCtx(Env.getCtx()));<NEW_LINE>//<NEW_LINE>// Resolve esQuery's variables<NEW_LINE>final IStringExpression esQuery = datasourceDescriptor.getEsQuery();<NEW_LINE>final String esQueryParsed = esQuery.evaluate(evalCtx, OnVariableNotFound.Preserve);<NEW_LINE>//<NEW_LINE>// Execute the query<NEW_LINE>final SearchResponse response;<NEW_LINE>try {<NEW_LINE>logger.trace("Executing: \n{}", esQueryParsed);<NEW_LINE>final SearchRequest searchRequest = new SearchRequest().indices(datasourceDescriptor.getEsSearchIndex()).searchType(datasourceDescriptor.getEsSearchTypes()).source(toSearchSourceBuilder(esQueryParsed));<NEW_LINE>response = elasticsearchClient.search(searchRequest, RequestOptions.DEFAULT);<NEW_LINE>logger.trace("Got response: \n{}", response);<NEW_LINE>} catch (final NoNodeAvailableException | java.net.ConnectException e) {<NEW_LINE>// elastic search transport error => nothing to do about it<NEW_LINE>throw new AdempiereException("Cannot connect to elasticsearch node." + "\nIf you want to disable the elasticsearch system then you can set system property or sysconfig `" + ESSystem.SYSCONFIG_elastic_enable + "` to `N`.", e);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new AdempiereException("Failed executing query for " + this + ": " + e.getLocalizedMessage() + "\n KPI: " + <MASK><NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Fetch data<NEW_LINE>try {<NEW_LINE>final List<Aggregation> aggregations = response.getAggregations().asList();<NEW_LINE>for (final Aggregation agg : aggregations) {<NEW_LINE>if (agg instanceof NumericMetricsAggregation.SingleValue) {<NEW_LINE>loadDataFromSingleValue(data, (NumericMetricsAggregation.SingleValue) agg);<NEW_LINE>} else if (agg instanceof MultiBucketsAggregation) {<NEW_LINE>loadDataFromMultiBucketsAggregation(data, timeRange, (MultiBucketsAggregation) agg);<NEW_LINE>} else {<NEW_LINE>// noinspection ThrowableNotThrown<NEW_LINE>new AdempiereException("Aggregation type not supported: " + agg.getClass()).throwIfDeveloperModeOrLogWarningElse(logger);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new AdempiereException("Failed fetching data from elasticsearch response" + "\n KPI: " + kpi + "\n Query: " + esQueryParsed + "\n Response: " + response, e);<NEW_LINE>}<NEW_LINE>} | kpi + "\n Query: " + esQueryParsed, e); |
1,551,786 | void populateCommonInterfaceProperties(InterfacesInterface vsIface, org.batfish.datamodel.Interface viIface) {<NEW_LINE>// addresses<NEW_LINE>if (!vsIface.getAddresses().isEmpty()) {<NEW_LINE>List<ConcreteInterfaceAddress> addresses = vsIface.getAddresses();<NEW_LINE>ImmutableList.Builder<ConcreteInterfaceAddress> ownedAddressesBuilder = ImmutableList.builder();<NEW_LINE>String vrf = firstNonNull(vsIface.getVrf(), DEFAULT_VRF_NAME);<NEW_LINE>for (ConcreteInterfaceAddress address : addresses) {<NEW_LINE>Prefix prefix = address.getPrefix();<NEW_LINE>if (ownedPrefixesByVrf().containsEntry(vrf, prefix)) {<NEW_LINE>viIface.setAdditionalArpIps(AclIpSpace.union(viIface.getAdditionalArpIps(), address.getIp<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ownedPrefixesByVrf().put(vrf, prefix);<NEW_LINE>ownedAddressesBuilder.add(address);<NEW_LINE>}<NEW_LINE>List<ConcreteInterfaceAddress> ownedAddresses = ownedAddressesBuilder.build();<NEW_LINE>if (!ownedAddresses.isEmpty()) {<NEW_LINE>viIface.setAddress(ownedAddresses.get(0));<NEW_LINE>viIface.setAllAddresses(ownedAddresses);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// description<NEW_LINE>viIface.setDescription(vsIface.getDescription());<NEW_LINE>// mtu<NEW_LINE>if (vsIface.getMtu() != null) {<NEW_LINE>viIface.setMtu(vsIface.getMtu());<NEW_LINE>}<NEW_LINE>// speed<NEW_LINE>if (vsIface.getLinkSpeed() != null) {<NEW_LINE>double speed = vsIface.getLinkSpeed() * SPEED_CONVERSION_FACTOR;<NEW_LINE>viIface.setSpeed(speed);<NEW_LINE>viIface.setBandwidth(speed);<NEW_LINE>}<NEW_LINE>} | ().toIpSpace())); |
562,690 | private void processRows(IncrementalIndex index, BitmapFactory bitmapFactory, List<IncrementalIndex.DimensionDesc> dimensions) {<NEW_LINE>int rowNum = 0;<NEW_LINE>for (IncrementalIndexRow row : index.getFacts().persistIterable()) {<NEW_LINE>final Object[] dims = row.getDims();<NEW_LINE>for (IncrementalIndex.DimensionDesc dimension : dimensions) {<NEW_LINE>final int dimIndex = dimension.getIndex();<NEW_LINE>DimensionAccessor accessor = accessors.get(dimension.getName());<NEW_LINE>// Add 'null' to the dimension's dictionary.<NEW_LINE>if (dimIndex >= dims.length || dims[dimIndex] == null) {<NEW_LINE>accessor.indexer.processRowValsToUnsortedEncodedKeyComponent(null, true);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final ColumnCapabilities capabilities = dimension.getCapabilities();<NEW_LINE>if (capabilities.hasBitmapIndexes()) {<NEW_LINE>final <MASK><NEW_LINE>final DimensionIndexer indexer = accessor.indexer;<NEW_LINE>indexer.fillBitmapsFromUnsortedEncodedKeyComponent(dims[dimIndex], rowNum, bitmapIndexes, bitmapFactory);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>++rowNum;<NEW_LINE>}<NEW_LINE>} | MutableBitmap[] bitmapIndexes = accessor.invertedIndexes; |
889,739 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see com.ibm.ws.http.channel.internal.outbound.HttpOutputStream#writeFile(java.nio.channels.FileChannel)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>@FFDCIgnore({ IOException.class })<NEW_LINE>public void writeFile(FileChannel fc) throws IOException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "writeFile: " + fc);<NEW_LINE>}<NEW_LINE>if (cannotWriteFC()) {<NEW_LINE>// not file channel capable<NEW_LINE>convertFile(fc);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// make sure the headers are written separately from the file buffer<NEW_LINE>flushHeaders();<NEW_LINE>WsByteBuffer fb = HttpDispatcher.<MASK><NEW_LINE>try {<NEW_LINE>// TODO should adjust write timeout based on file size. Large files<NEW_LINE>// can only be written so fast so a 1Gb file should have larger<NEW_LINE>// timeout than a 100K file<NEW_LINE>this.isc.sendResponseBody(new WsByteBuffer[] { fb });<NEW_LINE>this.bytesWritten += fc.size();<NEW_LINE>} catch (MessageSentException mse) {<NEW_LINE>FFDCFilter.processException(mse, getClass().getName(), "writeFile", new Object[] { this, this.isc });<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.event(tc, "Invalid state, message-sent-exception received; " + this.isc);<NEW_LINE>}<NEW_LINE>this.error = new IOException("Invalid state");<NEW_LINE>throw this.error;<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>// no FFDC required<NEW_LINE>this.error = ioe;<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Received exception during write: " + ioe);<NEW_LINE>}<NEW_LINE>throw ioe;<NEW_LINE>} finally {<NEW_LINE>fb.release();<NEW_LINE>}<NEW_LINE>} | getBufferManager().allocateFileChannelBuffer(fc); |
691,997 | public void postProcessFile(File file, String fileType) {<NEW_LINE>if (file == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String haskellPostProcessFile = System.getenv("HASKELL_POST_PROCESS_FILE");<NEW_LINE>if (StringUtils.isEmpty(haskellPostProcessFile)) {<NEW_LINE>// skip if HASKELL_POST_PROCESS_FILE env variable is not defined<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// only process files with hs extension<NEW_LINE>if ("hs".equals(FilenameUtils.getExtension(file.toString()))) {<NEW_LINE>String command = haskellPostProcessFile + " " + file;<NEW_LINE>try {<NEW_LINE>Process p = Runtime.getRuntime().exec(command);<NEW_LINE>int exitValue = p.waitFor();<NEW_LINE>if (exitValue != 0) {<NEW_LINE>LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue);<NEW_LINE>} else {<NEW_LINE>LOGGER.info("Successfully executed: {}", command);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException | IOException e) {<NEW_LINE>LOGGER.error("Error running the command ({}). Exception: {}", <MASK><NEW_LINE>// Restore interrupted state<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | command, e.getMessage()); |
1,778,455 | private void add(String attributeName, ImmutableList.Builder<String> valuePath, TabularData tds) {<NEW_LINE>// @see TabularData#keySet JavaDoc:<NEW_LINE>// "Set<List<?>>" but is declared as a {@code Set<?>} for<NEW_LINE>// compatibility reasons. The returned set can be used to iterate<NEW_LINE>// over the keys."<NEW_LINE>Set<List<?>> keys = (Set<List<?>>) tds.keySet();<NEW_LINE>for (List<?> key : keys) {<NEW_LINE>// ie: attributeName=LastGcInfo.Par Survivor Space<NEW_LINE>// i haven't seen this be smaller or larger than List<1>, but<NEW_LINE>// might as well loop it.<NEW_LINE>CompositeData compositeData = tds.get(key.toArray());<NEW_LINE>String attributeName2 = Joiner.on<MASK><NEW_LINE>add(attributeName, newValuePath(valuePath, attributeName2), compositeData);<NEW_LINE>}<NEW_LINE>} | ('.').join(key); |
920,120 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>assert getArguments() != null;<NEW_LINE>switch(Objects.requireNonNull(getArguments().getString(USourceSkill.EXTRA_INFO_TYPE))) {<NEW_LINE>case USourceSkill.INFO_TYPE_CONDITION:<NEW_LINE>type = Type.condition;<NEW_LINE>break;<NEW_LINE>case USourceSkill.INFO_TYPE_EVENT:<NEW_LINE>type = Type.event;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("CalendarSkillViewFragment should either be a condition or event one");<NEW_LINE>}<NEW_LINE>if (type == Type.condition) {<NEW_LINE>View view = inflater.inflate(R.layout.skill_usource__calendar_condition, container, false);<NEW_LINE>rg_event_title = view.findViewById(R.id.radioGroup_event_title);<NEW_LINE>rb_event_title_any = view.findViewById(R.id.radioButton_any_event);<NEW_LINE>rb_event_title_pattern = view.findViewById(R.id.radioButton_event_match_title);<NEW_LINE>ti_event_title_pattern = view.findViewById(R.id.textInput_event_pattern);<NEW_LINE>cb_all_day_event = view.findViewById(R.id.checkBox_all_day_event);<NEW_LINE>rg_event_title.setOnCheckedChangeListener((group, checkedId) -> {<NEW_LINE>if (checkedId == rb_event_title_pattern.getId()) {<NEW_LINE>ti_event_title_pattern.setEnabled(true);<NEW_LINE>} else {<NEW_LINE>ti_event_title_pattern.setEnabled(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return view;<NEW_LINE>} else {<NEW_LINE>View view = inflater.inflate(R.<MASK><NEW_LINE>cb_conditions[0] = view.findViewById(R.id.checkBox_start);<NEW_LINE>cb_conditions[1] = view.findViewById(R.id.checkBox_end);<NEW_LINE>return view;<NEW_LINE>}<NEW_LINE>} | layout.skill_usource__calendar_event, container, false); |
942,082 | public Packet nextFrame() throws IOException {<NEW_LINE>try {<NEW_LINE>Future<DashMP4DemuxerTrack> curFrag = fragments.get(curFragNo);<NEW_LINE>MP4Packet nextFrame = null;<NEW_LINE>if (curFrag != null) {<NEW_LINE>nextFrame = <MASK><NEW_LINE>if (nextFrame == null) {<NEW_LINE>getCurFrag(curFrag).close();<NEW_LINE>fragments.put(curFragNo, null);<NEW_LINE>curFragNo++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (nextFrame != null) {<NEW_LINE>++globalFrame;<NEW_LINE>return setPts(nextFrame);<NEW_LINE>}<NEW_LINE>curFrag = fragments.get(curFragNo);<NEW_LINE>if (curFrag == null) {<NEW_LINE>for (int i = curFragNo; i < curFragNo + INIT_SIZE; i++) scheduleFragment(curFragNo);<NEW_LINE>curFrag = fragments.get(curFragNo);<NEW_LINE>}<NEW_LINE>if (curFrag == null)<NEW_LINE>return null;<NEW_LINE>++globalFrame;<NEW_LINE>return setPts(getCurFrag(curFrag).nextFrame());<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>throw new RuntimeException("Execution problem", e);<NEW_LINE>}<NEW_LINE>} | getCurFrag(curFrag).nextFrame(); |
101,182 | public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {<NEW_LINE>if (0 != args.length) {<NEW_LINE>String argument = args[0];<NEW_LINE>if (argument.equalsIgnoreCase("help")) {<NEW_LINE>help(out);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>J9JavaVMPointer javaVM = J9RASHelper.getVM(DataType.getJ9RASPointer());<NEW_LINE>J9HashTablePointer contTable = javaVM.contendedLoadTable();<NEW_LINE>J9PoolPointer poolPtr = contTable.listNodePool();<NEW_LINE>Pool<J9ContendedLoadTableEntryPointer> pool = Pool.fromJ9Pool(poolPtr, J9ContendedLoadTableEntryPointer.class);<NEW_LINE>SlotIterator<J9ContendedLoadTableEntryPointer> poolIterator = pool.iterator();<NEW_LINE>if (poolIterator.hasNext()) {<NEW_LINE>out.println("Active class loads:");<NEW_LINE>while (poolIterator.hasNext()) {<NEW_LINE>J9ContendedLoadTableEntryPointer entryPointer = poolIterator.next();<NEW_LINE>String ldStatus = loadingStatusValues.get(entryPointer.status().longValue());<NEW_LINE>if (null == ldStatus) {<NEW_LINE>ldStatus = "ILLEGAL VALUE: " + entryPointer.status();<NEW_LINE>}<NEW_LINE>J9VMThreadPointer loadingThread = entryPointer.thread();<NEW_LINE>out.print(String.format("\tClassname: %s;\n\t\tLoader: %s; Loading thread: %s %s\n\t\tStatus: %s; Table entry hash 0x%X\n", entryPointer.className().getCStringAtOffset(0, entryPointer.classNameLength().longValue()), entryPointer.classLoader().formatShortInteractive(), J9VMThreadHelper.getName(loadingThread), loadingThread.formatShortInteractive(), ldStatus, entryPointer.hashValue().longValue()));<NEW_LINE>}<NEW_LINE>MonitorIterator iterator = new MonitorIterator(javaVM);<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Object current = iterator.next();<NEW_LINE>if (current instanceof J9ThreadMonitorPointer) {<NEW_LINE>// System Monitor<NEW_LINE>SystemMonitor monitor = SystemMonitor.fromJ9ThreadMonitor((J9ThreadMonitorPointer) current);<NEW_LINE>final String monitorName = monitor.getName();<NEW_LINE>if (monitorName.matches(".*VM class table.*")) {<NEW_LINE>List<J9ThreadPointer<MASK><NEW_LINE>if (!waitingThreads.isEmpty()) {<NEW_LINE>out.print("Waiting threads:\n");<NEW_LINE>for (J9ThreadPointer tp : waitingThreads) {<NEW_LINE>J9VMThreadPointer vmThread = J9ThreadHelper.getVMThread(tp);<NEW_LINE>if (vmThread.notNull()) {<NEW_LINE>out.print(String.format("\t%s\t%s\n", vmThread.formatShortInteractive(), J9VMThreadHelper.getName(vmThread)));<NEW_LINE>} else {<NEW_LINE>out.print(String.format("\t%s\t%s\n", tp.formatShortInteractive(), "[osthread]"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>out.println("No active class loads");<NEW_LINE>}<NEW_LINE>} catch (CorruptDataException e) {<NEW_LINE>throw new DDRInteractiveCommandException(e);<NEW_LINE>}<NEW_LINE>} | > waitingThreads = monitor.getWaitingThreads(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.