idx
int32 46
1.86M
| input
stringlengths 321
6.6k
| target
stringlengths 9
1.24k
|
|---|---|---|
1,188,534
|
public Builder mergeFrom(io.kubernetes.client.proto.Meta.LabelSelector other) {<NEW_LINE>if (other == io.kubernetes.client.proto.Meta.LabelSelector.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>internalGetMutableMatchLabels().mergeFrom(other.internalGetMatchLabels());<NEW_LINE>if (matchExpressionsBuilder_ == null) {<NEW_LINE>if (!other.matchExpressions_.isEmpty()) {<NEW_LINE>if (matchExpressions_.isEmpty()) {<NEW_LINE>matchExpressions_ = other.matchExpressions_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>} else {<NEW_LINE>ensureMatchExpressionsIsMutable();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.matchExpressions_.isEmpty()) {<NEW_LINE>if (matchExpressionsBuilder_.isEmpty()) {<NEW_LINE>matchExpressionsBuilder_.dispose();<NEW_LINE>matchExpressionsBuilder_ = null;<NEW_LINE>matchExpressions_ = other.matchExpressions_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>matchExpressionsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getMatchExpressionsFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE>matchExpressionsBuilder_.addAllMessages(other.matchExpressions_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>}
|
matchExpressions_.addAll(other.matchExpressions_);
|
1,726,530
|
private void loadExtend() {<NEW_LINE>Iterator<HealthCheckProcessor> processorIt = processors.iterator();<NEW_LINE>Iterator<AbstractHealthChecker> healthCheckerIt = checkers.iterator();<NEW_LINE>Set<String> origin = new HashSet<>();<NEW_LINE>for (HealthCheckType type : HealthCheckType.values()) {<NEW_LINE>origin.add(type.name());<NEW_LINE>}<NEW_LINE>Set<String> processorType = new HashSet<>(origin);<NEW_LINE>Set<String> healthCheckerType = new HashSet<>(origin);<NEW_LINE>while (processorIt.hasNext()) {<NEW_LINE><MASK><NEW_LINE>String type = processor.getType();<NEW_LINE>if (processorType.contains(type)) {<NEW_LINE>throw new RuntimeException("More than one processor of the same type was found : [type=\"" + type + "\"]");<NEW_LINE>}<NEW_LINE>processorType.add(type);<NEW_LINE>registry.registerSingleton(lowerFirstChar(processor.getClass().getSimpleName()), processor);<NEW_LINE>}<NEW_LINE>while (healthCheckerIt.hasNext()) {<NEW_LINE>AbstractHealthChecker checker = healthCheckerIt.next();<NEW_LINE>String type = checker.getType();<NEW_LINE>if (healthCheckerType.contains(type)) {<NEW_LINE>throw new RuntimeException("More than one healthChecker of the same type was found : [type=\"" + type + "\"]");<NEW_LINE>}<NEW_LINE>healthCheckerType.add(type);<NEW_LINE>HealthCheckType.registerHealthChecker(checker.getType(), checker.getClass());<NEW_LINE>}<NEW_LINE>if (!processorType.equals(healthCheckerType)) {<NEW_LINE>throw new RuntimeException("An unmatched processor and healthChecker are detected in the extension package.");<NEW_LINE>}<NEW_LINE>if (processorType.size() > origin.size()) {<NEW_LINE>processorType.removeAll(origin);<NEW_LINE>LOGGER.debug("init health plugin : types=" + processorType);<NEW_LINE>}<NEW_LINE>}
|
HealthCheckProcessor processor = processorIt.next();
|
417,750
|
private void unselectedCellView() {<NEW_LINE>int unSelectedColor = mTableView.getUnSelectedColor();<NEW_LINE>// Change background color of the row header which is located on Y Position of the cell<NEW_LINE>// view.<NEW_LINE>AbstractViewHolder rowHeader = (<MASK><NEW_LINE>// If view is null, that means the row view holder was already recycled.<NEW_LINE>if (rowHeader != null) {<NEW_LINE>// Change color<NEW_LINE>rowHeader.setBackgroundColor(unSelectedColor);<NEW_LINE>// Change state<NEW_LINE>rowHeader.setSelected(SelectionState.UNSELECTED);<NEW_LINE>}<NEW_LINE>// Change background color of the column header which is located on X Position of the cell<NEW_LINE>// view.<NEW_LINE>AbstractViewHolder columnHeader = (AbstractViewHolder) mColumnHeaderRecyclerView.findViewHolderForAdapterPosition(mSelectedColumnPosition);<NEW_LINE>if (columnHeader != null) {<NEW_LINE>// Change color<NEW_LINE>columnHeader.setBackgroundColor(unSelectedColor);<NEW_LINE>// Change state<NEW_LINE>columnHeader.setSelected(SelectionState.UNSELECTED);<NEW_LINE>}<NEW_LINE>}
|
AbstractViewHolder) mRowHeaderRecyclerView.findViewHolderForAdapterPosition(mSelectedRowPosition);
|
981,812
|
public void updatePartitionAssignments(String key, Datastream datastream, HostTargetAssignment targetAssignment, boolean notifyLeader) throws DatastreamException {<NEW_LINE>Validate.notNull(datastream, "null datastream");<NEW_LINE>Validate.notNull(key, "null key for datastream" + datastream);<NEW_LINE>verifyHostname(targetAssignment.getTargetHost());<NEW_LINE>long currentTime = System.currentTimeMillis();<NEW_LINE>String datastreamGroupName = DatastreamUtils.getTaskPrefix(datastream);<NEW_LINE>String path = KeyBuilder.getTargetAssignmentPath(_cluster, datastream.getConnectorName(), datastreamGroupName);<NEW_LINE>_zkClient.ensurePath(path);<NEW_LINE>if (_zkClient.exists(path)) {<NEW_LINE>String json = targetAssignment.toJson();<NEW_LINE>_zkClient.<MASK><NEW_LINE>_zkClient.writeData(path + '/' + currentTime, json);<NEW_LINE>}<NEW_LINE>if (notifyLeader) {<NEW_LINE>try {<NEW_LINE>_zkClient.writeData(KeyBuilder.getTargetAssignmentBase(_cluster, datastream.getConnectorName()), String.valueOf(System.currentTimeMillis()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("Failed to touch the assignment update", e);<NEW_LINE>throw new DatastreamException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
ensurePath(path + '/' + currentTime);
|
278,749
|
public void actionPerformed(ActionEvent e) {<NEW_LINE>X509Metadata metadata = new X509Metadata("whocares", "whocares");<NEW_LINE>File certificatesConfigFile = new File(folder, X509Utils.CA_CONFIG);<NEW_LINE>FileBasedConfig config = new FileBasedConfig(certificatesConfigFile, FS.detect());<NEW_LINE>NewCertificateConfig certificateConfig = null;<NEW_LINE>if (certificatesConfigFile.exists()) {<NEW_LINE>try {<NEW_LINE>config.load();<NEW_LINE>} catch (Exception x) {<NEW_LINE>Utils.showException(GitblitAuthority.this, x);<NEW_LINE>}<NEW_LINE>certificateConfig = NewCertificateConfig.KEY.parse(config);<NEW_LINE>certificateConfig.update(metadata);<NEW_LINE>}<NEW_LINE>InputVerifier verifier = new InputVerifier() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean verify(JComponent comp) {<NEW_LINE>boolean returnValue;<NEW_LINE>JTextField textField = (JTextField) comp;<NEW_LINE>try {<NEW_LINE>Integer.parseInt(textField.getText());<NEW_LINE>returnValue = true;<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>returnValue = false;<NEW_LINE>}<NEW_LINE>return returnValue;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>JTextField siteNameTF = new JTextField(20);<NEW_LINE>siteNameTF.setText(gitblitSettings.getString(Keys.web.siteName, "Gitblit"));<NEW_LINE>JPanel siteNamePanel = Utils.newFieldPanel(Translation.get("gb.siteName"), siteNameTF, Translation.get("gb.siteNameDescription"));<NEW_LINE>JTextField validityTF = new JTextField(4);<NEW_LINE>validityTF.setInputVerifier(verifier);<NEW_LINE>validityTF.setVerifyInputWhenFocusTarget(true);<NEW_LINE>validityTF.setText("" + certificateConfig.duration);<NEW_LINE>JPanel validityPanel = Utils.newFieldPanel(Translation.get("gb.validity"), validityTF, Translation.get("gb.duration.days").replace("{0}", "").trim());<NEW_LINE>JPanel p1 = new JPanel(new GridLayout(0, 1, 5, 2));<NEW_LINE>p1.add(siteNamePanel);<NEW_LINE>p1.add(validityPanel);<NEW_LINE>DefaultOidsPanel oids = new DefaultOidsPanel(metadata);<NEW_LINE>JPanel panel = new JPanel(new BorderLayout());<NEW_LINE>panel.add(p1, BorderLayout.NORTH);<NEW_LINE>panel.add(oids, BorderLayout.CENTER);<NEW_LINE>int result = JOptionPane.showConfirmDialog(GitblitAuthority.this, panel, Translation.get("gb.newCertificateDefaults"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, new ImageIcon(getClass().getResource("/settings_32x32.png")));<NEW_LINE>if (result == JOptionPane.OK_OPTION) {<NEW_LINE>try {<NEW_LINE>oids.update(metadata);<NEW_LINE>certificateConfig.duration = Integer.<MASK><NEW_LINE>certificateConfig.store(config, metadata);<NEW_LINE>config.save();<NEW_LINE>Map<String, String> updates = new HashMap<String, String>();<NEW_LINE>updates.put(Keys.web.siteName, siteNameTF.getText());<NEW_LINE>gitblitSettings.saveSettings(updates);<NEW_LINE>} catch (Exception e1) {<NEW_LINE>Utils.showException(GitblitAuthority.this, e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
parseInt(validityTF.getText());
|
1,014,697
|
private void run() {<NEW_LINE>KeybaseEngine engine = context.getNativeModule(KeybaseEngine.class);<NEW_LINE>if (bundleFromNotification != null) {<NEW_LINE>engine.setInitialBundleFromNotification(bundleFromNotification);<NEW_LINE>} else if (uri != null) {<NEW_LINE>String filePath = readFileFromUri(getReactContext(), uri);<NEW_LINE>if (filePath != null) {<NEW_LINE>// ensure not inside ourselves<NEW_LINE>String appPath = getApplicationInfo().dataDir;<NEW_LINE>if (filePath.indexOf("io.keybase.ossifrage") == -1) {<NEW_LINE>engine.setInitialShareFileUrl(filePath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (textPayload.length() > 0) {<NEW_LINE>engine.setInitialShareText(textPayload);<NEW_LINE>}<NEW_LINE>assert emitter != null;<NEW_LINE>// If there are any other bundle sources we care about, emit them here<NEW_LINE>if (bundleFromNotification != null) {<NEW_LINE>emitter.emit("initialIntentFromNotification", Arguments.fromBundle(bundleFromNotification));<NEW_LINE>}<NEW_LINE>if (uri != null) {<NEW_LINE>String filePath = readFileFromUri(getReactContext(), uri);<NEW_LINE>if (filePath != null) {<NEW_LINE>String appPath = getApplicationInfo().dataDir;<NEW_LINE>// ensure not inside ourselves<NEW_LINE>if (filePath.indexOf("io.keybase.ossifrage") == -1) {<NEW_LINE>WritableMap args = Arguments.createMap();<NEW_LINE>args.putString("localPath", filePath);<NEW_LINE>emitter.emit("onShareData", args);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (textPayload.length() > 0) {<NEW_LINE>WritableMap args = Arguments.createMap();<NEW_LINE><MASK><NEW_LINE>emitter.emit("onShareData", args);<NEW_LINE>}<NEW_LINE>}
|
args.putString("text", textPayload);
|
1,246,650
|
public ValueT put(KeyT key, ValueT value) {<NEW_LINE>val e = new Entry<KeyT, ValueT>(key, value);<NEW_LINE>e.lastAccessTime = this.currentTime.get();<NEW_LINE>Entry<KeyT, ValueT> prevValue;<NEW_LINE>synchronized (this.lock) {<NEW_LINE>prevValue = this.<MASK><NEW_LINE>if (prevValue != null) {<NEW_LINE>// Replacement.<NEW_LINE>if (isExpired(prevValue, e.lastAccessTime)) {<NEW_LINE>// Expired previous value is equivalent to it not having existed in the first place<NEW_LINE>// cleanup will take care of expired entries.<NEW_LINE>prevValue.replaced = true;<NEW_LINE>prevValue = null;<NEW_LINE>} else {<NEW_LINE>// Not expired. We need to manually unlink it.<NEW_LINE>unregister(prevValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Insertion.<NEW_LINE>register(e);<NEW_LINE>}<NEW_LINE>if (prevValue == null) {<NEW_LINE>// We have made an insertion. Clean up if necessary.<NEW_LINE>cleanUp();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return prevValue.value;<NEW_LINE>}
|
map.put(key, e);
|
1,317,987
|
private void initSchemaPartition() throws Exception {<NEW_LINE>final InstanceLayout instanceLayout = this.service.getInstanceLayout();<NEW_LINE>final File schemaPartitionDirectory = new File(instanceLayout.getPartitionsDirectory(), "schema");<NEW_LINE>if (schemaPartitionDirectory.exists()) {<NEW_LINE>System.out.println("schema partition already exists, skipping schema extraction");<NEW_LINE>} else {<NEW_LINE>final SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor(instanceLayout.getPartitionsDirectory());<NEW_LINE>extractor.extractOrCopy();<NEW_LINE>}<NEW_LINE>final SchemaLoader loader = new LdifSchemaLoader(schemaPartitionDirectory);<NEW_LINE>final SchemaManager schemaManager = new DefaultSchemaManager(loader);<NEW_LINE>schemaManager.loadAllEnabled();<NEW_LINE>final List<Throwable> errors = schemaManager.getErrors();<NEW_LINE>if (errors.size() != 0) {<NEW_LINE>throw new Exception(I18n.err(I18n.ERR_317, Exceptions.printErrors(errors)));<NEW_LINE>}<NEW_LINE>this.service.setSchemaManager(schemaManager);<NEW_LINE>final LdifPartition schemaLdifPartition = new LdifPartition(schemaManager);<NEW_LINE>schemaLdifPartition.setPartitionPath(schemaPartitionDirectory.toURI());<NEW_LINE>final SchemaPartition schemaPartition = new SchemaPartition(schemaManager);<NEW_LINE>schemaPartition.setWrappedPartition(schemaLdifPartition);<NEW_LINE><MASK><NEW_LINE>}
|
this.service.setSchemaPartition(schemaPartition);
|
1,684,349
|
protected Result deleteVoD(String id) {<NEW_LINE>boolean success = false;<NEW_LINE>String message = "";<NEW_LINE>ApplicationContext appContext = getAppContext();<NEW_LINE>if (appContext != null) {<NEW_LINE>File videoFile = null;<NEW_LINE>VoD voD = getDataStore().getVoD(id);<NEW_LINE>if (voD != null) {<NEW_LINE>try {<NEW_LINE>String filePath = String.format("webapps/%s/%s", getScope().getName(), voD.getFilePath());<NEW_LINE>videoFile = new File(filePath);<NEW_LINE>boolean result = Files.deleteIfExists(videoFile.toPath());<NEW_LINE>if (!result) {<NEW_LINE>logger.warn("File is not deleted because it does not exist {}", videoFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>String previewFilePath = voD.getPreviewFilePath();<NEW_LINE>if (previewFilePath != null) {<NEW_LINE>File tmp = new File(previewFilePath);<NEW_LINE>boolean resultThumbnail = Files.deleteIfExists(tmp.toPath());<NEW_LINE>if (!resultThumbnail) {<NEW_LINE>logger.warn("Preview is not deleted because it does not exist {}", tmp.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>success = getDataStore().deleteVod(id);<NEW_LINE>if (success) {<NEW_LINE>message = "vod deleted";<NEW_LINE>}<NEW_LINE>String fileName = videoFile.getName();<NEW_LINE>int indexOfFileExtension = fileName.lastIndexOf(".");<NEW_LINE>String finalFileName = fileName.substring(0, indexOfFileExtension);<NEW_LINE>// delete preview file if exists<NEW_LINE>File previewFile = Muxer.getPreviewFile(getScope(), finalFileName, ".png");<NEW_LINE>Files.deleteIfExists(previewFile.toPath());<NEW_LINE>StorageClient storageClient = (StorageClient) appContext.getBean(StorageClient.BEAN_NAME);<NEW_LINE>storageClient.delete(getAppSettings().getS3StreamsFolderPath() + File.separator + fileName);<NEW_LINE>storageClient.delete(getAppSettings().getS3PreviewsFolderPath() + File.separator + finalFileName + ".png");<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(ExceptionUtils.getStackTrace(e));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
|
return new Result(success, message);
|
1,691,573
|
static void write(Manifest manifest, OutputStream out) throws IOException {<NEW_LINE>CharsetEncoder encoder = Charsets.UTF_8.newEncoder();<NEW_LINE>ByteBuffer buffer = ByteBuffer.allocate(LINE_LENGTH_LIMIT);<NEW_LINE>String version = manifest.mainAttributes.getValue(Attributes.Name.MANIFEST_VERSION);<NEW_LINE>if (version != null) {<NEW_LINE>writeEntry(out, Attributes.Name.MANIFEST_VERSION, version, encoder, buffer);<NEW_LINE>Iterator<?> entries = manifest.mainAttributes.keySet().iterator();<NEW_LINE>while (entries.hasNext()) {<NEW_LINE>Attributes.Name name = (Attributes.Name) entries.next();<NEW_LINE>if (!name.equals(Attributes.Name.MANIFEST_VERSION)) {<NEW_LINE>writeEntry(out, name, manifest.mainAttributes.getValue(name), encoder, buffer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.write(LINE_SEPARATOR);<NEW_LINE>Iterator<String> i = manifest.getEntries()<MASK><NEW_LINE>while (i.hasNext()) {<NEW_LINE>String key = i.next();<NEW_LINE>writeEntry(out, NAME_ATTRIBUTE, key, encoder, buffer);<NEW_LINE>Attributes attrib = manifest.entries.get(key);<NEW_LINE>Iterator<?> entries = attrib.keySet().iterator();<NEW_LINE>while (entries.hasNext()) {<NEW_LINE>Attributes.Name name = (Attributes.Name) entries.next();<NEW_LINE>writeEntry(out, name, attrib.getValue(name), encoder, buffer);<NEW_LINE>}<NEW_LINE>out.write(LINE_SEPARATOR);<NEW_LINE>}<NEW_LINE>}
|
.keySet().iterator();
|
696,983
|
public JsonConfigurationMetadata convert(PersistentEntity persistentEntity) {<NEW_LINE>final JsonConfigurationMetadata jsonConfigurationMetadata = new JsonConfigurationMetadata(persistentEntity.getName(), globalAdministrationConfiguration.isManagedDomainType(persistentEntity.getType()));<NEW_LINE>persistentEntity.doWithProperties(new SimplePropertyHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void doWithPersistentProperty(PersistentProperty<?> persistentProperty) {<NEW_LINE>jsonConfigurationMetadata.addPersistentProperty(persistentProperty);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>persistentEntity.doWithAssociations(new SimpleAssociationHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void doWithAssociation(Association<? extends PersistentProperty<?>> association) {<NEW_LINE>jsonConfigurationMetadata.addAssociationProperty(association, associationRestLinkTemplate(association.getInverse()));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (!globalAdministrationConfiguration.isManagedDomainType(persistentEntity.getType())) {<NEW_LINE>return jsonConfigurationMetadata;<NEW_LINE>}<NEW_LINE>DomainTypeAdministrationConfiguration configuration = globalAdministrationConfiguration.forManagedDomainType(persistentEntity.getType());<NEW_LINE>List<DomainConfigurationUnitType> unitTypes = newArrayList(<MASK><NEW_LINE>for (DomainConfigurationUnitType unitType : unitTypes) {<NEW_LINE>Set<FieldMetadata> fieldForUnit = configuration.fieldsForUnit(unitType);<NEW_LINE>for (FieldMetadata field : fieldForUnit) {<NEW_LINE>if (persistentFieldMetadataPredicate().apply(field)) {<NEW_LINE>addPersistentProperty((PersistentFieldMetadata) field, unitType, jsonConfigurationMetadata);<NEW_LINE>}<NEW_LINE>if (customFieldMetadataPredicate().apply(field)) {<NEW_LINE>jsonConfigurationMetadata.addDynamicProperty((CustomFieldMetadata) field, unitType);<NEW_LINE>}<NEW_LINE>if (transientFieldMetadataPredicate().apply(field)) {<NEW_LINE>jsonConfigurationMetadata.addDynamicProperty((TransientFieldMetadata) field, unitType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return jsonConfigurationMetadata;<NEW_LINE>}
|
LIST_VIEW, FORM_VIEW, SHOW_VIEW, QUICK_VIEW);
|
790,608
|
public int[][] highFive(int[][] items) {<NEW_LINE>TreeMap<Integer, PriorityQueue<Integer>> treeMap = new TreeMap<>();<NEW_LINE>for (int[] studentToScores : items) {<NEW_LINE>if (treeMap.containsKey(studentToScores[0])) {<NEW_LINE>PriorityQueue<Integer> maxHeap = treeMap.get(studentToScores[0]);<NEW_LINE>maxHeap.offer(studentToScores[1]);<NEW_LINE>if (maxHeap.size() > 5) {<NEW_LINE>maxHeap.poll();<NEW_LINE>}<NEW_LINE>treeMap.put<MASK><NEW_LINE>} else {<NEW_LINE>PriorityQueue<Integer> maxHeap = new PriorityQueue<>();<NEW_LINE>maxHeap.offer(studentToScores[1]);<NEW_LINE>treeMap.put(studentToScores[0], maxHeap);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int[][] result = new int[treeMap.size()][2];<NEW_LINE>for (int id : treeMap.keySet()) {<NEW_LINE>result[id - 1][0] = id;<NEW_LINE>int sum = 0;<NEW_LINE>PriorityQueue<Integer> maxHeap = treeMap.get(id);<NEW_LINE>while (!maxHeap.isEmpty()) {<NEW_LINE>sum += maxHeap.poll();<NEW_LINE>}<NEW_LINE>result[id - 1][1] = sum / 5;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
(studentToScores[0], maxHeap);
|
1,683,661
|
public static BechAddressParams bchBechDecode(String bech) throws Exception {<NEW_LINE>byte[<MASK><NEW_LINE>for (byte b : buffer) {<NEW_LINE>if (b < 0x21 || b > 0x7e) {<NEW_LINE>throw new Exception("bech32 characters out of range");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!bech.equals(bech.toLowerCase(Locale.ROOT)) && !bech.equals(bech.toUpperCase(Locale.ROOT))) {<NEW_LINE>throw new Exception("BCH bech32 cannot mix upper and lower case");<NEW_LINE>}<NEW_LINE>bech = bech.toLowerCase();<NEW_LINE>int position = bech.lastIndexOf(":");<NEW_LINE>if (position < 1) {<NEW_LINE>throw new Exception("BCH bech32 missing separator");<NEW_LINE>} else if (position + 7 > bech.length()) {<NEW_LINE>throw new Exception("BCH bech32 separator misplaced");<NEW_LINE>} else if (bech.length() < 8) {<NEW_LINE>throw new Exception("BCH bech32 input too short");<NEW_LINE>} else if (bech.length() > 90) {<NEW_LINE>throw new Exception("BCH bech32 input too long");<NEW_LINE>}<NEW_LINE>String s = bech.substring(position + 1);<NEW_LINE>for (int i = 0; i < s.length(); i++) {<NEW_LINE>if (CHARSET.indexOf(s.charAt(i)) == -1) {<NEW_LINE>throw new Exception("BCH bech32 characters out of range");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>byte[] humanReadablePart = bech.substring(0, position).getBytes();<NEW_LINE>byte[] data = new byte[bech.length() - position - 1];<NEW_LINE>for (int j = 0, i = position + 1; i < bech.length(); i++, j++) {<NEW_LINE>data[j] = (byte) CHARSET.indexOf(bech.charAt(i));<NEW_LINE>}<NEW_LINE>if (!verifyChecksum(humanReadablePart, data)) {<NEW_LINE>throw new Exception("invalid BCH bech32 checksum");<NEW_LINE>}<NEW_LINE>byte[] payloadData = fromBase5Array(Arrays.copyOfRange(data, 0, data.length - 8));<NEW_LINE>byte[] hash = Arrays.copyOfRange(payloadData, 1, payloadData.length);<NEW_LINE>String type = getType(payloadData[0]);<NEW_LINE>return new BechAddressParams(type, hash, new String(humanReadablePart));<NEW_LINE>}
|
] buffer = bech.getBytes();
|
1,699,066
|
public static boolean drawImage(GC gc, Image image, Point srcStart, Rectangle dstRect, Rectangle clipping, int hOffset, int vOffset, boolean clearArea) {<NEW_LINE>Rectangle srcRect;<NEW_LINE>Point dstAdj;<NEW_LINE>if (clipping == null) {<NEW_LINE>dstAdj = new Point(0, 0);<NEW_LINE>srcRect = new Rectangle(srcStart.x, srcStart.y, <MASK><NEW_LINE>} else {<NEW_LINE>if (!dstRect.intersects(clipping)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>dstAdj = new Point(Math.max(0, clipping.x - dstRect.x), Math.max(0, clipping.y - dstRect.y));<NEW_LINE>srcRect = new Rectangle(0, 0, 0, 0);<NEW_LINE>srcRect.x = srcStart.x + dstAdj.x;<NEW_LINE>srcRect.y = srcStart.y + dstAdj.y;<NEW_LINE>srcRect.width = Math.min(dstRect.width - dstAdj.x, clipping.x + clipping.width - dstRect.x);<NEW_LINE>srcRect.height = Math.min(dstRect.height - dstAdj.y, clipping.y + clipping.height - dstRect.y);<NEW_LINE>}<NEW_LINE>if (!srcRect.isEmpty()) {<NEW_LINE>try {<NEW_LINE>if (clearArea) {<NEW_LINE>gc.fillRectangle(dstRect.x + dstAdj.x + hOffset, dstRect.y + dstAdj.y + vOffset, srcRect.width, srcRect.height);<NEW_LINE>}<NEW_LINE>gc.drawImage(image, srcRect.x, srcRect.y, srcRect.width, srcRect.height, dstRect.x + dstAdj.x + hOffset, dstRect.y + dstAdj.y + vOffset, srcRect.width, srcRect.height);<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.out.println("drawImage: " + e.getMessage() + ": " + image + ", " + srcRect + ", " + (dstRect.x + dstAdj.y + hOffset) + "," + (dstRect.y + dstAdj.y + vOffset) + "," + srcRect.width + "," + srcRect.height + "; imageBounds = " + image.getBounds());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
dstRect.width, dstRect.height);
|
164,696
|
public void writeCustomNBT(CompoundTag nbt, boolean descPacket) {<NEW_LINE>super.writeCustomNBT(nbt, descPacket);<NEW_LINE>nbt.putInt("energyStorage", energyStorage);<NEW_LINE>nbt.putBoolean("redstoneControlInverted", redstoneControlInverted);<NEW_LINE>nbt.putInt("facing", facing.ordinal());<NEW_LINE>nbt.putFloat("rotY", rotY);<NEW_LINE>nbt.putFloat("rotX", rotX);<NEW_LINE>nbt.putInt("lightAmount", fakeLights.size());<NEW_LINE>for (int i = 0; i < fakeLights.size(); i++) {<NEW_LINE>BlockPos cc = fakeLights.get(i);<NEW_LINE>nbt.putIntArray("fakeLight_" + i, new int[] { cc.getX(), cc.getY()<MASK><NEW_LINE>}<NEW_LINE>if (descPacket && computerControl.isStillAttached())<NEW_LINE>nbt.putBoolean("computerOn", computerControl.isEnabled());<NEW_LINE>}
|
, cc.getZ() });
|
386,507
|
public static void horizontal(GrayU16 src, GrayF32 dst) {<NEW_LINE>if (src.width < dst.width)<NEW_LINE>throw new IllegalArgumentException("src width must be >= dst width");<NEW_LINE>if (src.height != dst.height)<NEW_LINE>throw new IllegalArgumentException("src height must equal dst height");<NEW_LINE>float scale = src.width / (float) dst.width;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, dst.height, y -> {<NEW_LINE>for (int y = 0; y < dst.height; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>for (int x = 0; x < dst.width - 1; x++, indexDst++) {<NEW_LINE>float srcX0 = x * scale;<NEW_LINE>float srcX1 = (x + 1) * scale;<NEW_LINE>int isrcX0 = (int) srcX0;<NEW_LINE>int isrcX1 = (int) srcX1;<NEW_LINE>int index = src.getIndex(isrcX0, y);<NEW_LINE>// compute value of overlapped region<NEW_LINE>float startWeight = (1.0f - (srcX0 - isrcX0));<NEW_LINE>int start = src.data[index++] & 0xFFFF;<NEW_LINE>int middle = 0;<NEW_LINE>for (int i = isrcX0 + 1; i < isrcX1; i++) {<NEW_LINE>middle += src.data[index++] & 0xFFFF;<NEW_LINE>}<NEW_LINE>float endWeight = (srcX1 % 1);<NEW_LINE>int end = src.data[index] & 0xFFFF;<NEW_LINE>dst.data[indexDst] = (start * startWeight + middle + end * endWeight) / scale;<NEW_LINE>}<NEW_LINE>// handle the last area as a special case<NEW_LINE>int x = dst.width - 1;<NEW_LINE>float srcX0 = x * scale;<NEW_LINE>int isrcX0 = (int) srcX0;<NEW_LINE>int isrcX1 = src.width - 1;<NEW_LINE>int index = src.getIndex(isrcX0, y);<NEW_LINE>// compute value of overlapped region<NEW_LINE>float startWeight = (1.0f - (srcX0 - isrcX0));<NEW_LINE>int start = src.data[index++] & 0xFFFF;<NEW_LINE>int middle = 0;<NEW_LINE>for (int i = isrcX0 + 1; i < isrcX1; i++) {<NEW_LINE>middle += src.data[index++] & 0xFFFF;<NEW_LINE>}<NEW_LINE>int end = isrcX1 != isrcX0 ? src.data[index] & 0xFFFF : 0;<NEW_LINE>dst.data[indexDst] = (start * <MASK><NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
|
startWeight + middle + end) / scale;
|
1,639,731
|
// Earth annoying his friends <3 nothing to see here<NEW_LINE>@Inject(method = "getWindowTitle", at = @At("RETURN"), cancellable = true)<NEW_LINE>private void modifyWindowTitle(CallbackInfoReturnable<String> ci) {<NEW_LINE>String playerName = MinecraftClient.getInstance().getSession()<MASK><NEW_LINE>if ("Earthcomputer".equals(playerName) || "Azteched".equals(playerName) || "samnrad".equals(playerName) || "allocator".equals(playerName) || "Rybot666".equals(playerName)) {<NEW_LINE>List<Character> chars = ci.getReturnValue().chars().mapToObj(c -> (char) c).collect(Collectors.toCollection(ArrayList::new));<NEW_LINE>Collections.shuffle(chars);<NEW_LINE>ci.setReturnValue(chars.stream().map(String::valueOf).collect(Collectors.joining()));<NEW_LINE>}<NEW_LINE>}
|
.getProfile().getName();
|
1,662,741
|
public RFuture<Boolean> putAllAsync(K key, Iterable<? extends V> values) {<NEW_LINE>List<Object> params <MASK><NEW_LINE>ByteBuf keyState = encodeMapKey(key);<NEW_LINE>params.add(keyState);<NEW_LINE>String keyHash = hash(keyState);<NEW_LINE>params.add(keyHash);<NEW_LINE>for (Object value : values) {<NEW_LINE>ByteBuf valueState = encodeMapValue(value);<NEW_LINE>params.add(valueState);<NEW_LINE>}<NEW_LINE>String setName = getValuesName(keyHash);<NEW_LINE>return commandExecutor.evalWriteNoRetryAsync(getRawName(), codec, RedisCommands.EVAL_BOOLEAN_AMOUNT, "redis.call('hset', KEYS[1], ARGV[1], ARGV[2]); " + "return redis.call('rpush', KEYS[2], unpack(ARGV, 3, #ARGV)); ", Arrays.<Object>asList(getRawName(), setName), params.toArray());<NEW_LINE>}
|
= new ArrayList<Object>();
|
1,125,886
|
public boolean action(Request request, Response response) {<NEW_LINE>if (request.getNettyRequest() instanceof FullHttpRequest) {<NEW_LINE>InputCreateGroup inputCreateGroup = getRequestBody(request.getNettyRequest(), InputCreateGroup.class);<NEW_LINE>if (inputCreateGroup.isValide()) {<NEW_LINE>sendApiMessage(response, inputCreateGroup.getOperator(), IMTopic.CreateGroupTopic, inputCreateGroup.toProtoGroupRequest().toByteArray(), result -> {<NEW_LINE><MASK><NEW_LINE>byteBuf.writeBytes(result);<NEW_LINE>ErrorCode errorCode = ErrorCode.fromCode(byteBuf.readByte());<NEW_LINE>if (errorCode == ErrorCode.ERROR_CODE_SUCCESS) {<NEW_LINE>byte[] data = new byte[byteBuf.readableBytes()];<NEW_LINE>byteBuf.readBytes(data);<NEW_LINE>String groupId = new String(data);<NEW_LINE>return new Result(ErrorCode.ERROR_CODE_SUCCESS, new OutputCreateGroupResult(groupId));<NEW_LINE>} else {<NEW_LINE>return new Result(errorCode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>setResponseContent(RestResult.resultOf(ErrorCode.INVALID_PARAMETER), response);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
ByteBuf byteBuf = Unpooled.buffer();
|
1,211,686
|
private static void doExperiment(int numberOfExperiments, int initialArraySize, Map<Integer, Comparable[]> allInputArrays) {<NEW_LINE>StdOut.printf("%13s %16s %38s %52s\n", <MASK><NEW_LINE>int arraySize = initialArraySize;<NEW_LINE>for (int i = 0; i < numberOfExperiments; i++) {<NEW_LINE>Comparable[] originalArray = allInputArrays.get(i);<NEW_LINE>Comparable[] arrayCopy1 = new Comparable[originalArray.length];<NEW_LINE>System.arraycopy(originalArray, 0, arrayCopy1, 0, originalArray.length);<NEW_LINE>Comparable[] arrayCopy2 = new Comparable[originalArray.length];<NEW_LINE>System.arraycopy(originalArray, 0, arrayCopy2, 0, originalArray.length);<NEW_LINE>// QuickSort 3-Way<NEW_LINE>Stopwatch quickSort3WaySortTimer = new Stopwatch();<NEW_LINE>QuickSort3Way.quickSort3Way(originalArray);<NEW_LINE>double quickSort3WayRunningTime = quickSort3WaySortTimer.elapsedTime();<NEW_LINE>// QuickSort with fast 3-way partitioning (Bentley-McIlroy)<NEW_LINE>Stopwatch quickSortWithFast3WayPartitioning = new Stopwatch();<NEW_LINE>Exercise22_Fast3WayPartitioning.quickSortWithFast3WayPartitioning(arrayCopy1);<NEW_LINE>double quickSortWithFast3WayPartitioningRunningTime = quickSortWithFast3WayPartitioning.elapsedTime();<NEW_LINE>// QuickSort with fast 3-way partitioning (Bentley-McIlroy) + Tukey Ninther<NEW_LINE>Stopwatch quickSortWithFast3WayPartitioningTukeyNinther = new Stopwatch();<NEW_LINE>quickSortWithFast3WayPartitioningTukeyNinther(arrayCopy2);<NEW_LINE>double quickSortWithFast3WayPartitioningTukeyNintherRunningTime = quickSortWithFast3WayPartitioningTukeyNinther.elapsedTime();<NEW_LINE>printResults(arraySize, quickSort3WayRunningTime, quickSortWithFast3WayPartitioningRunningTime, quickSortWithFast3WayPartitioningTukeyNintherRunningTime);<NEW_LINE>arraySize *= 2;<NEW_LINE>}<NEW_LINE>}
|
"Array Size | ", "QuickSort 3-Way |", "QuickSort with fast 3-way partitioning | ", "QuickSort w/ fast 3-way partitioning + Tukey Ninther");
|
1,674,551
|
private boolean processFileNotify(String id, EventAction action) {<NEW_LINE>MagicEntity <MASK><NEW_LINE>if (entity == null) {<NEW_LINE>// create<NEW_LINE>this.readAll();<NEW_LINE>entity = fileCache.get(id);<NEW_LINE>}<NEW_LINE>if (entity != null) {<NEW_LINE>Group group = groupCache.get(entity.getGroupId());<NEW_LINE>if (group != null) {<NEW_LINE>MagicResourceStorage<? extends MagicEntity> storage = storages.get(group.getType());<NEW_LINE>Map<String, String> pathCacheMap = storage.requirePath() ? pathCache.get(storage.folder()) : null;<NEW_LINE>if (action == EventAction.DELETE) {<NEW_LINE>fileMappings.remove(id);<NEW_LINE>entity = fileCache.remove(id);<NEW_LINE>if (pathCacheMap != null) {<NEW_LINE>pathCacheMap.remove(id);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Resource resource = fileMappings.get(id);<NEW_LINE>entity = storage.read(resource.read());<NEW_LINE>putFile(storage, entity, resource);<NEW_LINE>}<NEW_LINE>publisher.publishEvent(new FileEvent(group.getType(), action, entity, Constants.EVENT_SOURCE_NOTIFY));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
|
entity = fileCache.get(id);
|
880,044
|
public static ListNamespacedConfigMapsResponse unmarshall(ListNamespacedConfigMapsResponse listNamespacedConfigMapsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listNamespacedConfigMapsResponse.setRequestId(_ctx.stringValue("ListNamespacedConfigMapsResponse.RequestId"));<NEW_LINE>listNamespacedConfigMapsResponse.setCode(_ctx.stringValue("ListNamespacedConfigMapsResponse.Code"));<NEW_LINE>listNamespacedConfigMapsResponse.setMessage(_ctx.stringValue("ListNamespacedConfigMapsResponse.Message"));<NEW_LINE>listNamespacedConfigMapsResponse.setErrorCode(_ctx.stringValue("ListNamespacedConfigMapsResponse.ErrorCode"));<NEW_LINE>listNamespacedConfigMapsResponse.setTraceId(_ctx.stringValue("ListNamespacedConfigMapsResponse.TraceId"));<NEW_LINE>listNamespacedConfigMapsResponse.setSuccess(_ctx.booleanValue("ListNamespacedConfigMapsResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>List<ConfigMap> configMaps = new ArrayList<ConfigMap>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListNamespacedConfigMapsResponse.Data.ConfigMaps.Length"); i++) {<NEW_LINE>ConfigMap configMap = new ConfigMap();<NEW_LINE>configMap.setConfigMapId(_ctx.longValue("ListNamespacedConfigMapsResponse.Data.ConfigMaps[" + i + "].ConfigMapId"));<NEW_LINE>configMap.setName(_ctx.stringValue<MASK><NEW_LINE>configMap.setNamespaceId(_ctx.stringValue("ListNamespacedConfigMapsResponse.Data.ConfigMaps[" + i + "].NamespaceId"));<NEW_LINE>configMap.setDescription(_ctx.stringValue("ListNamespacedConfigMapsResponse.Data.ConfigMaps[" + i + "].Description"));<NEW_LINE>configMap.setData(_ctx.mapValue("ListNamespacedConfigMapsResponse.Data.ConfigMaps[" + i + "].Data"));<NEW_LINE>configMap.setCreateTime(_ctx.longValue("ListNamespacedConfigMapsResponse.Data.ConfigMaps[" + i + "].CreateTime"));<NEW_LINE>configMap.setUpdateTime(_ctx.longValue("ListNamespacedConfigMapsResponse.Data.ConfigMaps[" + i + "].UpdateTime"));<NEW_LINE>List<RelateApp> relateApps = new ArrayList<RelateApp>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListNamespacedConfigMapsResponse.Data.ConfigMaps[" + i + "].RelateApps.Length"); j++) {<NEW_LINE>RelateApp relateApp = new RelateApp();<NEW_LINE>relateApp.setAppId(_ctx.stringValue("ListNamespacedConfigMapsResponse.Data.ConfigMaps[" + i + "].RelateApps[" + j + "].AppId"));<NEW_LINE>relateApp.setAppName(_ctx.stringValue("ListNamespacedConfigMapsResponse.Data.ConfigMaps[" + i + "].RelateApps[" + j + "].AppName"));<NEW_LINE>relateApps.add(relateApp);<NEW_LINE>}<NEW_LINE>configMap.setRelateApps(relateApps);<NEW_LINE>configMaps.add(configMap);<NEW_LINE>}<NEW_LINE>data.setConfigMaps(configMaps);<NEW_LINE>listNamespacedConfigMapsResponse.setData(data);<NEW_LINE>return listNamespacedConfigMapsResponse;<NEW_LINE>}
|
("ListNamespacedConfigMapsResponse.Data.ConfigMaps[" + i + "].Name"));
|
25,692
|
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String registryName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><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 (registryName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2019-05-01";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, registryName, context);<NEW_LINE>}
|
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
|
1,732,615
|
protected WebRtcServiceState handleStartOutgoingCall(@NonNull WebRtcServiceState currentState, @NonNull RemotePeer remotePeer, @NonNull OfferMessage.Type offerType) {<NEW_LINE>Log.i(TAG, "handleStartOutgoingCall():");<NEW_LINE>WebRtcServiceStateBuilder builder = currentState.builder();<NEW_LINE>remotePeer.dialing();<NEW_LINE>Log.i(TAG, "assign activePeer callId: " + remotePeer.getCallId() + " key: " + remotePeer.hashCode() + " type: " + offerType);<NEW_LINE>boolean isVideoCall = offerType == OfferMessage.Type.VIDEO_CALL;<NEW_LINE>webRtcInteractor.setCallInProgressNotification(TYPE_OUTGOING_RINGING, remotePeer);<NEW_LINE>webRtcInteractor.setDefaultAudioDevice(remotePeer.getId(), isVideoCall ? SignalAudioManager.AudioDevice.SPEAKER_PHONE : <MASK><NEW_LINE>webRtcInteractor.updatePhoneState(WebRtcUtil.getInCallPhoneState(context));<NEW_LINE>webRtcInteractor.initializeAudioForCall();<NEW_LINE>webRtcInteractor.startOutgoingRinger();<NEW_LINE>if (!webRtcInteractor.addNewOutgoingCall(remotePeer.getId(), remotePeer.getCallId().longValue(), isVideoCall)) {<NEW_LINE>Log.i(TAG, "Unable to add new outgoing call");<NEW_LINE>return handleDropCall(currentState, remotePeer.getCallId().longValue());<NEW_LINE>}<NEW_LINE>RecipientUtil.setAndSendUniversalExpireTimerIfNecessary(context, Recipient.resolved(remotePeer.getId()), SignalDatabase.threads().getThreadIdIfExistsFor(remotePeer.getId()));<NEW_LINE>SignalDatabase.sms().insertOutgoingCall(remotePeer.getId(), isVideoCall);<NEW_LINE>EglBaseWrapper.replaceHolder(EglBaseWrapper.OUTGOING_PLACEHOLDER, remotePeer.getCallId().longValue());<NEW_LINE>webRtcInteractor.retrieveTurnServers(remotePeer);<NEW_LINE>return builder.changeCallSetupState(remotePeer.getCallId()).enableVideoOnCreate(isVideoCall).waitForTelecom(AndroidTelecomUtil.getTelecomSupported()).telecomApproved(false).commit().changeCallInfoState().activePeer(remotePeer).callState(WebRtcViewModel.State.CALL_OUTGOING).commit().changeLocalDeviceState().build();<NEW_LINE>}
|
SignalAudioManager.AudioDevice.EARPIECE, false);
|
325,951
|
public Response download(String downloadId) throws DownloadNotFoundException {<NEW_LINE>DownloadBean download;<NEW_LINE>try {<NEW_LINE>download = downloadManager.getDownload(downloadId);<NEW_LINE>if (download == null) {<NEW_LINE>throw new DownloadNotFoundException();<NEW_LINE>}<NEW_LINE>} catch (StorageException e) {<NEW_LINE>throw new DownloadNotFoundException(e);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>ApiRegistryInfo info;<NEW_LINE>switch(download.getType()) {<NEW_LINE>case apiRegistryJson:<NEW_LINE>info = parseApiRegistryPath(path);<NEW_LINE>return orgs.getApiRegistryJSONInternal(info.organizationId, info.clientId, info.version);<NEW_LINE>case apiRegistryXml:<NEW_LINE>info = parseApiRegistryPath(path);<NEW_LINE>return orgs.getApiRegistryXMLInternal(info.organizationId, info.clientId, info.version);<NEW_LINE>case exportJson:<NEW_LINE>return system.exportData();<NEW_LINE>default:<NEW_LINE>throw new DownloadNotFoundException();<NEW_LINE>}<NEW_LINE>}
|
String path = download.getPath();
|
1,458,146
|
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>setTheme(<MASK><NEW_LINE>overridePendingTransition(de.cotech.sweetspot.R.anim.fade_in_quick, de.cotech.sweetspot.R.anim.fade_out_quick);<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(de.cotech.sweetspot.R.layout.activity_nfc_sweetspot);<NEW_LINE>sweetspotIndicator = findViewById(de.cotech.sweetspot.R.id.indicator_nfc_sweetspot);<NEW_LINE>Pair<Double, Double> nfcPosition = NfcSweetspotData.getSweetspotForBuildModel();<NEW_LINE>if (nfcPosition == null) {<NEW_LINE>throw new IllegalArgumentException("No data available for this model. This activity should not be called!");<NEW_LINE>}<NEW_LINE>DisplayMetrics displayDimensions = getDisplaySize();<NEW_LINE>final float translationX = (float) (displayDimensions.widthPixels * nfcPosition.first);<NEW_LINE>final float translationY = (float) (displayDimensions.heightPixels * nfcPosition.second);<NEW_LINE>sweetspotIndicator.post(() -> {<NEW_LINE>sweetspotIndicator.setTranslationX(translationX - sweetspotIndicator.getWidth() / 2);<NEW_LINE>sweetspotIndicator.setTranslationY(translationY - sweetspotIndicator.getHeight() / 2);<NEW_LINE>});<NEW_LINE>sweetspotIcon = findViewById(de.cotech.sweetspot.R.id.icon_nfc_sweetspot);<NEW_LINE>sweetspotCircle1 = findViewById(de.cotech.sweetspot.R.id.circle_nfc_sweetspot_1);<NEW_LINE>sweetspotCircle2 = findViewById(de.cotech.sweetspot.R.id.circle_nfc_sweetspot_2);<NEW_LINE>sweetspotCircle3 = findViewById(de.cotech.sweetspot.R.id.circle_nfc_sweetspot_3);<NEW_LINE>sweetspotIcon.setAlpha(0.0f);<NEW_LINE>sweetspotCircle1.setAlpha(0.0f);<NEW_LINE>sweetspotCircle2.setAlpha(0.0f);<NEW_LINE>sweetspotCircle3.setAlpha(0.0f);<NEW_LINE>}
|
android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
|
421,125
|
private MaterialConfigs knownMaterials(Pipeline pipeline, MaterialRevisions scheduledRevs) {<NEW_LINE>CruiseConfig currentConfig = goConfigService.getCurrentConfig();<NEW_LINE>MaterialConfigs configuredMaterials = new MaterialConfigs();<NEW_LINE>for (MaterialRevision revision : scheduledRevs) {<NEW_LINE>String fingerprint = revision.getMaterial().getFingerprint();<NEW_LINE>// first try to find material config from current pipeline config<NEW_LINE>MaterialConfig configuredMaterial = currentConfig.materialConfigFor(new CaseInsensitiveString(pipeline<MASK><NEW_LINE>if (configuredMaterial != null) {<NEW_LINE>configuredMaterials.add(configuredMaterial);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// todo: remove the global lookup fallback code after we feel safe<NEW_LINE>if (new SystemEnvironment().get(SystemEnvironment.GO_SERVER_SCHEDULED_PIPELINE_LOADER_GLOBAL_MATERIAL_LOOKUP)) {<NEW_LINE>// fallback to global lookup if material is not in current pipeline config (old behavior)<NEW_LINE>configuredMaterial = currentConfig.materialConfigFor(fingerprint);<NEW_LINE>if (configuredMaterial != null) {<NEW_LINE>configuredMaterials.add((configuredMaterial));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MaterialConfigs knownMaterials = new MaterialConfigs();<NEW_LINE>for (MaterialConfig configuredMaterial : configuredMaterials) {<NEW_LINE>materialExpansionService.expandForScheduling(configuredMaterial, knownMaterials);<NEW_LINE>}<NEW_LINE>return knownMaterials;<NEW_LINE>}
|
.getName()), fingerprint);
|
930,335
|
public void handleInsert(InsertionContext context, LookupElement item) {<NEW_LINE>final Editor editor = context.getEditor();<NEW_LINE>final Project project = editor.getProject();<NEW_LINE>if (project != null) {<NEW_LINE>final JSGraphQLEndpointImportDeclaration[] imports = PsiTreeUtil.getChildrenOfType(context.getFile(), JSGraphQLEndpointImportDeclaration.class);<NEW_LINE>int insertionOffset = 0;<NEW_LINE>if (imports != null && imports.length > 0) {<NEW_LINE>JSGraphQLEndpointImportDeclaration lastImport = <MASK><NEW_LINE>insertionOffset = lastImport.getTextRange().getEndOffset();<NEW_LINE>}<NEW_LINE>final String name = JSGraphQLEndpointImportUtil.getImportName(project, fileToImport);<NEW_LINE>String importDeclaration = "import \"" + name + "\"\n";<NEW_LINE>if (insertionOffset > 0) {<NEW_LINE>importDeclaration = "\n" + importDeclaration;<NEW_LINE>}<NEW_LINE>editor.getDocument().insertString(insertionOffset, importDeclaration);<NEW_LINE>}<NEW_LINE>}
|
imports[imports.length - 1];
|
1,084,234
|
public boolean isValid() {<NEW_LINE>switch(htmlTag) {<NEW_LINE>case A:<NEW_LINE>return (hasAttr(HtmlAttr.NAME) || (hasAttr(HtmlAttr.<MASK><NEW_LINE>case BR:<NEW_LINE>return (!hasContent() && (!hasAttrs() || hasAttr(HtmlAttr.CLEAR)));<NEW_LINE>case FRAME:<NEW_LINE>return (hasAttr(HtmlAttr.SRC) && !hasContent());<NEW_LINE>case HR:<NEW_LINE>return (!hasContent());<NEW_LINE>case IMG:<NEW_LINE>return (hasAttr(HtmlAttr.SRC) && hasAttr(HtmlAttr.ALT) && !hasContent());<NEW_LINE>case LINK:<NEW_LINE>return (hasAttr(HtmlAttr.HREF) && !hasContent());<NEW_LINE>case META:<NEW_LINE>return (hasAttr(HtmlAttr.CONTENT) && !hasContent());<NEW_LINE>case SCRIPT:<NEW_LINE>return ((hasAttr(HtmlAttr.TYPE) && hasAttr(HtmlAttr.SRC) && !hasContent()) || (hasAttr(HtmlAttr.TYPE) && hasContent()));<NEW_LINE>default:<NEW_LINE>return hasContent();<NEW_LINE>}<NEW_LINE>}
|
HREF) && hasContent()));
|
727,282
|
private void allocateContainer(Container container) throws Exception {<NEW_LINE>String containerId = container.getId().toString();<NEW_LINE>LOGGER.logInfo("[%s]: allocateContainer: Try to Allocate Container to Task: Container: %s", containerId, HadoopExts.toString(container));<NEW_LINE>// 0. findTask<NEW_LINE>TaskStatus taskStatus = findTask(container);<NEW_LINE>if (taskStatus == null) {<NEW_LINE>LOGGER.logDebug("[%s]: Cannot find a suitable Task to accept the Allocate Container. It should be exceeded.", containerId);<NEW_LINE>tryToReleaseContainer(containerId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String taskRoleName = taskStatus.getTaskRoleName();<NEW_LINE>TaskStatusLocator taskLocator = new TaskStatusLocator(taskRoleName, taskStatus.getTaskIndex());<NEW_LINE>// 1. removeContainerRequest<NEW_LINE>removeContainerRequest(taskStatus);<NEW_LINE>// 2. testContainer<NEW_LINE>if (!testContainer(container, taskRoleName)) {<NEW_LINE>LOGGER.logInfo("%s[%s]: Container is Rejected, Release Container and Request again", taskLocator, containerId);<NEW_LINE>tryToReleaseContainer(containerId);<NEW_LINE>statusManager.transitionTaskState(taskLocator, TaskState.TASK_WAITING);<NEW_LINE>addContainerRequest(taskStatus);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// 3. allocateContainer<NEW_LINE>Map<String, Ports> portDefinitions = requestManager.getTaskResource(taskRoleName).getPortDefinitions();<NEW_LINE>try {<NEW_LINE>statusManager.transitionTaskState(taskLocator, TaskState.CONTAINER_ALLOCATED, new TaskEvent().setContainer(container).setPortDefinitions(portDefinitions));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.logWarning(<MASK><NEW_LINE>tryToReleaseContainer(containerId);<NEW_LINE>statusManager.transitionTaskState(taskLocator, TaskState.TASK_WAITING);<NEW_LINE>addContainerRequest(taskStatus);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOGGER.logInfo("%s[%s]: Succeeded to Allocate Container to Task", taskLocator, containerId);<NEW_LINE>if (containerConnectionExceedCount.containsKey(containerId)) {<NEW_LINE>// Pending Exceed Container now is settled to live associated Container<NEW_LINE>containerConnectionExceedCount.remove(containerId);<NEW_LINE>}<NEW_LINE>// 4. launchContainer<NEW_LINE>Boolean gangAllocation = requestManager.getPlatParams().getGangAllocation();<NEW_LINE>if (!gangAllocation) {<NEW_LINE>launchContainer(taskStatus);<NEW_LINE>}<NEW_LINE>}
|
e, "%s[%s]: Failed to Allocate Container to Task, Release Container and Request again", taskLocator, containerId);
|
226,487
|
private void updateSummary() {<NEW_LINE>FixDescription curFix = getResult();<NEW_LINE><MASK><NEW_LINE>if (curFix.isSet && curFix.version2Set != null) {<NEW_LINE>part1 = FixVersionConflictPanel_sumPart1_text(getSetText(), curFix.version2Set.toString(), conflictNode.getImpl().getArtifact().getArtifactId());<NEW_LINE>}<NEW_LINE>if (curFix.isExclude && !curFix.exclusionTargets.isEmpty()) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>boolean isFirst = true;<NEW_LINE>for (Artifact art : curFix.exclusionTargets) {<NEW_LINE>if (!isFirst) {<NEW_LINE>sb.append(", ");<NEW_LINE>} else {<NEW_LINE>isFirst = false;<NEW_LINE>}<NEW_LINE>sb.append(art.getArtifactId());<NEW_LINE>}<NEW_LINE>part2 = FixVersionConflictPanel_sumPart2_text(conflictNode.getImpl().getArtifact().getArtifactId(), sb);<NEW_LINE>}<NEW_LINE>if (part1.isEmpty() && part2.isEmpty()) {<NEW_LINE>part1 = FixVersionConflictPanel_noChanges();<NEW_LINE>}<NEW_LINE>if (!part1.isEmpty() && !part2.isEmpty()) {<NEW_LINE>part1 = part1 + " ";<NEW_LINE>}<NEW_LINE>sumContent.setText(FixVersionConflictPanel_sumContent_text(part1, part2));<NEW_LINE>}
|
String part1 = "", part2 = "";
|
1,407,455
|
@JSONP<NEW_LINE>@NoCache<NEW_LINE>@Produces({ MediaType.APPLICATION_JSON, "application/javascript" })<NEW_LINE>public final Response findStepById(@Context final HttpServletRequest request, @Context final HttpServletResponse response, @NotNull @PathParam("stepId") final String stepId) {<NEW_LINE>this.webResource.init(null, request, response, true, null);<NEW_LINE>Logger.debug(this, "finding step by id stepId: " + stepId);<NEW_LINE>try {<NEW_LINE>final WorkflowStep step = this.workflowHelper.findStepById(stepId);<NEW_LINE>return Response.ok(new ResponseEntityView<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(this.getClass(), "Exception on findStepById, stepId: " + stepId + ", exception message: " + e.getMessage(), e);<NEW_LINE>return ResponseUtil.mapExceptionResponse(e);<NEW_LINE>}<NEW_LINE>}
|
(step)).build();
|
290,079
|
protected void parseCreateField(ParseContext context) throws IOException {<NEW_LINE>if (stored == false && hasDocValues == false) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>byte[] value = context.<MASK><NEW_LINE>if (value == null) {<NEW_LINE>if (context.parser().currentToken() == XContentParser.Token.VALUE_NULL) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>value = context.parser().binaryValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (value == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (stored) {<NEW_LINE>context.doc().add(new StoredField(fieldType().name(), value));<NEW_LINE>}<NEW_LINE>if (hasDocValues) {<NEW_LINE>CustomBinaryDocValuesField field = (CustomBinaryDocValuesField) context.doc().getByKey(fieldType().name());<NEW_LINE>if (field == null) {<NEW_LINE>field = new CustomBinaryDocValuesField(fieldType().name(), value);<NEW_LINE>context.doc().addWithKey(fieldType().name(), field);<NEW_LINE>} else {<NEW_LINE>field.add(value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Only add an entry to the field names field if the field is stored<NEW_LINE>// but has no doc values so exists query will work on a field with<NEW_LINE>// no doc values<NEW_LINE>createFieldNamesField(context);<NEW_LINE>}<NEW_LINE>}
|
parseExternalValue(byte[].class);
|
1,482,347
|
public void compileRoutes() {<NEW_LINE>if (routes.isEmpty()) {<NEW_LINE>// nothing to do<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>log.debug("Compile routes");<NEW_LINE>Iterator<Route> it = routes.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Route route = it.next();<NEW_LINE>// remove route<NEW_LINE>it.remove();<NEW_LINE>// updates routes' cache<NEW_LINE>List<Route> cacheEntry = routesCache.<MASK><NEW_LINE>if (cacheEntry != null) {<NEW_LINE>cacheEntry.remove(route);<NEW_LINE>}<NEW_LINE>// compile route and apply the transformers<NEW_LINE>Route compiledRoute = compileRoute(route);<NEW_LINE>for (RouteTransformer transformer : transformers) {<NEW_LINE>compiledRoute = transformer.transform(compiledRoute);<NEW_LINE>if (compiledRoute == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>compiledRoute.bind("__transformer", transformer);<NEW_LINE>}<NEW_LINE>if (compiledRoute != null) {<NEW_LINE>// add the compiled route to list<NEW_LINE>addCompiledRoute(compiledRoute);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// sort compiled routes<NEW_LINE>Collections.sort(compiledRoutes);<NEW_LINE>}
|
get(route.getRequestMethod());
|
5,545
|
final GetOnPremisesInstanceResult executeGetOnPremisesInstance(GetOnPremisesInstanceRequest getOnPremisesInstanceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getOnPremisesInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetOnPremisesInstanceRequest> request = null;<NEW_LINE>Response<GetOnPremisesInstanceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetOnPremisesInstanceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getOnPremisesInstanceRequest));<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, "CodeDeploy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetOnPremisesInstance");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetOnPremisesInstanceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>}
|
false), new GetOnPremisesInstanceResultJsonUnmarshaller());
|
1,069,357
|
public Sequence execute(StaticContext sctx, QueryContext ctx, Sequence[] args) {<NEW_LINE>final XmlDBNode doc = ((XmlDBNode) args[0]);<NEW_LINE>final NodeReadOnlyTrx rtx = doc.getTrx();<NEW_LINE>final XmlIndexController controller = (XmlIndexController) rtx.getResourceManager().<MASK><NEW_LINE>if (controller == null) {<NEW_LINE>throw new QueryException(new QNm("Document not found: " + ((Str) args[1]).stringValue()));<NEW_LINE>}<NEW_LINE>final int idx = FunUtil.getInt(args, 1, "$idx-no", -1, null, true);<NEW_LINE>final IndexDef indexDef = controller.getIndexes().getIndexDef(idx, IndexType.PATH);<NEW_LINE>if (indexDef == null) {<NEW_LINE>throw new QueryException(SDBFun.ERR_INDEX_NOT_FOUND, "Index no %s for collection %s and document %s not found.", idx, doc.getCollection().getName(), doc.getTrx().getResourceManager().getResourceConfig().getResource().getFileName().toString());<NEW_LINE>}<NEW_LINE>if (indexDef.getType() != IndexType.PATH) {<NEW_LINE>throw new QueryException(SDBFun.ERR_INVALID_INDEX_TYPE, "Index no %s for collection %s and document %s is not a path index.", idx, doc.getCollection().getName(), doc.getTrx().getResourceManager().getResourceConfig().getResource().getFileName().toString());<NEW_LINE>}<NEW_LINE>final String paths = FunUtil.getString(args, 2, "$paths", null, null, false);<NEW_LINE>final PathFilter filter = (paths != null) ? controller.createPathFilter(Set.of(paths.split(";")), doc.getTrx()) : null;<NEW_LINE>return getSequence(doc, controller.openPathIndex(doc.getTrx().getPageTrx(), indexDef, filter));<NEW_LINE>}
|
getRtxIndexController(rtx.getRevisionNumber());
|
656,687
|
private void init() {<NEW_LINE>this.setLayout(new BorderLayout());<NEW_LINE>// HEADER<NEW_LINE>Box boxV = Box.createVerticalBox();<NEW_LINE>// DIALS/HTML+Bars<NEW_LINE>Box boxH = Box.createHorizontalBox();<NEW_LINE>// DIALS<NEW_LINE>Box boxV1 = Box.createVerticalBox();<NEW_LINE>// HTML/Bars<NEW_LINE>Box boxV2 = Box.createVerticalBox();<NEW_LINE>// barChart<NEW_LINE>Box boxH1 = Box.createHorizontalBox();<NEW_LINE>// boxH_V.setPreferredSize(new Dimension(180, 1500));<NEW_LINE>// boxH1.setPreferredSize(new Dimension(400, 180));<NEW_LINE>boxV2.setPreferredSize(new Dimension(120, 120));<NEW_LINE>// DIALS below HEADER, LEFT<NEW_LINE>for (int i = 0; i < m_goals.length; i++) {<NEW_LINE>PerformanceIndicator pi = new PerformanceIndicator(m_goals[i]);<NEW_LINE>pi.addActionListener(this);<NEW_LINE>boxV1.add(pi, BorderLayout.NORTH);<NEW_LINE>}<NEW_LINE>boxV1.add(Box.<MASK><NEW_LINE>JScrollPane scrollPane = new JScrollPane();<NEW_LINE>scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);<NEW_LINE>scrollPane.getViewport().add(boxV1, BorderLayout.CENTER);<NEW_LINE>scrollPane.setMinimumSize(new Dimension(190, 180));<NEW_LINE>// RIGHT, HTML + Bars<NEW_LINE>HtmlDashboard contentHtml = new HtmlDashboard("http:///local/home", m_goals, true);<NEW_LINE>boxV2.add(contentHtml, BorderLayout.CENTER);<NEW_LINE>for (int i = 0; i < java.lang.Math.min(2, m_goals.length); i++) {<NEW_LINE>if (// MGoal goal = pi.getGoal();<NEW_LINE>m_goals[i].getMeasure() != null || m_goals[i].getAD_Chart_ID() > 0)<NEW_LINE>boxH1.add(new Graph(m_goals[i]), BorderLayout.SOUTH);<NEW_LINE>}<NEW_LINE>boxV2.add(boxH1, BorderLayout.SOUTH);<NEW_LINE>// below HEADER<NEW_LINE>boxH.add(scrollPane, BorderLayout.WEST);<NEW_LINE>// space<NEW_LINE>boxH.add(Box.createHorizontalStrut(5));<NEW_LINE>boxH.add(boxV2, BorderLayout.CENTER);<NEW_LINE>// HEADER + below<NEW_LINE>HtmlDashboard t = new HtmlDashboard("http:///local/logo", null, false);<NEW_LINE>t.setMaximumSize(new Dimension(2000, 80));<NEW_LINE>// t.setPreferredSize(new Dimension(200,10));<NEW_LINE>// t.setMaximumSize(new Dimension(2000,10));<NEW_LINE>boxV.add(t, BorderLayout.NORTH);<NEW_LINE>// space<NEW_LINE>boxV.add(Box.createVerticalStrut(5));<NEW_LINE>boxV.add(boxH, BorderLayout.CENTER);<NEW_LINE>boxV.add(Box.createVerticalGlue());<NEW_LINE>// WINDOW<NEW_LINE>add(boxV, BorderLayout.CENTER);<NEW_LINE>}
|
createVerticalGlue(), BorderLayout.CENTER);
|
279,036
|
public String stringValue(BLink parent) {<NEW_LINE>StringJoiner sj = new StringJoiner(",");<NEW_LINE>for (Map.Entry<K, V> kvEntry : this.entrySet()) {<NEW_LINE>K key = kvEntry.getKey();<NEW_LINE>V value = kvEntry.getValue();<NEW_LINE>if (value == null) {<NEW_LINE>sj.add("\"" + key + "\":null");<NEW_LINE>} else {<NEW_LINE>Type type = TypeChecker.getType(value);<NEW_LINE>CycleUtils.Node mapParent = new <MASK><NEW_LINE>switch(type.getTag()) {<NEW_LINE>case TypeTags.STRING_TAG:<NEW_LINE>case TypeTags.XML_TAG:<NEW_LINE>case TypeTags.XML_ELEMENT_TAG:<NEW_LINE>case TypeTags.XML_ATTRIBUTES_TAG:<NEW_LINE>case TypeTags.XML_COMMENT_TAG:<NEW_LINE>case TypeTags.XML_PI_TAG:<NEW_LINE>case TypeTags.XMLNS_TAG:<NEW_LINE>case TypeTags.XML_TEXT_TAG:<NEW_LINE>sj.add("\"" + key + "\":" + ((BValue) value).informalStringValue(mapParent));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>sj.add("\"" + key + "\":" + StringUtils.getStringValue(value, mapParent));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return "{" + sj.toString() + "}";<NEW_LINE>}
|
CycleUtils.Node(this, parent);
|
444,094
|
public void endVisit(SQLCaseExpr x) {<NEW_LINE>List<SQLCaseExpr.Item> whenList = x.getItems();<NEW_LINE>ArrayList<Item> args = new ArrayList<>();<NEW_LINE>int nCases, firstExprNum = -1, elseExprNum = -1;<NEW_LINE>for (SQLCaseExpr.Item when : whenList) {<NEW_LINE>args.add(getItem(when.getConditionExpr()));<NEW_LINE>args.add(getItem(when.getValueExpr()));<NEW_LINE>}<NEW_LINE>nCases = args.size();<NEW_LINE>// add compared<NEW_LINE>SQLExpr compared = x.getValueExpr();<NEW_LINE>if (compared != null) {<NEW_LINE>firstExprNum = args.size();<NEW_LINE>args.add(getItem(compared));<NEW_LINE>}<NEW_LINE>// add else exp<NEW_LINE>SQLExpr elseExpr = x.getElseExpr();<NEW_LINE>if (elseExpr != null) {<NEW_LINE>elseExprNum = args.size();<NEW_LINE>args<MASK><NEW_LINE>}<NEW_LINE>item = new ItemFuncCase(args, nCases, firstExprNum, elseExprNum, this.charsetIndex);<NEW_LINE>}
|
.add(getItem(elseExpr));
|
669,014
|
public DimensionValueContribution unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DimensionValueContribution dimensionValueContribution = new DimensionValueContribution();<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("DimensionValue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dimensionValueContribution.setDimensionValue(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("ContributionScore", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dimensionValueContribution.setContributionScore(context.getUnmarshaller(Double.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 dimensionValueContribution;<NEW_LINE>}
|
class).unmarshall(context));
|
1,572,505
|
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, 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 (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (serverName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (virtualNetworkRuleName == null) {<NEW_LINE>return Mono.<MASK><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>final String apiVersion = "2015-05-01-preview";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, serverName, virtualNetworkRuleName, this.client.getSubscriptionId(), apiVersion, context);<NEW_LINE>}
|
error(new IllegalArgumentException("Parameter virtualNetworkRuleName is required and cannot be null."));
|
1,711,491
|
private void processClassReferences(ObjectiveC2_State state) throws Exception {<NEW_LINE>state.monitor.setMessage("Objective-C 2.0 Class References...");<NEW_LINE>MemoryBlock block = state.program.getMemory().getBlock(ObjectiveC2_Constants.OBJC2_CLASS_REFS);<NEW_LINE>if (block == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ObjectiveC1_Utilities.clear(state, block);<NEW_LINE>long count = block.getSize() / state.pointerSize;<NEW_LINE>state.monitor.initialize((int) count);<NEW_LINE>Address address = block.getStart();<NEW_LINE>for (int i = 0; i < count; ++i) {<NEW_LINE>if (state.monitor.isCancelled()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>state.monitor.setProgress(i);<NEW_LINE>ObjectiveC1_Utilities.<MASK><NEW_LINE>address = address.add(state.pointerSize);<NEW_LINE>}<NEW_LINE>}
|
createPointerAndReturnAddressBeingReferenced(state.program, address);
|
1,545,259
|
private void checkResources(final String schemaName, final ShardingSphereMetaData shardingSphereMetaData, final ReadwriteSplittingRuleConfiguration currentRuleConfig) throws DistSQLException {<NEW_LINE>Collection<String> requireResources = new LinkedHashSet<>();<NEW_LINE>Collection<String> requireDiscoverableResources = new LinkedHashSet<>();<NEW_LINE>currentRuleConfig.getDataSources().forEach(each -> {<NEW_LINE>if (each.getAutoAwareDataSourceName().isPresent()) {<NEW_LINE>requireDiscoverableResources.add(each.getAutoAwareDataSourceName().get());<NEW_LINE>}<NEW_LINE>if (each.getWriteDataSourceName().isPresent()) {<NEW_LINE>requireResources.add(each.getWriteDataSourceName().get());<NEW_LINE>}<NEW_LINE>if (each.getReadDataSourceNames().isPresent()) {<NEW_LINE>requireResources.addAll(new InlineExpressionParser(each.getReadDataSourceNames().get()).splitAndEvaluate());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Collection<String> notExistResources = shardingSphereMetaData.getResource().getNotExistedResources(requireResources);<NEW_LINE>DistSQLException.predictionThrow(notExistResources.isEmpty(), () -> new RequiredResourceMissedException(schemaName, notExistResources));<NEW_LINE>Collection<<MASK><NEW_LINE>Collection<String> notExistLogicResources = requireDiscoverableResources.stream().filter(each -> !logicResources.contains(each)).collect(Collectors.toSet());<NEW_LINE>DistSQLException.predictionThrow(notExistLogicResources.isEmpty(), () -> new RequiredResourceMissedException(schemaName, notExistLogicResources));<NEW_LINE>}
|
String> logicResources = getLogicResources(shardingSphereMetaData);
|
139,282
|
public void upload2() throws NoSuchAlgorithmException {<NEW_LINE>// BEGIN: com.azure.storage.blob.specialized.BlockBlobAsyncClient.uploadWithResponse#Flux-long-BlobHttpHeaders-Map-AccessTier-byte-BlobRequestConditions<NEW_LINE>BlobHttpHeaders headers = new BlobHttpHeaders().setContentMd5("data".getBytes(StandardCharsets.UTF_8)).setContentLanguage("en-US").setContentType("binary");<NEW_LINE>Map<String, String> metadata = Collections.singletonMap("metadata", "value");<NEW_LINE>byte[] md5 = MessageDigest.getInstance("MD5").digest("data"<MASK><NEW_LINE>BlobRequestConditions requestConditions = new BlobRequestConditions().setLeaseId(leaseId).setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3));<NEW_LINE>client.uploadWithResponse(data, length, headers, metadata, AccessTier.HOT, md5, requestConditions).subscribe(response -> System.out.printf("Uploaded BlockBlob MD5 is %s%n", Base64.getEncoder().encodeToString(response.getValue().getContentMd5())));<NEW_LINE>// END: com.azure.storage.blob.specialized.BlockBlobAsyncClient.uploadWithResponse#Flux-long-BlobHttpHeaders-Map-AccessTier-byte-BlobRequestConditions<NEW_LINE>}
|
.getBytes(StandardCharsets.UTF_8));
|
788,106
|
public CreateFirewallResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateFirewallResult createFirewallResult = new CreateFirewallResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return createFirewallResult;<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("Firewall", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createFirewallResult.setFirewall(FirewallJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("FirewallStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createFirewallResult.setFirewallStatus(FirewallStatusJsonUnmarshaller.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 createFirewallResult;<NEW_LINE>}
|
int originalDepth = context.getCurrentDepth();
|
353,049
|
public static ImageResult postImage(final Geocache cache, final Image image) {<NEW_LINE>final IConnector connector = ConnectorFactory.getConnector(cache.getGeocode());<NEW_LINE>if (!(connector instanceof SuConnector)) {<NEW_LINE>return new ImageResult(StatusCode.LOGIMAGE_POST_ERROR, "");<NEW_LINE>}<NEW_LINE>final SuConnector gcsuConnector = (SuConnector) connector;<NEW_LINE>final File file = image.getFile();<NEW_LINE>if (file == null) {<NEW_LINE>return new ImageResult(StatusCode.LOGIMAGE_POST_ERROR, "");<NEW_LINE>}<NEW_LINE>final Parameters params = new Parameters("cacheID", cache.getCacheId());<NEW_LINE>FileInputStream fileStream = null;<NEW_LINE>try {<NEW_LINE>fileStream = new FileInputStream(file);<NEW_LINE>params.add("image", Base64.encodeToString(IOUtils.readFully(fileStream, (int) file.length()), DEFAULT));<NEW_LINE>params.add("caption", createImageCaption(image));<NEW_LINE>final ObjectNode data = postRequest(gcsuConnector, SuApiEndpoint.POST_IMAGE, params).data;<NEW_LINE>if (data != null && data.get("data").get("success").asBoolean()) {<NEW_LINE>return new ImageResult(StatusCode.NO_ERROR, data.get("data").get("image_url").asText());<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>IOUtils.closeQuietly(fileStream);<NEW_LINE>}<NEW_LINE>return new ImageResult(StatusCode.LOGIMAGE_POST_ERROR, "");<NEW_LINE>}
|
Log.e("SuApi.postLogImage", e);
|
1,082,482
|
private void process(OPCPackage xlsxPackage) throws IOException, OpenXML4JException, SAXException {<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>Map<Integer, Map<CellAddress, CellAddress>> <MASK><NEW_LINE>StringsCache stringsCache = new StringsCache();<NEW_LINE>try {<NEW_LINE>ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(xlsxPackage, stringsCache);<NEW_LINE>this.doReadSheet(xlsxPackage, (stream, index, sheetName) -> {<NEW_LINE>readConfig.startSheetConsumer.accept(sheetName, index);<NEW_LINE>ContentHandler handler = new XSSFSheetXMLHandler(mergeCellIndexMapping.getOrDefault(index, Collections.emptyMap()), strings, new XSSFSaxReadHandler<>(result, readConfig));<NEW_LINE>processSheet(handler, stream);<NEW_LINE>mergeCellIndexMapping.remove(index);<NEW_LINE>});<NEW_LINE>} finally {<NEW_LINE>stringsCache.clearAll();<NEW_LINE>}<NEW_LINE>log.info("Sax import takes {} ms", System.currentTimeMillis() - startTime);<NEW_LINE>}
|
mergeCellIndexMapping = this.processMerge(xlsxPackage);
|
1,275,392
|
public List<PreparedFetch> ranges(final Series series, final DateRange range) throws IOException {<NEW_LINE>final List<PreparedFetch> bases = new ArrayList<>();<NEW_LINE>final long start = calculateBaseTimestamp(range.getStart());<NEW_LINE>final long end = calculateBaseTimestamp(range.getEnd());<NEW_LINE>for (long currentBase = start; currentBase <= end; currentBase += MAX_WIDTH) {<NEW_LINE>final DateRange modified = range.modify(currentBase, currentBase + MAX_WIDTH);<NEW_LINE>if (modified.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final ByteBuffer key = ROW_KEY.serialize(<MASK><NEW_LINE>final int startColumn = calculateColumnKey(modified.start());<NEW_LINE>final int endColumn = calculateColumnKey(modified.end());<NEW_LINE>final long base = currentBase;<NEW_LINE>bases.add(new PreparedFetch() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public BoundStatement fetch(int limit) {<NEW_LINE>return fetch.bind(key, startColumn, endColumn, limit);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Transform<Row, Point> converter() {<NEW_LINE>return row -> {<NEW_LINE>final long timestamp = calculateAbsoluteTimestamp(base, row.getInt(0));<NEW_LINE>final double value = row.getDouble(1);<NEW_LINE>return new Point(timestamp, value);<NEW_LINE>};<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String toString() {<NEW_LINE>return modified.toString();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return bases;<NEW_LINE>}
|
new MetricsRowKey(series, currentBase));
|
887,253
|
private void init(@Nullable AttributeSet attrs) {<NEW_LINE>final TypedArray typedArray;<NEW_LINE>if (attrs != null) {<NEW_LINE>typedArray = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.ConversationItemFooter, 0, 0);<NEW_LINE>} else {<NEW_LINE>typedArray = null;<NEW_LINE>}<NEW_LINE>@LayoutRes<NEW_LINE>final int contentId;<NEW_LINE>if (typedArray != null) {<NEW_LINE>int mode = typedArray.getInt(R.styleable.ConversationItemFooter_footer_mode, 0);<NEW_LINE>isOutgoing = mode == 0;<NEW_LINE>if (isOutgoing) {<NEW_LINE>contentId = R.layout.conversation_item_footer_outgoing;<NEW_LINE>} else {<NEW_LINE>contentId = R.layout.conversation_item_footer_incoming;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>contentId = R.layout.conversation_item_footer_outgoing;<NEW_LINE>isOutgoing = true;<NEW_LINE>}<NEW_LINE>inflate(getContext(), contentId, this);<NEW_LINE>dateView = findViewById(R.id.footer_date);<NEW_LINE>simView = findViewById(R.id.footer_sim_info);<NEW_LINE>timerView = findViewById(R.id.footer_expiration_timer);<NEW_LINE>insecureIndicatorView = findViewById(R.id.footer_insecure_indicator);<NEW_LINE>deliveryStatusView = findViewById(R.id.footer_delivery_status);<NEW_LINE>audioDuration = findViewById(R.id.footer_audio_duration);<NEW_LINE>revealDot = findViewById(R.id.footer_revealed_dot);<NEW_LINE>playbackSpeedToggleTextView = findViewById(R.id.footer_audio_playback_speed_toggle);<NEW_LINE>if (typedArray != null) {<NEW_LINE>setTextColor(typedArray.getInt(R.styleable.ConversationItemFooter_footer_text_color, getResources().getColor(R.color.core_white)));<NEW_LINE>setIconColor(typedArray.getInt(R.styleable.ConversationItemFooter_footer_icon_color, getResources().getColor(R.color.core_white)));<NEW_LINE>setRevealDotColor(typedArray.getInt(R.styleable.ConversationItemFooter_footer_reveal_dot_color, getResources().getColor(R.color.core_white)));<NEW_LINE>typedArray.recycle();<NEW_LINE>}<NEW_LINE>dateView.addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {<NEW_LINE>if (oldLeft != left || oldRight != right) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
notifyTouchDelegateChanged(getPlaybackSpeedToggleTouchDelegateRect(), playbackSpeedToggleTextView);
|
56,745
|
public List<String> checkAssets(IProgress progress, boolean forceUpdate, boolean forceCheck) {<NEW_LINE>if (context.getAppInitializer().isAppVersionChanged()) {<NEW_LINE>copyMissingJSAssets();<NEW_LINE>}<NEW_LINE>String fv = Version.getFullVersion(context);<NEW_LINE>OsmandSettings settings = context.getSettings();<NEW_LINE>boolean versionChanged = !fv.equalsIgnoreCase(settings.PREVIOUS_INSTALLED_VERSION.get());<NEW_LINE>boolean overwrite = versionChanged || forceUpdate;<NEW_LINE>if (overwrite || forceCheck) {<NEW_LINE>File appDataDir = context.getAppPath(null);<NEW_LINE>appDataDir.mkdirs();<NEW_LINE>if (appDataDir.canWrite()) {<NEW_LINE>try {<NEW_LINE>progress.startTask(context.getString(R.string.installing_new_resources), -1);<NEW_LINE>AssetManager assetManager = context.getAssets();<NEW_LINE>boolean firstInstall = !settings.PREVIOUS_INSTALLED_VERSION.isSet();<NEW_LINE>unpackBundledAssets(assetManager, appDataDir, <MASK><NEW_LINE>settings.PREVIOUS_INSTALLED_VERSION.set(fv);<NEW_LINE>copyRegionsBoundaries(overwrite);<NEW_LINE>// see Issue #3381<NEW_LINE>// copyPoiTypes();<NEW_LINE>RendererRegistry registry = context.getRendererRegistry();<NEW_LINE>for (String internalStyle : registry.getInternalRenderers().keySet()) {<NEW_LINE>File file = registry.getFileForInternalStyle(internalStyle);<NEW_LINE>if (file.exists() && overwrite) {<NEW_LINE>registry.copyFileForInternalStyle(internalStyle);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SQLiteException | IOException | XmlPullParserException e) {<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.emptyList();<NEW_LINE>}
|
firstInstall || forceUpdate, overwrite, forceCheck);
|
369,472
|
private Placeable merge(Placeable data1, Placeable data2) {<NEW_LINE>if (data1 == null) {<NEW_LINE>return data2;<NEW_LINE>}<NEW_LINE>if (data2 == null) {<NEW_LINE>return data1;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (data1 instanceof BpmElement) {<NEW_LINE>return data1;<NEW_LINE>}<NEW_LINE>if (data2 instanceof BpmElement) {<NEW_LINE>final ConnectorPuzzleEmpty puz1 = (ConnectorPuzzleEmpty) data1;<NEW_LINE>if (puz1.checkDirections("SW")) {<NEW_LINE>((BpmElement) data2).remove(Where.NORTH);<NEW_LINE>((BpmElement) data2).append(Where.WEST);<NEW_LINE>}<NEW_LINE>return data2;<NEW_LINE>}<NEW_LINE>assert data1 instanceof ConnectorPuzzleEmpty && data2 instanceof ConnectorPuzzleEmpty;<NEW_LINE>final ConnectorPuzzleEmpty puz1 = (ConnectorPuzzleEmpty) data1;<NEW_LINE>final ConnectorPuzzleEmpty puz2 = (ConnectorPuzzleEmpty) data2;<NEW_LINE>return puz2;<NEW_LINE>}
|
assert data1 != null && data2 != null;
|
1,496,818
|
void initiateClose(boolean saveState) {<NEW_LINE>log.trace(<MASK><NEW_LINE>MinorCompactionTask mct = null;<NEW_LINE>synchronized (this) {<NEW_LINE>if (isClosed() || isClosing()) {<NEW_LINE>String msg = "Tablet " + getExtent() + " already " + closeState;<NEW_LINE>throw new IllegalStateException(msg);<NEW_LINE>}<NEW_LINE>// enter the closing state, no splits or minor compactions can start<NEW_LINE>closeState = CloseState.CLOSING;<NEW_LINE>this.notifyAll();<NEW_LINE>}<NEW_LINE>// Cancel any running compactions and prevent future ones from starting. This is very important<NEW_LINE>// because background compactions may update the metadata table. These metadata updates can not<NEW_LINE>// be allowed after a tablet closes. Compactable has its own lock and calls tablet code, so do<NEW_LINE>// not hold tablet lock while calling it.<NEW_LINE>compactable.close();<NEW_LINE>synchronized (this) {<NEW_LINE>Preconditions.checkState(closeState == CloseState.CLOSING);<NEW_LINE>while (updatingFlushID) {<NEW_LINE>try {<NEW_LINE>this.wait(50);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.error(e.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// calling this.wait() releases the lock, ensure things are as expected when the lock is<NEW_LINE>// obtained again<NEW_LINE>Preconditions.checkState(closeState == CloseState.CLOSING);<NEW_LINE>if (!saveState || getTabletMemory().getMemTable().getNumEntries() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>getTabletMemory().waitForMinC();<NEW_LINE>// calling this.wait() in waitForMinC() releases the lock, ensure things are as expected when<NEW_LINE>// the lock is obtained again<NEW_LINE>Preconditions.checkState(closeState == CloseState.CLOSING);<NEW_LINE>try {<NEW_LINE>mct = prepareForMinC(getFlushID(), MinorCompactionReason.CLOSE);<NEW_LINE>} catch (NoNodeException e) {<NEW_LINE>throw new RuntimeException("Exception on " + extent + " during prep for MinC", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// do minor compaction outside of synch block so that tablet can be read and written to while<NEW_LINE>// compaction runs<NEW_LINE>mct.run();<NEW_LINE>}
|
"initiateClose(saveState={}) {}", saveState, getExtent());
|
1,461,629
|
private Object extractWithPath(ObjectToJsonConverter pConverter, Collection pCollection, Stack<String> pPathParts, boolean pJsonify, String pPathPart, int pLength) throws AttributeNotFoundException {<NEW_LINE>try {<NEW_LINE>int idx = Integer.parseInt(pPathPart);<NEW_LINE>return pConverter.extractObject(getElement(pCollection, idx, pLength), pPathParts, pJsonify);<NEW_LINE>} catch (NumberFormatException exp) {<NEW_LINE><MASK><NEW_LINE>return faultHandler.handleException(new AttributeNotFoundException("Index '" + pPathPart + "' is not numeric for accessing list"));<NEW_LINE>} catch (IndexOutOfBoundsException exp) {<NEW_LINE>ValueFaultHandler faultHandler = pConverter.getValueFaultHandler();<NEW_LINE>return faultHandler.handleException(new AttributeNotFoundException("Index '" + pPathPart + "' is out-of-bound for a list of size " + pLength));<NEW_LINE>}<NEW_LINE>}
|
ValueFaultHandler faultHandler = pConverter.getValueFaultHandler();
|
1,485,032
|
private String loadProjectName() {<NEW_LINE>String appName = null;<NEW_LINE>InputStream in = null;<NEW_LINE>try {<NEW_LINE>in = Thread.currentThread().getContextClassLoader().getResourceAsStream(PROPERTIES_FILE);<NEW_LINE>if (in == null) {<NEW_LINE>in = Cat.class.getResourceAsStream(PROPERTIES_FILE);<NEW_LINE>}<NEW_LINE>if (in != null) {<NEW_LINE>Properties prop = new Properties();<NEW_LINE>prop.load(in);<NEW_LINE>appName = prop.getProperty("app.name");<NEW_LINE>if (appName != null) {<NEW_LINE>m_logger.info(String.format("Find domain name %s from app.properties.", appName));<NEW_LINE>} else {<NEW_LINE>m_logger.info(String.format("Can't find app.name from app.properties."));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>m_logger.info(String<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>m_logger.error(e.getMessage(), e);<NEW_LINE>} finally {<NEW_LINE>if (in != null) {<NEW_LINE>try {<NEW_LINE>in.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return appName;<NEW_LINE>}
|
.format("Can't find app.properties in %s", PROPERTIES_FILE));
|
533,338
|
final SearchGameSessionsResult executeSearchGameSessions(SearchGameSessionsRequest searchGameSessionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(searchGameSessionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SearchGameSessionsRequest> request = null;<NEW_LINE>Response<SearchGameSessionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SearchGameSessionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(searchGameSessionsRequest));<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, "SearchGameSessions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SearchGameSessionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SearchGameSessionsResultJsonUnmarshaller());<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, "GameLift");
|
1,733,401
|
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select * from SupportBean(2 = (select count(*) from SupportEventWithLongArray#unique(coll)))";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>sendSBAssertFilter(env, false);<NEW_LINE>env.sendEventBean(new SupportEventWithLongArray("E0", new long[<MASK><NEW_LINE>env.sendEventBean(new SupportEventWithLongArray("E1", new long[] { 1 }));<NEW_LINE>env.milestone(0);<NEW_LINE>sendSBAssertFilter(env, true);<NEW_LINE>env.sendEventBean(new SupportEventWithLongArray("E2", new long[] { 1, 2 }));<NEW_LINE>env.sendEventBean(new SupportEventWithLongArray("E3", new long[] { 1 }));<NEW_LINE>sendSBAssertFilter(env, true);<NEW_LINE>env.sendEventBean(new SupportEventWithLongArray("E4", new long[] { 3 }));<NEW_LINE>sendSBAssertFilter(env, false);<NEW_LINE>env.undeployAll();<NEW_LINE>}
|
] { 1, 2 }));
|
1,456,181
|
public static <T> PartitionMutableList<T> partitionWhile(ArrayList<T> list, Predicate<? super T> predicate) {<NEW_LINE><MASK><NEW_LINE>if (ArrayListIterate.isOptimizableArrayList(list, size)) {<NEW_LINE>PartitionMutableList<T> result = new PartitionFastList<T>();<NEW_LINE>MutableList<T> selected = result.getSelected();<NEW_LINE>T[] elements = ArrayListIterate.getInternalArray(list);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>T each = elements[i];<NEW_LINE>if (predicate.accept(each)) {<NEW_LINE>selected.add(each);<NEW_LINE>} else {<NEW_LINE>MutableList<T> rejected = result.getRejected();<NEW_LINE>rejected.add(each);<NEW_LINE>for (int j = i + 1; j < size; j++) {<NEW_LINE>rejected.add(elements[j]);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return RandomAccessListIterate.partitionWhile(list, predicate);<NEW_LINE>}
|
int size = list.size();
|
795,376
|
public Object schemaGet(String model) throws TimeoutException, ExecutionException, InterruptedException, ApiException {<NEW_LINE>Object postBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String path = "/schema";<NEW_LINE>// query params<NEW_LINE>List<Pair> queryParams = new ArrayList<Pair>();<NEW_LINE>// header params<NEW_LINE>Map<String, String> headerParams = new HashMap<String, String>();<NEW_LINE>// form params<NEW_LINE>Map<String, String> formParams = new HashMap<String, String>();<NEW_LINE>queryParams.addAll(ApiInvoker.parameterToPairs("", "model", model));<NEW_LINE>String[] contentTypes = { "application/json", "application/x-www-form-urlencoded" };<NEW_LINE>String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";<NEW_LINE>if (contentType.startsWith("multipart/form-data")) {<NEW_LINE>// file uploading<NEW_LINE><MASK><NEW_LINE>HttpEntity httpEntity = localVarBuilder.build();<NEW_LINE>postBody = httpEntity;<NEW_LINE>} else {<NEW_LINE>// normal form params<NEW_LINE>}<NEW_LINE>String[] authNames = new String[] {};<NEW_LINE>try {<NEW_LINE>String localVarResponse = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);<NEW_LINE>if (localVarResponse != null) {<NEW_LINE>return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} catch (ApiException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (ExecutionException ex) {<NEW_LINE>if (ex.getCause() instanceof VolleyError) {<NEW_LINE>VolleyError volleyError = (VolleyError) ex.getCause();<NEW_LINE>if (volleyError.networkResponse != null) {<NEW_LINE>throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw ex;<NEW_LINE>} catch (TimeoutException ex) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}
|
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
1,301,235
|
private String toNormalSQL(SQLShowTablesStatement ast) {<NEW_LINE>SQLName database = ast.getDatabase();<NEW_LINE><MASK><NEW_LINE>// for mysql<NEW_LINE>boolean full = ast.isFull();<NEW_LINE>SQLExpr where = ast.getWhere();<NEW_LINE>List<String[]> strings = full ? Arrays.asList(new String[] { "TABLE_NAME", "`Tables_in_" + SQLUtils.normalize(database.getSimpleName()) + "`" }, new String[] { "TABLE_TYPE", "Table_type" }) : Collections.singletonList(new String[] { "TABLE_NAME", "`Tables_in_" + SQLUtils.normalize(database.getSimpleName()) + "`" });<NEW_LINE>return generateSimpleSQL(strings, "INFORMATION_SCHEMA", "TABLES", "TABLE_SCHEMA = '" + SQLUtils.normalize(database.getSimpleName()).toLowerCase() + "'", Optional.ofNullable(where).map(i -> i.toString()).orElse(null), Optional.ofNullable(like).map(i -> "TABLE_NAME like " + i.toString()).orElse(null)).toString();<NEW_LINE>}
|
SQLExpr like = ast.getLike();
|
974,851
|
private void export(XlsxBorderInfo info) {<NEW_LINE>// if(info.hasBorder())<NEW_LINE>{<NEW_LINE>write("<border");<NEW_LINE>if (info.getDirection() != null) {<NEW_LINE>write(info.getDirection().equals(LineDirectionEnum.TOP_DOWN) ? " diagonalDown=\"1\"" : " diagonalUp=\"1\"");<NEW_LINE>}<NEW_LINE>write(">");<NEW_LINE>exportBorder(info, XlsxBorderInfo.LEFT_BORDER);<NEW_LINE>exportBorder(info, XlsxBorderInfo.RIGHT_BORDER);<NEW_LINE>exportBorder(info, XlsxBorderInfo.TOP_BORDER);<NEW_LINE><MASK><NEW_LINE>exportBorder(info, XlsxBorderInfo.DIAGONAL_BORDER);<NEW_LINE>write("</border>\n");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// write(" <w:tcMar>\n");<NEW_LINE>// exportPadding(info, BorderInfo.TOP_BORDER);<NEW_LINE>// exportPadding(info, BorderInfo.LEFT_BORDER);<NEW_LINE>// exportPadding(info, BorderInfo.BOTTOM_BORDER);<NEW_LINE>// exportPadding(info, BorderInfo.RIGHT_BORDER);<NEW_LINE>// write(" </w:tcMar>\n");<NEW_LINE>}
|
exportBorder(info, XlsxBorderInfo.BOTTOM_BORDER);
|
1,188,593
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {<NEW_LINE>if (holder instanceof HeaderStatusViewHolder) {<NEW_LINE>HeaderStatusViewHolder viewHolder = (HeaderStatusViewHolder) holder;<NEW_LINE>viewHolder.bindView(this, status, nightMode);<NEW_LINE>} else if (holder instanceof WarningViewHolder) {<NEW_LINE>boolean hideBottomPadding = false;<NEW_LINE>if (items.size() > position + 1) {<NEW_LINE>Object item = items.get(position + 1);<NEW_LINE>hideBottomPadding = Algorithms.objectEquals(item, ACTION_BUTTON_TYPE) || item instanceof SettingsItem || item instanceof Pair;<NEW_LINE>}<NEW_LINE>WarningViewHolder viewHolder = (WarningViewHolder) holder;<NEW_LINE>viewHolder.bindView(status, error, hideBottomPadding);<NEW_LINE>} else if (holder instanceof ConflictViewHolder) {<NEW_LINE>Pair<LocalFile, RemoteFile> pair = (Pair<LocalFile, RemoteFile>) items.get(position);<NEW_LINE>ConflictViewHolder viewHolder = (ConflictViewHolder) holder;<NEW_LINE>viewHolder.bindView(pair, fragment, fragment, nightMode);<NEW_LINE>} else if (holder instanceof ItemViewHolder) {<NEW_LINE>boolean lastBackupItem = false;<NEW_LINE>if (items.size() > position + 1) {<NEW_LINE>Object item = items.get(position + 1);<NEW_LINE>lastBackupItem = !(item instanceof SettingsItem) && !(item instanceof Pair);<NEW_LINE>}<NEW_LINE>SettingsItem item = (SettingsItem) items.get(position);<NEW_LINE>ItemViewHolder viewHolder = (ItemViewHolder) holder;<NEW_LINE>viewHolder.bindView(item, lastBackupItem, info.itemsToDelete.contains(item));<NEW_LINE>} else if (holder instanceof ActionButtonViewHolder) {<NEW_LINE>ActionButtonViewHolder viewHolder = (ActionButtonViewHolder) holder;<NEW_LINE>viewHolder.bindView(mapActivity, backup, fragment, uploadItemsVisible, nightMode);<NEW_LINE>} else if (holder instanceof LocalBackupViewHolder) {<NEW_LINE>LocalBackupViewHolder viewHolder = (LocalBackupViewHolder) holder;<NEW_LINE><MASK><NEW_LINE>} else if (holder instanceof RestoreBackupViewHolder) {<NEW_LINE>RestoreBackupViewHolder viewHolder = (RestoreBackupViewHolder) holder;<NEW_LINE>viewHolder.bindView(mapActivity, nightMode);<NEW_LINE>} else if (holder instanceof IntroductionViewHolder) {<NEW_LINE>IntroductionViewHolder viewHolder = (IntroductionViewHolder) holder;<NEW_LINE>viewHolder.bindView(mapActivity, fragment, backup, dialogType, nightMode);<NEW_LINE>}<NEW_LINE>}
|
viewHolder.bindView(mapActivity, nightMode);
|
679,337
|
public static ListUsersOfRoleResponse unmarshall(ListUsersOfRoleResponse listUsersOfRoleResponse, UnmarshallerContext context) {<NEW_LINE>listUsersOfRoleResponse.setRequestId(context.stringValue("ListUsersOfRoleResponse.RequestId"));<NEW_LINE>listUsersOfRoleResponse.setSuccess(context.booleanValue("ListUsersOfRoleResponse.Success"));<NEW_LINE>listUsersOfRoleResponse.setCode(context.stringValue("ListUsersOfRoleResponse.Code"));<NEW_LINE>listUsersOfRoleResponse.setMessage(context.stringValue("ListUsersOfRoleResponse.Message"));<NEW_LINE>listUsersOfRoleResponse.setHttpStatusCode(context.integerValue("ListUsersOfRoleResponse.HttpStatusCode"));<NEW_LINE>Users users = new Users();<NEW_LINE>users.setTotalCount(context.integerValue("ListUsersOfRoleResponse.Users.TotalCount"));<NEW_LINE>users.setPageNumber(context.integerValue("ListUsersOfRoleResponse.Users.PageNumber"));<NEW_LINE>users.setPageSize(context.integerValue("ListUsersOfRoleResponse.Users.PageSize"));<NEW_LINE>List<User> list = new ArrayList<User>();<NEW_LINE>for (int i = 0; i < context.lengthValue("ListUsersOfRoleResponse.Users.List.Length"); i++) {<NEW_LINE>User user = new User();<NEW_LINE>user.setUserId(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].UserId"));<NEW_LINE>user.setRamId(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].RamId"));<NEW_LINE>user.setInstanceId(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].InstanceId"));<NEW_LINE>Detail detail = new Detail();<NEW_LINE>detail.setLoginName(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].Detail.LoginName"));<NEW_LINE>detail.setDisplayName(context.stringValue<MASK><NEW_LINE>detail.setPhone(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].Detail.Phone"));<NEW_LINE>detail.setEmail(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].Detail.Email"));<NEW_LINE>detail.setDepartment(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].Detail.Department"));<NEW_LINE>user.setDetail(detail);<NEW_LINE>List<SkillLevel> skillLevels = new ArrayList<SkillLevel>();<NEW_LINE>for (int j = 0; j < context.lengthValue("ListUsersOfRoleResponse.Users.List[" + i + "].SkillLevels.Length"); j++) {<NEW_LINE>SkillLevel skillLevel = new SkillLevel();<NEW_LINE>skillLevel.setSkillLevelId(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].SkillLevels[" + j + "].SkillLevelId"));<NEW_LINE>skillLevel.setLevel(context.integerValue("ListUsersOfRoleResponse.Users.List[" + i + "].SkillLevels[" + j + "].Level"));<NEW_LINE>Skill skill = new Skill();<NEW_LINE>skill.setSkillGroupId(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].SkillLevels[" + j + "].Skill.SkillGroupId"));<NEW_LINE>skill.setInstanceId(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].SkillLevels[" + j + "].Skill.InstanceId"));<NEW_LINE>skill.setSkillGroupName(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].SkillLevels[" + j + "].Skill.SkillGroupName"));<NEW_LINE>skill.setSkillGroupDescription(context.stringValue("ListUsersOfRoleResponse.Users.List[" + i + "].SkillLevels[" + j + "].Skill.SkillGroupDescription"));<NEW_LINE>skillLevel.setSkill(skill);<NEW_LINE>skillLevels.add(skillLevel);<NEW_LINE>}<NEW_LINE>user.setSkillLevels(skillLevels);<NEW_LINE>list.add(user);<NEW_LINE>}<NEW_LINE>users.setList(list);<NEW_LINE>listUsersOfRoleResponse.setUsers(users);<NEW_LINE>return listUsersOfRoleResponse;<NEW_LINE>}
|
("ListUsersOfRoleResponse.Users.List[" + i + "].Detail.DisplayName"));
|
1,672,529
|
public Vulnerability updateVulnerability(Vulnerability transientVulnerability, boolean commitIndex) {<NEW_LINE>final Vulnerability vulnerability;<NEW_LINE>if (transientVulnerability.getId() > 0) {<NEW_LINE>vulnerability = getObjectById(Vulnerability.class, transientVulnerability.getId());<NEW_LINE>} else {<NEW_LINE>vulnerability = getVulnerabilityByVulnId(transientVulnerability.getSource(), transientVulnerability.getVulnId());<NEW_LINE>}<NEW_LINE>if (vulnerability != null) {<NEW_LINE>vulnerability.setCreated(transientVulnerability.getCreated());<NEW_LINE>vulnerability.setPublished(transientVulnerability.getPublished());<NEW_LINE>vulnerability.setUpdated(transientVulnerability.getUpdated());<NEW_LINE>vulnerability.setVulnId(transientVulnerability.getVulnId());<NEW_LINE>vulnerability.setSource(transientVulnerability.getSource());<NEW_LINE>vulnerability.setCredits(transientVulnerability.getCredits());<NEW_LINE>vulnerability.setVulnerableVersions(transientVulnerability.getVulnerableVersions());<NEW_LINE>vulnerability.setPatchedVersions(transientVulnerability.getPatchedVersions());<NEW_LINE>vulnerability.<MASK><NEW_LINE>vulnerability.setDetail(transientVulnerability.getDetail());<NEW_LINE>vulnerability.setTitle(transientVulnerability.getTitle());<NEW_LINE>vulnerability.setSubTitle(transientVulnerability.getSubTitle());<NEW_LINE>vulnerability.setReferences(transientVulnerability.getReferences());<NEW_LINE>vulnerability.setRecommendation(transientVulnerability.getRecommendation());<NEW_LINE>vulnerability.setSeverity(transientVulnerability.getSeverity());<NEW_LINE>vulnerability.setCvssV2Vector(transientVulnerability.getCvssV2Vector());<NEW_LINE>vulnerability.setCvssV2BaseScore(transientVulnerability.getCvssV2BaseScore());<NEW_LINE>vulnerability.setCvssV2ImpactSubScore(transientVulnerability.getCvssV2ImpactSubScore());<NEW_LINE>vulnerability.setCvssV2ExploitabilitySubScore(transientVulnerability.getCvssV2ExploitabilitySubScore());<NEW_LINE>vulnerability.setCvssV3Vector(transientVulnerability.getCvssV3Vector());<NEW_LINE>vulnerability.setCvssV3BaseScore(transientVulnerability.getCvssV3BaseScore());<NEW_LINE>vulnerability.setCvssV3ImpactSubScore(transientVulnerability.getCvssV3ImpactSubScore());<NEW_LINE>vulnerability.setCvssV3ExploitabilitySubScore(transientVulnerability.getCvssV3ExploitabilitySubScore());<NEW_LINE>vulnerability.setCwes(transientVulnerability.getCwes());<NEW_LINE>if (transientVulnerability.getVulnerableSoftware() != null) {<NEW_LINE>vulnerability.setVulnerableSoftware(transientVulnerability.getVulnerableSoftware());<NEW_LINE>}<NEW_LINE>final Vulnerability result = persist(vulnerability);<NEW_LINE>Event.dispatch(new IndexEvent(IndexEvent.Action.UPDATE, pm.detachCopy(result)));<NEW_LINE>commitSearchIndex(commitIndex, Vulnerability.class);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
|
setDescription(transientVulnerability.getDescription());
|
1,354,396
|
public Label visit(SubqueryWrapperLabel subqueryWrapperLabel) {<NEW_LINE>// Visit all subquery<NEW_LINE>final SubqueryWrapperLabel visited = ((SubqueryWrapperLabel) super.visit(subqueryWrapperLabel)).subqueryAccept(this);<NEW_LINE>final List<RelDataTypeField> fields = new ArrayList<>();<NEW_LINE>final List<Pair<Label, ImmutableBitSet>> inputBitSets = new ArrayList<>();<NEW_LINE>final List<RexNode> predicates = new ArrayList<>();<NEW_LINE>final Map<? extends Label, RexPermuteInputsShuttle> inputPermuteMap = PredicateUtil.mergePullUpPredicates(visited, fields, inputBitSets, predicates);<NEW_LINE>final SargableConditionInference inference = PredicateUtil.infer(visited, predicates, fields, context);<NEW_LINE>final Map<String, RexNode<MASK><NEW_LINE>// Classify and permute inferred predicates<NEW_LINE>final Map<Label, List<RexNode>> classified = PredicateUtil.dispatchAndPermute(valuePredicates, inputBitSets, inputPermuteMap, l -> l instanceof SubqueryLabel);<NEW_LINE>// Merge pull up predicates<NEW_LINE>final List<PredicateNode> pullUp = new ArrayList<>(visited.getPredicates());<NEW_LINE>final List<RexNode> inferredPullUp = classified.get(visited);<NEW_LINE>if (null != inferredPullUp && !inferredPullUp.isEmpty()) {<NEW_LINE>pullUp.add(new PredicateNode(context.labelBuilder().baseOf(visited), null, inferredPullUp, context));<NEW_LINE>}<NEW_LINE>final Map<String, RexNode> pullUps = PredicateUtil.pullUp(pullUp, visited);<NEW_LINE>if (!pullUps.isEmpty()) {<NEW_LINE>visited.setPullUp(new PredicateNode(visited, null, pullUps, context));<NEW_LINE>}<NEW_LINE>relLabelMap.put(visited.getRel(), visited);<NEW_LINE>return visited;<NEW_LINE>}
|
> valuePredicates = inference.allValuePredicate();
|
1,487,417
|
// </editor-fold>//GEN-END:initComponents<NEW_LINE>private void targetComboBoxActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_targetComboBoxActionPerformed<NEW_LINE>String selection = (String) targetComboBox.getSelectedItem();<NEW_LINE>if (selection == null) {<NEW_LINE>// Why? Not sure. #45097.<NEW_LINE>selection = "";<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>StringTokenizer tok <MASK><NEW_LINE>List<String> targetsL = Collections.list(NbCollections.checkedEnumerationByFilter(tok, String.class, true));<NEW_LINE>String description = "";<NEW_LINE>if (targetsL.size() == 1) {<NEW_LINE>String targetName = targetsL.get(0);<NEW_LINE>for (TargetLister.Target target : allTargets) {<NEW_LINE>if (!target.isOverridden() && target.getName().equals(targetName)) {<NEW_LINE>// NOI18N<NEW_LINE>description = target.getElement().getAttribute("description");<NEW_LINE>// may still be "" if not defined<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>targetDescriptionField.setText(description);<NEW_LINE>}
|
= new StringTokenizer(selection, " ,");
|
496,658
|
final boolean add(T entry) {<NEW_LINE>T[] a = array;<NEW_LINE>if (a == terminated()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>synchronized (this) {<NEW_LINE>a = array;<NEW_LINE>if (a == terminated()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int idx = pollFree();<NEW_LINE>if (idx < 0) {<NEW_LINE>int n = a.length;<NEW_LINE>T[] b = n != 0 ? newArray(n <MASK><NEW_LINE>System.arraycopy(a, 0, b, 0, n);<NEW_LINE>array = b;<NEW_LINE>a = b;<NEW_LINE>int m = b.length;<NEW_LINE>int[] u = new int[m];<NEW_LINE>for (int i = n + 1; i < m; i++) {<NEW_LINE>u[i] = i;<NEW_LINE>}<NEW_LINE>free = u;<NEW_LINE>consumerIndex = n + 1;<NEW_LINE>producerIndex = m;<NEW_LINE>idx = n;<NEW_LINE>}<NEW_LINE>setIndex(entry, idx);<NEW_LINE>// make sure entry is released<NEW_LINE>SIZE.lazySet(this, size);<NEW_LINE>a[idx] = entry;<NEW_LINE>SIZE.lazySet(this, size + 1);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
<< 1) : newArray(4);
|
662,218
|
// static jobjectArray NativeGetResourceStringArray(JNIEnv* env, jclass /*clazz*/, jlong ptr,<NEW_LINE>// jint resid) {<NEW_LINE>@Implementation(minSdk = P)<NEW_LINE>@Nullable<NEW_LINE>protected static String[] nativeGetResourceStringArray(long ptr, @ArrayRes int resid) {<NEW_LINE>CppAssetManager2 assetmanager = AssetManagerFromLong(ptr);<NEW_LINE>ResolvedBag bag = assetmanager.GetBag(resid);<NEW_LINE>if (bag == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String[] array = new String[bag.entry_count];<NEW_LINE>if (array == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < bag.entry_count; i++) {<NEW_LINE>ResolvedBag.Entry entry = bag.entries[i];<NEW_LINE>// Resolve any references to their final value.<NEW_LINE>final Ref<Res_value> value = new Ref<>(entry.value);<NEW_LINE>final Ref<ResTable_config> selected_config = new Ref<>(null);<NEW_LINE>final Ref<Integer> flags = new Ref<>(0);<NEW_LINE>final Ref<Integer> ref = new Ref<>(0);<NEW_LINE>ApkAssetsCookie cookie = assetmanager.ResolveReference(entry.cookie, <MASK><NEW_LINE>if (cookie.intValue() == kInvalidCookie) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (value.get().dataType == Res_value.TYPE_STRING) {<NEW_LINE>CppApkAssets apk_assets = assetmanager.GetApkAssets().get(cookie.intValue());<NEW_LINE>ResStringPool pool = apk_assets.GetLoadedArsc().GetStringPool();<NEW_LINE>String java_string = null;<NEW_LINE>String str_utf8 = pool.stringAt(value.get().data);<NEW_LINE>if (str_utf8 != null) {<NEW_LINE>java_string = str_utf8;<NEW_LINE>} else {<NEW_LINE>String str_utf16 = pool.stringAt(value.get().data);<NEW_LINE>java_string = str_utf16;<NEW_LINE>}<NEW_LINE>// // Check for errors creating the strings (if malformed or no memory).<NEW_LINE>// if (env.ExceptionCheck()) {<NEW_LINE>// return null;<NEW_LINE>// }<NEW_LINE>// env.SetObjectArrayElement(array, i, java_string);<NEW_LINE>array[i] = java_string;<NEW_LINE>// If we have a large amount of string in our array, we might overflow the<NEW_LINE>// local reference table of the VM.<NEW_LINE>// env.DeleteLocalRef(java_string);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return array;<NEW_LINE>}
|
value, selected_config, flags, ref);
|
875,946
|
private static boolean canBlinkTo(@Nonnull BlockPos bc, @Nonnull World w, @Nonnull Vec3d start, @Nonnull Vec3d target) {<NEW_LINE>RayTraceResult p = w.rayTraceBlocks(start, target, !TeleportConfig.enableBlinkNonSolidBlocks.get());<NEW_LINE>if (p != null) {<NEW_LINE>if (!TeleportConfig.enableBlinkNonSolidBlocks.get()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>IBlockState bs = w.<MASK><NEW_LINE>Block block = bs.getBlock();<NEW_LINE>if (isClear(w, bs, block, p.getBlockPos())) {<NEW_LINE>if (BlockCoord.get(p).equals(bc)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// need to step<NEW_LINE>Vector3d sv = new Vector3d(start.x, start.y, start.z);<NEW_LINE>Vector3d rayDir = new Vector3d(target.x, target.y, target.z);<NEW_LINE>rayDir.sub(sv);<NEW_LINE>rayDir.normalize();<NEW_LINE>rayDir.add(sv);<NEW_LINE>return canBlinkTo(bc, w, new Vec3d(rayDir.x, rayDir.y, rayDir.z), target);<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
getBlockState(p.getBlockPos());
|
1,379,439
|
private void checkPfadName() {<NEW_LINE>String pfad = ((JTextComponent) jComboBoxPath.getEditor().<MASK><NEW_LINE>String name = jTextFieldName.getText();<NEW_LINE>String p;<NEW_LINE>if (pfad.endsWith(File.separator)) {<NEW_LINE>p = pfad.substring(0, pfad.length() - 1);<NEW_LINE>} else {<NEW_LINE>p = pfad;<NEW_LINE>}<NEW_LINE>String pfadName = GuiFunktionen.concatPaths(p, name);<NEW_LINE>try {<NEW_LINE>File file = new File(pfadName);<NEW_LINE>if (file.exists()) {<NEW_LINE>jLabelExists.setForeground(MVColor.DOWNLOAD_DATEINAME_EXISTIERT.color);<NEW_LINE>jLabelExists.setText("Datei existiert schon!");<NEW_LINE>} else if (!jTextFieldName.getText().equals(datenDownload.arr[DatenDownload.DOWNLOAD_ZIEL_DATEINAME]) || !(((JTextComponent) jComboBoxPath.getEditor().getEditorComponent()).getText()).equals(datenDownload.arr[DatenDownload.DOWNLOAD_ZIEL_PFAD])) {<NEW_LINE>jLabelExists.setForeground(MVColor.DOWNLOAD_DATEINAME_NEU.color);<NEW_LINE>jLabelExists.setText("Neuer Name");<NEW_LINE>} else {<NEW_LINE>jLabelExists.setForeground(MVColor.DOWNLOAD_DATEINAME_ALT.color);<NEW_LINE>jLabelExists.setText("");<NEW_LINE>}<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}
|
getEditorComponent()).getText();
|
1,392,433
|
public static ListDeployGroupResponse unmarshall(ListDeployGroupResponse listDeployGroupResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDeployGroupResponse.setRequestId(_ctx.stringValue("ListDeployGroupResponse.RequestId"));<NEW_LINE>listDeployGroupResponse.setCode(_ctx.integerValue("ListDeployGroupResponse.Code"));<NEW_LINE>listDeployGroupResponse.setMessage(_ctx.stringValue("ListDeployGroupResponse.Message"));<NEW_LINE>List<DeployGroup> deployGroupList = new ArrayList<DeployGroup>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDeployGroupResponse.DeployGroupList.Length"); i++) {<NEW_LINE>DeployGroup deployGroup = new DeployGroup();<NEW_LINE>deployGroup.setGroupId(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].GroupId"));<NEW_LINE>deployGroup.setGroupName(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].GroupName"));<NEW_LINE>deployGroup.setAppId(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].AppId"));<NEW_LINE>deployGroup.setPackageVersionId(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].PackageVersionId"));<NEW_LINE>deployGroup.setAppVersionId(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].AppVersionId"));<NEW_LINE>deployGroup.setGroupType(_ctx.integerValue("ListDeployGroupResponse.DeployGroupList[" + i + "].GroupType"));<NEW_LINE>deployGroup.setClusterId(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].ClusterId"));<NEW_LINE>deployGroup.setCreateTime(_ctx.longValue("ListDeployGroupResponse.DeployGroupList[" + i + "].CreateTime"));<NEW_LINE>deployGroup.setUpdateTime(_ctx.longValue("ListDeployGroupResponse.DeployGroupList[" + i + "].UpdateTime"));<NEW_LINE>deployGroup.setNameSpace(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].NameSpace"));<NEW_LINE>deployGroup.setClusterName(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].ClusterName"));<NEW_LINE>deployGroup.setLastUpdateTime(_ctx.longValue("ListDeployGroupResponse.DeployGroupList[" + i + "].LastUpdateTime"));<NEW_LINE>deployGroup.setPreStop(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].PreStop"));<NEW_LINE>deployGroup.setPostStart(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].PostStart"));<NEW_LINE>deployGroup.setPackageUrl(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].PackageUrl"));<NEW_LINE>deployGroup.setEnv(_ctx.stringValue<MASK><NEW_LINE>deployGroup.setLabels(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].Labels"));<NEW_LINE>deployGroup.setSelector(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].Selector"));<NEW_LINE>deployGroup.setStrategy(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].Strategy"));<NEW_LINE>deployGroup.setStatus(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].Status"));<NEW_LINE>deployGroup.setReversion(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].Reversion"));<NEW_LINE>deployGroup.setCsClusterId(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].CsClusterId"));<NEW_LINE>deployGroup.setBaseComponentMetaName(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].BaseComponentMetaName"));<NEW_LINE>deployGroup.setDeploymentName(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].DeploymentName"));<NEW_LINE>deployGroup.setCpuLimit(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].CpuLimit"));<NEW_LINE>deployGroup.setMemoryLimit(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].MemoryLimit"));<NEW_LINE>deployGroup.setPackagePublicUrl(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].PackagePublicUrl"));<NEW_LINE>deployGroup.setPackageVersion(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].PackageVersion"));<NEW_LINE>deployGroup.setCpuRequest(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].CpuRequest"));<NEW_LINE>deployGroup.setMemoryRequest(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].MemoryRequest"));<NEW_LINE>deployGroup.setVServerGroupId(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].VServerGroupId"));<NEW_LINE>deployGroup.setVExtServerGroupId(_ctx.stringValue("ListDeployGroupResponse.DeployGroupList[" + i + "].VExtServerGroupId"));<NEW_LINE>deployGroupList.add(deployGroup);<NEW_LINE>}<NEW_LINE>listDeployGroupResponse.setDeployGroupList(deployGroupList);<NEW_LINE>return listDeployGroupResponse;<NEW_LINE>}
|
("ListDeployGroupResponse.DeployGroupList[" + i + "].Env"));
|
1,199,427
|
public GridBoundsChange performAction(GridManager gridManager, DesignerContext context) {<NEW_LINE>GridInfoProvider gridInfo = gridManager.getGridInfo();<NEW_LINE>boolean gapSupport = gridInfo.hasGaps();<NEW_LINE>int[] originalColumnBounds = gridInfo.getColumnBounds();<NEW_LINE>int[] originalRowBounds = gridInfo.getRowBounds();<NEW_LINE>int column = context.getFocusedColumn();<NEW_LINE>GridUtils.removePaddingComponents(gridManager);<NEW_LINE>gridManager.deleteColumn(column);<NEW_LINE>GridUtils.addPaddingComponents(gridManager, originalColumnBounds.length - 1 - (gapSupport ? 2 : 1), originalRowBounds.length - 1);<NEW_LINE>GridUtils.revalidateGrid(gridManager);<NEW_LINE>int[] newColumnBounds = gridInfo.getColumnBounds();<NEW_LINE>int[<MASK><NEW_LINE>int[] columnBounds;<NEW_LINE>if (column == originalColumnBounds.length - 2) {<NEW_LINE>// The last column deleted<NEW_LINE>columnBounds = newColumnBounds;<NEW_LINE>} else {<NEW_LINE>columnBounds = new int[newColumnBounds.length + (gapSupport ? 2 : 1)];<NEW_LINE>if (gapSupport) {<NEW_LINE>System.arraycopy(newColumnBounds, 0, columnBounds, 0, column + 1);<NEW_LINE>columnBounds[column + 1] = columnBounds[column];<NEW_LINE>columnBounds[column + 2] = columnBounds[column];<NEW_LINE>System.arraycopy(newColumnBounds, column + 1, columnBounds, column + 3, newColumnBounds.length - column - 1);<NEW_LINE>} else {<NEW_LINE>System.arraycopy(newColumnBounds, 0, columnBounds, 0, column + 1);<NEW_LINE>columnBounds[column + 1] = columnBounds[column];<NEW_LINE>System.arraycopy(newColumnBounds, column + 1, columnBounds, column + 2, newColumnBounds.length - column - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new GridBoundsChange(originalColumnBounds, originalRowBounds, columnBounds, newRowBounds);<NEW_LINE>}
|
] newRowBounds = gridInfo.getRowBounds();
|
1,727,686
|
public void marshall(APNSChannelResponse aPNSChannelResponse, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (aPNSChannelResponse == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getApplicationId(), APPLICATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getCreationDate(), CREATIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getDefaultAuthenticationMethod(), DEFAULTAUTHENTICATIONMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getEnabled(), ENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getHasCredential(), HASCREDENTIAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getHasTokenKey(), HASTOKENKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getIsArchived(), ISARCHIVED_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getLastModifiedBy(), LASTMODIFIEDBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getLastModifiedDate(), LASTMODIFIEDDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getPlatform(), PLATFORM_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getVersion(), VERSION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
|
e.getMessage(), e);
|
189,910
|
List<PathMatcher> compilePattern(List<String> patternStrings, final String separator) {<NEW_LINE>if (CollectionUtils.isEmpty(patternStrings)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final List<PathMatcher> pathMatchers = new ArrayList<>(patternStrings.size());<NEW_LINE>for (String patternString : patternStrings) {<NEW_LINE>final int prefixEnd = patternString.indexOf(":");<NEW_LINE>if (prefixEnd != -1) {<NEW_LINE>final String prefix = patternString.substring(0, prefixEnd).trim();<NEW_LINE>if (prefix.equals(ANT_STYLE_PATTERN_PREFIX)) {<NEW_LINE>final String trimmed = patternString.substring(prefixEnd + 1).trim();<NEW_LINE>if (!trimmed.isEmpty()) {<NEW_LINE>pathMatchers.add(new AntPathMatcher(trimmed, separator));<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>} else if (prefix.equals(REGEX_PATTERN_PREFIX)) {<NEW_LINE>final String trimmed = patternString.substring(prefixEnd + 1).trim();<NEW_LINE>if (!trimmed.isEmpty()) {<NEW_LINE>final Pattern <MASK><NEW_LINE>pathMatchers.add(new RegexPathMatcher(pattern));<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Pattern pattern = Pattern.compile(patternString);<NEW_LINE>pathMatchers.add(new RegexPathMatcher(pattern));<NEW_LINE>}<NEW_LINE>return pathMatchers;<NEW_LINE>}
|
pattern = Pattern.compile(trimmed);
|
802,169
|
public com.amazonaws.services.cloudtrail.model.InvalidEventDataStoreStatusException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.cloudtrail.model.InvalidEventDataStoreStatusException invalidEventDataStoreStatusException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return invalidEventDataStoreStatusException;<NEW_LINE>}
|
cloudtrail.model.InvalidEventDataStoreStatusException(null);
|
894,181
|
private void insertTime(final Dialog dialog, final JButton appendButton) {<NEW_LINE>FormattedDate date = getCalendarDate();<NEW_LINE>final String dateAsString = dateFormat.formatObject(date).toString();<NEW_LINE>final Window parentWindow;<NEW_LINE>if (dialog != null) {<NEW_LINE>parentWindow = (Window) dialog.getParent();<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final Component mostRecentFocusOwner = parentWindow.getMostRecentFocusOwner();<NEW_LINE>if (mostRecentFocusOwner instanceof JTextComponent && !(mostRecentFocusOwner.getClass().getName().contains("JSpinField"))) {<NEW_LINE>final JTextComponent textComponent = (JTextComponent) mostRecentFocusOwner;<NEW_LINE>textComponent.replaceSelection(dateAsString);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (mostRecentFocusOwner instanceof JTable) {<NEW_LINE>JTable table = (JTable) mostRecentFocusOwner;<NEW_LINE>final int[] selectedRows = table.getSelectedRows();<NEW_LINE>final int[] selectedColumns = table.getSelectedColumns();<NEW_LINE>for (int r : selectedRows) for (int c : selectedColumns) table.setValueAt(date, r, c);<NEW_LINE>} else {<NEW_LINE>ModeController mController = Controller.getCurrentModeController();<NEW_LINE>for (final NodeModel node : mController.getMapController().getSelectedNodes()) {<NEW_LINE>final MTextController textController = (MTextController) TextController.getController();<NEW_LINE>textController.setNodeObject(node, date);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
parentWindow = SwingUtilities.getWindowAncestor(appendButton);
|
810,642
|
public static List<ScaleMeasurement> importFrom(BufferedReader reader) throws IOException, ParseException {<NEW_LINE>CsvProcessor<ScaleMeasurement> csvProcessor = new CsvProcessor<>(ScaleMeasurement.class).withHeaderValidation(true).withFlexibleOrder(true).withAlwaysTrimInput(true).withAllowPartialLines(true);<NEW_LINE>csvProcessor.setColumnNameMatcher(new ColumnNameMatcher() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean matchesColumnName(String definitionName, String csvName) {<NEW_LINE>return definitionName.equals(csvName) || (definitionName.equals("lbm") && csvName.equals("lbw"));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>reader.mark(1000);<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (ParseException ex) {<NEW_LINE>// Try to import it as an old style CSV export<NEW_LINE>reader.reset();<NEW_LINE>final String sampleLine = reader.readLine();<NEW_LINE>reader.reset();<NEW_LINE>final String[] header = getOldStyleHeaders(sampleLine);<NEW_LINE>if (header == null) {<NEW_LINE>// Don't know what to do with this, let Simple CSV error out<NEW_LINE>return csvProcessor.readAll(reader, null);<NEW_LINE>}<NEW_LINE>csvProcessor.validateHeaderColumns(header, null);<NEW_LINE>}<NEW_LINE>return csvProcessor.readRows(reader, null);<NEW_LINE>}
|
csvProcessor.readHeader(reader, null);
|
727,291
|
private static // -------------<NEW_LINE>void debugElement(Element e, MyPopup p) {<NEW_LINE>StringBuilder result = new StringBuilder();<NEW_LINE>result.append("<html><body style='font-weight:normal;'>");<NEW_LINE>try {<NEW_LINE>String text = e.getDocument().getText(e.getStartOffset(), e.getEndOffset() - e.getStartOffset());<NEW_LINE>// Make linebreaks visible<NEW_LINE>text = text.replace("\n", "\\n");<NEW_LINE>result.append("'").append(text).append("'");<NEW_LINE>result.append("<br />");<NEW_LINE>if (e.isLeaf() && e.getParentElement() != null) {<NEW_LINE>Element parent = e.getParentElement();<NEW_LINE>int elementIndex = parent.getElementIndex(e.getStartOffset());<NEW_LINE>result.append("Index: ").append(elementIndex).append(" of ").append(parent.getElementCount());<NEW_LINE>result.append(" (Length: ").append(e.getEndOffset() - e.getStartOffset<MASK><NEW_LINE>result.append("<br />");<NEW_LINE>}<NEW_LINE>} catch (BadLocationException ex) {<NEW_LINE>Logger.getLogger(LinkController.class.getName()).log(Level.SEVERE, null, ex);<NEW_LINE>}<NEW_LINE>AttributeSet attrs = e.getAttributes();<NEW_LINE>while (attrs != null) {<NEW_LINE>result.append("<b>").append(attrs.toString()).append("</b>");<NEW_LINE>result.append("<br />");<NEW_LINE>Enumeration en = attrs.getAttributeNames();<NEW_LINE>while (en.hasMoreElements()) {<NEW_LINE>Object key = en.nextElement();<NEW_LINE>Object value = attrs.getAttribute(key);<NEW_LINE>result.append(Helper.htmlspecialchars_encode(String.valueOf(key)));<NEW_LINE>result.append(" => ");<NEW_LINE>result.append(Helper.htmlspecialchars_encode(String.valueOf(value)));<NEW_LINE>result.append("<br />");<NEW_LINE>}<NEW_LINE>attrs = attrs.getResolveParent();<NEW_LINE>}<NEW_LINE>p.setText(result.toString());<NEW_LINE>}
|
()).append(")");
|
1,032,611
|
private void init() {<NEW_LINE>m_simDevice = SimDevice.create(<MASK><NEW_LINE>if (m_simDevice != null) {<NEW_LINE>m_simPosition = m_simDevice.createDouble("position", SimDevice.Direction.kInput, 0.0);<NEW_LINE>m_simDistancePerRotation = m_simDevice.createDouble("distance_per_rot", SimDevice.Direction.kOutput, 1.0);<NEW_LINE>m_simAbsolutePosition = m_simDevice.createDouble("absPosition", SimDevice.Direction.kInput, 0.0);<NEW_LINE>m_simIsConnected = m_simDevice.createBoolean("connected", SimDevice.Direction.kInput, true);<NEW_LINE>} else {<NEW_LINE>m_counter = new Counter();<NEW_LINE>m_analogTrigger = new AnalogTrigger(m_dutyCycle);<NEW_LINE>m_analogTrigger.setLimitsDutyCycle(0.25, 0.75);<NEW_LINE>m_counter.setUpSource(m_analogTrigger, AnalogTriggerType.kRisingPulse);<NEW_LINE>m_counter.setDownSource(m_analogTrigger, AnalogTriggerType.kFallingPulse);<NEW_LINE>}<NEW_LINE>SendableRegistry.addLW(this, "DutyCycle Encoder", m_dutyCycle.getSourceChannel());<NEW_LINE>}
|
"DutyCycle:DutyCycleEncoder", m_dutyCycle.getSourceChannel());
|
964,510
|
final GetExtensionResult executeGetExtension(GetExtensionRequest getExtensionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getExtensionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetExtensionRequest> request = null;<NEW_LINE>Response<GetExtensionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetExtensionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getExtensionRequest));<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, "GameSparks");<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<GetExtensionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetExtensionResultJsonUnmarshaller());<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, "GetExtension");
|
800,086
|
public void marshall(MediaCapturePipeline mediaCapturePipeline, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (mediaCapturePipeline == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(mediaCapturePipeline.getMediaPipelineId(), MEDIAPIPELINEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(mediaCapturePipeline.getSourceType(), SOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(mediaCapturePipeline.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(mediaCapturePipeline.getSinkType(), SINKTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(mediaCapturePipeline.getSinkArn(), SINKARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(mediaCapturePipeline.getCreatedTimestamp(), CREATEDTIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(mediaCapturePipeline.getUpdatedTimestamp(), UPDATEDTIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(mediaCapturePipeline.getChimeSdkMeetingConfiguration(), CHIMESDKMEETINGCONFIGURATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
mediaCapturePipeline.getSourceArn(), SOURCEARN_BINDING);
|
528,483
|
public static void serialize(Source source, Result result, boolean omit_xml_declaration, boolean method_xml, boolean indent) throws Docx4JException {<NEW_LINE>// Xalan <= 2.7.2 can't handle astral characters: https://issues.apache.org/jira/browse/XALANJ-2419<NEW_LINE>// but org.docx4j.org.apache.xalan repackaging is patched to fix this<NEW_LINE>try {<NEW_LINE>Transformer serializer = new org.docx4j.org.apache.xalan.transformer.TransformerIdentityImpl();<NEW_LINE>if (omit_xml_declaration) {<NEW_LINE>serializer.setOutputProperty(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");<NEW_LINE>}<NEW_LINE>if (method_xml) {<NEW_LINE>// probably the default anyway?<NEW_LINE>serializer.setOutputProperty(javax.xml.<MASK><NEW_LINE>}<NEW_LINE>if (indent) {<NEW_LINE>serializer.setOutputProperty(javax.xml.transform.OutputKeys.INDENT, "yes");<NEW_LINE>// actual indent amount is set in org/docx4j/org/apache/xml/serializer/docx4j_xalan_output_xml.properties<NEW_LINE>}<NEW_LINE>serializer.transform(source, result);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>throw new Docx4JException("Exception writing Document to OutputStream: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
transform.OutputKeys.METHOD, "xml");
|
281,367
|
final CreateSiteResult executeCreateSite(CreateSiteRequest createSiteRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSiteRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSiteRequest> request = null;<NEW_LINE>Response<CreateSiteResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateSiteRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSiteRequest));<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, "NetworkManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSite");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateSiteResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateSiteResultJsonUnmarshaller());<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);
|
1,854,961
|
private void populateFromPubKeyInfo(SubjectPublicKeyInfo info) {<NEW_LINE>ASN1BitString bits = info.getPublicKeyData();<NEW_LINE>ASN1OctetString key;<NEW_LINE>this.algorithm = "ECGOST3410";<NEW_LINE>try {<NEW_LINE>key = (ASN1OctetString) ASN1Primitive.fromByteArray(bits.getBytes());<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new IllegalArgumentException("error recovering public key");<NEW_LINE>}<NEW_LINE>byte[] keyEnc = key.getOctets();<NEW_LINE>byte[] x9Encoding = new byte[65];<NEW_LINE>x9Encoding[0] = 0x04;<NEW_LINE>for (int i = 1; i <= 32; ++i) {<NEW_LINE>x9Encoding[i] = keyEnc[32 - i];<NEW_LINE>x9Encoding[i + 32] = keyEnc[64 - i];<NEW_LINE>}<NEW_LINE>ASN1ObjectIdentifier paramOID;<NEW_LINE>if (info.getAlgorithm().getParameters() instanceof ASN1ObjectIdentifier) {<NEW_LINE>paramOID = ASN1ObjectIdentifier.getInstance(info.getAlgorithm().getParameters());<NEW_LINE>gostParams = paramOID;<NEW_LINE>} else {<NEW_LINE>GOST3410PublicKeyAlgParameters params = GOST3410PublicKeyAlgParameters.getInstance(info.getAlgorithm().getParameters());<NEW_LINE>gostParams = params;<NEW_LINE>paramOID = params.getPublicKeyParamSet();<NEW_LINE>}<NEW_LINE>ECNamedCurveParameterSpec spec = ECGOST3410NamedCurveTable.getParameterSpec(ECGOST3410NamedCurves.getName(paramOID));<NEW_LINE><MASK><NEW_LINE>EllipticCurve ellipticCurve = EC5Util.convertCurve(curve, spec.getSeed());<NEW_LINE>this.ecPublicKey = new ECPublicKeyParameters(curve.decodePoint(x9Encoding), ECUtil.getDomainParameters(null, spec));<NEW_LINE>this.ecSpec = new ECNamedCurveSpec(ECGOST3410NamedCurves.getName(paramOID), ellipticCurve, EC5Util.convertPoint(spec.getG()), spec.getN(), spec.getH());<NEW_LINE>}
|
ECCurve curve = spec.getCurve();
|
876,523
|
protected void drawBackgroundLayer(float partialTicks) {<NEW_LINE>ICON_GUI.drawAt(mainGui.rootElement);<NEW_LINE>RenderHelper.enableGUIStandardItemLighting();<NEW_LINE>for (int i = 0; i < 9; i++) {<NEW_LINE>ItemStack stack = container.tile.invFilter.getStackInSlot(i);<NEW_LINE>double currentX = mainGui.rootElement.getX() + 8 + i * 18;<NEW_LINE>double currentY = mainGui.rootElement.getY() + 61;<NEW_LINE>// GL11.glEnable(GL11.GL_BLEND);<NEW_LINE>// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);<NEW_LINE>// GL11.glColor4f(1, 1, 1, 0.5F);<NEW_LINE>if (!stack.isEmpty()) {<NEW_LINE>this.itemRender.renderItemAndEffectIntoGUI(this.mc.player, stack, (int<MASK><NEW_LINE>} else {<NEW_LINE>this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);<NEW_LINE>this.drawTexturedModalRect((int) currentX, (int) currentY, BCTransportSprites.NOTHING_FILTERED_BUFFER_SLOT.getSprite(), 16, 16);<NEW_LINE>}<NEW_LINE>// GL11.glColor4f(1, 1, 1, 1);<NEW_LINE>// GL11.glDisable(GL11.GL_BLEND);<NEW_LINE>}<NEW_LINE>RenderHelper.disableStandardItemLighting();<NEW_LINE>// GL11.glPushMatrix();<NEW_LINE>// GL11.glTranslatef(0, 0, 100);<NEW_LINE>GlStateManager.disableDepth();<NEW_LINE>GlStateManager.enableBlend();<NEW_LINE>GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);<NEW_LINE>GlStateManager.color(1, 1, 1, 0.7f);<NEW_LINE>ICON_GUI.drawAt(mainGui.rootElement);<NEW_LINE>GlStateManager.color(1, 1, 1, 1);<NEW_LINE>GlStateManager.disableBlend();<NEW_LINE>GlStateManager.enableDepth();<NEW_LINE>// GL11.glPopMatrix();<NEW_LINE>}
|
) currentX, (int) currentY);
|
498,230
|
public boolean onTouch(View v, MotionEvent event) {<NEW_LINE>if (getDisplayedDrawable() != null) {<NEW_LINE>int x = (int) event.getX();<NEW_LINE>int y = (int) event.getY();<NEW_LINE>int left = (loc == Location.LEFT) ? 0 : getWidth() - getPaddingRight() - xD.getIntrinsicWidth();<NEW_LINE>int right = (loc == Location.LEFT) ? getPaddingLeft() + xD.getIntrinsicWidth() : getWidth();<NEW_LINE>boolean tappedX = x >= left && x <= right && y >= 0 && y <= (getBottom() - getTop());<NEW_LINE>if (tappedX) {<NEW_LINE>if (event.getAction() == MotionEvent.ACTION_UP) {<NEW_LINE>setText("");<NEW_LINE>if (listener != null) {<NEW_LINE>listener.didClearText();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (l != null) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
|
l.onTouch(v, event);
|
1,030,169
|
public String toXml(int offset) {<NEW_LINE>StringBuilder buffer = new StringBuilder();<NEW_LINE>String mentionType = mType;<NEW_LINE>appendOffset(buffer, offset);<NEW_LINE>buffer.append("<entity_mention ID=\"" + getId() + "\" TYPE =\"" + mentionType + "\" LDCTYPE=\"" + mLdctype + "\">\n");<NEW_LINE>buffer.append(mExtent.toXml("extent", offset + 2));<NEW_LINE>buffer.append("\n");<NEW_LINE>buffer.append(mHead.toXml("head", offset + 2));<NEW_LINE>buffer.append("\n");<NEW_LINE>appendOffset(buffer, offset);<NEW_LINE>buffer.append("</entity_mention>");<NEW_LINE>if (mentionType.equals("NAM")) {<NEW_LINE>// XXX: <entity_attributes> should be in Entity.toXml()<NEW_LINE>buffer.append("\n");<NEW_LINE>appendOffset(buffer, offset);<NEW_LINE>buffer.append("<entity_attributes>\n");<NEW_LINE>appendOffset(buffer, offset + 2);<NEW_LINE>buffer.append("<name NAME=\"" + mHead.getText() + "\">\n");<NEW_LINE>buffer.append(mHead.toXml<MASK><NEW_LINE>appendOffset(buffer, offset + 2);<NEW_LINE>buffer.append("</name>\n");<NEW_LINE>appendOffset(buffer, offset);<NEW_LINE>buffer.append("</entity_attributes>");<NEW_LINE>}<NEW_LINE>return buffer.toString();<NEW_LINE>}
|
(offset + 4) + "\n");
|
1,278,745
|
protected void readBitmap() {<NEW_LINE>// (sub)image position & size<NEW_LINE>currentFrame.ix = readShort();<NEW_LINE>currentFrame.iy = readShort();<NEW_LINE>currentFrame.iw = readShort();<NEW_LINE>currentFrame.ih = readShort();<NEW_LINE>int packed = read();<NEW_LINE>// 1 - local color table flag interlace<NEW_LINE>lctFlag = (packed & 0x80) != 0;<NEW_LINE>lctSize = (int) Math.pow(2, (packed & 0x07) + 1);<NEW_LINE>// 3 - sort flag<NEW_LINE>// 4-5 - reserved lctSize = 2 << (packed & 7); // 6-8 - local color<NEW_LINE>// table size<NEW_LINE>currentFrame.interlace = (packed & 0x40) != 0;<NEW_LINE>if (lctFlag) {<NEW_LINE>// read table<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>// No local color table<NEW_LINE>currentFrame.lct = null;<NEW_LINE>}<NEW_LINE>// Save this as the decoding position pointer<NEW_LINE>currentFrame.bufferFrameStart = rawData.position();<NEW_LINE>// false decode pixel data to advance buffer<NEW_LINE>decodeBitmapData(null, mainPixels);<NEW_LINE>skip();<NEW_LINE>if (err()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>frameCount++;<NEW_LINE>// add image to frame<NEW_LINE>frames.add(currentFrame);<NEW_LINE>}
|
currentFrame.lct = readColorTable(lctSize);
|
647,494
|
private boolean saveFileToExternalStorage() {<NEW_LINE>// build paths<NEW_LINE>mArcGISTempFolderPath = getExternalFilesDir(null) + File.separator + getResources().getString(R.string.pin_blank_orange_folder_name);<NEW_LINE>mPinBlankOrangeFilePath = mArcGISTempFolderPath + File.separator + getResources().getString(R.string.pin_blank_orange_file_name);<NEW_LINE>// get drawable resource<NEW_LINE>Bitmap bm = BitmapFactory.decodeResource(getResources(<MASK><NEW_LINE>// create new ArcGIS temp folder<NEW_LINE>File folder = new File(mArcGISTempFolderPath);<NEW_LINE>if (folder.mkdirs()) {<NEW_LINE>Log.d(TAG, "Temp folder created");<NEW_LINE>} else {<NEW_LINE>Toast.makeText(this, "Could not create temp folder", Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>// create file on disk<NEW_LINE>File file = new File(mPinBlankOrangeFilePath);<NEW_LINE>try {<NEW_LINE>OutputStream outStream = new FileOutputStream(file);<NEW_LINE>bm.compress(Bitmap.CompressFormat.PNG, 100, outStream);<NEW_LINE>outStream.flush();<NEW_LINE>outStream.close();<NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e("picture-marker-symbol", "Failed to write image to external directory: message = " + e.getMessage());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
|
), R.drawable.pin_blank_orange);
|
677,626
|
protected MetadataFieldRest put(Context context, HttpServletRequest request, String apiCategory, String model, Integer id, JsonNode jsonNode) throws SQLException, AuthorizeException {<NEW_LINE>MetadataFieldRest metadataFieldRest = new Gson().fromJson(jsonNode.toString(), MetadataFieldRest.class);<NEW_LINE>if (isBlank(metadataFieldRest.getElement())) {<NEW_LINE>throw new UnprocessableEntityException("metadata element (in request body) cannot be blank");<NEW_LINE>}<NEW_LINE>if (!Objects.equals(id, metadataFieldRest.getId())) {<NEW_LINE>throw new UnprocessableEntityException("ID in request body doesn't match path ID");<NEW_LINE>}<NEW_LINE>MetadataField metadataField = metadataFieldService.find(context, id);<NEW_LINE>if (metadataField == null) {<NEW_LINE>throw new ResourceNotFoundException("metadata field with id: " + id + " not found");<NEW_LINE>}<NEW_LINE>metadataField.setElement(metadataFieldRest.getElement());<NEW_LINE>metadataField.setQualifier(metadataFieldRest.getQualifier());<NEW_LINE>metadataField.<MASK><NEW_LINE>try {<NEW_LINE>metadataFieldService.update(context, metadataField);<NEW_LINE>context.commit();<NEW_LINE>} catch (NonUniqueMetadataException e) {<NEW_LINE>throw new UnprocessableEntityException("metadata field " + metadataField.getMetadataSchema().getName() + "." + metadataFieldRest.getElement() + (metadataFieldRest.getQualifier() != null ? "." + metadataFieldRest.getQualifier() : "") + " already exists");<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>return converter.toRest(metadataField, utils.obtainProjection());<NEW_LINE>}
|
setScopeNote(metadataFieldRest.getScopeNote());
|
1,051,665
|
private void addGraphicsOverlay() {<NEW_LINE>// create the polygon<NEW_LINE>PolygonBuilder polygonGeometry = new PolygonBuilder(SpatialReferences.getWebMercator());<NEW_LINE>polygonGeometry.addPoint(-20e5, 20e5);<NEW_LINE><MASK><NEW_LINE>polygonGeometry.addPoint(20e5, -20e5);<NEW_LINE>polygonGeometry.addPoint(-20e5, -20e5);<NEW_LINE>// create solid line symbol<NEW_LINE>SimpleFillSymbol polygonSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, Color.YELLOW, null);<NEW_LINE>// create graphic from polygon geometry and symbol<NEW_LINE>Graphic graphic = new Graphic(polygonGeometry.toGeometry(), polygonSymbol);<NEW_LINE>// create graphics overlay<NEW_LINE>grOverlay = new GraphicsOverlay();<NEW_LINE>// create list of graphics<NEW_LINE>ListenableList<Graphic> graphics = grOverlay.getGraphics();<NEW_LINE>// add graphic to graphics overlay<NEW_LINE>graphics.add(graphic);<NEW_LINE>// add graphics overlay to the MapView<NEW_LINE>mMapView.getGraphicsOverlays().add(grOverlay);<NEW_LINE>}
|
polygonGeometry.addPoint(20e5, 20.e5);
|
1,777,249
|
private void generateCreateFieldsForClass(GeneratorContext context, SourceWriter writer, String className) throws IOException {<NEW_LINE>ReflectionDependencyListener reflection = context.getService(ReflectionDependencyListener.class);<NEW_LINE>Set<String> accessibleFields = reflection.getAccessibleFields(className);<NEW_LINE>ClassReader cls = context.getClassSource().get(className);<NEW_LINE>if (cls == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>writer.appendClass(className).append(".$meta.fields").ws().append('=').ws().append('[').indent();<NEW_LINE>generateCreateMembers(writer, cls.getFields(), field -> {<NEW_LINE>appendProperty(writer, "type", false, () -> context.typeToClassString(writer, field.getType()));<NEW_LINE>appendProperty(writer, "getter", false, () -> {<NEW_LINE>if (accessibleFields != null && accessibleFields.contains(field.getName())) {<NEW_LINE>renderGetter(context, writer, field);<NEW_LINE>} else {<NEW_LINE>writer.append("null");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>appendProperty(writer, "setter", false, () -> {<NEW_LINE>if (accessibleFields != null && accessibleFields.contains(field.getName())) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>writer.append("null");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>writer.outdent().append("];").softNewLine();<NEW_LINE>}
|
renderSetter(context, writer, field);
|
1,720,233
|
final RejectQualificationRequestResult executeRejectQualificationRequest(RejectQualificationRequestRequest rejectQualificationRequestRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(rejectQualificationRequestRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RejectQualificationRequestRequest> request = null;<NEW_LINE>Response<RejectQualificationRequestResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RejectQualificationRequestRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(rejectQualificationRequestRequest));<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, "RejectQualificationRequest");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RejectQualificationRequestResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RejectQualificationRequestResultJsonUnmarshaller());<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, "MTurk");
|
84,014
|
public final void changeView(@Nonnull final String typeName, boolean requestFocus) {<NEW_LINE>myCurrentViewType = typeName;<NEW_LINE>final PsiElement element = mySmartPsiElementPointer.getElement();<NEW_LINE>if (element == null || !isApplicableElement(element)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (myContent != null) {<NEW_LINE>final String displayName = getContentDisplayName(typeName, element);<NEW_LINE>if (displayName != null) {<NEW_LINE>myContent.setDisplayName(displayName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myCardLayout.show(myTreePanel, typeName);<NEW_LINE>if (!myBuilders.containsKey(typeName)) {<NEW_LINE>try {<NEW_LINE>setWaitCursor();<NEW_LINE>// create builder<NEW_LINE>final JTree tree = myType2TreeMap.get(typeName);<NEW_LINE>final DefaultTreeModel model = new DefaultTreeModel(new DefaultMutableTreeNode(""));<NEW_LINE>tree.setModel(model);<NEW_LINE>PsiDocumentManager.getInstance(myProject).commitAllDocuments();<NEW_LINE>final HierarchyTreeStructure structure = createHierarchyTreeStructure(typeName, element);<NEW_LINE>if (structure == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Comparator<NodeDescriptor> comparator = getComparator();<NEW_LINE>final HierarchyTreeBuilder builder = new HierarchyTreeBuilder(myProject, tree, model, structure, comparator);<NEW_LINE>myBuilders.put(typeName, builder);<NEW_LINE>Disposer.register(this, builder);<NEW_LINE>Disposer.register(builder, new Disposable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void dispose() {<NEW_LINE>myBuilders.remove(typeName);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final <MASK><NEW_LINE>builder.select(descriptor, new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>builder.expand(descriptor, null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} finally {<NEW_LINE>restoreCursor();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (requestFocus) {<NEW_LINE>IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(getCurrentTree(), true));<NEW_LINE>}<NEW_LINE>}
|
HierarchyNodeDescriptor descriptor = structure.getBaseDescriptor();
|
814,050
|
public INDArray tensorAlongDimension(long index, int... dimension) {<NEW_LINE>if (dimension == null || dimension.length == 0)<NEW_LINE>throw new IllegalArgumentException("Invalid input: dimensions not specified (null or length 0)");<NEW_LINE>Preconditions.checkArgument(!this.isEmpty(), "tensorAlongDimension(...) can't be used on empty tensors");<NEW_LINE>if (dimension.length >= rank() || dimension.length == 1 && dimension[0] == Integer.MAX_VALUE)<NEW_LINE>return this;<NEW_LINE>for (int i = 0; i < dimension.length; i++) if (dimension[i] < 0)<NEW_LINE>dimension[i] += rank();<NEW_LINE>// dedup<NEW_LINE>if (dimension.length > 1)<NEW_LINE>dimension = Ints.toArray(new ArrayList<>(new TreeSet<>(Ints.asList(dimension))));<NEW_LINE>if (dimension.length > 1) {<NEW_LINE>Arrays.sort(dimension);<NEW_LINE>}<NEW_LINE>long tads = tensorsAlongDimension(dimension);<NEW_LINE>if (index >= tads)<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>if (dimension.length == 1) {<NEW_LINE>if (dimension[0] == 0 && isColumnVector()) {<NEW_LINE>return this.transpose();<NEW_LINE>} else if (dimension[0] == 1 && isRowVector()) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Pair<DataBuffer, DataBuffer> tadInfo = Nd4j.getExecutioner().getTADManager().getTADOnlyShapeInfo(this, dimension);<NEW_LINE>DataBuffer shapeInfo = tadInfo.getFirst();<NEW_LINE>val jShapeInfo = shapeInfo.asLong();<NEW_LINE>val shape = Shape.shape(jShapeInfo);<NEW_LINE>val stride = Shape.stride(jShapeInfo);<NEW_LINE>long offset = offset() + tadInfo.getSecond().getLong(index);<NEW_LINE>val ews = shapeInfo.getLong(jShapeInfo[0] * 2 + 2);<NEW_LINE>char tadOrder = (char) shapeInfo.getInt(jShapeInfo[0] * 2 + 3);<NEW_LINE>val toTad = Nd4j.create(data(), shape, stride, offset, ews, tadOrder);<NEW_LINE>return toTad;<NEW_LINE>}
|
"Illegal index " + index + " out of tads " + tads);
|
229,757
|
public static void addDataSource(AutoIngestDataSourceProcessor dataSourceProcessor, Path dataSourcePath) throws TestUtilsException {<NEW_LINE>try {<NEW_LINE>if (!dataSourcePath.toFile().exists()) {<NEW_LINE>throw new TestUtilsException("IngestUtils.addDataSource: Data source not found: " + dataSourcePath.toString());<NEW_LINE>}<NEW_LINE>UUID taskId = UUID.randomUUID();<NEW_LINE>Case.getCurrentCaseThrows().notifyAddingDataSource(taskId);<NEW_LINE>DataSourceProcessorRunner.ProcessorCallback callBack = <MASK><NEW_LINE>DataSourceProcessorCallback.DataSourceProcessorResult result = callBack.getResult();<NEW_LINE>if (result.equals(DataSourceProcessorCallback.DataSourceProcessorResult.CRITICAL_ERRORS)) {<NEW_LINE>String joinedErrors = String.join(System.lineSeparator(), callBack.getErrorMessages());<NEW_LINE>throw new TestUtilsException(String.format("IngestUtils.addDataSource: Error(s) occurred while running the data source processor: %s", joinedErrors));<NEW_LINE>}<NEW_LINE>for (Content c : callBack.getDataSourceContent()) {<NEW_LINE>Case.getCurrentCaseThrows().notifyDataSourceAdded(c, taskId);<NEW_LINE>}<NEW_LINE>} catch (AutoIngestDataSourceProcessor.AutoIngestDataSourceProcessorException | NoCurrentCaseException | InterruptedException ex) {<NEW_LINE>throw new TestUtilsException("IngestUtils.addDataSource encountered an error on adding a datasource: " + ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>}
|
DataSourceProcessorRunner.runDataSourceProcessor(dataSourceProcessor, dataSourcePath);
|
373,794
|
public static void equalizeLocal(GrayU16 input, int radius, GrayU16 output, int histogramLength, @Nullable GrowArray<DogArray_I32> workspaces) {<NEW_LINE>InputSanityCheck.checkReshape(input, output);<NEW_LINE>workspaces = BoofMiscOps.checkDeclare(workspaces, DogArray_I32::new);<NEW_LINE>int width = radius * 2 + 1;<NEW_LINE>// use more efficient algorithms if possible<NEW_LINE>if (input.width >= width && input.height >= width) {<NEW_LINE>if (BoofConcurrency.USE_CONCURRENT) {<NEW_LINE>ImplEnhanceHistogram_MT.equalizeLocalInner(input, radius, histogramLength, output, workspaces);<NEW_LINE>// top border<NEW_LINE>ImplEnhanceHistogram_MT.equalizeLocalRow(input, radius, histogramLength, 0, output, workspaces);<NEW_LINE>// bottom border<NEW_LINE>ImplEnhanceHistogram_MT.equalizeLocalRow(input, radius, histogramLength, input.height - radius, output, workspaces);<NEW_LINE>// left border<NEW_LINE>ImplEnhanceHistogram_MT.equalizeLocalCol(input, radius, histogramLength, 0, output, workspaces);<NEW_LINE>// right border<NEW_LINE>ImplEnhanceHistogram_MT.equalizeLocalCol(input, radius, histogramLength, input.width - radius, output, workspaces);<NEW_LINE>} else {<NEW_LINE>ImplEnhanceHistogram.equalizeLocalInner(input, <MASK><NEW_LINE>// top border<NEW_LINE>ImplEnhanceHistogram.equalizeLocalRow(input, radius, histogramLength, 0, output, workspaces);<NEW_LINE>// bottom border<NEW_LINE>ImplEnhanceHistogram.equalizeLocalRow(input, radius, histogramLength, input.height - radius, output, workspaces);<NEW_LINE>// left border<NEW_LINE>ImplEnhanceHistogram.equalizeLocalCol(input, radius, histogramLength, 0, output, workspaces);<NEW_LINE>// right border<NEW_LINE>ImplEnhanceHistogram.equalizeLocalCol(input, radius, histogramLength, input.width - radius, output, workspaces);<NEW_LINE>}<NEW_LINE>} else if (input.width < width && input.height < width) {<NEW_LINE>// the local region is larger than the image. just use the full image algorithm<NEW_LINE>workspaces.reset();<NEW_LINE>int[] histogram = BoofMiscOps.checkDeclare(workspaces.grow(), histogramLength, false);<NEW_LINE>int[] transform = BoofMiscOps.checkDeclare(workspaces.grow(), histogramLength, false);<NEW_LINE>ImageStatistics.histogram(input, 0, histogram);<NEW_LINE>equalize(histogram, transform);<NEW_LINE>applyTransform(input, transform, output);<NEW_LINE>} else {<NEW_LINE>if (BoofConcurrency.USE_CONCURRENT) {<NEW_LINE>ImplEnhanceHistogram_MT.equalizeLocalNaive(input, radius, histogramLength, output, workspaces);<NEW_LINE>} else {<NEW_LINE>ImplEnhanceHistogram.equalizeLocalNaive(input, radius, histogramLength, output, workspaces);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
radius, histogramLength, output, workspaces);
|
347,982
|
private synchronized CompactHashSet<E> lockedExpand(Object[] children) {<NEW_LINE>// Precondition: this is a non-leaf node with non-leaf successors (depth > 2).<NEW_LINE>// Postcondition: memo is completely populated.<NEW_LINE>if (memo != null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>CompactHashSet<E> members = CompactHashSet.createWithExpectedSize(128);<NEW_LINE>CompactHashSet<Object> sets = CompactHashSet.createWithExpectedSize(128);<NEW_LINE>sets.add(children);<NEW_LINE>// (+3 for size: a guess)<NEW_LINE>memo = new byte[3 + Math.min(ceildiv(children.length, 8), 8)];<NEW_LINE>int pos = walk(sets, members, children, /*pos=*/<NEW_LINE>0);<NEW_LINE>// Append (nonzero) size to memo, in reverse varint encoding (7 bits at a time, least<NEW_LINE>// significant first). Only the first encoded byte's top bit is set.<NEW_LINE><MASK><NEW_LINE>Preconditions.checkState(0 < size, "Size must be positive, was %s", size);<NEW_LINE>int sizeVarIntLen = varintlen(size);<NEW_LINE>int memoOffset = ceildiv(pos, 8);<NEW_LINE>int idealMemoSize = memoOffset + sizeVarIntLen;<NEW_LINE>// Resize memo if it's too small or far too big.<NEW_LINE>if (memo.length < idealMemoSize || memo.length - 16 >= idealMemoSize) {<NEW_LINE>memo = Arrays.copyOf(memo, idealMemoSize);<NEW_LINE>}<NEW_LINE>for (byte top = (byte) 0x80; size > 0; top = 0) {<NEW_LINE>memo[memoOffset++] = (byte) ((byte) (size & 0x7f) | top);<NEW_LINE>size >>>= 7;<NEW_LINE>}<NEW_LINE>return members;<NEW_LINE>}
|
int size = members.size();
|
223,950
|
private boolean estimateMotion() {<NEW_LINE>CameraModel leftCM = cameraModels.get(CAMERA_LEFT);<NEW_LINE>CameraModel rightCM = cameraModels.get(CAMERA_RIGHT);<NEW_LINE>// Perform motion estimation relative to the most recent key frame<NEW_LINE>previousLeft.frame_to_world.invert(world_to_prev);<NEW_LINE>// Put observation and prior knowledge into a format the model matcher will understand<NEW_LINE>listStereo2D3D.reserve(candidates.size());<NEW_LINE>listStereo2D3D.reset();<NEW_LINE>for (int candidateIdx = 0; candidateIdx < candidates.size(); candidateIdx++) {<NEW_LINE>PointTrack l = candidates.get(candidateIdx);<NEW_LINE>Stereo2D3D stereo = listStereo2D3D.grow();<NEW_LINE>// Get the track location<NEW_LINE>TrackInfo bt = l.getCookie();<NEW_LINE>PointTrack r = bt.visualRight;<NEW_LINE>// Get the 3D coordinate of the point in the 'previous' frame<NEW_LINE>SePointOps_F64.transform(world_to_prev, bt.worldLoc, prevLoc4);<NEW_LINE>PerspectiveOps.homogenousTo3dPositiveZ(prevLoc4, 1e8, 1e-8, stereo.location);<NEW_LINE>// compute normalized image coordinate for track in left and right image<NEW_LINE>leftCM.pixelToNorm.compute(l.pixel.x, l.pixel.y, stereo.leftObs);<NEW_LINE>rightCM.pixelToNorm.compute(r.pixel.x, r.pixel.y, stereo.rightObs);<NEW_LINE>// TODO Could this transform be done just once?<NEW_LINE>}<NEW_LINE>// Robustly estimate left camera motion<NEW_LINE>if (!matcher.process(listStereo2D3D.toList()))<NEW_LINE>return false;<NEW_LINE>if (modelRefiner != null) {<NEW_LINE>modelRefiner.fitModel(matcher.getMatchSet(), matcher.getModelParameters(), previous_to_current);<NEW_LINE>} else {<NEW_LINE>previous_to_current.setTo(matcher.getModelParameters());<NEW_LINE>}<NEW_LINE>// Convert the found transforms back to world<NEW_LINE>previous_to_current.invert(current_to_previous);<NEW_LINE>current_to_previous.concat(<MASK><NEW_LINE>right_to_left.concat(currentLeft.frame_to_world, currentRight.frame_to_world);<NEW_LINE>return true;<NEW_LINE>}
|
previousLeft.frame_to_world, currentLeft.frame_to_world);
|
1,015,303
|
private boolean createReversals() {<NEW_LINE>// Cancel only Sales<NEW_LINE>if (!isSOTrx()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>log.debug("createReversals");<NEW_LINE>final StringBuilder info = new StringBuilder();<NEW_LINE>// Reverse All *Shipments*<NEW_LINE>info.append("@M_InOut_ID@:");<NEW_LINE>final MInOut[] shipments = getShipments();<NEW_LINE>for (final MInOut shipment : shipments) {<NEW_LINE>final MInOut ship = shipment;<NEW_LINE>// if closed - ignore<NEW_LINE>if (MInOut.DOCSTATUS_Closed.equals(ship.getDocStatus()) || MInOut.DOCSTATUS_Reversed.equals(ship.getDocStatus()) || MInOut.DOCSTATUS_Voided.equals(ship.getDocStatus())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ship.set_TrxName(get_TrxName());<NEW_LINE>// If not completed - void - otherwise reverse it<NEW_LINE>if (!MInOut.DOCSTATUS_Completed.equals(ship.getDocStatus())) {<NEW_LINE>if (ship.voidIt()) {<NEW_LINE>ship.setDocStatus(MInOut.DOCSTATUS_Voided);<NEW_LINE>}<NEW_LINE>} else if (// completed shipment<NEW_LINE>ship.reverseCorrectIt()) {<NEW_LINE>ship.setDocStatus(MInOut.DOCSTATUS_Reversed);<NEW_LINE>info.append(" ").append(ship.getDocumentNo());<NEW_LINE>} else {<NEW_LINE>m_processMsg = "Could not reverse Shipment " + ship;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ship.setDocAction(MInOut.DOCACTION_None);<NEW_LINE>ship.save(get_TrxName());<NEW_LINE>}<NEW_LINE>// for all shipments<NEW_LINE>// Reverse All *Invoices*<NEW_LINE>info.append(" - @C_Invoice_ID@:");<NEW_LINE>for (final MInvoice invoice : getInvoices(OrderId.ofRepoId(getC_Order_ID()))) {<NEW_LINE>// if closed - ignore<NEW_LINE>final DocStatus invoiceDocStatus = DocStatus.ofCode(invoice.getDocStatus());<NEW_LINE>if (invoiceDocStatus.isClosedReversedOrVoided()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>invoice.set_TrxName(get_TrxName());<NEW_LINE>// If not completed - void - otherwise reverse it<NEW_LINE>if (!invoiceDocStatus.isCompleted()) {<NEW_LINE>if (invoice.voidIt()) {<NEW_LINE>invoice.setDocStatus(DocStatus.Voided.getCode());<NEW_LINE>}<NEW_LINE>} else if (// completed invoice<NEW_LINE>invoice.reverseCorrectIt()) {<NEW_LINE>invoice.setDocStatus(DocStatus.Reversed.getCode());<NEW_LINE>info.append(" ").append(invoice.getDocumentNo());<NEW_LINE>} else {<NEW_LINE>m_processMsg = "Could not reverse Invoice " + invoice;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>invoice.save(get_TrxName());<NEW_LINE>}<NEW_LINE>// for all shipments<NEW_LINE>m_processMsg = info.toString();<NEW_LINE>return true;<NEW_LINE>}
|
invoice.setDocAction(MInvoice.DOCACTION_None);
|
108,314
|
public Response<Void> deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String factoryName = Utils.getValueFromIdByName(id, "factories");<NEW_LINE>if (factoryName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'factories'.", id)));<NEW_LINE>}<NEW_LINE>String managedVirtualNetworkName = Utils.getValueFromIdByName(id, "managedVirtualNetworks");<NEW_LINE>if (managedVirtualNetworkName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'managedVirtualNetworks'.", id)));<NEW_LINE>}<NEW_LINE>String managedPrivateEndpointName = <MASK><NEW_LINE>if (managedPrivateEndpointName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'managedPrivateEndpoints'.", id)));<NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(resourceGroupName, factoryName, managedVirtualNetworkName, managedPrivateEndpointName, context);<NEW_LINE>}
|
Utils.getValueFromIdByName(id, "managedPrivateEndpoints");
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.