idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
228,949
// ----- package methods -----<NEW_LINE>void deserialize(final Map<String, Object> source) {<NEW_LINE>final Map<String, Object> definitions = (Map<String, Object>) source.get(JsonSchema.KEY_DEFINITIONS);<NEW_LINE>if (definitions != null) {<NEW_LINE>typeDefinitions.deserialize(definitions);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Invalid JSON object for schema definitions, missing value for 'definitions'.");<NEW_LINE>}<NEW_LINE>final List<Map<String, Object>> globalSchemaMethods = (List<Map<String, Object>>) source.get(JsonSchema.KEY_METHODS);<NEW_LINE>if (globalSchemaMethods != null) {<NEW_LINE>globalMethods.deserialize(globalSchemaMethods);<NEW_LINE>} else {<NEW_LINE>final String title = "Deprecation warning";<NEW_LINE>final String text = "This schema snapshot was created with an older version of Structr. More recent versions support global schema methods. Please re-create the snapshot with the latest version to avoid compatibility issues.";<NEW_LINE>final Map<String, <MASK><NEW_LINE>deprecationBroadcastData.put("type", "WARNING");<NEW_LINE>deprecationBroadcastData.put("title", title);<NEW_LINE>deprecationBroadcastData.put("text", text);<NEW_LINE>TransactionCommand.simpleBroadcastGenericMessage(deprecationBroadcastData);<NEW_LINE>logger.info(title + ": " + text);<NEW_LINE>}<NEW_LINE>final Object idValue = source.get(JsonSchema.KEY_ID);<NEW_LINE>if (idValue != null) {<NEW_LINE>this.id = URI.create(idValue.toString());<NEW_LINE>}<NEW_LINE>}
Object> deprecationBroadcastData = new TreeMap();
804,691
void initialize() {<NEW_LINE>assert catColumn != null : "fx:id=\"catColumn\" was not injected: check your FXML file 'SummaryTablePane.fxml'.";<NEW_LINE>assert countColumn != null : "fx:id=\"countColumn\" was not injected: check your FXML file 'SummaryTablePane.fxml'.";<NEW_LINE>assert tableView != null : "fx:id=\"tableView\" was not injected: check your FXML file 'SummaryTablePane.fxml'.";<NEW_LINE>// set some properties related to layout/resizing<NEW_LINE>VBox.setVgrow(this, Priority.NEVER);<NEW_LINE><MASK><NEW_LINE>tableView.prefHeightProperty().set(7 * 25);<NEW_LINE>// set up columns<NEW_LINE>catColumn.setCellValueFactory(params -> new SimpleObjectProperty<>(params.getValue().getKey().getDisplayName()));<NEW_LINE>catColumn.setPrefWidth(USE_COMPUTED_SIZE);<NEW_LINE>catColumn.setText(Bundle.SummaryTablePane_catColumn());<NEW_LINE>countColumn.setCellValueFactory(params -> new SimpleObjectProperty<>(params.getValue().getValue()));<NEW_LINE>countColumn.setPrefWidth(USE_COMPUTED_SIZE);<NEW_LINE>countColumn.setText(Bundle.SummaryTablePane_countColumn());<NEW_LINE>tableView.getColumns().setAll(Arrays.asList(catColumn, countColumn));<NEW_LINE>// register for category events<NEW_LINE>controller.getCategoryManager().registerListener(this);<NEW_LINE>new Thread(() -> handleCategoryChanged(null)).start();<NEW_LINE>}
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
1,292,536
public void marshall(CachediSCSIVolume cachediSCSIVolume, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (cachediSCSIVolume == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(cachediSCSIVolume.getVolumeARN(), VOLUMEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(cachediSCSIVolume.getVolumeId(), VOLUMEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(cachediSCSIVolume.getVolumeType(), VOLUMETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(cachediSCSIVolume.getVolumeStatus(), VOLUMESTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(cachediSCSIVolume.getVolumeAttachmentStatus(), VOLUMEATTACHMENTSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(cachediSCSIVolume.getVolumeProgress(), VOLUMEPROGRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(cachediSCSIVolume.getSourceSnapshotId(), SOURCESNAPSHOTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(cachediSCSIVolume.getVolumeiSCSIAttributes(), VOLUMEISCSIATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(cachediSCSIVolume.getCreatedDate(), CREATEDDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(cachediSCSIVolume.getVolumeUsedInBytes(), VOLUMEUSEDINBYTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(cachediSCSIVolume.getKMSKey(), KMSKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(cachediSCSIVolume.getTargetName(), TARGETNAME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
cachediSCSIVolume.getVolumeSizeInBytes(), VOLUMESIZEINBYTES_BINDING);
634,482
public boolean configure(final FeatureContext context) {<NEW_LINE>final Configuration config = context.getConfiguration();<NEW_LINE>final String jsonFeature = CommonProperties.getValue(config.getProperties(), config.getRuntimeType(), InternalProperties.JSON_FEATURE, JSON_FEATURE, String.class);<NEW_LINE>// Other JSON providers registered.<NEW_LINE>if (!JSON_FEATURE.equalsIgnoreCase(jsonFeature)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Disable other JSON providers.<NEW_LINE>context.property(PropertiesHelper.getPropertyNameForRuntime(InternalProperties.JSON_FEATURE, config.getRuntimeType()), JSON_FEATURE);<NEW_LINE>// Register Jackson.<NEW_LINE>if (!config.isRegistered(JacksonJaxbJsonProvider.class)) {<NEW_LINE>// add the default Jackson exception mappers<NEW_LINE>context.register(JsonParseExceptionMapper.class);<NEW_LINE>context.register(JsonMappingExceptionMapper.class);<NEW_LINE>context.register(JacksonJaxbJsonProvider.class, <MASK><NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
MessageBodyReader.class, MessageBodyWriter.class);
1,125,795
private void followReferences(ShadowBuilder currentNode, JsonObject jsonElement) {<NEW_LINE>CdoSnapshot cdoSnapshot = currentNode.getCdoSnapshot();<NEW_LINE>cdoSnapshot.getManagedType().forEachProperty(property -> {<NEW_LINE>if (cdoSnapshot.isNull(property)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (property.getType() instanceof ManagedType) {<NEW_LINE>GlobalId refId = (GlobalId) cdoSnapshot.getPropertyValue(property);<NEW_LINE>ShadowBuilder target = createOrReuseNodeFromRef(refId, property);<NEW_LINE>if (target != null) {<NEW_LINE>currentNode.addReferenceWiring(property, target);<NEW_LINE>}<NEW_LINE>jsonElement.remove(property.getName());<NEW_LINE>}<NEW_LINE>if (typeMapper.isContainerOfManagedTypes(property.getType()) || typeMapper.isKeyValueTypeWithManagedTypes(property.getType())) {<NEW_LINE>EnumerableType propertyType = property.getType();<NEW_LINE>Object <MASK><NEW_LINE>if (!propertyType.isEmpty(containerWithRefs)) {<NEW_LINE>currentNode.addEnumerableWiring(property, propertyType.map(containerWithRefs, (value) -> passValueOrCreateNodeFromRef(value, property), true));<NEW_LINE>jsonElement.remove(property.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
containerWithRefs = cdoSnapshot.getPropertyValue(property);
242,944
private void storeEntries(List<CountingMemoryCacheInspector.DumpInfoEntry<CacheKey, CloseableImage>> entries, int i, PrintStream writer, File directory) throws IOException {<NEW_LINE>String filename;<NEW_LINE>for (CountingMemoryCacheInspector.DumpInfoEntry<CacheKey, CloseableImage> entry : entries) {<NEW_LINE>CloseableImage closeableImage = entry.value.get();<NEW_LINE>if (closeableImage instanceof CloseableBitmap) {<NEW_LINE>CloseableBitmap closeableBitmap = (CloseableBitmap) closeableImage;<NEW_LINE>filename = "tmp" + i + ".png";<NEW_LINE>writer.println(formatStrLocaleSafe("Storing image %d as %s. Key: %s", i, filename, entry.key));<NEW_LINE>storeImage(closeableBitmap.getUnderlyingBitmap(), new File(directory, filename), Bitmap.CompressFormat.PNG, 100);<NEW_LINE>} else {<NEW_LINE>writer.println(formatStrLocaleSafe("Image %d has unrecognized type %s. Key: %s", i<MASK><NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}
, closeableImage, entry.key));
1,276,065
protected void encodeMarkup(FacesContext context, SelectCheckboxMenu menu) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String clientId = menu.getClientId(context);<NEW_LINE>List<SelectItem> selectItems = getSelectItems(context, menu);<NEW_LINE>boolean valid = menu.isValid();<NEW_LINE><MASK><NEW_LINE>String style = menu.getStyle();<NEW_LINE>String styleclass = createStyleClass(menu, SelectCheckboxMenu.STYLE_CLASS);<NEW_LINE>styleclass = menu.isMultiple() ? SelectCheckboxMenu.MULTIPLE_CLASS + " " + styleclass : styleclass;<NEW_LINE>writer.startElement("div", menu);<NEW_LINE>writer.writeAttribute("id", clientId, "id");<NEW_LINE>writer.writeAttribute("class", styleclass, "styleclass");<NEW_LINE>if (style != null) {<NEW_LINE>writer.writeAttribute("style", style, "style");<NEW_LINE>}<NEW_LINE>if (title != null) {<NEW_LINE>writer.writeAttribute("title", title, "title");<NEW_LINE>}<NEW_LINE>renderARIACombobox(context, menu);<NEW_LINE>encodeKeyboardTarget(context, menu);<NEW_LINE>encodeInputs(context, menu, selectItems);<NEW_LINE>if (menu.isMultiple()) {<NEW_LINE>encodeMultipleLabel(context, menu, selectItems);<NEW_LINE>} else {<NEW_LINE>encodeLabel(context, menu, selectItems, valid);<NEW_LINE>}<NEW_LINE>encodeMenuIcon(context, menu, valid);<NEW_LINE>writer.endElement("div");<NEW_LINE>}
String title = menu.getTitle();
910,808
private void appendStreamToFile(File fileToWriteTo, InputStream sourceFileInputStream) throws IOException {<NEW_LINE>FileState <MASK><NEW_LINE>BufferedOutputStream bos = null;<NEW_LINE>try (InputStream inputStream = sourceFileInputStream) {<NEW_LINE>bos = state != null ? state.stream : createOutputStream(fileToWriteTo, true);<NEW_LINE>byte[] buffer = new byte[StreamUtils.BUFFER_SIZE];<NEW_LINE>int bytesRead = -1;<NEW_LINE>while ((bytesRead = inputStream.read(buffer)) != -1) {<NEW_LINE>// NOSONAR<NEW_LINE>bos.write(buffer, 0, bytesRead);<NEW_LINE>}<NEW_LINE>if (FileWritingMessageHandler.this.appendNewLine) {<NEW_LINE>bos.write(System.lineSeparator().getBytes());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (state == null || FileWritingMessageHandler.this.flushTask == null) {<NEW_LINE>if (bos != null) {<NEW_LINE>bos.close();<NEW_LINE>}<NEW_LINE>clearState(fileToWriteTo, state);<NEW_LINE>} else {<NEW_LINE>state.lastWrite = System.currentTimeMillis();<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
state = getFileState(fileToWriteTo, false);
1,278,573
public IStatus runInBackground(IPath workingDirectory, Map<String, String> environment, String input, boolean redirect, List<String> arguments) {<NEW_LINE>File outFile = null, errFile = null;<NEW_LINE>try {<NEW_LINE>if (redirect) {<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>outFile = File.createTempFile("studio", ".out");<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>errFile = File.createTempFile("studio", ".err");<NEW_LINE>Process p;<NEW_LINE>if (isJava7) {<NEW_LINE>p = doRun(arguments, workingDirectory, environment, redirect, outFile, errFile);<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>CollectionsUtil.// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>addToList(// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>arguments, // $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>">", // $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>outFile.getAbsolutePath(), // $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE><MASK><NEW_LINE>p = run(workingDirectory, environment, arguments.toArray(new String[arguments.size()]));<NEW_LINE>}<NEW_LINE>return processData(p, outFile, errFile);<NEW_LINE>}<NEW_LINE>Process p = run(workingDirectory, environment, arguments.toArray(new String[arguments.size()]));<NEW_LINE>return processData(p, input);<NEW_LINE>} catch (IOException e) {<NEW_LINE>return new Status(IStatus.ERROR, CorePlugin.PLUGIN_ID, e.getMessage(), e);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>return e.getStatus();<NEW_LINE>} finally {<NEW_LINE>if (outFile != null) {<NEW_LINE>outFile.delete();<NEW_LINE>}<NEW_LINE>if (errFile != null) {<NEW_LINE>errFile.delete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"2>", errFile.getAbsolutePath());
1,075,408
public static void validateIndexOrAliasName(String index, BiFunction<String, String, ? extends RuntimeException> exceptionCtor) {<NEW_LINE>if (!Strings.validFileName(index)) {<NEW_LINE>throw exceptionCtor.apply(index, "must not contain the following characters " + Strings.INVALID_FILENAME_CHARS);<NEW_LINE>}<NEW_LINE>if (index.isEmpty()) {<NEW_LINE>throw exceptionCtor.apply(index, "must not be empty");<NEW_LINE>}<NEW_LINE>if (index.contains("#")) {<NEW_LINE>throw exceptionCtor.apply(index, "must not contain '#'");<NEW_LINE>}<NEW_LINE>if (index.contains(":")) {<NEW_LINE>throw exceptionCtor.apply(index, "must not contain ':'");<NEW_LINE>}<NEW_LINE>if (index.charAt(0) == '_' || index.charAt(0) == '-' || index.charAt(0) == '+') {<NEW_LINE>throw exceptionCtor.apply(index, "must not start with '_', '-', or '+'");<NEW_LINE>}<NEW_LINE>int byteCount = 0;<NEW_LINE>try {<NEW_LINE>byteCount = index.getBytes("UTF-8").length;<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>// UTF-8 should always be supported, but rethrow this if it is not for some reason<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (byteCount > MAX_INDEX_NAME_BYTES) {<NEW_LINE>throw exceptionCtor.apply(index, "index name is too long, (" + byteCount + " > " + MAX_INDEX_NAME_BYTES + ")");<NEW_LINE>}<NEW_LINE>if (index.equals(".") || index.equals("..")) {<NEW_LINE>throw exceptionCtor.apply(index, "must not be '.' or '..'");<NEW_LINE>}<NEW_LINE>}
throw new OpenSearchException("Unable to determine length of index name", e);
311,483
public SerializeMap newSerializeSession() {<NEW_LINE>final Set<ClassLoader> candidates = new LinkedHashSet<>();<NEW_LINE>final Set<URL> classPath = new LinkedHashSet<>();<NEW_LINE>final Map<ClassLoader, Short> classLoaderIds = new HashMap<>();<NEW_LINE>final Map<Short, ClassLoaderDetails> classLoaderDetails = new HashMap<>();<NEW_LINE>return new SerializeMap() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public short visitClass(Class<?> target) {<NEW_LINE>ClassLoader classLoader = target.getClassLoader();<NEW_LINE>Short <MASK><NEW_LINE>if (id != null) {<NEW_LINE>// Already seen this ClassLoader<NEW_LINE>return id;<NEW_LINE>}<NEW_LINE>ClassLoaderDetails details = classLoaderCache.maybeGetDetails(classLoader);<NEW_LINE>if (details != null) {<NEW_LINE>// A cached ClassLoader<NEW_LINE>id = (short) (classLoaderIds.size() + CLIENT_CLASS_LOADER_ID + 1);<NEW_LINE>classLoaderIds.put(classLoader, id);<NEW_LINE>classLoaderDetails.put(id, details);<NEW_LINE>return id;<NEW_LINE>}<NEW_LINE>// An application ClassLoader: Inspect class to collect up the classpath for it<NEW_LINE>classpathInferer.getClassPathFor(target, classPath);<NEW_LINE>candidates.add(target.getClassLoader());<NEW_LINE>return CLIENT_CLASS_LOADER_ID;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void collectClassLoaderDefinitions(Map<Short, ClassLoaderDetails> details) {<NEW_LINE>ClassLoaderDetails clientClassLoaders = getDetailsForClassLoaders(candidates, classPath);<NEW_LINE>details.putAll(classLoaderDetails);<NEW_LINE>details.put(CLIENT_CLASS_LOADER_ID, clientClassLoaders);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
id = classLoaderIds.get(classLoader);
1,556,236
public Version parse(String text) {<NEW_LINE>Assert.notNull(text, "Text must not be null");<NEW_LINE>Matcher matcher = VERSION_REGEX.matcher(text.trim());<NEW_LINE>if (!matcher.matches()) {<NEW_LINE>throw new InvalidVersionException("Could not determine version based on '" + text + "': version format " + "is Major.Minor.Patch and an optional Qualifier " + "(e.g. 1.0.5.RELEASE)");<NEW_LINE>}<NEW_LINE>Integer major = Integer.valueOf(matcher.group(1));<NEW_LINE>String minor = matcher.group(2);<NEW_LINE>String patch = matcher.group(3);<NEW_LINE>Qualifier qualifier = parseQualifier(matcher);<NEW_LINE>if ("x".equals(minor) || "x".equals(patch)) {<NEW_LINE>Integer minorInt = ("x".equals(minor) ? null <MASK><NEW_LINE>Version latest = findLatestVersion(major, minorInt, qualifier);<NEW_LINE>if (latest == null) {<NEW_LINE>return new Version(major, ("x".equals(minor) ? 999 : Integer.parseInt(minor)), ("x".equals(patch) ? 999 : Integer.parseInt(patch)), qualifier);<NEW_LINE>}<NEW_LINE>return new Version(major, latest.getMinor(), latest.getPatch(), latest.getQualifier());<NEW_LINE>} else {<NEW_LINE>return new Version(major, Integer.parseInt(minor), Integer.parseInt(patch), qualifier);<NEW_LINE>}<NEW_LINE>}
: Integer.parseInt(minor));
56,300
public ApiResponse<BackupClients> backupGetBackupClientsWithHttpInfo() throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/backup/clients";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "text/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String <MASK><NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<BackupClients> localVarReturnType = new GenericType<BackupClients>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
1,177,153
private void registerAttributeHandlers(final ReadManager reader) {<NEW_LINE>final IAttributeHandler vShiftHandler = new IAttributeHandler() {<NEW_LINE><NEW_LINE>public void setAttribute(final Object userObject, final String value) {<NEW_LINE>final NodeModel node = (NodeModel) userObject;<NEW_LINE>LocationModel.createLocationModel(node).setShiftY(Quantity.fromString(value, LengthUnit.px));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_NODE, "VSHIFT", vShiftHandler);<NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_NODE, "VSHIFT_QUANTITY", vShiftHandler);<NEW_LINE>final IAttributeHandler vgapHandler = new IAttributeHandler() {<NEW_LINE><NEW_LINE>public void setAttribute(final Object userObject, final String value) {<NEW_LINE>final NodeModel node = (NodeModel) userObject;<NEW_LINE>LocationModel.createLocationModel(node).setVGap(Quantity.fromString(value, LengthUnit.px));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>reader.addAttributeHandler(<MASK><NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_NODE, "VGAP_QUANTITY", vgapHandler);<NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_STYLENODE, "VGAP", vgapHandler);<NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_STYLENODE, "VGAP_QUANTITY", vgapHandler);<NEW_LINE>final IAttributeHandler hgapHandler = new IAttributeHandler() {<NEW_LINE><NEW_LINE>public void setAttribute(final Object userObject, final String value) {<NEW_LINE>final NodeModel node = (NodeModel) userObject;<NEW_LINE>LocationModel.createLocationModel(node).setHGap(Quantity.fromString(value, LengthUnit.px));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_NODE, "HGAP_QUANTITY", hgapHandler);<NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_NODE, "HGAP", hgapHandler);<NEW_LINE>}
NodeBuilder.XML_NODE, "VGAP", vgapHandler);
907,822
public static INDArray reshape4dTo2d(INDArray in, CNN2DFormat format, LayerWorkspaceMgr workspaceMgr, ArrayType type) {<NEW_LINE>if (in.rank() != 4)<NEW_LINE>throw new IllegalArgumentException("Invalid input: expect NDArray with rank 4, got rank " + in.rank() + " with shape " + Arrays.toString(in.shape()));<NEW_LINE>val shape = in.shape();<NEW_LINE>if (format == CNN2DFormat.NCHW) {<NEW_LINE>// Reshape: from [n,c,h,w] to [n*h*w,c]<NEW_LINE>INDArray out = in.permute(0, 2, 3, 1);<NEW_LINE>if (out.ordering() != 'c' || !Shape.strideDescendingCAscendingF(out))<NEW_LINE>out = workspaceMgr.dup(type, out, 'c');<NEW_LINE>return workspaceMgr.leverageTo(type, out.reshape('c', shape[0] * shape[2] * shape[3], shape[1]));<NEW_LINE>} else {<NEW_LINE>// Reshape: from [n,h,w,c] to [n*h*w,c]<NEW_LINE>if (in.ordering() != 'c' || !Shape.strideDescendingCAscendingF(in))<NEW_LINE>in = workspaceMgr.dup(type, in, 'c');<NEW_LINE>return workspaceMgr.leverageTo(type, in.reshape('c', shape[0] * shape[1] * shape[2<MASK><NEW_LINE>}<NEW_LINE>}
], shape[3]));
1,542,888
private void continueProtocolFlowToClient(State state) {<NEW_LINE>TlsAction clientHelloAction = state.getWorkflowTrace().getTlsActions().get(0);<NEW_LINE>WorkflowTrace trace = new WorkflowConfigurationFactory(state.getConfig()).createWorkflowTrace(WorkflowTraceType.HANDSHAKE, RunningModeType.SERVER);<NEW_LINE>// Remove client hello action<NEW_LINE>trace.removeTlsAction(0);<NEW_LINE>trace.removeTlsAction(trace.getTlsActions().size() - 1);<NEW_LINE>state.getWorkflowTrace().removeTlsAction(0);<NEW_LINE>state.getConfig().setWorkflowExecutorShouldClose(true);<NEW_LINE>state.getConfig().setWorkflowExecutorShouldOpen(false);<NEW_LINE>for (TlsAction action : trace.getTlsActions()) {<NEW_LINE>state.getWorkflowTrace().addTlsAction(action);<NEW_LINE>}<NEW_LINE>WorkflowExecutor workflowExecutor = WorkflowExecutorFactory.<MASK><NEW_LINE>workflowExecutor.executeWorkflow();<NEW_LINE>// Glue client hello action back on<NEW_LINE>state.getWorkflowTrace().addTlsAction(0, clientHelloAction);<NEW_LINE>}
createWorkflowExecutor(WorkflowExecutorType.DEFAULT, state);
1,690,948
public static List<SqlPartitionValueItem> buildPartitionExprByString(String partExpr) {<NEW_LINE>List<SQLExpr> exprList = new ArrayList<>();<NEW_LINE>List<SqlPartitionValueItem> partExprSqlNodeList = new ArrayList<>();<NEW_LINE>MySqlExprParser parser = new MySqlExprParser(ByteString.from(partExpr));<NEW_LINE>Lexer lexer = parser.getLexer();<NEW_LINE>while (true) {<NEW_LINE>SQLExpr expr = parser.expr();<NEW_LINE>exprList.add(expr);<NEW_LINE>if (lexer.token() == Token.COMMA) {<NEW_LINE>lexer.nextToken();<NEW_LINE>}<NEW_LINE>if (lexer.token() == Token.EOF) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < exprList.size(); i++) {<NEW_LINE>SQLExpr expr = exprList.get(i);<NEW_LINE>SqlNode sqlNodePartExpr = FastSqlConstructUtils.convertToSqlNode(expr, context, null);<NEW_LINE>SqlPartitionValueItem valueItem = new SqlPartitionValueItem(sqlNodePartExpr);<NEW_LINE>if (expr instanceof SQLIdentifierExpr) {<NEW_LINE>if (MAXVALUE.equalsIgnoreCase(((SQLIdentifierExpr) expr).getSimpleName())) {<NEW_LINE>valueItem.setMaxValue(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>partExprSqlNodeList.add(valueItem);<NEW_LINE>}<NEW_LINE>return partExprSqlNodeList;<NEW_LINE>}
ContextParameters context = new ContextParameters(false);
1,406,551
Optional<ExecutableElement> findSetterMethodFor(Element field) {<NEW_LINE>String name = field.getSimpleName().toString();<NEW_LINE>if (field.asType().getKind() == TypeKind.BOOLEAN && name.length() > 2 && Character.isUpperCase(name.charAt(2))) {<NEW_LINE>name = name.replaceFirst("^(is)(.+)", "$2");<NEW_LINE>}<NEW_LINE>// FIXME refine this to discover one of possible overloaded methods with correct signature (i.e. single arg of field type)<NEW_LINE>TypeElement typeElement = classElementFor(field);<NEW_LINE>if (typeElement == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>String setterName = setterNameFor(name);<NEW_LINE>List<? extends Element> elements = typeElement.getEnclosedElements();<NEW_LINE>List<ExecutableElement> methods = ElementFilter.methodsIn(elements);<NEW_LINE>return methods.stream().filter(method -> {<NEW_LINE>String methodName = method.getSimpleName().toString();<NEW_LINE>if (setterName.equals(methodName)) {<NEW_LINE>Set<Modifier<MASK><NEW_LINE>return // it's not static<NEW_LINE>// it's either public or package visibility<NEW_LINE>!modifiers.contains(STATIC) && modifiers.contains(PUBLIC) || !(modifiers.contains(PRIVATE) || modifiers.contains(PROTECTED));<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}).findFirst();<NEW_LINE>}
> modifiers = method.getModifiers();
77,904
public void append(IRegion... region) {<NEW_LINE>for (IRegion r : region) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Assert.isLegal(r.getLength() >= 0, "Negative region length");<NEW_LINE>if (r.getLength() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>boolean hasOverlaps;<NEW_LINE>do {<NEW_LINE>hasOverlaps = false;<NEW_LINE>IRegion left = NavigableSetFloor(regions, r);<NEW_LINE>IRegion right = NavigableSetCeiling(regions, r);<NEW_LINE>if (overlap(left, r)) {<NEW_LINE>regions.remove(left);<NEW_LINE><MASK><NEW_LINE>hasOverlaps = true;<NEW_LINE>}<NEW_LINE>if (overlap(r, right)) {<NEW_LINE>regions.remove(right);<NEW_LINE>r = merge(r, right);<NEW_LINE>hasOverlaps = true;<NEW_LINE>}<NEW_LINE>} while (hasOverlaps);<NEW_LINE>regions.add(r);<NEW_LINE>}<NEW_LINE>validate();<NEW_LINE>}
r = merge(left, r);
947,944
public int performStreamDecode(Transport transport, int max_bytes) throws IOException {<NEW_LINE>protocol_bytes_last_read = 0;<NEW_LINE>data_bytes_last_read = 0;<NEW_LINE>long total_read = 0;<NEW_LINE>while (total_read < max_bytes) {<NEW_LINE>long bytes_read;<NEW_LINE>int read_lim = (int) (max_bytes - total_read);<NEW_LINE>ByteBuffer payload_buffer = buffers[1];<NEW_LINE>if (payload_buffer == null) {<NEW_LINE>int rem = length_buffer.remaining();<NEW_LINE>int lim = length_buffer.limit();<NEW_LINE>if (rem > read_lim) {<NEW_LINE>length_buffer.limit(length_buffer.position() + read_lim);<NEW_LINE>}<NEW_LINE>bytes_read = transport.read(buffers, 0, 1);<NEW_LINE>length_buffer.limit(lim);<NEW_LINE>protocol_bytes_last_read += bytes_read;<NEW_LINE>if (length_buffer.hasRemaining()) {<NEW_LINE>total_read += bytes_read;<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>length_buffer.flip();<NEW_LINE>int size = length_buffer.getInt();<NEW_LINE>if (size > MAX_MESSAGE_LENGTH || size < 0) {<NEW_LINE>Debug.out("Message size invalid for generic payload (" + size + ", " + transport.getTransportEndpoint().getProtocolEndpoint(<MASK><NEW_LINE>throw (new IOException("message too large"));<NEW_LINE>}<NEW_LINE>buffers[1] = ByteBuffer.allocate(size);<NEW_LINE>length_buffer.flip();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int rem = payload_buffer.remaining();<NEW_LINE>int lim = payload_buffer.limit();<NEW_LINE>if (rem > read_lim) {<NEW_LINE>payload_buffer.limit(payload_buffer.position() + read_lim);<NEW_LINE>}<NEW_LINE>bytes_read = transport.read(buffers, 1, 1);<NEW_LINE>payload_buffer.limit(lim);<NEW_LINE>data_bytes_last_read += bytes_read;<NEW_LINE>if (payload_buffer.hasRemaining()) {<NEW_LINE>total_read += bytes_read;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>payload_buffer.flip();<NEW_LINE>messages.add(new GenericMessage(msg_type, msg_desc, new DirectByteBuffer(payload_buffer), false));<NEW_LINE>buffers[1] = null;<NEW_LINE>}<NEW_LINE>total_read += bytes_read;<NEW_LINE>}<NEW_LINE>if (destroyed) {<NEW_LINE>throw (new IOException("decoder has been destroyed"));<NEW_LINE>}<NEW_LINE>return ((int) total_read);<NEW_LINE>}
).getAddress() + ")");
1,795,586
private JComponent createButtonPanel() {<NEW_LINE>JPanel fileChooserPanel = new JPanel(new GridLayout(1, 0));<NEW_LINE>fileChooserPanel.setBorder(new TitledBorder("Actions"));<NEW_LINE>fileChooser = new JFileChooser();<NEW_LINE>final JButton chooseFileButton = new JButton("Open...");<NEW_LINE>chooseFileButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent arg0) {<NEW_LINE>int returnVal = <MASK><NEW_LINE>if (returnVal == JFileChooser.APPROVE_OPTION) {<NEW_LINE>File file = fileChooser.getSelectedFile();<NEW_LINE>PlayerState currentState = player.getState();<NEW_LINE>player.load(file);<NEW_LINE>if (currentState == PlayerState.NO_FILE_LOADED || currentState == PlayerState.PLAYING) {<NEW_LINE>player.play();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// canceled<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fileChooserPanel.add(chooseFileButton);<NEW_LINE>stopButton = new JButton("Stop");<NEW_LINE>fileChooserPanel.add(stopButton);<NEW_LINE>stopButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent arg0) {<NEW_LINE>player.stop();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>playButton = new JButton("Play");<NEW_LINE>playButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent arg0) {<NEW_LINE>player.play();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fileChooserPanel.add(playButton);<NEW_LINE>pauzeButton = new JButton("Pauze");<NEW_LINE>pauzeButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent arg0) {<NEW_LINE>player.pauze();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fileChooserPanel.add(pauzeButton);<NEW_LINE>return fileChooserPanel;<NEW_LINE>}
fileChooser.showOpenDialog(ConstantQAudioPlayer.this);
742,208
private static byte[] buildHeader(byte[] src) {<NEW_LINE>byte[] result = null;<NEW_LINE>final long length = src.length;<NEW_LINE>if (length < 251) {<NEW_LINE>result = new byte[1];<NEW_LINE>result[0] = (byte) length;<NEW_LINE>} else if (length < 0x10000L) {<NEW_LINE>result = new byte[3];<NEW_LINE>result[0] = (byte) 252;<NEW_LINE>result[1] = (byte) (length & 0xff);<NEW_LINE>result[2] = (byte) (length >>> 8);<NEW_LINE>} else if (length < 0x1000000L) {<NEW_LINE>result = new byte[4];<NEW_LINE>result[0] = (byte) 253;<NEW_LINE>result[1] = (byte) (length & 0xff);<NEW_LINE>result[2] = (byte) (length >>> 8);<NEW_LINE>result[3] = (byte) (length >>> 16);<NEW_LINE>} else {<NEW_LINE>result = new byte[9];<NEW_LINE>result[0] = (byte) 254;<NEW_LINE>result[1] = (byte) (length & 0xff);<NEW_LINE>result[2] = (byte) (length >>> 8);<NEW_LINE>result[3] = (byte<MASK><NEW_LINE>result[4] = (byte) (length >>> 24);<NEW_LINE>result[5] = (byte) (length >>> 32);<NEW_LINE>result[6] = (byte) (length >>> 40);<NEW_LINE>result[7] = (byte) (length >>> 48);<NEW_LINE>result[8] = (byte) (length >>> 56);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
) (length >>> 16);
1,614,218
private void updateViewFaceShape() {<NEW_LINE>float faceShape = <MASK><NEW_LINE>mBoxIntensityChin.setVisibility(faceShape != 4 ? GONE : VISIBLE);<NEW_LINE>mBoxIntensityForehead.setVisibility(faceShape != 4 ? GONE : VISIBLE);<NEW_LINE>mBoxIntensityNose.setVisibility(faceShape != 4 ? GONE : VISIBLE);<NEW_LINE>mBoxIntensityMouth.setVisibility(faceShape != 4 ? GONE : VISIBLE);<NEW_LINE>mFaceShape4Radio.setVisibility(isHeightPerformance ? GONE : VISIBLE);<NEW_LINE>if (isHeightPerformance && mFaceShapeRadioGroup.getCheckedRadioButtonId() == R.id.face_shape_4) {<NEW_LINE>mFaceShapeRadioGroup.check(R.id.face_shape_3_default);<NEW_LINE>}<NEW_LINE>onChangeFaceBeautyLevel(R.id.beauty_box_face_shape);<NEW_LINE>onChangeFaceBeautyLevel(R.id.beauty_box_eye_enlarge);<NEW_LINE>onChangeFaceBeautyLevel(R.id.beauty_box_cheek_thinning);<NEW_LINE>onChangeFaceBeautyLevel(R.id.beauty_box_intensity_chin);<NEW_LINE>onChangeFaceBeautyLevel(R.id.beauty_box_intensity_forehead);<NEW_LINE>onChangeFaceBeautyLevel(R.id.beauty_box_intensity_nose);<NEW_LINE>onChangeFaceBeautyLevel(R.id.beauty_box_intensity_mouth);<NEW_LINE>}
getValue(R.id.beauty_box_face_shape);
1,499,254
public void refresh(boolean force) {<NEW_LINE>if (drawCanvas == null || drawCanvas.isDisposed())<NEW_LINE>return;<NEW_LINE>Rectangle bounds = drawCanvas.getClientArea();<NEW_LINE>if (bounds.height < 30 || bounds.width < 100 || bounds.width > 10000 || bounds.height > 10000)<NEW_LINE>return;<NEW_LINE>// inflate # of values only if necessary<NEW_LINE>if (bounds.width > maxEntries) {<NEW_LINE>try {<NEW_LINE>this_mon.enter();<NEW_LINE>while (maxEntries < bounds.width) maxEntries += 1000;<NEW_LINE>for (int i = 0; i < all_values.length; i++) {<NEW_LINE>int[] newValues = new int[maxEntries];<NEW_LINE>System.arraycopy(all_values[i], 0, newValues, 0, all_values[i].length);<NEW_LINE>all_values[i] = newValues;<NEW_LINE>}<NEW_LINE>int[] newAges = new int[maxEntries];<NEW_LINE>System.arraycopy(ages, 0, newAges, 0, ages.length);<NEW_LINE>ages = newAges;<NEW_LINE>} finally {<NEW_LINE>this_mon.exit();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean sizeChanged = (oldSize == null || oldSize.x != bounds.width || oldSize.y != bounds.height);<NEW_LINE>oldSize = new Point(<MASK><NEW_LINE>internalLoop++;<NEW_LINE>if (internalLoop > graphicsUpdate)<NEW_LINE>internalLoop = 0;<NEW_LINE>if (internalLoop == 0 || sizeChanged || force) {<NEW_LINE>drawChart(sizeChanged);<NEW_LINE>// second drawing required to pick up and redraw the scale correctly<NEW_LINE>if (force) {<NEW_LINE>drawChart(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>drawCanvas.redraw();<NEW_LINE>drawCanvas.update();<NEW_LINE>}
bounds.width, bounds.height);
712,823
private void handleLocally(HttpActionHandler actionHandler, HttpObjectCallback httpObjectCallback, HttpRequest request, ResponseWriter responseWriter, boolean synchronous, String clientId) {<NEW_LINE>if (MockServerLogger.isEnabled(TRACE)) {<NEW_LINE>mockServerLogger.logEvent(new LogEntry().setLogLevel(TRACE).setHttpRequest(request).setMessageFormat("locally sending request{}to client " + clientId).setArguments(request));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>HttpResponse callbackResponse = LocalCallbackRegistry.retrieveResponseCallback<MASK><NEW_LINE>actionHandler.writeResponseActionResponse(callbackResponse, responseWriter, request, httpObjectCallback, synchronous);<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>if (MockServerLogger.isEnabled(WARN)) {<NEW_LINE>mockServerLogger.logEvent(new LogEntry().setLogLevel(WARN).setHttpRequest(request).setMessageFormat("returning{}because client " + clientId + " response callback throw an exception").setArguments(notFoundResponse()).setThrowable(throwable));<NEW_LINE>}<NEW_LINE>actionHandler.writeResponseActionResponse(notFoundResponse(), responseWriter, request, httpObjectCallback, synchronous);<NEW_LINE>}<NEW_LINE>}
(clientId).handle(request);
319,413
public static VersionInfoExResponse responseVersionEx(String branch, String version) {<NEW_LINE>if (lastModified < walletVersionsSource.lastModified()) {<NEW_LINE>lastModified = walletVersionsSource.lastModified();<NEW_LINE>readVersions();<NEW_LINE>}<NEW_LINE>WalletVersion clientVersion = WalletVersion.from(version);<NEW_LINE>if (clientVersion == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// todo: add different warnings depending on branch/version<NEW_LINE>if (branch.equals("android") && version.startsWith("1.1.1")) {<NEW_LINE>// List<FeatureWarning> warnings = new ArrayList<FeatureWarning>();<NEW_LINE>// warnings.add(new FeatureWarning(Feature.MAIN_SCREEN, WarningKind.WARN, "Warning", URI.create("https://mycelium.com")));<NEW_LINE>// return new VersionInfoExResponse("2.3.2", "", URI.create("https://mycelium.com/bitcoinwallet"), warnings);<NEW_LINE>}<NEW_LINE>// check if we have a newer version<NEW_LINE>if (latestVersionsEx.containsKey(branch)) {<NEW_LINE>Set<WalletVersion> <MASK><NEW_LINE>for (WalletVersion latestVersion : walletVersions) {<NEW_LINE>if (latestVersion.isGreaterThan(clientVersion)) {<NEW_LINE>return new VersionInfoExResponse(latestVersion.toString(), "Update available", URI.create("https://wallet.mycelium.com"), null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// return null -> no important update or warnings available for this branch/version<NEW_LINE>return null;<NEW_LINE>}
walletVersions = latestVersionsEx.get(branch);
1,717,347
public void voidIt(final DocumentTableFields docFields) {<NEW_LINE>final I_C_BankStatement bankStatement = extractBankStatement(docFields);<NEW_LINE>final DocStatus docStatus = DocStatus.ofNullableCodeOrUnknown(bankStatement.getDocStatus());<NEW_LINE>if (docStatus.isClosedReversedOrVoided()) {<NEW_LINE>throw new AdempiereException("Document Closed: " + docStatus);<NEW_LINE>}<NEW_LINE>// Not Processed<NEW_LINE>if (DocStatus.Drafted.equals(docStatus) || DocStatus.Invalid.equals(docStatus) || DocStatus.InProgress.equals(docStatus) || DocStatus.Approved.equals(docStatus) || DocStatus.NotApproved.equals(docStatus)) {<NEW_LINE>// Std Period open?<NEW_LINE>} else {<NEW_LINE>MPeriod.testPeriodOpen(Env.getCtx(), bankStatement.getStatementDate(), X_C_DocType.DOCBASETYPE_BankStatement, bankStatement.getAD_Org_ID());<NEW_LINE>services.deleteFactsForBankStatement(bankStatement);<NEW_LINE>}<NEW_LINE>final BankStatementId bankStatementId = BankStatementId.ofRepoId(bankStatement.getC_BankStatement_ID());<NEW_LINE>final List<I_C_BankStatementLine> lines = services.getBankStatementLinesByBankStatementId(bankStatementId);<NEW_LINE>services.unlinkPaymentsAndDeleteReferences(lines);<NEW_LINE>//<NEW_LINE>// Set lines to 0<NEW_LINE>for (final I_C_BankStatementLine line : lines) {<NEW_LINE>if (line.getStmtAmt().signum() != 0) {<NEW_LINE>final String description = buildVoidDescription(line);<NEW_LINE>addDescription(line, description);<NEW_LINE>//<NEW_LINE>line.setStmtAmt(BigDecimal.ZERO);<NEW_LINE>line.setTrxAmt(BigDecimal.ZERO);<NEW_LINE>line.setBankFeeAmt(BigDecimal.ZERO);<NEW_LINE>line.setChargeAmt(BigDecimal.ZERO);<NEW_LINE>line.setInterestAmt(BigDecimal.ZERO);<NEW_LINE>//<NEW_LINE>// Cash/bank transfer<NEW_LINE>final BankStatementLineId linkedBankStatementLineId = BankStatementLineId.ofRepoIdOrNull(line.getLink_BankStatementLine_ID());<NEW_LINE>if (linkedBankStatementLineId != null) {<NEW_LINE>final I_C_BankStatementLine lineFrom = services.getBankStatementLineById(linkedBankStatementLineId);<NEW_LINE>if (lineFrom.getLink_BankStatementLine_ID() == line.getC_BankStatementLine_ID()) {<NEW_LINE>lineFrom.setLink_BankStatementLine_ID(-1);<NEW_LINE>services.save(lineFrom);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>services.save(line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addDescription(bankStatement, services.getMsg(MSG_VOIDED));<NEW_LINE><MASK><NEW_LINE>bankStatement.setProcessed(true);<NEW_LINE>bankStatement.setDocAction(IDocument.ACTION_None);<NEW_LINE>}
bankStatement.setStatementDifference(BigDecimal.ZERO);
849,464
public void runSafety() {<NEW_LINE>// PackageManagerInternal mPackageManagerInt;<NEW_LINE>// https://github.com/LineageOS/android_frameworks_base/blob/lineage-17.1/services/core/java/com/android/server/am/ActivityManagerService.java<NEW_LINE>Object mPackageManagerInt = XposedHelpersExt.callMethodWithPreferredNames(ams, new String<MASK><NEW_LINE>XLog.w("AMSPackageInternalHooks installPackageManagerInternalHooks, mPackageManagerInt: %s", mPackageManagerInt);<NEW_LINE>if (mPackageManagerInt == null)<NEW_LINE>return;<NEW_LINE>Object proxy = new PackageManagerInternalProxyFactory(classLoader).newProxy(mPackageManagerInt, ServiceConfigs.baseServerTmpDir());<NEW_LINE>XLog.w("AMSPackageInternalHooks installPackageManagerInternalHooks, proxy: %s", proxy);<NEW_LINE>XposedHelpers.setObjectField(ams, "mPackageManagerInt", proxy);<NEW_LINE>XLog.w("AMSPackageInternalHooks installPackageManagerInternalHooks success");<NEW_LINE>}
[] { "getPackageManagerInternal", "getPackageManagerInternalLocked" });
1,008,086
protected IToken mapToken(Symbol symbol, Symbol symbolStart, boolean returnDefaultContentType) {<NEW_LINE>switch(((JSTokenTypeSymbol) symbol).token) {<NEW_LINE>case SDOC:<NEW_LINE>return returnToken(symbol, symbolStart, returnDefaultContentType, symbol.getEnd() - symbol.getStart() + 1, JS_DOC_TOKEN);<NEW_LINE>case STRING_DOUBLE:<NEW_LINE>return returnToken(symbol, symbolStart, returnDefaultContentType, symbol.getEnd() - symbol.getStart() + 1, STRING_DOUBLE_TOKEN);<NEW_LINE>case STRING_SINGLE:<NEW_LINE>return returnToken(symbol, symbolStart, returnDefaultContentType, symbol.getEnd() - symbol.getStart() + 1, STRING_SINGLE_TOKEN);<NEW_LINE>case REGEX:<NEW_LINE>return returnToken(symbol, symbolStart, returnDefaultContentType, symbol.getEnd() - symbol.<MASK><NEW_LINE>case MULTILINE_COMMENT:<NEW_LINE>return returnToken(symbol, symbolStart, returnDefaultContentType, symbol.getEnd() - symbol.getStart() + 1, MULTILINE_COMMENT_TOKEN);<NEW_LINE>case SINGLELINE_COMMENT:<NEW_LINE>return returnToken(symbol, symbolStart, returnDefaultContentType, symbol.getEnd() - symbol.getStart() + 1, SINGLELINE_COMMENT_TOKEN);<NEW_LINE>case TEMPLATE_HEAD:<NEW_LINE>case TEMPLATE_MIDDLE:<NEW_LINE>case TEMPLATE_TAIL:<NEW_LINE>case NO_SUB_TEMPLATE:<NEW_LINE>return returnToken(symbol, symbolStart, returnDefaultContentType, symbol.getEnd() - symbol.getStart() + 1, TEMPLATE_TOKEN);<NEW_LINE>case EOF:<NEW_LINE>return returnToken(symbol, symbolStart, returnDefaultContentType, 0, Token.EOF);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
getStart() + 1, REGEXP_TOKEN);
371,934
public static IMantisStageMetadata convertMantisStageMetadataWriteableToMantisStageMetadata(MantisStageMetadata stageMeta, LifecycleEventPublisher eventPublisher, boolean skipAddingWorkerMetaData) {<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("DataFormatAdapter:converting stage {}, skipadding workers {}", stageMeta, skipAddingWorkerMetaData);<NEW_LINE>}<NEW_LINE>Optional<JobId> jIdOp = JobId.<MASK><NEW_LINE>if (!jIdOp.isPresent()) {<NEW_LINE>new IllegalArgumentException("Invalid jobid " + stageMeta.getJobId());<NEW_LINE>}<NEW_LINE>IMantisStageMetadata newStageMeta = new MantisStageMetadataImpl.Builder().withHardConstraints(stageMeta.getHardConstraints()).withSoftConstraints(stageMeta.getSoftConstraints()).withJobId(jIdOp.get()).withMachineDefinition(stageMeta.getMachineDefinition()).withNumStages(stageMeta.getNumStages()).withNumWorkers(stageMeta.getNumWorkers()).withScalingPolicy(stageMeta.getScalingPolicy()).withStageNum(stageMeta.getStageNum()).isScalable(stageMeta.getScalable()).build();<NEW_LINE>if (!skipAddingWorkerMetaData) {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Skip adding workers to stage meta");<NEW_LINE>}<NEW_LINE>stageMeta.getAllWorkers().stream().forEach((mantisWorkerMetadata) -> {<NEW_LINE>((MantisStageMetadataImpl) newStageMeta).addWorkerIndex(convertMantisWorkerMetadataWriteableToMantisWorkerMetadata(mantisWorkerMetadata, eventPublisher));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("DataFormatAdapter:converted stage {}", newStageMeta);<NEW_LINE>}<NEW_LINE>return newStageMeta;<NEW_LINE>}
fromId(stageMeta.getJobId());
695,735
public void drawSeries(Canvas canvas, Paint paint, List<Float> points, XYSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, int startIndex) {<NEW_LINE>int seriesNr = mDataset.getSeriesCount();<NEW_LINE>int length = points.size();<NEW_LINE>paint.setColor(seriesRenderer.getColor());<NEW_LINE>paint.setStyle(Style.FILL);<NEW_LINE>float halfDiffX = getHalfDiffX(points, length, seriesNr);<NEW_LINE>Point[] yvals = new Point[length / 2];<NEW_LINE>for (int i = 0; i < length; i += 2) {<NEW_LINE>Point p = new Point();<NEW_LINE>p.seriesIndex = i / 2;<NEW_LINE>p.yval = points.get(i + 1);<NEW_LINE>yvals[i / 2] = p;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < length; i += 2) {<NEW_LINE>float x = points.get(i);<NEW_LINE>float y = points.get(i + 1);<NEW_LINE>if (mType == Type.HEAPED && seriesIndex > 0) {<NEW_LINE>float lastY = mPreviousSeriesPoints.get(i + 1);<NEW_LINE>y = y + (lastY - yAxisValue);<NEW_LINE>points.set(i + 1, y);<NEW_LINE>drawBar(canvas, x, lastY, x, y, halfDiffX, seriesNr, seriesIndex, paint);<NEW_LINE>} else {<NEW_LINE>drawBar(canvas, x, yAxisValue, x, y, halfDiffX, seriesNr, seriesIndex, paint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>paint.<MASK><NEW_LINE>mPreviousSeriesPoints = points;<NEW_LINE>}
setColor(seriesRenderer.getColor());
533,331
private void printPostInstallStepsRedHat(File serviceFile) {<NEW_LINE>System.out.println(INTENSITY_BOLD + "RedHat/Fedora/CentOS Linux system detected (SystemV):" + INTENSITY_NORMAL);<NEW_LINE>System.out.println(" To install the service:");<NEW_LINE>System.out.println(" $ ln -s " + serviceFile.getPath() + " /etc/init.d/");<NEW_LINE>System.out.println(" $ chkconfig " + serviceFile.getName() + " --add");<NEW_LINE>System.out.println("");<NEW_LINE>System.out.println(" To start the service when the machine is rebooted:");<NEW_LINE>System.out.println(" $ chkconfig " + serviceFile.getName() + " on");<NEW_LINE>System.out.println("");<NEW_LINE>System.out.println(" To disable starting the service when the machine is rebooted:");<NEW_LINE>System.out.println(" $ chkconfig " + serviceFile.getName() + " off");<NEW_LINE>System.out.println("");<NEW_LINE>System.out.println(" To start the service:");<NEW_LINE>System.out.println(" $ service " + serviceFile.getName() + " start");<NEW_LINE>System.out.println("");<NEW_LINE>System.out.println(" To stop the service:");<NEW_LINE>System.out.println(" $ service " + serviceFile.getName() + " stop");<NEW_LINE>System.out.println("");<NEW_LINE>System.out.println(" To uninstall the service:");<NEW_LINE>System.out.println(" $ chkconfig " + <MASK><NEW_LINE>System.out.println(" $ rm /etc/init.d/" + serviceFile.getPath());<NEW_LINE>}
serviceFile.getName() + " --del");
1,168,392
private SecureStoreConfig handleVault(Node vaultRoot) {<NEW_LINE>String address = null;<NEW_LINE>String secretPath = null;<NEW_LINE>String token = null;<NEW_LINE>SSLConfig sslConfig = null;<NEW_LINE>int pollingInterval = VaultSecureStoreConfig.DEFAULT_POLLING_INTERVAL;<NEW_LINE>for (Node n : childElements(vaultRoot)) {<NEW_LINE>String name = cleanNodeName(n);<NEW_LINE>if (matches("address", name)) {<NEW_LINE>address = getTextContent(n);<NEW_LINE>} else if (matches("secret-path", name)) {<NEW_LINE>secretPath = getTextContent(n);<NEW_LINE>} else if (matches("token", name)) {<NEW_LINE>token = getTextContent(n);<NEW_LINE>} else if (matches("ssl", name)) {<NEW_LINE>sslConfig = parseSslConfig(n);<NEW_LINE>} else if (matches("polling-interval", name)) {<NEW_LINE>pollingInterval = parseInt(getTextContent(n));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new VaultSecureStoreConfig(address, secretPath, token).setSSLConfig<MASK><NEW_LINE>}
(sslConfig).setPollingInterval(pollingInterval);
1,764,689
public long writeEvent(byte[] eventArray) throws IOException {<NEW_LINE>lastWrite = Instant.now();<NEW_LINE>ByteBuffer <MASK><NEW_LINE>RecordType nextType = null;<NEW_LINE>ByteBuffer slice = eventBuffer.slice();<NEW_LINE>long startPosition = channel.position();<NEW_LINE>while (slice.hasRemaining()) {<NEW_LINE>if (posInBlock + RECORD_HEADER_SIZE + 1 > BLOCK_SIZE) {<NEW_LINE>channel.position((++currentBlockIdx) * BLOCK_SIZE + VERSION_SIZE);<NEW_LINE>posInBlock = 0;<NEW_LINE>}<NEW_LINE>nextType = getNextType(slice, nextType);<NEW_LINE>int originalLimit = slice.limit();<NEW_LINE>int nextRecordSize = Math.min(remainingInBlock() - RECORD_HEADER_SIZE, slice.remaining());<NEW_LINE>OptionalInt optTotalSize = (nextType == RecordType.START) ? OptionalInt.of(eventArray.length) : OptionalInt.empty();<NEW_LINE>slice.limit(nextRecordSize);<NEW_LINE>Checksum checksum = new CRC32();<NEW_LINE>checksum.update(slice.array(), slice.arrayOffset() + slice.position(), nextRecordSize);<NEW_LINE>posInBlock += writeRecordHeader(new RecordHeader(nextType, nextRecordSize, optTotalSize, (int) checksum.getValue()));<NEW_LINE>posInBlock += channel.write(slice);<NEW_LINE>slice.limit(originalLimit);<NEW_LINE>slice = slice.slice();<NEW_LINE>}<NEW_LINE>return channel.position() - startPosition;<NEW_LINE>}
eventBuffer = ByteBuffer.wrap(eventArray);
31,713
// deleteLanguageById.<NEW_LINE>private void dbUpsert(final Language language) throws DotDataException {<NEW_LINE>if (language.getId() == 0) {<NEW_LINE>language.setId(APILocator.getDeterministicIdentifierAPI().generateDeterministicIdBestEffort(language));<NEW_LINE>}<NEW_LINE>Language tester = <MASK><NEW_LINE>if (tester != null) {<NEW_LINE>new DotConnect().setSQL(UPDATE_LANGUAGE_BY_ID).addParam(language.getLanguageCode().toLowerCase()).addParam(language.getCountryCode()).addParam(language.getLanguage()).addParam(language.getCountry()).addParam(language.getId()).loadResult();<NEW_LINE>} else {<NEW_LINE>DotConnect dc = new DotConnect().setSQL(INSERT_LANGUAGE_BY_ID).addParam(language.getId()).addParam(language.getLanguageCode().toLowerCase()).addParam(language.getCountryCode()).addParam(language.getLanguage()).addParam(language.getCountry());<NEW_LINE>dc.loadResult();<NEW_LINE>}<NEW_LINE>CacheLocator.getLanguageCache().removeLanguage(language);<NEW_LINE>}
getLanguage(language.getId());
1,209,930
public static GetNotificationConfigResponse unmarshall(GetNotificationConfigResponse getNotificationConfigResponse, UnmarshallerContext context) {<NEW_LINE>getNotificationConfigResponse.setRequestId(context.stringValue("GetNotificationConfigResponse.RequestId"));<NEW_LINE>getNotificationConfigResponse.setSuccess(context.booleanValue("GetNotificationConfigResponse.Success"));<NEW_LINE>getNotificationConfigResponse.setCode(context.stringValue("GetNotificationConfigResponse.Code"));<NEW_LINE>getNotificationConfigResponse.setMessage(context.stringValue("GetNotificationConfigResponse.Message"));<NEW_LINE>getNotificationConfigResponse.setHttpStatusCode(context.integerValue("GetNotificationConfigResponse.HttpStatusCode"));<NEW_LINE>getNotificationConfigResponse.setProducerId(context.stringValue("GetNotificationConfigResponse.ProducerId"));<NEW_LINE>getNotificationConfigResponse.setAccessPoint(context.stringValue("GetNotificationConfigResponse.AccessPoint"));<NEW_LINE>getNotificationConfigResponse.setTopic<MASK><NEW_LINE>List<SubscriptionsItem> subscriptions = new ArrayList<SubscriptionsItem>();<NEW_LINE>for (int i = 0; i < context.lengthValue("GetNotificationConfigResponse.Subscriptions.Length"); i++) {<NEW_LINE>SubscriptionsItem subscriptionsItem = new SubscriptionsItem();<NEW_LINE>subscriptionsItem.setName(context.stringValue("GetNotificationConfigResponse.Subscriptions[" + i + "].Name"));<NEW_LINE>subscriptionsItem.setDisplayName(context.stringValue("GetNotificationConfigResponse.Subscriptions[" + i + "].DisplayName"));<NEW_LINE>subscriptionsItem.setSelected(context.booleanValue("GetNotificationConfigResponse.Subscriptions[" + i + "].Selected"));<NEW_LINE>subscriptions.add(subscriptionsItem);<NEW_LINE>}<NEW_LINE>getNotificationConfigResponse.setSubscriptions(subscriptions);<NEW_LINE>return getNotificationConfigResponse;<NEW_LINE>}
(context.stringValue("GetNotificationConfigResponse.Topic"));
1,171,599
private void removeConfigInfoByIdsAtomic(final String ids) {<NEW_LINE>if (StringUtils.isBlank(ids)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuilder sql = new StringBuilder(SQL_DELETE_CONFIG_INFO_BY_IDS);<NEW_LINE>sql.append("id in (");<NEW_LINE>List<Long> paramList = new ArrayList<>();<NEW_LINE>String[] tagArr = ids.split(",");<NEW_LINE>for (int i = 0; i < tagArr.length; i++) {<NEW_LINE>if (i != 0) {<NEW_LINE>sql.append(", ");<NEW_LINE>}<NEW_LINE>sql.append("?");<NEW_LINE>paramList.add(Long.<MASK><NEW_LINE>}<NEW_LINE>sql.append(") ");<NEW_LINE>try {<NEW_LINE>jt.update(sql.toString(), paramList.toArray());<NEW_LINE>} catch (CannotGetJdbcConnectionException e) {<NEW_LINE>fatalLog.error("[db-error] " + e.toString(), e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
valueOf(tagArr[i]));
518,832
public static void writeScoresFile(final Map<Integer, PSPathogenTaxonScore> scores, final PSTree tree, final String filePath) {<NEW_LINE>final String header = "tax_id\ttaxonomy\ttype\tname\t" + PSPathogenTaxonScore.outputHeader;<NEW_LINE>try (final PrintStream printStream = new PrintStream(BucketUtils.createFile(filePath))) {<NEW_LINE>printStream.println(header);<NEW_LINE>for (final int key : scores.keySet()) {<NEW_LINE>final String name = tree.getNameOf(key);<NEW_LINE>final String rank = tree.getRankOf(key);<NEW_LINE>final List<String> path = tree.getPathOf(key).stream().map(tree::getNameOf).collect(Collectors.toList());<NEW_LINE>Collections.reverse(path);<NEW_LINE>final String taxonomy = String.join("|", path);<NEW_LINE>final String line = key + "\t" + taxonomy + "\t" + rank + "\t" + name + "\t" + scores.get(key).toString(tree);<NEW_LINE>printStream.println(line.replace(" ", "_"));<NEW_LINE>}<NEW_LINE>if (printStream.checkError()) {<NEW_LINE>throw new UserException.CouldNotCreateOutputFile<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(filePath, new IOException());
1,175,364
public void process(CodeGenContext context) throws Exception {<NEW_LINE>JavaCodeGenContext ctx = (JavaCodeGenContext) context;<NEW_LINE>int projectId = ctx.getProjectId();<NEW_LINE>File dir = new File(String.format("%s/%s/java", ctx.getGeneratePath(), projectId));<NEW_LINE>VelocityContext vltCcontext = GenUtils.buildDefaultVelocityContext();<NEW_LINE>vltCcontext.put("host", ctx.getDalConfigHost());<NEW_LINE>GenUtils.mergeVelocityContext(vltCcontext, String.format("%s/dal.xml", dir.getAbsolutePath()), "templates/java/Dal.config.java.tpl");<NEW_LINE>vltCcontext.put(<MASK><NEW_LINE>GenUtils.mergeVelocityContext(vltCcontext, String.format("%s/datasource.xml", dir.getAbsolutePath()), "templates/java/DataSource.java.tpl");<NEW_LINE>}
"host", ctx.getContextHost());
1,632,434
public MHRProcess reverseIt(boolean isAccrual) {<NEW_LINE>Timestamp currentDate = new Timestamp(System.currentTimeMillis());<NEW_LINE>Optional<Timestamp> loginDateOptional = Optional.of(Env.getContextAsDate(getCtx(), "#Date"));<NEW_LINE>Timestamp reversalDate = isAccrual ? loginDateOptional.orElseGet(() -> currentDate) : getDateAcct();<NEW_LINE>MPeriod.testPeriodOpen(getCtx(), reversalDate, getC_DocType_ID(), <MASK><NEW_LINE>MHRProcess reversal = copyFrom(this, getDateAcct(), getC_DocType_ID(), false, get_TrxName(), true);<NEW_LINE>if (reversal == null) {<NEW_LINE>processMsg = "Could not create Payroll Process Reversal";<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>reversal.setReversal_ID(getHR_Process_ID());<NEW_LINE>reversal.setProcessing(false);<NEW_LINE>reversal.setDocStatus(DOCSTATUS_Reversed);<NEW_LINE>reversal.setDocAction(DOCACTION_None);<NEW_LINE>reversal.setProcessed(true);<NEW_LINE>reversal.setName("(" + reversal.getDocumentNo() + " -> " + getDocumentNo() + ")");<NEW_LINE>reversal.saveEx();<NEW_LINE>processMsg = reversal.getDocumentNo();<NEW_LINE>setProcessed(true);<NEW_LINE>setReversal_ID(reversal.getHR_Process_ID());<NEW_LINE>// may come from void<NEW_LINE>setDocStatus(DOCSTATUS_Reversed);<NEW_LINE>setDocAction(DOCACTION_None);<NEW_LINE>setProcessed(true);<NEW_LINE>setDocAction(DOCACTION_None);<NEW_LINE>setName("(" + getName() + " <- " + reversal.getDocumentNo() + ")");<NEW_LINE>saveEx();<NEW_LINE>return reversal;<NEW_LINE>}
getAD_Org_ID(), get_TrxName());
7,315
static ChaiProvider openProxyChaiProvider(final ChaiProviderFactory chaiProviderFactory, final SessionLabel sessionLabel, final LdapProfile ldapProfile, final DomainConfig config, final StatisticsService statisticsManager) throws PwmUnrecoverableException {<NEW_LINE>LOGGER.trace(sessionLabel, () -> "opening new ldap proxy connection");<NEW_LINE>final String proxyDN = <MASK><NEW_LINE>final PasswordData proxyPW = ldapProfile.readSettingAsPassword(PwmSetting.LDAP_PROXY_USER_PASSWORD);<NEW_LINE>try {<NEW_LINE>return createChaiProvider(chaiProviderFactory, sessionLabel, ldapProfile, config, proxyDN, proxyPW);<NEW_LINE>} catch (final ChaiUnavailableException e) {<NEW_LINE>if (statisticsManager != null) {<NEW_LINE>statisticsManager.incrementValue(Statistic.LDAP_UNAVAILABLE_COUNT);<NEW_LINE>}<NEW_LINE>final StringBuilder errorMsg = new StringBuilder();<NEW_LINE>errorMsg.append("error connecting as proxy user: ");<NEW_LINE>final Optional<PwmError> pwmError = PwmError.forChaiError(e.getErrorCode());<NEW_LINE>if (pwmError.isPresent() && pwmError.get() != PwmError.ERROR_INTERNAL) {<NEW_LINE>errorMsg.append(new ErrorInformation(pwmError.get(), e.getMessage()).toDebugStr());<NEW_LINE>} else {<NEW_LINE>errorMsg.append(e.getMessage());<NEW_LINE>}<NEW_LINE>final ErrorInformation errorInformation = new ErrorInformation(PwmError.ERROR_DIRECTORY_UNAVAILABLE, errorMsg.toString());<NEW_LINE>LOGGER.fatal(sessionLabel, () -> "check ldap proxy settings: " + errorInformation.toDebugStr());<NEW_LINE>throw new PwmUnrecoverableException(errorInformation);<NEW_LINE>}<NEW_LINE>}
ldapProfile.readSettingAsString(PwmSetting.LDAP_PROXY_USER_DN);
395,005
private static void trySendContextCountSimple(RegressionEnvironment env, int numThreads, int numRepeats) {<NEW_LINE>SupportMTUpdateListener listener = new SupportMTUpdateListener();<NEW_LINE>env.statement("select").addListener(listener);<NEW_LINE>List<Object>[<MASK><NEW_LINE>for (int t = 0; t < numThreads; t++) {<NEW_LINE>eventsPerThread[t] = new ArrayList<>();<NEW_LINE>for (int i = 0; i < numRepeats; i++) {<NEW_LINE>eventsPerThread[t].add(new SupportBean_S0(-1, "E" + i, i + "_" + t));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ExecutorService threadPool = Executors.newFixedThreadPool(numThreads, new SupportThreadFactory(MultithreadContextCountSimple.class));<NEW_LINE>Future<Boolean>[] future = new Future[numThreads];<NEW_LINE>for (int i = 0; i < numThreads; i++) {<NEW_LINE>Callable<Boolean> callable = new SendEventCallable(i, env.runtime(), eventsPerThread[i].iterator());<NEW_LINE>future[i] = threadPool.submit(callable);<NEW_LINE>}<NEW_LINE>SupportCompileDeployUtil.threadSleep(2000);<NEW_LINE>threadPool.shutdown();<NEW_LINE>SupportCompileDeployUtil.threadpoolAwait(threadPool, 10, TimeUnit.SECONDS);<NEW_LINE>SupportCompileDeployUtil.assertFutures(future);<NEW_LINE>EventBean[] result = listener.getNewDataListFlattened();<NEW_LINE>Set<String> received = new LinkedHashSet<>();<NEW_LINE>for (EventBean event : result) {<NEW_LINE>String key = (String) event.get("p01");<NEW_LINE>if (received.contains(key)) {<NEW_LINE>fail("key " + key + " received multiple times");<NEW_LINE>}<NEW_LINE>received.add(key);<NEW_LINE>}<NEW_LINE>if (received.size() != numRepeats * numThreads) {<NEW_LINE>log.info("Received are " + received.size() + " entries");<NEW_LINE>fail();<NEW_LINE>}<NEW_LINE>}
] eventsPerThread = new ArrayList[numThreads];
1,810,515
private static void basicInfo(List<String> textRecord, Person person, long endTime) {<NEW_LINE>String name = (String) person.attributes.get(Person.NAME);<NEW_LINE>textRecord.add(name);<NEW_LINE>// "underline" the characters in the name<NEW_LINE>textRecord.add(name<MASK><NEW_LINE>String race = (String) person.attributes.get(Person.RACE);<NEW_LINE>String ethnicity = (String) person.attributes.get(Person.ETHNICITY);<NEW_LINE>String displayEthnicity;<NEW_LINE>if (ethnicity.equals("hispanic")) {<NEW_LINE>displayEthnicity = "Hispanic";<NEW_LINE>} else {<NEW_LINE>displayEthnicity = "Non-Hispanic";<NEW_LINE>}<NEW_LINE>textRecord.add("Race: " + WordUtils.capitalize(race));<NEW_LINE>textRecord.add("Ethnicity: " + displayEthnicity);<NEW_LINE>textRecord.add("Gender: " + person.attributes.get(Person.GENDER));<NEW_LINE>String birthdate = dateFromTimestamp((long) person.attributes.get(Person.BIRTHDATE));<NEW_LINE>textRecord.add("Birth Date: " + birthdate);<NEW_LINE>}
.replaceAll("[A-Za-z0-9 ]", "="));
132,080
public void showHomeFollowingArticles(final RequestContext context) {<NEW_LINE>final Request request = context.getRequest();<NEW_LINE>final JSONObject user = (JSONObject) context.attr(User.USER);<NEW_LINE>final AbstractFreeMarkerRenderer renderer = new SkinRenderer(context, "home/following-articles.ftl");<NEW_LINE>final Map<String, Object> dataModel = renderer.getDataModel();<NEW_LINE>dataModelService.fillHeaderAndFooter(context, dataModel);<NEW_LINE>final int pageNum = Paginator.getPage(request);<NEW_LINE>final int pageSize = Symphonys.USER_HOME_LIST_CNT;<NEW_LINE>final int windowSize = Symphonys.USER_HOME_LIST_WIN_SIZE;<NEW_LINE>fillHomeUser(dataModel, user, roleQueryService);<NEW_LINE>final String followingId = user.optString(Keys.OBJECT_ID);<NEW_LINE>dataModel.put(Follow.FOLLOWING_ID, followingId);<NEW_LINE>avatarQueryService.fillUserAvatarURL(user);<NEW_LINE>final JSONObject followingArticlesResult = followQueryService.getFollowingArticles(followingId, pageNum, pageSize);<NEW_LINE>final List<JSONObject> followingArticles = (List<JSONObject>) followingArticlesResult.opt(Keys.RESULTS);<NEW_LINE>dataModel.put(Common.USER_HOME_FOLLOWING_ARTICLES, followingArticles);<NEW_LINE>final boolean isLoggedIn = (Boolean) <MASK><NEW_LINE>if (isLoggedIn) {<NEW_LINE>final JSONObject currentUser = Sessions.getUser();<NEW_LINE>final String followerId = currentUser.optString(Keys.OBJECT_ID);<NEW_LINE>final boolean isFollowing = followQueryService.isFollowing(followerId, followingId, Follow.FOLLOWING_TYPE_C_USER);<NEW_LINE>dataModel.put(Common.IS_FOLLOWING, isFollowing);<NEW_LINE>for (final JSONObject followingArticle : followingArticles) {<NEW_LINE>final String homeUserFollowingArticleId = followingArticle.optString(Keys.OBJECT_ID);<NEW_LINE>followingArticle.put(Common.IS_FOLLOWING, followQueryService.isFollowing(followerId, homeUserFollowingArticleId, Follow.FOLLOWING_TYPE_C_ARTICLE));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int followingArticleCnt = followingArticlesResult.optInt(Pagination.PAGINATION_RECORD_COUNT);<NEW_LINE>final int pageCount = (int) Math.ceil(followingArticleCnt / (double) pageSize);<NEW_LINE>final List<Integer> pageNums = Paginator.paginate(pageNum, pageSize, pageCount, windowSize);<NEW_LINE>if (!pageNums.isEmpty()) {<NEW_LINE>dataModel.put(Pagination.PAGINATION_FIRST_PAGE_NUM, pageNums.get(0));<NEW_LINE>dataModel.put(Pagination.PAGINATION_LAST_PAGE_NUM, pageNums.get(pageNums.size() - 1));<NEW_LINE>}<NEW_LINE>dataModel.put(Pagination.PAGINATION_CURRENT_PAGE_NUM, pageNum);<NEW_LINE>dataModel.put(Pagination.PAGINATION_PAGE_COUNT, pageCount);<NEW_LINE>dataModel.put(Pagination.PAGINATION_PAGE_NUMS, pageNums);<NEW_LINE>dataModel.put(Pagination.PAGINATION_RECORD_COUNT, followingArticleCnt);<NEW_LINE>dataModel.put(Common.TYPE, "followingArticles");<NEW_LINE>}
dataModel.get(Common.IS_LOGGED_IN);
93,647
protected static void canonicaliseStarts(ComplexFieldLocator fl, List<FieldRef> fieldRefs) throws Docx4JException {<NEW_LINE>for (P p : fl.getStarts()) {<NEW_LINE>int index;<NEW_LINE>if (p.getParent() instanceof ContentAccessor) {<NEW_LINE>// 2.8.1<NEW_LINE>index = ((ContentAccessor) p.getParent()).getContent().indexOf(p);<NEW_LINE>P newP = FieldsPreprocessor.canonicalise(p, fieldRefs);<NEW_LINE>newP.setParent(p.getParent());<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Canonicalised: " + XmlUtils.marshaltoString(newP, true, true));<NEW_LINE>}<NEW_LINE>((ContentAccessor) p.getParent()).getContent().set(index, newP);<NEW_LINE>} else if (p.getParent() instanceof java.util.List) {<NEW_LINE>// 3.0<NEW_LINE>index = ((java.util.List) p.getParent()).indexOf(p);<NEW_LINE>P newP = FieldsPreprocessor.canonicalise(p, fieldRefs);<NEW_LINE>newP.setParent(p.getParent());<NEW_LINE>log.debug("NewP length: " + newP.getContent().size());<NEW_LINE>((java.util.List) p.getParent()).set(index, newP);<NEW_LINE>} else if (p.getParent() instanceof CTTextbox) {<NEW_LINE>// 3.0.1<NEW_LINE>index = ((CTTextbox) p.getParent()).getTxbxContent().getContent().indexOf(p);<NEW_LINE>P newP = FieldsPreprocessor.canonicalise(p, fieldRefs);<NEW_LINE>newP.setParent(p.getParent());<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Canonicalised: " + XmlUtils.marshaltoString(newP, true, true));<NEW_LINE>}<NEW_LINE>((CTTextbox) p.getParent()).getTxbxContent().getContent(<MASK><NEW_LINE>} else {<NEW_LINE>throw new Docx4JException("Unexpected parent: " + p.getParent().getClass().getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).set(index, newP);
106,311
private void pushToSliceQueue(MonitorDataFrame mdf, boolean needConcurrent) {<NEW_LINE><MASK><NEW_LINE>if (now - mdf.getTimeFlag() > DROP_TIMEOUT) {<NEW_LINE>if (log.isDebugEnable()) {<NEW_LINE>log.debug(this, "MDF too late, drop it: " + mdf.toJSONString());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// step 1: store slices<NEW_LINE>List<Slice> slices = extractSlice(mdf);<NEW_LINE>RuntimeNotifySliceMgr rnsm = (RuntimeNotifySliceMgr) ConfigurationManager.getInstance().getComponent(this.feature, "RuntimeNotifySliceMgr");<NEW_LINE>rnsm.storeSlices(slices, mdf.getTag());<NEW_LINE>if (log.isDebugEnable()) {<NEW_LINE>log.debug(this, "Prepare Slices for Judge: count= " + slices.size());<NEW_LINE>}<NEW_LINE>// step 2: notification judge<NEW_LINE>if (needConcurrent == false) {<NEW_LINE>// one thread judge<NEW_LINE>for (Slice slice : slices) {<NEW_LINE>new JudgeNotifyTask(JudgeNotifyTask.class.getSimpleName(), "runtimenotify", slice).run();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// 1+N Queue Judge<NEW_LINE>I1NQueueWorker n1nqw = get1NQueueWorkerMgr().getQueueWorker(this.feature, RuntimeNotifyCatcher.QWORKER_NAME);<NEW_LINE>for (Slice slice : slices) {<NEW_LINE>n1nqw.put(new JudgeNotifyTask(JudgeNotifyTask.class.getSimpleName(), feature, slice));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
long now = System.currentTimeMillis();
1,723,638
public void apply(IntrinsicContext context, InvocationExpr invocation) {<NEW_LINE>switch(invocation.getMethod().getName()) {<NEW_LINE>case "fillZero":<NEW_LINE>context.includes().addInclude("<string.h>");<NEW_LINE>context.writer().print("memset(");<NEW_LINE>context.emit(invocation.getArguments<MASK><NEW_LINE>context.writer().print(", 0, ");<NEW_LINE>context.emit(invocation.getArguments().get(1));<NEW_LINE>context.writer().print(")");<NEW_LINE>break;<NEW_LINE>case "fill":<NEW_LINE>context.includes().addInclude("<string.h>");<NEW_LINE>context.writer().print("memset(");<NEW_LINE>context.emit(invocation.getArguments().get(0));<NEW_LINE>context.writer().print(", ");<NEW_LINE>context.emit(invocation.getArguments().get(1));<NEW_LINE>context.writer().print(", ");<NEW_LINE>context.emit(invocation.getArguments().get(2));<NEW_LINE>context.writer().print(")");<NEW_LINE>break;<NEW_LINE>case "moveMemoryBlock":<NEW_LINE>context.includes().addInclude("<string.h>");<NEW_LINE>context.writer().print("memmove(");<NEW_LINE>context.emit(invocation.getArguments().get(1));<NEW_LINE>context.writer().print(", ");<NEW_LINE>context.emit(invocation.getArguments().get(0));<NEW_LINE>context.writer().print(", ");<NEW_LINE>context.emit(invocation.getArguments().get(2));<NEW_LINE>context.writer().print(")");<NEW_LINE>break;<NEW_LINE>case "isInitialized":<NEW_LINE>context.writer().print("(((TeaVM_Class *) ");<NEW_LINE>context.emit(invocation.getArguments().get(0));<NEW_LINE>context.writer().print(")->").print(context.names().forMemberField(FLAGS_FIELD)).print(" & INT32_C(" + RuntimeClass.INITIALIZED + "))");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
().get(0));
1,789,424
final GetRecoveryGroupReadinessSummaryResult executeGetRecoveryGroupReadinessSummary(GetRecoveryGroupReadinessSummaryRequest getRecoveryGroupReadinessSummaryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRecoveryGroupReadinessSummaryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRecoveryGroupReadinessSummaryRequest> request = null;<NEW_LINE>Response<GetRecoveryGroupReadinessSummaryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRecoveryGroupReadinessSummaryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRecoveryGroupReadinessSummaryRequest));<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, "Route53 Recovery Readiness");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetRecoveryGroupReadinessSummary");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRecoveryGroupReadinessSummaryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRecoveryGroupReadinessSummaryResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,325,611
private static void executeBatches(List<BatchInterface> batches) throws IOException {<NEW_LINE>ExecutorService executor = MoreExecutors.listeningDecorator(new ThreadPoolExecutor(MAX_CONCURRENT_BATCHES, MAX_CONCURRENT_BATCHES, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>()));<NEW_LINE>List<CompletionStage<Void>> <MASK><NEW_LINE>for (final BatchInterface batch : batches) {<NEW_LINE>futures.add(MoreFutures.runAsync(() -> batch.execute(), executor));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>MoreFutures.get(MoreFutures.allAsList(futures));<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>throw new IOException("Interrupted while executing batch GCS request", e);<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>if (e.getCause() instanceof FileNotFoundException) {<NEW_LINE>throw (FileNotFoundException) e.getCause();<NEW_LINE>}<NEW_LINE>throw new IOException("Error executing batch GCS request", e);<NEW_LINE>} finally {<NEW_LINE>executor.shutdown();<NEW_LINE>}<NEW_LINE>}
futures = new ArrayList<>();
1,573,364
public static Map<String, String> readConfig(Path data) throws IOException {<NEW_LINE>File conf_dir = new File("conf");<NEW_LINE>Properties prop = new Properties();<NEW_LINE>prop.load(new FileInputStream(new File(conf_dir, "config.properties")));<NEW_LINE>Map<String, String> config = new HashMap<>();<NEW_LINE>for (Map.Entry<Object, Object> entry : prop.entrySet()) config.put((String) entry.getKey(), (String) entry.getValue());<NEW_LINE>Path settings_dir = data.resolve("settings");<NEW_LINE>settings_dir.toFile().mkdirs();<NEW_LINE>OS.protectPath(settings_dir);<NEW_LINE>File customized_config = new File(settings_dir.toFile(), "customized_config.properties");<NEW_LINE>if (!customized_config.exists()) {<NEW_LINE>BufferedWriter w = new BufferedWriter(new FileWriter(customized_config));<NEW_LINE>w.write("# This file can be used to customize the configuration file conf/config.properties\n");<NEW_LINE>w.close();<NEW_LINE>}<NEW_LINE>Properties customized_config_props = new Properties();<NEW_LINE>customized_config_props.<MASK><NEW_LINE>for (Map.Entry<Object, Object> entry : customized_config_props.entrySet()) config.put((String) entry.getKey(), (String) entry.getValue());<NEW_LINE>// overwrite the config with environment variables. Because a '.' (dot) is not allowed in system environments<NEW_LINE>// the dot can be replaced by "_" (underscore), i.e. like:<NEW_LINE>// backend_push_enabled="false" java -jar build/libs/loklak_server-all.jar<NEW_LINE>// create a clone of the keys to prevent a ConcurrentModificationException<NEW_LINE>String[] keys = config.keySet().toArray(new String[config.size()]);<NEW_LINE>for (String key : keys) if (System.getenv().containsKey(key.replace('.', '_')))<NEW_LINE>config.put(key, System.getenv().get(key.replace('.', '_')));<NEW_LINE>// the config can further be overwritten by System Properties, i.e. like:<NEW_LINE>// java -jar -Dbackend.push.enabled="false" build/libs/loklak_server-all.jar<NEW_LINE>for (String key : keys) if (System.getProperties().containsKey(key))<NEW_LINE>config.put(key, System.getProperties().getProperty(key));<NEW_LINE>return config;<NEW_LINE>}
load(new FileInputStream(customized_config));
1,638,469
public void openTorrent(String fileName, String save_path) {<NEW_LINE>String uc_filename = fileName.toUpperCase(Locale.US);<NEW_LINE>boolean is_remote = uc_filename.startsWith("HTTP://") || uc_filename.startsWith("HTTPS://") || uc_filename.startsWith("MAGNET:");<NEW_LINE>if (console != null) {<NEW_LINE>// System.out.println("NOT NULL CONSOLE. CAN PASS STRAIGHT TO IT!");<NEW_LINE>if (is_remote) {<NEW_LINE>console.out.println("Downloading torrent from url: " + fileName);<NEW_LINE>if (save_path == null) {<NEW_LINE>console.downloadRemoteTorrent(fileName);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>console.out.println("Open Torrent " + fileName);<NEW_LINE>if (save_path == null) {<NEW_LINE>console.downloadTorrent(fileName);<NEW_LINE>} else {<NEW_LINE>console.downloadTorrent(fileName, save_path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>// System.out.println("NULL CONSOLE");<NEW_LINE>}<NEW_LINE>if (is_remote) {<NEW_LINE>if (console != null) {<NEW_LINE>console.out.println("Downloading torrent from url: " + fileName);<NEW_LINE>}<NEW_LINE>if (save_path == null) {<NEW_LINE>TorrentDownloaderFactory.downloadManaged(fileName);<NEW_LINE>} else {<NEW_LINE>TorrentDownloaderFactory.downloadToLocationManaged(fileName, save_path);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!TorrentUtils.isTorrentFile(fileName)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.err.println(fileName + " doesn't seem to be a torrent file. Not added.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Something is wrong with " + fileName + ". Not added. (Reason: " + e.getMessage() + ")");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (core.getGlobalManager() != null) {<NEW_LINE>try {<NEW_LINE>String downloadDir = save_path != null ? save_path : COConfigurationManager.getDirectoryParameter("Default save path");<NEW_LINE>if (console != null) {<NEW_LINE>console.out.println("Adding torrent: " + fileName + " and saving to " + downloadDir);<NEW_LINE>}<NEW_LINE>core.getGlobalManager().addDownloadManager(fileName, downloadDir);<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("The torrent " + fileName + " could not be added. " + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
console.downloadRemoteTorrent(fileName, save_path);
727,608
public ImageConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ImageConfiguration imageConfiguration = new ImageConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("RuntimeEnvironmentVariables", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>imageConfiguration.setRuntimeEnvironmentVariables(new MapUnmarshaller<String, String>(context.getUnmarshaller(String.class), context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("StartCommand", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>imageConfiguration.setStartCommand(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Port", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>imageConfiguration.setPort(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return imageConfiguration;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
582,964
public void onEnable() {<NEW_LINE>PlanVelocityComponent component = DaggerPlanVelocityComponent.builder().plan(this).abstractionLayer(abstractionLayer).build();<NEW_LINE>try {<NEW_LINE>system = component.system();<NEW_LINE>locale = system.getLocaleSystem().getLocale();<NEW_LINE>system.enable();<NEW_LINE>int pluginId = 10326;<NEW_LINE>new BStatsVelocity(system.getDatabaseSystem().getDatabase(), metricsFactory.make(this, pluginId)).registerMetrics();<NEW_LINE>logger.info(locale.getString(PluginLang.ENABLED));<NEW_LINE>} catch (AbstractMethodError e) {<NEW_LINE>logger.error("Plugin ran into AbstractMethodError - Server restart is required. Likely cause is updating the jar without a restart.");<NEW_LINE>} catch (EnableException e) {<NEW_LINE>logger.error("----------------------------------------");<NEW_LINE>logger.error("Error: " + e.getMessage());<NEW_LINE>logger.error("----------------------------------------");<NEW_LINE>logger.error("Plugin Failed to Initialize Correctly. If this issue is caused by config settings you can use /planvelocity reload");<NEW_LINE>onDisable();<NEW_LINE>} catch (Exception e) {<NEW_LINE>String version = abstractionLayer.getPluginInformation().getVersion();<NEW_LINE>java.util.logging.Logger.getGlobal().log(Level.SEVERE, e, () -> this.getClass().getSimpleName() + "-v" + version);<NEW_LINE>logger.error("Plugin Failed to Initialize Correctly. If this issue is caused by config settings you can use /planvelocity reload");<NEW_LINE>logger.error("This error should be reported at https://github.com/plan-player-analytics/Plan/issues");<NEW_LINE>onDisable();<NEW_LINE>}<NEW_LINE>registerCommand(component.planCommand().build());<NEW_LINE>if (system != null) {<NEW_LINE>system.getProcessing().submitNonCritical(() -> system.getListenerSystem<MASK><NEW_LINE>}<NEW_LINE>}
().callEnableEvent(this));
1,802,359
public void execute() {<NEW_LINE>String selection = editor_.getSelectionValue();<NEW_LINE>// modify prefix based on prefs<NEW_LINE>String insertPrefix = prefix;<NEW_LINE>if (isSectionCommand && prefs_.insertNumberedLatexSections().getValue()) {<NEW_LINE>insertPrefix = <MASK><NEW_LINE>}<NEW_LINE>editor_.insertCode(insertPrefix + selection + suffix, false);<NEW_LINE>editor_.focus();<NEW_LINE>// if there was no previous selection then put the cursor<NEW_LINE>// inside the braces<NEW_LINE>if (selection.length() == 0) {<NEW_LINE>Position pos = editor_.getCursorPosition();<NEW_LINE>int row = pos.getRow();<NEW_LINE>if (suffix.startsWith("\n"))<NEW_LINE>row = Math.max(0, row - 1);<NEW_LINE>int col = Math.max(0, pos.getColumn() - suffix.length());<NEW_LINE>editor_.setCursorPosition(Position.create(row, col));<NEW_LINE>}<NEW_LINE>}
insertPrefix.replace("*", "");
491,087
private StructuredGraph transplantGraph(DebugContext debug, HostedMethod hMethod, CompileReason reason) {<NEW_LINE>AnalysisMethod aMethod = hMethod.getWrapped();<NEW_LINE>StructuredGraph aGraph = aMethod.getAnalyzedGraph();<NEW_LINE>if (aGraph == null) {<NEW_LINE>throw VMError.shouldNotReachHere("Method not parsed during static analysis: " + aMethod.format("%r %H.%n(%p)") + ". Reachable from: " + reason);<NEW_LINE>}<NEW_LINE>aMethod.setAnalyzedGraph(null);<NEW_LINE>boolean trackNodeSourcePosition = GraalOptions.TrackNodeSourcePosition.getValue(compileOptions);<NEW_LINE>StructuredGraph graph = aGraph.copy(universe.lookup(aGraph.method()), compileOptions, debug, trackNodeSourcePosition);<NEW_LINE>transplantEscapeAnalysisState(graph);<NEW_LINE>IdentityHashMap<Object, Object> replacements = new IdentityHashMap<>();<NEW_LINE>for (Node node : graph.getNodes()) {<NEW_LINE>NodeClass<?> nodeClass = node.getNodeClass();<NEW_LINE>for (int i = 0; i < nodeClass.getData().getCount(); i++) {<NEW_LINE>Object oldValue = nodeClass.getData(<MASK><NEW_LINE>Object newValue = replaceAnalysisObjects(oldValue, node, replacements, universe);<NEW_LINE>if (oldValue != newValue) {<NEW_LINE>nodeClass.getData().putObjectChecked(node, i, newValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (trackNodeSourcePosition) {<NEW_LINE>node.setNodeSourcePosition((NodeSourcePosition) replaceAnalysisObjects(node.getNodeSourcePosition(), node, replacements, universe));<NEW_LINE>} else {<NEW_LINE>node.clearNodeSourcePosition();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return graph;<NEW_LINE>}
).get(node, i);
1,471,065
private void createShipmentLineHUAssignments(final I_M_InOutLine shipmentLine) {<NEW_LINE>// Assign Handling Units to shipment line<NEW_LINE>boolean haveHUAssigments = false;<NEW_LINE>for (final HUTopLevel huToAssign : husToAssign) {<NEW_LINE>// transfer packing materials only if this TU was not already assigned to other document line (partial TUs case)<NEW_LINE>final boolean isTransferPackingMaterials = alreadyAssignedTUIds.add(huToAssign.getTuHUId());<NEW_LINE>huShipmentAssignmentBL.assignHU(shipmentLine, huToAssign, isTransferPackingMaterials);<NEW_LINE>transferAttributesToShipmentLine(shipmentLine, huToAssign.getM_HU_TopLevel());<NEW_LINE>haveHUAssigments = true;<NEW_LINE>}<NEW_LINE>// Guard: while generating shipment line from candidates, we shall have HUs for them<NEW_LINE>if (!haveHUAssigments && !isManualPackingMaterial()) {<NEW_LINE>throw new HUException("No HUs to assign and manualPackingMaterial==false." + <MASK><NEW_LINE>}<NEW_LINE>}
"\n @M_InOutLine_ID@: " + shipmentLine + "\n @M_HU_ID@: " + husToAssign);
252,662
static void logCert(String alias, X509Certificate x509Cert) {<NEW_LINE>X500Principal subj = x509Cert.getSubjectX500Principal();<NEW_LINE><MASK><NEW_LINE>Date now = new Date();<NEW_LINE>String label = alias != null ? (alias + ": ") : "";<NEW_LINE>if (now.compareTo(x509Cert.getNotAfter()) > 0) {<NEW_LINE>Msg.warn(ApplicationKeyStore.class, " " + label + getCommonName(subj) + ", issued by " + getCommonName(issuer) + ", S/N " + x509Cert.getSerialNumber().toString(16) + ", expired " + x509Cert.getNotAfter() + " **EXPIRED**");<NEW_LINE>} else {<NEW_LINE>Msg.info(ApplicationKeyStore.class, " " + label + getCommonName(subj) + ", issued by " + getCommonName(issuer) + ", S/N " + x509Cert.getSerialNumber().toString(16) + ", expires " + x509Cert.getNotAfter());<NEW_LINE>}<NEW_LINE>}
X500Principal issuer = x509Cert.getIssuerX500Principal();
1,571,740
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>icon = new javax.swing.JLabel();<NEW_LINE>problemDescription = new javax.swing.JTextPane();<NEW_LINE>showDetails = new javax.swing.JButton();<NEW_LINE>setBorder(javax.swing.BorderFactory.createEmptyBorder(3, 3, 3, 3));<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>icon.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));<NEW_LINE>icon.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 6, 1, 6));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>add(icon, gridBagConstraints);<NEW_LINE>problemDescription.setEditable(false);<NEW_LINE>// NOI18N<NEW_LINE>problemDescription.setContentType("text/html");<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 1;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>add(problemDescription, gridBagConstraints);<NEW_LINE>showDetails.addActionListener(new java.awt.event.ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>showDetailsActionPerformed(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 2;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>add(showDetails, gridBagConstraints);<NEW_LINE>showDetails.getAccessibleContext().<MASK><NEW_LINE>showDetails.getAccessibleContext().setAccessibleDescription(showDetails.getText());<NEW_LINE>}
setAccessibleName(showDetails.getText());
1,413,991
private final TLCState processUnchangedImplTuple(final Action action, ActionItemList acts, Context c, TLCState s0, TLCState s1, INextStateFunctor nss, ExprOrOpArgNode[] args, int alen, CostModel cm, CostModel cmNested) {<NEW_LINE>// a tuple:<NEW_LINE>if (alen != 0) {<NEW_LINE>ActionItemList acts1 = acts;<NEW_LINE>for (int i = alen - 1; i > 0; i--) {<NEW_LINE>acts1 = (ActionItemList) acts1.cons(args[i], c, cmNested, IActionItemList.UNCHANGED);<NEW_LINE>}<NEW_LINE>return this.processUnchanged(action, args[0], acts1, c, s0, s1, nss, cmNested);<NEW_LINE>}<NEW_LINE>return this.getNextStates(action, acts, <MASK><NEW_LINE>}
s0, s1, nss, cm);
323,107
public static int cliInstaller(boolean uninstall, List<String> rawArgs) {<NEW_LINE>CmdReader<CmdArgs> reader = CmdReader.of(CmdArgs.class);<NEW_LINE>CmdArgs args;<NEW_LINE>try {<NEW_LINE>args = reader.make(rawArgs.toArray(new String[0]));<NEW_LINE>} catch (InvalidCommandLineException e) {<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>System.err.println("--------------------------");<NEW_LINE>System.err.println(generateCliHelp(uninstall, reader));<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>if (args.help) {<NEW_LINE>System.out.println(generateCliHelp(uninstall, reader));<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>if (args.path.isEmpty()) {<NEW_LINE>System.err.println("ERROR: Nothing to do!");<NEW_LINE>System.err.println("--------------------------");<NEW_LINE>System.err.println(generateCliHelp(uninstall, reader));<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>final List<IdeLocation> locations = new ArrayList<IdeLocation>();<NEW_LINE>final List<CorruptedIdeLocationException> problems = new ArrayList<CorruptedIdeLocationException>();<NEW_LINE>if (args.path.contains("auto"))<NEW_LINE>autoDiscover(locations, problems);<NEW_LINE>for (String rawPath : args.path) {<NEW_LINE>if (!rawPath.equals("auto")) {<NEW_LINE>try {<NEW_LINE>IdeLocation loc = tryAllProviders(rawPath);<NEW_LINE>if (loc != null)<NEW_LINE>locations.add(loc);<NEW_LINE>else<NEW_LINE>problems.add(new CorruptedIdeLocationException("Can't find any IDE at: " <MASK><NEW_LINE>} catch (CorruptedIdeLocationException e) {<NEW_LINE>problems.add(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int validLocations = locations.size();<NEW_LINE>for (IdeLocation loc : locations) {<NEW_LINE>try {<NEW_LINE>if (uninstall) {<NEW_LINE>loc.uninstall();<NEW_LINE>} else {<NEW_LINE>loc.install();<NEW_LINE>}<NEW_LINE>System.out.printf("Lombok %s %s: %s\n", uninstall ? "uninstalled" : "installed", uninstall ? "from" : "to", loc.getName());<NEW_LINE>} catch (InstallException e) {<NEW_LINE>if (e.isWarning()) {<NEW_LINE>System.err.printf("Warning while installing at %s:\n", loc.getName());<NEW_LINE>} else {<NEW_LINE>System.err.printf("Installation at %s failed:\n", loc.getName());<NEW_LINE>validLocations--;<NEW_LINE>}<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>} catch (UninstallException e) {<NEW_LINE>if (e.isWarning()) {<NEW_LINE>System.err.printf("Warning while uninstalling at %s:\n", loc.getName());<NEW_LINE>} else {<NEW_LINE>System.err.printf("Uninstall at %s failed:\n", loc.getName());<NEW_LINE>validLocations--;<NEW_LINE>}<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (CorruptedIdeLocationException problem : problems) {<NEW_LINE>System.err.println("WARNING: " + problem.getMessage());<NEW_LINE>}<NEW_LINE>if (validLocations == 0) {<NEW_LINE>System.err.println("WARNING: Zero valid locations found; so nothing was done!");<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
+ rawPath, null, null));
1,169,019
private void fireChange(final TwoWayEvent<DM, UMD, DMD> e) {<NEW_LINE>final List<TwoWayListener<DM, UMD, DMD>> ls;<NEW_LINE>synchronized (listeners) {<NEW_LINE>if (listeners.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ls = new ArrayList<TwoWayListener<DM, UMD, DMD>>(listeners);<NEW_LINE>}<NEW_LINE>lock.read(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>for (TwoWayListener<DM, UMD, DMD> l : ls) {<NEW_LINE>if (e instanceof TwoWayEvent.Derived) {<NEW_LINE>l.derived((TwoWayEvent.Derived<DM, UMD, DMD>) e);<NEW_LINE>} else if (e instanceof TwoWayEvent.Invalidated) {<NEW_LINE>l.invalidated((TwoWayEvent.Invalidated<DM, UMD, DMD>) e);<NEW_LINE>} else if (e instanceof TwoWayEvent.Recreated) {<NEW_LINE>l.recreated((TwoWayEvent.Recreated<DM, UMD, DMD>) e);<NEW_LINE>} else if (e instanceof TwoWayEvent.Clobbered) {<NEW_LINE>l.clobbered((TwoWayEvent.Clobbered<DM<MASK><NEW_LINE>} else if (e instanceof TwoWayEvent.Forgotten) {<NEW_LINE>l.forgotten((TwoWayEvent.Forgotten<DM, UMD, DMD>) e);<NEW_LINE>} else {<NEW_LINE>assert e instanceof TwoWayEvent.Broken;<NEW_LINE>l.broken((TwoWayEvent.Broken<DM, UMD, DMD>) e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
, UMD, DMD>) e);
857,781
void readAllowedClockSkew(ModelNode addIdentityProvider, XMLExtendedStreamReader reader) throws XMLStreamException {<NEW_LINE>ModelNode allowedClockSkew = addIdentityProvider.get(Constants.Model.ALLOWED_CLOCK_SKEW);<NEW_LINE>for (int i = 0; i < reader.getAttributeCount(); i++) {<NEW_LINE>String name = reader.getAttributeLocalName(i);<NEW_LINE>String value = reader.getAttributeValue(i);<NEW_LINE>if (Constants.XML.ALLOWED_CLOCK_SKEW_UNIT.equals(name)) {<NEW_LINE>SimpleAttributeDefinition attr = AllowedClockSkew.ALLOWED_CLOCK_SKEW_UNIT;<NEW_LINE>attr.<MASK><NEW_LINE>} else {<NEW_LINE>throw ParseUtils.unexpectedAttribute(reader, i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// the real value is the content<NEW_LINE>String value = reader.getElementText();<NEW_LINE>SimpleAttributeDefinition attr = AllowedClockSkew.ALLOWED_CLOCK_SKEW_VALUE;<NEW_LINE>attr.parseAndSetParameter(value, allowedClockSkew, reader);<NEW_LINE>}
parseAndSetParameter(value, allowedClockSkew, reader);
582,302
private static ActionGroup createTreePopupActions(final boolean isRightTree, final Tree tree) {<NEW_LINE>DefaultActionGroup group = new DefaultActionGroup();<NEW_LINE>final TreeExpander treeExpander = new TreeExpander() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void expandAll() {<NEW_LINE>TreeUtil.expandAll(tree);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean canExpand() {<NEW_LINE>return isRightTree;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void collapseAll() {<NEW_LINE>TreeUtil.collapseAll(tree, 3);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean canCollapse() {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final <MASK><NEW_LINE>if (isRightTree) {<NEW_LINE>group.add(actionManager.createExpandAllAction(treeExpander, tree));<NEW_LINE>}<NEW_LINE>group.add(actionManager.createCollapseAllAction(treeExpander, tree));<NEW_LINE>final ActionManager globalActionManager = ActionManager.getInstance();<NEW_LINE>group.add(globalActionManager.getAction(IdeActions.ACTION_EDIT_SOURCE));<NEW_LINE>group.add(AnSeparator.getInstance());<NEW_LINE>group.add(globalActionManager.getAction(IdeActions.ACTION_ANALYZE_DEPENDENCIES));<NEW_LINE>group.add(globalActionManager.getAction(IdeActions.ACTION_ANALYZE_BACK_DEPENDENCIES));<NEW_LINE>// non exists in platform group.add(globalActionManager.getAction(IdeActions.ACTION_ANALYZE_CYCLIC_DEPENDENCIES));<NEW_LINE>return group;<NEW_LINE>}
CommonActionsManager actionManager = CommonActionsManager.getInstance();
334,157
public Request<ListGroupsRequest> marshall(ListGroupsRequest listGroupsRequest) {<NEW_LINE>if (listGroupsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListGroupsRequest)");<NEW_LINE>}<NEW_LINE>Request<ListGroupsRequest> request = new DefaultRequest<ListGroupsRequest>(listGroupsRequest, "AmazonCognitoIdentityProvider");<NEW_LINE>String target = "AWSCognitoIdentityProviderService.ListGroups";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (listGroupsRequest.getUserPoolId() != null) {<NEW_LINE>String userPoolId = listGroupsRequest.getUserPoolId();<NEW_LINE>jsonWriter.name("UserPoolId");<NEW_LINE>jsonWriter.value(userPoolId);<NEW_LINE>}<NEW_LINE>if (listGroupsRequest.getLimit() != null) {<NEW_LINE>Integer limit = listGroupsRequest.getLimit();<NEW_LINE>jsonWriter.name("Limit");<NEW_LINE>jsonWriter.value(limit);<NEW_LINE>}<NEW_LINE>if (listGroupsRequest.getNextToken() != null) {<NEW_LINE>String nextToken = listGroupsRequest.getNextToken();<NEW_LINE>jsonWriter.name("NextToken");<NEW_LINE>jsonWriter.value(nextToken);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addHeader("Content-Type", "application/x-amz-json-1.1");
1,452,948
public void run() {<NEW_LINE>// ============================================================<NEW_LINE>// Deploy to app 1 through zip deploy<NEW_LINE>System.out.println("Deploying coffeeshop.war to " + appName + " through web deploy...");<NEW_LINE>app.deploy().withPackageUri("https://raw.githubusercontent.com/Azure/azure-sdk-for-java/main/sdk/resourcemanager/azure-resourcemanager-samples/src/main/resources/coffeeshop.zip").<MASK><NEW_LINE>System.out.println("Deployments to web app " + app.name() + " completed");<NEW_LINE>Utils.print(app);<NEW_LINE>// warm up<NEW_LINE>System.out.println("Warming up " + appUrl + "/coffeeshop...");<NEW_LINE>Utils.sendGetRequest("http://" + appUrl + "/coffeeshop/");<NEW_LINE>ResourceManagerUtils.sleep(Duration.ofSeconds(5));<NEW_LINE>System.out.println("CURLing " + appUrl + "/coffeeshop...");<NEW_LINE>System.out.println(Utils.sendGetRequest("http://" + appUrl + "/coffeeshop/"));<NEW_LINE>}
withExistingDeploymentsDeleted(false).execute();
1,139,896
protected Widget createMainWidget() {<NEW_LINE>VerticalPanel panel = new VerticalPanel();<NEW_LINE>HorizontalPanel horizontalPanel = new HorizontalPanel();<NEW_LINE>horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);<NEW_LINE>// add image<NEW_LINE>MessageDialogImages images = MessageDialogImages.INSTANCE;<NEW_LINE>Image image = new Image(new ImageResource2x(images.dialog_warning2x()));<NEW_LINE>image.setAltText(MessageDialogImages.DIALOG_WARNING_TEXT);<NEW_LINE>horizontalPanel.add(image);<NEW_LINE>// add message widget<NEW_LINE>VerticalPanel messagePanel = new VerticalPanel();<NEW_LINE>Label label = new <MASK><NEW_LINE>label.setStylePrimaryName(ThemeResources.INSTANCE.themeStyles().dialogMessage());<NEW_LINE>messagePanel.add(label);<NEW_LINE>HelpLink helpLink = new HelpLink(constants_.usingRMarkdownParameters(), "parameterized_reports", false);<NEW_LINE>Style style = helpLink.getElement().getStyle();<NEW_LINE>style.setMarginTop(4, Unit.PX);<NEW_LINE>style.setMarginBottom(12, Unit.PX);<NEW_LINE>messagePanel.add(helpLink);<NEW_LINE>horizontalPanel.add(messagePanel);<NEW_LINE>panel.add(horizontalPanel);<NEW_LINE>// read the message when dialog is shown<NEW_LINE>setARIADescribedBy(label.getElement());<NEW_LINE>return panel;<NEW_LINE>}
MultiLineLabel(constants_.noParametersDefinedForCurrentRMarkdown());
930,290
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject(Fields.SEGMENTS);<NEW_LINE>builder.field(Fields.COUNT, count);<NEW_LINE>builder.humanReadableField(Fields.MEMORY_IN_BYTES, Fields.MEMORY, getMemory());<NEW_LINE>builder.humanReadableField(Fields.TERMS_MEMORY_IN_BYTES, Fields.TERMS_MEMORY, getTermsMemory());<NEW_LINE>builder.humanReadableField(Fields.STORED_FIELDS_MEMORY_IN_BYTES, Fields.STORED_FIELDS_MEMORY, getStoredFieldsMemory());<NEW_LINE>builder.humanReadableField(Fields.TERM_VECTORS_MEMORY_IN_BYTES, Fields.TERM_VECTORS_MEMORY, getTermVectorsMemory());<NEW_LINE>builder.humanReadableField(Fields.NORMS_MEMORY_IN_BYTES, Fields.NORMS_MEMORY, getNormsMemory());<NEW_LINE>builder.humanReadableField(Fields.POINTS_MEMORY_IN_BYTES, Fields.POINTS_MEMORY, getPointsMemory());<NEW_LINE>builder.humanReadableField(Fields.DOC_VALUES_MEMORY_IN_BYTES, Fields.DOC_VALUES_MEMORY, getDocValuesMemory());<NEW_LINE>builder.humanReadableField(Fields.INDEX_WRITER_MEMORY_IN_BYTES, Fields.INDEX_WRITER_MEMORY, getIndexWriterMemory());<NEW_LINE>builder.humanReadableField(Fields.VERSION_MAP_MEMORY_IN_BYTES, <MASK><NEW_LINE>builder.humanReadableField(Fields.FIXED_BIT_SET_MEMORY_IN_BYTES, Fields.FIXED_BIT_SET, getBitsetMemory());<NEW_LINE>builder.humanReadableField(Fields.TOKEN_RANGES_BIT_SET_MEMORY_IN_BYTES, Fields.TOKEN_RANGES_BIT_SET, getTokenRangeBitsetMemory());<NEW_LINE>builder.field(Fields.MAX_UNSAFE_AUTO_ID_TIMESTAMP, maxUnsafeAutoIdTimestamp);<NEW_LINE>builder.startObject(Fields.FILE_SIZES);<NEW_LINE>for (Iterator<ObjectObjectCursor<String, Long>> it = fileSizes.iterator(); it.hasNext(); ) {<NEW_LINE>ObjectObjectCursor<String, Long> entry = it.next();<NEW_LINE>builder.startObject(entry.key);<NEW_LINE>builder.humanReadableField(Fields.SIZE_IN_BYTES, Fields.SIZE, new ByteSizeValue(entry.value));<NEW_LINE>builder.field(Fields.DESCRIPTION, fileDescriptions.getOrDefault(entry.key, "Others"));<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>}
Fields.VERSION_MAP_MEMORY, getVersionMapMemory());
801,410
public io.kubernetes.client.proto.V1.PodExecOptions buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1.PodExecOptions result = new io.kubernetes.client.<MASK><NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.stdin_ = stdin_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.stdout_ = stdout_;<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.stderr_ = stderr_;<NEW_LINE>if (((from_bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>to_bitField0_ |= 0x00000008;<NEW_LINE>}<NEW_LINE>result.tty_ = tty_;<NEW_LINE>if (((from_bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>to_bitField0_ |= 0x00000010;<NEW_LINE>}<NEW_LINE>result.container_ = container_;<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>command_ = command_.getUnmodifiableView();<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000020);<NEW_LINE>}<NEW_LINE>result.command_ = command_;<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
proto.V1.PodExecOptions(this);
1,081,496
protected void findObjectsByMask(@NotNull GenericExecutionContext executionContext, @NotNull JDBCSession session, @NotNull DBSObjectType objectType, @NotNull ObjectsSearchParams params, @NotNull List<DBSObjectReference> references) throws DBException, SQLException {<NEW_LINE>DBSObject parentObject = params.getParentObject();<NEW_LINE>boolean globalSearch = params.isGlobalSearch();<NEW_LINE>String objectNameMask = params.getMask();<NEW_LINE>GenericSchema schema = parentObject instanceof GenericSchema ? (GenericSchema) parentObject : (params.isGlobalSearch() ? null : executionContext.getDefaultSchema());<NEW_LINE>GenericCatalog catalog = parentObject instanceof GenericCatalog ? (GenericCatalog) parentObject : schema == null ? (globalSearch ? null : executionContext.getDefaultCatalog()) : schema.getCatalog();<NEW_LINE>final GenericDataSource dataSource = getDataSource();<NEW_LINE>DBPIdentifierCase convertCase = params.isCaseSensitive() ? dataSource.getSQLDialect().storesQuotedCase() : dataSource.getSQLDialect().storesUnquotedCase();<NEW_LINE>objectNameMask = convertCase.transform(objectNameMask);<NEW_LINE>if (objectType == RelationalObjectType.TYPE_TABLE) {<NEW_LINE>findTablesByMask(session, catalog, schema, objectNameMask, params.getMaxResults(), references);<NEW_LINE>} else if (objectType == RelationalObjectType.TYPE_PROCEDURE) {<NEW_LINE>findProceduresByMask(session, catalog, schema, objectNameMask, <MASK><NEW_LINE>}<NEW_LINE>}
params.getMaxResults(), references);
869,774
private void processLine(String line) {<NEW_LINE>switch(state) {<NEW_LINE>case BEFORE:<NEW_LINE>Matcher <MASK><NEW_LINE>if (matcher.matches()) {<NEW_LINE>section = matcher.group(1);<NEW_LINE>exampleNumber = 0;<NEW_LINE>}<NEW_LINE>if (line.startsWith(EXAMPLE_START_MARKER)) {<NEW_LINE>info = line.substring(EXAMPLE_START_MARKER.length()).trim();<NEW_LINE>state = State.SOURCE;<NEW_LINE>exampleNumber++;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case SOURCE:<NEW_LINE>if (line.equals(".")) {<NEW_LINE>state = State.HTML;<NEW_LINE>} else {<NEW_LINE>// examples use "rightwards arrow" to show tab<NEW_LINE>String processedLine = line.replace('\u2192', '\t');<NEW_LINE>source.append(processedLine).append('\n');<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case HTML:<NEW_LINE>if (line.equals("````````````````````````````````")) {<NEW_LINE>state = State.BEFORE;<NEW_LINE>examples.add(new Example(filename, section, info, exampleNumber, source.toString(), html.toString()));<NEW_LINE>resetContents();<NEW_LINE>} else {<NEW_LINE>html.append(line).append('\n');<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
matcher = SECTION_PATTERN.matcher(line);
1,543,695
public AccessToken fetchAccessToken() {<NEW_LINE>HttpHeaders tokenHeaders = new HttpHeaders();<NEW_LINE>tokenHeaders.setContentType(MediaType.APPLICATION_FORM_URLENCODED);<NEW_LINE>MultiValueMap<String, String> tokenRequestBody = new LinkedMultiValueMap<>();<NEW_LINE>tokenRequestBody.add("username", getAuthenticationUser());<NEW_LINE>tokenRequestBody.add("password", getAuthenticationPassword());<NEW_LINE><MASK><NEW_LINE>tokenRequestBody.add("client_id", "admin-cli");<NEW_LINE>HttpEntity<MultiValueMap<String, String>> tokenRequest = new HttpEntity<>(tokenRequestBody, tokenHeaders);<NEW_LINE>ResponseEntity<JsonNode> tokenResponse = tokenRestTemplate.postForEntity(getServer() + "auth/realms/{realm}/protocol/openid-connect/token", tokenRequest, JsonNode.class, getAuthenticationRealm());<NEW_LINE>HttpStatus statusCode = tokenResponse.getStatusCode();<NEW_LINE>if (statusCode.is2xxSuccessful()) {<NEW_LINE>JsonNode body = tokenResponse.getBody();<NEW_LINE>if (body != null) {<NEW_LINE>String accessToken = body.path("access_token").asText(null);<NEW_LINE>long expiresIn = body.path("expires_in").asLong(0);<NEW_LINE>Instant expiresAt = Instant.now().plusSeconds(expiresIn > 0 ? expiresIn : 1);<NEW_LINE>return new AccessToken(accessToken, expiresAt);<NEW_LINE>}<NEW_LINE>throw new FlowableException("Could not get access token");<NEW_LINE>} else {<NEW_LINE>throw new FlowableException("Could not get access token. Status code: " + statusCode + ". Token response: " + tokenResponse.getBody());<NEW_LINE>}<NEW_LINE>}
tokenRequestBody.add("grant_type", "password");
801,620
protected void paintComponent(Graphics g) {<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>int x = 0;<NEW_LINE>if (parentArrowVisible) {<NEW_LINE>g2.setColor(ARROW_COLOR);<NEW_LINE>g2.drawLine(x + 1, 0, x + 5, getHeight() / 2);<NEW_LINE>g2.drawLine(x + 1, getHeight(), x + 5, getHeight() / 2);<NEW_LINE>x += PARENT_ARROW_BOX_WIDTH;<NEW_LINE>}<NEW_LINE>g2.setColor(TEXT_COLOR);<NEW_LINE>g.drawString(rendering, x, getFontMetrics(getFont()).getAscent());<NEW_LINE>int width = getWidth();<NEW_LINE>if (width < getPreferredSize().width) {<NEW_LINE>int fadeLength = 12;<NEW_LINE>int fadeX = width - fadeLength;<NEW_LINE>Color bgColor = getBackground();<NEW_LINE>Color transparentBgColor = new Color(bgColor.getRed(), bgColor.getGreen(), bgColor.getBlue(), 0);<NEW_LINE>GradientPaint paint = new GradientPaint(fadeX, 0, transparentBgColor, <MASK><NEW_LINE>g2.setPaint(paint);<NEW_LINE>g2.fillRect(fadeX, 0, fadeLength, getHeight());<NEW_LINE>}<NEW_LINE>}
fadeX + fadeLength, 0, bgColor);
74,337
public static DescribePriceResponse unmarshall(DescribePriceResponse describePriceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePriceResponse.setRequestId(_ctx.stringValue("DescribePriceResponse.RequestId"));<NEW_LINE>describePriceResponse.setOrderParams(_ctx.stringValue("DescribePriceResponse.OrderParams"));<NEW_LINE>Order order = new Order();<NEW_LINE>order.setOriginalAmount(_ctx.stringValue("DescribePriceResponse.Order.OriginalAmount"));<NEW_LINE>order.setHandlingFeeAmount(_ctx.stringValue("DescribePriceResponse.Order.HandlingFeeAmount"));<NEW_LINE>order.setCurrency(_ctx.stringValue("DescribePriceResponse.Order.Currency"));<NEW_LINE>order.setDiscountAmount<MASK><NEW_LINE>order.setTradeAmount(_ctx.stringValue("DescribePriceResponse.Order.TradeAmount"));<NEW_LINE>List<String> ruleIds1 = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePriceResponse.Order.RuleIds.Length"); i++) {<NEW_LINE>ruleIds1.add(_ctx.stringValue("DescribePriceResponse.Order.RuleIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>order.setRuleIds1(ruleIds1);<NEW_LINE>List<Coupon> coupons = new ArrayList<Coupon>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePriceResponse.Order.Coupons.Length"); i++) {<NEW_LINE>Coupon coupon = new Coupon();<NEW_LINE>coupon.setIsSelected(_ctx.stringValue("DescribePriceResponse.Order.Coupons[" + i + "].IsSelected"));<NEW_LINE>coupon.setCouponNo(_ctx.stringValue("DescribePriceResponse.Order.Coupons[" + i + "].CouponNo"));<NEW_LINE>coupon.setName(_ctx.stringValue("DescribePriceResponse.Order.Coupons[" + i + "].Name"));<NEW_LINE>coupon.setDescription(_ctx.stringValue("DescribePriceResponse.Order.Coupons[" + i + "].Description"));<NEW_LINE>coupons.add(coupon);<NEW_LINE>}<NEW_LINE>order.setCoupons(coupons);<NEW_LINE>describePriceResponse.setOrder(order);<NEW_LINE>List<Rule> rules = new ArrayList<Rule>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePriceResponse.Rules.Length"); i++) {<NEW_LINE>Rule rule = new Rule();<NEW_LINE>rule.setRuleDescId(_ctx.longValue("DescribePriceResponse.Rules[" + i + "].RuleDescId"));<NEW_LINE>rule.setTitle(_ctx.stringValue("DescribePriceResponse.Rules[" + i + "].Title"));<NEW_LINE>rule.setName(_ctx.stringValue("DescribePriceResponse.Rules[" + i + "].Name"));<NEW_LINE>rules.add(rule);<NEW_LINE>}<NEW_LINE>describePriceResponse.setRules(rules);<NEW_LINE>List<SubOrder> subOrders = new ArrayList<SubOrder>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePriceResponse.SubOrders.Length"); i++) {<NEW_LINE>SubOrder subOrder = new SubOrder();<NEW_LINE>subOrder.setOriginalAmount(_ctx.stringValue("DescribePriceResponse.SubOrders[" + i + "].OriginalAmount"));<NEW_LINE>subOrder.setInstanceId(_ctx.stringValue("DescribePriceResponse.SubOrders[" + i + "].InstanceId"));<NEW_LINE>subOrder.setDiscountAmount(_ctx.stringValue("DescribePriceResponse.SubOrders[" + i + "].DiscountAmount"));<NEW_LINE>subOrder.setTradeAmount(_ctx.stringValue("DescribePriceResponse.SubOrders[" + i + "].TradeAmount"));<NEW_LINE>List<String> ruleIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribePriceResponse.SubOrders[" + i + "].RuleIds.Length"); j++) {<NEW_LINE>ruleIds.add(_ctx.stringValue("DescribePriceResponse.SubOrders[" + i + "].RuleIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>subOrder.setRuleIds(ruleIds);<NEW_LINE>subOrders.add(subOrder);<NEW_LINE>}<NEW_LINE>describePriceResponse.setSubOrders(subOrders);<NEW_LINE>return describePriceResponse;<NEW_LINE>}
(_ctx.stringValue("DescribePriceResponse.Order.DiscountAmount"));
482,320
// Kick off the analytics logic.<NEW_LINE>private void startAnalytics() {<NEW_LINE>Activity activity = getActivity();<NEW_LINE>if (activity == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SharedPreferences prefs = activity.getSharedPreferences("WGMaplyPrefs", Context.MODE_PRIVATE);<NEW_LINE>// USER ID is a random string. Only used for deconfliction. No unique information here.<NEW_LINE>String userID = prefs.getString("wgmaplyanalyticuser", null);<NEW_LINE>if (userID == null) {<NEW_LINE>UUID uuid = UUID.randomUUID();<NEW_LINE>userID = uuid.toString();<NEW_LINE>SharedPreferences.Editor editor = prefs.edit();<NEW_LINE>editor.putString("wgmaplyanalyticuser", userID);<NEW_LINE>editor.apply();<NEW_LINE>}<NEW_LINE>// Send it once a month at most<NEW_LINE>long lastSent = prefs.getLong("wgmaplyanalytictime2", 0);<NEW_LINE>final long now = new Date().getTime() / 1000;<NEW_LINE>final long howLong = now - lastSent;<NEW_LINE>if (howLong > 30 * 24 * 60 * 60) {<NEW_LINE>PackageInfo pInfo;<NEW_LINE>try {<NEW_LINE>pInfo = activity.getPackageManager().getPackageInfo(activity.getPackageName(), 0);<NEW_LINE>} catch (Exception e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// We're not recording anything that can identify the user, just the app<NEW_LINE>// create table register( userid VARCHAR(50), bundleid VARCHAR(100), bundlename VARCHAR(100), bundlebuild VARCHAR(100), bundleversion VARCHAR(100), osversion VARCHAR(20), model VARCHAR(100), wgmaplyversion VARCHAR(20));<NEW_LINE>String bundleID = activity.getPackageName();<NEW_LINE>String bundleName = pInfo.packageName;<NEW_LINE>String bundleBuild = "unknown";<NEW_LINE>String bundleVersion = pInfo.versionName;<NEW_LINE>String osversion = "Android " + Build.VERSION.RELEASE;<NEW_LINE>String model = Build.MANUFACTURER + " " + Build.MODEL;<NEW_LINE>String wgMaplyVersion = "3.4";<NEW_LINE>String json = String.format("{ \"userid\":\"%s\", \"bundleid\":\"%s\", \"bundlename\":\"%s\", \"bundlebuild\":\"%s\", \"bundleversion\":\"%s\", \"osversion\":\"%s\", \"model\":\"%s\", \"wgmaplyversion\":\"%s\" }", userID, bundleID, bundleName, bundleBuild, bundleVersion, osversion, model, wgMaplyVersion);<NEW_LINE>Request request = new Request.Builder().url("http://analytics.mousebirdconsulting.com:8081/register").post(RequestBody.create(json, MediaType.parse("application/json"))).build();<NEW_LINE>OkHttpClient client = new OkHttpClient();<NEW_LINE>client.newCall(request).enqueue(new Callback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(@NotNull Call call, @NotNull IOException e) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(@NotNull Call call, @NotNull Response response) {<NEW_LINE>Activity activity2 = getActivity();<NEW_LINE>// We got a response, so save that in prefs<NEW_LINE>if (activity2 != null) {<NEW_LINE>SharedPreferences prefs = activity2.getSharedPreferences("WGMaplyPrefs", Context.MODE_PRIVATE);<NEW_LINE>SharedPreferences.Editor editor = prefs.edit();<NEW_LINE><MASK><NEW_LINE>editor.apply();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
editor.putLong("wgmaplyanalytictime2", now);
1,176,278
public void draw(Canvas canvas) {<NEW_LINE>super.draw(canvas);<NEW_LINE>Rect r = getBounds();<NEW_LINE>// draw border<NEW_LINE>if (borderThickness > 0) {<NEW_LINE>drawBorder(canvas);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (bitmap == null) {<NEW_LINE>canvas.translate(r.left, r.top);<NEW_LINE>}<NEW_LINE>// draw text<NEW_LINE>int width = this.width < 0 ? r.width() : this.width;<NEW_LINE>int height = this.height < 0 ? r.height() : this.height;<NEW_LINE>int fontSize = this.fontSize < 0 ? (Math.min(width, height) / 2) : this.fontSize;<NEW_LINE>if (bitmap == null) {<NEW_LINE>textPaint.setTextSize(fontSize);<NEW_LINE>canvas.drawText(text, width / 2, height / 2 - ((textPaint.descent() + textPaint.ascent()) / 2), textPaint);<NEW_LINE>} else {<NEW_LINE>canvas.drawBitmap(bitmap, (width - bitmap.getWidth()) / 2, (height - bitmap.getHeight()) / 2, null);<NEW_LINE>}<NEW_LINE>canvas.restoreToCount(count);<NEW_LINE>}
int count = canvas.save();
977,373
public void applyProperties(Object arg) {<NEW_LINE>if (!(arg instanceof HashMap)) {<NEW_LINE>Log.w(TAG, "Cannot apply properties: invalid type for properties", Log.DEBUG_MODE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HashMap props = (HashMap) arg;<NEW_LINE>if (modelListener == null) {<NEW_LINE>for (Object name : props.keySet()) {<NEW_LINE>setProperty(TiConvert.toString(name), props.get(name));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (TiApplication.isUIThread()) {<NEW_LINE>for (Object key : props.keySet()) {<NEW_LINE>String name = TiConvert.toString(key);<NEW_LINE>Object value = props.get(key);<NEW_LINE>Object current = getProperty(name);<NEW_LINE>setProperty(name, value);<NEW_LINE>if (shouldFireChange(current, value)) {<NEW_LINE>modelListener.propertyChanged(name, current, value, this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>KrollPropertyChangeSet changes = new KrollPropertyChangeSet(props.size());<NEW_LINE>for (Object key : props.keySet()) {<NEW_LINE>String name = TiConvert.toString(key);<NEW_LINE>Object <MASK><NEW_LINE>Object current = getProperty(name);<NEW_LINE>setProperty(name, value);<NEW_LINE>if (shouldFireChange(current, value)) {<NEW_LINE>changes.addChange(name, current, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (changes.entryCount > 0) {<NEW_LINE>getMainHandler().obtainMessage(MSG_MODEL_PROPERTY_CHANGE, changes).sendToTarget();<NEW_LINE>}<NEW_LINE>}
value = props.get(key);
1,171,166
final ListTargetedSentimentDetectionJobsResult executeListTargetedSentimentDetectionJobs(ListTargetedSentimentDetectionJobsRequest listTargetedSentimentDetectionJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTargetedSentimentDetectionJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTargetedSentimentDetectionJobsRequest> request = null;<NEW_LINE>Response<ListTargetedSentimentDetectionJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTargetedSentimentDetectionJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTargetedSentimentDetectionJobsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Comprehend");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTargetedSentimentDetectionJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTargetedSentimentDetectionJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTargetedSentimentDetectionJobsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
657,005
public Response intercept(Chain chain) throws IOException {<NEW_LINE>Request request = chain.request();<NEW_LINE>if (RealmLog.getLevel() <= LogLevel.DEBUG) {<NEW_LINE>StringBuilder sb = new <MASK><NEW_LINE>sb.append(' ');<NEW_LINE>sb.append(request.url());<NEW_LINE>sb.append('\n');<NEW_LINE>sb.append(request.headers());<NEW_LINE>if (request.body() != null) {<NEW_LINE>// Stripped down version of https://github.com/square/okhttp/blob/master/okhttp-logging-interceptor/src/main/java/okhttp3/logging/HttpLoggingInterceptor.java<NEW_LINE>// We only expect request context to be JSON.<NEW_LINE>Buffer buffer = new Buffer();<NEW_LINE>request.body().writeTo(buffer);<NEW_LINE>// Obfuscate sensitive information if applicable<NEW_LINE>String input = buffer.readString(UTF8);<NEW_LINE>if (httpLogObfuscator != null) {<NEW_LINE>input = httpLogObfuscator.obfuscate(request.url().pathSegments(), input);<NEW_LINE>}<NEW_LINE>sb.append(input);<NEW_LINE>}<NEW_LINE>RealmLog.debug("HTTP Request = \n%s", sb);<NEW_LINE>}<NEW_LINE>return chain.proceed(request);<NEW_LINE>}
StringBuilder(request.method());
954,712
private void assertDuplicate(RegressionEnvironment env, boolean withCache) {<NEW_LINE>CompilerPathCache cache = CompilerPathCache.getInstance();<NEW_LINE>List<EPCompiled> pathOne = new ArrayList<>();<NEW_LINE>compileAdd(env, cache, pathOne, new SupportModuleLoadDetector(), "@public create schema A()");<NEW_LINE>List<EPCompiled> pathTwo = new ArrayList<>();<NEW_LINE>compileAdd(env, cache, pathTwo, new SupportModuleLoadDetector(), "@public create schema A()");<NEW_LINE>CompilerArguments args = new CompilerArguments();<NEW_LINE>if (withCache) {<NEW_LINE>args.getOptions().setPathCache(cache);<NEW_LINE>}<NEW_LINE>args.<MASK><NEW_LINE>args.getPath().addAll(pathTwo);<NEW_LINE>try {<NEW_LINE>EPCompilerProvider.getCompiler().compile("create schema B()", args);<NEW_LINE>fail();<NEW_LINE>} catch (EPCompileException e) {<NEW_LINE>SupportMessageAssertUtil.assertMessage(e, "Invalid path: An event type by name 'A' has already been created for module '(unnamed)'");<NEW_LINE>}<NEW_LINE>}
getPath().addAll(pathOne);
786,501
public boolean isSuperSetOf(BitKey bitKey) {<NEW_LINE>if (bitKey instanceof BitKey.Small) {<NEW_LINE>BitKey.Small other = (BitKey.Small) bitKey;<NEW_LINE>return ((this.bits | other.bits) == this.bits);<NEW_LINE>} else if (bitKey instanceof BitKey.Mid128) {<NEW_LINE>BitKey.Mid128 other = (BitKey.Mid128) bitKey;<NEW_LINE>return ((this.bits | other.bits0) == this.bits) <MASK><NEW_LINE>} else if (bitKey instanceof BitKey.Big) {<NEW_LINE>BitKey.Big other = (BitKey.Big) bitKey;<NEW_LINE>if ((this.bits | other.bits[0]) != this.bits) {<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>for (int i = 1; i < other.bits.length; i++) {<NEW_LINE>if (other.bits[i] != 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
&& (other.bits1 == 0);
849,349
public static boolean deleteFile(@NonNull final File file, Context context) {<NEW_LINE>// First try the normal deletion.<NEW_LINE>if (file == null)<NEW_LINE>return true;<NEW_LINE>boolean fileDelete = false;<NEW_LINE>if (file.isDirectory()) {<NEW_LINE>fileDelete = rmdir(file, context);<NEW_LINE>}<NEW_LINE>if (file.delete() || fileDelete)<NEW_LINE>return true;<NEW_LINE>// Try with Storage Access Framework.<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && FileUtil.isOnExtSdCard(file, context)) {<NEW_LINE>DocumentFile document = getDocumentFile(file, false, context);<NEW_LINE>if (document == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return document.delete();<NEW_LINE>}<NEW_LINE>// Try the Kitkat workaround.<NEW_LINE>if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {<NEW_LINE>ContentResolver resolver = context.getContentResolver();<NEW_LINE>try {<NEW_LINE>Uri uri = MediaStoreHack.getUriFromFile(<MASK><NEW_LINE>resolver.delete(uri, null, null);<NEW_LINE>return !file.exists();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(LOG, "Error when deleting file " + file.getAbsolutePath(), e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return !file.exists();<NEW_LINE>}
file.getAbsolutePath(), context);
2,580
private void init() throws InitialComponentCatalogException {<NEW_LINE>componentName2Id = new HashMap<>();<NEW_LINE>componentName2Id.put("N/A", 0);<NEW_LINE>componentId2Name = new HashMap<>();<NEW_LINE>componentId2Name.put(0, "N/A");<NEW_LINE>componentId2ServerId = new HashMap<>();<NEW_LINE>Map<String, String> nameMapping = new HashMap<>();<NEW_LINE>try {<NEW_LINE>Reader applicationReader = ResourceUtils.read("component-libraries.yml");<NEW_LINE>Yaml yaml = new Yaml();<NEW_LINE>Map map = yaml.loadAs(applicationReader, Map.class);<NEW_LINE>map.forEach((componentName, settingCollection) -> {<NEW_LINE>Map settings = (Map) settingCollection;<NEW_LINE>if (COMPONENT_SERVER_MAPPING_SECTION.equals(componentName)) {<NEW_LINE>settings.forEach((name, serverName) -> {<NEW_LINE>nameMapping.put((String) name, (String) serverName);<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>Integer componentId = (<MASK><NEW_LINE>componentName2Id.put((String) componentName, componentId);<NEW_LINE>componentId2Name.put(componentId, (String) componentName);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>nameMapping.forEach((name, serverName) -> {<NEW_LINE>if (!componentName2Id.containsKey(name)) {<NEW_LINE>throw new InitialComponentCatalogException("Component name [" + name + "] in Component-Server-Mappings doesn't exist in component define. ");<NEW_LINE>}<NEW_LINE>if (!componentName2Id.containsKey(serverName)) {<NEW_LINE>throw new InitialComponentCatalogException("Server componentId name [" + serverName + "] in Component-Server-Mappings doesn't exist in component define. ");<NEW_LINE>}<NEW_LINE>componentId2ServerId.put(componentName2Id.get(name), componentName2Id.get(serverName));<NEW_LINE>});<NEW_LINE>nameMapping.clear();<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>LOGGER.error("component-libraries.yml not found.", e);<NEW_LINE>}<NEW_LINE>}
Integer) settings.get("id");
1,191,157
final DescribeImageAttributeResult executeDescribeImageAttribute(DescribeImageAttributeRequest describeImageAttributeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeImageAttributeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeImageAttributeRequest> request = null;<NEW_LINE>Response<DescribeImageAttributeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeImageAttributeRequestMarshaller().marshall(super.beforeMarshalling(describeImageAttributeRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeImageAttribute");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeImageAttributeResult> responseHandler = new StaxResponseHandler<DescribeImageAttributeResult>(new DescribeImageAttributeResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
898,960
/*<NEW_LINE>private String _findSecondary(int origOffset, int q1) {<NEW_LINE>// tertiary area division is dynamic. First; its size is N/4 compared to<NEW_LINE>// primary hash size; and offsets are for 4 int slots. So to get to logical<NEW_LINE>// index would shift by 4. But! Tertiary area is further split into buckets,<NEW_LINE>// determined by shift value. And finally, from bucket back into physical offsets<NEW_LINE>int offset = _tertiaryStart + ((origOffset >> (_tertiaryShift + 2)) << _tertiaryShift);<NEW_LINE>final int[] hashArea = _hashArea;<NEW_LINE>final int bucketSize = (1 << _tertiaryShift);<NEW_LINE>for (int end = offset + bucketSize; offset < end; offset += 4) {<NEW_LINE>int len = hashArea[offset + 3];<NEW_LINE>if ((q1 == hashArea[offset]) && (1 == len)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (len == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// but if tertiary full, check out spill-over area as last resort<NEW_LINE>// shared spillover starts at 7/8 of the main hash area<NEW_LINE>// (which is sized at 2 * _hashSize), so:<NEW_LINE>for (offset = _spilloverStart(); offset < _spilloverEnd; offset += 4) {<NEW_LINE>if ((q1 == hashArea[offset]) && (1 == hashArea[offset + 3])) {<NEW_LINE>return _names[offset >> 2];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
return _names[offset >> 2];
1,778,276
public ResponseOperateOrchestrator convertWorkflow(RequestConvertOrchestrations requestConversionWorkflow) throws DSSErrorException {<NEW_LINE>// TODO try to optimize it by select db in batch.<NEW_LINE>List<DSSOrchestration> flows = requestConversionWorkflow.getOrcAppIds().stream().map(flowService::getFlowWithJsonAndSubFlowsByID).collect(Collectors.toList());<NEW_LINE>SchedulerAppConn appConn = AppConnManager.getAppConnManager().getAppConn(SchedulerAppConn.class);<NEW_LINE>// List<AppInstance> appInstances = appConn.getAppDesc().getAppInstancesByLabels(requestConversionWorkflow.getDSSLabels());<NEW_LINE>AppInstance schedulerInstance = appConn.getAppDesc().getAppInstances().get(0);<NEW_LINE>DSSToRelConversionOperation operation = appConn.getOrCreateWorkflowConversionStandard().<MASK><NEW_LINE>DSSToRelConversionRequestRef requestRef = AppConnRefFactoryUtils.newAppConnRef(DSSToRelConversionRequestRef.class, appConn.getAppDesc().getAppName());<NEW_LINE>if (requestRef instanceof ProjectToRelConversionRequestRefImpl) {<NEW_LINE>ProjectToRelConversionRequestRefImpl relConversionRequestRef = (ProjectToRelConversionRequestRefImpl) requestRef;<NEW_LINE>relConversionRequestRef.setDSSProject((DSSProject) requestConversionWorkflow.getProject());<NEW_LINE>relConversionRequestRef.setDSSOrcList(flows);<NEW_LINE>relConversionRequestRef.setUserName(requestConversionWorkflow.getUserName());<NEW_LINE>relConversionRequestRef.setWorkspace((Workspace) requestConversionWorkflow.getWorkspace());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ResponseRef responseRef = operation.convert(requestRef);<NEW_LINE>if (responseRef.isFailed()) {<NEW_LINE>return ResponseOperateOrchestrator.failed(responseRef.getErrorMsg());<NEW_LINE>}<NEW_LINE>return ResponseOperateOrchestrator.success();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("convertWorkflow error:", e);<NEW_LINE>return ResponseOperateOrchestrator.failed(e.getMessage());<NEW_LINE>}<NEW_LINE>}
getDSSToRelConversionService(schedulerInstance).getDSSToRelConversionOperation();
1,209,118
public void startElement(XMLElement element, Attributes attributes) {<NEW_LINE>CacheMapping descriptor = getDescriptor();<NEW_LINE>if (element.getQName().equals(RuntimeTagNames.TIMEOUT)) {<NEW_LINE>for (int i = 0; i < attributes.getLength(); i++) {<NEW_LINE>if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {<NEW_LINE>descriptor.setAttributeValue(CacheMapping.TIMEOUT, CacheMapping.NAME, attributes.getValue(i));<NEW_LINE>} else if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {<NEW_LINE>int index = 0;<NEW_LINE>while (descriptor.getAttributeValue(CacheMapping.TIMEOUT, index, CacheMapping.NAME) != null) {<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>descriptor.setAttributeValue(CacheMapping.TIMEOUT, index - 1, CacheMapping.SCOPE, attributes.getValue(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (element.getQName().equals(RuntimeTagNames.REFRESH_FIELD)) {<NEW_LINE>descriptor.setRefreshField(true);<NEW_LINE>for (int i = 0; i < attributes.getLength(); i++) {<NEW_LINE>if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {<NEW_LINE>descriptor.setAttributeValue(CacheMapping.REFRESH_FIELD, 0, CacheMapping.NAME<MASK><NEW_LINE>} else if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {<NEW_LINE>descriptor.setAttributeValue(CacheMapping.REFRESH_FIELD, 0, CacheMapping.SCOPE, attributes.getValue(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (element.getQName().equals(RuntimeTagNames.KEY_FIELD)) {<NEW_LINE>descriptor.addKeyField(true);<NEW_LINE>for (int i = 0; i < attributes.getLength(); i++) {<NEW_LINE>if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {<NEW_LINE>descriptor.setAttributeValue(CacheMapping.KEY_FIELD, CacheMapping.NAME, attributes.getValue(i));<NEW_LINE>} else if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {<NEW_LINE>int index = descriptor.sizeKeyField();<NEW_LINE>descriptor.setAttributeValue(CacheMapping.KEY_FIELD, index - 1, CacheMapping.SCOPE, attributes.getValue(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>super.startElement(element, attributes);<NEW_LINE>}
, attributes.getValue(i));
754,375
void doDelete(Tokenizer st) throws IOException {<NEW_LINE>Tokenizer.Token token;<NEW_LINE>String s;<NEW_LINE>Name name;<NEW_LINE>Record record;<NEW_LINE>int type;<NEW_LINE><MASK><NEW_LINE>token = st.get();<NEW_LINE>if (token.isString()) {<NEW_LINE>s = token.value;<NEW_LINE>if (DClass.value(s) >= 0) {<NEW_LINE>s = st.getString();<NEW_LINE>}<NEW_LINE>if ((type = Type.value(s)) < 0) {<NEW_LINE>throw new IOException("Invalid type: " + s);<NEW_LINE>}<NEW_LINE>token = st.get();<NEW_LINE>boolean iseol = token.isEOL();<NEW_LINE>st.unget();<NEW_LINE>if (!iseol) {<NEW_LINE>record = Record.fromString(name, type, DClass.NONE, 0, st, zone);<NEW_LINE>} else {<NEW_LINE>record = Record.newRecord(name, type, DClass.ANY, 0);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>record = Record.newRecord(name, Type.ANY, DClass.ANY, 0);<NEW_LINE>}<NEW_LINE>query.addRecord(record, Section.UPDATE);<NEW_LINE>print(record);<NEW_LINE>}
name = st.getName(zone);
1,666,606
public Result isProject(FileObject projectDirectory) {<NEW_LINE>assert projectDirectory != null;<NEW_LINE>String displayName = null;<NEW_LINE>String fileName = null;<NEW_LINE>for (String jsonFile : JSON_FILES) {<NEW_LINE>FileObject file = projectDirectory.getFileObject(jsonFile);<NEW_LINE>if (file == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>fileName = file.getNameExt();<NEW_LINE>displayName = getDisplayName(file);<NEW_LINE>if (StringUtilities.hasText(displayName)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fileName == null) {<NEW_LINE>// #262428<NEW_LINE>LOGGER.log(Level.INFO, "None of {0} found in {1}", new Object[] { Arrays.toString(JSON_FILES)<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!StringUtilities.hasText(displayName)) {<NEW_LINE>// should not happen often<NEW_LINE>displayName = projectDirectory.getNameExt();<NEW_LINE>}<NEW_LINE>final Lookup transientLkp = ProjectConvertors.createDelegateToOwnerLookup(projectDirectory);<NEW_LINE>return new Result(Lookups.exclude(transientLkp, ProjectProblemsProvider.class), new Factory(projectDirectory, displayName, (Closeable) transientLkp, fileName), displayName, ImageUtilities.image2Icon(ImageUtilities.loadImage(PROJECT_ICON)));<NEW_LINE>}
, projectDirectory.getNameExt() });
1,676,970
public void prepareData(CodeGenContext context) throws Exception {<NEW_LINE>List<String> exceptions = new ArrayList<>();<NEW_LINE>CSharpCodeGenContext ctx = (CSharpCodeGenContext) context;<NEW_LINE>try {<NEW_LINE>LoggerManager.getInstance().info(String.format("Begin to prepare csharp table data for project %s", ctx.getProjectId()));<NEW_LINE>new CSharpDataPreparerOfTableViewSpProcessor().process(ctx);<NEW_LINE>LoggerManager.getInstance().info(String.format("Prepare csharp table data for project %s completed.", ctx.getProjectId()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LoggerManager.getInstance().error(e);<NEW_LINE>exceptions.add(e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>LoggerManager.getInstance().info(String.format("Begin to prepare csharp sqlbuilder data for project %s", ctx.getProjectId()));<NEW_LINE>new CSharpDataPreparerOfSqlBuilderProcessor().process(ctx);<NEW_LINE>LoggerManager.getInstance().info(String.format("Prepare csharp sqlbuilder data for project %s completed.", ctx.getProjectId()));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LoggerManager.<MASK><NEW_LINE>exceptions.add(e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>LoggerManager.getInstance().info(String.format("Begin to prepare csharp freesql data for project %s", ctx.getProjectId()));<NEW_LINE>new CSharpDataPreparerOfFreeSqlProcessor().process(ctx);<NEW_LINE>LoggerManager.getInstance().info(String.format("Prepare csharp freesql data for project %s completed.", ctx.getProjectId()));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LoggerManager.getInstance().error(e);<NEW_LINE>exceptions.add(e.getMessage());<NEW_LINE>}<NEW_LINE>if (exceptions.size() > 0) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (String exception : exceptions) {<NEW_LINE>sb.append(exception);<NEW_LINE>}<NEW_LINE>throw new RuntimeException(sb.toString());<NEW_LINE>}<NEW_LINE>}
getInstance().error(e);
658,927
public GetIpamResourceCidrsResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>GetIpamResourceCidrsResult getIpamResourceCidrsResult = new GetIpamResourceCidrsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return getIpamResourceCidrsResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>getIpamResourceCidrsResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ipamResourceCidrSet", targetDepth)) {<NEW_LINE>getIpamResourceCidrsResult.withIpamResourceCidrs(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ipamResourceCidrSet/item", targetDepth)) {<NEW_LINE>getIpamResourceCidrsResult.withIpamResourceCidrs(IpamResourceCidrStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return getIpamResourceCidrsResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
new ArrayList<IpamResourceCidr>());
1,591,546
public AttributeValue decode(InputStream inStream) throws IOException {<NEW_LINE>AttributeValue attrValue = new AttributeValue();<NEW_LINE>String type = StringUtf8Coder.of().decode(inStream);<NEW_LINE>AttributeValueType attrType = AttributeValueType.valueOf(type);<NEW_LINE>switch(attrType) {<NEW_LINE>case s:<NEW_LINE>attrValue.setS(StringUtf8Coder.of().decode(inStream));<NEW_LINE>break;<NEW_LINE>case n:<NEW_LINE>attrValue.setN(StringUtf8Coder.of().decode(inStream));<NEW_LINE>break;<NEW_LINE>case bOOL:<NEW_LINE>attrValue.setBOOL(BooleanCoder.of().decode(inStream));<NEW_LINE>break;<NEW_LINE>case b:<NEW_LINE>attrValue.setB(ByteBuffer.wrap(ByteArrayCoder.of().decode(inStream)));<NEW_LINE>break;<NEW_LINE>case sS:<NEW_LINE>attrValue.setSS(LIST_STRING_CODER.decode(inStream));<NEW_LINE>break;<NEW_LINE>case nS:<NEW_LINE>attrValue.setNS(LIST_STRING_CODER.decode(inStream));<NEW_LINE>break;<NEW_LINE>case bS:<NEW_LINE>attrValue.setBS(convertToListByteBuffer(LIST_BYTE_CODER.decode(inStream)));<NEW_LINE>break;<NEW_LINE>case l:<NEW_LINE>attrValue.setL(LIST_ATTRIBUTE_CODER.decode(inStream));<NEW_LINE>break;<NEW_LINE>case m:<NEW_LINE>attrValue.setM<MASK><NEW_LINE>break;<NEW_LINE>case nULLValue:<NEW_LINE>attrValue.setNULL(BooleanCoder.of().decode(inStream));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new CoderException("Unknown Type");<NEW_LINE>}<NEW_LINE>return attrValue;<NEW_LINE>}
(MAP_ATTRIBUTE_CODER.decode(inStream));
824,360
/* (non-Javadoc)<NEW_LINE>* @see org.lamport.tla.toolbox.tool.tlc.output.IProcessOutputSink#appendText(java.lang.String)<NEW_LINE>*/<NEW_LINE>public synchronized void appendText(final String text) {<NEW_LINE>try {<NEW_LINE>ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {<NEW_LINE><NEW_LINE>public void run(IProgressMonitor monitor) throws CoreException {<NEW_LINE>// System.out.print(Thread.currentThread().getId() + " : " + message);<NEW_LINE>outFile.appendContents(new ByteArrayInputStream(text.getBytes()), IResource.FORCE, monitor);<NEW_LINE>}<NEW_LINE>}, rule, IWorkspace.AVOID_UPDATE, new NullProgressMonitor());<NEW_LINE>// if the console output is active, print to it<NEW_LINE>} catch (CoreException e) {<NEW_LINE>TLCActivator.logError("Error writing the TLC process output file for " + <MASK><NEW_LINE>}<NEW_LINE>}
model.getName(), e);
378,438
private void initialize(CompareConfiguration configuration) {<NEW_LINE>Control tree = getControl();<NEW_LINE>INavigatable nav = new INavigatable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean selectChange(int flag) {<NEW_LINE>if (flag == INavigatable.FIRST_CHANGE) {<NEW_LINE>setSelection(StructuredSelection.EMPTY);<NEW_LINE>flag = INavigatable.NEXT_CHANGE;<NEW_LINE>} else if (flag == INavigatable.LAST_CHANGE) {<NEW_LINE>setSelection(StructuredSelection.EMPTY);<NEW_LINE>flag = INavigatable.PREVIOUS_CHANGE;<NEW_LINE>}<NEW_LINE>// Fix for https://dev.eclipse.org/bugs/show_bug.cgi?id=20106<NEW_LINE>return internalNavigate(flag == INavigatable.NEXT_CHANGE, true);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object getInput() {<NEW_LINE>return CheckboxDiffTreeViewer.this.getInput();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean openSelectedChange() {<NEW_LINE>return internalOpen();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasChange(int changeFlag) {<NEW_LINE>return getNextItem(changeFlag == INavigatable.NEXT_CHANGE, false) != null;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>tree.setData(INavigatable.NAVIGATOR_PROPERTY, nav);<NEW_LINE>tree.setData(CompareUI.COMPARE_VIEWER_TITLE, getTitle());<NEW_LINE>Composite parent = tree.getParent();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>fBundle = ResourceBundle.getBundle("org.eclipse.compare.structuremergeviewer.DiffTreeViewerResources");<NEW_LINE>// Register for notification with the CompareConfiguration.<NEW_LINE>fCompareConfiguration = configuration;<NEW_LINE>if (fCompareConfiguration != null) {<NEW_LINE>fPropertyChangeListener = this::propertyChange;<NEW_LINE>fCompareConfiguration.addPropertyChangeListener(fPropertyChangeListener);<NEW_LINE>}<NEW_LINE>setContentProvider(new DiffViewerContentProvider());<NEW_LINE>setLabelProvider(diffViewerLabelProvider = new DiffViewerLabelProvider());<NEW_LINE>addSelectionChangedListener(event -> updateActions());<NEW_LINE>setComparator(new DiffViewerComparator());<NEW_LINE>ToolBarManager tbm = CompareViewerPane.getToolBarManager(parent);<NEW_LINE>if (tbm != null) {<NEW_LINE>tbm.removeAll();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>tbm.<MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>tbm.add(new Separator("modes"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>tbm.add(new Separator("navigation"));<NEW_LINE>createToolItems(tbm);<NEW_LINE>updateActions();<NEW_LINE>tbm.update(true);<NEW_LINE>}<NEW_LINE>MenuManager mm = new MenuManager();<NEW_LINE>mm.setRemoveAllWhenShown(true);<NEW_LINE>mm.addMenuListener(mm2 -> {<NEW_LINE>fillContextMenu(mm2);<NEW_LINE>if (mm2.isEmpty()) {<NEW_LINE>if (fEmptyMenuAction == null) {<NEW_LINE>fEmptyMenuAction = new // $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Action(Utilities.getString(fBundle, "emptyMenuItem")) {<NEW_LINE>};<NEW_LINE>fEmptyMenuAction.setEnabled(false);<NEW_LINE>}<NEW_LINE>mm2.add(fEmptyMenuAction);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tree.setMenu(mm.createContextMenu(tree));<NEW_LINE>}
add(new Separator("merge"));
1,151,696
public ChunkUploadResponse uploadFileAsMultipartPublic1(String accessKey, String uploadId, File file, String contentRange, String xSdsDateFormat) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'accessKey' is set<NEW_LINE>if (accessKey == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'accessKey' when calling uploadFileAsMultipartPublic1");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'uploadId' is set<NEW_LINE>if (uploadId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'uploadId' when calling uploadFileAsMultipartPublic1");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/public/shares/uploads/{access_key}/{upload_id}".replaceAll("\\{" + "access_key" + "\\}", apiClient.escapeString(accessKey.toString())).replaceAll("\\{" + "upload_id" + "\\}", apiClient.escapeString(uploadId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (contentRange != null)<NEW_LINE>localVarHeaderParams.put("Content-Range", apiClient.parameterToString(contentRange));<NEW_LINE>if (xSdsDateFormat != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Date-Format", apiClient.parameterToString(xSdsDateFormat));<NEW_LINE>if (file != null)<NEW_LINE><MASK><NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "multipart/form-data" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<ChunkUploadResponse> localVarReturnType = new GenericType<ChunkUploadResponse>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
localVarFormParams.put("file", file);
1,375,677
public int literalIndex(long key) {<NEW_LINE>// Retrieve the index from the cache<NEW_LINE>// The long constant takes two indexes into the constant pool, but we only store<NEW_LINE>// the first index into the long table<NEW_LINE>int index;<NEW_LINE>// lazy initialization for base type caches<NEW_LINE>// If it is null, initialize it, otherwise use it<NEW_LINE>if (this.longCache == null) {<NEW_LINE>this.longCache = new LongCache(LONG_INITIAL_SIZE);<NEW_LINE>}<NEW_LINE>if ((index = this.longCache.putIfAbsent(key, this.currentIndex)) < 0) {<NEW_LINE>if ((index = -index) > 0xFFFF) {<NEW_LINE>this.classFile.referenceBinding.scope.problemReporter().noMoreAvailableSpaceInConstantPool(this.classFile.referenceBinding.scope.referenceType());<NEW_LINE>}<NEW_LINE>// long value need an extra place into thwe constant pool<NEW_LINE>this.currentIndex += 2;<NEW_LINE>// Write the long into the constant pool<NEW_LINE>// First add the tag<NEW_LINE>int length = this.offsets.length;<NEW_LINE>if (length <= index) {<NEW_LINE>// resize<NEW_LINE>System.arraycopy(this.offsets, 0, (this.offsets = new int[index * 2]), 0, length);<NEW_LINE>}<NEW_LINE>this.offsets[index] = this.currentOffset;<NEW_LINE>writeU1(LongTag);<NEW_LINE>// Then add the 8 bytes representing the long<NEW_LINE>if (this.currentOffset + 8 >= this.poolContent.length) {<NEW_LINE>resizePoolContents(8);<NEW_LINE>}<NEW_LINE>this.poolContent[this.currentOffset++] = (byte) (key >>> 56);<NEW_LINE>this.poolContent[this.currentOffset++] = (byte) (key >>> 48);<NEW_LINE>this.poolContent[this.currentOffset++] = (byte) (key >>> 40);<NEW_LINE>this.poolContent[this.currentOffset++] = (byte) (key >>> 32);<NEW_LINE>this.poolContent[this.currentOffset++] = (byte) (key >>> 24);<NEW_LINE>this.poolContent[this.currentOffset++] = (byte<MASK><NEW_LINE>this.poolContent[this.currentOffset++] = (byte) (key >>> 8);<NEW_LINE>this.poolContent[this.currentOffset++] = (byte) key;<NEW_LINE>}<NEW_LINE>return index;<NEW_LINE>}
) (key >>> 16);
772,948
public default DoubleFunction1D derivative(FiniteDifferenceType differenceType, double eps) {<NEW_LINE>ArgChecker.notNull(differenceType, "difference type");<NEW_LINE>switch(differenceType) {<NEW_LINE>case CENTRAL:<NEW_LINE>return new DoubleFunction1D() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double applyAsDouble(double x) {<NEW_LINE>return (DoubleFunction1D.this.applyAsDouble(x + eps) - DoubleFunction1D.this.applyAsDouble(x - eps)) / 2 / eps;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>case BACKWARD:<NEW_LINE>return new DoubleFunction1D() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double applyAsDouble(double x) {<NEW_LINE>return (DoubleFunction1D.this.applyAsDouble(x) - DoubleFunction1D.this.applyAsDouble(x - eps)) / eps;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>case FORWARD:<NEW_LINE>return new DoubleFunction1D() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double applyAsDouble(double x) {<NEW_LINE>return (DoubleFunction1D.this.applyAsDouble(x + eps) - DoubleFunction1D.this.applyAsDouble(x)) / eps;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>default:<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new IllegalArgumentException("Unhandled FiniteDifferenceType " + differenceType);
1,299,115
public String GetCurrentProgramName() {<NEW_LINE>String functionName = "GetCurrentProgramName";<NEW_LINE>if (!checkBluetooth(functionName)) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>byte[] command = new byte[2];<NEW_LINE>// Direct command telegram, response required<NEW_LINE>command<MASK><NEW_LINE>// GETCURRRENTPROGRAMNAME command<NEW_LINE>command[1] = (byte) 0x11;<NEW_LINE>byte[] returnPackage = sendCommandAndReceiveReturnPackage(functionName, command);<NEW_LINE>int status = getStatus(functionName, returnPackage, command[1]);<NEW_LINE>if (status == 0) {<NEW_LINE>// Success<NEW_LINE>return getStringValueFromBytes(returnPackage, 3);<NEW_LINE>}<NEW_LINE>if (status == 0xEC) {<NEW_LINE>// No active program. We don't treat this as an error.<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>// Some other error code.<NEW_LINE>evaluateStatus(functionName, returnPackage, command[1]);<NEW_LINE>return "";<NEW_LINE>}
[0] = (byte) 0x00;
541,330
final private BitVector makeClassTypeMask(SootClass clazz) {<NEW_LINE>{<NEW_LINE>BitVector cachedMask = typeMask.get(clazz.getType());<NEW_LINE>if (cachedMask != null) {<NEW_LINE>return cachedMask;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int nBits = pag.getAllocNodeNumberer().size();<NEW_LINE>final BitVector mask = new BitVector(nBits);<NEW_LINE>List<AllocNode> allocs = null;<NEW_LINE>if (clazz.isConcrete()) {<NEW_LINE>allocs = class2allocs.get(clazz);<NEW_LINE>}<NEW_LINE>if (allocs != null) {<NEW_LINE>for (AllocNode an : allocs) {<NEW_LINE>mask.set(an.getNumber());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collection<SootClass> subclasses = fh.<MASK><NEW_LINE>if (subclasses == Collections.EMPTY_LIST) {<NEW_LINE>for (AllocNode an : anySubtypeAllocs) {<NEW_LINE>mask.set(an.getNumber());<NEW_LINE>}<NEW_LINE>typeMask.put(clazz.getType(), mask);<NEW_LINE>return mask;<NEW_LINE>}<NEW_LINE>for (SootClass subcl : subclasses) {<NEW_LINE>mask.or(makeClassTypeMask(subcl));<NEW_LINE>}<NEW_LINE>typeMask.put(clazz.getType(), mask);<NEW_LINE>return mask;<NEW_LINE>}
get().getSubclassesOf(clazz);
1,454,253
public Flux<Long> generateCompanion(Flux<RetrySignal> t) {<NEW_LINE>validateArguments();<NEW_LINE>return t.concatMap(retryWhenState -> {<NEW_LINE>// capture the state immediately<NEW_LINE>RetrySignal copy = retryWhenState.copy();<NEW_LINE>Throwable currentFailure = copy.failure();<NEW_LINE>long iteration = isTransientErrors ? copy.totalRetriesInARow() : copy.totalRetries();<NEW_LINE>if (currentFailure == null) {<NEW_LINE>return Mono.error(new IllegalStateException("Retry.RetrySignal#failure() not expected to be null"));<NEW_LINE>}<NEW_LINE>if (!errorFilter.test(currentFailure)) {<NEW_LINE>return Mono.error(currentFailure);<NEW_LINE>}<NEW_LINE>if (iteration >= maxAttempts) {<NEW_LINE>return Mono.error(retryExhaustedGenerator.apply(this, copy));<NEW_LINE>}<NEW_LINE>Duration nextBackoff;<NEW_LINE>try {<NEW_LINE>nextBackoff = minBackoff.multipliedBy((long) Math.pow(2, iteration));<NEW_LINE>if (nextBackoff.compareTo(maxBackoff) > 0) {<NEW_LINE>nextBackoff = maxBackoff;<NEW_LINE>}<NEW_LINE>} catch (ArithmeticException overflow) {<NEW_LINE>nextBackoff = maxBackoff;<NEW_LINE>}<NEW_LINE>// short-circuit delay == 0 case<NEW_LINE>if (nextBackoff.isZero()) {<NEW_LINE>return RetrySpec.applyHooks(copy, Mono.just(iteration), syncPreRetry, syncPostRetry, asyncPreRetry, asyncPostRetry);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>long jitterOffset;<NEW_LINE>try {<NEW_LINE>jitterOffset = nextBackoff.multipliedBy((long) (100 * jitterFactor)).dividedBy(100).toMillis();<NEW_LINE>} catch (ArithmeticException ae) {<NEW_LINE>jitterOffset = Math.round(Long.MAX_VALUE * jitterFactor);<NEW_LINE>}<NEW_LINE>long lowBound = Math.max(minBackoff.minus(nextBackoff).toMillis(), -jitterOffset);<NEW_LINE>long highBound = Math.min(maxBackoff.minus(nextBackoff).toMillis(), jitterOffset);<NEW_LINE>long jitter;<NEW_LINE>if (highBound == lowBound) {<NEW_LINE>if (highBound == 0)<NEW_LINE>jitter = 0;<NEW_LINE>else<NEW_LINE>jitter = random.nextLong(highBound);<NEW_LINE>} else {<NEW_LINE>jitter = random.nextLong(lowBound, highBound);<NEW_LINE>}<NEW_LINE>Duration effectiveBackoff = nextBackoff.plusMillis(jitter);<NEW_LINE>return RetrySpec.applyHooks(copy, Mono.delay(effectiveBackoff, backoffSchedulerSupplier.get()), syncPreRetry, syncPostRetry, asyncPreRetry, asyncPostRetry);<NEW_LINE>});<NEW_LINE>}
ThreadLocalRandom random = ThreadLocalRandom.current();
1,392,041
public void marshall(MethodSetting methodSetting, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (methodSetting == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(methodSetting.getMetricsEnabled(), METRICSENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(methodSetting.getLoggingLevel(), LOGGINGLEVEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(methodSetting.getDataTraceEnabled(), DATATRACEENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(methodSetting.getThrottlingBurstLimit(), THROTTLINGBURSTLIMIT_BINDING);<NEW_LINE>protocolMarshaller.marshall(methodSetting.getThrottlingRateLimit(), THROTTLINGRATELIMIT_BINDING);<NEW_LINE>protocolMarshaller.marshall(methodSetting.getCachingEnabled(), CACHINGENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(methodSetting.getCacheDataEncrypted(), CACHEDATAENCRYPTED_BINDING);<NEW_LINE>protocolMarshaller.marshall(methodSetting.getRequireAuthorizationForCacheControl(), REQUIREAUTHORIZATIONFORCACHECONTROL_BINDING);<NEW_LINE>protocolMarshaller.marshall(methodSetting.getUnauthorizedCacheControlHeaderStrategy(), UNAUTHORIZEDCACHECONTROLHEADERSTRATEGY_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
methodSetting.getCacheTtlInSeconds(), CACHETTLINSECONDS_BINDING);