idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,698,682 | private void printHeader() {<NEW_LINE>for (int i = 0, columnsSize = columns.length; i < columnsSize; i++) {<NEW_LINE>DBDAttributeBinding column = columns[i];<NEW_LINE>String colName = column.getName();<NEW_LINE>if (headerFormat == HeaderFormat.description) {<NEW_LINE>colName = column.getDescription();<NEW_LINE>if (colName == null) {<NEW_LINE>colName = column.getLabel();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String colLabel = column.getLabel();<NEW_LINE>if (CommonUtils.equalObjects(colLabel, colName)) {<NEW_LINE>colName = column.getParentObject() == null ? column.getName() : DBUtils.getObjectFullName(column, DBPEvaluationContext.UI);<NEW_LINE>} else if (!CommonUtils.isEmpty(colLabel)) {<NEW_LINE>// Label has higher priority<NEW_LINE>colName = colLabel;<NEW_LINE>}<NEW_LINE>if (headerFormat == HeaderFormat.both) {<NEW_LINE><MASK><NEW_LINE>if (!CommonUtils.isEmpty(description)) {<NEW_LINE>colName += ":" + description;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writeCellValue(colName, true);<NEW_LINE>if (i < columnsSize - 1) {<NEW_LINE>writeDelimiter();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writeRowLimit();<NEW_LINE>} | String description = column.getDescription(); |
1,647,998 | private BType checkSpreadFieldWithMapType(BType spreadOpType) {<NEW_LINE>switch(spreadOpType.tag) {<NEW_LINE>case TypeTags.RECORD:<NEW_LINE>List<BType> types = new ArrayList<>();<NEW_LINE>BRecordType recordType = (BRecordType) spreadOpType;<NEW_LINE>for (BField recField : recordType.fields.values()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (!recordType.sealed) {<NEW_LINE>types.add(recordType.restFieldType);<NEW_LINE>}<NEW_LINE>return getRepresentativeBroadType(types);<NEW_LINE>case TypeTags.MAP:<NEW_LINE>return ((BMapType) spreadOpType).constraint;<NEW_LINE>case TypeTags.TYPEREFDESC:<NEW_LINE>return checkSpreadFieldWithMapType(Types.getReferredType(spreadOpType));<NEW_LINE>default:<NEW_LINE>return symTable.semanticError;<NEW_LINE>}<NEW_LINE>} | types.add(recField.type); |
339,340 | private boolean writeDictionaryRowGroup(Block dictionary, int valueCount, IntBigArray dictionaryIndexes, int maxDirectBytes) {<NEW_LINE>int[][] segments = dictionaryIndexes.getSegments();<NEW_LINE>for (int i = 0; valueCount > 0 && i < segments.length; i++) {<NEW_LINE>int[] segment = segments[i];<NEW_LINE>int positionCount = Math.min(valueCount, segment.length);<NEW_LINE>Block block = new DictionaryBlock(positionCount, dictionary, segment);<NEW_LINE>while (block != null) {<NEW_LINE>int chunkPositionCount = block.getPositionCount();<NEW_LINE>Block chunk = block.getRegion(0, chunkPositionCount);<NEW_LINE>// avoid chunk with huge logical size<NEW_LINE>while (chunkPositionCount > 1 && chunk.getLogicalSizeInBytes() > DIRECT_CONVERSION_CHUNK_MAX_LOGICAL_BYTES) {<NEW_LINE>chunkPositionCount /= 2;<NEW_LINE>chunk = <MASK><NEW_LINE>}<NEW_LINE>directColumnWriter.writeBlock(chunk);<NEW_LINE>if (directColumnWriter.getBufferedBytes() > maxDirectBytes) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// slice block to only unconverted rows<NEW_LINE>if (chunkPositionCount < block.getPositionCount()) {<NEW_LINE>block = block.getRegion(chunkPositionCount, block.getPositionCount() - chunkPositionCount);<NEW_LINE>} else {<NEW_LINE>block = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>valueCount -= positionCount;<NEW_LINE>}<NEW_LINE>checkState(valueCount == 0);<NEW_LINE>return true;<NEW_LINE>} | chunk.getRegion(0, chunkPositionCount); |
333,347 | private void prepareCluster() {<NEW_LINE>String clusterName = url.getParameter(URLParamType.cluster.getName(), URLParamType.cluster.getValue());<NEW_LINE>String loadbalanceName = url.getParameter(URLParamType.loadbalance.getName(), URLParamType.loadbalance.getValue());<NEW_LINE>String haStrategyName = url.getParameter(URLParamType.haStrategy.getName(), URLParamType.haStrategy.getValue());<NEW_LINE>cluster = ExtensionLoader.getExtensionLoader(Cluster.class).getExtension(clusterName);<NEW_LINE>LoadBalance<T> loadBalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(loadbalanceName);<NEW_LINE>HaStrategy<T> ha = ExtensionLoader.getExtensionLoader(HaStrategy<MASK><NEW_LINE>ha.setUrl(url);<NEW_LINE>cluster.setLoadBalance(loadBalance);<NEW_LINE>cluster.setHaStrategy(ha);<NEW_LINE>cluster.setUrl(url);<NEW_LINE>} | .class).getExtension(haStrategyName); |
1,286,422 | protected XFormDialog buildDialog(Interface modelItem) {<NEW_LINE>XFormDialogBuilder builder = XFormFactory.createDialogBuilder(".NET 2.0 artifacts");<NEW_LINE>XForm mainForm = builder.createForm("Basic");<NEW_LINE>addWSDLFields(mainForm, modelItem);<NEW_LINE>mainForm.addTextField(OUTPUT, "root directory for generated files.", XForm.FieldType.PROJECT_FOLDER);<NEW_LINE>mainForm.addTextField(NAMESPACE, "The namespace for the generated proxy or template", XForm.FieldType.TEXT);<NEW_LINE>mainForm.addCheckBox(SERVER, "(Generates interfaces for server-side implementation of an ASP.Net Web Service)");<NEW_LINE>mainForm.addComboBox(LANGUAGE, new String[] { "CS", "VB", "JS", "VJS", "CPP" }, "add scope to deploy.wsdd");<NEW_LINE>mainForm.addComboBox(PROTOCOL, new String[] { "SOAP", "SOAP12", "HttpGet", "HttpPost" }, "override the default protocol to implement");<NEW_LINE>XForm advForm = builder.createForm("Advanced");<NEW_LINE>advForm.addCheckBox(SHARETYPES, "(turns on type sharing feature)");<NEW_LINE>advForm.addCheckBox(FIELDS, "(generate fields instead of properties)");<NEW_LINE>advForm.addCheckBox(ORDER, "(generate explicit order identifiers on particle members)");<NEW_LINE>advForm.addCheckBox(ENABLEDATABINDING, "(implement INotifyPropertyChanged interface on all generated types)");<NEW_LINE>advForm.addTextField(URLKEY, "configuration key to use in the code generation to read the default URL value", XForm.FieldType.URL);<NEW_LINE>advForm.addTextField(BASEURL, "base url to use when calculating the url fragment", XForm.FieldType.URL);<NEW_LINE>XForm httpForm = builder.createForm("HTTP settings");<NEW_LINE>httpForm.addTextField(USERNAME, "username to access the WSDL-URI", XForm.FieldType.TEXT);<NEW_LINE>httpForm.addTextField(PASSWORD, <MASK><NEW_LINE>httpForm.addTextField(DOMAIN, "domain to access the WSDL-URI", XForm.FieldType.TEXT);<NEW_LINE>httpForm.addTextField(PROXY, "username to access the WSDL-URI", XForm.FieldType.TEXT);<NEW_LINE>httpForm.addTextField(PROXYUSERNAME, "proxy username to access the WSDL-URI", XForm.FieldType.TEXT);<NEW_LINE>httpForm.addTextField(PROXYPASSWORD, "proxy password to access the WSDL-URI", XForm.FieldType.PASSWORD);<NEW_LINE>httpForm.addTextField(PROXYDOMAIN, "proxy domain to access the WSDL-URI", XForm.FieldType.TEXT);<NEW_LINE>buildArgsForm(builder, false, "wsdl.exe");<NEW_LINE>return builder.buildDialog(buildDefaultActions(HelpUrls.DOTNET_HELP_URL, modelItem), "Specify arguments for .NET 2 wsdl.exe", UISupport.TOOL_ICON);<NEW_LINE>} | "password to access the WSDL-URI", XForm.FieldType.PASSWORD); |
861,336 | public Suggestions search(final List<NamedIndexReader> indexReaders, final SuggesterQuery suggesterQuery, final Query query) {<NEW_LINE>if (indexReaders == null || suggesterQuery == null) {<NEW_LINE>return new Suggestions(<MASK><NEW_LINE>}<NEW_LINE>List<NamedIndexReader> readers = indexReaders;<NEW_LINE>if (!projectsEnabled) {<NEW_LINE>readers = Collections.singletonList(new NamedIndexReader(PROJECTS_DISABLED_KEY, indexReaders.get(0).getReader()));<NEW_LINE>}<NEW_LINE>Suggestions suggestions;<NEW_LINE>if (!SuggesterUtils.isComplexQuery(query, suggesterQuery)) {<NEW_LINE>// use WFST for lone prefix<NEW_LINE>suggestions = prefixLookup(readers, (SuggesterPrefixQuery) suggesterQuery);<NEW_LINE>} else {<NEW_LINE>suggestions = complexLookup(readers, suggesterQuery, query);<NEW_LINE>}<NEW_LINE>return new Suggestions(SuggesterUtils.combineResults(suggestions.items, resultSize), suggestions.partialResult);<NEW_LINE>} | Collections.emptyList(), true); |
1,546,254 | protected boolean continueProcessing() {<NEW_LINE>if (level.isClientSide && !isVirtual())<NEW_LINE>return true;<NEW_LINE>if (processingTicks < 5)<NEW_LINE>return true;<NEW_LINE>if (!EmptyingByBasin.canItemBeEmptied(level, heldItem.stack))<NEW_LINE>return false;<NEW_LINE>Pair<FluidStack, ItemStack> emptyItem = EmptyingByBasin.emptyItem(level, heldItem.stack, true);<NEW_LINE><MASK><NEW_LINE>if (processingTicks > 5) {<NEW_LINE>internalTank.allowInsertion();<NEW_LINE>if (internalTank.getPrimaryHandler().fill(fluidFromItem, FluidAction.SIMULATE) != fluidFromItem.getAmount()) {<NEW_LINE>internalTank.forbidInsertion();<NEW_LINE>processingTicks = FILLING_TIME;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>internalTank.forbidInsertion();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>emptyItem = EmptyingByBasin.emptyItem(level, heldItem.stack.copy(), false);<NEW_LINE>AllTriggers.triggerForNearbyPlayers(AllTriggers.ITEM_DRAIN, level, worldPosition, 5);<NEW_LINE>// Process finished<NEW_LINE>ItemStack out = emptyItem.getSecond();<NEW_LINE>if (!out.isEmpty())<NEW_LINE>heldItem.stack = out;<NEW_LINE>else<NEW_LINE>heldItem = null;<NEW_LINE>internalTank.allowInsertion();<NEW_LINE>internalTank.getPrimaryHandler().fill(fluidFromItem, FluidAction.EXECUTE);<NEW_LINE>internalTank.forbidInsertion();<NEW_LINE>notifyUpdate();<NEW_LINE>return true;<NEW_LINE>} | FluidStack fluidFromItem = emptyItem.getFirst(); |
73,719 | public com.amazonaws.services.textract.model.InternalServerErrorException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.textract.model.InternalServerErrorException internalServerErrorException = new com.amazonaws.services.<MASK><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>} 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 internalServerErrorException;<NEW_LINE>} | textract.model.InternalServerErrorException(null); |
226,118 | public GetPreparedStatementResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetPreparedStatementResult getPreparedStatementResult = new GetPreparedStatementResult();<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 getPreparedStatementResult;<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("PreparedStatement", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getPreparedStatementResult.setPreparedStatement(PreparedStatementJsonUnmarshaller.getInstance<MASK><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 getPreparedStatementResult;<NEW_LINE>} | ().unmarshall(context)); |
475,090 | public List<QueryMetadata> sql(final String sql, final Map<String, ?> overriddenProperties) {<NEW_LINE>final List<ParsedStatement> statements = ksqlEngine.parse(sql);<NEW_LINE>final KsqlExecutionContext sandbox = ksqlEngine.<MASK><NEW_LINE>final Map<String, Object> validationOverrides = new HashMap<>(overriddenProperties);<NEW_LINE>for (final ParsedStatement stmt : statements) {<NEW_LINE>execute(sandbox, stmt, ksqlConfig, validationOverrides, injectorFactory.apply(sandbox, sandbox.getServiceContext()));<NEW_LINE>}<NEW_LINE>final List<QueryMetadata> queries = new ArrayList<>();<NEW_LINE>final Injector injector = injectorFactory.apply(ksqlEngine, serviceContext);<NEW_LINE>final Map<String, Object> executionOverrides = new HashMap<>(overriddenProperties);<NEW_LINE>for (final ParsedStatement parsed : statements) {<NEW_LINE>execute(ksqlEngine, parsed, ksqlConfig, executionOverrides, injector).getQuery().ifPresent(queries::add);<NEW_LINE>}<NEW_LINE>for (final QueryMetadata queryMetadata : queries) {<NEW_LINE>if (queryMetadata instanceof PersistentQueryMetadata) {<NEW_LINE>queryMetadata.start();<NEW_LINE>} else {<NEW_LINE>LOG.warn("Ignoring statemenst: {}", sql);<NEW_LINE>LOG.warn("Only CREATE statements can run in KSQL embedded mode.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return queries;<NEW_LINE>} | createSandbox(ksqlEngine.getServiceContext()); |
1,404,581 | public void createBindings() {<NEW_LINE>LengthConverter lengthConverter = new LengthConverter();<NEW_LINE>DoubleConverter doubleConverter = new DoubleConverter("%f");<NEW_LINE>addWrappedBinding(axis, "type", this, "type");<NEW_LINE>addWrappedBinding(axis, "backlashCompensationMethod", backlashCompensationMethod, "selectedItem");<NEW_LINE>addWrappedBinding(axis, <MASK><NEW_LINE>addWrappedBinding(axis, "backlashOffset", backlashOffset, "text", lengthConverter);<NEW_LINE>addWrappedBinding(axis, "sneakUpOffset", sneakUpOffset, "text", lengthConverter);<NEW_LINE>addWrappedBinding(axis, "backlashSpeedFactor", backlashSpeedFactor, "text", doubleConverter);<NEW_LINE>addWrappedBinding(axis, "stepTestGraph", stepTestGraph, "graph");<NEW_LINE>addWrappedBinding(axis, "backlashDistanceTestGraph", backlashDistanceTestGraph, "graph");<NEW_LINE>addWrappedBinding(axis, "backlashSpeedTestGraph", backlashSpeedTestGraph, "graph");<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(acceptableTolerance);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(backlashOffset);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(sneakUpOffset);<NEW_LINE>adaptDialog();<NEW_LINE>} | "acceptableTolerance", acceptableTolerance, "text", lengthConverter); |
812,847 | public void process(T input, GrayS32 output) {<NEW_LINE>output.reshape(input.width, input.height);<NEW_LINE>stopRequested = false;<NEW_LINE>if (input.width < 2 * BORDER || input.height < 2 * BORDER)<NEW_LINE>throw new IllegalArgumentException("Image is too small to process. Must have a width and height of at least " + (2 * BORDER));<NEW_LINE>// initialize all the data structures<NEW_LINE>initalize(input);<NEW_LINE>// Seed the clusters<NEW_LINE>initializeClusters();<NEW_LINE>// Perform the modified k-means iterations<NEW_LINE>for (int i = 0; i < totalIterations && !stopRequested; i++) {<NEW_LINE>computeClusterDistance();<NEW_LINE>updateClusters();<NEW_LINE>}<NEW_LINE>if (stopRequested)<NEW_LINE>return;<NEW_LINE>// Assign labels to each pixel based on how close it is to a cluster<NEW_LINE>computeClusterDistance();<NEW_LINE>assignLabelsToPixels(initialSegments, regionMemberCount, regionColor);<NEW_LINE>// Assign disconnected pixels to the largest cluster they touch<NEW_LINE>int N = input.width * input.height / numberOfRegions;<NEW_LINE>segment.process(initialSegments, output, regionMemberCount);<NEW_LINE><MASK><NEW_LINE>mergeSmall.process(input, output, regionMemberCount, regionColor);<NEW_LINE>} | mergeSmall.setMinimumSize(N / 2); |
1,274,254 | private void parseCfgHostsAndConnect(String cfgHostsLine) {<NEW_LINE>String[] <MASK><NEW_LINE>for (int i = 0; i < cfgHostsEntries.length; i++) {<NEW_LINE>String cfgHostEntry = cfgHostsEntries[i];<NEW_LINE>String[] cfgHostAndPort = cfgHostEntry.split(":", 3);<NEW_LINE>String host = cfgHostAndPort[0];<NEW_LINE>int port;<NEW_LINE>String authkey = null;<NEW_LINE>if (cfgHostAndPort.length > 1) {<NEW_LINE>if (!cfgHostAndPort[1].equals("")) {<NEW_LINE>port = Integer.parseInt(cfgHostAndPort[1]);<NEW_LINE>} else {<NEW_LINE>port = BRICKD_DEFAULT_PORT;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>port = BRICKD_DEFAULT_PORT;<NEW_LINE>}<NEW_LINE>if (cfgHostAndPort.length == 3) {<NEW_LINE>authkey = cfgHostAndPort[2];<NEW_LINE>}<NEW_LINE>logger.debug("parse brickd config: host {}, port {}, authkey is set {}", host, port, authkey != null ? true : false);<NEW_LINE>connectBrickd(host, port, authkey);<NEW_LINE>}<NEW_LINE>} | cfgHostsEntries = cfgHostsLine.split("\\s"); |
388,008 | public PlanNode visitWindow(WindowNode node, RewriteContext<Void> context) {<NEW_LINE>PlanNode source = context.rewrite(node.getSource());<NEW_LINE>ImmutableMap.Builder<VariableReferenceExpression, WindowNode.Function> functions = ImmutableMap.builder();<NEW_LINE>for (Map.Entry<VariableReferenceExpression, WindowNode.Function> entry : node.getWindowFunctions().entrySet()) {<NEW_LINE>VariableReferenceExpression variable = entry.getKey();<NEW_LINE>// Be aware of the CallExpression handling.<NEW_LINE>CallExpression callExpression = entry.getValue().getFunctionCall();<NEW_LINE>List<RowExpression> rewrittenArguments = canonicalizeCallExpression(callExpression);<NEW_LINE>WindowNode.Frame canonicalFrame = canonicalize(entry.getValue().getFrame());<NEW_LINE>functions.put(canonicalize(variable), new WindowNode.Function(call(callExpression.getDisplayName(), callExpression.getFunctionHandle(), callExpression.getType(), rewrittenArguments), canonicalFrame, entry.getValue().isIgnoreNulls()));<NEW_LINE>}<NEW_LINE>return new WindowNode(node.getSourceLocation(), node.getId(), source, canonicalizeAndDistinct(node.getSpecification()), functions.build(), canonicalize(node.getHashVariable()), canonicalize(node.getPrePartitionedInputs()<MASK><NEW_LINE>} | ), node.getPreSortedOrderPrefix()); |
863,239 | public Tree visitClass(ClassTree node, Element source) {<NEW_LINE>final GeneratorUtilities genUtils = GeneratorUtilities.get(workingCopy);<NEW_LINE>final TreePath classPath = getCurrentPath();<NEW_LINE>ClassTree classTree = node;<NEW_LINE>translateQueue.addLast(new HashMap<Tree, Tree>());<NEW_LINE>Element el = workingCopy.getTrees().getElement(getCurrentPath());<NEW_LINE>inSuperClass = el.equals(source);<NEW_LINE>Tree value = super.visitClass(classTree, source);<NEW_LINE>if (inSuperClass) {<NEW_LINE>classTree = rewriteSuperClass(el, classTree, genUtils);<NEW_LINE>} else {<NEW_LINE>TypeMirror tm = el.asType();<NEW_LINE>Types types = workingCopy.getTypes();<NEW_LINE>Trees trees = workingCopy.getTrees();<NEW_LINE>if (types.isSubtype(types.erasure(tm), types.erasure(source.asType()))) {<NEW_LINE>classTree = rewriteSubClass(el, source, genUtils, trees, node);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<Tree, Tree> original2Translated = translateQueue.pollLast();<NEW_LINE>classTree = (ClassTree) workingCopy.getTreeUtilities(<MASK><NEW_LINE>if (/* final boolean notTopLevel = classPath.getParentPath().getLeaf().getKind() != Tree.Kind.COMPILATION_UNIT; */<NEW_LINE>!translateQueue.isEmpty()) {<NEW_LINE>translateQueue.getLast().put(node, classTree);<NEW_LINE>} else {<NEW_LINE>rewrite(node, classTree);<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>} | ).translate(classTree, original2Translated); |
812,369 | public void init(final int capacity) {<NEW_LINE>this.bayes.setMemoryCapacity(capacity);<NEW_LINE>// read the categories<NEW_LINE>for (Category f : this.categories.keySet()) {<NEW_LINE>String keys = DAO.getConfig("classification." + this.name() + "." + f.name(), "");<NEW_LINE>Set<String> <MASK><NEW_LINE>for (String key : keys.toLowerCase().split(",")) keyset.add(key);<NEW_LINE>this.categories.put(f, keyset);<NEW_LINE>}<NEW_LINE>// consistency check of categories: identify words appearing not in one category only<NEW_LINE>Set<String> inconsistentWords = new HashSet<>();<NEW_LINE>for (Map.Entry<Category, Set<String>> c0 : this.categories.entrySet()) {<NEW_LINE>for (String key : c0.getValue()) {<NEW_LINE>doublecheck: for (Map.Entry<Category, Set<String>> c1 : this.categories.entrySet()) {<NEW_LINE>if (c1.getKey().equals(c0.getKey()))<NEW_LINE>continue doublecheck;<NEW_LINE>if (c1.getValue().contains(key)) {<NEW_LINE>inconsistentWords.add(key);<NEW_LINE>break doublecheck;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// remove inconsistent words from all categories<NEW_LINE>for (String key : inconsistentWords) {<NEW_LINE>forgetWord(key);<NEW_LINE>}<NEW_LINE>} | keyset = new HashSet<>(); |
270,394 | public boolean apply(Game game, Ability source) {<NEW_LINE>List<Permanent> permanents = new ArrayList<>();<NEW_LINE>for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {<NEW_LINE>Player player = game.getPlayer(playerId);<NEW_LINE>if (player == null || game.getBattlefield().count(StaticFilters.FILTER_CONTROLLED_CREATURE, playerId, source, game) < 1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>TargetPermanent target = new TargetControlledCreaturePermanent();<NEW_LINE>target.setNotTarget(true);<NEW_LINE>player.choose(outcome, target, source, game);<NEW_LINE>Permanent permanent = game.<MASK><NEW_LINE>if (permanent == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>permanents.add(permanent);<NEW_LINE>permanent.addCounters(CounterType.VOW.createInstance(), playerId, source, game);<NEW_LINE>}<NEW_LINE>for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getSourceId(), game)) {<NEW_LINE>if (permanent == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (permanents.contains(permanent)) {<NEW_LINE>game.addEffect(new PromiseOfLoyaltyAttackEffect().setTargetPointer(new FixedTarget(permanent, game)), source);<NEW_LINE>} else {<NEW_LINE>permanent.sacrifice(source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | getPermanent(target.getFirstTarget()); |
642,731 | private Definition loadDefinition(String url) throws WSDLException {<NEW_LINE>WSDLReader reader = factory.newWSDLReader();<NEW_LINE>reader.setFeature("javax.wsdl.verbose", false);<NEW_LINE>reader.setFeature("javax.wsdl.importDocuments", true);<NEW_LINE>reader.setExtensionRegistry(registry);<NEW_LINE>CatalogWSDLLocator catLocator = new CatalogWSDLLocator(url, bus);<NEW_LINE>ResourceManagerWSDLLocator wsdlLocator = new ResourceManagerWSDLLocator(url, catLocator, bus);<NEW_LINE>InputSource src = wsdlLocator.getBaseInputSource();<NEW_LINE>Definition def = null;<NEW_LINE>if (src.getByteStream() != null || src.getCharacterStream() != null) {<NEW_LINE>Document doc;<NEW_LINE>XMLStreamReader xmlReader = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>doc = StaxUtils.read(xmlReader, true);<NEW_LINE>if (src.getSystemId() != null) {<NEW_LINE>try {<NEW_LINE>doc.setDocumentURI(new String(src.getSystemId()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>// ignore - probably not DOM level 3<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new WSDLException(WSDLException.PARSER_ERROR, e.getMessage(), e);<NEW_LINE>} finally {<NEW_LINE>StaxUtils.close(xmlReader);<NEW_LINE>}<NEW_LINE>def = reader.readWSDL(wsdlLocator, doc.getDocumentElement());<NEW_LINE>} else {<NEW_LINE>def = reader.readWSDL(wsdlLocator);<NEW_LINE>}<NEW_LINE>synchronized (definitionsMap) {<NEW_LINE>definitionsMap.put(url, def);<NEW_LINE>}<NEW_LINE>return def;<NEW_LINE>} | xmlReader = StaxUtils.createXMLStreamReader(src); |
923,676 | public static void Initialize() {<NEW_LINE>// remove all the appenders<NEW_LINE>log.removeAllAppenders();<NEW_LINE>// setting up the logger<NEW_LINE>// This is the root logger provided by log4j<NEW_LINE>log.setLevel(Level.ALL);<NEW_LINE>// Define log pattern layout<NEW_LINE>PatternLayout layout = new PatternLayout("%m%n");<NEW_LINE>// Add console appender to root logger<NEW_LINE>log.addAppender(new ConsoleAppender(layout));<NEW_LINE>try {<NEW_LINE>// get new file name<NEW_LINE>SimpleDateFormat formatter = new SimpleDateFormat("dd:MM:yyyy HH:mm:ss");<NEW_LINE>Date date = new Date();<NEW_LINE>String fileName = "output/searchStats-" <MASK><NEW_LINE>// Define file appender with layout and output log file name<NEW_LINE>RollingFileAppender fileAppender = new RollingFileAppender(layout, fileName);<NEW_LINE>// Add the appender to root logger<NEW_LINE>log.addAppender(fileAppender);<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.out.println("Failed to add appender to the SearchLogger!!");<NEW_LINE>}<NEW_LINE>} | + date.toString() + ".log"; |
103,235 | public synchronized void containerPut(IJavaProject project, IPath containerPath, IClasspathContainer container) {<NEW_LINE>// set/unset the initialization in progress<NEW_LINE>if (container == CONTAINER_INITIALIZATION_IN_PROGRESS) {<NEW_LINE>containerAddInitializationInProgress(project, containerPath);<NEW_LINE>// do not write out intermediate initialization value<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>containerRemoveInitializationInProgress(project, containerPath);<NEW_LINE>Map<IPath, IClasspathContainer> projectContainers = <MASK><NEW_LINE>if (projectContainers == null) {<NEW_LINE>projectContainers = new HashMap<>(1);<NEW_LINE>this.containers.put(project, projectContainers);<NEW_LINE>}<NEW_LINE>if (container == null) {<NEW_LINE>projectContainers.remove(containerPath);<NEW_LINE>} else {<NEW_LINE>projectContainers.put(containerPath, container);<NEW_LINE>}<NEW_LINE>// discard obsoleted information about previous session<NEW_LINE>Map<IPath, IClasspathContainer> previousContainers = this.previousSessionContainers.get(project);<NEW_LINE>if (previousContainers != null) {<NEW_LINE>previousContainers.remove(containerPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// container values are persisted in preferences during save operations, see #saving(ISaveContext)<NEW_LINE>} | this.containers.get(project); |
245,436 | public static ClassTree addMethod(WorkingCopy copy, ClassTree tree, Modifier[] modifiers, String[] annotations, Object[] annotationAttrs, String name, Object returnType, String[] parameters, Object[] paramTypes, Object[] paramAnnotationsArray, Object[] paramAnnotationAttrsArray, Object[] throwList, String bodyText, String comment) {<NEW_LINE>TreeMaker maker = copy.getTreeMaker();<NEW_LINE>ModifiersTree modifiersTree = createModifiersTree(copy, modifiers, annotations, annotationAttrs);<NEW_LINE>Tree returnTypeTree = createTypeTree(copy, returnType);<NEW_LINE>List<VariableTree> paramTrees = new ArrayList<VariableTree>();<NEW_LINE>if (parameters != null) {<NEW_LINE>for (int i = 0; i < parameters.length; i++) {<NEW_LINE>ModifiersTree paramModTree = maker.Modifiers(Collections.<Modifier>emptySet());<NEW_LINE>String[] paramAnnotations = null;<NEW_LINE>Object[] paramAnnotationAttrs = null;<NEW_LINE>if (paramAnnotationsArray != null && paramAnnotationsArray.length > 0) {<NEW_LINE>if (paramAnnotationsArray[i] instanceof String) {<NEW_LINE>paramAnnotations = new String[] { (String) paramAnnotationsArray[i] };<NEW_LINE>paramAnnotationAttrs = new Object[] { paramAnnotationAttrsArray[i] };<NEW_LINE>} else {<NEW_LINE>paramAnnotations = (String[]) paramAnnotationsArray[i];<NEW_LINE>paramAnnotationAttrs = (Object[]) paramAnnotationAttrsArray[i];<NEW_LINE>}<NEW_LINE>if (paramAnnotations != null) {<NEW_LINE>paramModTree = createModifiersTree(copy, new Modifier[<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>paramTrees.add(maker.Variable(paramModTree, parameters[i], createTypeTree(copy, paramTypes[i]), null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<ExpressionTree> throwsExpressions = createThrowTrees(copy, throwList);<NEW_LINE>MethodTree methodTree = maker.Method(modifiersTree, name, returnTypeTree, Collections.<TypeParameterTree>emptyList(), paramTrees, throwsExpressions, bodyText, null);<NEW_LINE>if (comment != null) {<NEW_LINE>maker.addComment(methodTree, createJavaDocComment(comment), true);<NEW_LINE>}<NEW_LINE>return maker.addClassMember(tree, methodTree);<NEW_LINE>} | ] {}, paramAnnotations, paramAnnotationAttrs); |
1,255,528 | private void printLocalsInBody(Body body, UnitPrinter up) {<NEW_LINE>Map<Type, List<Local>> typeToLocals = new DeterministicHashMap<Type, List<Local>>(body.getLocalCount() * 2 + 1, 0.7f);<NEW_LINE>// Collect locals<NEW_LINE>for (Local local : body.getLocals()) {<NEW_LINE><MASK><NEW_LINE>List<Local> localList = typeToLocals.get(t);<NEW_LINE>if (localList == null) {<NEW_LINE>typeToLocals.put(t, localList = new ArrayList<Local>());<NEW_LINE>}<NEW_LINE>localList.add(local);<NEW_LINE>}<NEW_LINE>// Print locals<NEW_LINE>for (Map.Entry<Type, List<Local>> e : typeToLocals.entrySet()) {<NEW_LINE>up.type(e.getKey());<NEW_LINE>up.literal(" ");<NEW_LINE>for (Iterator<Local> it = e.getValue().iterator(); it.hasNext(); ) {<NEW_LINE>Local l = it.next();<NEW_LINE>up.local(l);<NEW_LINE>if (it.hasNext()) {<NEW_LINE>up.literal(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>up.literal(";");<NEW_LINE>up.newline();<NEW_LINE>}<NEW_LINE>if (!typeToLocals.isEmpty()) {<NEW_LINE>up.newline();<NEW_LINE>}<NEW_LINE>} | Type t = local.getType(); |
1,063,058 | public static DescribeExpressSyncSharesResponse unmarshall(DescribeExpressSyncSharesResponse describeExpressSyncSharesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeExpressSyncSharesResponse.setRequestId<MASK><NEW_LINE>describeExpressSyncSharesResponse.setMessage(_ctx.stringValue("DescribeExpressSyncSharesResponse.Message"));<NEW_LINE>describeExpressSyncSharesResponse.setCode(_ctx.stringValue("DescribeExpressSyncSharesResponse.Code"));<NEW_LINE>describeExpressSyncSharesResponse.setSuccess(_ctx.booleanValue("DescribeExpressSyncSharesResponse.Success"));<NEW_LINE>List<Share> shares = new ArrayList<Share>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeExpressSyncSharesResponse.Shares.Length"); i++) {<NEW_LINE>Share share = new Share();<NEW_LINE>share.setMnsQueue(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].MnsQueue"));<NEW_LINE>share.setExpressSyncId(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].ExpressSyncId"));<NEW_LINE>share.setGatewayId(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].GatewayId"));<NEW_LINE>share.setExpressSyncState(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].ExpressSyncState"));<NEW_LINE>share.setGatewayName(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].GatewayName"));<NEW_LINE>share.setStorageBundleId(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].StorageBundleId"));<NEW_LINE>share.setSyncProgress(_ctx.integerValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].SyncProgress"));<NEW_LINE>share.setGatewayRegion(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].GatewayRegion"));<NEW_LINE>share.setShareName(_ctx.stringValue("DescribeExpressSyncSharesResponse.Shares[" + i + "].ShareName"));<NEW_LINE>shares.add(share);<NEW_LINE>}<NEW_LINE>describeExpressSyncSharesResponse.setShares(shares);<NEW_LINE>return describeExpressSyncSharesResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeExpressSyncSharesResponse.RequestId")); |
1,047,919 | public static PropertyValues resolvePropertyValues(Object bean, final String prefix, String dataId, String groupId, String content, String type) {<NEW_LINE>final Map<String, Object> configProperties = toProperties(<MASK><NEW_LINE>final MutablePropertyValues propertyValues = new MutablePropertyValues();<NEW_LINE>ReflectionUtils.doWithFields(bean.getClass(), new ReflectionUtils.FieldCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {<NEW_LINE>String propertyName = NacosUtils.resolvePropertyName(field);<NEW_LINE>propertyName = StringUtils.isEmpty(prefix) ? propertyName : prefix + "." + propertyName;<NEW_LINE>if (hasText(propertyName)) {<NEW_LINE>// If it is a map, the data will not be fetched<NEW_LINE>// fix issue #91<NEW_LINE>if (Collection.class.isAssignableFrom(field.getType()) || Map.class.isAssignableFrom(field.getType())) {<NEW_LINE>bindContainer(prefix, propertyName, configProperties, propertyValues);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (containsDescendantOf(configProperties.keySet(), propertyName) && !isUnbindableBean(field.getType())) {<NEW_LINE>bindBean(propertyName, field.getType(), configProperties, propertyValues);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (configProperties.containsKey(propertyName)) {<NEW_LINE>String propertyValue = String.valueOf(configProperties.get(propertyName));<NEW_LINE>propertyValues.add(field.getName(), propertyValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return propertyValues;<NEW_LINE>} | dataId, groupId, content, type); |
1,180,880 | public static void paintAtScale1x(Graphics2D g, int x, int y, int width, int height, Painter painter) {<NEW_LINE>// save original transform<NEW_LINE>AffineTransform transform = g.getTransform();<NEW_LINE>// check whether scaled<NEW_LINE>if (transform.getScaleX() == 1 && transform.getScaleY() == 1) {<NEW_LINE>painter.paint(g, x, y, width, height, 1);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// scale rectangle<NEW_LINE>Rectangle2D.Double scaledRect = scale(transform, x, y, width, height);<NEW_LINE>try {<NEW_LINE>// unscale to factor 1.0 and move origin (to whole numbers)<NEW_LINE>g.setTransform(new AffineTransform(1, 0, 0, 1, Math.floor(scaledRect.x), Math.<MASK><NEW_LINE>int swidth = (int) scaledRect.width;<NEW_LINE>int sheight = (int) scaledRect.height;<NEW_LINE>// paint<NEW_LINE>painter.paint(g, 0, 0, swidth, sheight, transform.getScaleX());<NEW_LINE>} finally {<NEW_LINE>// restore original transform<NEW_LINE>g.setTransform(transform);<NEW_LINE>}<NEW_LINE>} | floor(scaledRect.y))); |
860,244 | public void split() {<NEW_LINE>if (chord.isVip()) {<NEW_LINE>logger.info("VIP split {}, {} origins on {}", chord, origins.size(<MASK><NEW_LINE>}<NEW_LINE>// Detect all partitions of consistent heads in this chord<NEW_LINE>getAllPartitions();<NEW_LINE>logger.debug("allPartitions: {}", allPartitions);<NEW_LINE>if (rootStem != null) {<NEW_LINE>// Detect all sub-stems of the (root) chord stem<NEW_LINE>Map<StemInter, List<Partition>> subStems = getSubStems();<NEW_LINE>if (subStems != null) {<NEW_LINE>StemInter lastSubStem = null;<NEW_LINE>for (Entry<StemInter, List<Partition>> entry : subStems.entrySet()) {<NEW_LINE>lastSubStem = entry.getKey();<NEW_LINE>processStem(lastSubStem, entry.getValue());<NEW_LINE>}<NEW_LINE>// Beams attached to last sub-stem?<NEW_LINE>for (Relation rel : sig.getRelations(rootStem, BeamStemRelation.class)) {<NEW_LINE>BeamStemRelation oldRel = (BeamStemRelation) rel;<NEW_LINE>BeamStemRelation newRel = new BeamStemRelation();<NEW_LINE>newRel.setGrade(oldRel.getGrade());<NEW_LINE>newRel.setBeamPortion(oldRel.getBeamPortion());<NEW_LINE>newRel.setExtensionPoint(oldRel.getExtensionPoint());<NEW_LINE>sig.addEdge(sig.getEdgeSource(oldRel), lastSubStem, newRel);<NEW_LINE>sig.removeEdge(oldRel);<NEW_LINE>}<NEW_LINE>rootStem.remove();<NEW_LINE>} else {<NEW_LINE>// Shared mode<NEW_LINE>processStem(rootStem, allPartitions);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// No stem involved, hence dispatch the whole heads<NEW_LINE>// TODO: to be implemented<NEW_LINE>}<NEW_LINE>chord.remove();<NEW_LINE>} | ), side.opposite()); |
1,823,692 | protected void encodeMarkup(FacesContext context, TextEditor editor) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String clientId = editor.getClientId(context);<NEW_LINE>String valueToRender = sanitizeHtml(context, editor, ComponentUtils.getValueToRender(context, editor));<NEW_LINE>String inputId = clientId + "_input";<NEW_LINE>String editorId = clientId + "_editor";<NEW_LINE>UIComponent toolbar = editor.getFacet("toolbar");<NEW_LINE>String style = editor.getStyle();<NEW_LINE>String styleClass = createStyleClass(editor, TextEditor.EDITOR_CLASS);<NEW_LINE>writer.startElement("div", editor);<NEW_LINE>writer.writeAttribute("id", clientId, null);<NEW_LINE>writer.writeAttribute("class", styleClass, null);<NEW_LINE>if (style != null) {<NEW_LINE>writer.writeAttribute("style", style, null);<NEW_LINE>}<NEW_LINE>renderARIARequired(context, editor);<NEW_LINE>renderARIAInvalid(context, editor);<NEW_LINE>if (editor.isToolbarVisible() && ComponentUtils.shouldRenderFacet(toolbar)) {<NEW_LINE>writer.startElement("div", editor);<NEW_LINE>writer.writeAttribute(<MASK><NEW_LINE>writer.writeAttribute("class", "ui-editor-toolbar", null);<NEW_LINE>toolbar.encodeAll(context);<NEW_LINE>writer.endElement("div");<NEW_LINE>}<NEW_LINE>writer.startElement("div", editor);<NEW_LINE>writer.writeAttribute("id", editorId, null);<NEW_LINE>if (valueToRender != null) {<NEW_LINE>writer.write(valueToRender);<NEW_LINE>}<NEW_LINE>writer.endElement("div");<NEW_LINE>renderHiddenInput(context, inputId, valueToRender, editor.isDisabled());<NEW_LINE>writer.endElement("div");<NEW_LINE>} | "id", clientId + "_toolbar", null); |
1,326,698 | private void zoom(double x, double y, double factor, boolean slow) {<NEW_LINE>final double w = center.getBoundsInParent().getWidth();<NEW_LINE>final double h = center<MASK><NEW_LINE>final double minx = center.getBoundsInParent().getMinX();<NEW_LINE>final double miny = center.getBoundsInParent().getMinY();<NEW_LINE>double dw = w * (factor - 1);<NEW_LINE>double xr = 2 * (w / 2 - (x - minx)) / w;<NEW_LINE>double dh = h * (factor - 1);<NEW_LINE>double yr = 2 * (h / 2 - (y - miny)) / h;<NEW_LINE>if (slow) {<NEW_LINE>ScaleTransition st = new ScaleTransition(Duration.millis(200), center);<NEW_LINE>st.setToX(center.getScaleX() * factor);<NEW_LINE>st.setToY(center.getScaleY() * factor);<NEW_LINE>st.setInterpolator(Interpolator.LINEAR);<NEW_LINE>TranslateTransition tt = new TranslateTransition(Duration.millis(100), center);<NEW_LINE>tt.setToX(center.getTranslateX() + xr * dw / 2);<NEW_LINE>tt.setToY(center.getTranslateY() + yr * dh / 2);<NEW_LINE>tt.setInterpolator(Interpolator.EASE_IN);<NEW_LINE>ParallelTransition pt = new ParallelTransition(st, tt);<NEW_LINE>pt.setOnFinished(new EventHandler<ActionEvent>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(ActionEvent event) {<NEW_LINE>alignNeighbours();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>pt.play();<NEW_LINE>} else {<NEW_LINE>center.setScaleX(center.getScaleX() * factor);<NEW_LINE>center.setScaleY(center.getScaleY() * factor);<NEW_LINE>move(xr * dw / 2, yr * dh / 2);<NEW_LINE>alignNeighbours();<NEW_LINE>}<NEW_LINE>} | .getBoundsInParent().getHeight(); |
227,253 | public static void handleClassPath(CommandLine line) {<NEW_LINE>String DCP = null;<NEW_LINE>java.util.Properties properties = line.getOptionProperties("D");<NEW_LINE>for (String propertyName : properties.stringPropertyNames()) {<NEW_LINE>if (propertyName.equals("CP")) {<NEW_LINE>DCP = properties.getProperty(propertyName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (line.hasOption("projectCP") && DCP != null) {<NEW_LINE>throw new IllegalArgumentException("Ambiguous classpath: both -projectCP and -DCP are defined");<NEW_LINE>}<NEW_LINE>String[] cpEntries = null;<NEW_LINE>if (line.hasOption("projectCP")) {<NEW_LINE>cpEntries = line.getOptionValue("projectCP").split(File.pathSeparator);<NEW_LINE>} else if (DCP != null) {<NEW_LINE>cpEntries = DCP.split(File.pathSeparator);<NEW_LINE>}<NEW_LINE>if (cpEntries != null) {<NEW_LINE>ClassPathHandler.getInstance().changeTargetClassPath(cpEntries);<NEW_LINE>}<NEW_LINE>if (line.hasOption("target")) {<NEW_LINE>String target = line.getOptionValue("target");<NEW_LINE>ClassPathHandler.getInstance().addElementToTargetProjectClassPath(target);<NEW_LINE>}<NEW_LINE>if (line.hasOption("evosuiteCP")) {<NEW_LINE>String <MASK><NEW_LINE>String[] entries = entry.split(File.pathSeparator);<NEW_LINE>ClassPathHandler.getInstance().setEvoSuiteClassPath(entries);<NEW_LINE>}<NEW_LINE>} | entry = line.getOptionValue("evosuiteCP"); |
1,840,940 | void jarHellCheck(PluginInfo candidateInfo, Path candidateDir, Path pluginsDir, Path modulesDir) throws Exception {<NEW_LINE>// create list of current jars in classpath<NEW_LINE>final Set<URL> classpath = JarHell.parseClassPath().stream().filter(url -> {<NEW_LINE>try {<NEW_LINE>return url.toURI().getPath().matches(LIB_TOOLS_PLUGIN_CLI_CLASSPATH_JAR) == false;<NEW_LINE>} catch (final URISyntaxException e) {<NEW_LINE>throw new AssertionError(e);<NEW_LINE>}<NEW_LINE>}).collect(Collectors.toSet());<NEW_LINE>// read existing bundles. this does some checks on the installation too.<NEW_LINE>Set<PluginsService.Bundle> bundles = new HashSet<>(PluginsService.getPluginBundles(pluginsDir));<NEW_LINE>bundles.addAll(PluginsService.getModuleBundles(modulesDir));<NEW_LINE>bundles.add(new PluginsService.Bundle(candidateInfo, candidateDir));<NEW_LINE>List<PluginsService.Bundle> <MASK><NEW_LINE>// check jarhell of all plugins so we know this plugin and anything depending on it are ok together<NEW_LINE>// TODO: optimize to skip any bundles not connected to the candidate plugin?<NEW_LINE>Map<String, Set<URL>> transitiveUrls = new HashMap<>();<NEW_LINE>for (PluginsService.Bundle bundle : sortedBundles) {<NEW_LINE>PluginsService.checkBundleJarHell(classpath, bundle, transitiveUrls);<NEW_LINE>}<NEW_LINE>// TODO: no jars should be an error<NEW_LINE>// TODO: verify the classname exists in one of the jars!<NEW_LINE>} | sortedBundles = PluginsService.sortBundles(bundles); |
731,965 | public Request<DescribeTimeToLiveRequest> marshall(DescribeTimeToLiveRequest describeTimeToLiveRequest) {<NEW_LINE>if (describeTimeToLiveRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DescribeTimeToLiveRequest)");<NEW_LINE>}<NEW_LINE>Request<DescribeTimeToLiveRequest> request = new DefaultRequest<DescribeTimeToLiveRequest>(describeTimeToLiveRequest, "AmazonDynamoDB");<NEW_LINE>String target = "DynamoDB_20120810.DescribeTimeToLive";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (describeTimeToLiveRequest.getTableName() != null) {<NEW_LINE>String tableName = describeTimeToLiveRequest.getTableName();<NEW_LINE>jsonWriter.name("TableName");<NEW_LINE>jsonWriter.value(tableName);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.0");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | t.getMessage(), t); |
703,869 | public static byte[] attributesFromSecretKey(KeyType slot, CanonicalizedSecretKey secretKey, KeyFormat formatForKeyType) throws IOException {<NEW_LINE>if (secretKey.isRSA()) {<NEW_LINE>return attributesForRsaKey(secretKey.getBitStrength<MASK><NEW_LINE>} else if (secretKey.isEC()) {<NEW_LINE>byte[] oid = new ASN1ObjectIdentifier(secretKey.getCurveOid()).getEncoded();<NEW_LINE>byte[] attrs = new byte[1 + (oid.length - 2) + 1];<NEW_LINE>if (slot.equals(KeyType.ENCRYPT))<NEW_LINE>attrs[0] = PublicKeyAlgorithmTags.ECDH;<NEW_LINE>else {<NEW_LINE>// SIGN and AUTH is ECDSA<NEW_LINE>attrs[0] = PublicKeyAlgorithmTags.ECDSA;<NEW_LINE>}<NEW_LINE>System.arraycopy(oid, 2, attrs, 1, (oid.length - 2));<NEW_LINE>attrs[attrs.length - 1] = (byte) 0xff;<NEW_LINE>return attrs;<NEW_LINE>} else {<NEW_LINE>throw new IOException("Unsupported key type");<NEW_LINE>}<NEW_LINE>} | (), (RsaKeyFormat) formatForKeyType); |
1,818,258 | // Visible for testing<NEW_LINE>static Sampler configureSampler(String sampler, ConfigProperties config, ClassLoader serviceClassLoader) {<NEW_LINE>NamedSpiManager<Sampler> spiSamplersManager = SpiUtil.loadConfigurable(ConfigurableSamplerProvider.class, ConfigurableSamplerProvider::getName, ConfigurableSamplerProvider::createSampler, config, serviceClassLoader);<NEW_LINE>switch(sampler) {<NEW_LINE>case "always_on":<NEW_LINE>return Sampler.alwaysOn();<NEW_LINE>case "always_off":<NEW_LINE>return Sampler.alwaysOff();<NEW_LINE>case "traceidratio":<NEW_LINE>{<NEW_LINE>Double ratio = config.getDouble("otel.traces.sampler.arg");<NEW_LINE>if (ratio == null) {<NEW_LINE>ratio = 1.0d;<NEW_LINE>}<NEW_LINE>return Sampler.traceIdRatioBased(ratio);<NEW_LINE>}<NEW_LINE>case "parentbased_always_on":<NEW_LINE>return Sampler.parentBased(Sampler.alwaysOn());<NEW_LINE>case "parentbased_always_off":<NEW_LINE>return Sampler.parentBased(Sampler.alwaysOff());<NEW_LINE>case "parentbased_traceidratio":<NEW_LINE>{<NEW_LINE>Double ratio = config.getDouble("otel.traces.sampler.arg");<NEW_LINE>if (ratio == null) {<NEW_LINE>ratio = 1.0d;<NEW_LINE>}<NEW_LINE>return Sampler.parentBased<MASK><NEW_LINE>}<NEW_LINE>default:<NEW_LINE>Sampler spiSampler = spiSamplersManager.getByName(sampler);<NEW_LINE>if (spiSampler == null) {<NEW_LINE>throw new ConfigurationException("Unrecognized value for otel.traces.sampler: " + sampler);<NEW_LINE>}<NEW_LINE>return spiSampler;<NEW_LINE>}<NEW_LINE>} | (Sampler.traceIdRatioBased(ratio)); |
1,391,732 | private void genInterfaceMethodDecl(StringBuilder sb, Type iface, MethodSymbol mi, ClassSymbol rootType) {<NEW_LINE>Types types = Types.instance(JavacPlugin.instance().getContext());<NEW_LINE>mi = (MethodSymbol) mi.asMemberOf(iface, types);<NEW_LINE>if ((mi.isDefault() && !implementsMethod(rootType, mi)) || mi.isStatic() || isSynthetic(mi)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (mi.getAnnotation(ExtensionMethod.class) != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isObjectMethod(mi)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String returnType = eraseParams(mi.getReturnType());<NEW_LINE>sb.append(" public ")./*append( getTypeVarList( mi ) ).append( ' ' ).*/<NEW_LINE>append(returnType).append(' ').append(mi.flatName()).append("(");<NEW_LINE>List<VarSymbol> params = mi.getParameters();<NEW_LINE>for (int i = 0; i < params.size(); i++) {<NEW_LINE>VarSymbol <MASK><NEW_LINE>sb.append(' ').append(eraseParams(pi.type)).append(" p").append(i);<NEW_LINE>sb.append(i < params.size() - 1 ? ',' : ' ');<NEW_LINE>}<NEW_LINE>sb.append(") {\n").append(returnType.equals("void") ? " " : " return ").append(maybeCastReturnType(mi, returnType, rootType));<NEW_LINE>if (!mi.getReturnType().isPrimitive()) {<NEW_LINE>sb.append(RuntimeMethods.class.getTypeName()).append(".coerce(");<NEW_LINE>}<NEW_LINE>if (!handleField(sb, mi)) {<NEW_LINE>handleMethod(sb, mi, params);<NEW_LINE>}<NEW_LINE>if (!mi.getReturnType().isPrimitive()) {<NEW_LINE>sb.append(", ").append(returnType).append(".class);\n");<NEW_LINE>} else {<NEW_LINE>sb.append(";\n");<NEW_LINE>}<NEW_LINE>sb.append(" }\n");<NEW_LINE>} | pi = params.get(i); |
1,407,740 | public static EvaluatedParams evaluateMessageParams(EvalContext context) {<NEW_LINE>List<Expression> params = context.getParams();<NEW_LINE>if (params.size() < 2) {<NEW_LINE>return EMPTY;<NEW_LINE>}<NEW_LINE>Supplier<?>[] allResults = new Supplier[params.size()];<NEW_LINE>List<CompletableFuture<?>> asyncResults = null;<NEW_LINE>int i = 0;<NEW_LINE>CompletedStage<?> failure = null;<NEW_LINE>Iterator<Expression> it = params.subList(1, params.size()).iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>CompletionStage<?> result = context.evaluate(it.next());<NEW_LINE>if (result instanceof CompletedStage) {<NEW_LINE>CompletedStage<?> completed = (CompletedStage<?>) result;<NEW_LINE>allResults[i++] = completed;<NEW_LINE>if (completed.isFailure()) {<NEW_LINE>failure = completed;<NEW_LINE>}<NEW_LINE>// No async computation needed<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>CompletableFuture<?> fu = result.toCompletableFuture();<NEW_LINE>if (asyncResults == null) {<NEW_LINE>asyncResults = new ArrayList<>();<NEW_LINE>}<NEW_LINE>asyncResults.add(fu);<NEW_LINE>allResults[i++] = Futures.toSupplier(fu);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CompletionStage<?> cs;<NEW_LINE>if (asyncResults == null) {<NEW_LINE>cs = failure != null ? failure : CompletedStage.VOID;<NEW_LINE>} else if (asyncResults.size() == 1) {<NEW_LINE>cs = asyncResults.get(0);<NEW_LINE>} else {<NEW_LINE>cs = CompletableFuture.allOf(asyncResults.toArray(new CompletableFuture[0]));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | return new EvaluatedParams(cs, allResults); |
65,741 | protected List<ClassificationResult<BytesRef>> buildListFromTopDocs(TopDocs topDocs) throws IOException {<NEW_LINE>Map<BytesRef, Integer> classCounts = new HashMap<>();<NEW_LINE>// this is a boost based on class ranking positions in topDocs<NEW_LINE>Map<BytesRef, Double> // this is a boost based on class ranking positions in topDocs<NEW_LINE>classBoosts = new HashMap<>();<NEW_LINE>float maxScore = topDocs.totalHits.value == 0 ? Float.NaN : topDocs.scoreDocs[0].score;<NEW_LINE>for (ScoreDoc scoreDoc : topDocs.scoreDocs) {<NEW_LINE>IndexableField[] storableFields = indexSearcher.doc(scoreDoc.doc).getFields(classFieldName);<NEW_LINE>for (IndexableField singleStorableField : storableFields) {<NEW_LINE>if (singleStorableField != null) {<NEW_LINE>BytesRef cl = new BytesRef(singleStorableField.stringValue());<NEW_LINE>// update count<NEW_LINE>classCounts.merge(cl, 1, Integer::sum);<NEW_LINE>// update boost, the boost is based on the best score<NEW_LINE>Double totalBoost = classBoosts.get(cl);<NEW_LINE>double singleBoost = scoreDoc.score / maxScore;<NEW_LINE>if (totalBoost != null) {<NEW_LINE>classBoosts.put(cl, totalBoost + singleBoost);<NEW_LINE>} else {<NEW_LINE>classBoosts.put(cl, singleBoost);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<ClassificationResult<BytesRef>> returnList = new ArrayList<>();<NEW_LINE>List<ClassificationResult<BytesRef>> temporaryList = new ArrayList<>();<NEW_LINE>int sumdoc = 0;<NEW_LINE>for (Map.Entry<BytesRef, Integer> entry : classCounts.entrySet()) {<NEW_LINE><MASK><NEW_LINE>// the boost is normalized to be 0<b<1<NEW_LINE>Double // the boost is normalized to be 0<b<1<NEW_LINE>normBoost = classBoosts.get(entry.getKey()) / count;<NEW_LINE>temporaryList.add(new ClassificationResult<>(entry.getKey().clone(), (count * normBoost) / (double) k));<NEW_LINE>sumdoc += count;<NEW_LINE>}<NEW_LINE>// correction<NEW_LINE>if (sumdoc < k) {<NEW_LINE>for (ClassificationResult<BytesRef> cr : temporaryList) {<NEW_LINE>returnList.add(new ClassificationResult<>(cr.getAssignedClass(), cr.getScore() * k / (double) sumdoc));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>returnList = temporaryList;<NEW_LINE>}<NEW_LINE>return returnList;<NEW_LINE>} | Integer count = entry.getValue(); |
432,378 | public StockMoveLine compute(StockMoveLine stockMoveLine, StockMove stockMove) throws AxelorException {<NEW_LINE>BigDecimal unitPriceUntaxed = BigDecimal.ZERO;<NEW_LINE>BigDecimal companyPurchasePrice = BigDecimal.ZERO;<NEW_LINE>if (stockMoveLine.getProduct() != null && stockMove != null) {<NEW_LINE>if ((stockMove.getTypeSelect() == StockMoveRepository.TYPE_INCOMING && stockMove.getIsReversion()) || (stockMove.getTypeSelect() == StockMoveRepository.TYPE_OUTGOING && !stockMove.getIsReversion())) {<NEW_LINE>// customer delivery or customer return<NEW_LINE>unitPriceUntaxed = (BigDecimal) productCompanyService.get(stockMoveLine.getProduct(), "salePrice", stockMove.getCompany());<NEW_LINE>BigDecimal wapPrice = computeFromStockLocation(stockMoveLine, stockMove.getToStockLocation());<NEW_LINE>stockMoveLine.setWapPrice(wapPrice);<NEW_LINE>} else if ((stockMove.getTypeSelect() == StockMoveRepository.TYPE_OUTGOING && stockMove.getIsReversion()) || (stockMove.getTypeSelect() == StockMoveRepository.TYPE_INCOMING && !stockMove.getIsReversion())) {<NEW_LINE>// supplier return or supplier delivery<NEW_LINE>BigDecimal shippingCoef = shippingCoefService.getShippingCoef(stockMoveLine.getProduct(), stockMove.getPartner(), stockMove.getCompany(), stockMoveLine.getRealQty());<NEW_LINE>companyPurchasePrice = (BigDecimal) productCompanyService.get(stockMoveLine.getProduct(), "purchasePrice", stockMove.getCompany());<NEW_LINE>;<NEW_LINE><MASK><NEW_LINE>} else if (stockMove.getTypeSelect() == StockMoveRepository.TYPE_INTERNAL && stockMove.getFromStockLocation() != null && stockMove.getFromStockLocation().getTypeSelect() != StockLocationRepository.TYPE_VIRTUAL) {<NEW_LINE>unitPriceUntaxed = computeFromStockLocation(stockMoveLine, stockMove.getFromStockLocation());<NEW_LINE>} else {<NEW_LINE>unitPriceUntaxed = (BigDecimal) productCompanyService.get(stockMoveLine.getProduct(), "costPrice", stockMove.getCompany());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>stockMoveLine.setCompanyPurchasePrice(companyPurchasePrice);<NEW_LINE>stockMoveLine.setUnitPriceUntaxed(unitPriceUntaxed);<NEW_LINE>stockMoveLine.setUnitPriceTaxed(unitPriceUntaxed);<NEW_LINE>stockMoveLine.setCompanyUnitPriceUntaxed(unitPriceUntaxed);<NEW_LINE>return stockMoveLine;<NEW_LINE>} | unitPriceUntaxed = companyPurchasePrice.multiply(shippingCoef); |
682,034 | private void renderProgressBar(List<Polygon> rectangles) {<NEW_LINE>if (rectangles.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Canvas container = getPrimitiveContainer().getLayer(0);<NEW_LINE>final TimeUnit timeUnit = input.getProgressBarTimeUnit();<NEW_LINE>final ITaskSceneTask task = ((ITaskActivity<ITaskSceneTask>) rectangles.get(0).<MASK><NEW_LINE>float length = task.getDuration().getLength(timeUnit);<NEW_LINE>float completed = task.getCompletionPercentage() * length / 100f;<NEW_LINE>Polygon lastProgressRectangle = null;<NEW_LINE>for (Polygon nextRectangle : rectangles) {<NEW_LINE>final ITaskActivity<ITaskSceneTask> nextActivity = (ITaskActivity<ITaskSceneTask>) nextRectangle.getModelObject();<NEW_LINE>final float nextLength = nextActivity.getDuration().getLength(timeUnit);<NEW_LINE>final int nextProgressBarLength;<NEW_LINE>if (completed > nextLength || nextActivity.getIntensity() == 0f) {<NEW_LINE>nextProgressBarLength = nextRectangle.getWidth();<NEW_LINE>if (nextActivity.getIntensity() > 0f) {<NEW_LINE>completed -= nextLength;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>nextProgressBarLength = (int) (nextRectangle.getWidth() * (completed / nextLength));<NEW_LINE>completed = 0f;<NEW_LINE>}<NEW_LINE>final Rectangle nextProgressBar = container.createRectangle(nextRectangle.getLeftX(), nextRectangle.getMiddleY() - 1, nextProgressBarLength, 3);<NEW_LINE>nextProgressBar.setStyle(completed == 0f ? "task.progress.end" : "task.progress");<NEW_LINE>getPrimitiveContainer().getLayer(0).bind(nextProgressBar, task);<NEW_LINE>if (completed == 0) {<NEW_LINE>lastProgressRectangle = nextRectangle;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lastProgressRectangle == null) {<NEW_LINE>lastProgressRectangle = rectangles.get(rectangles.size() - 1);<NEW_LINE>}<NEW_LINE>// createDownSideText(lastProgressRectangle);<NEW_LINE>} | getModelObject()).getOwner(); |
63,826 | public static DescribeLiveDomainOnlineUserNumResponse unmarshall(DescribeLiveDomainOnlineUserNumResponse describeLiveDomainOnlineUserNumResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLiveDomainOnlineUserNumResponse.setRequestId(_ctx.stringValue("DescribeLiveDomainOnlineUserNumResponse.RequestId"));<NEW_LINE>describeLiveDomainOnlineUserNumResponse.setUserCount(_ctx.integerValue("DescribeLiveDomainOnlineUserNumResponse.UserCount"));<NEW_LINE>describeLiveDomainOnlineUserNumResponse.setStreamCount(_ctx.integerValue("DescribeLiveDomainOnlineUserNumResponse.StreamCount"));<NEW_LINE>List<LiveStreamOnlineUserNumInfo> onlineUserInfo <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLiveDomainOnlineUserNumResponse.OnlineUserInfo.Length"); i++) {<NEW_LINE>LiveStreamOnlineUserNumInfo liveStreamOnlineUserNumInfo = new LiveStreamOnlineUserNumInfo();<NEW_LINE>liveStreamOnlineUserNumInfo.setStreamName(_ctx.stringValue("DescribeLiveDomainOnlineUserNumResponse.OnlineUserInfo[" + i + "].StreamName"));<NEW_LINE>List<Info> infos = new ArrayList<Info>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeLiveDomainOnlineUserNumResponse.OnlineUserInfo[" + i + "].Infos.Length"); j++) {<NEW_LINE>Info info = new Info();<NEW_LINE>info.setUserNumber(_ctx.longValue("DescribeLiveDomainOnlineUserNumResponse.OnlineUserInfo[" + i + "].Infos[" + j + "].UserNumber"));<NEW_LINE>info.setTranscodeTemplate(_ctx.stringValue("DescribeLiveDomainOnlineUserNumResponse.OnlineUserInfo[" + i + "].Infos[" + j + "].TranscodeTemplate"));<NEW_LINE>infos.add(info);<NEW_LINE>}<NEW_LINE>liveStreamOnlineUserNumInfo.setInfos(infos);<NEW_LINE>onlineUserInfo.add(liveStreamOnlineUserNumInfo);<NEW_LINE>}<NEW_LINE>describeLiveDomainOnlineUserNumResponse.setOnlineUserInfo(onlineUserInfo);<NEW_LINE>return describeLiveDomainOnlineUserNumResponse;<NEW_LINE>} | = new ArrayList<LiveStreamOnlineUserNumInfo>(); |
1,529,683 | // Convert our data to DynamoDB attribute values<NEW_LINE>private static Map<String, AttributeValue> toAttributeValueMap(Map<String, Object> engineDetails) {<NEW_LINE>Map<String, AttributeValue> options = new HashMap<>();<NEW_LINE>options.put("name", AttributeValue.builder().s((String) engineDetails.get("name")).build());<NEW_LINE>options.put("description", AttributeValue.builder().s((String) engineDetails.get("description")).build());<NEW_LINE>Map<String, AttributeValue> <MASK><NEW_LINE>for (Map.Entry<Database.RDS_INSTANCE, Map<String, Object>> instance : ((EnumMap<Database.RDS_INSTANCE, Map<String, Object>>) engineDetails.get("instances")).entrySet()) {<NEW_LINE>Map<String, Object> instanceDetails = instance.getValue();<NEW_LINE>Map<String, AttributeValue> versions = new HashMap<>();<NEW_LINE>versions.put("class", AttributeValue.builder().s((String) instanceDetails.get("class")).build());<NEW_LINE>versions.put("description", AttributeValue.builder().s((String) instanceDetails.get("description")).build());<NEW_LINE>List<AttributeValue> instanceVersions = new ArrayList<>();<NEW_LINE>for (Map<String, String> instanceVersion : (List<Map<String, String>>) instanceDetails.get("versions")) {<NEW_LINE>instanceVersions.add(AttributeValue.builder().m(instanceVersion.entrySet().stream().collect(Collectors.toMap(entry -> entry.getKey(), entry -> AttributeValue.builder().s(entry.getValue()).build()))).build());<NEW_LINE>}<NEW_LINE>versions.put("versions", AttributeValue.builder().l(instanceVersions).build());<NEW_LINE>instances.put(instance.getKey().name(), AttributeValue.builder().m(versions).build());<NEW_LINE>}<NEW_LINE>options.put("instances", AttributeValue.builder().m(instances).build());<NEW_LINE>return options;<NEW_LINE>} | instances = new HashMap<>(); |
901,748 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String clusterName, String applicationName, 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 (clusterName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (applicationName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter applicationName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, applicationName, this.client.getApiVersion(), accept, context);<NEW_LINE>} | this.client.mergeContext(context); |
149,848 | protected Promise<Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>> run(final Context context) throws Exception {<NEW_LINE>final SettablePromise<Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>> result = Promises.settable();<NEW_LINE>InternalUtil.fastFailAfter(p -> {<NEW_LINE>if (p.isFailed()) {<NEW_LINE>result.fail(p.getError());<NEW_LINE>} else {<NEW_LINE>result.done(tuple(_tasks._1().get(), _tasks._2().get(), _tasks._3().get(), _tasks._4().get(), _tasks._5().get(), _tasks._6().get(), _tasks._7().get(), _tasks._8().get()));<NEW_LINE>}<NEW_LINE>}, _tasks._1(), _tasks._2(), _tasks._3(), _tasks._4(), _tasks._5(), _tasks._6(), _tasks._7(), _tasks._8());<NEW_LINE>_tasks.forEach(t -> context.run((<MASK><NEW_LINE>return result;<NEW_LINE>} | Task<?>) t)); |
856,820 | private void init() {<NEW_LINE>this.typePublic = new ConcurrentHashMap<String, String>();<NEW_LINE>this.typeUri = new <MASK><NEW_LINE>Map<String, NamespaceDefinition> namespaceDefinitionRegistry = new HashMap<String, NamespaceDefinition>();<NEW_LINE>ResourceLoader classLoader = loaderCache.getResourceLoader(project, null);<NEW_LINE>schemaMappings = getSchemaMappings(classLoader);<NEW_LINE>if (schemaMappings != null) {<NEW_LINE>for (String key : schemaMappings.keySet()) {<NEW_LINE>String path = schemaMappings.get(key);<NEW_LINE>// add the resolved path to the list of uris<NEW_LINE>String resolvedPath = resolveXsdPathOnClasspath(path, classLoader);<NEW_LINE>if (resolvedPath != null) {<NEW_LINE>typeUri.put(key, resolvedPath);<NEW_LINE>// collect base information to later extract the default uri<NEW_LINE>String namespaceUri = getTargetNamespace(resolvedPath);<NEW_LINE>if (namespaceDefinitionRegistry.containsKey(namespaceUri)) {<NEW_LINE>namespaceDefinitionRegistry.get(namespaceUri).addSchemaLocation(key);<NEW_LINE>namespaceDefinitionRegistry.get(namespaceUri).addUri(path);<NEW_LINE>} else {<NEW_LINE>NamespaceDefinition namespaceDefinition = new NamespaceDefinition(null);<NEW_LINE>namespaceDefinition.addSchemaLocation(key);<NEW_LINE>namespaceDefinition.setNamespaceUri(namespaceUri);<NEW_LINE>namespaceDefinition.addUri(path);<NEW_LINE>namespaceDefinitionRegistry.put(namespaceUri, namespaceDefinition);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add catalog entry to namespace uri<NEW_LINE>for (NamespaceDefinition definition : namespaceDefinitionRegistry.values()) {<NEW_LINE>String namespaceKey = definition.getNamespaceUri();<NEW_LINE>String defaultUri = definition.getDefaultUri();<NEW_LINE>String resolvedPath = resolveXsdPathOnClasspath(defaultUri, classLoader);<NEW_LINE>if (resolvedPath != null) {<NEW_LINE>typePublic.put(namespaceKey, resolvedPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ConcurrentHashMap<String, String>(); |
1,631,653 | public void marshall(StartTaskRequest startTaskRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (startTaskRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(startTaskRequest.getCluster(), CLUSTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(startTaskRequest.getContainerInstances(), CONTAINERINSTANCES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(startTaskRequest.getEnableExecuteCommand(), ENABLEEXECUTECOMMAND_BINDING);<NEW_LINE>protocolMarshaller.marshall(startTaskRequest.getGroup(), GROUP_BINDING);<NEW_LINE>protocolMarshaller.marshall(startTaskRequest.getNetworkConfiguration(), NETWORKCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(startTaskRequest.getOverrides(), OVERRIDES_BINDING);<NEW_LINE>protocolMarshaller.marshall(startTaskRequest.getPropagateTags(), PROPAGATETAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(startTaskRequest.getReferenceId(), REFERENCEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(startTaskRequest.getStartedBy(), STARTEDBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(startTaskRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(startTaskRequest.getTaskDefinition(), TASKDEFINITION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | startTaskRequest.getEnableECSManagedTags(), ENABLEECSMANAGEDTAGS_BINDING); |
115,524 | boolean breakDownDestructure(AbstractCompiler compiler) {<NEW_LINE>if (!NodeUtil.isLhsByDestructuring(getLhs())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Node rootTarget = NodeUtil.getRootTarget(getLhs());<NEW_LINE>checkState(rootTarget.getParent().isDestructuringLhs());<NEW_LINE>if (!NodeUtil.isNameDeclaration(rootTarget.getGrandparent())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Node definitionNode = rootTarget.getGrandparent();<NEW_LINE>Node prev = null;<NEW_LINE>for (Node n : NodeUtil.findLhsNodesInNode(rootTarget.getParent())) {<NEW_LINE>n.detach();<NEW_LINE>Node <MASK><NEW_LINE>if (prev == null) {<NEW_LINE>definitionNode.replaceWith(temp);<NEW_LINE>compiler.reportChangeToEnclosingScope(temp);<NEW_LINE>} else {<NEW_LINE>temp.insertAfter(prev);<NEW_LINE>compiler.reportChangeToEnclosingScope(temp);<NEW_LINE>temp.srcrefTree(prev);<NEW_LINE>}<NEW_LINE>prev = temp;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | temp = IR.var(n); |
1,236,016 | private void appendElementValueWhereClause(final StringBuilder whereClause, final List<Object> whereClauseSqlParams) {<NEW_LINE>if (p_C_ElementValue_ID > 0 && p_C_ElementValue_ID_To > 0) {<NEW_LINE>final I_C_ElementValue elementValueFrom = InterfaceWrapperHelper.create(getCtx(), p_C_ElementValue_ID, I_C_ElementValue.class, ITrx.TRXNAME_None);<NEW_LINE>final I_C_ElementValue elementValueTo = InterfaceWrapperHelper.create(getCtx(), p_C_ElementValue_ID_To, I_C_ElementValue.class, ITrx.TRXNAME_None);<NEW_LINE>final LpadQueryFilterModifier lpadModifier = new LpadQueryFilterModifier(20, "0");<NEW_LINE>final List<Integer> elementValueIds = Services.get(IQueryBL.class).createQueryBuilder(I_C_ElementValue.class, this).addCompareFilter(I_C_ElementValue.COLUMNNAME_Value, Operator.GREATER_OR_EQUAL, elementValueFrom.getValue(), lpadModifier).addCompareFilter(I_C_ElementValue.COLUMNNAME_Value, Operator.LESS_OR_EQUAL, elementValueTo.getValue(), lpadModifier).create().listIds();<NEW_LINE>final String sql = DB.buildSqlList(elementValueIds, whereClauseSqlParams);<NEW_LINE>whereClause.append(" AND ").append(AcctSchemaElementType.Account.getColumnName()).append<MASK><NEW_LINE>} else if (p_C_ElementValue_ID <= 0 && p_C_ElementValue_ID_To <= 0) {<NEW_LINE>// no accounts specified, nothing to do<NEW_LINE>return;<NEW_LINE>} else if (p_C_ElementValue_ID > 0) {<NEW_LINE>whereClause.append(" AND ").append(MReportTree.getWhereClause(getCtx(), p_PA_Hierarchy_ID, AcctSchemaElementType.Account, p_C_ElementValue_ID));<NEW_LINE>} else if (p_C_ElementValue_ID_To > 0) {<NEW_LINE>whereClause.append(" AND ").append(MReportTree.getWhereClause(getCtx(), p_PA_Hierarchy_ID, AcctSchemaElementType.Account, p_C_ElementValue_ID_To));<NEW_LINE>}<NEW_LINE>} | (" IN ").append(sql); |
808,281 | public void drawButton(float llx, float lly, float urx, float ury, String text, BaseFont bf, float size) {<NEW_LINE>if (llx > urx) {<NEW_LINE>float x = llx;<NEW_LINE>llx = urx;<NEW_LINE>urx = x;<NEW_LINE>}<NEW_LINE>if (lly > ury) {<NEW_LINE>float y = lly;<NEW_LINE>lly = ury;<NEW_LINE>ury = y;<NEW_LINE>}<NEW_LINE>// black rectangle not filled<NEW_LINE>saveState();<NEW_LINE>setColorStroke(new Color(0x00, 0x00, 0x00));<NEW_LINE>setLineWidth(1);<NEW_LINE>setLineCap(0);<NEW_LINE>rectangle(llx, lly, urx - llx, ury - lly);<NEW_LINE>stroke();<NEW_LINE>// silver rectangle filled<NEW_LINE>setLineWidth(1);<NEW_LINE>setLineCap(0);<NEW_LINE>setColorFill(new Color(0xC0, 0xC0, 0xC0));<NEW_LINE>rectangle(llx + 0.5f, lly + 0.5f, urx - llx - 1f, ury - lly - 1f);<NEW_LINE>fill();<NEW_LINE>// white lines<NEW_LINE>setColorStroke(new Color(MAX_COLOR_VALUE, MAX_COLOR_VALUE, MAX_COLOR_VALUE));<NEW_LINE>setLineWidth(1);<NEW_LINE>setLineCap(0);<NEW_LINE>moveTo(<MASK><NEW_LINE>lineTo(llx + 1f, ury - 1f);<NEW_LINE>lineTo(urx - 1f, ury - 1f);<NEW_LINE>stroke();<NEW_LINE>// dark grey lines<NEW_LINE>setColorStroke(new Color(0xA0, 0xA0, 0xA0));<NEW_LINE>setLineWidth(1);<NEW_LINE>setLineCap(0);<NEW_LINE>moveTo(llx + 1f, lly + 1f);<NEW_LINE>lineTo(urx - 1f, lly + 1f);<NEW_LINE>lineTo(urx - 1f, ury - 1f);<NEW_LINE>stroke();<NEW_LINE>// text<NEW_LINE>resetRGBColorFill();<NEW_LINE>beginText();<NEW_LINE>setFontAndSize(bf, size);<NEW_LINE>showTextAligned(PdfContentByte.ALIGN_CENTER, text, llx + (urx - llx) / 2, lly + (ury - lly - size) / 2, 0);<NEW_LINE>endText();<NEW_LINE>restoreState();<NEW_LINE>} | llx + 1f, lly + 1f); |
794,268 | /*<NEW_LINE>* encode the input data producing a Bcrypt base 64 String.<NEW_LINE>*<NEW_LINE>* @param a byte representation of the salt or the password<NEW_LINE>* @return the Bcrypt base64 String<NEW_LINE>*/<NEW_LINE>private static void encodeData(StringBuffer sb, byte[] data) {<NEW_LINE>if (// 192 bit key or 128 bit salt expected<NEW_LINE>data.length != 24 && data.length != 16) {<NEW_LINE>throw new DataLengthException("Invalid length: " + data.length + ", 24 for key or 16 for salt expected");<NEW_LINE>}<NEW_LINE>boolean salt = false;<NEW_LINE>if (// salt<NEW_LINE>data.length == 16) {<NEW_LINE>salt = true;<NEW_LINE>// zero padding<NEW_LINE>byte[] tmp = new byte[18];<NEW_LINE>System.arraycopy(data, 0, tmp, 0, data.length);<NEW_LINE>data = tmp;<NEW_LINE>} else // key<NEW_LINE>{<NEW_LINE>data[data.length <MASK><NEW_LINE>}<NEW_LINE>int len = data.length;<NEW_LINE>int a1, a2, a3;<NEW_LINE>int i;<NEW_LINE>for (i = 0; i < len; i += 3) {<NEW_LINE>a1 = data[i] & 0xff;<NEW_LINE>a2 = data[i + 1] & 0xff;<NEW_LINE>a3 = data[i + 2] & 0xff;<NEW_LINE>sb.append((char) encodingTable[(a1 >>> 2) & 0x3f]);<NEW_LINE>sb.append((char) encodingTable[((a1 << 4) | (a2 >>> 4)) & 0x3f]);<NEW_LINE>sb.append((char) encodingTable[((a2 << 2) | (a3 >>> 6)) & 0x3f]);<NEW_LINE>sb.append((char) encodingTable[a3 & 0x3f]);<NEW_LINE>}<NEW_LINE>if (// truncate padding<NEW_LINE>salt == true) {<NEW_LINE>sb.setLength(sb.length() - 2);<NEW_LINE>} else {<NEW_LINE>sb.setLength(sb.length() - 1);<NEW_LINE>}<NEW_LINE>} | - 1] = (byte) 0; |
18,938 | private JPanel createShaderStagePanel(final ParticleEditor editor, JPanel contentPanel, final boolean isVertexShader) {<NEW_LINE>JPanel buttonsPanel = new JPanel(<MASK><NEW_LINE>JLabel label = new JLabel(isVertexShader ? "Vertex Shader" : "Frag. Shader");<NEW_LINE>buttonsPanel.add(label);<NEW_LINE>JButton defaultButton = new JButton("Default");<NEW_LINE>buttonsPanel.add(defaultButton);<NEW_LINE>defaultButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent event) {<NEW_LINE>if (isVertexShader) {<NEW_LINE>shading.setVertexShaderFile(null);<NEW_LINE>} else {<NEW_LINE>shading.setFragmentShaderFile(null);<NEW_LINE>}<NEW_LINE>displayErrors();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JButton setButton = new JButton("Set");<NEW_LINE>buttonsPanel.add(setButton);<NEW_LINE>setButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent event) {<NEW_LINE>FileDialog dialog = new FileDialog(editor, isVertexShader ? "Open Vertex Shader File" : "Open Fragment Shader File", FileDialog.LOAD);<NEW_LINE>if (lastDir != null)<NEW_LINE>dialog.setDirectory(lastDir);<NEW_LINE>dialog.setVisible(true);<NEW_LINE>final String file = dialog.getFile();<NEW_LINE>final String dir = dialog.getDirectory();<NEW_LINE>if (dir == null || file == null || file.trim().length() == 0)<NEW_LINE>return;<NEW_LINE>lastDir = dir;<NEW_LINE>String path = new File(dir, file).getAbsolutePath();<NEW_LINE>if (isVertexShader) {<NEW_LINE>shading.setVertexShaderFile(path);<NEW_LINE>} else {<NEW_LINE>shading.setFragmentShaderFile(path);<NEW_LINE>}<NEW_LINE>displayErrors();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JButton reloadButton = new JButton("Reload");<NEW_LINE>buttonsPanel.add(reloadButton);<NEW_LINE>reloadButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent event) {<NEW_LINE>if (isVertexShader) {<NEW_LINE>shading.reloadVertexShader();<NEW_LINE>} else {<NEW_LINE>shading.reloadFragmentShader();<NEW_LINE>}<NEW_LINE>displayErrors();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JButton showButton = new JButton("Show");<NEW_LINE>buttonsPanel.add(showButton);<NEW_LINE>showButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent event) {<NEW_LINE>JTextArea text = new JTextArea(isVertexShader ? shading.vertexShaderCode : shading.fragmentShaderCode);<NEW_LINE>text.setEditable(false);<NEW_LINE>JOptionPane.showMessageDialog(editor, text, isVertexShader ? "Current vertex shader code" : "Current fragment shader code", JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return buttonsPanel;<NEW_LINE>} | new GridLayout(5, 1)); |
496,961 | public static void fromXmlNode(MMigration parent, Node stepNode) {<NEW_LINE>MMigrationStep mstep = new MMigrationStep(parent);<NEW_LINE>Element step = (Element) stepNode;<NEW_LINE>mstep.setSeqNo(Integer.parseInt(step.getAttribute("SeqNo")));<NEW_LINE>mstep.setStepType(step.getAttribute("StepType"));<NEW_LINE>mstep.setStatusCode(MMigrationStep.STATUSCODE_Unapplied);<NEW_LINE>mstep.saveEx();<NEW_LINE>Node comment = (Element) step.getElementsByTagName("Comments").item(0);<NEW_LINE>if (comment != null)<NEW_LINE>mstep.setComments(comment.getTextContent());<NEW_LINE>if (MMigrationStep.STEPTYPE_ApplicationDictionary.equals(mstep.getStepType())) {<NEW_LINE>NodeList <MASK><NEW_LINE>for (int i = 0; i < children.getLength(); i++) {<NEW_LINE>Element element = (Element) children.item(i);<NEW_LINE>mstep.setAction(element.getAttribute("Action"));<NEW_LINE>mstep.setAD_Table_ID(Integer.parseInt(element.getAttribute("AD_Table_ID")));<NEW_LINE>mstep.setRecord_ID(Integer.parseInt(element.getAttribute("Record_ID")));<NEW_LINE>NodeList data = element.getElementsByTagName("Data");<NEW_LINE>for (int j = 0; j < data.getLength(); j++) {<NEW_LINE>MMigrationData.fromXmlNode(mstep, data.item(j));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (MMigrationStep.STEPTYPE_SQLStatement.equals(mstep.getStepType())) {<NEW_LINE>mstep.setDBType(step.getAttribute("DBType"));<NEW_LINE>// If Parse is defined, set it accordingly, else, use the default or ignore<NEW_LINE>if (!step.getAttribute("Parse").equals("")) {<NEW_LINE>mstep.setParse("Y".equals(step.getAttribute("Parse")));<NEW_LINE>}<NEW_LINE>Node sql = step.getElementsByTagName("SQLStatement").item(0);<NEW_LINE>if (sql != null)<NEW_LINE>mstep.setSQLStatement(sql.getTextContent());<NEW_LINE>sql = step.getElementsByTagName("RollbackStatement").item(0);<NEW_LINE>if (sql != null)<NEW_LINE>mstep.setRollbackStatement(sql.getTextContent());<NEW_LINE>}<NEW_LINE>mstep.saveEx();<NEW_LINE>log.log(Level.CONFIG, mstep.getAD_Migration().toString() + ": Step " + mstep.getSeqNo() + " loaded");<NEW_LINE>} | children = step.getElementsByTagName("PO"); |
910,991 | public void message(final Contact contact, final Message message) throws OperationFailedException {<NEW_LINE>if (!this.connectionState.isConnected()) {<NEW_LINE>throw new IllegalStateException("Not connected to an IRC server.");<NEW_LINE>}<NEW_LINE>final String target = contact.getAddress();<NEW_LINE>// message format as forwarded by IRC server to clients:<NEW_LINE>// :<user> PRIVMSG <nick> :<message><NEW_LINE>final int maxMsgSize = calculateMaximumMessageSize(0, target);<NEW_LINE>if (maxMsgSize < message.getContent().length()) {<NEW_LINE>// Message is definitely too large to be sent to a standard IRC<NEW_LINE>// network. Sending is not attempted, since we would send a partial<NEW_LINE>// message, even though the user is not informed of this.<NEW_LINE>LOGGER.warn("Message for " + target + " is too large. At best you can send the message up to: " + message.getContent().substring(0, maxMsgSize));<NEW_LINE>throw new OperationFailedException("Message is too large for this IRC server.", OperationFailedException.ILLEGAL_ARGUMENT);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.irc.message(target, message.getContent());<NEW_LINE>LOGGER.trace("Message delivered to server successfully.");<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>LOGGER.trace("Failed to deliver message: " + <MASK><NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
1,797,543 | public void marshall(CreateTaskSetRequest createTaskSetRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createTaskSetRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createTaskSetRequest.getService(), SERVICE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTaskSetRequest.getCluster(), CLUSTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTaskSetRequest.getExternalId(), EXTERNALID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTaskSetRequest.getTaskDefinition(), TASKDEFINITION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTaskSetRequest.getNetworkConfiguration(), NETWORKCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTaskSetRequest.getLoadBalancers(), LOADBALANCERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTaskSetRequest.getServiceRegistries(), SERVICEREGISTRIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTaskSetRequest.getLaunchType(), LAUNCHTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTaskSetRequest.getCapacityProviderStrategy(), CAPACITYPROVIDERSTRATEGY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTaskSetRequest.getPlatformVersion(), PLATFORMVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTaskSetRequest.getScale(), SCALE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTaskSetRequest.getClientToken(), CLIENTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createTaskSetRequest.getTags(), TAGS_BINDING); |
419,185 | private void modify(HTTPSamplerBase sampler, String value) {<NEW_LINE>if (isPathExtension()) {<NEW_LINE>String oldPath = sampler.getPath();<NEW_LINE>int indexOfSessionId = oldPath.indexOf(SEMI_COLON + getArgumentName());<NEW_LINE>if (oldPath.contains(SEMI_COLON + getArgumentName())) {<NEW_LINE>int indexOfQuestionMark = oldPath.indexOf('?');<NEW_LINE>if (indexOfQuestionMark < 0) {<NEW_LINE>oldPath = oldPath.substring(0, indexOfSessionId);<NEW_LINE>} else {<NEW_LINE>oldPath = oldPath.substring(0, indexOfSessionId) + oldPath.substring(indexOfQuestionMark);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isPathExtensionNoEquals()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sampler.setPath(oldPath + SEMI_COLON + getArgumentName() + value);<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$ // $NON-NLS-2$<NEW_LINE>sampler.setPath(oldPath + SEMI_COLON + getArgumentName() + "=" + value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>sampler.getArguments().removeArgument(getArgumentName());<NEW_LINE>sampler.getArguments().addArgument(new HTTPArgument(getArgumentName(), <MASK><NEW_LINE>}<NEW_LINE>} | value, !encode())); |
860,609 | private void showImportSuggestion(String[] list, int x, int y) {<NEW_LINE>if (frmImportSuggest != null) {<NEW_LINE>// frmImportSuggest.setVisible(false);<NEW_LINE>// frmImportSuggest = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JList<String> classList = new JList<>(list);<NEW_LINE><MASK><NEW_LINE>frmImportSuggest = new JFrame();<NEW_LINE>frmImportSuggest.setUndecorated(true);<NEW_LINE>frmImportSuggest.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);<NEW_LINE>JPanel panel = new JPanel();<NEW_LINE>panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));<NEW_LINE>panel.setBackground(Color.WHITE);<NEW_LINE>frmImportSuggest.setBackground(Color.WHITE);<NEW_LINE>panel.add(classList);<NEW_LINE>JLabel label = new JLabel("<html><div alight = \"left\"><font size = \"2\"><br>(Click to insert)</font></div></html>");<NEW_LINE>label.setBackground(Color.WHITE);<NEW_LINE>label.setHorizontalTextPosition(SwingConstants.LEFT);<NEW_LINE>panel.add(label);<NEW_LINE>panel.validate();<NEW_LINE>frmImportSuggest.getContentPane().add(panel);<NEW_LINE>frmImportSuggest.pack();<NEW_LINE>classList.addListSelectionListener(e -> {<NEW_LINE>if (classList.getSelectedValue() != null) {<NEW_LINE>try {<NEW_LINE>String t = classList.getSelectedValue().trim();<NEW_LINE>Messages.log(t);<NEW_LINE>int x1 = t.indexOf('(');<NEW_LINE>String impString = "import " + t.substring(x1 + 1, t.indexOf(')')) + ";\n";<NEW_LINE>int ct = getSketch().getCurrentCodeIndex();<NEW_LINE>getSketch().setCurrentCode(0);<NEW_LINE>getTextArea().getDocument().insertString(0, impString, null);<NEW_LINE>getSketch().setCurrentCode(ct);<NEW_LINE>} catch (BadLocationException ble) {<NEW_LINE>Messages.log("Failed to insert import");<NEW_LINE>ble.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>frmImportSuggest.setVisible(false);<NEW_LINE>frmImportSuggest.dispose();<NEW_LINE>frmImportSuggest = null;<NEW_LINE>});<NEW_LINE>frmImportSuggest.addWindowFocusListener(new WindowFocusListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void windowLostFocus(WindowEvent e) {<NEW_LINE>if (frmImportSuggest != null) {<NEW_LINE>frmImportSuggest.dispose();<NEW_LINE>frmImportSuggest = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void windowGainedFocus(WindowEvent e) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>frmImportSuggest.setLocation(x, y);<NEW_LINE>frmImportSuggest.setBounds(x, y, 250, 100);<NEW_LINE>frmImportSuggest.pack();<NEW_LINE>frmImportSuggest.setVisible(true);<NEW_LINE>} | classList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |
1,052,960 | protected void mouseClicked(MouseEvent e) {<NEW_LINE>// *** JTree ***<NEW_LINE>if (e.getSource() instanceof JTree) {<NEW_LINE>// Left Double Click<NEW_LINE>if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() > 0) {<NEW_LINE>int selRow = tree.getRowForLocation(e.getX(), e.getY());<NEW_LINE>if (selRow != -1) {<NEW_LINE>MTreeNode tn = (MTreeNode) tree.getPathForLocation(e.getX(), e.getY()).getLastPathComponent();<NEW_LINE>setSelectedNode(tn);<NEW_LINE>}<NEW_LINE>} else // Right Click for PopUp<NEW_LINE>if ((editable || hasBar) && SwingUtilities.isRightMouseButton(e)) {<NEW_LINE>int selRow = tree.getRowForLocation(e.getX(), e.getY());<NEW_LINE>if (selRow != -1) {<NEW_LINE>tree.setSelectionRow(selRow);<NEW_LINE>}<NEW_LINE>if (// need select first<NEW_LINE>tree.getSelectionPath() != null) {<NEW_LINE>MTreeNode nd = (MTreeNode) tree.getSelectionPath().getLastPathComponent();<NEW_LINE>if (// only add leaves to bar<NEW_LINE>nd.isLeaf())<NEW_LINE>barAdd.setEnabled(true);<NEW_LINE>else<NEW_LINE>barAdd.setEnabled(false);<NEW_LINE>Rectangle r = tree.getPathBounds(tree.getSelectionPath());<NEW_LINE>popMenuTree.show(tree, (int) r.getMaxX(), (int) r.getY());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else // JTree<NEW_LINE>// *** JButton ***<NEW_LINE>if (e.getSource() instanceof JButton) {<NEW_LINE>if (SwingUtilities.isRightMouseButton(e)) {<NEW_LINE>buttonSelected = (CButton) e.getSource();<NEW_LINE>popMenuBar.show(buttonSelected, e.getX(<MASK><NEW_LINE>}<NEW_LINE>} else // JToolBar<NEW_LINE>if (e.getSource() instanceof JToolBar) {<NEW_LINE>if (SwingUtilities.isRightMouseButton(e)) {<NEW_LINE>toolSelected = (JToolBar) e.getSource();<NEW_LINE>popToolBar.show(toolSelected, e.getX(), e.getY());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), e.getY()); |
1,561,316 | protected void makeSerializable(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {<NEW_LINE>if (addGWTInterface) {<NEW_LINE>topLevelClass.addImportedType(gwtSerializable);<NEW_LINE>topLevelClass.addSuperInterface(gwtSerializable);<NEW_LINE>}<NEW_LINE>if (!suppressJavaInterface) {<NEW_LINE>topLevelClass.addImportedType(serializable);<NEW_LINE>topLevelClass.addSuperInterface(serializable);<NEW_LINE>Field field = new // $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Field(// $NON-NLS-1$<NEW_LINE><MASK><NEW_LINE>field.setFinal(true);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>field.setInitializationString("1L");<NEW_LINE>field.setStatic(true);<NEW_LINE>field.setVisibility(JavaVisibility.PRIVATE);<NEW_LINE>if (introspectedTable.getTargetRuntime() == TargetRuntime.MYBATIS3_DSQL) {<NEW_LINE>context.getCommentGenerator().addFieldAnnotation(field, introspectedTable, topLevelClass.getImportedTypes());<NEW_LINE>} else {<NEW_LINE>context.getCommentGenerator().addFieldComment(field, introspectedTable);<NEW_LINE>}<NEW_LINE>topLevelClass.addField(field);<NEW_LINE>}<NEW_LINE>} | "serialVersionUID", new FullyQualifiedJavaType("long")); |
1,197,188 | private void execute() {<NEW_LINE>if (processing.app.Base.DEBUG) {<NEW_LINE>systemOut.println("Build status: ");<NEW_LINE>systemOut.println("Sketch: " + sketchPath);<NEW_LINE>systemOut.println("Output: " + outputPath);<NEW_LINE><MASK><NEW_LINE>systemOut.println("Target: " + target);<NEW_LINE>systemOut.println("Component: " + appComponent);<NEW_LINE>systemOut.println("==== Task ====");<NEW_LINE>systemOut.println("--build: " + (task == BUILD));<NEW_LINE>systemOut.println("--run: " + (task == RUN));<NEW_LINE>systemOut.println("--export: " + (task == EXPORT));<NEW_LINE>systemOut.println();<NEW_LINE>}<NEW_LINE>if (task == HELP) {<NEW_LINE>printCommandLine(systemOut);<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>checkOrQuit(outputFolder.mkdirs(), "Could not create the output folder.", false);<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>boolean runOnEmu = runArg_EMULATOR.equals(device);<NEW_LINE>sketch = new Sketch(pdePath, androidMode);<NEW_LINE>if (task == BUILD || task == RUN) {<NEW_LINE>AndroidBuild build = new AndroidBuild(sketch, androidMode, appComponent);<NEW_LINE>build.build(target);<NEW_LINE>if (task == RUN) {<NEW_LINE>AndroidRunner runner = new AndroidRunner(build, this);<NEW_LINE>runner.launch(runOnEmu ? Devices.getInstance().getEmulator(build.isWear()) : Devices.getInstance().getHardware(), build.getAppComponent(), runOnEmu);<NEW_LINE>}<NEW_LINE>success = true;<NEW_LINE>} else if (task == EXPORT) {<NEW_LINE>AndroidBuild build = new AndroidBuild(sketch, androidMode, appComponent);<NEW_LINE>build.exportProject();<NEW_LINE>success = true;<NEW_LINE>}<NEW_LINE>if (!success) {<NEW_LINE>// error already printed<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>systemOut.println("Finished.");<NEW_LINE>System.exit(0);<NEW_LINE>} catch (SketchException re) {<NEW_LINE>statusError(re);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>} | systemOut.println("Force: " + force); |
1,331,068 | protected JFreeChart createBubbleChart() throws JRException {<NEW_LINE><MASK><NEW_LINE>XYPlot xyPlot = (XYPlot) jfreeChart.getPlot();<NEW_LINE>XYBubbleRenderer bubbleRenderer = (XYBubbleRenderer) xyPlot.getRenderer();<NEW_LINE>bubbleRenderer = new GradientXYBubbleRenderer(bubbleRenderer.getScaleType());<NEW_LINE>xyPlot.setRenderer(bubbleRenderer);<NEW_LINE>XYDataset xyDataset = xyPlot.getDataset();<NEW_LINE>if (xyDataset != null) {<NEW_LINE>for (int i = 0; i < xyDataset.getSeriesCount(); i++) {<NEW_LINE>bubbleRenderer.setSeriesOutlinePaint(i, ChartThemesConstants.TRANSPARENT_PAINT);<NEW_LINE>bubbleRenderer.setSeriesPaint(i, ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return jfreeChart;<NEW_LINE>} | JFreeChart jfreeChart = super.createBubbleChart(); |
1,747,561 | public final FuncbodyContext funcbody() throws RecognitionException {<NEW_LINE>FuncbodyContext _localctx = new FuncbodyContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 56, RULE_funcbody);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(356);<NEW_LINE>match(LPAREN);<NEW_LINE>setState(358);<NEW_LINE>_errHandler.sync(this);<NEW_LINE><MASK><NEW_LINE>if (_la == DOTS || _la == NAME) {<NEW_LINE>{<NEW_LINE>setState(357);<NEW_LINE>parlist();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(360);<NEW_LINE>match(RPAREN);<NEW_LINE>setState(361);<NEW_LINE>block();<NEW_LINE>setState(362);<NEW_LINE>match(END);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | _la = _input.LA(1); |
1,654,138 | synchronized void removeDomainObject(DomainObjectAdapterDB domainObj) throws LockException {<NEW_LINE>if (getCurrentTransaction() != null) {<NEW_LINE>throw new LockException("domain object has open transaction: " + getCurrentTransaction().getDescription());<NEW_LINE>}<NEW_LINE>if (isLocked()) {<NEW_LINE>throw new LockException("domain object is locked!");<NEW_LINE>}<NEW_LINE>if (domainObj.getTransactionManager() != this) {<NEW_LINE>throw new IllegalArgumentException("domain object has different transaction manager");<NEW_LINE>}<NEW_LINE>int index = -1;<NEW_LINE>for (int i = 0; i < domainObjects.length; i++) {<NEW_LINE>if (domainObjects[i] == domainObj) {<NEW_LINE>index = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (index < 0) {<NEW_LINE>throw new IllegalArgumentException("invalid domain object");<NEW_LINE>}<NEW_LINE>clearTransactions();<NEW_LINE>DomainObjectTransactionManager restoredMgr = domainObjectTransactionManagers[index];<NEW_LINE>int count = domainObjects.length - 1;<NEW_LINE>DomainObjectAdapterDB[<MASK><NEW_LINE>DomainObjectTransactionManager[] updatedManagers = new DomainObjectTransactionManager[count];<NEW_LINE>System.arraycopy(domainObjects, 0, updatedDomainObjects, 0, index);<NEW_LINE>System.arraycopy(domainObjectTransactionManagers, 0, updatedManagers, 0, index);<NEW_LINE>if (index < count) {<NEW_LINE>System.arraycopy(domainObjects, index + 1, updatedDomainObjects, index, count - index);<NEW_LINE>System.arraycopy(domainObjectTransactionManagers, index + 1, updatedManagers, index, count - index);<NEW_LINE>}<NEW_LINE>domainObjects = updatedDomainObjects;<NEW_LINE>domainObjectTransactionManagers = updatedManagers;<NEW_LINE>domainObj.setTransactionManager(restoredMgr);<NEW_LINE>restoredMgr.notifyUndoStackChanged();<NEW_LINE>if (count == 1) {<NEW_LINE>removeDomainObject(domainObjects[0]);<NEW_LINE>} else {<NEW_LINE>notifyUndoableListeners();<NEW_LINE>}<NEW_LINE>} | ] updatedDomainObjects = new DomainObjectAdapterDB[count]; |
433,422 | public void add(long item, long count) {<NEW_LINE>if (count < 0) {<NEW_LINE>// Negative values are not implemented in the regular version, and do not<NEW_LINE>// play nicely with this algorithm anyway<NEW_LINE>throw new IllegalArgumentException("Negative increments not implemented");<NEW_LINE>}<NEW_LINE>int[] buckets = new int[depth];<NEW_LINE>for (int i = 0; i < depth; ++i) {<NEW_LINE>buckets[i<MASK><NEW_LINE>}<NEW_LINE>long min = table[0][buckets[0]];<NEW_LINE>for (int i = 1; i < depth; ++i) {<NEW_LINE>min = Math.min(min, table[i][buckets[i]]);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < depth; ++i) {<NEW_LINE>long newVal = Math.max(table[i][buckets[i]], min + count);<NEW_LINE>table[i][buckets[i]] = newVal;<NEW_LINE>}<NEW_LINE>size += count;<NEW_LINE>} | ] = hash(item, i); |
496,843 | private static void writeMetadata(ResolvedPom pom, StringBuilder bom) {<NEW_LINE>bom.append(" <metadata>\n");<NEW_LINE>bom.append(" <timestamp>").append(Instant.now().toString()).append("</timestamp>\n");<NEW_LINE>bom.append(" <tools>\n");<NEW_LINE>bom.append(" <tool>\n");<NEW_LINE>bom.append(" <vendor>OpenRewrite</vendor>\n");<NEW_LINE>bom.append(" <name>OpenRewrite CycloneDX</name>\n");<NEW_LINE>// Probably should pull the version from build properties.<NEW_LINE>bom.append(" <version>7.18.0</version>\n");<NEW_LINE>bom.append(" </tool>\n");<NEW_LINE>bom.append(" </tools>\n");<NEW_LINE>// (Scope scope, String groupId, String artifactId, String version, String packaging, List<String> licenses, String bomReference, StringBuilder bom) {<NEW_LINE>String packaging = ("war".equals(pom.getPackaging()) || "ear".equals(pom.getPackaging<MASK><NEW_LINE>writeComponent(Scope.Compile, pom.getValue(pom.getGroupId()), pom.getArtifactId(), pom.getValue(pom.getVersion()), packaging, pom.getRequested().getLicenses(), bom);<NEW_LINE>bom.append(" </metadata>\n");<NEW_LINE>} | ())) ? "application" : "library"; |
1,110,495 | public boolean visit(SQLSelect x) {<NEW_LINE>SQLWithSubqueryClause withSubQuery = x.getWithSubQuery();<NEW_LINE>if (withSubQuery != null) {<NEW_LINE>if (withSubQuery.getRecursive() != null && withSubQuery.getRecursive() == true) {<NEW_LINE>throw new FastSqlParserException(FastSqlParserException.ExceptionType.NOT_SUPPORT, "Not supported recursive CTE (Common Table Expressions)");<NEW_LINE>}<NEW_LINE>SqlNodeList withList = new SqlNodeList(SqlParserPos.ZERO);<NEW_LINE>for (SQLWithSubqueryClause.Entry e : withSubQuery.getEntries()) {<NEW_LINE>SqlNodeList columnList = null;<NEW_LINE>if (e.getColumns() != null && !e.getColumns().isEmpty()) {<NEW_LINE>columnList = new SqlNodeList(SqlParserPos.ZERO);<NEW_LINE>for (SQLName sqlName : e.getColumns()) {<NEW_LINE>columnList.add(new SqlIdentifier(sqlName.getSimpleName(), SqlParserPos.ZERO));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>e.<MASK><NEW_LINE>SqlWithItem sqlWithItem = new SqlWithItem(SqlParserPos.ZERO, new SqlIdentifier(SQLUtils.normalizeNoTrim(e.getAlias()), SqlParserPos.ZERO), columnList, this.getSqlNode());<NEW_LINE>withList.add(sqlWithItem);<NEW_LINE>}<NEW_LINE>visit(x.getQuery());<NEW_LINE>SqlWith sqlWith = new SqlWith(SqlParserPos.ZERO, withList, this.getSqlNode());<NEW_LINE>this.sqlNode = sqlWith;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>visit(x.getQuery());<NEW_LINE>return false;<NEW_LINE>} | getSubQuery().accept(this); |
994,880 | public void exitRedistribute_connected_is_stanza(Redistribute_connected_is_stanzaContext ctx) {<NEW_LINE>IsisProcess proc <MASK><NEW_LINE>RedistributionSourceProtocol sourceProtocol = RedistributionSourceProtocol.CONNECTED;<NEW_LINE>IsisRedistributionPolicy r = new IsisRedistributionPolicy(sourceProtocol);<NEW_LINE>proc.getRedistributionPolicies().put(sourceProtocol, r);<NEW_LINE>if (ctx.metric != null) {<NEW_LINE>int metric = toInteger(ctx.metric);<NEW_LINE>r.setMetric(metric);<NEW_LINE>}<NEW_LINE>if (ctx.map != null) {<NEW_LINE>String map = ctx.map.getText();<NEW_LINE>r.setMap(map);<NEW_LINE>_configuration.referenceStructure(ROUTE_MAP, map, ISIS_REDISTRIBUTE_CONNECTED_MAP, ctx.map.getLine());<NEW_LINE>}<NEW_LINE>if (ctx.LEVEL_1() != null) {<NEW_LINE>r.setLevel(IsisLevel.LEVEL_1);<NEW_LINE>} else if (ctx.LEVEL_2() != null) {<NEW_LINE>r.setLevel(IsisLevel.LEVEL_2);<NEW_LINE>} else if (ctx.LEVEL_1_2() != null) {<NEW_LINE>r.setLevel(IsisLevel.LEVEL_1_2);<NEW_LINE>} else {<NEW_LINE>r.setLevel(IsisRedistributionPolicy.DEFAULT_LEVEL);<NEW_LINE>}<NEW_LINE>} | = currentVrf().getIsisProcess(); |
1,127,578 | private void updateFooterFromState(GridStaticSectionState state) {<NEW_LINE>Grid<JsonObject> grid = getWidget();<NEW_LINE><MASK><NEW_LINE>while (grid.getFooterRowCount() > 0) {<NEW_LINE>grid.removeFooterRow(0);<NEW_LINE>}<NEW_LINE>for (RowState rowState : state.rows) {<NEW_LINE>FooterRow row = grid.appendFooterRow();<NEW_LINE>for (CellState cellState : rowState.cells) {<NEW_LINE>CustomGridColumn column = columnIdToColumn.get(cellState.columnId);<NEW_LINE>updateFooterCellFromState(row.getCell(column), cellState);<NEW_LINE>}<NEW_LINE>for (Set<String> group : rowState.cellGroups.keySet()) {<NEW_LINE>Grid.Column<?, ?>[] columns = new Grid.Column<?, ?>[group.size()];<NEW_LINE>CellState cellState = rowState.cellGroups.get(group);<NEW_LINE>int i = 0;<NEW_LINE>for (String columnId : group) {<NEW_LINE>columns[i] = columnIdToColumn.get(columnId);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>// Set state to be the same as first in group.<NEW_LINE>updateFooterCellFromState(row.join(columns), cellState);<NEW_LINE>}<NEW_LINE>row.setStyleName(rowState.styleName);<NEW_LINE>}<NEW_LINE>} | grid.setFooterVisible(state.visible); |
1,444,179 | private static void filterExactMatches(@Nonnull List<PatchAndVariants> candidates, @Nonnull MultiMap<VirtualFile, AbstractFilePatchInProgress> result) {<NEW_LINE>for (Iterator<PatchAndVariants> iterator = candidates.iterator(); iterator.hasNext(); ) {<NEW_LINE>final PatchAndVariants candidate = iterator.next();<NEW_LINE>if (candidate.getVariants().size() == 1) {<NEW_LINE>final AbstractFilePatchInProgress oneCandidate = candidate.<MASK><NEW_LINE>result.putValue(oneCandidate.getBase(), oneCandidate);<NEW_LINE>iterator.remove();<NEW_LINE>} else {<NEW_LINE>final List<AbstractFilePatchInProgress> exact = new ArrayList<>(candidate.getVariants().size());<NEW_LINE>for (AbstractFilePatchInProgress patch : candidate.getVariants()) {<NEW_LINE>if (patch.getCurrentStrip() == 0) {<NEW_LINE>exact.add(patch);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (exact.size() == 1) {<NEW_LINE>final AbstractFilePatchInProgress patchInProgress = exact.get(0);<NEW_LINE>putSelected(result, candidate.getVariants(), patchInProgress);<NEW_LINE>iterator.remove();<NEW_LINE>} else if (!exact.isEmpty()) {<NEW_LINE>candidate.getVariants().retainAll(exact);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getVariants().get(0); |
757,549 | private void mergeMonoDex(@NonNull Collection<Path> inputs, @NonNull Path output) throws IOException {<NEW_LINE>Map<Path, List<Dex>> dexesFromArchives = Maps.newConcurrentMap();<NEW_LINE>// counts how many inputs are yet to be processed<NEW_LINE>AtomicInteger inputsToProcess = new AtomicInteger(inputs.size());<NEW_LINE>ArrayList<ForkJoinTask<Void>> <MASK><NEW_LINE>for (Path archivePath : inputs) {<NEW_LINE>subTasks.add(forkJoinPool.submit(() -> {<NEW_LINE>try (DexArchive dexArchive = DexArchives.fromInput(archivePath)) {<NEW_LINE>List<DexArchiveEntry> entries = dexArchive.getFiles();<NEW_LINE>List<Dex> dexes = new ArrayList<>(entries.size());<NEW_LINE>for (DexArchiveEntry e : entries) {<NEW_LINE>dexes.add(new Dex(e.getDexFileContent()));<NEW_LINE>}<NEW_LINE>dexesFromArchives.put(dexArchive.getRootPath(), dexes);<NEW_LINE>}<NEW_LINE>if (inputsToProcess.decrementAndGet() == 0) {<NEW_LINE>mergeMonoDexEntries(output, dexesFromArchives).join();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>// now wait for all subtasks execution.<NEW_LINE>subTasks.forEach(ForkJoinTask::join);<NEW_LINE>} | subTasks = new ArrayList<>(); |
724,271 | final DescribeCacheResult executeDescribeCache(DescribeCacheRequest describeCacheRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeCacheRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeCacheRequest> request = null;<NEW_LINE>Response<DescribeCacheResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeCacheRequestProtocolMarshaller(protocolFactory).marshall<MASK><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(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Storage Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeCache");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeCacheResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeCacheResultJsonUnmarshaller());<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>} | (super.beforeMarshalling(describeCacheRequest)); |
1,145,825 | public void loadTableInfo(BankInfo bi, Timestamp payDate, ValueNamePair paymentRule, boolean onlyDue, int C_BPartner_ID, KeyNamePair docType, IMiniTable miniTable) {<NEW_LINE>log.config("");<NEW_LINE>// not yet initialized<NEW_LINE>if (m_sql == null)<NEW_LINE>return;<NEW_LINE>String sql = m_sql;<NEW_LINE>// Parameters<NEW_LINE>String isSOTrx = "N";<NEW_LINE>if (paymentRule != null && X_C_Order.PAYMENTRULE_DirectDebit.equals(paymentRule.getValue())) {<NEW_LINE>isSOTrx = "Y";<NEW_LINE>sql += " AND i.PaymentRule='" + X_C_Order.PAYMENTRULE_DirectDebit + "'";<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (onlyDue)<NEW_LINE>sql += " AND COALESCE(ips.duedate,paymentTermDueDate(i.C_PaymentTerm_ID, i.DateInvoiced)) <= ?";<NEW_LINE>//<NEW_LINE>if (C_BPartner_ID != 0)<NEW_LINE>sql += " AND i.C_BPartner_ID=?";<NEW_LINE>// Document Type<NEW_LINE>KeyNamePair dt = docType;<NEW_LINE>int c_doctype_id = dt.getKey();<NEW_LINE>if (c_doctype_id != 0)<NEW_LINE>sql += " AND i.c_doctype_id =?";<NEW_LINE>sql += " ORDER BY DateDue, bp.Name, i.DocumentNo";<NEW_LINE>log.fine(sql + " - C_Currency_ID=" + bi.C_Currency_ID + ", C_BPartner_ID=" + C_BPartner_ID + ", C_doctype_id=" + c_doctype_id);<NEW_LINE>// Get Open Invoices<NEW_LINE>try {<NEW_LINE>int index = 1;<NEW_LINE>PreparedStatement pstmt = DB.prepareStatement(sql, null);<NEW_LINE>// DiscountAmt<NEW_LINE>pstmt.setTimestamp(index++, payDate);<NEW_LINE>// DueAmt<NEW_LINE>pstmt.setInt(index++, bi.C_Currency_ID);<NEW_LINE>pstmt<MASK><NEW_LINE>// PayAmt<NEW_LINE>pstmt.setTimestamp(index++, payDate);<NEW_LINE>pstmt.setInt(index++, bi.C_Currency_ID);<NEW_LINE>pstmt.setTimestamp(index++, payDate);<NEW_LINE>// IsSOTrx<NEW_LINE>pstmt.setString(index++, isSOTrx);<NEW_LINE>pstmt.setTimestamp(index++, payDate);<NEW_LINE>// Client<NEW_LINE>pstmt.setInt(index++, m_AD_Client_ID);<NEW_LINE>if (onlyDue)<NEW_LINE>pstmt.setTimestamp(index++, payDate);<NEW_LINE>if (C_BPartner_ID != 0)<NEW_LINE>pstmt.setInt(index++, C_BPartner_ID);<NEW_LINE>if (// Document type<NEW_LINE>c_doctype_id != 0)<NEW_LINE>pstmt.setInt(index++, c_doctype_id);<NEW_LINE>//<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>miniTable.loadTable(rs);<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>}<NEW_LINE>} | .setTimestamp(index++, payDate); |
1,367,418 | public ListUsersResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListUsersResult listUsersResult = new ListUsersResult();<NEW_LINE><MASK><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 listUsersResult;<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("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listUsersResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ServerId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listUsersResult.setServerId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Users", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listUsersResult.setUsers(new ListUnmarshaller<ListedUser>(ListedUserJsonUnmarshaller.getInstance()).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 listUsersResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
573,621 | public Status scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) {<NEW_LINE>try {<NEW_LINE>final RangeQueryBuilder rangeQuery = rangeQuery<MASK><NEW_LINE>final SearchResponse response = client.prepareSearch(indexKey).setTypes(table).setQuery(rangeQuery).setSize(recordcount).execute().actionGet();<NEW_LINE>HashMap<String, ByteIterator> entry;<NEW_LINE>for (SearchHit hit : response.getHits()) {<NEW_LINE>entry = new HashMap<>(fields.size());<NEW_LINE>for (String field : fields) {<NEW_LINE>entry.put(field, new StringByteIterator((String) hit.getSource().get(field)));<NEW_LINE>}<NEW_LINE>result.add(entry);<NEW_LINE>}<NEW_LINE>return Status.OK;<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return Status.ERROR;<NEW_LINE>}<NEW_LINE>} | ("_id").gte(startkey); |
921,294 | public boolean step() {<NEW_LINE>NetworkSystem networkSystem = context.get(NetworkSystem.class);<NEW_LINE>WorldAtlas atlas = new WorldAtlasImpl(context.get(Config.class).getRendering().getMaxTextureAtlasResolution());<NEW_LINE>context.put(WorldAtlas.class, atlas);<NEW_LINE>ModuleEnvironment environment = context.get(<MASK><NEW_LINE>context.put(BlockFamilyLibrary.class, new BlockFamilyLibrary(environment, context));<NEW_LINE>BlockManagerImpl blockManager;<NEW_LINE>if (networkSystem.getMode().isAuthority()) {<NEW_LINE>blockManager = new BlockManagerImpl(atlas, context.get(AssetManager.class), true);<NEW_LINE>blockManager.subscribe(context.get(NetworkSystem.class));<NEW_LINE>} else {<NEW_LINE>blockManager = new BlockManagerImpl(atlas, context.get(AssetManager.class), false);<NEW_LINE>}<NEW_LINE>context.put(BlockManager.class, blockManager);<NEW_LINE>context.get(TypeHandlerLibrary.class).addTypeHandler(Block.class, new BlockTypeHandler(blockManager));<NEW_LINE>context.get(TypeHandlerLibrary.class).addTypeHandler(BlockFamily.class, new BlockFamilyTypeHandler(blockManager));<NEW_LINE>blockManager.initialise(gameManifest.getRegisteredBlockFamilies(), gameManifest.getBlockIdMap());<NEW_LINE>return true;<NEW_LINE>} | ModuleManager.class).getEnvironment(); |
609,723 | public void registerService(String serviceName, String groupName, Instance instance) throws NacosException {<NEW_LINE>NAMING_LOGGER.info("[REGISTER-SERVICE] {} registering service {} with instance: {}", namespaceId, serviceName, instance);<NEW_LINE>String groupedServiceName = NamingUtils.getGroupedName(serviceName, groupName);<NEW_LINE>if (instance.isEphemeral()) {<NEW_LINE>BeatInfo beatInfo = beatReactor.buildBeatInfo(groupedServiceName, instance);<NEW_LINE>beatReactor.addBeatInfo(groupedServiceName, beatInfo);<NEW_LINE>}<NEW_LINE>final Map<String, String> params = new HashMap<String, String>(32);<NEW_LINE>params.<MASK><NEW_LINE>params.put(CommonParams.SERVICE_NAME, groupedServiceName);<NEW_LINE>params.put(CommonParams.GROUP_NAME, groupName);<NEW_LINE>params.put(CommonParams.CLUSTER_NAME, instance.getClusterName());<NEW_LINE>params.put(IP_PARAM, instance.getIp());<NEW_LINE>params.put(PORT_PARAM, String.valueOf(instance.getPort()));<NEW_LINE>params.put(WEIGHT_PARAM, String.valueOf(instance.getWeight()));<NEW_LINE>params.put(REGISTER_ENABLE_PARAM, String.valueOf(instance.isEnabled()));<NEW_LINE>params.put(HEALTHY_PARAM, String.valueOf(instance.isHealthy()));<NEW_LINE>params.put(EPHEMERAL_PARAM, String.valueOf(instance.isEphemeral()));<NEW_LINE>params.put(META_PARAM, JacksonUtils.toJson(instance.getMetadata()));<NEW_LINE>reqApi(UtilAndComs.nacosUrlInstance, params, HttpMethod.POST);<NEW_LINE>} | put(CommonParams.NAMESPACE_ID, namespaceId); |
846,153 | // ----- private methods -----<NEW_LINE>private static GraphObjectMap relationPropertyToMap(final ConfigurationProvider config, final RelationProperty relationProperty) {<NEW_LINE>final GraphObjectMap map = new GraphObjectMap();<NEW_LINE>final Relation relation = relationProperty.getRelation();<NEW_LINE>map.put(SchemaRelationshipNode.sourceMultiplicity, multiplictyToString(relation.getSourceMultiplicity()));<NEW_LINE>map.put(SchemaRelationshipNode.targetMultiplicity, multiplictyToString(relation.getTargetMultiplicity()));<NEW_LINE>map.put(typeProperty, relation.getClass().getSimpleName());<NEW_LINE>map.put(SchemaRelationshipNode.relationshipType, relation.name());<NEW_LINE>final Class sourceType = relation.getSourceType();<NEW_LINE>final Class targetType = relation.getTargetType();<NEW_LINE>// select AbstractNode and SUPERCLASSES (not subclasses!)<NEW_LINE>if (sourceType.isAssignableFrom(AbstractNode.class)) {<NEW_LINE>map.put(allSourceTypesPossibleProperty, true);<NEW_LINE><MASK><NEW_LINE>map.put(possibleSourceTypesProperty, null);<NEW_LINE>} else if ("DOMNode".equals(sourceType.getSimpleName())) {<NEW_LINE>map.put(allTargetTypesPossibleProperty, false);<NEW_LINE>map.put(htmlTargetTypesPossibleProperty, true);<NEW_LINE>map.put(possibleTargetTypesProperty, null);<NEW_LINE>} else {<NEW_LINE>map.put(allSourceTypesPossibleProperty, false);<NEW_LINE>map.put(htmlSourceTypesPossibleProperty, false);<NEW_LINE>map.put(possibleSourceTypesProperty, StringUtils.join(SearchCommand.getAllSubtypesAsStringSet(sourceType.getSimpleName()), ","));<NEW_LINE>}<NEW_LINE>// select AbstractNode and SUPERCLASSES (not subclasses!)<NEW_LINE>if (targetType.isAssignableFrom(AbstractNode.class)) {<NEW_LINE>map.put(allTargetTypesPossibleProperty, true);<NEW_LINE>map.put(htmlTargetTypesPossibleProperty, true);<NEW_LINE>map.put(possibleTargetTypesProperty, null);<NEW_LINE>} else if ("DOMNode".equals(targetType.getSimpleName())) {<NEW_LINE>map.put(allTargetTypesPossibleProperty, false);<NEW_LINE>map.put(htmlTargetTypesPossibleProperty, true);<NEW_LINE>map.put(possibleTargetTypesProperty, null);<NEW_LINE>} else {<NEW_LINE>map.put(allTargetTypesPossibleProperty, false);<NEW_LINE>map.put(htmlTargetTypesPossibleProperty, false);<NEW_LINE>map.put(possibleTargetTypesProperty, StringUtils.join(SearchCommand.getAllSubtypesAsStringSet(targetType.getSimpleName()), ","));<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>} | map.put(htmlSourceTypesPossibleProperty, true); |
560,633 | public void exec() throws IOException {<NEW_LINE>if (this.central == null) {<NEW_LINE>this.central = new Central(this.project, this.session, this.manager);<NEW_LINE>}<NEW_LINE>String before = this.status();<NEW_LINE>int cycle = 0;<NEW_LINE>final Moja<?>[] mojas = { new Moja<>(ParseMojo.class), new Moja<>(OptimizeMojo.class), new Moja<>(DiscoverMojo.class), new Moja<>(PullMojo.class), new Moja<>(ResolveMojo.class), new Moja<>(MarkMojo.class), new Moja<MASK><NEW_LINE>while (true) {<NEW_LINE>for (final Moja<?> moja : mojas) {<NEW_LINE>moja.copy(this).execute();<NEW_LINE>}<NEW_LINE>final String after = this.status();<NEW_LINE>++cycle;<NEW_LINE>Logger.info(this, "Assemble cycle #%d (%s -> %s)", cycle, before, after);<NEW_LINE>if (after.equals(before)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>before = after;<NEW_LINE>}<NEW_LINE>Logger.info(this, "%d assemble cycle(s) produced some new object(s): %s", cycle, before);<NEW_LINE>} | <>(PlaceMojo.class) }; |
117,886 | public void forwardToConflictDestination(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>response.setStatus(HttpServletResponse.SC_CONFLICT);<NEW_LINE>final Map reducedMap = new LinkedHashMap(request.getParameterMap());<NEW_LINE>reducedMap.remove(BroadleafAdminRequestProcessor.CATALOG_REQ_PARAM);<NEW_LINE>reducedMap.remove(BroadleafAdminRequestProcessor.PROFILE_REQ_PARAM);<NEW_LINE><MASK><NEW_LINE>reducedMap.remove(StaleStateProtectionServiceImpl.STATEVERSIONTOKENPARAMETER);<NEW_LINE>reducedMap.remove(BroadleafSiteResolver.SELECTED_SITE_URL_PARAM);<NEW_LINE>final HttpServletRequestWrapper wrapper = new HttpServletRequestWrapper(request) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getParameter(String name) {<NEW_LINE>Object temp = reducedMap.get(name);<NEW_LINE>Object[] response = new Object[0];<NEW_LINE>if (temp != null) {<NEW_LINE>ArrayUtils.addAll(response, temp);<NEW_LINE>}<NEW_LINE>if (ArrayUtils.isEmpty(response)) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>return (String) response[0];<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Map getParameterMap() {<NEW_LINE>return reducedMap;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Enumeration getParameterNames() {<NEW_LINE>return new IteratorEnumeration(reducedMap.keySet().iterator());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String[] getParameterValues(String name) {<NEW_LINE>return (String[]) reducedMap.get(name);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>requestProcessor.process(new ServletWebRequest(wrapper, response));<NEW_LINE>wrapper.getRequestDispatcher("/sc_conflict").forward(wrapper, response);<NEW_LINE>} | reducedMap.remove(BroadleafAdminRequestProcessor.SANDBOX_REQ_PARAM); |
1,117,146 | private void removeBreakpoints(DebuggerManagerListener dl) {<NEW_LINE>if (!breakpointsInitialized) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Breakpoint[] bps;<NEW_LINE>try {<NEW_LINE>java.lang.reflect.Method unloadMethod = dl.getClass().getMethod("unloadBreakpoints", new Class[] {});<NEW_LINE>bps = (Breakpoint[]) unloadMethod.invoke(dl, new Object[] {});<NEW_LINE>} catch (IllegalAccessException iaex) {<NEW_LINE>return;<NEW_LINE>} catch (IllegalArgumentException iaex) {<NEW_LINE>return;<NEW_LINE>} catch (NoSuchMethodException iaex) {<NEW_LINE>return;<NEW_LINE>} catch (SecurityException iaex) {<NEW_LINE>return;<NEW_LINE>} catch (InvocationTargetException iaex) {<NEW_LINE>Exceptions.printStackTrace(iaex.getTargetException());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Breakpoint[] bps = dl.unloadBreakpoints();<NEW_LINE>// System.err.println("\n removeBreakpoints("+dl+")\n");<NEW_LINE>breakpoints.removeAll(Arrays.asList(bps));<NEW_LINE>for (Breakpoint breakpoint : bps) {<NEW_LINE>Class c = breakpoint.getClass();<NEW_LINE><MASK><NEW_LINE>synchronized (breakpointsByClassLoaders) {<NEW_LINE>Set<Breakpoint> lb = breakpointsByClassLoaders.get(cl);<NEW_LINE>if (lb != null) {<NEW_LINE>lb.remove(breakpoint);<NEW_LINE>if (lb.isEmpty()) {<NEW_LINE>breakpointsByClassLoaders.remove(cl);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>breakpoint.disposeOut();<NEW_LINE>}<NEW_LINE>// System.err.println("removedBreakpoints = "+Arrays.asList(bps));<NEW_LINE>for (Breakpoint bp : bps) {<NEW_LINE>fireBreakpointRemoved(bp, false, dl);<NEW_LINE>}<NEW_LINE>} | ClassLoader cl = c.getClassLoader(); |
1,152,557 | public void insertHoleAt(final JSONArray args, final CallbackContext callbackContext) throws JSONException {<NEW_LINE>String id = args.getString(0);<NEW_LINE>final int holeIndex = args.getInt(1);<NEW_LINE>JSONArray holeJson = args.getJSONArray(2);<NEW_LINE>final ArrayList<LatLng> newHole = PluginUtil.JSONArray2LatLngList(holeJson);<NEW_LINE>final Polygon <MASK><NEW_LINE>// ------------------------<NEW_LINE>// Update the hole list<NEW_LINE>// ------------------------<NEW_LINE>String propertyId = "polygon_holePaths_" + polygonHashCode;<NEW_LINE>final ArrayList<ArrayList<LatLng>> holes = (ArrayList<ArrayList<LatLng>>) pluginMap.objects.get(propertyId);<NEW_LINE>holes.add(holeIndex, newHole);<NEW_LINE>pluginMap.objects.put(propertyId, holes);<NEW_LINE>cordova.getActivity().runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>// Update the polygon<NEW_LINE>try {<NEW_LINE>polygon.setHoles(holes);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Ignore this error<NEW_LINE>// e.printStackTrace();<NEW_LINE>}<NEW_LINE>callbackContext.success();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | polygon = this.getPolygon(id); |
271,350 | public CompletableFuture<InitializeResult> initialize(InitializeParams init) {<NEW_LINE>NbCodeClientCapabilities capa = NbCodeClientCapabilities.get(init);<NEW_LINE>client.setClientCaps(capa);<NEW_LINE>hackConfigureGroovySupport(capa);<NEW_LINE>List<FileObject> projectCandidates = new ArrayList<>();<NEW_LINE>List<WorkspaceFolder> folders = init.getWorkspaceFolders();<NEW_LINE>if (folders != null) {<NEW_LINE>for (WorkspaceFolder w : folders) {<NEW_LINE>try {<NEW_LINE>projectCandidates.add(Utils.fromUri<MASK><NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>LOG.log(Level.FINE, null, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String root = init.getRootUri();<NEW_LINE>if (root != null) {<NEW_LINE>try {<NEW_LINE>projectCandidates.add(Utils.fromUri(root));<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>LOG.log(Level.FINE, null, ex);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// TODO: use getRootPath()?<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CompletableFuture<Project[]> prjs = workspaceProjects;<NEW_LINE>SERVER_INIT_RP.post(() -> asyncOpenSelectedProjects0(prjs, projectCandidates, true, true));<NEW_LINE>// chain showIndexingComplete message after initial project open.<NEW_LINE>prjs.thenApply(this::showIndexingCompleted);<NEW_LINE>initializeOptions();<NEW_LINE>// but complete the InitializationRequest independently of the project initialization.<NEW_LINE>return CompletableFuture.completedFuture(finishInitialization(constructInitResponse(init, checkJavaSupport())));<NEW_LINE>} | (w.getUri())); |
1,215,042 | final DeleteDomainResult executeDeleteDomain(DeleteDomainRequest deleteDomainRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDomainRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDomainRequest> request = null;<NEW_LINE>Response<DeleteDomainResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDomainRequestProtocolMarshaller(protocolFactory).marshall<MASK><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(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "codeartifact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDomain");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDomainResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDomainResultJsonUnmarshaller());<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>} | (super.beforeMarshalling(deleteDomainRequest)); |
1,313,594 | public static <K, V> SnapshotEntry<K, V> forEntry(K key, V value, long snapshot, int weight, long expiresAt, long refreshableAt) {<NEW_LINE><MASK><NEW_LINE>int features = 0 | ((refreshableAt == unsetTicks) ? 0b000 : 0b100) | ((expiresAt == unsetTicks) ? 0b000 : 0b010) | ((weight < 0) || (weight == 1) ? 0b000 : 0b001);<NEW_LINE>switch(// optimized for common cases<NEW_LINE>features) {<NEW_LINE>case 0b000:<NEW_LINE>return new SnapshotEntry<>(key, value, snapshot);<NEW_LINE>case 0b001:<NEW_LINE>return new WeightedEntry<>(key, value, snapshot, weight);<NEW_LINE>case 0b010:<NEW_LINE>return new ExpirableEntry<>(key, value, snapshot, expiresAt);<NEW_LINE>case 0b011:<NEW_LINE>return new ExpirableWeightedEntry<>(key, value, snapshot, weight, expiresAt);<NEW_LINE>case 0b110:<NEW_LINE>return new RefreshableExpirableEntry<>(key, value, snapshot, expiresAt, refreshableAt);<NEW_LINE>default:<NEW_LINE>return new CompleteEntry<>(key, value, snapshot, weight, expiresAt, refreshableAt);<NEW_LINE>}<NEW_LINE>} | long unsetTicks = snapshot + Long.MAX_VALUE; |
1,669,495 | // int c = 0;<NEW_LINE>@Override<NEW_LINE>public boolean publish(BinaryMapDataObject object) {<NEW_LINE>if (object.getPointsLength() < 1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>initTypes(object);<NEW_LINE>String nm = mapIndexFields.get(mapIndexFields.downloadNameType, object);<NEW_LINE>if (!countriesByDownloadName.containsKey(nm)) {<NEW_LINE>LinkedList<BinaryMapDataObject> ls = new LinkedList<BinaryMapDataObject>();<NEW_LINE>countriesByDownloadName.put(nm, ls);<NEW_LINE>ls.add(object);<NEW_LINE>} else {<NEW_LINE>countriesByDownloadName.get(nm).add(object);<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>int maxy = object.getPoint31YTile(0);<NEW_LINE>int minx = maxx;<NEW_LINE>int miny = maxy;<NEW_LINE>for (int i = 1; i < object.getPointsLength(); i++) {<NEW_LINE>int x = object.getPoint31XTile(i);<NEW_LINE>int y = object.getPoint31YTile(i);<NEW_LINE>if (y < miny) {<NEW_LINE>miny = y;<NEW_LINE>} else if (y > maxy) {<NEW_LINE>maxy = y;<NEW_LINE>}<NEW_LINE>if (x < minx) {<NEW_LINE>minx = x;<NEW_LINE>} else if (x > maxx) {<NEW_LINE>maxx = x;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>quadTree.insert(nm, new QuadRect(minx, miny, maxx, maxy));<NEW_LINE>return false;<NEW_LINE>} | maxx = object.getPoint31XTile(0); |
1,672,744 | public void addDeserializationCode(Context context) throws SerializationProcessingFailedException {<NEW_LINE>Context repeated = context.with(((ArrayType) context.type).getComponentType(), context.makeName("repeated"));<NEW_LINE>String lengthName = context.makeName("length");<NEW_LINE>context.builder.addStatement("int $L = codedIn.readInt32()", lengthName);<NEW_LINE>String resultName = context.makeName("result");<NEW_LINE>context.builder.addStatement("$T[] $L = new $T[$L]", repeated.getTypeName(), resultName, repeated.getTypeName(), lengthName);<NEW_LINE>String indexName = context.makeName("i");<NEW_LINE>context.builder.beginControlFlow("for (int $L = 0; $L < $L; ++$L)", indexName, indexName, lengthName, indexName);<NEW_LINE>writeDeserializationCode(repeated);<NEW_LINE>context.builder.addStatement("$L[$L] = $L", <MASK><NEW_LINE>context.builder.endControlFlow();<NEW_LINE>context.builder.addStatement("$L = $L", context.name, resultName);<NEW_LINE>} | resultName, indexName, repeated.name); |
1,065,386 | public void checkForMultipleStyleSheets(String fileName) {<NEW_LINE>LinkMarkup firstOne = null;<NEW_LINE>for (LinkMarkup linkTag : linkTags) {<NEW_LINE>if (linkTag.relAttribute.compareToIgnoreCase("stylesheet") == 0) {<NEW_LINE>if (++styleSheetsCount == 1) {<NEW_LINE>firstOne = linkTag;<NEW_LINE>} else if (styleSheetsCount > 1) {<NEW_LINE>if (firstOne != null) {<NEW_LINE>report.message(MessageId.CSS_012, EPUBLocation.create(fileName, firstOne.getLocation().getLineNumber(), firstOne.getLocation().getColumnNumber()<MASK><NEW_LINE>firstOne = null;<NEW_LINE>}<NEW_LINE>report.message(MessageId.CSS_012, EPUBLocation.create(fileName, linkTag.getLocation().getLineNumber(), linkTag.getLocation().getColumnNumber(), linkTag.getHrefAttribute()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (linkTag.relAttribute.compareToIgnoreCase("alternate stylesheet") == 0) {<NEW_LINE>String title = linkTag.getTitleAttribute();<NEW_LINE>if (title == null || title.trim().equals("")) {<NEW_LINE>report.message(MessageId.CSS_015, EPUBLocation.create(fileName, linkTag.getLocation().getLineNumber(), linkTag.getLocation().getColumnNumber(), linkTag.getHrefAttribute()));<NEW_LINE>}<NEW_LINE>if (styleSheetsCount == 0) {<NEW_LINE>report.message(MessageId.CSS_016, EPUBLocation.create(fileName, linkTag.getLocation().getLineNumber(), linkTag.getLocation().getColumnNumber(), linkTag.getHrefAttribute()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , firstOne.getHrefAttribute())); |
1,517,714 | public void playNotificationSoundURI(Command notificationURL) {<NEW_LINE>if (notificationURL instanceof StringType) {<NEW_LINE>try {<NEW_LINE>ZonePlayerHandler coordinator = getCoordinatorHandler();<NEW_LINE>String currentURI = coordinator.getCurrentURI();<NEW_LINE>logger.debug("playNotificationSoundURI: currentURI {} metadata {}", <MASK><NEW_LINE>if (isPlayingStream(currentURI) || isPlayingRadioStartedByAmazonEcho(currentURI) || isPlayingRadio(currentURI)) {<NEW_LINE>handleNotifForRadioStream(currentURI, notificationURL, coordinator);<NEW_LINE>} else if (isPlayingLineIn(currentURI)) {<NEW_LINE>handleNotifForLineIn(currentURI, notificationURL, coordinator);<NEW_LINE>} else if (isPlayingVirtualLineIn(currentURI)) {<NEW_LINE>handleNotifForVirtualLineIn(currentURI, notificationURL, coordinator);<NEW_LINE>} else if (isPlayingQueue(currentURI)) {<NEW_LINE>handleNotifForSharedQueue(currentURI, notificationURL, coordinator);<NEW_LINE>} else if (isPlaylistEmpty(coordinator)) {<NEW_LINE>handleNotifForEmptyQueue(notificationURL, coordinator);<NEW_LINE>} else {<NEW_LINE>logger.debug("Notification feature not yet implemented while the current media is being played");<NEW_LINE>}<NEW_LINE>synchronized (notificationLock) {<NEW_LINE>notificationLock.notify();<NEW_LINE>}<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>logger.debug("Cannot play notification sound ({})", e.getMessage());<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.debug("Play notification sound interrupted ({})", e.getMessage());<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | currentURI, coordinator.getCurrentURIMetadataAsString()); |
989,240 | protected void updateTable(boolean pack) {<NEW_LINE>ServerStatus status = gitblit.getStatus();<NEW_LINE>header.setText(Translation.get("gb.status"));<NEW_LINE>version.setText(Constants.NAME + (status.isGO ? " GO v" <MASK><NEW_LINE>releaseDate.setText(status.releaseDate);<NEW_LINE>bootDate.setText(status.bootDate.toString() + " (" + Translation.getTimeUtils().timeAgo(status.bootDate) + ")");<NEW_LINE>url.setText(gitblit.url);<NEW_LINE>servletContainer.setText(status.servletContainer);<NEW_LINE>ByteFormat byteFormat = new ByteFormat();<NEW_LINE>heapMaximum.setText(byteFormat.format(status.heapMaximum));<NEW_LINE>heapAllocated.setText(byteFormat.format(status.heapAllocated));<NEW_LINE>heapUsed.setText(byteFormat.format(status.heapAllocated - status.heapFree) + " (" + byteFormat.format(status.heapFree) + " " + Translation.get("gb.free") + ")");<NEW_LINE>tableModel.setProperties(status.systemProperties);<NEW_LINE>tableModel.fireTableDataChanged();<NEW_LINE>} | : " WAR v") + status.version); |
1,716,037 | private void assignLogserver(DeployState deployState, NodesSpecification nodesSpecification, Admin admin) {<NEW_LINE>if (nodesSpecification.minResources().nodes() > 1)<NEW_LINE>throw new IllegalArgumentException("You can only request a single log server");<NEW_LINE>// No logserver is needed on tester applications<NEW_LINE>if (deployState.getProperties().applicationId().instance().isTester())<NEW_LINE>return;<NEW_LINE>if (nodesSpecification.isDedicated()) {<NEW_LINE>Collection<HostResource> hosts = allocateHosts(admin.hostSystem(), "logserver", nodesSpecification);<NEW_LINE>// No log server can be created (and none is needed)<NEW_LINE>if (hosts.isEmpty())<NEW_LINE>return;<NEW_LINE>Logserver logserver = <MASK><NEW_LINE>createContainerOnLogserverHost(deployState, admin, logserver.getHostResource());<NEW_LINE>} else if (containerModels.iterator().hasNext()) {<NEW_LINE>List<HostResource> hosts = sortedContainerHostsFrom(containerModels.iterator().next(), nodesSpecification.minResources().nodes(), false);<NEW_LINE>// No log server can be created (and none is needed)<NEW_LINE>if (hosts.isEmpty())<NEW_LINE>return;<NEW_LINE>createLogserver(deployState, admin, hosts);<NEW_LINE>} else {<NEW_LINE>context.getDeployLogger().logApplicationPackage(Level.INFO, "No container host available to use for running logserver");<NEW_LINE>}<NEW_LINE>} | createLogserver(deployState, admin, hosts); |
1,407,052 | public BlacklistEntry unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BlacklistEntry blacklistEntry = new BlacklistEntry();<NEW_LINE><MASK><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("RblName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>blacklistEntry.setRblName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ListingTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>blacklistEntry.setListingTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Description", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>blacklistEntry.setDescription(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 blacklistEntry;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
615,416 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c0,c1,c2,c3".split(",");<NEW_LINE>SupportEvalBuilder builder = new SupportEvalBuilder("SupportCollection");<NEW_LINE>builder.expression(fields[0], "strvals.sumOf(v => extractNum(v))");<NEW_LINE>builder.expression(fields[1], "strvals.sumOf(v => extractBigDecimal(v))");<NEW_LINE>builder.expression(fields[2], "strvals.sumOf( (v, i) => extractNum(v) + i*10)");<NEW_LINE>builder.expression(fields[3], "strvals.sumOf( (v, i, s) => extractNum(v) + i*10 + s*100)");<NEW_LINE>builder.statementConsumer(stmt -> assertTypes(stmt.getEventType(), fields, new EPTypeClass[] { INTEGERBOXED.getEPType(), BIGDECIMAL.getEPType(), INTEGERBOXED.getEPType(), INTEGERBOXED.getEPType() }));<NEW_LINE>builder.assertion(SupportCollection.makeString("E2,E1,E5,E4")).expect(fields, 2 + 1 + 5 + 4, new BigDecimal(2 + 1 + 5 + 4), 2 + 11 + 25 + 34, <MASK><NEW_LINE>builder.assertion(SupportCollection.makeString("E1")).expect(fields, 1, new BigDecimal(1), 1, 101);<NEW_LINE>builder.assertion(SupportCollection.makeString(null)).expect(fields, null, null, null, null);<NEW_LINE>builder.assertion(SupportCollection.makeString("")).expect(fields, null, null, null, null);<NEW_LINE>builder.run(env);<NEW_LINE>} | 402 + 411 + 425 + 434); |
1,304,349 | protected CompletableFuture<Response> encodeResponse(Invocation invocation, Response response) {<NEW_LINE>invocation.onEncodeResponseStart(response);<NEW_LINE>ResponseHeader header = new ResponseHeader();<NEW_LINE>header.setStatusCode(response.getStatusCode());<NEW_LINE>header.<MASK><NEW_LINE>header.setContext(invocation.getContext());<NEW_LINE>header.fromMultiMap(response.getHeaders());<NEW_LINE>HighwayTransportContext transportContext = invocation.getTransportContext();<NEW_LINE>long msgId = transportContext.getMsgId();<NEW_LINE>OperationProtobuf operationProtobuf = transportContext.getOperationProtobuf();<NEW_LINE>ResponseRootSerializer bodySchema = operationProtobuf.findResponseRootSerializer(response.getStatusCode());<NEW_LINE>try {<NEW_LINE>Buffer respBuffer = HighwayCodec.encodeResponse(msgId, header, bodySchema, response.getResult());<NEW_LINE>transportContext.setResponseBuffer(respBuffer);<NEW_LINE>return CompletableFuture.completedFuture(response);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// keep highway performance and simple, this encoding/decoding error not need handle by client<NEW_LINE>String msg = String.format("encode response failed, msgId=%d", msgId);<NEW_LINE>return AsyncUtils.completeExceptionally(new IllegalStateException(msg, e));<NEW_LINE>}<NEW_LINE>} | setReasonPhrase(response.getReasonPhrase()); |
80,005 | private static void ensureMapColorsInitialized(Device device) {<NEW_LINE>if (device == null || device.isDisposed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (mapColors.size() == 0) {<NEW_LINE>for (int i = 1; i <= 16; i++) {<NEW_LINE>Color color = device.getSystemColor(i);<NEW_LINE>Long key = new Long(((long) color.getRed() << 16) + (color.getGreen() << 8) + color.getBlue());<NEW_LINE>addColor(key, color);<NEW_LINE>}<NEW_LINE>if (DEBUG) {<NEW_LINE>timerColorCacheChecker = SimpleTimer.addPeriodicEvent("ColorCacheChecker", 60000, new TimerEventPerformer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void perform(TimerEvent event) {<NEW_LINE>if (Utils.isDisplayDisposed()) {<NEW_LINE>event.cancel();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Utils.execSWTThread(new AERunnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void runSupport() {<NEW_LINE>for (Iterator<Long> iter = mapColors.keySet().iterator(); iter.hasNext(); ) {<NEW_LINE><MASK><NEW_LINE>Color color = mapColors.get(key);<NEW_LINE>if (color.isDisposed()) {<NEW_LINE>System.err.println("Someone disposed of color " + Long.toHexString(key.longValue()));<NEW_LINE>iter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Long key = iter.next(); |
1,032,275 | private void readAndFormatOldStyle() throws IOException {<NEW_LINE>// process the trace records in all the input files<NEW_LINE>for (Iterator i = traceFiles.iterator(); i.hasNext(); ) {<NEW_LINE>traceFile = (TraceFile) i.next();<NEW_LINE>instantiateMessageFileOldStyle();<NEW_LINE>traceFile.traceFileHeader.processTraceBufferHeaders();<NEW_LINE>}<NEW_LINE>// for each thread sort the trace records<NEW_LINE>TraceThread traceThread;<NEW_LINE>for (Iterator i = threads.iterator(); i.hasNext(); ) {<NEW_LINE>traceThread = (TraceThread) i.next();<NEW_LINE>Collections.sort(traceThread);<NEW_LINE>}<NEW_LINE>// if -summary then just summarize to stdout<NEW_LINE>if (TraceArgs.summary) {<NEW_LINE>doSummary(new BufferedWriter(new OutputStreamWriter(TraceFormat.outStream)));<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>if (doSummary(out) != 0)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// write out the formatted entires<NEW_LINE>TraceFormat.outStream.println("*** starting formatting of entries");<NEW_LINE>out.write(header, 0, header.length());<NEW_LINE>out.newLine();<NEW_LINE>out.newLine();<NEW_LINE>if (Integer.valueOf(Util.getProperty("POINTER_SIZE")).intValue() == 4) {<NEW_LINE>headings = "ThreadID TP id Type TraceEntry ";<NEW_LINE>}<NEW_LINE>out.write(Util.getTimerDescription() + headings, 0, headings.length() + Util.getTimerDescription().length());<NEW_LINE>out.newLine();<NEW_LINE>// the main processing loop<NEW_LINE>Merge merge;<NEW_LINE>try {<NEW_LINE>merge = new Merge(threads);<NEW_LINE>String s;<NEW_LINE>String eol = System.getProperty("line.separator");<NEW_LINE>while ((s = merge.getNextEntry()) != null) {<NEW_LINE>// write out the trace entry<NEW_LINE>out.write(s + eol);<NEW_LINE>}<NEW_LINE>} catch (InvalidSpannedRecordException isre) {<NEW_LINE>TraceFormat.outStream.println(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>out.flush();<NEW_LINE>TraceFormat.outStream.println("*** formatted ");<NEW_LINE>TraceFormat.outStream.println("Formatted output written to file: " + TraceArgs.outputFile);<NEW_LINE>} | "\n" + isre.getMessage()); |
798,032 | public static GroupRepresentation toRepresentation(GroupModel group, boolean full) {<NEW_LINE>GroupRepresentation rep = new GroupRepresentation();<NEW_LINE>rep.setId(group.getId());<NEW_LINE>rep.setName(group.getName());<NEW_LINE>rep.setPath(buildGroupPath(group));<NEW_LINE>if (!full)<NEW_LINE>return rep;<NEW_LINE>// Role mappings<NEW_LINE>Set<RoleModel> roles = group.getRoleMappingsStream().<MASK><NEW_LINE>List<String> realmRoleNames = new ArrayList<>();<NEW_LINE>Map<String, List<String>> clientRoleNames = new HashMap<>();<NEW_LINE>for (RoleModel role : roles) {<NEW_LINE>if (role.getContainer() instanceof RealmModel) {<NEW_LINE>realmRoleNames.add(role.getName());<NEW_LINE>} else {<NEW_LINE>ClientModel client = (ClientModel) role.getContainer();<NEW_LINE>String clientId = client.getClientId();<NEW_LINE>List<String> currentClientRoles = clientRoleNames.computeIfAbsent(clientId, k -> new ArrayList<>());<NEW_LINE>currentClientRoles.add(role.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rep.setRealmRoles(realmRoleNames);<NEW_LINE>rep.setClientRoles(clientRoleNames);<NEW_LINE>Map<String, List<String>> attributes = group.getAttributes();<NEW_LINE>rep.setAttributes(attributes);<NEW_LINE>return rep;<NEW_LINE>} | collect(Collectors.toSet()); |
1,462,467 | public void execute() {<NEW_LINE>DomUtils.fillIFrame(<MASK><NEW_LINE>DomUtils.forwardWheelEvent(frame.getIFrame().getContentDocument(), parentElement);<NEW_LINE>int contentHeight = frame.getWindow().getDocument().getDocumentElement().getOffsetHeight();<NEW_LINE>callbackContent.setHeight(contentHeight + "px");<NEW_LINE>callbackContent.setWidth("100%");<NEW_LINE>frame.getElement().getStyle().setWidth(100, Unit.PCT);<NEW_LINE>frame.getElement().getStyle().setHeight(contentHeight, Unit.PX);<NEW_LINE>host_.notifyHeightChanged();<NEW_LINE>Command heightHandler = () -> {<NEW_LINE>// reset height so we can shrink it if necessary<NEW_LINE>frame.getElement().getStyle().setHeight(0, Unit.PX);<NEW_LINE>// delay calculating the height so any images can load<NEW_LINE>new Timer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>int newHeight = frame.getWindow().getDocument().getDocumentElement().getOffsetHeight();<NEW_LINE>callbackContent.setHeight(newHeight + "px");<NEW_LINE>frame.getElement().getStyle().setHeight(newHeight, Unit.PX);<NEW_LINE>host_.notifyHeightChanged();<NEW_LINE>}<NEW_LINE>}.schedule(50);<NEW_LINE>};<NEW_LINE>MutationObserver.Builder builder = new MutationObserver.Builder(heightHandler);<NEW_LINE>builder.attributes(true);<NEW_LINE>builder.characterData(true);<NEW_LINE>builder.childList(true);<NEW_LINE>builder.subtree(true);<NEW_LINE>MutationObserver observer = builder.get();<NEW_LINE>observer.observe(frame.getIFrame().getContentDocument().getBody());<NEW_LINE>} | frame.getIFrame(), htmlOutput); |
588,389 | public boolean visit(MySqlDeclareHandlerStatement x) {<NEW_LINE>String handleType = x.getHandleType().name();<NEW_LINE><MASK><NEW_LINE>print0(ucase ? handleType : handleType.toLowerCase());<NEW_LINE>print0(ucase ? " HANDLER FOR " : " handler for ");<NEW_LINE>for (int i = 0; i < x.getConditionValues().size(); i++) {<NEW_LINE>ConditionValue cv = x.getConditionValues().get(i);<NEW_LINE>if (cv.getType() == ConditionType.SQLSTATE) {<NEW_LINE>print0(ucase ? " SQLSTATE " : " sqlstate ");<NEW_LINE>print0(cv.getValue());<NEW_LINE>} else if (cv.getType() == ConditionType.MYSQL_ERROR_CODE) {<NEW_LINE>print0(cv.getValue());<NEW_LINE>} else if (cv.getType() == ConditionType.SELF) {<NEW_LINE>print0(cv.getValue());<NEW_LINE>} else if (cv.getType() == ConditionType.SYSTEM) {<NEW_LINE>print0(ucase ? cv.getValue().toUpperCase() : cv.getValue().toLowerCase());<NEW_LINE>}<NEW_LINE>if (i != x.getConditionValues().size() - 1) {<NEW_LINE>print0(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.indentCount++;<NEW_LINE>println();<NEW_LINE>x.getSpStatement().accept(this);<NEW_LINE>this.indentCount--;<NEW_LINE>return false;<NEW_LINE>} | print0(ucase ? "DECLARE " : "declare "); |
284,964 | public HealthCheckResponse call() {<NEW_LINE>HealthCheckResponseBuilder builder = HealthCheckResponse.named("vault");<NEW_LINE>boolean status = true;<NEW_LINE>for (String vaultId : vaultIds) {<NEW_LINE>try {<NEW_LINE>ApiOptionalResponse<GetVault.Response> r = ociVault.getVault(GetVault.Request.builder().vaultId(vaultId));<NEW_LINE>LOGGER.fine(() -> "OCI vault health check " + vaultId + " returned status code " + r.status().code());<NEW_LINE>r.entity().ifPresentOrElse(e -> {<NEW_LINE>String id = e.displayName() != null && !e.displayName().isEmpty() ? e.displayName() : vaultId;<NEW_LINE>builder.withData(id, r.status().code());<NEW_LINE>}, () -> builder.withData(vaultId, r.status().code()));<NEW_LINE>status = status && r.status().equals(OK_200);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>LOGGER.fine(() -> "OCI vault health check " + vaultId + " exception " + t.getMessage());<NEW_LINE>status = false;<NEW_LINE>builder.withData(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.status(status);<NEW_LINE>return builder.build();<NEW_LINE>} | vaultId, t.getMessage()); |
93,687 | /* Component basic features */<NEW_LINE>@Override<NEW_LINE>public void paintContent(PaintTarget target) throws PaintException {<NEW_LINE>// Adds the locale as attribute<NEW_LINE>final Locale l = getLocale();<NEW_LINE>if (l != null) {<NEW_LINE>target.addAttribute("locale", l.toString());<NEW_LINE>}<NEW_LINE>if (getDateFormat() != null) {<NEW_LINE>target.addAttribute("format", dateFormat);<NEW_LINE>}<NEW_LINE>if (!isLenient()) {<NEW_LINE>target.addAttribute("strict", true);<NEW_LINE>}<NEW_LINE>target.addAttribute(DateFieldConstants.ATTR_WEEK_NUMBERS, isShowISOWeekNumbers());<NEW_LINE><MASK><NEW_LINE>// Gets the calendar<NEW_LINE>final Calendar calendar = getCalendar();<NEW_LINE>final Date currentDate = getValue();<NEW_LINE>// Only paint variables for the resolution and up, e.g. Resolution DAY<NEW_LINE>// paints DAY,MONTH,YEAR<NEW_LINE>for (Resolution res : Resolution.getResolutionsHigherOrEqualTo(resolution)) {<NEW_LINE>int value = -1;<NEW_LINE>if (currentDate != null) {<NEW_LINE>value = calendar.get(res.getCalendarField());<NEW_LINE>if (res == Resolution.MONTH) {<NEW_LINE>// Calendar month is zero based<NEW_LINE>value++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>target.addVariable(this, variableNameForResolution.get(res), value);<NEW_LINE>}<NEW_LINE>} | target.addAttribute("parsable", uiHasValidDateString); |
388,315 | public void doWithDevice(final IDevice device) throws MojoExecutionException {<NEW_LINE>String deviceLogLinePrefix = DeviceHelper.getDeviceLogLinePrefix(device);<NEW_LINE>// message will be set in for each loop according to the processed files<NEW_LINE>String message = "";<NEW_LINE>try {<NEW_LINE>SyncService syncService = device.getSyncService();<NEW_LINE>for (Map.Entry<String, String> pushFileEntry : sourceDestinationMap.entrySet()) {<NEW_LINE>String sourcePath = pushFileEntry.getKey();<NEW_LINE>String destinationPath = pushFileEntry.getValue();<NEW_LINE>message = deviceLogLinePrefix + "Push of " + sourcePath + " to " + destinationPath + " on " + DeviceHelper.getDescriptiveName(device);<NEW_LINE>syncService.pushFile(sourcePath, destinationPath, <MASK><NEW_LINE>getLog().info(message + " successful.");<NEW_LINE>}<NEW_LINE>} catch (SyncException e) {<NEW_LINE>throw new MojoExecutionException(message + " failed.", e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new MojoExecutionException(message + " failed.", e);<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>throw new MojoExecutionException(message + " failed.", e);<NEW_LINE>} catch (AdbCommandRejectedException e) {<NEW_LINE>throw new MojoExecutionException(message + " failed.", e);<NEW_LINE>}<NEW_LINE>} | new LogSyncProgressMonitor(getLog())); |
747,047 | public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'petId' is set<NEW_LINE>if (petId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));<NEW_LINE>// query params<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>if (additionalMetadata != null)<NEW_LINE>localVarFormParams.put("additionalMetadata", additionalMetadata);<NEW_LINE>if (_file != null)<NEW_LINE>localVarFormParams.put("file", _file);<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "multipart/form-data" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "petstore_auth" };<NEW_LINE>GenericType<ModelApiResponse> localVarReturnType = new GenericType<ModelApiResponse>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, <MASK><NEW_LINE>} | localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); |
679,449 | public void onStatisticsUpdate(V2TXLivePlayer player, V2TXLiveDef.V2TXLivePlayerStatistics statistics) {<NEW_LINE>Bundle netStatus = new Bundle();<NEW_LINE>netStatus.putInt(TXLiveConstants.NET_STATUS_VIDEO_WIDTH, statistics.width);<NEW_LINE>netStatus.putInt(TXLiveConstants.NET_STATUS_VIDEO_HEIGHT, statistics.height);<NEW_LINE>int appCpu = statistics.appCpu / 10;<NEW_LINE>int totalCpu = statistics.systemCpu / 10;<NEW_LINE>String strCpu = appCpu + "/" + totalCpu + "%";<NEW_LINE>netStatus.putCharSequence(TXLiveConstants.NET_STATUS_CPU_USAGE, strCpu);<NEW_LINE>netStatus.putInt(TXLiveConstants.NET_STATUS_NET_SPEED, statistics.videoBitrate + statistics.audioBitrate);<NEW_LINE>netStatus.putInt(<MASK><NEW_LINE>netStatus.putInt(TXLiveConstants.NET_STATUS_VIDEO_BITRATE, statistics.videoBitrate);<NEW_LINE>netStatus.putInt(TXLiveConstants.NET_STATUS_VIDEO_FPS, statistics.fps);<NEW_LINE>netStatus.putInt(TXLiveConstants.NET_STATUS_AUDIO_CACHE, 0);<NEW_LINE>netStatus.putInt(TXLiveConstants.NET_STATUS_VIDEO_CACHE, 0);<NEW_LINE>netStatus.putInt(TXLiveConstants.NET_STATUS_V_SUM_CACHE_SIZE, 0);<NEW_LINE>netStatus.putInt(TXLiveConstants.NET_STATUS_V_DEC_CACHE_SIZE, 0);<NEW_LINE>netStatus.putString(TXLiveConstants.NET_STATUS_AUDIO_INFO, "");<NEW_LINE>Log.d(TAG, "Current status, CPU:" + netStatus.getString(TXLiveConstants.NET_STATUS_CPU_USAGE) + ", RES:" + netStatus.getInt(TXLiveConstants.NET_STATUS_VIDEO_WIDTH) + "*" + netStatus.getInt(TXLiveConstants.NET_STATUS_VIDEO_HEIGHT) + ", SPD:" + netStatus.getInt(TXLiveConstants.NET_STATUS_NET_SPEED) + "Kbps" + ", FPS:" + netStatus.getInt(TXLiveConstants.NET_STATUS_VIDEO_FPS) + ", ARA:" + netStatus.getInt(TXLiveConstants.NET_STATUS_AUDIO_BITRATE) + "Kbps" + ", VRA:" + netStatus.getInt(TXLiveConstants.NET_STATUS_VIDEO_BITRATE) + "Kbps");<NEW_LINE>mLogInfoWindow.setLogText(netStatus, null, 0);<NEW_LINE>} | TXLiveConstants.NET_STATUS_AUDIO_BITRATE, statistics.audioBitrate); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.