idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
66,191 | protected void updateCheckBoxes(BasicPermissionTarget item) {<NEW_LINE>itemChanging = true;<NEW_LINE>if (item != null) {<NEW_LINE>boolean visible = !item.getId().startsWith("root:") && !item.getId().startsWith("category:all:");<NEW_LINE>allowCheckBox.setVisible(visible);<NEW_LINE>disallowCheckBox.setVisible(<MASK><NEW_LINE>if (item.getPermissionVariant() == PermissionVariant.ALLOWED) {<NEW_LINE>allowCheckBox.setValue(true);<NEW_LINE>disallowCheckBox.setValue(false);<NEW_LINE>} else if (item.getPermissionVariant() == PermissionVariant.DISALLOWED) {<NEW_LINE>disallowCheckBox.setValue(true);<NEW_LINE>allowCheckBox.setValue(false);<NEW_LINE>} else {<NEW_LINE>allowCheckBox.setValue(false);<NEW_LINE>disallowCheckBox.setValue(false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>allowCheckBox.setValue(false);<NEW_LINE>disallowCheckBox.setValue(false);<NEW_LINE>}<NEW_LINE>itemChanging = false;<NEW_LINE>} | visible && (rolesPolicyVersion == 1)); |
1,110,476 | public static Iterable<TextRange> excludeRanges(@Nonnull TextRange original, @Nonnull List<? extends TextRange> excludedRanges) {<NEW_LINE>if (!excludedRanges.isEmpty()) {<NEW_LINE>if (excludedRanges.size() > 1) {<NEW_LINE>excludedRanges.sort(RANGE_COMPARATOR);<NEW_LINE>}<NEW_LINE>int enabledRangeStart = original.getStartOffset();<NEW_LINE>List<TextRange> enabledRanges = new ArrayList<>();<NEW_LINE>for (TextRange excludedRange : excludedRanges) {<NEW_LINE>if (excludedRange.getEndOffset() < enabledRangeStart)<NEW_LINE>continue;<NEW_LINE>int excludedRangeStart = excludedRange.getStartOffset();<NEW_LINE>if (excludedRangeStart > original.getEndOffset())<NEW_LINE>break;<NEW_LINE>if (excludedRangeStart > enabledRangeStart) {<NEW_LINE>enabledRanges.add(<MASK><NEW_LINE>}<NEW_LINE>enabledRangeStart = excludedRange.getEndOffset();<NEW_LINE>}<NEW_LINE>if (enabledRangeStart < original.getEndOffset()) {<NEW_LINE>enabledRanges.add(new TextRange(enabledRangeStart, original.getEndOffset()));<NEW_LINE>}<NEW_LINE>return enabledRanges;<NEW_LINE>}<NEW_LINE>return Collections.singletonList(original);<NEW_LINE>} | new TextRange(enabledRangeStart, excludedRangeStart)); |
1,359,685 | public static List<OrderByElement> extraOrderBy(SelectBody selectBody) {<NEW_LINE>if (selectBody != null) {<NEW_LINE>if (selectBody instanceof PlainSelect) {<NEW_LINE>List<OrderByElement> orderByElements = ((PlainSelect) selectBody).getOrderByElements();<NEW_LINE>((PlainSelect) selectBody).setOrderByElements(null);<NEW_LINE>return orderByElements;<NEW_LINE>} else if (selectBody instanceof WithItem) {<NEW_LINE>WithItem withItem = (WithItem) selectBody;<NEW_LINE>if (withItem.getSubSelect() != null) {<NEW_LINE>return extraOrderBy(withItem.getSubSelect().getSelectBody());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>SetOperationList operationList = (SetOperationList) selectBody;<NEW_LINE>if (operationList.getSelects() != null && operationList.getSelects().size() > 0) {<NEW_LINE>List<SelectBody<MASK><NEW_LINE>return extraOrderBy(plainSelects.get(plainSelects.size() - 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | > plainSelects = operationList.getSelects(); |
491,670 | private void initFilters(List<String> listStringPreference) {<NEW_LINE>if (listStringPreference == null) {<NEW_LINE>scriptPatterns = CharOperation.NO_CHAR_CHAR;<NEW_LINE>doCopy = new boolean[0];<NEW_LINE>}<NEW_LINE>int size = listStringPreference.size();<NEW_LINE>if (size % 2 == 0) {<NEW_LINE>scriptPatterns = new char[size / 2][];<NEW_LINE>doCopy <MASK><NEW_LINE>} else {<NEW_LINE>// preferences are a little bit wacky<NEW_LINE>scriptPatterns = new char[1 + size / 2][];<NEW_LINE>doCopy = new boolean[1 + size / 2];<NEW_LINE>}<NEW_LINE>int count = 0;<NEW_LINE>int index = 0;<NEW_LINE>for (String patternStr : listStringPreference) {<NEW_LINE>if (count++ % 2 == 0) {<NEW_LINE>scriptPatterns[index] = patternStr.toCharArray();<NEW_LINE>} else {<NEW_LINE>char[] pattern = patternStr.toCharArray();<NEW_LINE>doCopy[index++] = pattern.length > 0 && pattern[0] == 'y';<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new boolean[size / 2]; |
984,467 | private String executeCreateScript(DownloadJob dnld, TemplateDownloader td, String resourcePath, String finalResourcePath, ResourceType resourceType, String templateFilename) {<NEW_LINE>String result;<NEW_LINE>int imgSizeGigs = (int) Math.ceil(_storage.getSize(td.getDownloadLocalPath()) * 1.0d / (1024 * 1024 * 1024));<NEW_LINE>// add one just in case<NEW_LINE>imgSizeGigs++;<NEW_LINE>long timeout = (long) imgSizeGigs * installTimeoutPerGig;<NEW_LINE>Script scr = null;<NEW_LINE>String script = resourceType == ResourceType.TEMPLATE ? createTmpltScr : createVolScr;<NEW_LINE>scr = new <MASK><NEW_LINE>scr.add("-s", Integer.toString(imgSizeGigs));<NEW_LINE>scr.add("-S", Long.toString(td.getMaxTemplateSizeInBytes()));<NEW_LINE>if (dnld.getDescription() != null && dnld.getDescription().length() > 1) {<NEW_LINE>scr.add("-d", dnld.getDescription());<NEW_LINE>}<NEW_LINE>if (dnld.isHvm()) {<NEW_LINE>scr.add("-h");<NEW_LINE>}<NEW_LINE>// run script to mv the temporary template file to the final template<NEW_LINE>// file<NEW_LINE>dnld.setTmpltPath(finalResourcePath + "/" + templateFilename);<NEW_LINE>scr.add("-n", templateFilename);<NEW_LINE>scr.add("-t", resourcePath);<NEW_LINE>// this is the temporary template file downloaded<NEW_LINE>scr.add("-f", td.getDownloadLocalPath());<NEW_LINE>// cleanup<NEW_LINE>scr.add("-u");<NEW_LINE>result = scr.execute();<NEW_LINE>return result;<NEW_LINE>} | Script(script, timeout, LOGGER); |
423,555 | static void close(ScanState scanState) {<NEW_LINE>if (!scanState.finished && scanState.scanID != null && scanState.prevLoc != null) {<NEW_LINE>TInfo tinfo = TraceUtil.traceInfo();<NEW_LINE>log.debug("Closing active scan {} {}", scanState.prevLoc, scanState.scanID);<NEW_LINE>HostAndPort parsedLocation = HostAndPort.fromString(scanState.prevLoc.tablet_location);<NEW_LINE>TabletClientService.Client client = null;<NEW_LINE>try {<NEW_LINE>client = ThriftUtil.getTServerClient(parsedLocation, scanState.context);<NEW_LINE>client.closeScan(tinfo, scanState.scanID);<NEW_LINE>} catch (TException e) {<NEW_LINE>// ignore this is a best effort<NEW_LINE>log.debug("Failed to close active scan " + scanState.prevLoc + <MASK><NEW_LINE>} finally {<NEW_LINE>if (client != null)<NEW_LINE>ThriftUtil.returnClient(client, scanState.context);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | " " + scanState.scanID, e); |
198,670 | static byte[] make2ByteMsgBuff(byte msgID, byte channel, byte[] param_a, boolean useRunningStatus) {<NEW_LINE>int numMsgs = param_a.length;<NEW_LINE>byte[] msgBuff;<NEW_LINE>if (useRunningStatus) {<NEW_LINE>msgBuff = new byte[1 + numMsgs];<NEW_LINE>int byteOffset = 0;<NEW_LINE>msgBuff[byteOffset++] = MidiSpec.makeChanMessageCode(msgID, channel);<NEW_LINE>for (int index = 0; index < numMsgs; index++) {<NEW_LINE>msgBuff[byteOffset++] = param_a[index];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>msgBuff = new byte[numMsgs * 2];<NEW_LINE>int byteOffset = 0;<NEW_LINE>for (int index = 0; index < numMsgs; index++) {<NEW_LINE>msgBuff[byteOffset++] = <MASK><NEW_LINE>msgBuff[byteOffset++] = param_a[index];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return msgBuff;<NEW_LINE>} | MidiSpec.makeChanMessageCode(msgID, channel); |
1,215,073 | public void draw(ZoneRenderer renderer, Graphics2D g, Rectangle bounds) {<NEW_LINE>createShape(renderer.getScale());<NEW_LINE>int offU = getOffU(renderer);<NEW_LINE>int offV = getOffV(renderer);<NEW_LINE>int count = 0;<NEW_LINE>Object oldAntiAlias = SwingUtil.useAntiAliasing(g);<NEW_LINE>g.setColor(new Color(getZone<MASK><NEW_LINE>g.setStroke(new BasicStroke(AppState.getGridSize()));<NEW_LINE>for (double v = offV % (scaledMinorRadius * 2) - (scaledMinorRadius * 2); v < getRendererSizeV(renderer); v += scaledMinorRadius) {<NEW_LINE>double offsetU = (int) ((count & 1) == 0 ? 0 : -(scaledEdgeProjection + scaledEdgeLength));<NEW_LINE>count++;<NEW_LINE>double start = offU % (2 * scaledEdgeLength + 2 * scaledEdgeProjection) - (2 * scaledEdgeLength + 2 * scaledEdgeProjection);<NEW_LINE>double end = getRendererSizeU(renderer) + 2 * scaledEdgeLength + 2 * scaledEdgeProjection;<NEW_LINE>double incr = 2 * scaledEdgeLength + 2 * scaledEdgeProjection;<NEW_LINE>for (double u = start; u < end; u += incr) {<NEW_LINE>setGridDrawTranslation(g, u + offsetU, v);<NEW_LINE>g.draw(scaledHex);<NEW_LINE>setGridDrawTranslation(g, -(u + offsetU), -v);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, oldAntiAlias);<NEW_LINE>} | ().getGridColor())); |
1,586,879 | static void merge(int[] a, int num1, int[] b, int num2) {<NEW_LINE>int[] c <MASK><NEW_LINE>int k = 0;<NEW_LINE>int j = 0;<NEW_LINE>int i = 0;<NEW_LINE>// Traverse both array<NEW_LINE>while (i < num1 && j < num2) {<NEW_LINE>if (a[i] > b[j])<NEW_LINE>c[k++] = b[j++];<NEW_LINE>else<NEW_LINE>c[k++] = a[i++];<NEW_LINE>}<NEW_LINE>// copying remaining elements of array a<NEW_LINE>while (i < num1) c[k++] = a[i++];<NEW_LINE>// copying remaining elements of array b<NEW_LINE>while (j < num2) c[k++] = b[j++];<NEW_LINE>System.out.println("New merged array: \n");<NEW_LINE>for (i = 0; i < (num1 + num2); i++) {<NEW_LINE>System.out.println(c[i] + " ");<NEW_LINE>}<NEW_LINE>} | = new int[num1 + num2]; |
659,052 | void reloadRows() {<NEW_LINE>editRowsPanel.removeAll();<NEW_LINE>addEditorRow(new NumericPanel(pixelsPerMeter, "Pixels per meter", ""));<NEW_LINE>addEditorRow(new NumericPanel(zoomLevel, "Zoom level", ""));<NEW_LINE>addEditorRow(new NumericPanel(deltaMultiplier, "Delta multiplier", ""));<NEW_LINE>addEditorRow(new GradientPanel(backgroundColor, "Background color", "", true));<NEW_LINE>previewImagePanel = new PreviewImagePanel(ParticleEditor.this, "Preview Image", "");<NEW_LINE>addEditorRow(previewImagePanel);<NEW_LINE>JPanel gridPanel = <MASK><NEW_LINE>boolean previousSelected = renderGridCheckBox != null && renderGridCheckBox.isSelected();<NEW_LINE>renderGridCheckBox = new JCheckBox("Render Grid", previousSelected);<NEW_LINE>gridPanel.add(renderGridCheckBox, new GridBagConstraints());<NEW_LINE>addEditorRow(gridPanel);<NEW_LINE>addEditorRow(new CustomShadingPanel(ParticleEditor.this, "Shading", "Custom shader and multi-texture preview."));<NEW_LINE>rowsPanel.removeAll();<NEW_LINE>ParticleEmitter emitter = getEmitter();<NEW_LINE>addRow(new ImagePanel(ParticleEditor.this, "Images", ""));<NEW_LINE>addRow(new CountPanel(ParticleEditor.this, "Count", "Min number of particles at all times, max number of particles allowed."));<NEW_LINE>addRow(new RangedNumericPanel(emitter.getDelay(), "Delay", "Time from beginning of effect to emission start, in milliseconds."));<NEW_LINE>addRow(new RangedNumericPanel(emitter.getDuration(), "Duration", "Time particles will be emitted, in milliseconds."));<NEW_LINE>addRow(new ScaledNumericPanel(emitter.getEmission(), "Duration", "Emission", "Number of particles emitted per second."));<NEW_LINE>addRow(new ScaledNumericPanel(emitter.getLife(), "Duration", "Life", "Time particles will live, in milliseconds."));<NEW_LINE>addRow(new ScaledNumericPanel(emitter.getLifeOffset(), "Duration", "Life Offset", "Particle starting life consumed, in milliseconds."));<NEW_LINE>addRow(new RangedNumericPanel(emitter.getXOffsetValue(), "X Offset", "Amount to offset a particle's starting X location, in world units."));<NEW_LINE>addRow(new RangedNumericPanel(emitter.getYOffsetValue(), "Y Offset", "Amount to offset a particle's starting Y location, in world units."));<NEW_LINE>addRow(new SpawnPanel(ParticleEditor.this, emitter.getSpawnShape(), "Spawn", "Shape used to spawn particles."));<NEW_LINE>addRow(new ScaledNumericPanel(emitter.getSpawnWidth(), "Duration", "Spawn Width", "Width of the spawn shape, in world units."));<NEW_LINE>addRow(new ScaledNumericPanel(emitter.getSpawnHeight(), "Duration", "Spawn Height", "Height of the spawn shape, in world units."));<NEW_LINE>addRow(new ScaledNumericPanel(emitter.getXScale(), "Life", "X Size", "Particle x size, in world units. If Y Size is not active, this also controls the y size"));<NEW_LINE>addRow(new ScaledNumericPanel(emitter.getYScale(), "Life", "Y Size", "Particle y size, in world units."));<NEW_LINE>addRow(new ScaledNumericPanel(emitter.getVelocity(), "Life", "Velocity", "Particle speed, in world units per second."));<NEW_LINE>addRow(new ScaledNumericPanel(emitter.getAngle(), "Life", "Angle", "Particle emission angle, in degrees."));<NEW_LINE>addRow(new ScaledNumericPanel(emitter.getRotation(), "Life", "Rotation", "Particle rotation, in degrees."));<NEW_LINE>addRow(new ScaledNumericPanel(emitter.getWind(), "Life", "Wind", "Wind strength, in world units per second."));<NEW_LINE>addRow(new ScaledNumericPanel(emitter.getGravity(), "Life", "Gravity", "Gravity strength, in world units per second."));<NEW_LINE>addRow(new GradientPanel(emitter.getTint(), "Tint", "", false));<NEW_LINE>addRow(new PercentagePanel(emitter.getTransparency(), "Life", "Transparency", ""));<NEW_LINE>addRow(new OptionsPanel(ParticleEditor.this, "Options", ""));<NEW_LINE>for (Component component : rowsPanel.getComponents()) if (component instanceof EditorPanel)<NEW_LINE>((EditorPanel) component).update(ParticleEditor.this);<NEW_LINE>rowsPanel.repaint();<NEW_LINE>} | new JPanel(new GridLayout()); |
1,684,733 | public void initializeTaskDetails(TaskInfo taskInfo) {<NEW_LINE>this.id = taskInfo.getId();<NEW_LINE>this.name = taskInfo.getName();<NEW_LINE>this<MASK><NEW_LINE>this.category = taskInfo.getCategory();<NEW_LINE>this.created = taskInfo.getCreateTime();<NEW_LINE>this.dueDate = taskInfo.getDueDate();<NEW_LINE>this.priority = taskInfo.getPriority();<NEW_LINE>this.processInstanceId = taskInfo.getProcessInstanceId();<NEW_LINE>this.processDefinitionId = taskInfo.getProcessDefinitionId();<NEW_LINE>this.scopeId = taskInfo.getScopeId();<NEW_LINE>this.scopeType = taskInfo.getScopeType();<NEW_LINE>this.scopeDefinitionId = taskInfo.getScopeDefinitionId();<NEW_LINE>if (taskInfo instanceof HistoricTaskInstance) {<NEW_LINE>this.endDate = ((HistoricTaskInstance) taskInfo).getEndTime();<NEW_LINE>this.formKey = taskInfo.getFormKey();<NEW_LINE>this.duration = ((HistoricTaskInstance) taskInfo).getDurationInMillis();<NEW_LINE>} else {<NEW_LINE>// Rendering of forms for historic tasks not supported currently<NEW_LINE>this.formKey = taskInfo.getFormKey();<NEW_LINE>}<NEW_LINE>} | .description = taskInfo.getDescription(); |
790,159 | public boolean bind(int port) {<NEW_LINE>if (port == server.getPort() || port == -1) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (channelRegistrar == null) {<NEW_LINE>Disposer.register(server, this);<NEW_LINE>channelRegistrar = new ChannelRegistrar();<NEW_LINE>}<NEW_LINE>ServerBootstrap bootstrap = serverBootstrap(server.getEventLoopGroup());<NEW_LINE>Map<String, Object> xmlRpcHandlers = user.createXmlRpcHandlers();<NEW_LINE>if (xmlRpcHandlers == null) {<NEW_LINE>BuiltInServer.configureChildHandler(bootstrap, channelRegistrar, null);<NEW_LINE>} else {<NEW_LINE>final XmlRpcDelegatingHttpRequestHandler handler = new XmlRpcDelegatingHttpRequestHandler(xmlRpcHandlers);<NEW_LINE>bootstrap.childHandler(new ChannelInitializer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void initChannel(Channel channel) throws Exception {<NEW_LINE>channel.pipeline().addLast(channelRegistrar);<NEW_LINE>NettyUtil.addHttpServerCodec(channel.pipeline());<NEW_LINE>channel.pipeline().addLast(handler);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>bootstrap.localAddress(user.isAvailableExternally() ? new InetSocketAddress(port) <MASK><NEW_LINE>channelRegistrar.setServerChannel(bootstrap.bind().syncUninterruptibly().channel(), false);<NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>try {<NEW_LINE>NettyUtil.log(e, Logger.getInstance(BuiltInServer.class));<NEW_LINE>} finally {<NEW_LINE>user.cannotBind(e, port);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | : NetUtils.loopbackSocketAddress(port)); |
469,357 | public KrakenPublicTrades deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException {<NEW_LINE>List<KrakenPublicTrade> krakenTrades = new ArrayList<>();<NEW_LINE>long last = 0;<NEW_LINE>ObjectCodec oc = jsonParser.getCodec();<NEW_LINE>JsonNode node = oc.readTree(jsonParser);<NEW_LINE>Iterator<Entry<String, JsonNode>> tradesResultIterator = node.fields();<NEW_LINE>while (tradesResultIterator.hasNext()) {<NEW_LINE>Entry<String, JsonNode> entry = tradesResultIterator.next();<NEW_LINE>String key = entry.getKey();<NEW_LINE>JsonNode value = entry.getValue();<NEW_LINE>if (key == "last") {<NEW_LINE>last = value.asLong();<NEW_LINE>} else if (value.isArray()) {<NEW_LINE>for (JsonNode tradeJsonNode : value) {<NEW_LINE>BigDecimal price = new BigDecimal(tradeJsonNode.path(0).asText());<NEW_LINE>BigDecimal volume = new BigDecimal(tradeJsonNode.path<MASK><NEW_LINE>double time = tradeJsonNode.path(2).asDouble();<NEW_LINE>KrakenType type = KrakenType.fromString(tradeJsonNode.path(3).asText());<NEW_LINE>KrakenOrderType orderType = KrakenOrderType.fromString(tradeJsonNode.path(4).asText());<NEW_LINE>String miscellaneous = tradeJsonNode.path(5).asText();<NEW_LINE>krakenTrades.add(new KrakenPublicTrade(price, volume, time, type, orderType, miscellaneous));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new KrakenPublicTrades(krakenTrades, last);<NEW_LINE>} | (1).asText()); |
1,713,322 | private static void listFromProvider(ConfiguredProperty property, Map<String, ConfiguredType> typesMap, int nesting, String spaces) {<NEW_LINE>// let's find all supported providers<NEW_LINE>List<ConfiguredType> providers = new LinkedList<>();<NEW_LINE>for (ConfiguredType value : typesMap.values()) {<NEW_LINE>if (value.provides().contains(property.type())) {<NEW_LINE>providers.add(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>if (providers.isEmpty()) {<NEW_LINE>System.out.print(spaces + <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (ConfiguredType provider : providers) {<NEW_LINE>System.out.print(spaces + "- ");<NEW_LINE>if (provider.prefix() != null) {<NEW_LINE>System.out.println("# " + provider.description());<NEW_LINE>System.out.println(spaces + " " + provider.prefix() + ":");<NEW_LINE>printType(provider, typesMap, nesting + 2, false);<NEW_LINE>} else {<NEW_LINE>printType(provider, typesMap, nesting + 1, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "- # There are no modules on classpath providing " + property.type()); |
525,890 | static String toHeaderName(String name) {<NEW_LINE>requireNonNull(name, "name");<NEW_LINE>checkArgument(!name.isEmpty(), "name is empty.");<NEW_LINE>final String <MASK><NEW_LINE>if (name.equals(upperCased)) {<NEW_LINE>return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name);<NEW_LINE>}<NEW_LINE>final String lowerCased = Ascii.toLowerCase(name);<NEW_LINE>if (name.equals(lowerCased)) {<NEW_LINE>return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name);<NEW_LINE>}<NEW_LINE>// Ensure that the name does not contain '_'.<NEW_LINE>// If it contains '_', we give up to make it lower hyphen case. Just converting it to lower case.<NEW_LINE>if (name.indexOf('_') >= 0) {<NEW_LINE>return lowerCased;<NEW_LINE>}<NEW_LINE>if (Ascii.isUpperCase(name.charAt(0))) {<NEW_LINE>return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, name);<NEW_LINE>} else {<NEW_LINE>return CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_HYPHEN, name);<NEW_LINE>}<NEW_LINE>} | upperCased = Ascii.toUpperCase(name); |
705,646 | private void grahamScan() {<NEW_LINE>if (points.size() < 3) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Iterator<double[]> iter = points.iterator();<NEW_LINE>Stack<double[]> stack = new Stack<>();<NEW_LINE>// Start with the first two points on the stack<NEW_LINE>final double[] first = iter.next();<NEW_LINE>stack.add(first);<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>double[] n = iter.next();<NEW_LINE>if (mdist(first, n) > 0) {<NEW_LINE>stack.add(n);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>double[] next = iter.next();<NEW_LINE>double[<MASK><NEW_LINE>double[] prev = stack.peek();<NEW_LINE>while ((stack.size() > 1) && (mdist(curr, next) == 0 || !isConvex(prev, curr, next))) {<NEW_LINE>curr = stack.pop();<NEW_LINE>prev = stack.peek();<NEW_LINE>}<NEW_LINE>stack.add(curr);<NEW_LINE>stack.add(next);<NEW_LINE>}<NEW_LINE>points = stack;<NEW_LINE>} | ] curr = stack.pop(); |
1,378,519 | private boolean isSLAStale(ResourceFile slaFile) {<NEW_LINE>String slafilename = slaFile.getName();<NEW_LINE>int index = slafilename.lastIndexOf('.');<NEW_LINE>String slabase = slafilename.substring(0, index);<NEW_LINE>String slaspecfilename = slabase + ".slaspec";<NEW_LINE>ResourceFile slaspecFile = new ResourceFile(<MASK><NEW_LINE>File resourceAsFile = slaspecFile.getFile(true);<NEW_LINE>SleighPreprocessor preprocessor = new SleighPreprocessor(new ModuleDefinitionsAdapter(), resourceAsFile);<NEW_LINE>long sourceTimestamp = Long.MAX_VALUE;<NEW_LINE>try {<NEW_LINE>sourceTimestamp = preprocessor.scanForTimestamp();<NEW_LINE>} catch (Exception e) {<NEW_LINE>// squash the error because we will force recompilation and errors<NEW_LINE>// will propagate elsewhere<NEW_LINE>}<NEW_LINE>long compiledTimestamp = slaFile.lastModified();<NEW_LINE>return (sourceTimestamp > compiledTimestamp);<NEW_LINE>} | slaFile.getParentFile(), slaspecfilename); |
359,547 | public void createDefaultAcl(final SecurableModel securableModel, final List<PermissionName> permissionNames) {<NEW_LINE>log.debug("createDefaultAcl() - securableModel: {}, permissionNames: {}", securableModel, permissionNames);<NEW_LINE>final AclClass aclClass = aclClassService.find(AclClassName.getByName(securableModel.getClass<MASK><NEW_LINE>final AclSid ownerAclSid = aclSidService.find(AclSidType.OWNER, 0L);<NEW_LINE>AclObjectIdentity aclObjectIdentity = aclObjectIdentityService.find(aclClass, securableModel.getId());<NEW_LINE>if (aclObjectIdentity == null) {<NEW_LINE>aclObjectIdentity = AclObjectIdentity.builder().aclClass(aclClass).objectId(securableModel.getId()).build();<NEW_LINE>}<NEW_LINE>for (final PermissionName permissionName : permissionNames) {<NEW_LINE>final AclEntry aclEntry = AclEntry.builder().aclSid(ownerAclSid).permission(permissionService.find(permissionName)).aclObjectIdentity(aclObjectIdentity).build();<NEW_LINE>aclEntryService.create(aclEntry);<NEW_LINE>}<NEW_LINE>} | ().getCanonicalName())); |
1,031,820 | public void write(Encoder encoder, AnnotationProcessingData value) throws Exception {<NEW_LINE>HierarchicalNameSerializer hierarchicalNameSerializer = classNameSerializerSupplier.get();<NEW_LINE>SetSerializer<String> typesSerializer = new SetSerializer<>(hierarchicalNameSerializer);<NEW_LINE>MapSerializer<String, Set<String>> generatedTypesSerializer = new MapSerializer<>(hierarchicalNameSerializer, typesSerializer);<NEW_LINE>GeneratedResourceSerializer resourceSerializer = new GeneratedResourceSerializer(hierarchicalNameSerializer);<NEW_LINE>SetSerializer<GeneratedResource> resourcesSerializer = new SetSerializer<>(resourceSerializer);<NEW_LINE>MapSerializer<String, Set<GeneratedResource>> generatedResourcesSerializer = new <MASK><NEW_LINE>generatedTypesSerializer.write(encoder, value.generatedTypesByOrigin);<NEW_LINE>typesSerializer.write(encoder, value.aggregatedTypes);<NEW_LINE>typesSerializer.write(encoder, value.generatedTypesDependingOnAllOthers);<NEW_LINE>encoder.writeNullableString(value.fullRebuildCause);<NEW_LINE>generatedResourcesSerializer.write(encoder, value.generatedResourcesByOrigin);<NEW_LINE>resourcesSerializer.write(encoder, value.generatedResourcesDependingOnAllOthers);<NEW_LINE>} | MapSerializer<>(hierarchicalNameSerializer, resourcesSerializer); |
301,346 | void validateData() {<NEW_LINE>assert EventQueue.isDispatchThread();<NEW_LINE>for (BuildTask buildTask : buildTasks) {<NEW_LINE>String text = buildTask.getText();<NEW_LINE>if (text != null && text.isEmpty()) {<NEW_LINE>category.setErrorMessage(Bundle.CustomizerPanel_error_field_empty());<NEW_LINE>category.setValid(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>String message = " ";<NEW_LINE>if (customizerPanel != null) {<NEW_LINE>if (!customizerPanel.isValid()) {<NEW_LINE>String error = customizerPanel.getErrorMessage();<NEW_LINE>assert error != null <MASK><NEW_LINE>category.setErrorMessage(error);<NEW_LINE>category.setValid(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String warning = customizerPanel.getWarningMessage();<NEW_LINE>if (warning != null) {<NEW_LINE>message = warning;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>category.setErrorMessage(message);<NEW_LINE>category.setValid(true);<NEW_LINE>} | : "Non-null error message must be returned for invalid panel of " + category.getDisplayName(); |
1,766,496 | public void showModal(boolean restoreFocus) {<NEW_LINE>if (mainWidget_ == null) {<NEW_LINE>mainWidget_ = createMainWidget();<NEW_LINE>// get the main widget to line up with the right edge of the buttons.<NEW_LINE>mainWidget_.getElement().getStyle().setMarginRight(2, Unit.PX);<NEW_LINE>mainPanel_.insert(mainWidget_, 0);<NEW_LINE>}<NEW_LINE>restoreFocus_ = restoreFocus;<NEW_LINE>if (restoreFocus) {<NEW_LINE>originallyActiveElement_ = DomUtils.getActiveElement();<NEW_LINE>if (originallyActiveElement_ != null)<NEW_LINE>originallyActiveElement_.blur();<NEW_LINE>}<NEW_LINE>// position the dialog<NEW_LINE>positionAndShowDialog(() -> {<NEW_LINE>// defer shown notification to allow all elements to render<NEW_LINE>// before attempting to interact w/ them programmatically (e.g. setFocus)<NEW_LINE>Timers.singleShot(100<MASK><NEW_LINE>});<NEW_LINE>} | , () -> onDialogShown()); |
873,746 | private void toggleWatchingState() {<NEW_LINE>WatchingService service = ServiceFactory.get(WatchingService.class, false);<NEW_LINE>final Single<Boolean> responseSingle;<NEW_LINE>if (mIsWatching) {<NEW_LINE>responseSingle = service.deleteRepositorySubscription(mRepoOwner, mRepoName).map(ApiHelpers::mapToBooleanOrThrowOnFailure).map(result -> false);<NEW_LINE>} else {<NEW_LINE>SubscriptionRequest request = SubscriptionRequest.builder().subscribed(true).build();<NEW_LINE>responseSingle = service.setRepositorySubscription(mRepoOwner, mRepoName, request).map(ApiHelpers::throwOnFailure).map(<MASK><NEW_LINE>}<NEW_LINE>responseSingle.compose(RxUtils::doInBackground).subscribe(result -> {<NEW_LINE>if (mIsWatching != null) {<NEW_LINE>mIsWatching = result;<NEW_LINE>}<NEW_LINE>getActivity().invalidateOptionsMenu();<NEW_LINE>}, error -> {<NEW_LINE>handleActionFailure("Updating repo watching state failed", error);<NEW_LINE>});<NEW_LINE>} | sub -> sub.subscribed()); |
1,653,422 | protected boolean shouldDroppedTagBeRemovedOnUpdate(RequestDetails theRequest, ResourceTag theTag) {<NEW_LINE>Set<TagTypeEnum> metaSnapshotModeTokens = null;<NEW_LINE>if (theRequest != null) {<NEW_LINE>List<String> metaSnapshotMode = <MASK><NEW_LINE>if (metaSnapshotMode != null && !metaSnapshotMode.isEmpty()) {<NEW_LINE>metaSnapshotModeTokens = new HashSet<>();<NEW_LINE>for (String nextHeaderValue : metaSnapshotMode) {<NEW_LINE>StringTokenizer tok = new StringTokenizer(nextHeaderValue, ",");<NEW_LINE>while (tok.hasMoreTokens()) {<NEW_LINE>switch(trim(tok.nextToken())) {<NEW_LINE>case "TAG":<NEW_LINE>metaSnapshotModeTokens.add(TagTypeEnum.TAG);<NEW_LINE>break;<NEW_LINE>case "PROFILE":<NEW_LINE>metaSnapshotModeTokens.add(TagTypeEnum.PROFILE);<NEW_LINE>break;<NEW_LINE>case "SECURITY_LABEL":<NEW_LINE>metaSnapshotModeTokens.add(TagTypeEnum.SECURITY_LABEL);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (metaSnapshotModeTokens == null) {<NEW_LINE>metaSnapshotModeTokens = Collections.singleton(TagTypeEnum.PROFILE);<NEW_LINE>}<NEW_LINE>return metaSnapshotModeTokens.contains(theTag.getTag().getTagType());<NEW_LINE>} | theRequest.getHeaders(JpaConstants.HEADER_META_SNAPSHOT_MODE); |
588,874 | private List<Wo> list(Business business, EffectivePerson effectivePesron, Wi wi) throws Exception {<NEW_LINE>List<Wo> wos = new ArrayList<>();<NEW_LINE>if (StringUtils.isEmpty(wi.getKey())) {<NEW_LINE>return wos;<NEW_LINE>}<NEW_LINE>List<String> personIds = business.expendGroupRoleToPerson(wi.getGroupList(), wi.getRoleList());<NEW_LINE>String str = StringUtils.lowerCase(StringTools.escapeSqlLikeKey(wi.getKey()));<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Person.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Person> root = cq.from(Person.class);<NEW_LINE>Predicate p = cb.like(cb.lower(root.get(Person_.name)), "%" + str + "%", StringTools.SQL_ESCAPE_CHAR);<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.unique)), "%" + str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.pinyin)), str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.pinyinInitial)), str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.mobile)), str <MASK><NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.distinguishedName)), str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>if (ListTools.isNotEmpty(personIds)) {<NEW_LINE>p = cb.and(p, root.get(Person_.id).in(personIds));<NEW_LINE>} else {<NEW_LINE>if (ListTools.isNotEmpty(wi.getGroupList(), wi.getRoleList())) {<NEW_LINE>return wos;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>p = cb.and(p, business.personPredicateWithTopUnit(effectivePesron));<NEW_LINE>List<String> ids = em.createQuery(cq.select(root.get(Person_.id)).where(p)).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>List<Person> os = business.entityManagerContainer().list(Person.class, ids);<NEW_LINE>wos = Wo.copier.copy(os);<NEW_LINE>wos = business.person().sort(wos);<NEW_LINE>return wos;<NEW_LINE>} | + "%", StringTools.SQL_ESCAPE_CHAR)); |
197,179 | private void doLoadMaps() {<NEW_LINE>Connection c = null;<NEW_LINE>boolean err = false;<NEW_LINE>mapKey.clear();<NEW_LINE>// Read the maps table - cache results<NEW_LINE>try {<NEW_LINE>c = getConnection();<NEW_LINE>Statement stmt = c.createStatement();<NEW_LINE>ResultSet rs = stmt.<MASK><NEW_LINE>while (rs.next()) {<NEW_LINE>int key = rs.getInt("ID");<NEW_LINE>String worldID = rs.getString("WorldID");<NEW_LINE>String mapID = rs.getString("MapID");<NEW_LINE>String variant = rs.getString("Variant");<NEW_LINE>long serverid = rs.getLong("ServerID");<NEW_LINE>if (serverid == serverID) {<NEW_LINE>// One of ours<NEW_LINE>mapKey.put(worldID + ":" + mapID + ":" + variant, key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>stmt.close();<NEW_LINE>} catch (SQLException x) {<NEW_LINE>logSQLException("Error loading map table", x);<NEW_LINE>err = true;<NEW_LINE>} finally {<NEW_LINE>releaseConnection(c, err);<NEW_LINE>c = null;<NEW_LINE>}<NEW_LINE>} | executeQuery("SELECT * from " + tableMaps + ";"); |
1,850,129 | public static ListRepositoryTagsResponse unmarshall(ListRepositoryTagsResponse listRepositoryTagsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listRepositoryTagsResponse.setRequestId(_ctx.stringValue("ListRepositoryTagsResponse.RequestId"));<NEW_LINE>listRepositoryTagsResponse.setErrorCode(_ctx.stringValue("ListRepositoryTagsResponse.ErrorCode"));<NEW_LINE>listRepositoryTagsResponse.setSuccess(_ctx.booleanValue("ListRepositoryTagsResponse.Success"));<NEW_LINE>listRepositoryTagsResponse.setErrorMessage(_ctx.stringValue("ListRepositoryTagsResponse.ErrorMessage"));<NEW_LINE>listRepositoryTagsResponse.setTotal(_ctx.longValue("ListRepositoryTagsResponse.Total"));<NEW_LINE>List<ResultItem> result = new ArrayList<ResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListRepositoryTagsResponse.Result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setId(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Id"));<NEW_LINE>resultItem.setName(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Name"));<NEW_LINE>resultItem.setMessage(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Message"));<NEW_LINE>Commit commit = new Commit();<NEW_LINE>commit.setId(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.Id"));<NEW_LINE>commit.setShortId(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.ShortId"));<NEW_LINE>commit.setTitle(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.Title"));<NEW_LINE>commit.setAuthorName(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.AuthorName"));<NEW_LINE>commit.setAuthorEmail(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.AuthorEmail"));<NEW_LINE>commit.setCreatedAt(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.CreatedAt"));<NEW_LINE>commit.setMessage(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.Message"));<NEW_LINE>commit.setAuthoredDate(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.AuthoredDate"));<NEW_LINE>commit.setCommittedDate(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.CommittedDate"));<NEW_LINE>commit.setCommitterEmail(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.CommitterEmail"));<NEW_LINE>commit.setCommitterName(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.CommitterName"));<NEW_LINE>List<String> parentIds <MASK><NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.ParentIds.Length"); j++) {<NEW_LINE>parentIds.add(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.ParentIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>commit.setParentIds(parentIds);<NEW_LINE>Signature1 signature1 = new Signature1();<NEW_LINE>signature1.setGpgKeyId(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.Signature.GpgKeyId"));<NEW_LINE>signature1.setVerificationStatus(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.Signature.VerificationStatus"));<NEW_LINE>commit.setSignature1(signature1);<NEW_LINE>resultItem.setCommit(commit);<NEW_LINE>Signature signature = new Signature();<NEW_LINE>signature.setGpgKeyId(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Signature.GpgKeyId"));<NEW_LINE>signature.setVerificationStatus(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Signature.VerificationStatus"));<NEW_LINE>resultItem.setSignature(signature);<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>listRepositoryTagsResponse.setResult(result);<NEW_LINE>return listRepositoryTagsResponse;<NEW_LINE>} | = new ArrayList<String>(); |
834,779 | public SizeConstraintSetUpdate unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SizeConstraintSetUpdate sizeConstraintSetUpdate = new SizeConstraintSetUpdate();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Action", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sizeConstraintSetUpdate.setAction(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("SizeConstraint", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sizeConstraintSetUpdate.setSizeConstraint(SizeConstraintJsonUnmarshaller.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 sizeConstraintSetUpdate;<NEW_LINE>} | class).unmarshall(context)); |
649,377 | protected void startTag(String name, Object text, boolean closed, java.util.Map<String, String> dynamicAttributes, Object... nameValues) {<NEW_LINE>indent();<NEW_LINE>sb.append<MASK><NEW_LINE>int len = nameValues.length;<NEW_LINE>for (int i = 0; i + 1 < len; i += 2) {<NEW_LINE>Object attrName = nameValues[i];<NEW_LINE>Object attrValue = nameValues[i + 1];<NEW_LINE>if (attrValue != null) {<NEW_LINE>sb.append(' ').append(attrName).append("=\"").append(escape(attrValue)).append('"');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dynamicAttributes != null) {<NEW_LINE>for (java.util.Map.Entry<String, String> e : dynamicAttributes.entrySet()) {<NEW_LINE>sb.append(' ').append(e.getKey()).append("=\"").append(escape(e.getValue())).append('"');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (text != null && closed) {<NEW_LINE>sb.append('>');<NEW_LINE>sb.append(escape(text, true));<NEW_LINE>sb.append("</").append(name).append(">\r\n");<NEW_LINE>} else {<NEW_LINE>if (closed) {<NEW_LINE>sb.append('/');<NEW_LINE>} else {<NEW_LINE>level++;<NEW_LINE>}<NEW_LINE>sb.append(">\r\n");<NEW_LINE>}<NEW_LINE>} | ('<').append(name); |
390,651 | public StartQueryResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StartQueryResult startQueryResult = new StartQueryResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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 startQueryResult;<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("queryId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startQueryResult.setQueryId(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 startQueryResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,028,304 | /*<NEW_LINE>* Download an image from a HTTP URL.<NEW_LINE>*<NEW_LINE>* @param String HTTP URL to download from.<NEW_LINE>* @param String The filename to save the remote image as.<NEW_LINE>* @return String Returns 'true' or 'false'. As Rhino does not like boolean, this is a String.<NEW_LINE>*/<NEW_LINE>public static String downloadHTTPTo(String urlString, String location) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>ByteArrayOutputStream outputStream;<NEW_LINE>try (InputStream inputStream = new BufferedInputStream(url.openStream())) {<NEW_LINE>outputStream = new ByteArrayOutputStream();<NEW_LINE>byte[] buffer = new byte[1024];<NEW_LINE>int n = 0;<NEW_LINE>while ((n = inputStream.read(buffer)) != -1) {<NEW_LINE>outputStream.write(buffer, 0, n);<NEW_LINE>}<NEW_LINE>outputStream.close();<NEW_LINE>}<NEW_LINE>byte[] imgData = outputStream.toByteArray();<NEW_LINE>if (!new File(location.substring(0, location.lastIndexOf("/"))).exists()) {<NEW_LINE>new File(location.substring(0, location.lastIndexOf("/"))).mkdirs();<NEW_LINE>}<NEW_LINE>try (FileOutputStream fileOutputStream = new FileOutputStream(location)) {<NEW_LINE>fileOutputStream.write(imgData);<NEW_LINE>}<NEW_LINE>return new String("true");<NEW_LINE>} catch (IOException ex) {<NEW_LINE>com.gmt2001.Console.debug.println("ImgDownload::downloadHTTP(" + urlString + ", " + location + ") failed: " + ex.getMessage());<NEW_LINE>return new String("false");<NEW_LINE>}<NEW_LINE>} | URL url = new URL(urlString); |
621,021 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see<NEW_LINE>* org.eclipse.paho.mqttv5.client.IMqttAsyncClient#subscribe(org.eclipse.paho.<NEW_LINE>* mqttv5.common.MqttSubscription[], java.lang.Object,<NEW_LINE>* org.eclipse.paho.mqttv5.client.MqttActionListener,<NEW_LINE>* org.eclipse.paho.mqttv5.client.IMqttMessageListener[],<NEW_LINE>* org.eclipse.paho.mqttv5.common.packet.MqttProperties)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public IMqttToken subscribe(MqttSubscription[] subscriptions, Object userContext, MqttActionListener callback, IMqttMessageListener[] messageListeners, MqttProperties subscriptionProperties) throws MqttException {<NEW_LINE>// add message handlers to the list for this client<NEW_LINE>for (int i = 0; i < subscriptions.length; ++i) {<NEW_LINE>MqttTopicValidator.validate(subscriptions[i].getTopic(), this.mqttConnection.isWildcardSubscriptionsAvailable(), this.mqttConnection.isSharedSubscriptionsAvailable());<NEW_LINE>if (messageListeners == null || messageListeners[i] == null) {<NEW_LINE>this.comms.removeMessageListener(subscriptions<MASK><NEW_LINE>} else {<NEW_LINE>this.comms.setMessageListener(null, subscriptions[i].getTopic(), messageListeners[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IMqttToken token = null;<NEW_LINE>try {<NEW_LINE>token = this.subscribeBase(subscriptions, userContext, callback, subscriptionProperties);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// if the subscribe fails, then we have to remove the message handlers<NEW_LINE>for (MqttSubscription subscription : subscriptions) {<NEW_LINE>this.comms.removeMessageListener(subscription.getTopic());<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>return token;<NEW_LINE>} | [i].getTopic()); |
408,824 | private JsonObject generateRecordType(BRecordType effectiveType) {<NEW_LINE>JsonObject typeNode;<NEW_LINE>LinkedHashMap<String, BField> fieldLinkedHashMap = effectiveType.getFields();<NEW_LINE>JsonObject effectiveTypeNode = new JsonObject();<NEW_LINE>JsonArray requiredFields = new JsonArray();<NEW_LINE>for (Map.Entry<String, BField> key : fieldLinkedHashMap.entrySet()) {<NEW_LINE>BField field = key.getValue();<NEW_LINE>JsonObject fieldTypeNode = getType(field.getType());<NEW_LINE>effectiveTypeNode.add(field.getName().getValue(), fieldTypeNode);<NEW_LINE>if (!Symbols.isOptional(field.symbol)) {<NEW_LINE>requiredFields.add(field.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>typeNode = createObjNode(effectiveTypeNode);<NEW_LINE>// Set required fields<NEW_LINE>if (!requiredFields.isEmpty()) {<NEW_LINE>typeNode.add("required", requiredFields);<NEW_LINE>}<NEW_LINE>// Get record type and set the type name as a property<NEW_LINE>if (effectiveType.getIntersectionType().isPresent()) {<NEW_LINE>for (BType bType : effectiveType.getIntersectionType().get().getConstituentTypes()) {<NEW_LINE>// Does not consider anonymous records<NEW_LINE>if (bType instanceof BTypeReferenceType) {<NEW_LINE>typeNode.addProperty("name", bType.toString().trim());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return typeNode;<NEW_LINE>} | getName().getValue()); |
192,508 | private Mono<Response<RemediationInner>> cancelAtResourceGroupWithResponseAsync(String resourceGroupName, String remediationName, 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 (remediationName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-10-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.cancelAtResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, remediationName, apiVersion, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter remediationName is required and cannot be null.")); |
40,497 | public void onClick(final View v) {<NEW_LINE>if (mBiv != null) {<NEW_LINE>mRootLayout.removeView(mBiv);<NEW_LINE>}<NEW_LINE>ImageViewFactory imageViewFactory;<NEW_LINE>switch(mImageLoader) {<NEW_LINE>case IMAGE_LOADER_FRESCO:<NEW_LINE>BigImageViewer.initialize(FrescoImageLoader.with(getApplicationContext()));<NEW_LINE>imageViewFactory = new FrescoImageViewFactory();<NEW_LINE>break;<NEW_LINE>case IMAGE_LOADER_GLIDE:<NEW_LINE>BigImageViewer.initialize(GlideImageLoader.with(getApplicationContext()));<NEW_LINE>imageViewFactory = new GlideImageViewFactory();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mBiv = new BigImageView(ImageTypesActivity.this);<NEW_LINE>mBiv.setImageViewFactory(imageViewFactory);<NEW_LINE>mBiv<MASK><NEW_LINE>mRootLayout.addView(mBiv, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);<NEW_LINE>mBiv.showImage(Uri.parse(IMAGE_URLS.get(mImageType)));<NEW_LINE>} | .setProgressIndicator(new ProgressPieIndicator()); |
1,828,411 | synchronized public void save(Writer writer, Properties options) throws IOException {<NEW_LINE>writer.write("maxCellIndex=");<NEW_LINE>writer.write(Integer.toString(_maxCellIndex));<NEW_LINE>writer.write('\n');<NEW_LINE>writer.write("keyColumnIndex=");<NEW_LINE>writer.write(Integer.toString(_keyColumnIndex));<NEW_LINE>writer.write('\n');<NEW_LINE>writer.write("columnCount=");<NEW_LINE>writer.write(Integer.toString<MASK><NEW_LINE>writer.write('\n');<NEW_LINE>for (Column column : columns) {<NEW_LINE>column.save(writer);<NEW_LINE>writer.write('\n');<NEW_LINE>}<NEW_LINE>writer.write("columnGroupCount=");<NEW_LINE>writer.write(Integer.toString(columnGroups.size()));<NEW_LINE>writer.write('\n');<NEW_LINE>for (ColumnGroup group : columnGroups) {<NEW_LINE>group.save(writer);<NEW_LINE>writer.write('\n');<NEW_LINE>}<NEW_LINE>writer.write("/e/\n");<NEW_LINE>} | (columns.size())); |
46,621 | private static PathStrategy parsePathStrategy(Context context, String authority) throws IOException, XmlPullParserException {<NEW_LINE>final SimplePathStrategy strat = new SimplePathStrategy(authority);<NEW_LINE>final ProviderInfo info = context.getPackageManager().resolveContentProvider(authority, PackageManager.GET_META_DATA);<NEW_LINE>final XmlResourceParser in = info.loadXmlMetaData(context.getPackageManager(), META_DATA_FILE_PROVIDER_PATHS);<NEW_LINE>if (in == null) {<NEW_LINE>throw new IllegalArgumentException("Missing " + META_DATA_FILE_PROVIDER_PATHS + " meta-data");<NEW_LINE>}<NEW_LINE>int type;<NEW_LINE>while ((type = in.next()) != END_DOCUMENT) {<NEW_LINE>if (type == START_TAG) {<NEW_LINE>final <MASK><NEW_LINE>final String name = in.getAttributeValue(null, ATTR_NAME);<NEW_LINE>String path = in.getAttributeValue(null, ATTR_PATH);<NEW_LINE>File target = null;<NEW_LINE>if (TAG_ROOT_PATH.equals(tag)) {<NEW_LINE>target = buildPath(DEVICE_ROOT, path);<NEW_LINE>} else if (TAG_FILES_PATH.equals(tag)) {<NEW_LINE>target = buildPath(context.getFilesDir(), path);<NEW_LINE>} else if (TAG_CACHE_PATH.equals(tag)) {<NEW_LINE>target = buildPath(context.getCacheDir(), path);<NEW_LINE>} else if (TAG_EXTERNAL.equals(tag)) {<NEW_LINE>target = buildPath(Environment.getExternalStorageDirectory(), path);<NEW_LINE>} else if (TAG_EXTERNAL_APP.equals(tag)) {<NEW_LINE>target = buildPath(context.getExternalFilesDir(null), path);<NEW_LINE>}<NEW_LINE>if (target != null) {<NEW_LINE>strat.addRoot(name, target);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return strat;<NEW_LINE>} | String tag = in.getName(); |
494,713 | private void createProfileForSelectedAuthType(XFormDialog dialog) {<NEW_LINE>String authType = dialog.getValue(AuthorizationTypeForm.AUTHORIZATION_TYPE);<NEW_LINE>CredentialsConfig.AuthType.Enum authTypeEnum;<NEW_LINE>String profileName;<NEW_LINE>if (CredentialsConfig.AuthType.O_AUTH_2_0.toString().equals(authType)) {<NEW_LINE>profileName = dialog.getValue(AuthorizationTypeForm.OAUTH_PROFILE_NAME_FIELD);<NEW_LINE>if (ProfileSelectionForm.isReservedProfileName(profileName)) {<NEW_LINE>UISupport.showErrorMessage(messages.get("AuthorizationSelectionDialog.Error.ReservedProfileName", profileName));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (getOAuth2ProfileContainer().getOAuth2ProfileNameList().contains(profileName)) {<NEW_LINE>UISupport.showErrorMessage(messages.get("AuthorizationSelectionDialog.Error.ProfileAlreadyExists", profileName));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>getOAuth2ProfileContainer().addNewOAuth2Profile(profileName);<NEW_LINE>authTypeEnum = CredentialsConfig.AuthType.O_AUTH_2_0;<NEW_LINE>} else if (CredentialsConfig.AuthType.O_AUTH_1_0.toString().equals(authType)) {<NEW_LINE>profileName = dialog.getValue(AuthorizationTypeForm.OAUTH_PROFILE_NAME_FIELD);<NEW_LINE>if (ProfileSelectionForm.isReservedProfileName(profileName)) {<NEW_LINE>UISupport.showErrorMessage(messages.get("AuthorizationSelectionDialog.Error.ReservedProfileName", profileName));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (getOAuth1ProfileContainer().getOAuth1ProfileNameList().contains(profileName)) {<NEW_LINE>UISupport.showErrorMessage(messages.get("AuthorizationSelectionDialog.Error.ProfileAlreadyExists", profileName));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>authTypeEnum = CredentialsConfig.AuthType.O_AUTH_1_0;<NEW_LINE>} else {<NEW_LINE>profileName = authType;<NEW_LINE>authTypeEnum = request.getBasicAuthType(authType);<NEW_LINE>}<NEW_LINE>request.setSelectedAuthProfileAndAuthType(profileName, authTypeEnum);<NEW_LINE>} | getOAuth1ProfileContainer().addNewOAuth1Profile(profileName); |
1,728,088 | public CoverageReportActionsWrapper createCoverageActionsWrapper(EventHandler reporter, BlazeDirectories directories, Collection<ConfiguredTarget> targetsToTest, NestedSet<Artifact> baselineCoverageArtifacts, ArtifactFactory factory, ActionKeyContext actionKeyContext, ArtifactOwner artifactOwner, String workspaceName, ArgsFunc argsFunction, LocationFunc locationFunc, boolean htmlReport) throws InterruptedException {<NEW_LINE>if (targetsToTest == null || targetsToTest.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ImmutableList.Builder<Artifact> builder = ImmutableList.<Artifact>builder();<NEW_LINE>FilesToRunProvider reportGenerator = null;<NEW_LINE>for (ConfiguredTarget target : targetsToTest) {<NEW_LINE>TestParams testParams = target.getProvider(TestProvider.class).getTestParams();<NEW_LINE>builder.addAll(testParams.getCoverageArtifacts());<NEW_LINE>if (reportGenerator == null) {<NEW_LINE>reportGenerator = testParams.getCoverageReportGenerator();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.addAll(baselineCoverageArtifacts.toList());<NEW_LINE>ImmutableList<Artifact> coverageArtifacts = builder.build();<NEW_LINE>if (!coverageArtifacts.isEmpty()) {<NEW_LINE>PathFragment coverageDir = TestRunnerAction.COVERAGE_TMP_ROOT;<NEW_LINE>Artifact lcovArtifact = factory.getDerivedArtifact(coverageDir.getRelative("lcov_files.tmp"), directories.getBuildDataDirectory(workspaceName), artifactOwner);<NEW_LINE>Action lcovFileAction = generateLcovFileWriteAction(lcovArtifact, coverageArtifacts);<NEW_LINE>Action coverageReportAction = generateCoverageReportAction(CoverageArgs.create(directories, coverageArtifacts, lcovArtifact, factory, artifactOwner, reportGenerator, workspaceName, htmlReport), argsFunction, locationFunc);<NEW_LINE>return new <MASK><NEW_LINE>} else {<NEW_LINE>reporter.handle(Event.error("Cannot generate coverage report - no coverage information was collected"));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | CoverageReportActionsWrapper(lcovFileAction, coverageReportAction, actionKeyContext); |
1,424,212 | public void mapPartition(Iterable<Tuple2<Integer, Integer>> values, Collector<Tuple3<Integer, Integer, Integer>> out) throws Exception {<NEW_LINE>int numPartitions = getRuntimeContext().getNumberOfParallelSubtasks();<NEW_LINE>List<Tuple2<Integer, Integer>> itemCounts = new ArrayList<>();<NEW_LINE>for (Tuple2<Integer, Integer> v : values) {<NEW_LINE>itemCounts.add(v);<NEW_LINE>}<NEW_LINE>itemCounts.sort((o1, o2) -> {<NEW_LINE>int cmp = Long.compare(o2.f1, o1.f1);<NEW_LINE>return cmp == 0 ? Integer.compare(o1.<MASK><NEW_LINE>});<NEW_LINE>// queue of tuple: partition, count<NEW_LINE>PriorityQueue<Tuple2<Integer, Double>> queue = new PriorityQueue<>(numPartitions, Comparator.comparingDouble(o -> o.f1));<NEW_LINE>for (int i = 0; i < numPartitions; i++) {<NEW_LINE>queue.add(Tuple2.of(i, 0.0));<NEW_LINE>}<NEW_LINE>List<Double> scaledItemCount = new ArrayList<>(itemCounts.size());<NEW_LINE>for (int i = 0; i < itemCounts.size(); i++) {<NEW_LINE>Tuple2<Integer, Integer> item = itemCounts.get(i);<NEW_LINE>double pos = (double) i / ((double) itemCounts.size());<NEW_LINE>double score = pos * item.f1.doubleValue();<NEW_LINE>scaledItemCount.add(score);<NEW_LINE>}<NEW_LINE>List<Integer> order = new ArrayList<>(itemCounts.size());<NEW_LINE>for (int i = 0; i < itemCounts.size(); i++) {<NEW_LINE>order.add(i);<NEW_LINE>}<NEW_LINE>order.sort((o1, o2) -> {<NEW_LINE>double s1 = scaledItemCount.get(o1);<NEW_LINE>double s2 = scaledItemCount.get(o2);<NEW_LINE>return Double.compare(s2, s1);<NEW_LINE>});<NEW_LINE>// greedily assign partition number to each item<NEW_LINE>for (int i = 0; i < itemCounts.size(); i++) {<NEW_LINE>Tuple2<Integer, Integer> item = itemCounts.get(order.get(i));<NEW_LINE>double score = scaledItemCount.get(order.get(i));<NEW_LINE>Tuple2<Integer, Double> target = queue.poll();<NEW_LINE>int targetPartition = target.f0;<NEW_LINE>target.f1 += score;<NEW_LINE>queue.add(target);<NEW_LINE>out.collect(Tuple3.of(item.f0, order.get(i), targetPartition));<NEW_LINE>}<NEW_LINE>} | f0, o2.f0) : cmp; |
1,456,399 | public List<String> listResourcesOfApp(String app) {<NEW_LINE>List<String> results = new ArrayList<>();<NEW_LINE>if (StringUtil.isBlank(app)) {<NEW_LINE>return results;<NEW_LINE>}<NEW_LINE>// resource -> timestamp -> metric<NEW_LINE>Map<String, LinkedHashMap<Long, MetricEntity>> resourceMap = allMetrics.get(app);<NEW_LINE>if (resourceMap == null) {<NEW_LINE>return results;<NEW_LINE>}<NEW_LINE>final long minTimeMs = System.currentTimeMillis() - 1000 * 60;<NEW_LINE>Map<String, MetricEntity> resourceCount = new ConcurrentHashMap<>(32);<NEW_LINE>readWriteLock.readLock().lock();<NEW_LINE>try {<NEW_LINE>for (Entry<String, LinkedHashMap<Long, MetricEntity>> resourceMetrics : resourceMap.entrySet()) {<NEW_LINE>for (Entry<Long, MetricEntity> metrics : resourceMetrics.getValue().entrySet()) {<NEW_LINE>if (metrics.getKey() < minTimeMs) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>MetricEntity newEntity = metrics.getValue();<NEW_LINE>if (resourceCount.containsKey(resourceMetrics.getKey())) {<NEW_LINE>MetricEntity oldEntity = resourceCount.get(resourceMetrics.getKey());<NEW_LINE>oldEntity.<MASK><NEW_LINE>oldEntity.addRtAndSuccessQps(newEntity.getRt(), newEntity.getSuccessQps());<NEW_LINE>oldEntity.addBlockQps(newEntity.getBlockQps());<NEW_LINE>oldEntity.addExceptionQps(newEntity.getExceptionQps());<NEW_LINE>oldEntity.addCount(1);<NEW_LINE>} else {<NEW_LINE>resourceCount.put(resourceMetrics.getKey(), MetricEntity.copyOf(newEntity));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Order by last minute b_qps DESC.<NEW_LINE>return resourceCount.entrySet().stream().sorted((o1, o2) -> {<NEW_LINE>MetricEntity e1 = o1.getValue();<NEW_LINE>MetricEntity e2 = o2.getValue();<NEW_LINE>int t = e2.getBlockQps().compareTo(e1.getBlockQps());<NEW_LINE>if (t != 0) {<NEW_LINE>return t;<NEW_LINE>}<NEW_LINE>return e2.getPassQps().compareTo(e1.getPassQps());<NEW_LINE>}).map(Entry::getKey).collect(Collectors.toList());<NEW_LINE>} finally {<NEW_LINE>readWriteLock.readLock().unlock();<NEW_LINE>}<NEW_LINE>} | addPassQps(newEntity.getPassQps()); |
743,800 | private void fixOrRemovePatternsWhichReferenceNoneExistingTrips() {<NEW_LINE>int orgSize = tripPatterns.size();<NEW_LINE>List<Map.Entry<StopPattern, TripPattern>> <MASK><NEW_LINE>for (Map.Entry<StopPattern, TripPattern> e : tripPatterns.entries()) {<NEW_LINE>TripPattern ptn = e.getValue();<NEW_LINE>ptn.removeTrips(t -> !tripsById.containsKey(t.getId()));<NEW_LINE>if (ptn.scheduledTripsAsStream().findAny().isEmpty()) {<NEW_LINE>removePatterns.add(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<StopPattern, TripPattern> it : removePatterns) {<NEW_LINE>tripPatterns.remove(it.getKey(), it.getValue());<NEW_LINE>}<NEW_LINE>logRemove("TripPattern", orgSize, tripPatterns.size(), "No trips for pattern exist.");<NEW_LINE>} | removePatterns = new ArrayList<>(); |
1,417,113 | public ASTNode visitCreateDefaultShardingStrategy(final CreateDefaultShardingStrategyContext ctx) {<NEW_LINE>ShardingStrategyContext shardingStrategyContext = ctx.shardingStrategy();<NEW_LINE>String shardingAlgorithmName = null;<NEW_LINE>if (null != shardingStrategyContext.shardingAlgorithm().existingAlgorithm()) {<NEW_LINE>shardingAlgorithmName = getIdentifierValue(shardingStrategyContext.shardingAlgorithm().existingAlgorithm().shardingAlgorithmName()).toLowerCase();<NEW_LINE>}<NEW_LINE>AlgorithmSegment algorithmSegment = null;<NEW_LINE>if (null != shardingStrategyContext.shardingAlgorithm().autoCreativeAlgorithm()) {<NEW_LINE>algorithmSegment = (AlgorithmSegment) visitAlgorithmDefinition(shardingStrategyContext.shardingAlgorithm().autoCreativeAlgorithm().algorithmDefinition());<NEW_LINE>}<NEW_LINE>String defaultType = new IdentifierValue(ctx.type.<MASK><NEW_LINE>String strategyType = getIdentifierValue(shardingStrategyContext.strategyType());<NEW_LINE>String shardingColumn = buildShardingColumn(ctx.shardingStrategy().shardingColumnDefinition());<NEW_LINE>return new CreateDefaultShardingStrategyStatement(defaultType, strategyType, shardingColumn, shardingAlgorithmName, algorithmSegment);<NEW_LINE>} | getText()).getValue(); |
1,671,322 | final DeleteProjectResult executeDeleteProject(DeleteProjectRequest deleteProjectRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteProjectRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteProjectRequest> request = null;<NEW_LINE>Response<DeleteProjectResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteProjectRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteProjectRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteProject");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteProjectResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteProjectResultJsonUnmarshaller());<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>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "Device Farm"); |
1,559,716 | public void exitOgs_service_object(Ogs_service_objectContext ctx) {<NEW_LINE>if (ctx.predef != null) {<NEW_LINE>String name = ctx.predef.getText();<NEW_LINE>_currentServiceObjectGroup.getLines().add(new ServiceObjectReferenceServiceObjectGroupLine(name));<NEW_LINE>_configuration.getServiceObjects().computeIfAbsent(name, AsaPredefinedServiceObject::forName);<NEW_LINE>} else if (ctx.name != null) {<NEW_LINE>String name <MASK><NEW_LINE>_currentServiceObjectGroup.getLines().add(new ServiceObjectReferenceServiceObjectGroupLine(name));<NEW_LINE>_configuration.referenceStructure(SERVICE_OBJECT, name, SERVICE_OBJECT_GROUP_SERVICE_OBJECT, ctx.name.getStart().getLine());<NEW_LINE>} else if (ctx.service_specifier() != null) {<NEW_LINE>_currentServiceObjectGroup.getLines().add(_currentServiceObject);<NEW_LINE>_currentServiceObject = null;<NEW_LINE>}<NEW_LINE>} | = ctx.name.getText(); |
1,803,577 | final DeleteInvitationsResult executeDeleteInvitations(DeleteInvitationsRequest deleteInvitationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteInvitationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteInvitationsRequest> request = null;<NEW_LINE>Response<DeleteInvitationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteInvitationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteInvitationsRequest));<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, "Macie2");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteInvitationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteInvitationsResultJsonUnmarshaller());<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>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteInvitations"); |
816,933 | public static DescribeNotificationSettingResponse unmarshall(DescribeNotificationSettingResponse describeNotificationSettingResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeNotificationSettingResponse.setRequestId(_ctx.stringValue("DescribeNotificationSettingResponse.RequestId"));<NEW_LINE>describeNotificationSettingResponse.setEmail(_ctx.stringValue("DescribeNotificationSettingResponse.Email"));<NEW_LINE>describeNotificationSettingResponse.setPhone(_ctx.stringValue("DescribeNotificationSettingResponse.Phone"));<NEW_LINE>describeNotificationSettingResponse.setScheduleMessageTime(_ctx.integerValue("DescribeNotificationSettingResponse.ScheduleMessageTime"));<NEW_LINE>describeNotificationSettingResponse.setScheduleMessageTimeZone(_ctx.integerValue("DescribeNotificationSettingResponse.ScheduleMessageTimeZone"));<NEW_LINE>List<String> realtimeMessageList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeNotificationSettingResponse.RealtimeMessageList.Length"); i++) {<NEW_LINE>realtimeMessageList.add(_ctx.stringValue("DescribeNotificationSettingResponse.RealtimeMessageList[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeNotificationSettingResponse.setRealtimeMessageList(realtimeMessageList);<NEW_LINE>List<String> reminderModeList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeNotificationSettingResponse.ReminderModeList.Length"); i++) {<NEW_LINE>reminderModeList.add(_ctx.stringValue<MASK><NEW_LINE>}<NEW_LINE>describeNotificationSettingResponse.setReminderModeList(reminderModeList);<NEW_LINE>return describeNotificationSettingResponse;<NEW_LINE>} | ("DescribeNotificationSettingResponse.ReminderModeList[" + i + "]")); |
518,429 | public PCollection<T> expand(PBegin input) {<NEW_LINE>checkArgument(getConnectionFactory() != null, "withConnectionFactory() is required");<NEW_LINE>checkArgument(getQueue() != null || <MASK><NEW_LINE>checkArgument(getQueue() == null || getTopic() == null, "withQueue() and withTopic() are exclusive");<NEW_LINE>checkArgument(getMessageMapper() != null, "withMessageMapper() is required");<NEW_LINE>checkArgument(getCoder() != null, "withCoder() is required");<NEW_LINE>// handles unbounded source to bounded conversion if maxNumRecords is set.<NEW_LINE>Unbounded<T> unbounded = org.apache.beam.sdk.io.Read.from(createSource());<NEW_LINE>PTransform<PBegin, PCollection<T>> transform = unbounded;<NEW_LINE>if (getMaxNumRecords() < Long.MAX_VALUE || getMaxReadTime() != null) {<NEW_LINE>transform = unbounded.withMaxReadTime(getMaxReadTime()).withMaxNumRecords(getMaxNumRecords());<NEW_LINE>}<NEW_LINE>return input.getPipeline().apply(transform);<NEW_LINE>} | getTopic() != null, "Either withQueue() or withTopic() is required"); |
1,376,004 | public static void process(GrayU8 orig, GrayS16 derivX, GrayS16 derivY) {<NEW_LINE>final byte[] data = orig.data;<NEW_LINE>final short[] imgX = derivX.data;<NEW_LINE>final short[] imgY = derivY.data;<NEW_LINE>final int width = orig.getWidth();<NEW_LINE>final int height = orig.getHeight() - 1;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(1,height,y->{<NEW_LINE>for (int y = 1; y < height; y++) {<NEW_LINE>int endX <MASK><NEW_LINE>for (int index = width * y + 1; index < endX; index++) {<NEW_LINE>int v = (data[index + width + 1] & 0xFF) - (data[index - width - 1] & 0xFF);<NEW_LINE>int w = (data[index + width - 1] & 0xFF) - (data[index - width + 1] & 0xFF);<NEW_LINE>imgY[index] = (short) (((data[index + width] & 0xFF) - (data[index - width] & 0xFF)) * 2 + v + w);<NEW_LINE>imgX[index] = (short) (((data[index + 1] & 0xFF) - (data[index - 1] & 0xFF)) * 2 + v - w);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | = width * y + width - 1; |
570,330 | final UpdateMaintenanceWindowResult executeUpdateMaintenanceWindow(UpdateMaintenanceWindowRequest updateMaintenanceWindowRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateMaintenanceWindowRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateMaintenanceWindowRequest> request = null;<NEW_LINE>Response<UpdateMaintenanceWindowResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateMaintenanceWindowRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateMaintenanceWindowRequest));<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, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateMaintenanceWindow");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateMaintenanceWindowResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateMaintenanceWindowResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
747,485 | public static MutationReport checkAllMutations(Browser browser, String specPath, List<String> includedTags, List<String> excludedTags, MutationOptions mutationOptions, Properties properties, ValidationListener validationListener) throws IOException {<NEW_LINE>SectionFilter sectionFilter <MASK><NEW_LINE>PageSpec pageSpec = parseSpec(specPath, browser, sectionFilter, properties);<NEW_LINE>File screenshotFile = browser.getPage().getScreenshotFile();<NEW_LINE>MutationRecordBrowser mutationRecordBrowser = new MutationRecordBrowser(browser);<NEW_LINE>LayoutReport initialLayoutReport = Galen.checkLayout(mutationRecordBrowser, pageSpec, sectionFilter, screenshotFile, validationListener);<NEW_LINE>MutationReport mutationReport;<NEW_LINE>if (initialLayoutReport.errors() > 0) {<NEW_LINE>mutationReport = createCrashedMutationReport("Cannot perform mutation testing. There are errors in initial layout validation report");<NEW_LINE>} else {<NEW_LINE>mutationReport = testAllMutations(mutationRecordBrowser.getRecordedElements(), browser, pageSpec, sectionFilter, mutationOptions, screenshotFile);<NEW_LINE>}<NEW_LINE>mutationReport.setInitialLayoutReport(initialLayoutReport);<NEW_LINE>return mutationReport;<NEW_LINE>} | = new SectionFilter(includedTags, excludedTags); |
413,635 | private void generateModelsToDir(File countDir, File modelDir, String[] languages, boolean compressed) throws IOException {<NEW_LINE>LanguageIdentifier identifier = LanguageIdentifier.generateFromCounts(countDir, languages);<NEW_LINE>List<CharNgramLanguageModel> models = identifier.getModels();<NEW_LINE>mkDir(modelDir);<NEW_LINE>for (CharNgramLanguageModel model : models) {<NEW_LINE>System.out.println("Generating model for:" + model.getId());<NEW_LINE>MapBasedCharNgramLanguageModel mbm = (MapBasedCharNgramLanguageModel) model;<NEW_LINE>if (compressed) {<NEW_LINE>File modelFile = new File(modelDir, model.getId() + ".clm");<NEW_LINE>CompressedCharNgramModel.compress(mbm, modelFile);<NEW_LINE>} else {<NEW_LINE>File modelFile = new File(modelDir, <MASK><NEW_LINE>mbm.saveCustom(modelFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | model.getId() + ".lm"); |
78,183 | public static FAFProvider queryMethod(EPCompiled compiled, EPServicesContext services) {<NEW_LINE>ClassLoader classLoader = ClassProvidedImportClassLoaderFactory.getClassLoader(compiled.getClasses(), services.getClassLoaderParent(), services.getClassProvidedPathRegistry());<NEW_LINE>try {<NEW_LINE>RuntimeVersion.checkVersion(compiled.<MASK><NEW_LINE>} catch (RuntimeVersion.VersionException ex) {<NEW_LINE>throw new EPException(ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>if (compiled.getManifest().getQueryProviderClassName() == null) {<NEW_LINE>if (compiled.getManifest().getModuleProviderClassName() != null) {<NEW_LINE>throw new EPException("Cannot execute a fire-and-forget query that was compiled as module EPL, make sure to use the 'compileQuery' method of the compiler");<NEW_LINE>}<NEW_LINE>throw new EPException("Failed to find query provider class name in manifest (is this a compiled fire-and-forget query?)");<NEW_LINE>}<NEW_LINE>String className = compiled.getManifest().getQueryProviderClassName();<NEW_LINE>// load module resource class<NEW_LINE>Class clazz;<NEW_LINE>try {<NEW_LINE>clazz = classLoader.loadClass(className);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new EPException(e);<NEW_LINE>}<NEW_LINE>// get FAF provider<NEW_LINE>FAFProvider fafProvider;<NEW_LINE>try {<NEW_LINE>fafProvider = (FAFProvider) clazz.newInstance();<NEW_LINE>} catch (InstantiationException | IllegalAccessException e) {<NEW_LINE>throw new EPException(e);<NEW_LINE>}<NEW_LINE>if (classLoader instanceof ClassProvidedImportClassLoader) {<NEW_LINE>((ClassProvidedImportClassLoader) classLoader).setImported(fafProvider.getModuleDependencies().getPathClasses());<NEW_LINE>}<NEW_LINE>// initialize event types<NEW_LINE>Map<String, EventType> moduleTypes = new HashMap<>();<NEW_LINE>EventTypeResolverImpl eventTypeResolver = new EventTypeResolverImpl(moduleTypes, services.getEventTypePathRegistry(), services.getEventTypeRepositoryBus(), services.getBeanEventTypeFactoryPrivate(), services.getEventSerdeFactory());<NEW_LINE>EventTypeCollectorImpl eventTypeCollector = new EventTypeCollectorImpl(moduleTypes, services.getBeanEventTypeFactoryPrivate(), classLoader, services.getEventTypeFactory(), services.getBeanEventTypeStemService(), eventTypeResolver, services.getXmlFragmentEventTypeFactory(), services.getEventTypeAvroHandler(), services.getEventBeanTypedEventFactory(), services.getClasspathImportServiceRuntime(), services.getEventTypeXMLXSDHandler());<NEW_LINE>fafProvider.initializeEventTypes(new EPModuleEventTypeInitServicesImpl(eventTypeCollector, eventTypeResolver));<NEW_LINE>// initialize query<NEW_LINE>fafProvider.initializeQuery(new EPStatementInitServicesImpl("faf-query", Collections.emptyMap(), null, null, eventTypeResolver, null, null, null, null, false, null, null, services));<NEW_LINE>return fafProvider;<NEW_LINE>} | getManifest().getCompilerVersion()); |
1,520,440 | static boolean sendArguments(String[] args) {<NEW_LINE>// , long timeout) {<NEW_LINE>try {<NEW_LINE>Messages.log("Checking to see if Processing is already running");<NEW_LINE>int <MASK><NEW_LINE>String key = Preferences.get(SERVER_KEY);<NEW_LINE>Socket socket = null;<NEW_LINE>try {<NEW_LINE>socket = new Socket(InetAddress.getLoopbackAddress(), port);<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>if (socket != null) {<NEW_LINE>Messages.log("Processing is already running, sending command line");<NEW_LINE>PrintWriter writer = PApplet.createWriter(socket.getOutputStream());<NEW_LINE>writer.println(key);<NEW_LINE>for (String arg : args) {<NEW_LINE>writer.println(arg);<NEW_LINE>}<NEW_LINE>writer.flush();<NEW_LINE>writer.close();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>Messages.err("Error sending commands to other instance", e);<NEW_LINE>}<NEW_LINE>Messages.log("Processing is not already running (or could not connect)");<NEW_LINE>return false;<NEW_LINE>} | port = Preferences.getInteger(SERVER_PORT); |
1,528,766 | private static void tryAssertion18(RegressionEnvironment env, String stmtText, String outputLimit, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>String[] fields = new String[] { "symbol", "sum(price)" };<NEW_LINE>ResultAssertTestResult expected = new ResultAssertTestResult(CATEGORY, outputLimit, fields);<NEW_LINE>expected.addResultInsert(1200, 0, new Object[][] { { "IBM", 34d }, { "MSFT", 34d } });<NEW_LINE>expected.addResultInsert(2200, 0, new Object[][] { { "IBM", 85d }, { "MSFT", 85d }, { "IBM", 85d }, { "YAH", 85d }, { "IBM", 85d } });<NEW_LINE>expected.addResultInsert(3200, 0, new Object[][] { { "IBM", 85d }, { "MSFT", 85d }, { "IBM", 85d }, { "YAH", 85d }, { "IBM", 85d } });<NEW_LINE>expected.addResultInsert(4200, 0, new Object[][] { { "IBM", 87d }, { "MSFT", 87d }, { "IBM", 87d }, { "YAH", 87d }, { "IBM", 87d }, { "YAH", 87d } });<NEW_LINE>expected.addResultInsert(5200, 0, new Object[][] { { "IBM", 112d }, { "MSFT", 112d }, { "IBM", 112d }, { "YAH", 112d }, { "IBM", 112d }, { "YAH", 112d }, { "IBM", 112d }<MASK><NEW_LINE>expected.addResultInsert(6200, 0, new Object[][] { { "MSFT", 88d }, { "IBM", 88d }, { "YAH", 88d }, { "IBM", 88d }, { "YAH", 88d }, { "IBM", 88d }, { "YAH", 88d }, { "YAH", 88d } });<NEW_LINE>expected.addResultInsert(7200, 0, new Object[][] { { "IBM", 54d }, { "YAH", 54d }, { "IBM", 54d }, { "YAH", 54d }, { "YAH", 54d } });<NEW_LINE>ResultAssertExecution execution = new ResultAssertExecution(stmtText, env, expected);<NEW_LINE>execution.execute(false, milestone);<NEW_LINE>} | , { "YAH", 112d } }); |
772,562 | public static ReplicaMetadataRequestInfo readFrom(DataInputStream stream, ClusterMap clusterMap, FindTokenHelper findTokenHelper, short requestVersion) throws IOException {<NEW_LINE>String hostName = Utils.readIntString(stream);<NEW_LINE>String replicaPath = Utils.readIntString(stream);<NEW_LINE>ReplicaType replicaType;<NEW_LINE>if (requestVersion == ReplicaMetadataRequest.Replica_Metadata_Request_Version_V2) {<NEW_LINE>replicaType = ReplicaType.values()[stream.readShort()];<NEW_LINE>} else {<NEW_LINE>// before version 2 we only have disk based replicas<NEW_LINE>replicaType = ReplicaType.DISK_BACKED;<NEW_LINE>}<NEW_LINE>PartitionId partitionId = clusterMap.getPartitionIdFromStream(stream);<NEW_LINE>FindTokenFactory findTokenFactory = findTokenHelper.getFindTokenFactoryFromReplicaType(replicaType);<NEW_LINE>FindToken token = findTokenFactory.getFindToken(stream);<NEW_LINE>return new ReplicaMetadataRequestInfo(partitionId, token, <MASK><NEW_LINE>} | hostName, replicaPath, replicaType, requestVersion); |
496,595 | private void emitPerBaseCoverageIfRequested() {<NEW_LINE>if (this.perBaseOutput == null)<NEW_LINE>return;<NEW_LINE>final PrintWriter out = new PrintWriter(IOUtil.openFileForBufferedWriting(this.perBaseOutput));<NEW_LINE>out.println("chrom\tpos\ttarget\tcoverage");<NEW_LINE>for (final Map.Entry<Interval, Coverage> entry : this.highQualityCoverageByTarget.entrySet()) {<NEW_LINE>final Interval interval = entry.getKey();<NEW_LINE>final String chrom = interval.getContig();<NEW_LINE>final int firstBase = interval.getStart();<NEW_LINE>final int[] cov = entry<MASK><NEW_LINE>for (int i = 0; i < cov.length; ++i) {<NEW_LINE>out.print(chrom);<NEW_LINE>out.print('\t');<NEW_LINE>out.print(firstBase + i);<NEW_LINE>out.print('\t');<NEW_LINE>out.print(interval.getName());<NEW_LINE>out.print('\t');<NEW_LINE>out.print(cov[i]);<NEW_LINE>out.println();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.close();<NEW_LINE>} | .getValue().getDepths(); |
1,716,188 | // //////////////////////////////////////////////////////////////////<NEW_LINE>// Count<NEW_LINE>@Override<NEW_LINE>public long countData(@NotNull DBCExecutionSource source, @NotNull DBCSession session, @Nullable DBDDataFilter dataFilter, long flags) throws DBCException {<NEW_LINE>DBRProgressMonitor monitor = session.getProgressMonitor();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>StringBuilder query = new StringBuilder("SELECT COUNT(*) FROM ");<NEW_LINE>query.append<MASK><NEW_LINE>SQLUtils.appendQueryConditions(getDataSource(), query, null, dataFilter);<NEW_LINE>monitor.subTask(ModelMessages.model_jdbc_fetch_table_row_count);<NEW_LINE>try (DBCStatement dbStat = session.prepareStatement(DBCStatementType.QUERY, query.toString(), false, false, false)) {<NEW_LINE>dbStat.setStatementSource(source);<NEW_LINE>if (!dbStat.executeStatement()) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>DBCResultSet dbResult = dbStat.openResultSet();<NEW_LINE>if (dbResult == null) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (dbResult.nextRow()) {<NEW_LINE>Object result = dbResult.getAttributeValue(0);<NEW_LINE>if (result == null) {<NEW_LINE>return 0;<NEW_LINE>} else if (result instanceof Number) {<NEW_LINE>return ((Number) result).longValue();<NEW_LINE>} else {<NEW_LINE>return Long.parseLong(result.toString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>dbResult.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (getFullyQualifiedName(DBPEvaluationContext.DML)); |
1,441,415 | public Tuple2<CharSeq, CharSeq> partition(Predicate<? super Character> predicate) {<NEW_LINE>Objects.requireNonNull(predicate, "predicate is null");<NEW_LINE>if (isEmpty()) {<NEW_LINE>return Tuple.of(EMPTY, EMPTY);<NEW_LINE>}<NEW_LINE>final StringBuilder left = new StringBuilder();<NEW_LINE>final StringBuilder right = new StringBuilder();<NEW_LINE>for (int i = 0; i < length(); i++) {<NEW_LINE>final Character t = get(i);<NEW_LINE>(predicate.test(t) ? left : right).append(t);<NEW_LINE>}<NEW_LINE>if (left.length() == 0) {<NEW_LINE>return Tuple.of(EMPTY, of(right.toString()));<NEW_LINE>} else if (right.length() == 0) {<NEW_LINE>return Tuple.of(of(left<MASK><NEW_LINE>} else {<NEW_LINE>return Tuple.of(of(left.toString()), of(right.toString()));<NEW_LINE>}<NEW_LINE>} | .toString()), EMPTY); |
631,308 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Permanent sourcePermanent = game.<MASK><NEW_LINE>if (sourcePermanent != null && controller != null) {<NEW_LINE>TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(new FilterInstantOrSorceryCard("instant or sorcery card from your graveyard"));<NEW_LINE>if (controller.chooseTarget(outcome, target, source, game)) {<NEW_LINE>UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), game.getState().getZoneChangeCounter(source.getSourceId()) + 1);<NEW_LINE>Card card = controller.getGraveyard().get(target.getFirstTarget(), game);<NEW_LINE>if (card != null) {<NEW_LINE>controller.moveCardsToExile(card, source, game, true, exileId, sourcePermanent.getIdName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | getPermanentEntering(source.getSourceId()); |
1,172,842 | private void addResourcesFileReference(PBXGroup targetGroup, ImmutableSet<Path> resourceFiles, ImmutableSet<Path> resourceDirs, ImmutableSet<Path> variantResourceFiles, Consumer<? super PBXFileReference> resourceCallback, Consumer<? super PBXVariantGroup> variantGroupCallback) {<NEW_LINE>if (resourceFiles.isEmpty() && resourceDirs.isEmpty() && variantResourceFiles.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PBXGroup resourcesGroup = targetGroup.getOrCreateChildGroupByName("Resources");<NEW_LINE>for (Path path : resourceFiles) {<NEW_LINE>PBXFileReference fileReference = resourcesGroup.getOrCreateFileReferenceBySourceTreePath(new SourceTreePath(PBXReference.SourceTree.SOURCE_ROOT, pathRelativizer.outputDirToRootRelative(path), Optional.empty()));<NEW_LINE>resourceCallback.accept(fileReference);<NEW_LINE>}<NEW_LINE>for (Path path : resourceDirs) {<NEW_LINE>PBXFileReference fileReference = resourcesGroup.getOrCreateFileReferenceBySourceTreePath(new SourceTreePath(PBXReference.SourceTree.SOURCE_ROOT, pathRelativizer.outputDirToRootRelative(path), Optional.of("folder")));<NEW_LINE>resourceCallback.accept(fileReference);<NEW_LINE>}<NEW_LINE>Map<String, PBXVariantGroup> variantGroups = new HashMap<>();<NEW_LINE>for (Path variantFilePath : variantResourceFiles) {<NEW_LINE>String lprojSuffix = ".lproj";<NEW_LINE>Path variantDirectory = variantFilePath.getParent();<NEW_LINE>if (variantDirectory == null || !variantDirectory.toString().endsWith(lprojSuffix)) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>String variantDirectoryName = variantDirectory.getFileName().toString();<NEW_LINE>String variantLocalization = variantDirectoryName.substring(0, variantDirectoryName.length() - lprojSuffix.length());<NEW_LINE>String variantFileName = variantFilePath.getFileName().toString();<NEW_LINE>PBXVariantGroup variantGroup = variantGroups.get(variantFileName);<NEW_LINE>if (variantGroup == null) {<NEW_LINE>variantGroup = resourcesGroup.getOrCreateChildVariantGroupByName(variantFileName);<NEW_LINE>variantGroupCallback.accept(variantGroup);<NEW_LINE>variantGroups.put(variantFileName, variantGroup);<NEW_LINE>}<NEW_LINE>SourceTreePath sourceTreePath = new SourceTreePath(PBXReference.SourceTree.SOURCE_ROOT, pathRelativizer.outputDirToRootRelative(variantFilePath), Optional.empty());<NEW_LINE>variantGroup.getOrCreateVariantFileReferenceByNameAndSourceTreePath(variantLocalization, sourceTreePath);<NEW_LINE>}<NEW_LINE>} | HumanReadableException("Variant files have to be in a directory with name ending in '.lproj', " + "but '%s' is not.", variantFilePath); |
479,964 | protected List fetch() {<NEW_LINE>HazelcastClientInstanceImpl client = (HazelcastClientInstanceImpl) context.getHazelcastInstance();<NEW_LINE>String name = cacheProxy.getPrefixedName();<NEW_LINE>if (prefetchValues) {<NEW_LINE>ClientMessage request = CacheIterateEntriesCodec.encodeRequest(name, encodePointers(pointers), fetchSize);<NEW_LINE>try {<NEW_LINE>ClientInvocation clientInvocation = new ClientInvocation(client, request, name, partitionIndex);<NEW_LINE>ClientInvocationFuture future = clientInvocation.invoke();<NEW_LINE>CacheIterateEntriesCodec.ResponseParameters responseParameters = CacheIterateEntriesCodec.decodeResponse(future.get());<NEW_LINE>IterationPointer[] pointers = decodePointers(responseParameters.iterationPointers);<NEW_LINE>setIterationPointers(responseParameters.entries, pointers);<NEW_LINE>return responseParameters.entries;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw rethrow(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ClientMessage request = CacheIterateCodec.encodeRequest(name, encodePointers(pointers), fetchSize);<NEW_LINE>try {<NEW_LINE>ClientInvocation clientInvocation = new ClientInvocation(client, request, name, partitionIndex);<NEW_LINE><MASK><NEW_LINE>CacheIterateCodec.ResponseParameters responseParameters = CacheIterateCodec.decodeResponse(future.get());<NEW_LINE>IterationPointer[] pointers = decodePointers(responseParameters.iterationPointers);<NEW_LINE>setIterationPointers(responseParameters.keys, pointers);<NEW_LINE>return responseParameters.keys;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw rethrow(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ClientInvocationFuture future = clientInvocation.invoke(); |
1,733,198 | public CloudWatchLogsLogDeliveryDescription unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CloudWatchLogsLogDeliveryDescription cloudWatchLogsLogDeliveryDescription = new CloudWatchLogsLogDeliveryDescription();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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("enabled", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>cloudWatchLogsLogDeliveryDescription.setEnabled(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("logGroup", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>cloudWatchLogsLogDeliveryDescription.setLogGroup(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 cloudWatchLogsLogDeliveryDescription;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
832,252 | final ListLoggingConfigurationsResult executeListLoggingConfigurations(ListLoggingConfigurationsRequest listLoggingConfigurationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listLoggingConfigurationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListLoggingConfigurationsRequest> request = null;<NEW_LINE>Response<ListLoggingConfigurationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListLoggingConfigurationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listLoggingConfigurationsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WAF Regional");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListLoggingConfigurations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListLoggingConfigurationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListLoggingConfigurationsResultJsonUnmarshaller());<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>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
410,457 | final GetContainerServiceDeploymentsResult executeGetContainerServiceDeployments(GetContainerServiceDeploymentsRequest getContainerServiceDeploymentsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getContainerServiceDeploymentsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetContainerServiceDeploymentsRequest> request = null;<NEW_LINE>Response<GetContainerServiceDeploymentsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetContainerServiceDeploymentsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getContainerServiceDeploymentsRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetContainerServiceDeployments");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetContainerServiceDeploymentsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetContainerServiceDeploymentsResultJsonUnmarshaller());<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>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "Lightsail"); |
1,296,320 | static void c_5() throws Exception {<NEW_LINE>BatchOperator.setParallelism(4);<NEW_LINE>if (!new File(DATA_DIR + TABLE_TRAIN_FILE).exists()) {<NEW_LINE>AkSourceBatchOp train_sparse = new AkSourceBatchOp().setFilePath(DATA_DIR + SPARSE_TRAIN_FILE);<NEW_LINE>AkSourceBatchOp test_sparse = new AkSourceBatchOp().setFilePath(DATA_DIR + SPARSE_TEST_FILE);<NEW_LINE>StringBuilder sbd = new StringBuilder();<NEW_LINE>sbd.append("c_0 double");<NEW_LINE>for (int i = 1; i < 784; i++) {<NEW_LINE>sbd.append(", c_").append(i).append(" double");<NEW_LINE>}<NEW_LINE>new VectorToColumns().setVectorCol(VECTOR_COL_NAME).setSchemaStr(sbd.toString()).setReservedCols(LABEL_COL_NAME).transform(train_sparse).link(new AkSinkBatchOp().setFilePath(DATA_DIR + TABLE_TRAIN_FILE));<NEW_LINE>new VectorToColumns().setVectorCol(VECTOR_COL_NAME).setSchemaStr(sbd.toString()).setReservedCols(LABEL_COL_NAME).transform(test_sparse).link(new AkSinkBatchOp().setFilePath(DATA_DIR + TABLE_TEST_FILE));<NEW_LINE>BatchOperator.execute();<NEW_LINE>}<NEW_LINE>AkSourceBatchOp train_data = new AkSourceBatchOp().setFilePath(DATA_DIR + TABLE_TRAIN_FILE);<NEW_LINE>AkSourceBatchOp test_data = new AkSourceBatchOp().setFilePath(DATA_DIR + TABLE_TEST_FILE);<NEW_LINE>final String[] featureColNames = ArrayUtils.removeElement(train_data.getColNames(), LABEL_COL_NAME);<NEW_LINE>train_data.lazyPrint(5);<NEW_LINE>Stopwatch sw = new Stopwatch();<NEW_LINE>for (TreeType treeType : new TreeType[] { TreeType.GINI, TreeType.INFOGAIN, TreeType.INFOGAINRATIO }) {<NEW_LINE>sw.reset();<NEW_LINE>sw.start();<NEW_LINE>new DecisionTreeClassifier().setTreeType(treeType).setFeatureCols(featureColNames).setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME).enableLazyPrintModelInfo().fit(train_data).transform(test_data).link(new EvalMultiClassBatchOp().setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME).lazyPrintMetrics("DecisionTreeClassifier " + treeType.toString()));<NEW_LINE>BatchOperator.execute();<NEW_LINE>sw.stop();<NEW_LINE>System.out.println(sw.getElapsedTimeSpan());<NEW_LINE>}<NEW_LINE>for (int numTrees : new int[] { 2, 4, 8, 16, 32, 64, 128 }) {<NEW_LINE>sw.reset();<NEW_LINE>sw.start();<NEW_LINE>new RandomForestClassifier().setSubsamplingRatio(0.6).setNumTreesOfInfoGain(numTrees).setFeatureCols(featureColNames).setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME).enableLazyPrintModelInfo().fit(train_data).transform(test_data).link(new EvalMultiClassBatchOp().setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME).lazyPrintMetrics("RandomForestClassifier : " + numTrees));<NEW_LINE>BatchOperator.execute();<NEW_LINE>sw.stop();<NEW_LINE>System.out.<MASK><NEW_LINE>}<NEW_LINE>} | println(sw.getElapsedTimeSpan()); |
1,258,417 | private float drawLine(TokenPainter painter, Token token, Graphics2D g, float x, float y, int line) {<NEW_LINE>// The x-value at the end of our text.<NEW_LINE>float nextX = x;<NEW_LINE>boolean paintBG = host.getPaintTokenBackgrounds(line, y);<NEW_LINE>while (token != null && token.isPaintable() && nextX < clipEnd) {<NEW_LINE>nextX = painter.paint(token, g, nextX, y, host, this, clipStart, paintBG);<NEW_LINE>token = token.getNextToken();<NEW_LINE>}<NEW_LINE>// NOTE: We should re-use code from Token (paintBackground()) here,<NEW_LINE>// but don't because I'm just too lazy.<NEW_LINE>if (host.getEOLMarkersVisible()) {<NEW_LINE>g.setColor(host<MASK><NEW_LINE>g.setFont(host.getFontForTokenType(Token.WHITESPACE));<NEW_LINE>g.drawString("\u00B6", nextX, y);<NEW_LINE>}<NEW_LINE>// Return the x-coordinate at the end of the painted text.<NEW_LINE>return nextX;<NEW_LINE>} | .getForegroundForTokenType(Token.WHITESPACE)); |
1,419,494 | public static void log(Throwable th) {<NEW_LINE>if (th == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String msg = Log.getStackTraceString(th);<NEW_LINE>Log.e("QNdump", msg);<NEW_LINE>try {<NEW_LINE>XposedBridge.log(th);<NEW_LINE>} catch (NoClassDefFoundError e) {<NEW_LINE>Log.e("Xposed", msg);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>BugCollector.onThrowable(th);<NEW_LINE>} catch (Throwable ignored) {<NEW_LINE>}<NEW_LINE>if (ENABLE_DUMP_LOG) {<NEW_LINE>String path = Environment.getExternalStorageDirectory().getAbsolutePath() + "/qn_log.txt";<NEW_LINE>File f = new File(path);<NEW_LINE>try {<NEW_LINE>if (!f.exists()) {<NEW_LINE>f.createNewFile();<NEW_LINE>}<NEW_LINE>appendToFile(path, "[" + System.currentTimeMillis() + "-" + android.os.Process.myPid() + "] " + msg + "\n");<NEW_LINE>} catch (IOException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Log.e("EdXposed-Bridge", msg); |
600,280 | final CreateTrafficPolicyVersionResult executeCreateTrafficPolicyVersion(CreateTrafficPolicyVersionRequest createTrafficPolicyVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createTrafficPolicyVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateTrafficPolicyVersionRequest> request = null;<NEW_LINE>Response<CreateTrafficPolicyVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateTrafficPolicyVersionRequestMarshaller().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, "Route 53");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateTrafficPolicyVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateTrafficPolicyVersionResult> responseHandler = new StaxResponseHandler<CreateTrafficPolicyVersionResult>(new CreateTrafficPolicyVersionResultStaxUnmarshaller());<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(createTrafficPolicyVersionRequest)); |
1,642,778 | public void marshall(ReplicationConfigurationTemplate replicationConfigurationTemplate, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (replicationConfigurationTemplate == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getAssociateDefaultSecurityGroup(), ASSOCIATEDEFAULTSECURITYGROUP_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getBandwidthThrottling(), BANDWIDTHTHROTTLING_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getCreatePublicIP(), CREATEPUBLICIP_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getDataPlaneRouting(), DATAPLANEROUTING_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getDefaultLargeStagingDiskType(), DEFAULTLARGESTAGINGDISKTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getEbsEncryption(), EBSENCRYPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getReplicationConfigurationTemplateID(), REPLICATIONCONFIGURATIONTEMPLATEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getReplicationServerInstanceType(), REPLICATIONSERVERINSTANCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getReplicationServersSecurityGroupsIDs(), REPLICATIONSERVERSSECURITYGROUPSIDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getStagingAreaSubnetId(), STAGINGAREASUBNETID_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getStagingAreaTags(), STAGINGAREATAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getUseDedicatedReplicationServer(), USEDEDICATEDREPLICATIONSERVER_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | replicationConfigurationTemplate.getEbsEncryptionKeyArn(), EBSENCRYPTIONKEYARN_BINDING); |
1,653,744 | static int compare(long this_long0, long this_long1, long this_long2, long[] this_long0Array, int this_coordinates_offset, long that_long0, long that_long1, long that_long2, long[] that_long0Array, int that_coordinates_offset) {<NEW_LINE>int tableIdComparison = Integer.compare((int<MASK><NEW_LINE>if (tableIdComparison != 0) {<NEW_LINE>return tableIdComparison;<NEW_LINE>}<NEW_LINE>int codeComparison = Integer.compare((int) this_long1, (int) that_long1);<NEW_LINE>if (codeComparison != 0) {<NEW_LINE>return codeComparison;<NEW_LINE>}<NEW_LINE>// Points with the same coordinate system will have the same dimensions (enforced in Values.pointValue) - using this.<NEW_LINE>for (int i = 0; i < (int) this_long2; i++) {<NEW_LINE>final double thisCoord = Double.longBitsToDouble(this_long0Array[this_coordinates_offset + i]);<NEW_LINE>final double thatCoord = Double.longBitsToDouble(that_long0Array[that_coordinates_offset + i]);<NEW_LINE>int coordinateComparison = Double.compare(thisCoord, thatCoord);<NEW_LINE>if (coordinateComparison != 0) {<NEW_LINE>return coordinateComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | ) this_long0, (int) that_long0); |
1,820,478 | private List<VulnerableSoftware> parseCpes(DefCveItem cve) throws CpeValidationException {<NEW_LINE>final List<VulnerableSoftware> software = new ArrayList<>();<NEW_LINE>final List<DefCpeMatch> cpeEntries = // this single CPE entry causes nearly 100% FP - so filtering it at the source.<NEW_LINE>cve.getConfigurations().getNodes().stream().collect(NodeFlatteningCollector.getInstance()).collect(CpeMatchStreamCollector.getInstance()).filter(predicate -> predicate.getCpe23Uri() != null).filter(predicate -> predicate.getCpe23Uri().startsWith(cpeStartsWithFilter)).filter(entry -> !("CVE-2009-0754".equals(cve.getCve().getCVEDataMeta().getId()) && "cpe:2.3:a:apache:apache:*:*:*:*:*:*:*:*".equals(entry.getCpe23Uri()))).collect(Collectors.toList());<NEW_LINE>final VulnerableSoftwareBuilder builder = new VulnerableSoftwareBuilder();<NEW_LINE>try {<NEW_LINE>cpeEntries.forEach(entry -> {<NEW_LINE>builder.cpe(parseCpe(entry, cve.getCve().getCVEDataMeta().getId())).versionEndExcluding(entry.getVersionEndExcluding()).versionStartExcluding(entry.getVersionStartExcluding()).versionEndIncluding(entry.getVersionEndIncluding()).versionStartIncluding(entry.getVersionStartIncluding()).vulnerable(entry.getVulnerable());<NEW_LINE>try {<NEW_LINE>software.add(builder.build());<NEW_LINE>} catch (CpeValidationException ex) {<NEW_LINE>throw new LambdaExceptionWrapper(ex);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (LambdaExceptionWrapper ex) {<NEW_LINE>throw <MASK><NEW_LINE>}<NEW_LINE>return software;<NEW_LINE>} | (CpeValidationException) ex.getCause(); |
19,280 | public static Bitmap createAvatarWithStatus(Bitmap avatar, StatusType statusType, String icon, Context context) {<NEW_LINE>float avatarRadius = getResources().getDimension(R.dimen.list_item_avatar_icon_radius);<NEW_LINE>int width = DisplayUtils.<MASK><NEW_LINE>Bitmap output = Bitmap.createBitmap(width, width, Bitmap.Config.ARGB_8888);<NEW_LINE>Canvas canvas = new Canvas(output);<NEW_LINE>// avatar<NEW_LINE>Bitmap croppedBitmap = getCroppedBitmap(avatar, width);<NEW_LINE>canvas.drawBitmap(croppedBitmap, 0f, 0f, null);<NEW_LINE>// status<NEW_LINE>int statusSize = width / 4;<NEW_LINE>Status status = new Status(statusType, "", icon, -1);<NEW_LINE>StatusDrawable statusDrawable = new StatusDrawable(status, statusSize, context);<NEW_LINE>canvas.translate(width / 2f, width / 2f);<NEW_LINE>statusDrawable.draw(canvas);<NEW_LINE>return output;<NEW_LINE>} | convertDpToPixel(2 * avatarRadius, context); |
938,928 | private InvoiceItem generateFixedPriceItem(final UUID invoiceId, final UUID accountId, final BillingEvent thisEvent, final LocalDate targetDate, final Currency currency, final InvoiceItemGeneratorLogger invoiceItemGeneratorLogger, final InternalCallContext internalCallContext) throws InvoiceApiException {<NEW_LINE>final LocalDate roundedStartDate = internalCallContext.toLocalDate(thisEvent.getEffectiveDate());<NEW_LINE>if (roundedStartDate.isAfter(targetDate)) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>final BigDecimal fixedPrice = thisEvent.getFixedPrice();<NEW_LINE>if (fixedPrice != null) {<NEW_LINE>final Plan currentPlan = thisEvent.getPlan();<NEW_LINE>Preconditions.checkNotNull(currentPlan, String.format("Unexpected null Plan name event = %s", thisEvent));<NEW_LINE>final DateTime catalogEffectiveDate = thisEvent.getCatalogEffectiveDate() != null ? thisEvent.getCatalogEffectiveDate() : null;<NEW_LINE>final FixedPriceInvoiceItem fixedPriceInvoiceItem = new FixedPriceInvoiceItem(invoiceId, accountId, thisEvent.getBundleId(), thisEvent.getSubscriptionId(), currentPlan.getProduct().getName(), currentPlan.getName(), thisEvent.getPlanPhase().getName(), catalogEffectiveDate, roundedStartDate, fixedPrice, currency);<NEW_LINE>// For debugging purposes<NEW_LINE><MASK><NEW_LINE>return fixedPriceInvoiceItem;<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | invoiceItemGeneratorLogger.append(thisEvent, fixedPriceInvoiceItem); |
1,229,034 | public CreateDataSourceResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateDataSourceResult createDataSourceResult = new CreateDataSourceResult();<NEW_LINE>createDataSourceResult.setStatus(context.<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 createDataSourceResult;<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("Arn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDataSourceResult.setArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DataSourceId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDataSourceResult.setDataSourceId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CreationStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDataSourceResult.setCreationStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RequestId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDataSourceResult.setRequestId(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 createDataSourceResult;<NEW_LINE>} | getHttpResponse().getStatusCode()); |
1,693,822 | public String applyTokens(@Key("descriptors") List<String> tokens, @Key("extraStyles") List<String> extraStyles) throws QuickFixException {<NEW_LINE>checkNotNull(tokens, "The 'tokens' argument cannot be null");<NEW_LINE>// get the token descriptors<NEW_LINE>List<DefDescriptor<TokensDef>> tokenDescs = new ArrayList<>(tokens.size());<NEW_LINE>for (String desc : tokens) {<NEW_LINE>tokenDescs.add(definitionService.getDefDescriptor<MASK><NEW_LINE>}<NEW_LINE>// get the extra styles descriptors TODO get rid of this option<NEW_LINE>List<DefDescriptor<? extends BaseStyleDef>> extraStyleDescs = new ArrayList<>();<NEW_LINE>if (extraStyles != null) {<NEW_LINE>for (String name : extraStyles) {<NEW_LINE>DefDescriptor<StyleDef> styleDesc = definitionService.getDefDescriptor(DefDescriptor.CSS_PREFIX + "://" + name, StyleDef.class);<NEW_LINE>if (definitionService.exists(styleDesc)) {<NEW_LINE>extraStyleDescs.add(styleDesc);<NEW_LINE>}<NEW_LINE>DefDescriptor<FlavoredStyleDef> flavorDesc = definitionService.getDefDescriptor(DefDescriptor.CSS_PREFIX + "://" + name, FlavoredStyleDef.class);<NEW_LINE>if (definitionService.exists(flavorDesc)) {<NEW_LINE>extraStyleDescs.add(flavorDesc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return styleService.applyTokensContextual(tokenDescs, extraStyleDescs);<NEW_LINE>} | (desc, TokensDef.class)); |
158,999 | void collect(int droppedFrames) {<NEW_LINE>float frameIntervalCost = 1f * FrameTracer.this.frameIntervalNs / Constants.TIME_MILLIS_TO_NANO;<NEW_LINE>sumFrameCost += (droppedFrames + 1) * frameIntervalCost;<NEW_LINE>sumDroppedFrames += droppedFrames;<NEW_LINE>sumFrame++;<NEW_LINE>if (droppedFrames >= frozenThreshold) {<NEW_LINE>dropLevel[DropStatus.DROPPED_FROZEN.index]++;<NEW_LINE>dropSum[DropStatus.DROPPED_FROZEN.index] += droppedFrames;<NEW_LINE>} else if (droppedFrames >= highThreshold) {<NEW_LINE>dropLevel[DropStatus.DROPPED_HIGH.index]++;<NEW_LINE>dropSum[DropStatus.DROPPED_HIGH.index] += droppedFrames;<NEW_LINE>} else if (droppedFrames >= middleThreshold) {<NEW_LINE>dropLevel[DropStatus.DROPPED_MIDDLE.index]++;<NEW_LINE>dropSum[<MASK><NEW_LINE>} else if (droppedFrames >= normalThreshold) {<NEW_LINE>dropLevel[DropStatus.DROPPED_NORMAL.index]++;<NEW_LINE>dropSum[DropStatus.DROPPED_NORMAL.index] += droppedFrames;<NEW_LINE>} else {<NEW_LINE>dropLevel[DropStatus.DROPPED_BEST.index]++;<NEW_LINE>dropSum[DropStatus.DROPPED_BEST.index] += Math.max(droppedFrames, 0);<NEW_LINE>}<NEW_LINE>} | DropStatus.DROPPED_MIDDLE.index] += droppedFrames; |
1,217,399 | private void grabCPUTimesAfterTest() {<NEW_LINE>long totalCPUTime = 0;<NEW_LINE>long totalUserTime = 0;<NEW_LINE>for (Thread thread : _parseqThreads) {<NEW_LINE>long threadId = thread.getId();<NEW_LINE>long cpuTime = threadBean.getThreadCpuTime(threadId);<NEW_LINE>long <MASK><NEW_LINE>if (!threadCPU.containsKey(threadId)) {<NEW_LINE>LOG.warn("New ParSeq thread was added during test");<NEW_LINE>} else {<NEW_LINE>totalCPUTime = addTime(threadCPU, cpuTime, totalCPUTime, threadId, "CPU");<NEW_LINE>totalUserTime = addTime(threadUserCPU, cpuUserTime, totalUserTime, threadId, "User");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (totalCPUTime > 0) {<NEW_LINE>LOG.info(BENCHMARK_TEST_RESULTS_LOG_PREFIX + "Total CPU time in ms: " + totalCPUTime / 1000000);<NEW_LINE>LOG.info(BENCHMARK_TEST_RESULTS_LOG_PREFIX + "Total CPU User time in ms: " + totalUserTime / 1000000);<NEW_LINE>}<NEW_LINE>} | cpuUserTime = threadBean.getThreadUserTime(threadId); |
224,383 | void addShipmentLinesToCustomsInvoice(@NonNull ProductId productId, @NonNull final ImmutableSet<InOutAndLineId> shipmentLinesForProduct, @NonNull final CustomsInvoiceId customsInvoiceId) {<NEW_LINE>CustomsInvoice customsInvoice = customsInvoiceRepo.retrieveById(customsInvoiceId);<NEW_LINE>final ImmutableList<CustomsInvoiceLine> existingLines = customsInvoice.getLines();<NEW_LINE>final CustomsInvoiceLine customsInvoiceLineForProductFound = findCustomsInvoiceLineForProductId(productId, existingLines).orElse(null);<NEW_LINE>CustomsInvoiceLine customsInvoiceLineForProduct;<NEW_LINE>if (customsInvoiceLineForProductFound == null) {<NEW_LINE>final I_C_Customs_Invoice customsInvoiceRecord = customsInvoiceRepo.getByIdInTrx(customsInvoiceId);<NEW_LINE>final CustomsInvoiceLine newCustomsInvoiceLineForProduct = createCustomsInvoiceLine(productId, shipmentLinesForProduct, CurrencyId.ofRepoId<MASK><NEW_LINE>customsInvoiceLineForProduct = newCustomsInvoiceLineForProduct;<NEW_LINE>} else {<NEW_LINE>customsInvoiceLineForProduct = customsInvoiceLineForProductFound;<NEW_LINE>for (final InOutAndLineId shipmentLineId : shipmentLinesForProduct) {<NEW_LINE>customsInvoiceLineForProduct = allocateShipmentLine(customsInvoiceLineForProduct, shipmentLineId, customsInvoice.getCurrencyId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// newLines: existingLines with adding/replacing customsInvoiceLineForProductFound with our created/changed version<NEW_LINE>final List<CustomsInvoiceLine> newLines = new ArrayList<>();<NEW_LINE>{<NEW_LINE>boolean added = false;<NEW_LINE>for (CustomsInvoiceLine existingLine : existingLines) {<NEW_LINE>if (Util.same(customsInvoiceLineForProductFound, existingLine)) {<NEW_LINE>newLines.add(customsInvoiceLineForProduct);<NEW_LINE>added = true;<NEW_LINE>} else {<NEW_LINE>newLines.add(existingLine);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!added) {<NEW_LINE>newLines.add(customsInvoiceLineForProduct);<NEW_LINE>added = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>customsInvoice = customsInvoice.toBuilder().lines(ImmutableList.copyOf(newLines)).build();<NEW_LINE>customsInvoice.updateLineNos();<NEW_LINE>customsInvoiceRepo.save(customsInvoice);<NEW_LINE>} | (customsInvoiceRecord.getC_Currency_ID())); |
53,418 | private List<Object> createInsightDependencyChildren(RenderableDependency dependency, final Set<Object> visited, final Configuration configuration) {<NEW_LINE>Iterable<? extends RenderableDependency> children = dependency.getChildren();<NEW_LINE>return CollectionUtils.collect(children, (Transformer<Object, RenderableDependency>) childDependency -> {<NEW_LINE>boolean alreadyVisited = !visited.<MASK><NEW_LINE>boolean leaf = childDependency.getChildren().isEmpty();<NEW_LINE>boolean alreadyRendered = alreadyVisited && !leaf;<NEW_LINE>String childName = replaceArrow(childDependency.getName());<NEW_LINE>boolean hasConflict = !childName.equals(childDependency.getName());<NEW_LINE>String name = leaf ? configuration.getName() : childName;<NEW_LINE>LinkedHashMap<String, Object> map = new LinkedHashMap<>(6);<NEW_LINE>map.put("name", name);<NEW_LINE>map.put("resolvable", childDependency.getResolutionState());<NEW_LINE>map.put("hasConflict", hasConflict);<NEW_LINE>map.put("alreadyRendered", alreadyRendered);<NEW_LINE>map.put("isLeaf", leaf);<NEW_LINE>map.put("children", Collections.emptyList());<NEW_LINE>if (!alreadyRendered) {<NEW_LINE>map.put("children", createInsightDependencyChildren(childDependency, visited, configuration));<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>});<NEW_LINE>} | add(childDependency.getId()); |
1,156,449 | private boolean isWebAddress(String word) {<NEW_LINE>if (startWord + 2 >= sentence.length()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final char <MASK><NEW_LINE>final char char1 = sentence.charAt(startWord + 1);<NEW_LINE>if (char0 == '@' && (Character.isLetter(char1) || Character.isDigit(char1)) || startWord + 3 < sentence.length() && char0 == ':' && char1 == '/' && sentence.charAt(startWord + 2) == '/') {<NEW_LINE>while (startWord < endWord) {<NEW_LINE>final String next = sentence.substring(startWord, endWord).trim();<NEW_LINE>if (next.length() > 0) {<NEW_LINE>word += next;<NEW_LINE>startWord = endWord;<NEW_LINE>endWord = words.next();<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | char0 = sentence.charAt(startWord); |
946,433 | final DeleteReportResult executeDeleteReport(DeleteReportRequest deleteReportRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteReportRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteReportRequest> request = null;<NEW_LINE>Response<DeleteReportResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteReportRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteReportRequest));<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, "CodeBuild");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteReport");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteReportResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteReportResultJsonUnmarshaller());<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>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
777,443 | public NettyOutbound sendObject(Object message) {<NEW_LINE>if (!channel().isActive()) {<NEW_LINE>ReactorNetty.safeRelease(message);<NEW_LINE>return then(Mono.error(AbortedException.beforeSend()));<NEW_LINE>}<NEW_LINE>if (!(message instanceof ByteBuf)) {<NEW_LINE>return super.sendObject(message);<NEW_LINE>}<NEW_LINE>ByteBuf b = (ByteBuf) message;<NEW_LINE>return new PostHeadersNettyOutbound(FutureMono.deferFuture(() -> {<NEW_LINE>if (markSentHeaderAndBody(b)) {<NEW_LINE>try {<NEW_LINE>afterMarkSentHeaders();<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>b.release();<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>if (HttpUtil.getContentLength(outboundHttpMessage(), -1) == 0) {<NEW_LINE>log.debug(format(channel(), "Dropped HTTP content, " + <MASK><NEW_LINE>b.release();<NEW_LINE>return channel().writeAndFlush(newFullBodyMessage(Unpooled.EMPTY_BUFFER));<NEW_LINE>}<NEW_LINE>return channel().writeAndFlush(newFullBodyMessage(b));<NEW_LINE>}<NEW_LINE>return channel().writeAndFlush(b);<NEW_LINE>}), this, b);<NEW_LINE>} | "since response has Content-Length: 0 {}"), toPrettyHexDump(b)); |
813,848 | final ListGroupsOlderThanOrderingIdResult executeListGroupsOlderThanOrderingId(ListGroupsOlderThanOrderingIdRequest listGroupsOlderThanOrderingIdRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listGroupsOlderThanOrderingIdRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListGroupsOlderThanOrderingIdRequest> request = null;<NEW_LINE>Response<ListGroupsOlderThanOrderingIdResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListGroupsOlderThanOrderingIdRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listGroupsOlderThanOrderingIdRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "kendra");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListGroupsOlderThanOrderingId");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListGroupsOlderThanOrderingIdResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListGroupsOlderThanOrderingIdResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
695,751 | private void zip(ZipOutputStream out, File root, File file, TransferStatus status, HttpRange range) throws IOException {<NEW_LINE>// Exclude all hidden files starting with a "."<NEW_LINE>if (file.getName().startsWith(".")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String zipName = file.getCanonicalPath().substring(root.getCanonicalPath().length() + 1);<NEW_LINE>if (file.isFile()) {<NEW_LINE>status.setFile(file);<NEW_LINE>ZipEntry zipEntry = new ZipEntry(zipName);<NEW_LINE>zipEntry.setSize(file.length());<NEW_LINE>zipEntry.setCompressedSize(file.length());<NEW_LINE>zipEntry.setCrc(computeCrc(file));<NEW_LINE>out.putNextEntry(zipEntry);<NEW_LINE>copyFileToStream(file, out, status, range);<NEW_LINE>out.closeEntry();<NEW_LINE>} else {<NEW_LINE>ZipEntry zipEntry <MASK><NEW_LINE>zipEntry.setSize(0);<NEW_LINE>zipEntry.setCompressedSize(0);<NEW_LINE>zipEntry.setCrc(0);<NEW_LINE>out.putNextEntry(zipEntry);<NEW_LINE>out.closeEntry();<NEW_LINE>File[] children = FileUtil.listFiles(file);<NEW_LINE>for (File child : children) {<NEW_LINE>zip(out, root, child, status, range);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new ZipEntry(zipName + '/'); |
458,670 | public static CsvLoaderConfig from(Map<String, Object> config) {<NEW_LINE>Builder builder = builder();<NEW_LINE>if (config.get(DELIMITER) != null)<NEW_LINE>builder.delimiter(getCharacterOrString(config, DELIMITER));<NEW_LINE>if (config.get(ARRAY_DELIMITER) != null)<NEW_LINE>builder.arrayDelimiter(getCharacterOrString(config, ARRAY_DELIMITER));<NEW_LINE>if (config.get(QUOTATION_CHARACTER) != null)<NEW_LINE>builder.quotationCharacter(getCharacterOrString(config, QUOTATION_CHARACTER));<NEW_LINE>if (config.get(STRING_IDS) != null)<NEW_LINE>builder.stringIds((boolean) config.get(STRING_IDS));<NEW_LINE>if (config.get(SKIP_LINES) != null)<NEW_LINE>builder.skipLines((int) config.get(SKIP_LINES));<NEW_LINE>if (config.get(BATCH_SIZE) != null)<NEW_LINE>builder.batchSize((int) config.get(BATCH_SIZE));<NEW_LINE>if (config.get(IGNORE_DUPLICATE_NODES) != null)<NEW_LINE>builder.ignoreDuplicateNodes((boolean<MASK><NEW_LINE>if (config.get(IGNORE_BLANK_STRING) != null)<NEW_LINE>builder.ignoreBlankString((boolean) config.get(IGNORE_BLANK_STRING));<NEW_LINE>builder.binary((String) config.getOrDefault(COMPRESSION, CompressionAlgo.GZIP.name()));<NEW_LINE>builder.charset((String) config.getOrDefault(CHARSET, UTF_8.name()));<NEW_LINE>return builder.build();<NEW_LINE>} | ) config.get(IGNORE_DUPLICATE_NODES)); |
1,650,214 | public MethodVisitor visitClassConstructor(MethodDeclInfo methodDeclInfo, ClassVisitor cv) {<NEW_LINE>ClassName nestCompanion = nestDigest.nestCompanion(methodDeclInfo.owner());<NEW_LINE>MethodDeclInfo constructorBridge = methodDeclInfo.bridgeOfConstructor(nestCompanion);<NEW_LINE>MethodVisitor mv = constructorBridge.accept(cv);<NEW_LINE>mv.visitCode();<NEW_LINE>mv.<MASK><NEW_LINE>ImmutableList<Type> constructorBridgeArgTypes = constructorBridge.argumentTypes();<NEW_LINE>// Exclude last placeholder element loading.<NEW_LINE>for (int i = 0, slotOffset = 1; i < constructorBridgeArgTypes.size() - 1; i++) {<NEW_LINE>mv.visitVarInsn(constructorBridgeArgTypes.get(i).getOpcode(Opcodes.ILOAD), slotOffset);<NEW_LINE>slotOffset += constructorBridgeArgTypes.get(i).getSize();<NEW_LINE>}<NEW_LINE>mv.visitMethodInsn(Opcodes.INVOKESPECIAL, methodDeclInfo.ownerName(), methodDeclInfo.name(), methodDeclInfo.descriptor(), /* isInterface= */<NEW_LINE>false);<NEW_LINE>mv.visitInsn(Opcodes.RETURN);<NEW_LINE>int slot = 0;<NEW_LINE>for (Type bridgeConstructorArgType : constructorBridgeArgTypes) {<NEW_LINE>slot += bridgeConstructorArgType.getSize();<NEW_LINE>}<NEW_LINE>mv.visitMaxs(slot, slot);<NEW_LINE>mv.visitEnd();<NEW_LINE>return mv;<NEW_LINE>} | visitVarInsn(Opcodes.ALOAD, 0); |
436,876 | private // /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>void onSaveNewAccount(PaymentAccount paymentAccount) {<NEW_LINE><MASK><NEW_LINE>if (selectedTradeCurrency != null) {<NEW_LINE>if (selectedTradeCurrency instanceof CryptoCurrency && ((CryptoCurrency) selectedTradeCurrency).isAsset()) {<NEW_LINE>String name = selectedTradeCurrency.getName();<NEW_LINE>new Popup().information(Res.get("account.altcoin.popup.wallet.msg", selectedTradeCurrency.getCodeAndName(), name, name)).closeButtonText(Res.get("account.altcoin.popup.wallet.confirm")).show();<NEW_LINE>}<NEW_LINE>final Optional<Asset> asset = CurrencyUtil.findAsset(selectedTradeCurrency.getCode());<NEW_LINE>if (asset.isPresent()) {<NEW_LINE>final AltCoinAccountDisclaimer disclaimerAnnotation = asset.get().getClass().getAnnotation(AltCoinAccountDisclaimer.class);<NEW_LINE>if (disclaimerAnnotation != null) {<NEW_LINE>new Popup().width(asset.get() instanceof Monero ? 1000 : 669).maxMessageLength(2500).information(Res.get(disclaimerAnnotation.value())).useIUnderstandButton().show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (model.getPaymentAccounts().stream().noneMatch(e -> e.getAccountName() != null && e.getAccountName().equals(paymentAccount.getAccountName()))) {<NEW_LINE>model.onSaveNewAccount(paymentAccount);<NEW_LINE>removeNewAccountForm();<NEW_LINE>} else {<NEW_LINE>new Popup().warning(Res.get("shared.accountNameAlreadyUsed")).show();<NEW_LINE>}<NEW_LINE>preferences.dontShowAgain(INSTANT_TRADE_NEWS, true);<NEW_LINE>}<NEW_LINE>} | TradeCurrency selectedTradeCurrency = paymentAccount.getSelectedTradeCurrency(); |
1,773,146 | private static Predicate generateRangePredicate(InternalIndex index, Map<String, EqualPredicate> prefixes, int prefixLength, boolean fast) {<NEW_LINE>// see CompositeValue docs for more details on what is going on here<NEW_LINE>String[<MASK><NEW_LINE>Comparable[] from = new Comparable[components.length];<NEW_LINE>Comparable[] to = new Comparable[components.length];<NEW_LINE>for (int i = 0; i < prefixLength; ++i) {<NEW_LINE>String attribute = components[i];<NEW_LINE>Comparable value = fast ? prefixes.get(attribute).value : prefixes.remove(attribute).value;<NEW_LINE>from[i] = value;<NEW_LINE>to[i] = value;<NEW_LINE>}<NEW_LINE>for (int i = prefixLength; i < components.length; ++i) {<NEW_LINE>from[i] = NEGATIVE_INFINITY;<NEW_LINE>to[i] = POSITIVE_INFINITY;<NEW_LINE>}<NEW_LINE>return new CompositeRangePredicate(index, new CompositeValue(from), false, new CompositeValue(to), false, prefixLength);<NEW_LINE>} | ] components = index.getComponents(); |
992,761 | private void invokeSimpleImplProviderService(String msg, String warName, String serviceName, PrintWriter writer) {<NEW_LINE>StringBuilder sBuilder = new StringBuilder("http://").append(hostname).append(":").append(port).append("/").append(warName).append("/").append(serviceName).append("?wsdl");<NEW_LINE>// System.out.println(sBuilder.toString());<NEW_LINE>try {<NEW_LINE>QName qname = new QName(NAMESPACE, serviceName);<NEW_LINE>URL wsdlLocation = new URL(sBuilder.toString());<NEW_LINE>Service service = Service.create(wsdlLocation, qname);<NEW_LINE>QName portType = new QName(NAMESPACE, "SimpleImplProviderPort");<NEW_LINE>Dispatch<SOAPMessage> dispatch = service.createDispatch(portType, SOAPMessage.class, Service.Mode.MESSAGE);<NEW_LINE>MessageFactory messageFactory = MessageFactory.newInstance();<NEW_LINE>SOAPMessage message = messageFactory.createMessage();<NEW_LINE>SOAPPart soappart = message.getSOAPPart();<NEW_LINE>// <soapenv:Body><NEW_LINE>// <tns2:invoke><NEW_LINE>// <arg0><NEW_LINE>// <contentDescription>strfgsdfg</contentDescription><NEW_LINE>// </arg0><NEW_LINE>// </tns2:invoke><NEW_LINE>// </soapenv:Body><NEW_LINE>SOAPEnvelope envelope = soappart.getEnvelope();<NEW_LINE>envelope.setAttribute("xmlns:tns", "http://impl.service.cdi.jaxws.ws.ibm.com/");<NEW_LINE>SOAPBody body = envelope.getBody();<NEW_LINE>SOAPElement element = body.addChildElement(body.createQName("invoke", "tns"));<NEW_LINE>element.addChildElement(new QName("arg0")).setTextContent(msg);<NEW_LINE><MASK><NEW_LINE>SOAPMessage msgRtn = dispatch.invoke(message);<NEW_LINE>msgRtn.writeTo(System.out);<NEW_LINE>String rtnStr = msgRtn.getSOAPBody().getTextContent();<NEW_LINE>writer.println(rtnStr);<NEW_LINE>} catch (Exception e) {<NEW_LINE>writer.println(e.getMessage());<NEW_LINE>} finally {<NEW_LINE>writer.flush();<NEW_LINE>writer.close();<NEW_LINE>}<NEW_LINE>} | message.writeTo(System.out); |
1,398,956 | public void onCustomPacketRegistration(CustomPacketRegistrationEvent<?> event) {<NEW_LINE>final Set<String> channels = ((INetPlayHandlerBridge_Forge) event.getHandler()).forgeBridge$getRegisteredChannels();<NEW_LINE>final EntityPlayer player;<NEW_LINE>if (event.getSide().isClient()) {<NEW_LINE>player = null;<NEW_LINE>} else {<NEW_LINE>player = ((NetHandlerPlayServer) event.getHandler()).player;<NEW_LINE>}<NEW_LINE>final Cause currentCause = Cause.of(EventContext.empty(), player == null ? Sponge.getGame() : player, event.getSide().isClient() ? Platform.Type.CLIENT : Platform.Type.SERVER);<NEW_LINE>if (event.getOperation().equals("REGISTER")) {<NEW_LINE>for (String channel : event.getRegistrations()) {<NEW_LINE>if (channels.add(channel)) {<NEW_LINE>SpongeImpl.postEvent(SpongeEventFactory.createChannelRegistrationEventRegister(currentCause, channel));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (event.getOperation().equals("UNREGISTER")) {<NEW_LINE>for (String channel : event.getRegistrations()) {<NEW_LINE>if (channels.remove(channel)) {<NEW_LINE>SpongeImpl.postEvent(SpongeEventFactory<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .createChannelRegistrationEventUnregister(currentCause, channel)); |
200,053 | final CreateRuleGroupResult executeCreateRuleGroup(CreateRuleGroupRequest createRuleGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createRuleGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateRuleGroupRequest> request = null;<NEW_LINE>Response<CreateRuleGroupResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateRuleGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createRuleGroupRequest));<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, "WAF Regional");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateRuleGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateRuleGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateRuleGroupResultJsonUnmarshaller());<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>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
246,054 | private void initComponents() {<NEW_LINE>consoleTextArea.setEditable(false);<NEW_LINE>consoleTextArea.setColumns(20);<NEW_LINE>consoleTextArea.setDocument(new LengthLimitedDocument(CONSOLE_SIZE));<NEW_LINE>consoleTextArea.setRows(5);<NEW_LINE>consoleTextArea.setMaximumSize(new java.awt.Dimension(32767, 32767));<NEW_LINE>consoleTextArea.setMinimumSize(new java.awt.Dimension(0, 0));<NEW_LINE>scrollPane.setViewportView(consoleTextArea);<NEW_LINE>commandLabel.setEnabled(backend.isIdle());<NEW_LINE>scrollWindowMenuItem.<MASK><NEW_LINE>setLayout(new MigLayout("inset 0 0 5 0, fill, wrap 1", "", "[][min!]"));<NEW_LINE>add(scrollPane, "grow, growy");<NEW_LINE>add(commandLabel, "gapleft 5, al left, split 2");<NEW_LINE>add(commandTextField, "gapright 5, r, grow");<NEW_LINE>showVerboseMenuItem.addChangeListener((e) -> backend.getSettings().setVerboseOutputEnabled(showVerboseMenuItem.isSelected()));<NEW_LINE>menu.add(showVerboseMenuItem);<NEW_LINE>scrollWindowMenuItem.addChangeListener((e) -> backend.getSettings().setScrollWindowEnabled(scrollWindowMenuItem.isSelected()));<NEW_LINE>menu.add(scrollWindowMenuItem);<NEW_LINE>SwingHelpers.traverse(this, (comp) -> comp.setComponentPopupMenu(menu));<NEW_LINE>} | addActionListener(e -> checkScrollWindow()); |
936,163 | final ListDevicesResult executeListDevices(ListDevicesRequest listDevicesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDevicesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDevicesRequest> request = null;<NEW_LINE>Response<ListDevicesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDevicesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDevicesRequest));<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, "IoT 1Click Devices Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDevices");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDevicesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDevicesResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
43,169 | private void initRuntime(ClassNode cn, MethodNode clinit) {<NEW_LINE>addRuntimeNode(cn);<NEW_LINE>InsnList l = new InsnList();<NEW_LINE>l.add(new LdcInsnNode(Type.getObjectType(cn.name)));<NEW_LINE>l.add(loadTimerHandlers(cn));<NEW_LINE>l.add(loadEventHandlers(cn));<NEW_LINE>l.add(loadErrorHandlers(cn));<NEW_LINE>l.add(loadExitHandlers(cn));<NEW_LINE>l.add(loadLowMemoryHandlers(cn));<NEW_LINE>l.add(new MethodInsnNode(Opcodes.INVOKESTATIC, Constants.BTRACERTACCESS_INTERNAL, "forClass", BTRACERT_FOR_CLASS_DESC, false));<NEW_LINE>l.add(new FieldInsnNode(Opcodes.PUTSTATIC, cn.name, rtField.name, rtField.desc));<NEW_LINE>l<MASK><NEW_LINE>addRuntimeCheck(cn, clinit, l, true);<NEW_LINE>clinitEntryPoint = l.getLast();<NEW_LINE>clinit.instructions.insert(l);<NEW_LINE>startRuntime(cn, clinit);<NEW_LINE>} | .add(getRuntimeImpl(cn)); |
1,261,467 | public static ListAppInfoResponse unmarshall(ListAppInfoResponse listAppInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAppInfoResponse.setRequestId(_ctx.stringValue("ListAppInfoResponse.RequestId"));<NEW_LINE>listAppInfoResponse.setTotal(_ctx.integerValue("ListAppInfoResponse.Total"));<NEW_LINE>List<AppInfo> appInfoList = new ArrayList<AppInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAppInfoResponse.AppInfoList.Length"); i++) {<NEW_LINE>AppInfo appInfo = new AppInfo();<NEW_LINE>appInfo.setAppId(_ctx.stringValue<MASK><NEW_LINE>appInfo.setAppName(_ctx.stringValue("ListAppInfoResponse.AppInfoList[" + i + "].AppName"));<NEW_LINE>appInfo.setType(_ctx.stringValue("ListAppInfoResponse.AppInfoList[" + i + "].Type"));<NEW_LINE>appInfo.setDescription(_ctx.stringValue("ListAppInfoResponse.AppInfoList[" + i + "].Description"));<NEW_LINE>appInfo.setStatus(_ctx.stringValue("ListAppInfoResponse.AppInfoList[" + i + "].Status"));<NEW_LINE>appInfo.setCreationTime(_ctx.stringValue("ListAppInfoResponse.AppInfoList[" + i + "].CreationTime"));<NEW_LINE>appInfo.setModificationTime(_ctx.stringValue("ListAppInfoResponse.AppInfoList[" + i + "].ModificationTime"));<NEW_LINE>appInfoList.add(appInfo);<NEW_LINE>}<NEW_LINE>listAppInfoResponse.setAppInfoList(appInfoList);<NEW_LINE>return listAppInfoResponse;<NEW_LINE>} | ("ListAppInfoResponse.AppInfoList[" + i + "].AppId")); |
1,283,227 | public Builder addLayer(Layer layer) {<NEW_LINE>if (!prepDone) {<NEW_LINE>doPrep();<NEW_LINE>}<NEW_LINE>// Use the fineTune config to create the required NeuralNetConfiguration + Layer instances<NEW_LINE>// instantiate dummy layer to get the params<NEW_LINE>// Build a nn config builder with settings from finetune. Set layer with the added layer<NEW_LINE>// Issue: fine tune config has .learningRate(x), then I add a layer with .learningRate(y)...<NEW_LINE>// We don't want that to be overridden<NEW_LINE>NeuralNetConfiguration layerConf = finetuneConfiguration.appliedNeuralNetConfigurationBuilder().layer(layer).build();<NEW_LINE>val numParams = layer.<MASK><NEW_LINE>INDArray params;<NEW_LINE>if (numParams > 0) {<NEW_LINE>params = Nd4j.create(origModel.getLayerWiseConfigurations().getDataType(), numParams);<NEW_LINE>org.deeplearning4j.nn.api.Layer someLayer = layer.instantiate(layerConf, null, 0, params, true, dataType);<NEW_LINE>appendParams.add(someLayer.params());<NEW_LINE>appendConfs.add(someLayer.conf());<NEW_LINE>} else {<NEW_LINE>appendConfs.add(layerConf);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | initializer().numParams(layerConf); |
342,827 | private static FundingRecord adaptAdjustment(PoloniexAdjustment a) {<NEW_LINE>FundingRecord.Type type = OTHER_INFLOW;<NEW_LINE>// There seems to be a spelling error in the returning reason. In case that ever gets<NEW_LINE>// corrected, this will still pick it up.<NEW_LINE>if (a.getReason().toLowerCase().contains("aidrop") || a.getReason().toLowerCase().contains("airdrop")) {<NEW_LINE>type = Type.AIRDROP;<NEW_LINE>}<NEW_LINE>// There could be other forms of adjustements, but it seems to be some kind of deposit.<NEW_LINE>return new FundingRecord(null, a.getTimestamp(), Currency.getInstance(a.getCurrency()), a.getAmount(), null, null, type, FundingRecord.Status.resolveStatus(a.getStatus()), null, null, a.getCategory() + ":" + a.getReason() + "\n" + a.getAdjustmentTitle() + "\n" + a.getAdjustmentDesc() + <MASK><NEW_LINE>} | "\n" + a.getAdjustmentHelp()); |
1,340,369 | private static int parsePolygon(SvgContainer container, char[] ca, int start, int end) {<NEW_LINE>end = findClosingTag(ca, start, end);<NEW_LINE>if (end != -1) {<NEW_LINE>int endAttrs = closer(ca, start, end);<NEW_LINE>SvgShape element = new SvgShape(container, getAttrValue(ca, start, endAttrs, ATTR_ID));<NEW_LINE>float[] linePoints = parsePoints(getAttrValue(ca, start, endAttrs, ATTR_POINTS));<NEW_LINE>element.pathData = new PathData();<NEW_LINE>element.pathData.types = new byte[1 + (linePoints.length / 2)];<NEW_LINE>element.pathData.points = new float[linePoints.length];<NEW_LINE>element.pathData.types[0] = (byte) SWT.PATH_MOVE_TO;<NEW_LINE>element.pathData.points[0] = linePoints[0];<NEW_LINE>element.pathData.points[1] = linePoints[1];<NEW_LINE><MASK><NEW_LINE>while (i < linePoints.length - 1) {<NEW_LINE>element.pathData.types[j++] = (byte) SWT.PATH_LINE_TO;<NEW_LINE>element.pathData.points[i] = linePoints[i++];<NEW_LINE>element.pathData.points[i] = linePoints[i++];<NEW_LINE>}<NEW_LINE>element.pathData.types[element.pathData.types.length - 1] = (byte) SWT.PATH_CLOSE;<NEW_LINE>parseFill(element, ca, start, endAttrs);<NEW_LINE>parseStroke(element, ca, start, endAttrs);<NEW_LINE>element.transform = getTransform(ca, getAttrValueRange(ca, start, endAttrs, ATTR_TRANSFORM));<NEW_LINE>}<NEW_LINE>return end;<NEW_LINE>} | int i = 2, j = 1; |
17,752 | protected void dump(FileDescriptor fd, PrintWriter pw, String[] rawArgs) {<NEW_LINE>if (rawArgs.length > 0 && Utilities.IS_DEBUG_DEVICE) {<NEW_LINE>LinkedList<String> args = new LinkedList(Arrays.asList(rawArgs));<NEW_LINE>switch(args.pollFirst()) {<NEW_LINE>case "cmd":<NEW_LINE>if (args.peekFirst() == null) {<NEW_LINE>printAvailableCommands(pw);<NEW_LINE>} else {<NEW_LINE>onCommand(pw, args);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Dump everything<NEW_LINE>FeatureFlags.dump(pw);<NEW_LINE>if (mDeviceState.isUserUnlocked()) {<NEW_LINE>PluginManagerWrapper.INSTANCE.get(getBaseContext()).dump(pw);<NEW_LINE>}<NEW_LINE>mDeviceState.dump(pw);<NEW_LINE>if (mOverviewComponentObserver != null) {<NEW_LINE>mOverviewComponentObserver.dump(pw);<NEW_LINE>}<NEW_LINE>if (mGestureState != null) {<NEW_LINE>mGestureState.dump(pw);<NEW_LINE>}<NEW_LINE>pw.println("Input state:");<NEW_LINE>pw.println(" mInputMonitorCompat=" + mInputMonitorCompat);<NEW_LINE>pw.println(" mInputEventReceiver=" + mInputEventReceiver);<NEW_LINE>SysUINavigationMode.INSTANCE.get(this).dump(pw);<NEW_LINE>pw.println("TouchState:");<NEW_LINE>BaseDraggingActivity createdOverviewActivity = mOverviewComponentObserver == null ? null : mOverviewComponentObserver.getActivityInterface().getCreatedActivity();<NEW_LINE>boolean resumed = mOverviewComponentObserver != null && mOverviewComponentObserver.getActivityInterface().isResumed();<NEW_LINE>pw.println(" createdOverviewActivity=" + createdOverviewActivity);<NEW_LINE>pw.println(" resumed=" + resumed);<NEW_LINE>pw.println(" mConsumer=" + mConsumer.getName());<NEW_LINE>ActiveGestureLog.<MASK><NEW_LINE>pw.println("ProtoTrace:");<NEW_LINE>pw.println(" file=" + ProtoTracer.INSTANCE.get(this).getTraceFile());<NEW_LINE>}<NEW_LINE>} | INSTANCE.dump("", pw); |
1,064,169 | public static void reset(boolean finalCall) {<NEW_LINE>s_log.info("finalCall=" + finalCall);<NEW_LINE>if (Ini.isClient()) {<NEW_LINE>closeWindows();<NEW_LINE>// Dismantle windows<NEW_LINE>// bug [ 1574630 ]<NEW_LINE>if (s_windows.size() > 0) {<NEW_LINE>if (!finalCall) {<NEW_LINE>Container c = s_windows.get(0);<NEW_LINE>s_windows.clear();<NEW_LINE>createWindowNo(c);<NEW_LINE>} else {<NEW_LINE>s_windows.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Clear all Context<NEW_LINE>if (finalCall)<NEW_LINE>getCtx().clear();<NEW_LINE>else // clear window context only<NEW_LINE>{<NEW_LINE>Object[] keys = getCtx()<MASK><NEW_LINE>for (int i = 0; i < keys.length; i++) {<NEW_LINE>String tag = keys[i].toString();<NEW_LINE>if (Character.isDigit(tag.charAt(0)))<NEW_LINE>getCtx().remove(keys[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Cache<NEW_LINE>CacheMgt.get().reset();<NEW_LINE>if (Ini.isClient())<NEW_LINE>DB.closeTarget();<NEW_LINE>// Reset Role Access<NEW_LINE>if (!finalCall) {<NEW_LINE>if (Ini.isClient())<NEW_LINE>DB.setDBTarget(CConnection.get());<NEW_LINE>MRole defaultRole = MRole.getDefault(getCtx(), false);<NEW_LINE>if (defaultRole != null)<NEW_LINE>// Reload<NEW_LINE>defaultRole.loadAccess(true);<NEW_LINE>}<NEW_LINE>} | .keySet().toArray(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.