idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
216,811
protected byte[] serializeImpl(String subject, String topic, boolean isKey, T object, ProtobufSchema schema) throws SerializationException, InvalidConfigurationException {<NEW_LINE>if (schemaRegistry == null) {<NEW_LINE>throw new InvalidConfigurationException("SchemaRegistryClient not found. You need to configure the serializer " + "or use serializer constructor with SchemaRegistryClient.");<NEW_LINE>}<NEW_LINE>// null needs to treated specially since the client most likely just wants to send<NEW_LINE>// an individual null value instead of making the subject a null type. Also, null in<NEW_LINE>// Kafka has a special meaning for deletion in a topic with the compact retention policy.<NEW_LINE>// Therefore, we will bypass schema registration and return a null value in Kafka, instead<NEW_LINE>// of an encoded null.<NEW_LINE>if (object == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String restClientErrorMsg = "";<NEW_LINE>try {<NEW_LINE>boolean autoRegisterForDeps = autoRegisterSchema && !onlyLookupReferencesBySchema;<NEW_LINE>boolean useLatestForDeps = useLatestVersion && !onlyLookupReferencesBySchema;<NEW_LINE>schema = resolveDependencies(schemaRegistry, normalizeSchema, autoRegisterForDeps, useLatestForDeps, latestCompatStrict, latestVersions, skipKnownTypes, referenceSubjectNameStrategy, topic, isKey, schema);<NEW_LINE>int id;<NEW_LINE>if (autoRegisterSchema) {<NEW_LINE>restClientErrorMsg = "Error registering Protobuf schema: ";<NEW_LINE>id = schemaRegistry.register(subject, schema, normalizeSchema);<NEW_LINE>} else if (useSchemaId >= 0) {<NEW_LINE>restClientErrorMsg = "Error retrieving schema ID";<NEW_LINE>schema = (ProtobufSchema) lookupSchemaBySubjectAndId(subject, useSchemaId, schema, idCompatStrict);<NEW_LINE>id = schemaRegistry.getId(subject, schema);<NEW_LINE>} else if (useLatestVersion) {<NEW_LINE>restClientErrorMsg = "Error retrieving latest version: ";<NEW_LINE>schema = (ProtobufSchema) lookupLatestVersion(subject, schema, latestCompatStrict);<NEW_LINE>id = schemaRegistry.getId(subject, schema, normalizeSchema);<NEW_LINE>} else {<NEW_LINE>restClientErrorMsg = "Error retrieving Protobuf schema: ";<NEW_LINE>id = schemaRegistry.<MASK><NEW_LINE>}<NEW_LINE>ByteArrayOutputStream out = new ByteArrayOutputStream();<NEW_LINE>out.write(MAGIC_BYTE);<NEW_LINE>out.write(ByteBuffer.allocate(idSize).putInt(id).array());<NEW_LINE>MessageIndexes indexes = schema.toMessageIndexes(object.getDescriptorForType().getFullName());<NEW_LINE>out.write(indexes.toByteArray());<NEW_LINE>object.writeTo(out);<NEW_LINE>byte[] bytes = out.toByteArray();<NEW_LINE>out.close();<NEW_LINE>return bytes;<NEW_LINE>} catch (IOException | RuntimeException e) {<NEW_LINE>throw new SerializationException("Error serializing Protobuf message", e);<NEW_LINE>} catch (RestClientException e) {<NEW_LINE>throw toKafkaException(e, restClientErrorMsg + schema);<NEW_LINE>}<NEW_LINE>}
getId(subject, schema, normalizeSchema);
288,292
public void run() {<NEW_LINE>// Start a new thread which tracks the journal replay statistics<NEW_LINE>ExponentialBackoffRetry retry = new ExponentialBackoffRetry(<MASK><NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>final OptionalLong finalSN = UfsJournalReader.getLastSN(mJournal);<NEW_LINE>Thread t = new Thread(() -> {<NEW_LINE>UfsJournalProgressLogger progressLogger = new UfsJournalProgressLogger(mJournal, finalSN, () -> mLastAppliedSN);<NEW_LINE>while (!Thread.currentThread().isInterrupted() && retry.attempt()) {<NEW_LINE>// log current stats<NEW_LINE>progressLogger.logProgress();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>t.start();<NEW_LINE>runInternal();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>t.interrupt();<NEW_LINE>ProcessUtils.fatalError(LOG, e, "%s: Failed to run journal checkpoint thread, crashing.", mMaster.getName());<NEW_LINE>System.exit(-1);<NEW_LINE>} finally {<NEW_LINE>t.interrupt();<NEW_LINE>try {<NEW_LINE>t.join();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>LOG.warn("interrupted while waiting for journal stats thread to shut down.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
1000, 30000, Integer.MAX_VALUE);
1,364,814
public boolean importData(JComponent comp, Transferable t) {<NEW_LINE>DataFlavor htmlFlavor = DataFlavor.stringFlavor;<NEW_LINE>if (canImport(comp, t.getTransferDataFlavors())) {<NEW_LINE>try {<NEW_LINE>String transferString = (String) t.getTransferData(htmlFlavor);<NEW_LINE>EditorPane targetTextPane = (EditorPane) comp;<NEW_LINE>for (Map.Entry<String, String> entry : _copiedImgs.entrySet()) {<NEW_LINE><MASK><NEW_LINE>String imgPath = entry.getValue();<NEW_LINE>File destFile = targetTextPane.copyFileToBundle(imgPath);<NEW_LINE>String newName = destFile.getName();<NEW_LINE>if (!newName.equals(imgName)) {<NEW_LINE>String ptnImgName = "\"" + imgName + "\"";<NEW_LINE>newName = "\"" + newName + "\"";<NEW_LINE>transferString = transferString.replaceAll(ptnImgName, newName);<NEW_LINE>Debug.info("MyTransferHandler: importData:" + ptnImgName + " exists. Rename it to " + newName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>targetTextPane.insertString(transferString);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log(-1, "MyTransferHandler: importData: Problem pasting text\n%s", e.getMessage());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
String imgName = entry.getKey();
1,498,759
private ReplacedElement replaceImage(Element elem, String uri, int width, int height, UserAgentCallback uac) {<NEW_LINE>ReplacedElement replaced = _sizedImageCache.get(new SizedImageCacheKey(uri, width, height));<NEW_LINE>if (replaced != null) {<NEW_LINE>return replaced;<NEW_LINE>}<NEW_LINE>XRLog.log(Level.FINE, LogMessageId.LogMessageId1Param.LOAD_LOAD_IMMEDIATE_URI, uri);<NEW_LINE>ImageResource ir = uac.getImageResource(uri);<NEW_LINE>if (ir == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>FSImage awtfsImage = ir.getImage();<NEW_LINE>BufferedImage newImg = ((<MASK><NEW_LINE>if (newImg == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (width > -1 || height > -1) {<NEW_LINE>XRLog.log(Level.FINE, LogMessageId.LogMessageId4Param.LOAD_IMAGE_LOADER_SCALING_URI_TO, this, uri, width, height);<NEW_LINE>replaced = new ImageReplacedElement(newImg, width, height);<NEW_LINE>_sizedImageCache.put(new SizedImageCacheKey(uri, width, height), replaced);<NEW_LINE>} else {<NEW_LINE>replaced = new ImageReplacedElement(newImg, width, height);<NEW_LINE>}<NEW_LINE>return replaced;<NEW_LINE>}
AWTFSImage) awtfsImage).getImage();
1,297,756
private static long readSub0(int miCol, int miRow, int blSz, VPXBooleanDecoder decoder, DecodingContext c, int lumaMode, int packedRefFrames) {<NEW_LINE>int ref0 = Packed4BitList.get(packedRefFrames, 0);<NEW_LINE>int ref1 = <MASK><NEW_LINE>boolean compoundPred = Packed4BitList.get(packedRefFrames, 2) == 1;<NEW_LINE>long nearestNearMv00 = findBestMv(miCol, miRow, blSz, ref0, 0, c, true);<NEW_LINE>long nearestNearMv01 = 0;<NEW_LINE>if (compoundPred)<NEW_LINE>nearestNearMv01 = findBestMv(miCol, miRow, blSz, ref1, 0, c, true);<NEW_LINE>int mv0 = 0, mv1 = 0;<NEW_LINE>if (lumaMode == NEWMV) {<NEW_LINE>mv0 = readDiffMv(decoder, c, nearestNearMv00);<NEW_LINE>if (compoundPred)<NEW_LINE>mv1 = readDiffMv(decoder, c, nearestNearMv01);<NEW_LINE>} else if (lumaMode != ZEROMV) {<NEW_LINE>mv0 = MVList.get(nearestNearMv00, lumaMode - NEARESTMV);<NEW_LINE>mv1 = MVList.get(nearestNearMv01, lumaMode - NEARESTMV);<NEW_LINE>}<NEW_LINE>return MVList.create(mv0, mv1);<NEW_LINE>}
Packed4BitList.get(packedRefFrames, 1);
923,836
public Object childEvaluate(Parser parser, VariableResolver resolver, String functionName, List<Object> parameters) throws ParserException {<NEW_LINE>if (!MapTool.getParser().isMacroTrusted())<NEW_LINE>throw new ParserException(I18N.getText("macro.function.general.noPerm", functionName));<NEW_LINE>if (!AppPreferences.getAllowExternalMacroAccess())<NEW_LINE>throw new ParserException(I18N.getText("macro.function.general.accessDenied", functionName));<NEW_LINE>// New function to save data to an external file.<NEW_LINE>if (functionName.equalsIgnoreCase("exportData")) {<NEW_LINE>if (parameters.size() != 3)<NEW_LINE>throw new ParserException(I18N.getText("macro.function.general.wrongNumParam", functionName, 1<MASK><NEW_LINE>File file = new File(parameters.get(0).toString());<NEW_LINE>String data = parameters.get(1).toString();<NEW_LINE>boolean appendToFile = (new BigDecimal(parameters.get(2).toString()).equals(BigDecimal.ONE));<NEW_LINE>try {<NEW_LINE>// if file doesn't exists, then create it<NEW_LINE>if (!file.exists()) {<NEW_LINE>file.createNewFile();<NEW_LINE>}<NEW_LINE>FileWriter fw = new FileWriter(file.getAbsoluteFile(), appendToFile);<NEW_LINE>BufferedWriter bw = new BufferedWriter(fw);<NEW_LINE>String[] words = data.split("\\\\r");<NEW_LINE>for (String word : words) {<NEW_LINE>bw.write(word.replaceAll("\\\\t", "\t"));<NEW_LINE>bw.newLine();<NEW_LINE>}<NEW_LINE>bw.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.out.println("Error in exportData during file write!");<NEW_LINE>e.printStackTrace();<NEW_LINE>return BigDecimal.ZERO;<NEW_LINE>}<NEW_LINE>return BigDecimal.ONE;<NEW_LINE>}<NEW_LINE>if (functionName.equalsIgnoreCase("getEnvironmentVariable")) {<NEW_LINE>if (parameters.size() != 1)<NEW_LINE>throw new ParserException(I18N.getText("macro.function.general.wrongNumParam", functionName, 1, parameters.size()));<NEW_LINE>String envName = parameters.get(0).toString();<NEW_LINE>String value = System.getenv(envName);<NEW_LINE>// System.out.format("%s=%s%n", envName, value);<NEW_LINE>// System.out.format("%s is not assigned.%n", envName);<NEW_LINE>return Objects.requireNonNullElse(value, "");<NEW_LINE>}<NEW_LINE>throw new ParserException(I18N.getText("macro.function.general.unknownFunction", functionName));<NEW_LINE>}
, parameters.size()));
1,456,283
protected boolean increment(String key, String threadName, int threadId) {<NEW_LINE>try (PreparedStatement pstmt = _concierge.conn().prepareStatement(INCREMENT_SQL)) {<NEW_LINE>pstmt.setString(1, key);<NEW_LINE><MASK><NEW_LINE>pstmt.setString(3, threadName);<NEW_LINE>pstmt.setInt(4, threadId);<NEW_LINE>int rows = pstmt.executeUpdate();<NEW_LINE>assert (rows <= 1) : "hmm...non unique key? " + pstmt;<NEW_LINE>if (s_logger.isTraceEnabled()) {<NEW_LINE>s_logger.trace("lck-" + key + (rows == 1 ? " acquired again" : " failed to acquire again"));<NEW_LINE>}<NEW_LINE>if (rows == 1) {<NEW_LINE>incrCount();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_logger.error("increment:Exception:" + e.getMessage());<NEW_LINE>throw new CloudRuntimeException("increment:Exception:" + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
pstmt.setLong(2, _msId);
1,085,273
public static ClassDetailVO createClassInfo(Class clazz, boolean withFields) {<NEW_LINE>CodeSource cs = clazz.getProtectionDomain().getCodeSource();<NEW_LINE>ClassDetailVO classInfo = new ClassDetailVO();<NEW_LINE>classInfo.setName(StringUtils.classname(clazz));<NEW_LINE>classInfo.setClassInfo(StringUtils.classname(clazz));<NEW_LINE>classInfo.setCodeSource(ClassUtils.getCodeSource(cs));<NEW_LINE>classInfo.setInterface(clazz.isInterface());<NEW_LINE>classInfo.setAnnotation(clazz.isAnnotation());<NEW_LINE>classInfo.setEnum(clazz.isEnum());<NEW_LINE>classInfo.setAnonymousClass(clazz.isAnonymousClass());<NEW_LINE>classInfo.<MASK><NEW_LINE>classInfo.setLocalClass(clazz.isLocalClass());<NEW_LINE>classInfo.setMemberClass(clazz.isMemberClass());<NEW_LINE>classInfo.setPrimitive(clazz.isPrimitive());<NEW_LINE>classInfo.setSynthetic(clazz.isSynthetic());<NEW_LINE>classInfo.setSimpleName(clazz.getSimpleName());<NEW_LINE>classInfo.setModifier(StringUtils.modifier(clazz.getModifiers(), ','));<NEW_LINE>classInfo.setAnnotations(TypeRenderUtils.getAnnotations(clazz));<NEW_LINE>classInfo.setInterfaces(TypeRenderUtils.getInterfaces(clazz));<NEW_LINE>classInfo.setSuperClass(TypeRenderUtils.getSuperClass(clazz));<NEW_LINE>classInfo.setClassloader(TypeRenderUtils.getClassloader(clazz));<NEW_LINE>classInfo.setClassLoaderHash(StringUtils.classLoaderHash(clazz));<NEW_LINE>if (withFields) {<NEW_LINE>classInfo.setFields(TypeRenderUtils.getFields(clazz));<NEW_LINE>}<NEW_LINE>return classInfo;<NEW_LINE>}
setArray(clazz.isArray());
941,760
private JPanel createGraphFontValuePane() {<NEW_LINE>JPanel fontValueStylePane = new JPanel();<NEW_LINE>fontValueStylePane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>fontValueStylePane.// $NON-NLS-1$<NEW_LINE>add(// $NON-NLS-1$<NEW_LINE>GuiUtils.// $NON-NLS-1$<NEW_LINE>createLabelCombo(JMeterUtils.getResString("aggregate_graph_value_font"), valueFontNameList));<NEW_LINE>// default: sans serif<NEW_LINE>valueFontNameList.setSelectedIndex(0);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>fontValueStylePane.// $NON-NLS-1$<NEW_LINE>add(// $NON-NLS-1$<NEW_LINE>GuiUtils.// $NON-NLS-1$<NEW_LINE>createLabelCombo(JMeterUtils.getResString("aggregate_graph_size"), valueFontSizeList));<NEW_LINE>// default: 10<NEW_LINE>valueFontSizeList.setSelectedItem(StatGraphProperties.getFontSize()[2]);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>fontValueStylePane.// $NON-NLS-1$<NEW_LINE>add(// $NON-NLS-1$<NEW_LINE>GuiUtils.// $NON-NLS-1$<NEW_LINE>createLabelCombo(JMeterUtils.getResString("aggregate_graph_style"), valueFontStyleList));<NEW_LINE>// default: normal //$NON-NLS-1$<NEW_LINE>valueFontStyleList.setSelectedItem<MASK><NEW_LINE>return fontValueStylePane;<NEW_LINE>}
(JMeterUtils.getResString("fontstyle.normal"));
783,940
private int deleteRequest(PersistRequestBean<?> req, PersistRequestBean<?> draftReq) {<NEW_LINE>if (req.isRegisteredForDeleteBean()) {<NEW_LINE>// skip deleting bean. Used where cascade is on<NEW_LINE>// both sides of a relationship<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(<MASK><NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>req.initTransIfRequiredWithBatchCascade();<NEW_LINE>int rows = delete(req);<NEW_LINE>if (draftReq != null) {<NEW_LINE>// delete the 'draft' bean ('live' bean deleted first)<NEW_LINE>draftReq.setTrans(req.transaction());<NEW_LINE>rows = delete(draftReq);<NEW_LINE>}<NEW_LINE>req.commitTransIfRequired();<NEW_LINE>req.flushBatchOnCascade();<NEW_LINE>return rows;<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>req.rollbackTransIfRequired();<NEW_LINE>throw ex;<NEW_LINE>} finally {<NEW_LINE>req.clearTransIfRequired();<NEW_LINE>}<NEW_LINE>}
"skipping delete on alreadyRegistered {}", req.bean());
94,761
final ListBotVersionsResult executeListBotVersions(ListBotVersionsRequest listBotVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listBotVersionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListBotVersionsRequest> request = null;<NEW_LINE>Response<ListBotVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListBotVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listBotVersionsRequest));<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, "Lex Models V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListBotVersions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListBotVersionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListBotVersionsResultJsonUnmarshaller());<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);
458,184
public void remove(DHTPluginContact[] targets, byte[] key, String description, DHTPluginOperationListener listener) {<NEW_LINE>if (!isEnabled()) {<NEW_LINE>throw (new RuntimeException("DHT isn't enabled"));<NEW_LINE>}<NEW_LINE>Map dht_map = new HashMap();<NEW_LINE>for (int i = 0; i < targets.length; i++) {<NEW_LINE>DHTPluginContactImpl target = (DHTPluginContactImpl) targets[i];<NEW_LINE>DHTPluginImpl dht = target.getDHT();<NEW_LINE>List c = (List) dht_map.get(dht);<NEW_LINE>if (c == null) {<NEW_LINE>c = new ArrayList();<NEW_LINE>dht_map.put(dht, c);<NEW_LINE>}<NEW_LINE>c.add(target);<NEW_LINE>}<NEW_LINE>Iterator it = dht_map.entrySet().iterator();<NEW_LINE>boolean primary = true;<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Map.Entry entry = (Map<MASK><NEW_LINE>DHTPluginImpl dht = (DHTPluginImpl) entry.getKey();<NEW_LINE>List contacts = (List) entry.getValue();<NEW_LINE>DHTPluginContact[] dht_targets = new DHTPluginContact[contacts.size()];<NEW_LINE>contacts.toArray(dht_targets);<NEW_LINE>if (primary) {<NEW_LINE>primary = false;<NEW_LINE>dht.remove(dht_targets, key, description, listener);<NEW_LINE>} else {<NEW_LINE>// lazy - just report ops on one dht<NEW_LINE>dht.remove(dht_targets, key, description, new DHTPluginOperationListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean diversified() {<NEW_LINE>return (true);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void starts(byte[] key) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void valueRead(DHTPluginContact originator, DHTPluginValue value) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void valueWritten(DHTPluginContact target, DHTPluginValue value) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void complete(byte[] key, boolean timeout_occurred) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.Entry) it.next();
884,142
private File saveToFile(Response response) throws IOException {<NEW_LINE>InputStream is = null;<NEW_LINE>byte[] buf = new byte[40960];<NEW_LINE>int len = 0;<NEW_LINE>FileOutputStream fos = null;<NEW_LINE>try {<NEW_LINE>is = response.body().byteStream();<NEW_LINE>final long total = response.body().contentLength();<NEW_LINE>long sum = 0;<NEW_LINE>WXLogUtils.e(total + "");<NEW_LINE>File dir = new File(destDirPath);<NEW_LINE>if (!dir.exists()) {<NEW_LINE>dir.mkdirs();<NEW_LINE>}<NEW_LINE>File file = new File(dir, destFileName);<NEW_LINE>fos = new FileOutputStream(file);<NEW_LINE>while ((len = is.read(buf)) != -1) {<NEW_LINE>sum += len;<NEW_LINE>fos.<MASK><NEW_LINE>final long finalSum = sum;<NEW_LINE>runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>onProgress(finalSum * 1.0f / total);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>fos.flush();<NEW_LINE>return file;<NEW_LINE>} finally {<NEW_LINE>if (is != null)<NEW_LINE>is.close();<NEW_LINE>if (fos != null)<NEW_LINE>fos.close();<NEW_LINE>}<NEW_LINE>}
write(buf, 0, len);
501,897
void buildIndexCreationInfo() throws Exception {<NEW_LINE>Set<String> varLengthDictionaryColumns = new HashSet<>(_config.getVarLengthDictionaryColumns());<NEW_LINE>for (FieldSpec fieldSpec : _dataSchema.getAllFieldSpecs()) {<NEW_LINE>// Ignore virtual columns<NEW_LINE>if (fieldSpec.isVirtualColumn()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String columnName = fieldSpec.getName();<NEW_LINE>DataType storedType = fieldSpec.getDataType().getStoredType();<NEW_LINE>ColumnStatistics <MASK><NEW_LINE>boolean useVarLengthDictionary = varLengthDictionaryColumns.contains(columnName);<NEW_LINE>Object defaultNullValue = fieldSpec.getDefaultNullValue();<NEW_LINE>if (storedType == DataType.BYTES) {<NEW_LINE>if (!columnProfile.isFixedLength()) {<NEW_LINE>useVarLengthDictionary = true;<NEW_LINE>}<NEW_LINE>defaultNullValue = new ByteArray((byte[]) defaultNullValue);<NEW_LINE>}<NEW_LINE>_indexCreationInfoMap.put(columnName, new ColumnIndexCreationInfo(columnProfile, true, /*createDictionary*/<NEW_LINE>useVarLengthDictionary, false, /*isAutoGenerated*/<NEW_LINE>defaultNullValue));<NEW_LINE>}<NEW_LINE>_segmentIndexCreationInfo.setTotalDocs(_totalDocs);<NEW_LINE>}
columnProfile = _segmentStats.getColumnProfileFor(columnName);
975,184
public ResponseEntity<AttackResult> checkout(@RequestHeader(value = "Authorization", required = false) String token) {<NEW_LINE>if (token == null) {<NEW_LINE>return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Jwt jwt = Jwts.parser().setSigningKey(JWT_PASSWORD).parse(token.replace("Bearer ", ""));<NEW_LINE>Claims claims = (Claims) jwt.getBody();<NEW_LINE>String user = (String) claims.get("user");<NEW_LINE>if ("Tom".equals(user)) {<NEW_LINE>return ok(success<MASK><NEW_LINE>}<NEW_LINE>return ok(failed(this).feedback("jwt-refresh-not-tom").feedbackArgs(user).build());<NEW_LINE>} catch (ExpiredJwtException e) {<NEW_LINE>return ok(failed(this).output(e.getMessage()).build());<NEW_LINE>} catch (JwtException e) {<NEW_LINE>return ok(failed(this).feedback("jwt-invalid-token").build());<NEW_LINE>}<NEW_LINE>}
(this).build());
552,141
private static boolean verifyLabelMarkerData(Rule rule, String key, String value, Environment env) throws InterruptedException {<NEW_LINE>Preconditions.checkArgument(key.startsWith("FILE:"));<NEW_LINE>try {<NEW_LINE>RootedPath rootedPath;<NEW_LINE>String fileKey = key.substring(5);<NEW_LINE>if (LabelValidator.isAbsolute(fileKey)) {<NEW_LINE>rootedPath = getRootedPathFromLabel(Label.parseAbsolute(fileKey, ImmutableMap.of()), env);<NEW_LINE>} else {<NEW_LINE>// TODO(pcloudy): Removing checking absolute path, they should all be absolute label.<NEW_LINE>PathFragment filePathFragment = PathFragment.create(fileKey);<NEW_LINE>Path file = rule.getPackage().getPackageDirectory().getRelative(filePathFragment);<NEW_LINE>rootedPath = RootedPath.toRootedPath(Root.fromPath(file.getParentDirectory()), PathFragment.create(file.getBaseName()));<NEW_LINE>}<NEW_LINE>SkyKey fileSkyKey = FileValue.key(rootedPath);<NEW_LINE>FileValue fileValue = (FileValue) env.getValueOrThrow(fileSkyKey, IOException.class);<NEW_LINE>if (fileValue == null || !fileValue.isFile() || fileValue.isSpecialFile()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return Objects.equals<MASK><NEW_LINE>} catch (LabelSyntaxException e) {<NEW_LINE>throw new IllegalStateException("Key " + key + " is not a correct file key (should be in form FILE:label)", e);<NEW_LINE>} catch (IOException | EvalException e) {<NEW_LINE>// Consider those exception to be a cause for invalidation<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
(value, fileValueToMarkerValue(fileValue));
1,502,642
private List<RadioIdDetail> createRadioDetails() {<NEW_LINE>List<RadioIdDetail> details = new ArrayList<>();<NEW_LINE>details.add(new RadioIdDetail(Protocol.APCO25, IntegerFormat.DECIMAL, new IntegerFormatter(0, 0xFFFFFF), new IntegerFormatter(0, 0xFFFFFF), "Format: 0 - 16777215"));<NEW_LINE>details.add(new RadioIdDetail(Protocol.APCO25, IntegerFormat.HEXADECIMAL, new HexFormatter(0, 0xFFFFFF), new HexFormatter(0, 0xFFFFFF), "Format: 0 - FFFFFF"));<NEW_LINE>details.add(new RadioIdDetail(Protocol.PASSPORT, IntegerFormat.DECIMAL, new IntegerFormatter(0, 0x7FFFFF), new IntegerFormatter(<MASK><NEW_LINE>details.add(new RadioIdDetail(Protocol.PASSPORT, IntegerFormat.HEXADECIMAL, new HexFormatter(0, 0x7FFFFF), new HexFormatter(0, 0x7FFFFF), "Format: 0 - 7FFFFF"));<NEW_LINE>details.add(new RadioIdDetail(Protocol.UNKNOWN, IntegerFormat.DECIMAL, new IntegerFormatter(0, 16777215), new IntegerFormatter(0, 16777215), "Format: 0 - FFFFFF"));<NEW_LINE>details.add(new RadioIdDetail(Protocol.UNKNOWN, IntegerFormat.FORMATTED, new IntegerFormatter(0, 16777215), new IntegerFormatter(0, 16777215), "Format: 0 - FFFFFF"));<NEW_LINE>details.add(new RadioIdDetail(Protocol.UNKNOWN, IntegerFormat.HEXADECIMAL, new HexFormatter(0, 16777215), new HexFormatter(0, 16777215), "Format: 0 - FFFFFF"));<NEW_LINE>return details;<NEW_LINE>}
0, 0x7FFFFF), "Format: 0 - 8388607"));
1,014,132
public static IntOctagon bounding_octagon(FloatPoint[] p_point_arr) {<NEW_LINE>double lx = Integer.MAX_VALUE;<NEW_LINE>double ly = Integer.MAX_VALUE;<NEW_LINE>double rx = Integer.MIN_VALUE;<NEW_LINE>double uy = Integer.MIN_VALUE;<NEW_LINE>double ulx = Integer.MAX_VALUE;<NEW_LINE>double lrx = Integer.MIN_VALUE;<NEW_LINE>double llx = Integer.MAX_VALUE;<NEW_LINE>double urx = Integer.MIN_VALUE;<NEW_LINE>for (int i = 0; i < p_point_arr.length; ++i) {<NEW_LINE>FloatPoint curr = p_point_arr[i];<NEW_LINE>lx = Math.min(lx, curr.x);<NEW_LINE>ly = Math.min(ly, curr.y);<NEW_LINE>rx = Math.max(rx, curr.x);<NEW_LINE>uy = Math.<MASK><NEW_LINE>double tmp = curr.x - curr.y;<NEW_LINE>ulx = Math.min(ulx, tmp);<NEW_LINE>lrx = Math.max(lrx, tmp);<NEW_LINE>tmp = curr.x + curr.y;<NEW_LINE>llx = Math.min(llx, tmp);<NEW_LINE>urx = Math.max(urx, tmp);<NEW_LINE>}<NEW_LINE>IntOctagon surrounding_octagon = new IntOctagon((int) Math.floor(lx), (int) Math.floor(ly), (int) Math.ceil(rx), (int) Math.ceil(uy), (int) Math.floor(ulx), (int) Math.ceil(lrx), (int) Math.floor(llx), (int) Math.ceil(urx));<NEW_LINE>return surrounding_octagon;<NEW_LINE>}
max(uy, curr.y);
747,658
protected String doSubmitAction(@ModelAttribute("command") GeneralSettingsCommand command, RedirectAttributes redirectAttributes) {<NEW_LINE>int themeIndex = Integer.parseInt(command.getThemeIndex());<NEW_LINE>Theme theme = settingsService.getAvailableThemes()[themeIndex];<NEW_LINE>int localeIndex = Integer.parseInt(command.getLocaleIndex());<NEW_LINE>Locale locale = settingsService.getAvailableLocales()[localeIndex];<NEW_LINE>redirectAttributes.addFlashAttribute("settings_toast", true);<NEW_LINE>redirectAttributes.addFlashAttribute("settings_reload", !settingsService.getIndexString().equals(command.getIndex()) || !settingsService.getIgnoredArticles().equals(command.getIgnoredArticles()) || !settingsService.getShortcuts().equals(command.getShortcuts()) || !settingsService.getThemeId().equals(theme.getId()) || !settingsService.getLocale().equals(locale));<NEW_LINE>settingsService.setIndexString(command.getIndex());<NEW_LINE>settingsService.setIgnoredArticles(command.getIgnoredArticles());<NEW_LINE>settingsService.setShortcuts(command.getShortcuts());<NEW_LINE>settingsService.setPlaylistFolder(command.getPlaylistFolder());<NEW_LINE>settingsService.setMusicFileTypes(command.getMusicFileTypes());<NEW_LINE>settingsService.setVideoFileTypes(command.getVideoFileTypes());<NEW_LINE>settingsService.<MASK><NEW_LINE>settingsService.setSortAlbumsByYear(command.isSortAlbumsByYear());<NEW_LINE>settingsService.setGettingStartedEnabled(command.isGettingStartedEnabled());<NEW_LINE>settingsService.setWelcomeTitle(command.getWelcomeTitle());<NEW_LINE>settingsService.setWelcomeSubtitle(command.getWelcomeSubtitle());<NEW_LINE>settingsService.setWelcomeMessage(command.getWelcomeMessage());<NEW_LINE>settingsService.setLoginMessage(command.getLoginMessage());<NEW_LINE>settingsService.setThemeId(theme.getId());<NEW_LINE>settingsService.setLocale(locale);<NEW_LINE>settingsService.save();<NEW_LINE>return "redirect:generalSettings.view";<NEW_LINE>}
setCoverArtFileTypes(command.getCoverArtFileTypes());
1,799,996
public void read(org.apache.thrift.protocol.TProtocol prot, ClusterJoinResponseMessage struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>struct.header = new AsyncMessageHeader();<NEW_LINE>struct.header.read(iprot);<NEW_LINE>struct.setHeaderIsSet(true);<NEW_LINE>java.util.BitSet <MASK><NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.newNodeId = iprot.readI16();<NEW_LINE>struct.setNewNodeIdIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list69 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);<NEW_LINE>struct.nodeStore = new java.util.ArrayList<KeyedValues>(_list69.size);<NEW_LINE>@org.apache.thrift.annotation.Nullable<NEW_LINE>KeyedValues _elem70;<NEW_LINE>for (int _i71 = 0; _i71 < _list69.size; ++_i71) {<NEW_LINE>_elem70 = new KeyedValues();<NEW_LINE>_elem70.read(iprot);<NEW_LINE>struct.nodeStore.add(_elem70);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.setNodeStoreIsSet(true);<NEW_LINE>}<NEW_LINE>}
incoming = iprot.readBitSet(2);
1,725,521
public static void copyDirFiles(File sourceDir, File targetDir, boolean preserveTimestamp) {<NEW_LINE>File[] files = sourceDir.listFiles();<NEW_LINE>if (files == null || files.length == 0) {<NEW_LINE>targetDir.mkdirs();<NEW_LINE>if (preserveTimestamp) {<NEW_LINE>targetDir.<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (preserveTimestamp) {<NEW_LINE>targetDir.setLastModified(sourceDir.lastModified());<NEW_LINE>}<NEW_LINE>for (int i = 0; i < files.length; i++) {<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>File target = FileUtil.normalizeFile(new File(targetDir.getAbsolutePath() + "/" + files[i].getName()));<NEW_LINE>if (files[i].isDirectory()) {<NEW_LINE>copyDirFiles(files[i], target, preserveTimestamp);<NEW_LINE>} else {<NEW_LINE>FileUtils.copyFile(files[i], target);<NEW_LINE>if (preserveTimestamp) {<NEW_LINE>target.setLastModified(files[i].lastModified());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// should not happen<NEW_LINE>LocalRepository.LOG.log(Level.INFO, null, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setLastModified(sourceDir.lastModified());
885,793
public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) {<NEW_LINE>final ListCalc listCalc = compiler.compileList<MASK><NEW_LINE>final Calc calc = call.getArgCount() > 1 ? compiler.compileScalar(call.getArg(1), true) : new ValueCalc(call);<NEW_LINE>return new AbstractDoubleCalc(call, new Calc[] { listCalc, calc }) {<NEW_LINE><NEW_LINE>public double evaluateDouble(Evaluator evaluator) {<NEW_LINE>evaluator.getTiming().markStart(TIMING_NAME);<NEW_LINE>final int savepoint = evaluator.savepoint();<NEW_LINE>try {<NEW_LINE>TupleList memberList = evaluateCurrentList(listCalc, evaluator);<NEW_LINE>evaluator.setNonEmpty(false);<NEW_LINE>return (Double) (max ? max(evaluator, memberList, calc) : min(evaluator, memberList, calc));<NEW_LINE>} finally {<NEW_LINE>evaluator.restore(savepoint);<NEW_LINE>evaluator.getTiming().markEnd(TIMING_NAME);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>public boolean dependsOn(Hierarchy hierarchy) {<NEW_LINE>return anyDependsButFirst(getCalcs(), hierarchy);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
(call.getArg(0));
516,628
private void drawTextWithArrowNearOpenStructureIcon(String text, Rectangle cursorBounds) {<NEW_LINE>//<NEW_LINE>// Make some room to draw our annotations (text and an arrow)<NEW_LINE>//<NEW_LINE>Dimension whitespace = new Dimension(150, 10);<NEW_LINE>padImage(Color.WHITE, whitespace.height, whitespace.width, 10, 10);<NEW_LINE>//<NEW_LINE>// Draw text inside of the newly padded space<NEW_LINE>//<NEW_LINE>int arrowStartY = 40;<NEW_LINE>int textStartX = 20;<NEW_LINE>// up just a bit<NEW_LINE>int textStartY = arrowStartY - 4;<NEW_LINE>Point textPoint = new Point(textStartX, textStartY);<NEW_LINE>int size = 24;<NEW_LINE>Color textColor = Color.MAGENTA.darker();<NEW_LINE>drawText(text, textColor, textPoint, size);<NEW_LINE>//<NEW_LINE>// Draw an arrow from the text above to the 'open structure' icon<NEW_LINE>//<NEW_LINE>int arrowStartX = 60;<NEW_LINE>Color arrowColor <MASK><NEW_LINE>Point arrowStart = new Point(arrowStartX, arrowStartY);<NEW_LINE>int addressFieldStartX = 40;<NEW_LINE>int listingOffsetX = whitespace.width;<NEW_LINE>int listingOffsetY = whitespace.height;<NEW_LINE>// a bit of fudge<NEW_LINE>int arrowEndX = listingOffsetX + (cursorBounds.x - addressFieldStartX);<NEW_LINE>int arrowEndY = listingOffsetY + (cursorBounds.y + (cursorBounds.height / 2));<NEW_LINE>Point arrowEnd = new Point(arrowEndX, arrowEndY);<NEW_LINE>drawArrow(arrowColor, arrowStart, arrowEnd);<NEW_LINE>}
= Color.GREEN.darker();
1,557,124
private void save(FieldMetadata field, Writer writer, OutputStream out, boolean indent, boolean formatAsJavaString) throws IOException {<NEW_LINE>if (indent) {<NEW_LINE>write(LF, writer, out);<NEW_LINE>write(TAB, writer, out);<NEW_LINE>}<NEW_LINE>write(XMLFieldsConstants.FIELD_TAG_START_ELT, writer, out);<NEW_LINE>writeAttr(XMLFieldsConstants.NAME_ATTR, field.getFieldName(), formatAsJavaString, writer, out);<NEW_LINE>writeAttr(XMLFieldsConstants.LIST_ATTR, field.isListType(), formatAsJavaString, writer, out);<NEW_LINE>writeAttr(XMLFieldsConstants.IMAGE_NAME_ATTR, field.getImageName(), formatAsJavaString, writer, out);<NEW_LINE>writeAttr(XMLFieldsConstants.SYNTAX_KIND_ATTR, field.getSyntaxKind(), formatAsJavaString, writer, out);<NEW_LINE>write(">", writer, out);<NEW_LINE>if (indent) {<NEW_LINE><MASK><NEW_LINE>write(TAB, writer, out);<NEW_LINE>write(TAB, writer, out);<NEW_LINE>}<NEW_LINE>// Description<NEW_LINE>write(XMLFieldsConstants.DESCRIPTION_START_ELT, writer, out);<NEW_LINE>write(XMLFieldsConstants.START_CDATA, writer, out);<NEW_LINE>if (field.getDescription() != null) {<NEW_LINE>write(field.getDescription(), writer, out);<NEW_LINE>}<NEW_LINE>write(XMLFieldsConstants.END_CDATA, writer, out);<NEW_LINE>write(XMLFieldsConstants.DESCRIPTION_END_ELT, writer, out);<NEW_LINE>if (indent) {<NEW_LINE>write(LF, writer, out);<NEW_LINE>write(TAB, writer, out);<NEW_LINE>}<NEW_LINE>write(XMLFieldsConstants.FIELD_END_ELT, writer, out);<NEW_LINE>}
write(LF, writer, out);
116,408
protected void onElasticsearchFirstAvailable(ElasticsearchClient elasticsearchClient) {<NEW_LINE>if (corePlugin.isInitializeElasticsearch()) {<NEW_LINE>if (elasticsearchClient.isElasticsearch6Compatible() || elasticsearchClient.isElasticsearch7Compatible()) {<NEW_LINE>logger.debug("creating KibanaIndexAndMapping for ES 6/7...");<NEW_LINE>elasticsearchClient.createIndexAndSendMapping(".kibana", "doc", IOUtils.getResourceAsStream(elasticsearchClient.getKibanaResourcePath() + "kibana-index-doc.json"));<NEW_LINE>logger.debug("created KibanaIndexAndMapping for ES 6/7");<NEW_LINE>} else {<NEW_LINE>logger.debug("creating KibanaIndexAndMapping for ES 5...");<NEW_LINE>createKibana5IndexAndMappings(elasticsearchClient);<NEW_LINE>sendConfigurationMapping(elasticsearchClient);<NEW_LINE>logger.debug("created KibanaIndexAndMapping for ES 5");<NEW_LINE>}<NEW_LINE>manageMetricsIndex(elasticsearchClient, corePlugin);<NEW_LINE>}<NEW_LINE>elasticsearchClient.scheduleIndexManagement(ElasticsearchReporter.STAGEMONITOR_METRICS_INDEX_PREFIX, corePlugin.getMoveToColdNodesAfterDays(), corePlugin.getDeleteElasticsearchMetricsAfterDays());<NEW_LINE>reportToElasticsearch(corePlugin.getMetricRegistry(), corePlugin.getElasticsearchReportingInterval(<MASK><NEW_LINE>}
), corePlugin.getMeasurementSession());
974,330
public Object importPermission(Object bean, Map<String, Object> values) {<NEW_LINE>assert bean instanceof Permission;<NEW_LINE>try {<NEW_LINE>GroupRepository groupRepository = Beans.get(GroupRepository.class);<NEW_LINE>Permission permission = (Permission) bean;<NEW_LINE>String groups = (String) values.get("group");<NEW_LINE>if (permission.getId() != null) {<NEW_LINE>if (groups != null && !groups.isEmpty()) {<NEW_LINE>for (Group group : groupRepository.all().filter("code in ?1", Arrays.asList(groups.split("\\|"))).fetch()) {<NEW_LINE>Set<Permission<MASK><NEW_LINE>if (permissions == null)<NEW_LINE>permissions = new HashSet<Permission>();<NEW_LINE>permissions.add(permissionRepo.find(permission.getId()));<NEW_LINE>group.setPermissions(permissions);<NEW_LINE>groupRepository.save(group);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return permission;<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return bean;<NEW_LINE>}
> permissions = group.getPermissions();
1,647,603
public void actionPerformed(ActionEvent evt, JTextComponent target) {<NEW_LINE>if (target != null) {<NEW_LINE>if (!target.isEditable() || !target.isEnabled()) {<NEW_LINE>target.getToolkit().beep();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BaseDocument doc = (BaseDocument) target.getDocument();<NEW_LINE>// NOI18N<NEW_LINE>StringBuffer sb = new StringBuffer("System.out.println(\"");<NEW_LINE>String title = (String) doc.getProperty(Document.TitleProperty);<NEW_LINE>if (title != null) {<NEW_LINE>sb.append(title);<NEW_LINE>sb.append(':');<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>sb.append(Utilities.getLineOffset(doc, target.getCaret().getDot()) + 1);<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>}<NEW_LINE>sb.append(' ');<NEW_LINE>BaseKit kit = Utilities.getKit(target);<NEW_LINE>if (kit == null)<NEW_LINE>return;<NEW_LINE>Action a = kit.getActionByName(BaseKit.insertContentAction);<NEW_LINE>if (a != null) {<NEW_LINE>Utilities.performAction(a, new ActionEvent(target, ActionEvent.ACTION_PERFORMED, sb<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.toString()), target);
787,099
private void registerAndConnectAsHelixParticipant() {<NEW_LINE>// Registers customized Master-Slave state model to state machine engine, which is for calculating participant<NEW_LINE>// assignment in lead controller resource.<NEW_LINE>_helixParticipantManager.getStateMachineEngine().registerStateModelFactory(MasterSlaveSMD.name, new LeadControllerResourceMasterSlaveStateModelFactory(_leadControllerManager));<NEW_LINE>// Connects to cluster.<NEW_LINE>try {<NEW_LINE>_helixParticipantManager.connect();<NEW_LINE>} catch (Exception e) {<NEW_LINE>String errorMsg = String.format("Exception when connecting the instance %s as Participant role to Helix.", _helixParticipantInstanceId);<NEW_LINE>LOGGER.error(errorMsg, e);<NEW_LINE>throw new RuntimeException(errorMsg);<NEW_LINE>}<NEW_LINE>updateInstanceConfigIfNeeded();<NEW_LINE>LOGGER.info("Registering helix controller listener");<NEW_LINE>// This registration is not needed when the leadControllerResource is enabled.<NEW_LINE>// However, the resource can be disabled sometime while the cluster is in operation, so we keep it here. Plus, it<NEW_LINE>// does not add much overhead.<NEW_LINE>// At some point in future when we stop supporting the disabled resource, we will remove this line altogether and<NEW_LINE>// the logic that goes with it.<NEW_LINE>_helixParticipantManager.addControllerListener((ControllerChangeListener) changeContext -> _leadControllerManager.onHelixControllerChange());<NEW_LINE>LOGGER.info("Registering resource config listener");<NEW_LINE>try {<NEW_LINE>_helixParticipantManager.addResourceConfigChangeListener((resourceConfigList, changeContext) -> _leadControllerManager.onResourceConfigChange());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Error registering resource config listener for " + <MASK><NEW_LINE>}<NEW_LINE>}
CommonConstants.Helix.LEAD_CONTROLLER_RESOURCE_NAME, e);
630,409
public static BlockStateData parse(Material material, String state) throws InvalidBlockStateException {<NEW_LINE>if (state == null || state.trim().isEmpty() || state.trim().equals("*")) {<NEW_LINE>return new BlockStateData();<NEW_LINE>}<NEW_LINE>BlockStateReader reader = getReader(material);<NEW_LINE>if (material == null || reader == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>BlockStateData data = new BlockStateData();<NEW_LINE>String[] split = state.trim().split(",");<NEW_LINE>for (String section : split) {<NEW_LINE>if (!section.contains("=") || section.indexOf('=') != section.lastIndexOf('=')) {<NEW_LINE>throw new InvalidBlockStateException(material, state);<NEW_LINE>}<NEW_LINE>String[] keyVal = section.split("=");<NEW_LINE>if (keyVal.length < 2) {<NEW_LINE>throw new InvalidBlockStateException(material, state);<NEW_LINE>}<NEW_LINE>keyVal[0] = keyVal[0].trim().toLowerCase();<NEW_LINE>keyVal[1] = keyVal[1].trim().toLowerCase();<NEW_LINE>if (keyVal[0].isEmpty() || keyVal[1].isEmpty()) {<NEW_LINE>throw new InvalidBlockStateException(material, state);<NEW_LINE>}<NEW_LINE>if (!reader.getValidStates().contains(keyVal[0])) {<NEW_LINE>throw new InvalidBlockStateException(material, state);<NEW_LINE>}<NEW_LINE>data.put(keyVal[0], keyVal[1]);<NEW_LINE>}<NEW_LINE>return data;<NEW_LINE>}
throw new InvalidBlockStateException(material, state);
393,557
private void logCacheStatistics() {<NEW_LINE>logger.info("* Constraint Cache Statistics");<NEW_LINE>final int numberOfSATs = SolverCache.getInstance().getNumberOfSATs();<NEW_LINE>final int numberOfUNSATs = SolverCache.getInstance().getNumberOfUNSATs();<NEW_LINE>if (numberOfSATs == 0 || numberOfUNSATs == 0) {<NEW_LINE>logger.info(" - Constraint Cache was not used.");<NEW_LINE>} else {<NEW_LINE>logger.info(String<MASK><NEW_LINE>logger.info(String.format(" - Stored UNSAT constraints: %s", numberOfUNSATs));<NEW_LINE>NumberFormat percentFormat = NumberFormat.getPercentInstance();<NEW_LINE>percentFormat.setMaximumFractionDigits(1);<NEW_LINE>String hit_rate_str = percentFormat.format(SolverCache.getInstance().getHitRate());<NEW_LINE>logger.info(String.format(" - Cache hit rate: %s", hit_rate_str));<NEW_LINE>}<NEW_LINE>}
.format(" - Stored SAT constraints: %s", numberOfSATs));
1,580,667
private static void writeContentUriTriggerToBundle(Bundle data, ContentUriTrigger uriTrigger) {<NEW_LINE>data.putInt(BundleProtocol.PACKED_PARAM_TRIGGER_TYPE, BundleProtocol.TRIGGER_TYPE_CONTENT_URI);<NEW_LINE>int size = uriTrigger.getUris().size();<NEW_LINE>int[] flagsArray = new int[size];<NEW_LINE>Uri[<MASK><NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>ObservedUri uri = uriTrigger.getUris().get(i);<NEW_LINE>flagsArray[i] = uri.getFlags();<NEW_LINE>uriArray[i] = uri.getUri();<NEW_LINE>}<NEW_LINE>data.putIntArray(BundleProtocol.PACKED_PARAM_CONTENT_URI_FLAGS_ARRAY, flagsArray);<NEW_LINE>data.putParcelableArray(BundleProtocol.PACKED_PARAM_CONTENT_URI_ARRAY, uriArray);<NEW_LINE>}
] uriArray = new Uri[size];
1,048,951
private void onMatchLogicalView(RelOptRuleCall call) {<NEW_LINE>final LogicalSemiJoin join = call.rel(0);<NEW_LINE>RelNode left = call.rel(1);<NEW_LINE>final LogicalView logicalView = call.rel(2);<NEW_LINE>RexNode newCondition = JoinConditionSimplifyRule.simplifyCondition(join.getCondition(), join.getCluster().getRexBuilder());<NEW_LINE>RexUtils.RestrictType restrictType = RexUtils.RestrictType.RIGHT;<NEW_LINE>if (!RexUtils.isBatchKeysAccessCondition(join, newCondition, join.getLeft().getRowType().getFieldCount(), restrictType, (Pair<RelDataType, RelDataType> relDataTypePair) -> CBOUtil.bkaTypeCheck(relDataTypePair))) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!canBKAJoin(join)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final RelTraitSet leftTraitSet;<NEW_LINE>final RelTraitSet rightTraitSet;<NEW_LINE>if (RelOptUtil.NO_COLLATION_AND_DISTRIBUTION.test(join)) {<NEW_LINE>leftTraitSet = join.getCluster().getPlanner().emptyTraitSet().replace(DrdsConvention.INSTANCE);<NEW_LINE>rightTraitSet = join.getCluster().getPlanner().emptyTraitSet().replace(DrdsConvention.INSTANCE);<NEW_LINE>} else {<NEW_LINE>leftTraitSet = join.getLeft().getTraitSet().replace(DrdsConvention.INSTANCE);<NEW_LINE>rightTraitSet = join.getRight().getTraitSet(<MASK><NEW_LINE>}<NEW_LINE>left = convert(left, leftTraitSet);<NEW_LINE>LogicalView right = logicalView.copy(rightTraitSet);<NEW_LINE>SemiBKAJoin bkaJoin = SemiBKAJoin.create(join.getTraitSet().replace(DrdsConvention.INSTANCE), left, right, newCondition, join.getVariablesSet(), join.getJoinType(), join.isSemiJoinDone(), ImmutableList.copyOf(join.getSystemFieldList()), join.getHints(), join);<NEW_LINE>RelOptCost fixedCost = CheckJoinHint.check(join, HintType.CMD_SEMI_BKA_JOIN);<NEW_LINE>if (fixedCost != null) {<NEW_LINE>bkaJoin.setFixedCost(fixedCost);<NEW_LINE>}<NEW_LINE>right.setIsMGetEnabled(true);<NEW_LINE>right.setJoin(bkaJoin);<NEW_LINE>RelUtils.changeRowType(bkaJoin, join.getRowType());<NEW_LINE>call.transformTo(bkaJoin);<NEW_LINE>}
).replace(DrdsConvention.INSTANCE);
1,329,642
public void show(Color initialColor, JComponent component, Point offset, Balloon.Position position, ColorListener colorListener, Runnable onCancel, Runnable onOk) {<NEW_LINE>if (popup != null) {<NEW_LINE>popup.close();<NEW_LINE>}<NEW_LINE>popup = // TODO(jacobr): we would like to add the saturation and brightness<NEW_LINE>new ColorPickerBuilder().setOriginalColor(initialColor).// component but for some reason it throws exceptions even though there<NEW_LINE>// are examples of it being used identically without throwing exceptions<NEW_LINE>// elsewhere in the IntelliJ code base.<NEW_LINE>// .addSaturationBrightnessComponent()<NEW_LINE>addColorAdjustPanel(new MaterialGraphicalColorPipetteProvider()).addColorValuePanel().withFocus().addOperationPanel((okColor) -> {<NEW_LINE>onOk.run();<NEW_LINE>return Unit.INSTANCE;<NEW_LINE>}, (cancelColor) -> {<NEW_LINE>onCancel.run();<NEW_LINE>return Unit.INSTANCE;<NEW_LINE>}).withFocus().setFocusCycleRoot(true).focusWhenDisplay(true).addKeyAction(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), new AbstractAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>onCancel.run();<NEW_LINE>}<NEW_LINE>}).addKeyAction(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), new AbstractAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>onOk.run();<NEW_LINE>}<NEW_LINE>}).addColorListener(colorListener::colorChanged, true).build();<NEW_LINE>popup.<MASK><NEW_LINE>}
show(component, offset, position);
472,115
protected void readElementEvaluations(JRVirtualizable<VirtualElementsData> object) {<NEW_LINE>// ugly but needed for now<NEW_LINE>JRVirtualPrintPage page = ((VirtualizablePageElements) object).getPage();<NEW_LINE>FillPageKey pageKey = new FillPageKey(page);<NEW_LINE>for (Map.Entry<JREvaluationTime, LinkedHashMap<FillPageKey, LinkedMap<Object, EvaluationBoundAction>>> boundMapEntry : actionsMap.entrySet()) {<NEW_LINE>JREvaluationTime evaluationTime = boundMapEntry.getKey();<NEW_LINE>LinkedHashMap<FillPageKey, LinkedMap<Object, EvaluationBoundAction><MASK><NEW_LINE>synchronized (map) {<NEW_LINE>LinkedMap<Object, EvaluationBoundAction> actionsMap = map.get(pageKey);<NEW_LINE>readElementEvaluations(object, id, evaluationTime, actionsMap);<NEW_LINE>if (transferredIds != null) {<NEW_LINE>// FIXMEBOOK does this have any effect on the order of the actions?<NEW_LINE>for (Integer transferredId : transferredIds) {<NEW_LINE>readElementEvaluations(object, transferredId, evaluationTime, actionsMap);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
> map = boundMapEntry.getValue();
1,489,212
public void drawFrame(TextGraphics graphics, TerminalSize realSize, TerminalSize virtualSize, TerminalPosition virtualScrollPosition) {<NEW_LINE>if (realSize.getColumns() == 1 || realSize.getRows() <= 2) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TerminalSize viewportSize = getViewportSize(realSize, virtualSize);<NEW_LINE>graphics.setForegroundColor(TextColor.ANSI.WHITE);<NEW_LINE>graphics.setBackgroundColor(TextColor.ANSI.BLACK);<NEW_LINE>graphics.fill(' ');<NEW_LINE>graphics.putString(0, graphics.getSize().getRows() - 1, "Terminal too small, use ALT+arrows to scroll");<NEW_LINE>int horizontalSize = (int) (((double) (viewportSize.getColumns()) / (double) virtualSize.getColumns()) * (viewportSize.getColumns()));<NEW_LINE>int scrollable = viewportSize.getColumns() - horizontalSize - 1;<NEW_LINE>int horizontalPosition = (int) ((double) scrollable * ((double) virtualScrollPosition.getColumn() / (double) (virtualSize.getColumns() - <MASK><NEW_LINE>graphics.drawLine(new TerminalPosition(horizontalPosition, graphics.getSize().getRows() - 2), new TerminalPosition(horizontalPosition + horizontalSize, graphics.getSize().getRows() - 2), Symbols.BLOCK_MIDDLE);<NEW_LINE>int verticalSize = (int) (((double) (viewportSize.getRows()) / (double) virtualSize.getRows()) * (viewportSize.getRows()));<NEW_LINE>scrollable = viewportSize.getRows() - verticalSize - 1;<NEW_LINE>int verticalPosition = (int) ((double) scrollable * ((double) virtualScrollPosition.getRow() / (double) (virtualSize.getRows() - viewportSize.getRows())));<NEW_LINE>graphics.drawLine(new TerminalPosition(graphics.getSize().getColumns() - 1, verticalPosition), new TerminalPosition(graphics.getSize().getColumns() - 1, verticalPosition + verticalSize), Symbols.BLOCK_MIDDLE);<NEW_LINE>}
viewportSize.getColumns())));
373,479
private static void insertNativeEdges(final List<? extends ICodeEdge<?>> nativeEdges, final List<ReilBlock> nodes, final List<ReilEdge> edges, final Map<IInstruction, ReilInstruction> firstMap, final Map<IInstruction, ReilInstruction> lastMap) {<NEW_LINE>for (final ICodeEdge<?> nativeEdge : nativeEdges) {<NEW_LINE>final Object source = nativeEdge.getSource();<NEW_LINE>final Object target = nativeEdge.getTarget();<NEW_LINE>if ((source instanceof ICodeContainer) && (target instanceof ICodeContainer)) {<NEW_LINE>final ICodeContainer<?> sourceCodeNode = (ICodeContainer<?>) source;<NEW_LINE>final ICodeContainer<?> targetCodeNode = (ICodeContainer<?>) target;<NEW_LINE><MASK><NEW_LINE>final IInstruction targetInstruction = getFirstInstruction(targetCodeNode);<NEW_LINE>final ReilInstruction sourceReilInstruction = lastMap.get(sourceInstruction);<NEW_LINE>final ReilInstruction targetReilInstruction = firstMap.get(targetInstruction);<NEW_LINE>insertNativeEdge(nodes, edges, nativeEdge, sourceReilInstruction, targetReilInstruction);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
final IInstruction sourceInstruction = getLastInstruction(sourceCodeNode);
1,277,204
final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoTSiteWise");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "api.";<NEW_LINE>String resolvedHostPrefix = String.format("api.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
312,172
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)<NEW_LINE>public Response logoutConfirmAction() {<NEW_LINE>MultivaluedMap<String, String> formData = request.getDecodedFormParameters();<NEW_LINE>event.event(EventType.LOGOUT);<NEW_LINE>String code = formData.getFirst(SESSION_CODE);<NEW_LINE>String clientId = session.getContext().getUri().getQueryParameters().getFirst(Constants.CLIENT_ID);<NEW_LINE>String tabId = session.getContext().getUri().getQueryParameters().getFirst(Constants.TAB_ID);<NEW_LINE>logger.tracef("Logout confirmed. sessionCode=%s, clientId=%s, tabId=%s", code, clientId, tabId);<NEW_LINE>SessionCodeChecks checks = new LogoutSessionCodeChecks(realm, session.getContext().getUri(), request, clientConnection, session, <MASK><NEW_LINE>checks.initialVerify();<NEW_LINE>if (!checks.verifyActiveAndValidAction(AuthenticationSessionModel.Action.LOGGING_OUT.name(), ClientSessionCode.ActionType.USER) || !formData.containsKey("confirmLogout")) {<NEW_LINE>AuthenticationSessionModel logoutSession = checks.getAuthenticationSession();<NEW_LINE>logger.debugf("Failed verification during logout. logoutSessionId=%s, clientId=%s, tabId=%s", logoutSession != null ? logoutSession.getParentSession().getId() : "unknown", clientId, tabId);<NEW_LINE>if (logoutSession == null || logoutSession.getClient().equals(SystemClientUtil.getSystemClient(logoutSession.getRealm()))) {<NEW_LINE>// Cleanup system client URL to avoid links to account management<NEW_LINE>session.getProvider(LoginFormsProvider.class).setAttribute(Constants.SKIP_LINK, true);<NEW_LINE>}<NEW_LINE>return ErrorPage.error(session, logoutSession, Response.Status.BAD_REQUEST, Messages.FAILED_LOGOUT);<NEW_LINE>}<NEW_LINE>AuthenticationSessionModel logoutSession = checks.getAuthenticationSession();<NEW_LINE>logger.tracef("Logout code successfully verified. Logout Session is '%s'. Client ID is '%s'.", logoutSession.getParentSession().getId(), logoutSession.getClient().getClientId());<NEW_LINE>return doBrowserLogout(logoutSession);<NEW_LINE>}
event, code, clientId, tabId);
1,194,327
private static String accessToString(int access) {<NEW_LINE>char[] accessChars = new char[9];<NEW_LINE>accessChars[0] = ((access & USR_R) == 0) ? '-' : 'r';<NEW_LINE>accessChars[1] = ((access & USR_W) == 0) ? '-' : 'w';<NEW_LINE>accessChars[2] = ((access & USR_X) == 0) ? '-' : 'x';<NEW_LINE>accessChars[3] = ((access & GRP_R) == 0) ? '-' : 'r';<NEW_LINE>accessChars[4] = ((access & GRP_W<MASK><NEW_LINE>accessChars[5] = ((access & GRP_X) == 0) ? '-' : 'x';<NEW_LINE>accessChars[6] = ((access & ALL_R) == 0) ? '-' : 'r';<NEW_LINE>accessChars[7] = ((access & ALL_W) == 0) ? '-' : 'w';<NEW_LINE>accessChars[8] = ((access & ALL_X) == 0) ? '-' : 'x';<NEW_LINE>return new String(accessChars);<NEW_LINE>}
) == 0) ? '-' : 'w';
215,258
public GetRequestValidatorsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetRequestValidatorsResult getRequestValidatorsResult = new GetRequestValidatorsResult();<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 getRequestValidatorsResult;<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("position", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getRequestValidatorsResult.setPosition(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("item", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getRequestValidatorsResult.setItems(new ListUnmarshaller<RequestValidator>(RequestValidatorJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getRequestValidatorsResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
972,956
private void selectFiles() {<NEW_LINE>CompactionHelper localHelper;<NEW_LINE>synchronized (this) {<NEW_LINE>if (!closed && fileMgr.beginSelection()) {<NEW_LINE>localHelper = this.chelper;<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>var allFiles = tablet.getDatafiles();<NEW_LINE>Set<StoredTabletFile> selectingFiles = localHelper.selectFiles(allFiles);<NEW_LINE>if (selectingFiles.isEmpty()) {<NEW_LINE>synchronized (this) {<NEW_LINE>fileMgr.cancelSelection();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>var allSelected = allFiles.keySet().equals(Sets.union(selectingFiles<MASK><NEW_LINE>synchronized (this) {<NEW_LINE>fileMgr.finishSelection(selectingFiles, allSelected);<NEW_LINE>}<NEW_LINE>manager.compactableChanged(this);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Failed to select user compaction files {}", getExtent(), e);<NEW_LINE>} finally {<NEW_LINE>synchronized (this) {<NEW_LINE>if (fileMgr.getSelectionStatus() == FileSelectionStatus.SELECTING) {<NEW_LINE>fileMgr.cancelSelection();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, localHelper.getFilesToDrop()));
1,271,006
private RulesLoader initRuleLoaderMinio(MinioConfig minioConfig) {<NEW_LINE>RulesLoader rulesLoader = null;<NEW_LINE>MinioClient minioClient = MinioClient.builder().endpoint(minioConfig.getEndpoint()).credentials(minioConfig.getAccessKey(), minioConfig.getSecretKey()).build();<NEW_LINE>try {<NEW_LINE>boolean bucketExists = minioClient.bucketExists(BucketExistsArgs.builder().bucket(minioConfig.getBucket()).build());<NEW_LINE>if (bucketExists) {<NEW_LINE>try {<NEW_LINE>minioClient.statObject(StatObjectArgs.builder().bucket(minioConfig.getBucket()).object(minioConfig.getFile()).build());<NEW_LINE>rulesLoader = new MinioRulesLoader(minioConfig);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>log.error(String.format("minio bucket: %s object: %s, check fail", minioConfig.getBucket(), minioConfig<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>log.error(String.format("minio bucket: %s check fail", minioConfig.getBucket()), ex);<NEW_LINE>}<NEW_LINE>return rulesLoader;<NEW_LINE>}
.getFile()), ex);
975,801
public void updateStatisticOnRequest(int dataId) {<NEW_LINE>if (si != null) {<NEW_LINE>ConnectionPoolStats temp = ConnectionPoolMonitor.getConnectionPoolOB((si.getName()));<NEW_LINE>if (dataId == NUM_CREATES) {<NEW_LINE>numManagedConnectionsCreated.setCount(temp.getCreateCount());<NEW_LINE>}<NEW_LINE>if (dataId == NUM_DESTROYS) {<NEW_LINE>numManagedConnectionsDestroyed.setCount(temp.getDestroyCount());<NEW_LINE>}<NEW_LINE>if (dataId == NUM_MANAGED_CONNECTIONS) {<NEW_LINE>numManagedConnections.setCount(temp.getManagedConnectionCount());<NEW_LINE>}<NEW_LINE>if (dataId == NUM_CONNECTIONS) {<NEW_LINE>numConnectionHandles.setCount(temp.getConnectionHandleCount());<NEW_LINE>}<NEW_LINE>if (dataId == AVERAGE_WAIT) {<NEW_LINE>averageWait.set(((long) temp.getWaitTime()), (long) temp.getWaitTime(), (long) temp.getWaitTime(), 0, 0, 0, 0);<NEW_LINE>}<NEW_LINE>if (dataId == FREE_POOL_SIZE) {<NEW_LINE>freePoolSize.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
set(temp.getFreeConnectionCount());
582,516
public static void main(String[] args) throws IOException {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>System.out.println("Enter the dimention of the matrix: ");<NEW_LINE>int n = sc.nextInt();<NEW_LINE>int m = sc.nextInt();<NEW_LINE>int[][] grid = new int[n][m];<NEW_LINE>System.out.println("Enter values of the matrix which consists of 1 for fresh, 0 for no oranges, 2 for rotten oranges: ");<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>for (int j = 0; j < m; j++) {<NEW_LINE>grid[i][j] = sc.nextInt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BFS_RottenOranges1 obj = new BFS_RottenOranges1();<NEW_LINE>int <MASK><NEW_LINE>System.out.println("The time taken to rot all oranges is: ");<NEW_LINE>System.out.println(ans);<NEW_LINE>sc.close();<NEW_LINE>}
ans = obj.orangesRotting(grid);
945,978
public boolean configure(FeatureContext context) {<NEW_LINE>final boolean disabled = PropertiesHelper.isProperty(context.getConfiguration().getProperty(ServerProperties.WADL_FEATURE_DISABLE));<NEW_LINE>if (disabled) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!ReflectionHelper.isJaxbAvailable()) {<NEW_LINE>LOGGER.<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!ReflectionHelper.isXmlTransformAvailable()) {<NEW_LINE>LOGGER.warning(LocalizationMessages.WADL_FEATURE_DISABLED_NOTRANSFORM());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!WadlApplicationContextImpl.isJaxbImplAvailable()) {<NEW_LINE>LOGGER.warning(LocalizationMessages.WADL_FEATURE_DISABLED());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>context.register(WadlModelProcessor.class);<NEW_LINE>context.register(new AbstractBinder() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void configure() {<NEW_LINE>bind(WadlApplicationContextImpl.class).to(WadlApplicationContext.class).in(Singleton.class);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>}
warning(LocalizationMessages.WADL_FEATURE_DISABLED_NOJAXB());
591,620
public static void broadcastEvent(final String name, final String data, final boolean authenticated, final boolean anonymous) {<NEW_LINE>if (anonymous == true && authenticated == true) {<NEW_LINE>broadcastEvent(name, data);<NEW_LINE>} else if (anonymous == true) {<NEW_LINE>// account for multiple open tabs/connections for one sessionIds and save result<NEW_LINE>final Map<String, Boolean> checkedSessionIds = new HashMap<>();<NEW_LINE>for (StructrEventSource es : eventSources) {<NEW_LINE>final String sessionId = es.getSessionId();<NEW_LINE>final Boolean shouldReceive = checkedSessionIds.get(sessionId);<NEW_LINE>if (shouldReceive == null) {<NEW_LINE>final Principal user = AuthHelper.getPrincipalForSessionId(sessionId);<NEW_LINE>if (user == null) {<NEW_LINE>checkedSessionIds.put(sessionId, true);<NEW_LINE>es.sendEvent(name, data);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else if (shouldReceive == true) {<NEW_LINE>es.sendEvent(name, data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (authenticated == true) {<NEW_LINE>// account for multiple open tabs/connections for one sessionIds and save result<NEW_LINE>final Map<String, Boolean> checkedSessionIds = new HashMap<>();<NEW_LINE>for (StructrEventSource es : eventSources) {<NEW_LINE>final String sessionId = es.getSessionId();<NEW_LINE>final Boolean shouldReceive = checkedSessionIds.get(sessionId);<NEW_LINE>if (shouldReceive == null) {<NEW_LINE>final Principal user = AuthHelper.getPrincipalForSessionId(sessionId);<NEW_LINE>if (user != null) {<NEW_LINE>checkedSessionIds.put(sessionId, true);<NEW_LINE>es.sendEvent(name, data);<NEW_LINE>} else {<NEW_LINE>checkedSessionIds.put(sessionId, false);<NEW_LINE>}<NEW_LINE>} else if (shouldReceive == true) {<NEW_LINE>es.sendEvent(name, data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
checkedSessionIds.put(sessionId, false);
1,760,215
public static ListMetastoreMigrationsResponse unmarshall(ListMetastoreMigrationsResponse listMetastoreMigrationsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listMetastoreMigrationsResponse.setRequestId(_ctx.stringValue("ListMetastoreMigrationsResponse.RequestId"));<NEW_LINE>listMetastoreMigrationsResponse.setSuccess(_ctx.booleanValue("ListMetastoreMigrationsResponse.Success"));<NEW_LINE>listMetastoreMigrationsResponse.setTotalCount(_ctx.integerValue("ListMetastoreMigrationsResponse.TotalCount"));<NEW_LINE>List<MigrationInstances> data = new ArrayList<MigrationInstances>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListMetastoreMigrationsResponse.Data.Length"); i++) {<NEW_LINE>MigrationInstances migrationInstances = new MigrationInstances();<NEW_LINE>migrationInstances.setInstanceId(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].InstanceId"));<NEW_LINE>migrationInstances.setName(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].Name"));<NEW_LINE>migrationInstances.setDesc(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].Desc"));<NEW_LINE>migrationInstances.setMetastoreType(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].MetastoreType"));<NEW_LINE>migrationInstances.setMetastoreInfo(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].MetastoreInfo"));<NEW_LINE>migrationInstances.setRunOptions(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].RunOptions"));<NEW_LINE>migrationInstances.setRoleName(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].RoleName"));<NEW_LINE>migrationInstances.setStatus(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].Status"));<NEW_LINE>migrationInstances.setGmtCreate(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].GmtCreate"));<NEW_LINE>migrationInstances.setGmtModified(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].GmtModified"));<NEW_LINE>WorkflowLastRunInstance workflowLastRunInstance = new WorkflowLastRunInstance();<NEW_LINE>workflowLastRunInstance.setFlowInstanceId(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.FlowInstanceId"));<NEW_LINE>workflowLastRunInstance.setFlowId(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.FlowId"));<NEW_LINE>workflowLastRunInstance.setFlowName(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.FlowName"));<NEW_LINE>workflowLastRunInstance.setDuration(_ctx.longValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.Duration"));<NEW_LINE>workflowLastRunInstance.setStartTime(_ctx.longValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.StartTime"));<NEW_LINE>workflowLastRunInstance.setEndTime(_ctx.longValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.EndTime"));<NEW_LINE>workflowLastRunInstance.setStatus(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.Status"));<NEW_LINE>workflowLastRunInstance.setProjectId(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.ProjectId"));<NEW_LINE>workflowLastRunInstance.setClusterId(_ctx.stringValue<MASK><NEW_LINE>workflowLastRunInstance.setFailureInfo(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.FailureInfo"));<NEW_LINE>workflowLastRunInstance.setFlowExtendResult(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.FlowExtendResult"));<NEW_LINE>workflowLastRunInstance.setTotalCuUsage(_ctx.floatValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.TotalCuUsage"));<NEW_LINE>workflowLastRunInstance.setOpsUrl(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.OpsUrl"));<NEW_LINE>workflowLastRunInstance.setOffsetTime(_ctx.integerValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.OffsetTime"));<NEW_LINE>workflowLastRunInstance.setBatchProgress(_ctx.integerValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.BatchProgress"));<NEW_LINE>workflowLastRunInstance.setExecuteMode(_ctx.stringValue("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.ExecuteMode"));<NEW_LINE>migrationInstances.setWorkflowLastRunInstance(workflowLastRunInstance);<NEW_LINE>data.add(migrationInstances);<NEW_LINE>}<NEW_LINE>listMetastoreMigrationsResponse.setData(data);<NEW_LINE>return listMetastoreMigrationsResponse;<NEW_LINE>}
("ListMetastoreMigrationsResponse.Data[" + i + "].WorkflowLastRunInstance.ClusterId"));
1,389,861
public void deleteMessagesId(Integer id) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'id' is set<NEW_LINE>if (id == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'id' when calling deleteMessagesId");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/messages/{id}".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>}
HashMap<String, String>();
1,204,053
public Object apply(final ActionContext ctx, final Object caller, final Object[] sources) throws FrameworkException {<NEW_LINE>try {<NEW_LINE>assertArrayHasMinLengthAndAllElementsNotNull(sources, 2);<NEW_LINE>try {<NEW_LINE>if (!(sources[0] instanceof File)) {<NEW_LINE>logParameterError(caller, sources, "First parameter is not a file object.", ctx.isJavaScriptContext());<NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>if (!(sources[1] instanceof String)) {<NEW_LINE>logParameterError(caller, sources, "Second parameter is not a string.", ctx.isJavaScriptContext());<NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>final File pdfFileObject = (File) sources[0];<NEW_LINE>final String userPassword = (String) sources[1];<NEW_LINE>final java.io.File fileOnDisk = pdfFileObject.getFileOnDisk();<NEW_LINE>final PDDocument pdDocument = PDDocument.load(fileOnDisk);<NEW_LINE><MASK><NEW_LINE>accessPermission.setCanPrint(false);<NEW_LINE>// Owner password (to open the file with all permissions) is the superuser password<NEW_LINE>final StandardProtectionPolicy standardProtectionPolicy = new StandardProtectionPolicy(Settings.SuperUserPassword.getValue(), userPassword, accessPermission);<NEW_LINE>standardProtectionPolicy.setEncryptionKeyLength(keyLength);<NEW_LINE>standardProtectionPolicy.setPermissions(accessPermission);<NEW_LINE>pdDocument.protect(standardProtectionPolicy);<NEW_LINE>if (fileOnDisk.delete()) {<NEW_LINE>pdDocument.save(fileOnDisk);<NEW_LINE>}<NEW_LINE>pdDocument.close();<NEW_LINE>} catch (final IOException ioex) {<NEW_LINE>logException(caller, ioex, sources);<NEW_LINE>}<NEW_LINE>} catch (final ArgumentNullException pe) {<NEW_LINE>logParameterError(caller, sources, pe.getMessage(), ctx.isJavaScriptContext());<NEW_LINE>} catch (final ArgumentCountException pe) {<NEW_LINE>logParameterError(caller, sources, pe.getMessage(), ctx.isJavaScriptContext());<NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}
final AccessPermission accessPermission = new AccessPermission();
650,397
public void iteration() {<NEW_LINE>if (this.actualThreadCount == 0) {<NEW_LINE>preIteration();<NEW_LINE>}<NEW_LINE>if (getPopulation().getSpecies().size() == 0) {<NEW_LINE>throw new EncogError("Population is empty, there are no species.");<NEW_LINE>}<NEW_LINE>this.iteration++;<NEW_LINE>// Clear new population to just best genome.<NEW_LINE>this.newPopulation.clear();<NEW_LINE>this.newPopulation.add(this.bestGenome);<NEW_LINE>this.oldBestGenome = this.bestGenome;<NEW_LINE>// execute species in parallel<NEW_LINE>this.threadList.clear();<NEW_LINE>for (final Species species : getPopulation().getSpecies()) {<NEW_LINE>int numToSpawn = species.getOffspringCount();<NEW_LINE>// Add elite genomes directly<NEW_LINE>if (species.getMembers().size() > 5) {<NEW_LINE>final int idealEliteCount = (int) (species.getMembers().size() * getEliteRate());<NEW_LINE>final int eliteCount = Math.min(numToSpawn, idealEliteCount);<NEW_LINE>for (int i = 0; i < eliteCount; i++) {<NEW_LINE>final Genome eliteGenome = species.getMembers().get(i);<NEW_LINE>if (getOldBestGenome() != eliteGenome) {<NEW_LINE>numToSpawn--;<NEW_LINE>if (!addChild(eliteGenome)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now add one task for each offspring that each species is allowed<NEW_LINE>while (numToSpawn-- > 0) {<NEW_LINE>final EAWorker worker = new EAWorker(this, species);<NEW_LINE>this.threadList.add(worker);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// run all threads and wait for them to finish<NEW_LINE>try {<NEW_LINE>this.<MASK><NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>EncogLogging.log(e);<NEW_LINE>}<NEW_LINE>// handle any errors that might have happened in the threads<NEW_LINE>if (this.reportedError != null && !getShouldIgnoreExceptions()) {<NEW_LINE>throw new GeneticError(this.reportedError);<NEW_LINE>}<NEW_LINE>// validate, if requested<NEW_LINE>if (isValidationMode()) {<NEW_LINE>if (this.oldBestGenome != null && !this.newPopulation.contains(this.oldBestGenome)) {<NEW_LINE>throw new EncogError("The top genome died, this should never happen!!");<NEW_LINE>}<NEW_LINE>if (this.bestGenome != null && this.oldBestGenome != null && getBestComparator().isBetterThan(this.oldBestGenome, this.bestGenome)) {<NEW_LINE>throw new EncogError("The best genome's score got worse, this should never happen!! Went from " + this.oldBestGenome.getScore() + " to " + this.bestGenome.getScore());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.speciation.performSpeciation(this.newPopulation);<NEW_LINE>// purge invalid genomes<NEW_LINE>this.population.purgeInvalidGenomes();<NEW_LINE>}
taskExecutor.invokeAll(this.threadList);
1,216,097
public void go() throws Exception {<NEW_LINE>try {<NEW_LINE>buildFilterPattern();<NEW_LINE>refreshOrganizationsCache();<NEW_LINE>outerDcMeta = extractOuterDcMetaWithInterestedTypes(getDcMetaFromOutClient(currentDcId));<NEW_LINE>future = outerDcMeta.getKey();<NEW_LINE>current = extractLocalDcMetaWithInterestedTypes(metaCache.getXpipeMeta(<MASK><NEW_LINE>DcSyncMetaComparator dcMetaComparator = new DcSyncMetaComparator(current, future);<NEW_LINE>dcMetaComparator.compare();<NEW_LINE>new ClusterMetaSynchronizer(dcMetaComparator.getAdded(), dcMetaComparator.getRemoved(), dcMetaComparator.getMofified(), dcService, clusterService, shardService, redisService, organizationService, sentinelBalanceService, consoleConfig, clusterTypeUpdateEventFactory).sync();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>logger.error("[DcMetaSynchronizer][sync]", e);<NEW_LINE>}<NEW_LINE>}
), outerDcMeta.getValue());
1,706,039
private void sendRoleSharedPasswordAuthType() throws NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException, BadPaddingException, InvalidKeyException {<NEW_LINE>byte[] playerPasswordSalt = playerDatabase.getPlayerPasswordSalt(player.getName());<NEW_LINE>String[] password = new String[2];<NEW_LINE>password[GM_CHALLENGE] = <MASK><NEW_LINE>password[PLAYER_CHALLENGE] = new PasswordGenerator().getPassword();<NEW_LINE>handshakeChallenges[GM_CHALLENGE] = HandshakeChallenge.createChallenge(player.getName(), password[GM_CHALLENGE], playerDatabase.getRolePassword(Role.GM).get());<NEW_LINE>handshakeChallenges[PLAYER_CHALLENGE] = HandshakeChallenge.createChallenge(player.getName(), password[GM_CHALLENGE], playerDatabase.getRolePassword(Role.PLAYER).get());<NEW_LINE>var authTypeMsg = UseAuthTypeMsg.newBuilder().setAuthType(AuthTypeEnum.SHARED_PASSWORD).setSalt(ByteString.copyFrom(playerPasswordSalt)).addChallenge(ByteString.copyFrom(handshakeChallenges[GM_CHALLENGE].getChallenge())).addChallenge(ByteString.copyFrom(handshakeChallenges[PLAYER_CHALLENGE].getChallenge()));<NEW_LINE>var handshakeMsg = HandshakeMsg.newBuilder().setUseAuthTypeMsg(authTypeMsg).build();<NEW_LINE>sendMessage(handshakeMsg);<NEW_LINE>}
new PasswordGenerator().getPassword();
392,223
private void animatingZoomInThread(int zoomStart, double zoomFloatStart, int zoomEnd, double zoomFloatEnd, float animationTime, boolean notifyListener) {<NEW_LINE>try {<NEW_LINE>isAnimatingZoom = true;<NEW_LINE>// could be 0 ]-0.5,0.5], -1 ]-1,0], 1 ]0, 1]<NEW_LINE>int threshold = ((int) (zoomFloatEnd * 2));<NEW_LINE>double beginZoom = zoomStart + zoomFloatStart;<NEW_LINE>double endZoom = zoomEnd + zoomFloatEnd;<NEW_LINE>animationTime *= Math.abs(endZoom - beginZoom);<NEW_LINE>// AccelerateInterpolator interpolator = new AccelerateInterpolator(1);<NEW_LINE>LinearInterpolator interpolator = new LinearInterpolator();<NEW_LINE>long timeMillis = SystemClock.uptimeMillis();<NEW_LINE>float normalizedTime;<NEW_LINE>while (!stopped) {<NEW_LINE>normalizedTime = (SystemClock.uptimeMillis() - timeMillis) / animationTime;<NEW_LINE>if (normalizedTime > 1f) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>float interpolation = interpolator.getInterpolation(normalizedTime);<NEW_LINE>double curZoom = interpolation <MASK><NEW_LINE>int baseZoom = (int) Math.round(curZoom - 0.5 * threshold);<NEW_LINE>double zaAnimate = curZoom - baseZoom;<NEW_LINE>tileView.zoomToAnimate(baseZoom, zaAnimate, notifyListener);<NEW_LINE>try {<NEW_LINE>Thread.sleep(DEFAULT_SLEEP_TO_REDRAW);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>stopped = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tileView.setFractionalZoom(zoomEnd, zoomFloatEnd, notifyListener);<NEW_LINE>} finally {<NEW_LINE>isAnimatingZoom = false;<NEW_LINE>}<NEW_LINE>}
* (endZoom - beginZoom) + beginZoom;
87,846
public void testCopy() throws Exception {<NEW_LINE>CountDownLatch continueLatch = new CountDownLatch(1);<NEW_LINE>BlockableSupplier<Long> blocker = new BlockableSupplier<Long>(100l, null, continueLatch);<NEW_LINE>CompletableFuture<Long> cf0 = defaultManagedExecutor.supplyAsync(blocker);<NEW_LINE>if (!AT_LEAST_JAVA_9)<NEW_LINE>try {<NEW_LINE>fail("Should not be able to copy in Java SE 8. " + copy.apply(cf0));<NEW_LINE>} catch (UnsupportedOperationException x) {<NEW_LINE>// method unavailable for Java SE 8<NEW_LINE>return;<NEW_LINE>} finally {<NEW_LINE>continueLatch.countDown();<NEW_LINE>}<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>CompletableFuture<Long> cf1 = (CompletableFuture<Long>) copy.apply(cf0);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>CompletableFuture<Long> cf2 = (CompletableFuture<Long>) copy.apply(cf0);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>CompletableFuture<Long> cf3 = (CompletableFuture<Long<MASK><NEW_LINE>String s;<NEW_LINE>assertTrue(s = cf1.toString(), s.startsWith("ManagedCompletableFuture@"));<NEW_LINE>assertTrue(s = cf2.toString(), s.startsWith("ManagedCompletableFuture@"));<NEW_LINE>assertTrue(s = cf3.toString(), s.startsWith("ManagedCompletableFuture@"));<NEW_LINE>assertTrue(cf1.complete(200l));<NEW_LINE>assertTrue(cf2.completeExceptionally(new ArithmeticException("Intentional failure")));<NEW_LINE>assertFalse(cf0.isDone());<NEW_LINE>assertFalse(cf3.isDone());<NEW_LINE>continueLatch.countDown();<NEW_LINE>assertEquals(Long.valueOf(100), cf3.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertTrue(cf3.isDone());<NEW_LINE>assertFalse(cf3.isCompletedExceptionally());<NEW_LINE>assertEquals(Long.valueOf(200), cf1.getNow(-1l));<NEW_LINE>try {<NEW_LINE>Long result = cf2.getNow(-1l);<NEW_LINE>fail("Unexpected result for copied CompletableFuture: " + result);<NEW_LINE>} catch (CompletionException x) {<NEW_LINE>if (!(x.getCause() instanceof ArithmeticException))<NEW_LINE>throw x;<NEW_LINE>}<NEW_LINE>assertEquals(Long.valueOf(100), cf0.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertTrue(cf0.isDone());<NEW_LINE>assertFalse(cf0.isCompletedExceptionally());<NEW_LINE>}
>) copy.apply(cf0);
1,257,813
public void releasePodIp(Long id) throws CloudRuntimeException {<NEW_LINE>// Verify input parameters<NEW_LINE>DataCenterIpAddressVO ipVO = _privateIPAddressDao.findById(id);<NEW_LINE>if (ipVO == null) {<NEW_LINE>throw new CloudRuntimeException("Unable to find ip address by id:" + id);<NEW_LINE>}<NEW_LINE>if (ipVO.getTakenAt() == null) {<NEW_LINE>s_logger.debug("Ip Address with id= " + id + " is not allocated, so do nothing.");<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>// Verify permission<NEW_LINE>DataCenter zone = _entityMgr.findById(DataCenter.class, ipVO.getDataCenterId());<NEW_LINE>Account caller = CallContext.current().getCallingAccount();<NEW_LINE>if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(caller.getId())) {<NEW_LINE>throw new CloudRuntimeException(generateErrorMessageForOperationOnDisabledZone("release Pod IP", zone));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>_privateIPAddressDao.releasePodIpAddress(id);<NEW_LINE>} catch (Exception e) {<NEW_LINE>new CloudRuntimeException(e.getMessage());<NEW_LINE>}<NEW_LINE>}
CloudRuntimeException("Ip Address with id= " + id + " is not allocated, so do nothing.");
890,934
private void addDerivedTypes() {<NEW_LINE>Iterator<DefinedType> typeIter = schema.getTypes().iterator();<NEW_LINE>while (typeIter.hasNext()) {<NEW_LINE><MASK><NEW_LINE>// debug (type.getName()+":"+type.getDomain(true).toString());<NEW_LINE>// if ((type.getDomain() instanceof SimpleType)==false &&<NEW_LINE>// (type instanceof EnumerationType)==false &&<NEW_LINE>// (type instanceof SelectType)==false){<NEW_LINE>if (type.getName().equalsIgnoreCase("IfcCompoundPlaneAngleMeasure")) {<NEW_LINE>EClass testType = getOrCreateEClass(type.getName());<NEW_LINE>DefinedType type2 = new DefinedType("Integer");<NEW_LINE>type2.setDomain(new IntegerType());<NEW_LINE>modifySimpleType(type2, testType);<NEW_LINE>testType.getEAnnotations().add(createWrappedAnnotation());<NEW_LINE>} else if (type.getDomain() instanceof DefinedType) {<NEW_LINE>if (schemaPack.getEClassifier(type.getName()) != null) {<NEW_LINE>EClass testType = (EClass) schemaPack.getEClassifier(type.getName());<NEW_LINE>DefinedType domain = (DefinedType) type.getDomain();<NEW_LINE>EClassifier classifier = schemaPack.getEClassifier(domain.getName());<NEW_LINE>testType.getESuperTypes().add((EClass) classifier);<NEW_LINE>testType.setInstanceClass(classifier.getInstanceClass());<NEW_LINE>} else {<NEW_LINE>EClass testType = getOrCreateEClass(type.getName());<NEW_LINE>DefinedType domain = (DefinedType) type.getDomain();<NEW_LINE>if (simpleTypeReplacementMap.containsKey(domain.getName())) {<NEW_LINE>// We can't subclass because it's a 'primitive' type<NEW_LINE>simpleTypeReplacementMap.put(type.getName(), simpleTypeReplacementMap.get(domain.getName()));<NEW_LINE>} else {<NEW_LINE>EClass classifier = getOrCreateEClass(domain.getName());<NEW_LINE>testType.getESuperTypes().add((EClass) classifier);<NEW_LINE>if (classifier.getEAnnotation("wrapped") != null) {<NEW_LINE>testType.getEAnnotations().add(createWrappedAnnotation());<NEW_LINE>}<NEW_LINE>testType.setInstanceClass(classifier.getInstanceClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
DefinedType type = typeIter.next();
346,330
private void buildExtraJoins(STreeType desc, List<SqlTreeNode> myList) {<NEW_LINE>if (rawSql) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Set<String> predicateIncludes = predicates.getPredicateIncludes();<NEW_LINE>if (predicateIncludes == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Note includes - basically means joins.<NEW_LINE>// The selectIncludes is the set of joins that are required to support<NEW_LINE>// the 'select' part of the query. We may need to add other joins to<NEW_LINE>// support the predicates or order by clauses.<NEW_LINE>// remove ManyWhereJoins from the predicateIncludes<NEW_LINE>predicateIncludes.removeAll(manyWhereJoins.getPropertyNames());<NEW_LINE>predicateIncludes.<MASK><NEW_LINE>// look for predicateIncludes that are not in selectIncludes and add<NEW_LINE>// them as extra joins to the query<NEW_LINE>IncludesDistiller extraJoinDistill = new IncludesDistiller(desc, selectIncludes, predicateIncludes, manyWhereJoins, temporalMode);<NEW_LINE>Collection<SqlTreeNodeExtraJoin> extraJoins = extraJoinDistill.getExtraJoinRootNodes();<NEW_LINE>if (!extraJoins.isEmpty()) {<NEW_LINE>// add extra joins required to support predicates<NEW_LINE>// and/or order by clause<NEW_LINE>for (SqlTreeNodeExtraJoin extraJoin : extraJoins) {<NEW_LINE>myList.add(extraJoin);<NEW_LINE>if (extraJoin.isManyJoin()) {<NEW_LINE>// as we are now going to join to the many then we need<NEW_LINE>// to add the distinct to the sql query to stop duplicate<NEW_LINE>// rows...<NEW_LINE>sqlDistinct = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
addAll(predicates.getOrderByIncludes());
454,377
protected static ReportTemplateSource loadTemplate(Object source, JRBaseFiller filler, RepositoryContext repositoryContext) throws JRException {<NEW_LINE>Object cacheKey = source;<NEW_LINE>if (source instanceof String) {<NEW_LINE>cacheKey = ResourcePathKey.inContext(repositoryContext, (String) source);<NEW_LINE>}<NEW_LINE>ReportTemplateSource templateSource;<NEW_LINE>if (filler.fillContext.hasLoadedTemplate(cacheKey)) {<NEW_LINE>templateSource = <MASK><NEW_LINE>} else {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Loading styles template from " + source);<NEW_LINE>}<NEW_LINE>if (source instanceof String) {<NEW_LINE>ResourceInfo resourceInfo = RepositoryUtil.getInstance(repositoryContext).getResourceInfo((String) source);<NEW_LINE>if (resourceInfo == null) {<NEW_LINE>JRTemplate template = JRXmlTemplateLoader.getInstance(repositoryContext).loadTemplate((String) source);<NEW_LINE>templateSource = ReportTemplateSource.of(template);<NEW_LINE>} else {<NEW_LINE>String resourceLocation = resourceInfo.getRepositoryResourceLocation();<NEW_LINE>ResourcePathKey absoluteKey = ResourcePathKey.absolute(resourceLocation);<NEW_LINE>if (filler.fillContext.hasLoadedTemplate(absoluteKey)) {<NEW_LINE>templateSource = filler.fillContext.getLoadedTemplate(absoluteKey);<NEW_LINE>} else {<NEW_LINE>JRTemplate template = JRXmlTemplateLoader.getInstance(repositoryContext).loadTemplate(resourceLocation);<NEW_LINE>templateSource = ReportTemplateSource.of(template, resourceInfo);<NEW_LINE>filler.fillContext.registerLoadedTemplate(absoluteKey, templateSource);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (source instanceof File) {<NEW_LINE>JRTemplate template = JRXmlTemplateLoader.getInstance(filler.getJasperReportsContext()).loadTemplate((File) source);<NEW_LINE>templateSource = ReportTemplateSource.of(template);<NEW_LINE>} else if (source instanceof URL) {<NEW_LINE>JRTemplate template = JRXmlTemplateLoader.getInstance(filler.getJasperReportsContext()).loadTemplate((URL) source);<NEW_LINE>templateSource = ReportTemplateSource.of(template);<NEW_LINE>} else if (source instanceof InputStream) {<NEW_LINE>JRTemplate template = JRXmlTemplateLoader.getInstance(filler.getJasperReportsContext()).loadTemplate((InputStream) source);<NEW_LINE>templateSource = ReportTemplateSource.of(template);<NEW_LINE>} else {<NEW_LINE>throw new JRRuntimeException(EXCEPTION_MESSAGE_KEY_UNKNOWN_TEMPLATE_SOURCE, new Object[] { source.getClass().getName() });<NEW_LINE>}<NEW_LINE>filler.fillContext.registerLoadedTemplate(cacheKey, templateSource);<NEW_LINE>}<NEW_LINE>return templateSource;<NEW_LINE>}
filler.fillContext.getLoadedTemplate(cacheKey);
187,172
public void configure(Object... keyValues) {<NEW_LINE>Object key = keyValues[0];<NEW_LINE>Object value = keyValues[1];<NEW_LINE>if (key.equals(Hits.AUTH_PROP)) {<NEW_LINE>if (!(value instanceof String)) {<NEW_LINE>throw new IllegalArgumentException("auth requires a String as its argument");<NEW_LINE>}<NEW_LINE>this.authProp = (String) value;<NEW_LINE>} else if (key.equals(Hits.HUB_PROP)) {<NEW_LINE>if (!(value instanceof String)) {<NEW_LINE>throw new IllegalArgumentException("hub requires a String as its argument");<NEW_LINE>}<NEW_LINE>this.hubProp = (String) value;<NEW_LINE>} else if (key.equals(Hits.TIMES)) {<NEW_LINE>if (!(value instanceof Integer)) {<NEW_LINE>throw new IllegalArgumentException("times requires an Integer as its argument");<NEW_LINE>}<NEW_LINE>this.maxIterations = (int) value;<NEW_LINE>} else if (key.equals(Hits.EDGES)) {<NEW_LINE>if (!(value instanceof String)) {<NEW_LINE>throw new IllegalArgumentException("edges requires an String as its argument");<NEW_LINE>}<NEW_LINE>this.edgeLabels = Lists.newArrayList((String) value);<NEW_LINE>} else {<NEW_LINE>this.<MASK><NEW_LINE>}<NEW_LINE>}
parameters.set(this, keyValues);
193,278
public void onApplicationEvent(AppLoggedInEvent event) {<NEW_LINE><MASK><NEW_LINE>Connection connection = app.getConnection();<NEW_LINE>if (connection.isAuthenticated() && !isLoggedInWithExternalAuth(connection.getSessionNN())) {<NEW_LINE>User user = connection.getSessionNN().getUser();<NEW_LINE>// Change password on logon<NEW_LINE>if (Boolean.TRUE.equals(user.getChangePasswordAtNextLogon())) {<NEW_LINE>WindowManager wm = app.getWindowManager();<NEW_LINE>for (Window window : wm.getOpenWindows()) {<NEW_LINE>window.setEnabled(false);<NEW_LINE>}<NEW_LINE>WindowInfo changePasswordDialog = windowConfig.getWindowInfo("sec$User.changePassword");<NEW_LINE>Window changePasswordWindow = wm.openWindow(changePasswordDialog, WindowManager.OpenType.DIALOG.closeable(false), ParamsMap.of("cancelEnabled", Boolean.FALSE));<NEW_LINE>changePasswordWindow.addCloseListener(actionId -> {<NEW_LINE>for (Window window : wm.getOpenWindows()) {<NEW_LINE>window.setEnabled(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
App app = event.getApp();
930,825
public com.amazonaws.services.finspacedata.model.AccessDeniedException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.finspacedata.model.AccessDeniedException accessDeniedException = new com.amazonaws.services.finspacedata.model.AccessDeniedException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return accessDeniedException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,049,769
private void handleCExtensionException(String feature, Exception e) {<NEW_LINE>TranslateExceptionNode.logJavaException(getContext(), this, e);<NEW_LINE>final Throwable linkErrorException = searchForException("NFIUnsatisfiedLinkError", e);<NEW_LINE>if (linkErrorException != null) {<NEW_LINE>final String linkError = linkErrorException.getMessage();<NEW_LINE>if (getContext().getOptions().CEXTS_LOG_LOAD) {<NEW_LINE>RubyLanguage.LOGGER.info("unsatisfied link error " + linkError);<NEW_LINE>}<NEW_LINE>final String message;<NEW_LINE>if (feature.equals("openssl.so")) {<NEW_LINE>message = String.format("%s (%s)", "you may need to install the system OpenSSL library libssl - see https://github.com/oracle/truffleruby/blob/master/doc/user/installing-libssl.md", linkError);<NEW_LINE>} else {<NEW_LINE>message = linkError;<NEW_LINE>}<NEW_LINE>throw new RaiseException(getContext(), getContext().getCoreExceptions().runtimeError(message, this));<NEW_LINE>}<NEW_LINE>final Throwable linkerException = searchForException("LLVMLinkerException", e);<NEW_LINE>if (linkerException != null) {<NEW_LINE>final String linkError = linkerException.getMessage();<NEW_LINE>final String message;<NEW_LINE>final String home = getLanguage().getRubyHome();<NEW_LINE>final String postInstallHook = (home != null ? home + "/" : "") + "lib/truffle/post_install_hook.sh";<NEW_LINE>// Mismatches between the libssl compiled against and the libssl used at runtime (typically on a different machine)<NEW_LINE>if (feature.contains("openssl")) {<NEW_LINE>message = String.format("%s (%s)", "the OpenSSL C extension was compiled against a different libssl than the one used on this system - recompile by running " + postInstallHook, linkError);<NEW_LINE>} else {<NEW_LINE>message = linkError;<NEW_LINE>}<NEW_LINE>throw new RaiseException(getContext(), getContext().getCoreExceptions()<MASK><NEW_LINE>}<NEW_LINE>}
.runtimeError(message, this));
645,086
private void drawPainters(com.codename1.ui.Graphics g, Component par, Component c, int x, int y, int w, int h) {<NEW_LINE>if (flatten && getWidth() > 0 && getHeight() > 0) {<NEW_LINE>Image i = (Image) getClientProperty("$FLAT");<NEW_LINE>int absX = getAbsoluteX() + getScrollX();<NEW_LINE>int absY = getAbsoluteY() + getScrollY();<NEW_LINE>if (i == null || i.getWidth() != getWidth() || i.getHeight() != getHeight()) {<NEW_LINE>i = ImageFactory.createImage(this, getWidth(), getHeight(), 0);<NEW_LINE>Graphics tg = i.getGraphics();<NEW_LINE>// tg.translate(g.getTranslateX(), g.getTranslateY());<NEW_LINE>drawPaintersImpl(tg, par, c, x, y, w, h);<NEW_LINE>paintBackgroundImpl(tg);<NEW_LINE>putClientProperty("$FLAT", i);<NEW_LINE>}<NEW_LINE>int tx = g.getTranslateX();<NEW_LINE>int ty = g.getTranslateY();<NEW_LINE>g.translate(-tx + absX, -ty + absY);<NEW_LINE>g.drawImage(i, 0, 0);<NEW_LINE>g.translate(tx - absX, ty - absY);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>drawPaintersImpl(g, par, c, <MASK><NEW_LINE>}
x, y, w, h);
1,092,531
public static void YUV420pToRGBH2H(byte yh, byte yl, byte uh, byte ul, byte vh, byte vl, int nlbi, byte[] data, byte[] lowBits, int nlbo, int off) {<NEW_LINE>int clipMax = ((1 << nlbo) << 8) - 1;<NEW_LINE>int round = (1 << nlbo) >> 1;<NEW_LINE>int c = ((yh + 128<MASK><NEW_LINE>int d = ((uh + 128) << nlbi) + ul - 512;<NEW_LINE>int e = ((vh + 128) << nlbi) + vl - 512;<NEW_LINE>int r = MathUtil.clip((298 * c + 409 * e + 128) >> 8, 0, clipMax);<NEW_LINE>int g = MathUtil.clip((298 * c - 100 * d - 208 * e + 128) >> 8, 0, clipMax);<NEW_LINE>int b = MathUtil.clip((298 * c + 516 * d + 128) >> 8, 0, clipMax);<NEW_LINE>int valR = MathUtil.clip((r + round) >> nlbo, 0, 255);<NEW_LINE>data[off] = (byte) (valR - 128);<NEW_LINE>lowBits[off] = (byte) (r - (valR << nlbo));<NEW_LINE>int valG = MathUtil.clip((g + round) >> nlbo, 0, 255);<NEW_LINE>data[off + 1] = (byte) (valG - 128);<NEW_LINE>lowBits[off + 1] = (byte) (g - (valG << nlbo));<NEW_LINE>int valB = MathUtil.clip((b + round) >> nlbo, 0, 255);<NEW_LINE>data[off + 2] = (byte) (valB - 128);<NEW_LINE>lowBits[off + 2] = (byte) (b - (valB << nlbo));<NEW_LINE>}
) << nlbi) + yl - 64;
1,532,158
protected PageBook createPropertiesPanelTitle(Composite parent) {<NEW_LINE>GridLayout layout;<NEW_LINE>PageBook book = new PageBook(parent, SWT.NONE);<NEW_LINE>book.setFont(parent.getFont());<NEW_LINE>book.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));<NEW_LINE>titlePage = new Composite(book, SWT.NONE);<NEW_LINE>titlePage.setFont(book.getFont());<NEW_LINE>layout = new GridLayout(2, false);<NEW_LINE>layout.horizontalSpacing = 0;<NEW_LINE>layout.marginWidth = 0;<NEW_LINE>layout.marginHeight = 0;<NEW_LINE>layout.verticalSpacing = 0;<NEW_LINE>titlePage.setLayout(layout);<NEW_LINE>title = createSectionTitle(titlePage, PaletteMessages.NO_SELECTION_TITLE);<NEW_LINE>errorPage = new Composite(book, SWT.NONE);<NEW_LINE>errorPage.<MASK><NEW_LINE>layout = new GridLayout(1, false);<NEW_LINE>layout.horizontalSpacing = 0;<NEW_LINE>layout.marginWidth = 0;<NEW_LINE>layout.marginHeight = 0;<NEW_LINE>layout.verticalSpacing = 0;<NEW_LINE>errorPage.setLayout(layout);<NEW_LINE>Composite intermediary = new Composite(errorPage, SWT.NONE) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Point computeSize(int wHint, int hHint, boolean changed) {<NEW_LINE>Rectangle bounds = title.getBounds();<NEW_LINE>return new Point(bounds.width, bounds.height);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>intermediary.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));<NEW_LINE>StackLayout stackLayout = new StackLayout();<NEW_LINE>intermediary.setLayout(stackLayout);<NEW_LINE>errorTitle = new MultiLineLabel(intermediary);<NEW_LINE>stackLayout.topControl = errorTitle;<NEW_LINE>errorTitle.setImage(JFaceResources.getImage(DLG_IMG_MESSAGE_ERROR));<NEW_LINE>errorTitle.setFont(errorPage.getFont());<NEW_LINE>Label separator = new Label(errorPage, SWT.SEPARATOR | SWT.HORIZONTAL);<NEW_LINE>separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>book.showPage(titlePage);<NEW_LINE>return book;<NEW_LINE>}
setFont(book.getFont());
1,782,775
private void put(long keyPart, InMemEntry entry, int depth, int value) {<NEW_LINE>if (entry.isLeaf()) {<NEW_LINE>InMemLeafEntry leafEntry = (InMemLeafEntry) entry;<NEW_LINE>// Avoid adding the same edge id multiple times.<NEW_LINE>// Since each edge id is handled only once, this can only happen when<NEW_LINE>// this method is called several times in a row with the same edge id,<NEW_LINE>// so it is enough to check the last entry.<NEW_LINE>// (It happens when one edge has several segments. Every segment is traversed<NEW_LINE>// on its own, without de-duplicating the tiles that are touched.)<NEW_LINE>if (leafEntry.isEmpty() || leafEntry.get(leafEntry.size() - 1) != value) {<NEW_LINE>leafEntry.add(value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int index = (int) (keyPart >>> (64 - shifts[depth]));<NEW_LINE>keyPart = keyPart << shifts[depth];<NEW_LINE>InMemTreeEntry treeEntry = ((InMemTreeEntry) entry);<NEW_LINE>InMemEntry subentry = treeEntry.getSubEntry(index);<NEW_LINE>depth++;<NEW_LINE>if (subentry == null) {<NEW_LINE>if (depth == entries.length) {<NEW_LINE>subentry = new InMemLeafEntry(4);<NEW_LINE>} else {<NEW_LINE>subentry = <MASK><NEW_LINE>}<NEW_LINE>treeEntry.setSubEntry(index, subentry);<NEW_LINE>}<NEW_LINE>put(keyPart, subentry, depth, value);<NEW_LINE>}<NEW_LINE>}
new InMemTreeEntry(entries[depth]);
719,028
public static boolean registerDevice(final ActivityBase context) {<NEW_LINE>int userId = Util.getUserId(Process.myUid());<NEW_LINE>if (Util.hasProLicense(context) == null && !PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingRegistered, false)) {<NEW_LINE>// Get accounts<NEW_LINE>String email = null;<NEW_LINE>for (Account account : AccountManager.get(context).getAccounts()) if ("com.google".equals(account.type)) {<NEW_LINE>email = account.name;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>LayoutInflater LayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);<NEW_LINE>View view = LayoutInflater.inflate(R.layout.register, null);<NEW_LINE>final EditText input = (EditText) view.findViewById(R.id.etEmail);<NEW_LINE>if (email != null)<NEW_LINE>input.setText(email);<NEW_LINE>// Build dialog<NEW_LINE>AlertDialog.Builder alertDialogBuilder <MASK><NEW_LINE>alertDialogBuilder.setTitle(R.string.msg_register);<NEW_LINE>alertDialogBuilder.setIcon(context.getThemed(R.attr.icon_launcher));<NEW_LINE>alertDialogBuilder.setView(view);<NEW_LINE>alertDialogBuilder.setPositiveButton(context.getString(android.R.string.ok), new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>String email = input.getText().toString();<NEW_LINE>if (Patterns.EMAIL_ADDRESS.matcher(email).matches())<NEW_LINE>new RegisterTask(context).executeOnExecutor(mExecutor, email);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>alertDialogBuilder.setNegativeButton(context.getString(android.R.string.cancel), new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>// Do nothing<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Show dialog<NEW_LINE>AlertDialog alertDialog = alertDialogBuilder.create();<NEW_LINE>alertDialog.show();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
= new AlertDialog.Builder(context);
1,759,746
public void parse(String url, FileURL fileURL) throws MalformedURLException {<NEW_LINE>int urlLen = url.length();<NEW_LINE>int schemeDelimPos = url.indexOf("://");<NEW_LINE>String scheme = url.substring(0, schemeDelimPos);<NEW_LINE>fileURL.setScheme(scheme);<NEW_LINE>int hostStartPos = schemeDelimPos + 3;<NEW_LINE>int hostEndPos = url.lastIndexOf('/');<NEW_LINE>String host = url.substring(hostStartPos, hostEndPos);<NEW_LINE>fileURL.setHost(host);<NEW_LINE>int questionMarkPos = url.indexOf('?', hostEndPos);<NEW_LINE>String path = url.substring(hostEndPos + 1, questionMarkPos <MASK><NEW_LINE>LOGGER.info("found path: " + path);<NEW_LINE>// todo: throw exception on empty path<NEW_LINE>fileURL.setPath(path);<NEW_LINE>if (questionMarkPos != -1)<NEW_LINE>fileURL.setQuery(url.substring(questionMarkPos + 1));<NEW_LINE>}
== -1 ? urlLen : questionMarkPos);
744,406
public Mono<ActionDTO> importAction(Object input, String pageId, String name, String orgId, String branchName) {<NEW_LINE>ActionDTO action;<NEW_LINE>try {<NEW_LINE>if (input == null) {<NEW_LINE>throw new AppsmithException(AppsmithError.INVALID_PARAMETER, FieldName.CURL_CODE);<NEW_LINE>}<NEW_LINE>action = curlToAction((String) input, name);<NEW_LINE>} catch (AppsmithException e) {<NEW_LINE>return Mono.error(e);<NEW_LINE>}<NEW_LINE>if (action == null) {<NEW_LINE>return Mono.error(new AppsmithException(AppsmithError.INVALID_CURL_COMMAND));<NEW_LINE>}<NEW_LINE>Mono<NewPage> pageMono = newPageService.<MASK><NEW_LINE>// Set the default values for datasource (plugin, name) and then create the action<NEW_LINE>// with embedded datasource<NEW_LINE>return Mono.zip(Mono.just(action), pluginService.findByPackageName(RESTAPI_PLUGIN), pageMono).flatMap(tuple -> {<NEW_LINE>final ActionDTO action1 = tuple.getT1();<NEW_LINE>final Plugin plugin = tuple.getT2();<NEW_LINE>final NewPage newPage = tuple.getT3();<NEW_LINE>final Datasource datasource = action1.getDatasource();<NEW_LINE>final DatasourceConfiguration datasourceConfiguration = datasource.getDatasourceConfiguration();<NEW_LINE>datasource.setName(datasourceConfiguration.getUrl());<NEW_LINE>datasource.setPluginId(plugin.getId());<NEW_LINE>datasource.setOrganizationId(orgId);<NEW_LINE>// Set git related resource IDs<NEW_LINE>action1.setDefaultResources(newPage.getDefaultResources());<NEW_LINE>action1.setPageId(newPage.getId());<NEW_LINE>return Mono.just(action1);<NEW_LINE>}).flatMap(layoutActionService::createSingleAction).map(responseUtils::updateActionDTOWithDefaultResources);<NEW_LINE>}
findByBranchNameAndDefaultPageId(branchName, pageId, MANAGE_PAGES);
10,065
public long clearOldEntries(long cacheExpirationMs) {<NEW_LINE>long oldestRemainingEntryAgeMs = 0L;<NEW_LINE>synchronized (mLock) {<NEW_LINE>try {<NEW_LINE>long now = mClock.now();<NEW_LINE>Collection<DiskStorage.Entry> allEntries = mStorage.getEntries();<NEW_LINE>final long cacheSizeBeforeClearance = mCacheStats.getSize();<NEW_LINE>int itemsRemovedCount = 0;<NEW_LINE>long itemsRemovedSize = 0L;<NEW_LINE>for (DiskStorage.Entry entry : allEntries) {<NEW_LINE>// entry age of zero is disallowed.<NEW_LINE>long entryAgeMs = Math.max(1, Math.abs(now - entry.getTimestamp()));<NEW_LINE>if (entryAgeMs >= cacheExpirationMs) {<NEW_LINE>long entryRemovedSize = mStorage.remove(entry);<NEW_LINE>mResourceIndex.remove(entry.getId());<NEW_LINE>if (entryRemovedSize > 0) {<NEW_LINE>itemsRemovedCount++;<NEW_LINE>itemsRemovedSize += entryRemovedSize;<NEW_LINE>SettableCacheEvent cacheEvent = SettableCacheEvent.obtain().setResourceId(entry.getId()).setEvictionReason(CacheEventListener.EvictionReason.CONTENT_STALE).setItemSize(entryRemovedSize<MASK><NEW_LINE>mCacheEventListener.onEviction(cacheEvent);<NEW_LINE>cacheEvent.recycle();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>oldestRemainingEntryAgeMs = Math.max(oldestRemainingEntryAgeMs, entryAgeMs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mStorage.purgeUnexpectedResources();<NEW_LINE>if (itemsRemovedCount > 0) {<NEW_LINE>maybeUpdateFileCacheSize();<NEW_LINE>mCacheStats.increment(-itemsRemovedSize, -itemsRemovedCount);<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>mCacheErrorLogger.logError(CacheErrorLogger.CacheErrorCategory.EVICTION, TAG, "clearOldEntries: " + ioe.getMessage(), ioe);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return oldestRemainingEntryAgeMs;<NEW_LINE>}
).setCacheSize(cacheSizeBeforeClearance - itemsRemovedSize);
1,043,969
private Trace populateTraceId(scala.Option context) {<NEW_LINE>scala.collection.Map traceContextMap = (scala.collection.Map) context.get();<NEW_LINE>Map map = JavaConversions.mapAsJavaMap(traceContextMap);<NEW_LINE>String transactionId = (String) map.get("transactionId");<NEW_LINE>String spanId = (String) map.get("spanId");<NEW_LINE>String parentSpanId = (String) map.get("parentSpanId");<NEW_LINE>String flag = (String) map.get("flag");<NEW_LINE>String applicationName = (String) map.get("applicationName");<NEW_LINE>String serverTypeCode = (String) map.get("serverTypeCode");<NEW_LINE>String entityPath = (<MASK><NEW_LINE>String endPoint = (String) map.get("endPoint");<NEW_LINE>TraceId traceId = traceContext.createTraceId(transactionId, NumberUtils.parseLong(parentSpanId, SpanId.NULL), NumberUtils.parseLong(spanId, SpanId.NULL), NumberUtils.parseShort(flag, (short) 0));<NEW_LINE>if (traceId != null) {<NEW_LINE>Trace trace = traceContext.continueAsyncTraceObject(traceId);<NEW_LINE>final SpanRecorder recorder = trace.getSpanRecorder();<NEW_LINE>recorder.recordServiceType(OpenwhiskConstants.OPENWHISK_INVOKER);<NEW_LINE>recorder.recordApi(descriptor);<NEW_LINE>recorder.recordAcceptorHost(endPoint);<NEW_LINE>recorder.recordRpcName(entityPath);<NEW_LINE>// Record parent application<NEW_LINE>recorder.recordParentApplication(applicationName, Short.valueOf(serverTypeCode));<NEW_LINE>return trace;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
String) map.get("entityPath");
41,954
public static GetWelcomePageURIResponse unmarshall(GetWelcomePageURIResponse getWelcomePageURIResponse, UnmarshallerContext context) {<NEW_LINE>getWelcomePageURIResponse.setRequestId(context.stringValue("GetWelcomePageURIResponse.RequestId"));<NEW_LINE>getWelcomePageURIResponse.setData(context.stringValue("GetWelcomePageURIResponse.Data"));<NEW_LINE>getWelcomePageURIResponse.setErrorCode(context.integerValue("GetWelcomePageURIResponse.ErrorCode"));<NEW_LINE>getWelcomePageURIResponse.setErrorMsg(context.stringValue("GetWelcomePageURIResponse.ErrorMsg"));<NEW_LINE>getWelcomePageURIResponse.setSuccess<MASK><NEW_LINE>List<ErrorMessage> errorList = new ArrayList<ErrorMessage>();<NEW_LINE>for (int i = 0; i < context.lengthValue("GetWelcomePageURIResponse.ErrorList.Length"); i++) {<NEW_LINE>ErrorMessage errorMessage = new ErrorMessage();<NEW_LINE>errorMessage.setErrorMessage(context.stringValue("GetWelcomePageURIResponse.ErrorList[" + i + "].ErrorMessage"));<NEW_LINE>errorList.add(errorMessage);<NEW_LINE>}<NEW_LINE>getWelcomePageURIResponse.setErrorList(errorList);<NEW_LINE>return getWelcomePageURIResponse;<NEW_LINE>}
(context.booleanValue("GetWelcomePageURIResponse.Success"));
399,355
public List<GenericTrigger> loadTriggers(DBRProgressMonitor monitor, @NotNull GenericStructContainer container, @Nullable GenericTableBase table) throws DBException {<NEW_LINE>if (table == null) {<NEW_LINE>throw new DBException("Database level triggers aren't supported for HSQLDB");<NEW_LINE>}<NEW_LINE>try (JDBCSession session = DBUtils.openMetaSession(monitor, container, "Read triggers")) {<NEW_LINE>try (JDBCPreparedStatement dbStat = session.prepareStatement("SELECT * FROM INFORMATION_SCHEMA.TRIGGERS\n" + "WHERE EVENT_OBJECT_SCHEMA=? AND EVENT_OBJECT_TABLE=?")) {<NEW_LINE>dbStat.setString(1, container.getName());<NEW_LINE>dbStat.setString(2, table.getName());<NEW_LINE>List<GenericTrigger> result = new ArrayList<>();<NEW_LINE>try (JDBCResultSet dbResult = dbStat.executeQuery()) {<NEW_LINE>while (dbResult.next()) {<NEW_LINE>String name = <MASK><NEW_LINE>if (name == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>name = name.trim();<NEW_LINE>HSQLTrigger trigger = new HSQLTrigger(table, name, dbResult);<NEW_LINE>result.add(trigger);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new DBException(e, container.getDataSource());<NEW_LINE>}<NEW_LINE>}
JDBCUtils.safeGetString(dbResult, "TRIGGER_NAME");
171,026
public CertificateConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CertificateConfiguration certificateConfiguration = new CertificateConfiguration();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("CertificateType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>certificateConfiguration.setCertificateType(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 certificateConfiguration;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
434,893
protected void migrateAssignAxis(Axis legacyAxis, AbstractAxis axis, HeadMountable hm) {<NEW_LINE>AbstractAxis assignAxis = axis;<NEW_LINE>if (legacyAxis.transform != null) {<NEW_LINE>if (legacyAxis.transform instanceof CamTransform) {<NEW_LINE>if (!((CamTransform) legacyAxis.transform).negatedHeadMountableId.equals(hm.getId())) {<NEW_LINE>// Not the negated axis, take the input axis.<NEW_LINE>assignAxis = ((AbstractSingleTransformedAxis) axis).getInputAxis();<NEW_LINE>}<NEW_LINE>} else if (legacyAxis.transform instanceof NegatingTransform) {<NEW_LINE>if (!((NegatingTransform) legacyAxis.transform).negatedHeadMountableId.equals(hm.getId())) {<NEW_LINE>// Not the negated axis, take the input axis.<NEW_LINE>assignAxis = ((AbstractSingleTransformedAxis) axis).getInputAxis();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Assign if formerly mapped.<NEW_LINE>if (getLegacyAxis(hm, Type.X) == legacyAxis) {<NEW_LINE>((AbstractHeadMountable) hm).setAxisX(assignAxis);<NEW_LINE>}<NEW_LINE>if (getLegacyAxis(hm, Type.Y) == legacyAxis) {<NEW_LINE>((AbstractHeadMountable) hm).setAxisY(assignAxis);<NEW_LINE>}<NEW_LINE>if (getLegacyAxis(hm, Type.Z) == legacyAxis) {<NEW_LINE>((AbstractHeadMountable) hm).setAxisZ(assignAxis);<NEW_LINE>if (hm instanceof ReferenceNozzle) {<NEW_LINE>((ReferenceNozzle) hm).migrateSafeZ();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (getLegacyAxis(hm, Type.Rotation) == legacyAxis) {<NEW_LINE>((AbstractHeadMountable) hm).setAxisRotation(assignAxis);<NEW_LINE>if (hm instanceof ReferenceNozzle && assignAxis instanceof ReferenceControllerAxis) {<NEW_LINE>((ReferenceControllerAxis) assignAxis).setLimitRotation(((ReferenceNozzle<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
) hm).isLimitRotation());
16,614
public long createOrUpdateSecret(String name, String owner, String encryptedSecret, String hmac, String creator, Map<String, String> metadata, long expiry, String description, @Nullable String type, @Nullable Map<String, String> generationOptions) {<NEW_LINE>// SecretController should have already checked that the contents are not empty<NEW_LINE>return dslContext.transactionResult(configuration -> {<NEW_LINE>long now = OffsetDateTime.now().toEpochSecond();<NEW_LINE>SecretContentDAO secretContentDAO = secretContentDAOFactory.using(configuration);<NEW_LINE>SecretSeriesDAO secretSeriesDAO = secretSeriesDAOFactory.using(configuration);<NEW_LINE>Long ownerId = getOwnerId(configuration, owner);<NEW_LINE>Optional<SecretSeries> secretSeries = secretSeriesDAO.getSecretSeriesByName(name);<NEW_LINE>long secretId;<NEW_LINE>if (secretSeries.isPresent()) {<NEW_LINE>SecretSeries secretSeries1 = secretSeries.get();<NEW_LINE>secretId = secretSeries1.id();<NEW_LINE>Long effectiveOwnerId = ownerId != null ? ownerId : getOwnerId(configuration, secretSeries1.owner());<NEW_LINE>secretSeriesDAO.updateSecretSeries(secretId, name, effectiveOwnerId, creator, <MASK><NEW_LINE>} else {<NEW_LINE>secretId = secretSeriesDAO.createSecretSeries(name, ownerId, creator, description, type, generationOptions, now);<NEW_LINE>}<NEW_LINE>long secretContentId = secretContentDAO.createSecretContent(secretId, encryptedSecret, hmac, creator, metadata, expiry, now);<NEW_LINE>secretSeriesDAO.setCurrentVersion(secretId, secretContentId, creator, now);<NEW_LINE>return secretId;<NEW_LINE>});<NEW_LINE>}
description, type, generationOptions, now);
1,618,873
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see<NEW_LINE>* com.amazonaws.services.s3.AmazonS3#listObjects(com.amazonaws.services<NEW_LINE>* .s3.model.ListObjectsRequest)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public ObjectListing listObjects(ListObjectsRequest listObjectsRequest) throws AmazonClientException, AmazonServiceException {<NEW_LINE>assertParameterNotNull(listObjectsRequest.getBucketName(), "The bucket name parameter must be specified when listing objects in a bucket");<NEW_LINE>final boolean shouldSDKDecodeResponse = Constants.URL_ENCODING.equals(listObjectsRequest.getEncodingType());<NEW_LINE>// if the url is encoded, the prefix also has to be encoded.<NEW_LINE>final Request<ListObjectsRequest> request = createRequest(listObjectsRequest.getBucketName(), null, listObjectsRequest, HttpMethodName.GET);<NEW_LINE>addParameterIfNotNull(request, "prefix", listObjectsRequest.getPrefix());<NEW_LINE>addParameterIfNotNull(request, <MASK><NEW_LINE>addParameterIfNotNull(request, "marker", listObjectsRequest.getMarker());<NEW_LINE>addParameterIfNotNull(request, "encoding-type", listObjectsRequest.getEncodingType());<NEW_LINE>populateRequesterPaysHeader(request, listObjectsRequest.isRequesterPays());<NEW_LINE>if (listObjectsRequest.getMaxKeys() != null && listObjectsRequest.getMaxKeys().intValue() >= 0) {<NEW_LINE>request.addParameter("max-keys", listObjectsRequest.getMaxKeys().toString());<NEW_LINE>}<NEW_LINE>return invoke(request, new Unmarshallers.ListObjectsUnmarshaller(shouldSDKDecodeResponse), listObjectsRequest.getBucketName(), null);<NEW_LINE>}
"delimiter", listObjectsRequest.getDelimiter());
1,075,678
private void addBasicTypeToExcel(RowData oneRowData, Row row, int rowIndex, int relativeRowIndex) {<NEW_LINE>if (oneRowData.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<Integer, Head> headMap = writeContext.currentWriteHolder().excelWriteHeadProperty().getHeadMap();<NEW_LINE>int dataIndex = 0;<NEW_LINE>int maxCellIndex = -1;<NEW_LINE>for (Map.Entry<Integer, Head> entry : headMap.entrySet()) {<NEW_LINE>if (dataIndex >= oneRowData.size()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>Head head = entry.getValue();<NEW_LINE>doAddBasicTypeToExcel(oneRowData, head, row, rowIndex, relativeRowIndex, dataIndex++, columnIndex);<NEW_LINE>maxCellIndex = Math.max(maxCellIndex, columnIndex);<NEW_LINE>}<NEW_LINE>// Finish<NEW_LINE>if (dataIndex >= oneRowData.size()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// fix https://github.com/alibaba/easyexcel/issues/1702<NEW_LINE>// If there is data, it is written to the next cell<NEW_LINE>maxCellIndex++;<NEW_LINE>int size = oneRowData.size() - dataIndex;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>doAddBasicTypeToExcel(oneRowData, null, row, rowIndex, relativeRowIndex, dataIndex++, maxCellIndex++);<NEW_LINE>}<NEW_LINE>}
int columnIndex = entry.getKey();
312,220
private static void open(DbMethodCall mc) {<NEW_LINE>synchronized (mc.plugin) {<NEW_LINE>String path = normalizePath(mc.getAppContext(), (String) mc.args[1]);<NEW_LINE>DbEntry dbe = null;<NEW_LINE>for (DbEntry v : dbmap.values()) {<NEW_LINE>if (v.path.equals(path)) {<NEW_LINE>dbe = v;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dbe != null) {<NEW_LINE>dbe.countOpen();<NEW_LINE>mc.successOnMainThread(dbe.handle);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, Object> opts = cast(mc.args[2]);<NEW_LINE>EJDB2Builder b = new EJDB2Builder(path);<NEW_LINE>if (asBoolean(opts.get("readonly"), false)) {<NEW_LINE>b.readonly();<NEW_LINE>}<NEW_LINE>if (asBoolean(opts.get("truncate"), false)) {<NEW_LINE>b.truncate();<NEW_LINE>}<NEW_LINE>if (asBoolean(opts.get("wal_enabled"), true)) {<NEW_LINE>b.withWAL();<NEW_LINE>}<NEW_LINE>b.walCRCOnCheckpoint(asBoolean(opts.get("wal_check_crc_on_checkpoint"), false));<NEW_LINE>if (opts.containsKey("wal_checkpoint_buffer_sz")) {<NEW_LINE>b.walCheckpointBufferSize(asInt(opts.get("wal_checkpoint_buffer_sz"), 0));<NEW_LINE>}<NEW_LINE>if (opts.containsKey("wal_checkpoint_timeout_sec")) {<NEW_LINE>b.walCheckpointTimeoutSec(asInt(opts.get("wal_checkpoint_timeout_sec"), 0));<NEW_LINE>}<NEW_LINE>if (opts.containsKey("wal_savepoint_timeout_sec")) {<NEW_LINE>b.walSavepointTimeoutSec(asInt(opts.get("wal_savepoint_timeout_sec"), 0));<NEW_LINE>}<NEW_LINE>if (opts.containsKey("wal_wal_buffer_sz")) {<NEW_LINE>b.walBufferSize(asInt(opts.get("wal_wal_buffer_sz"), 0));<NEW_LINE>}<NEW_LINE>if (opts.containsKey("document_buffer_sz")) {<NEW_LINE>b.documentBufferSize(asInt(opts.<MASK><NEW_LINE>}<NEW_LINE>if (opts.containsKey("sort_buffer_sz")) {<NEW_LINE>b.sortBufferSize(asInt(opts.get("sort_buffer_sz"), 0));<NEW_LINE>}<NEW_LINE>final Integer handle = dbkeys.incrementAndGet();<NEW_LINE>dbmap.put(handle, new DbEntry(b.open(), handle, path));<NEW_LINE>mc.successOnMainThread(handle);<NEW_LINE>}<NEW_LINE>}
get("document_buffer_sz"), 0));
494,581
// @DocValidate(timings = { ModelValidator.TIMING_AFTER_COMPLETE, ModelValidator.TIMING_AFTER_REACTIVATE, ModelValidator.TIMING_AFTER_CLOSE })<NEW_LINE>// public void invalidateInvoiceCandidates(final I_C_Order order)<NEW_LINE>// {<NEW_LINE>// final IInvoiceCandidateHandlerBL invoiceCandidateHandlerBL = Services.get(IInvoiceCandidateHandlerBL.class);<NEW_LINE>// invoiceCandidateHandlerBL.invalidateCandidatesFor(order);<NEW_LINE>// }<NEW_LINE>@DocValidate(timings = { ModelValidator.TIMING_BEFORE_PREPARE })<NEW_LINE>public void checkCreditLimit(@NonNull final I_C_Order order) {<NEW_LINE>if (!isCheckCreditLimitNeeded(order)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final IBPartnerStatsBL bpartnerStatsBL = Services.get(IBPartnerStatsBL.class);<NEW_LINE>final IBPartnerStatsDAO bpartnerStatsDAO = Services.get(IBPartnerStatsDAO.class);<NEW_LINE>final BPartnerStats stats = bpartnerStatsDAO.getCreateBPartnerStats(order.getBill_BPartner_ID());<NEW_LINE>final BigDecimal creditUsed = stats.getSOCreditUsed();<NEW_LINE>final String soCreditStatus = stats.getSOCreditStatus();<NEW_LINE>final Timestamp dateOrdered = order.getDateOrdered();<NEW_LINE>final BPartnerCreditLimitRepository creditLimitRepo = Adempiere.getBean(BPartnerCreditLimitRepository.class);<NEW_LINE>final BigDecimal creditLimit = creditLimitRepo.retrieveCreditLimitByBPartnerId(order.getBill_BPartner_ID(), dateOrdered);<NEW_LINE>if (X_C_BPartner_Stats.SOCREDITSTATUS_CreditStop.equals(soCreditStatus)) {<NEW_LINE>throw new AdempiereException(TranslatableStrings.builder().appendADElement("BPartnerCreditStop").append(":").append(" ").appendADElement("SO_CreditUsed").append("=").append(creditUsed, DisplayType.Amount).append(", ").appendADElement("SO_CreditLimit").append("=").append(creditLimit, DisplayType<MASK><NEW_LINE>}<NEW_LINE>if (X_C_BPartner_Stats.SOCREDITSTATUS_CreditHold.equals(soCreditStatus)) {<NEW_LINE>throw new AdempiereException(TranslatableStrings.builder().appendADElement("BPartnerCreditHold").append(":").append(" ").appendADElement("SO_CreditUsed").append("=").append(creditUsed, DisplayType.Amount).append(", ").appendADElement("SO_CreditLimit").append("=").append(creditLimit, DisplayType.Amount).build());<NEW_LINE>}<NEW_LINE>final BigDecimal grandTotal = Services.get(ICurrencyBL.class).convertBase(order.getGrandTotal(), CurrencyId.ofRepoId(order.getC_Currency_ID()), TimeUtil.asLocalDate(order.getDateOrdered()), CurrencyConversionTypeId.ofRepoIdOrNull(order.getC_ConversionType_ID()), ClientId.ofRepoId(order.getAD_Client_ID()), OrgId.ofRepoId(order.getAD_Org_ID()));<NEW_LINE>final CalculateSOCreditStatusRequest request = // null is threated like zero<NEW_LINE>CalculateSOCreditStatusRequest.builder().stat(stats).// null is threated like zero<NEW_LINE>additionalAmt(grandTotal).date(dateOrdered).build();<NEW_LINE>final String calculatedSOCreditStatus = bpartnerStatsBL.calculateProjectedSOCreditStatus(request);<NEW_LINE>if (X_C_BPartner_Stats.SOCREDITSTATUS_CreditHold.equals(calculatedSOCreditStatus)) {<NEW_LINE>throw new AdempiereException(TranslatableStrings.builder().appendADElement("BPartnerOverOCreditHold").append(":").append(" ").appendADElement("SO_CreditUsed").append("=").append(creditUsed, DisplayType.Amount).append(", ").appendADElement("GrandTotal").append("=").append(grandTotal, DisplayType.Amount).append(", ").appendADElement("SO_CreditLimit").append("=").append(creditLimit, DisplayType.Amount).build());<NEW_LINE>}<NEW_LINE>}
.Amount).build());
783,782
public void invokeSvcClient(String testcase, WebClient webClient, Object startPage, SAMLTestSettings settings, List<validationData> expectations) throws Exception {<NEW_LINE>String thisMethod = "invokeSvcClient";<NEW_LINE>msgUtils.printMethodName(thisMethod);<NEW_LINE>try {<NEW_LINE>setMarkEndOfLogs();<NEW_LINE>URL url = AutomationTools.getNewUrl(settings.getSpAlternateApp());<NEW_LINE>WebRequest request = new WebRequest(url, HttpMethod.GET);<NEW_LINE>request.setRequestParameters(new ArrayList());<NEW_LINE>setRequestParameterIfSet(request, "targetApp", settings.getSpDefaultApp());<NEW_LINE>setRequestParameterIfSet(request, "header", settings.getRSSettings().getHeaderName());<NEW_LINE>setRequestParameterIfSet(request, "headerFormat", settings.getRSSettings().getHeaderFormat());<NEW_LINE>setRequestParameterIfSet(request, "formatType", settings.getRSSettings().getSamlTokenFormat());<NEW_LINE>msgUtils.printAllCookies(webClient);<NEW_LINE>msgUtils.printRequestParts(webClient, request, thisMethod + ": " + testcase, "Outgoing request");<NEW_LINE>Object thePage = webClient.getPage(request);<NEW_LINE>// make sure the page is processed before continuing<NEW_LINE>waitBeforeContinuing(webClient);<NEW_LINE>msgUtils.printAllCookies(webClient);<NEW_LINE>msgUtils.printResponseParts(thePage, testcase, thisMethod + " response");<NEW_LINE>validationTools.setServers(testSAMLServer, testSAMLOIDCServer, testOIDCServer, testAppServer, testIDPServer);<NEW_LINE>validationTools.validateResult(webClient, thePage, SAMLConstants.INVOKE_JAXRS_GET_VIASERVICECLIENT, expectations, settings);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.error(thisClass, testcase, e, "Exception occurred in " + thisMethod);<NEW_LINE>System.<MASK><NEW_LINE>validationTools.validateException(expectations, SAMLConstants.INVOKE_JAXRS_GET_VIASERVICECLIENT, e);<NEW_LINE>}<NEW_LINE>}
err.println("Exception: " + e);
605,178
public IO<IterV<char[], A>> f(IterV<char[], A> it) {<NEW_LINE>// use loop instead of recursion because of missing TCO<NEW_LINE>return () -> {<NEW_LINE>IterV<char<MASK><NEW_LINE>while (!isDone.f(i)) {<NEW_LINE>char[] buffer = new char[DEFAULT_BUFFER_SIZE];<NEW_LINE>final int numRead = r.read(buffer);<NEW_LINE>if (numRead == -1) {<NEW_LINE>return i;<NEW_LINE>}<NEW_LINE>if (numRead < buffer.length) {<NEW_LINE>buffer = Arrays.copyOfRange(buffer, 0, numRead);<NEW_LINE>}<NEW_LINE>final Input<char[]> input = Input.el(buffer);<NEW_LINE>final F<F<Input<char[]>, IterV<char[], A>>, P1<IterV<char[], A>>> cont = Function.<Input<char[]>, IterV<char[], A>>apply(input).lazy();<NEW_LINE>i = i.fold(done, cont)._1();<NEW_LINE>}<NEW_LINE>return i;<NEW_LINE>};<NEW_LINE>}
[], A> i = it;
314,382
public void handle(AnnotationValues<RequiredArgsConstructor> annotation, JCAnnotation ast, JavacNode annotationNode) {<NEW_LINE>handleFlagUsage(annotationNode, ConfigurationKeys.REQUIRED_ARGS_CONSTRUCTOR_FLAG_USAGE, "@RequiredArgsConstructor", ConfigurationKeys.ANY_CONSTRUCTOR_FLAG_USAGE, "any @xArgsConstructor");<NEW_LINE>deleteAnnotationIfNeccessary(annotationNode, RequiredArgsConstructor.class);<NEW_LINE>deleteImportFromCompilationUnit(annotationNode, "lombok.AccessLevel");<NEW_LINE>JavacNode typeNode = annotationNode.up();<NEW_LINE>if (!checkLegality(typeNode, annotationNode, NAME))<NEW_LINE>return;<NEW_LINE>List<JCAnnotation> onConstructor = unboxAndRemoveAnnotationParameter(ast, "onConstructor", "@RequiredArgsConstructor(onConstructor", annotationNode);<NEW_LINE>RequiredArgsConstructor ann = annotation.getInstance();<NEW_LINE>AccessLevel level = ann.access();<NEW_LINE>if (level == AccessLevel.NONE)<NEW_LINE>return;<NEW_LINE><MASK><NEW_LINE>if (annotation.isExplicit("suppressConstructorProperties")) {<NEW_LINE>annotationNode.addError("This deprecated feature is no longer supported. Remove it; you can create a lombok.config file with 'lombok.anyConstructor.suppressConstructorProperties = true'.");<NEW_LINE>}<NEW_LINE>handleConstructor.generateConstructor(typeNode, level, onConstructor, findRequiredFields(typeNode), false, staticName, SkipIfConstructorExists.NO, annotationNode);<NEW_LINE>}
String staticName = ann.staticName();
17,769
public static QueryProductListResponse unmarshall(QueryProductListResponse queryProductListResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryProductListResponse.setRequestId(_ctx.stringValue("QueryProductListResponse.RequestId"));<NEW_LINE>queryProductListResponse.setSuccess(_ctx.booleanValue("QueryProductListResponse.Success"));<NEW_LINE>queryProductListResponse.setCode(_ctx.stringValue("QueryProductListResponse.Code"));<NEW_LINE>queryProductListResponse.setErrorMessage(_ctx.stringValue("QueryProductListResponse.ErrorMessage"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCurrentPage(_ctx.integerValue("QueryProductListResponse.Data.CurrentPage"));<NEW_LINE>data.setPageCount(_ctx.integerValue("QueryProductListResponse.Data.PageCount"));<NEW_LINE>data.setPageSize(_ctx.integerValue("QueryProductListResponse.Data.PageSize"));<NEW_LINE>data.setTotal(_ctx.integerValue("QueryProductListResponse.Data.Total"));<NEW_LINE>List<ProductInfo> list <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryProductListResponse.Data.List.Length"); i++) {<NEW_LINE>ProductInfo productInfo = new ProductInfo();<NEW_LINE>productInfo.setGmtCreate(_ctx.longValue("QueryProductListResponse.Data.List[" + i + "].GmtCreate"));<NEW_LINE>productInfo.setDataFormat(_ctx.integerValue("QueryProductListResponse.Data.List[" + i + "].DataFormat"));<NEW_LINE>productInfo.setDescription(_ctx.stringValue("QueryProductListResponse.Data.List[" + i + "].Description"));<NEW_LINE>productInfo.setDeviceCount(_ctx.integerValue("QueryProductListResponse.Data.List[" + i + "].DeviceCount"));<NEW_LINE>productInfo.setNodeType(_ctx.integerValue("QueryProductListResponse.Data.List[" + i + "].NodeType"));<NEW_LINE>productInfo.setProductKey(_ctx.stringValue("QueryProductListResponse.Data.List[" + i + "].ProductKey"));<NEW_LINE>productInfo.setProductName(_ctx.stringValue("QueryProductListResponse.Data.List[" + i + "].ProductName"));<NEW_LINE>productInfo.setAuthType(_ctx.stringValue("QueryProductListResponse.Data.List[" + i + "].AuthType"));<NEW_LINE>list.add(productInfo);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>queryProductListResponse.setData(data);<NEW_LINE>return queryProductListResponse;<NEW_LINE>}
= new ArrayList<ProductInfo>();
299,659
private void processMipsOptions(ElfLoadHelper elfLoadHelper, Address mipsOptionsAddr) {<NEW_LINE>boolean elf64 = elfLoadHelper.getElfHeader().is64Bit();<NEW_LINE>String prefix = elf64 ? "Elf64" : "Elf32";<NEW_LINE>EnumDataType odkType = new EnumDataType(prefix + "_MipsOptionKind", 1);<NEW_LINE>odkType.add("ODK_NULL", ODK_NULL);<NEW_LINE>odkType.add("ODK_REGINFO", ODK_REGINFO);<NEW_LINE>odkType.add("ODK_EXCEPTIONS", ODK_EXCEPTIONS);<NEW_LINE>odkType.add("ODK_PAD", ODK_PAD);<NEW_LINE>odkType.add("ODK_HWPATCH", ODK_HWPATCH);<NEW_LINE><MASK><NEW_LINE>odkType.add("ODK_TAGS", ODK_TAGS);<NEW_LINE>odkType.add("ODK_HWAND", ODK_HWAND);<NEW_LINE>odkType.add("ODK_HWOR", ODK_HWOR);<NEW_LINE>odkType.add("ODK_GP_GROUP", ODK_GP_GROUP);<NEW_LINE>odkType.add("ODK_IDENT", ODK_IDENT);<NEW_LINE>odkType.add("ODK_PAGESIZE", ODK_PAGESIZE);<NEW_LINE>Structure odkHeader = new StructureDataType(new CategoryPath("/ELF"), prefix + "_MipsOptionHeader", 0);<NEW_LINE>odkHeader.add(odkType, "kind", null);<NEW_LINE>odkHeader.add(ByteDataType.dataType, "size", null);<NEW_LINE>odkHeader.add(WordDataType.dataType, "section", null);<NEW_LINE>odkHeader.add(DWordDataType.dataType, "info", null);<NEW_LINE>Memory memory = elfLoadHelper.getProgram().getMemory();<NEW_LINE>long limit = 0;<NEW_LINE>MemoryBlock block = memory.getBlock(mipsOptionsAddr);<NEW_LINE>if (block != null) {<NEW_LINE>limit = block.getEnd().subtract(mipsOptionsAddr) + 1;<NEW_LINE>}<NEW_LINE>Address nextOptionAddr = mipsOptionsAddr;<NEW_LINE>int optionDataSize = 0;<NEW_LINE>try {<NEW_LINE>while (limit >= odkHeader.getLength()) {<NEW_LINE>nextOptionAddr = nextOptionAddr.add(optionDataSize);<NEW_LINE>byte kind = memory.getByte(nextOptionAddr);<NEW_LINE>if (kind == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Data odkData = elfLoadHelper.createData(nextOptionAddr, odkHeader);<NEW_LINE>if (odkData == null) {<NEW_LINE>throw new MemoryAccessException();<NEW_LINE>}<NEW_LINE>int size = (memory.getByte(nextOptionAddr.next()) & 0xff) - odkData.getLength();<NEW_LINE>optionDataSize = size + (size % 8);<NEW_LINE>if (memory.getByte(nextOptionAddr) == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>nextOptionAddr = nextOptionAddr.add(odkData.getLength());<NEW_LINE>switch(kind) {<NEW_LINE>case ODK_REGINFO:<NEW_LINE>processMipsRegInfo(elfLoadHelper, nextOptionAddr);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>if (optionDataSize > 0) {<NEW_LINE>// consume unprocessed option description bytes<NEW_LINE>elfLoadHelper.createData(nextOptionAddr, new ArrayDataType(ByteDataType.dataType, optionDataSize, 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>limit -= odkHeader.getLength() + optionDataSize;<NEW_LINE>}<NEW_LINE>} catch (AddressOutOfBoundsException | MemoryAccessException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}
odkType.add("ODK_FILL", ODK_FILL);
549,648
public void handle(final RequestContext context) {<NEW_LINE>final Request request = context.getRequest();<NEW_LINE>final JSONObject requestJSONObject = context.requestJSON();<NEW_LINE>request.setAttribute(Keys.REQUEST, requestJSONObject);<NEW_LINE>final JSONObject currentUser = Sessions.getUser();<NEW_LINE>if (System.currentTimeMillis() - currentUser.optLong(UserExt.USER_LATEST_CMT_TIME) < Symphonys.MIN_STEP_CHAT_TIME && !Role.ROLE_ID_C_ADMIN.equals(currentUser.optString(User.USER_ROLE))) {<NEW_LINE>context.renderJSON(new JSONObject().put(Keys.MSG, langPropsService.get("tooFrequentCmtLabel")));<NEW_LINE>context.abort();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String content = requestJSONObject.optString(Common.CONTENT);<NEW_LINE>content = StringUtils.trim(content);<NEW_LINE>if (StringUtils.isBlank(content) || content.length() > 4096) {<NEW_LINE>context.renderJSON(new JSONObject().put(Keys.MSG, langPropsService.get("commentErrorLabel")));<NEW_LINE>context.abort();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (optionQueryService.containReservedWord(content)) {<NEW_LINE>context.renderJSON(new JSONObject().put(Keys.MSG, langPropsService.get("contentContainReservedWordLabel")));<NEW_LINE>context.abort();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>requestJSONObject.<MASK><NEW_LINE>context.handle();<NEW_LINE>}
put(Common.CONTENT, content);
1,589,441
// test entry point only<NEW_LINE>@FFDCIgnore(XMLStreamException.class)<NEW_LINE>public ConfigElement parseConfigElement(Reader reader) throws ConfigParserException {<NEW_LINE>behaviorStack.add(MergeBehavior.MERGE);<NEW_LINE>docLocationStack.add("Test Server");<NEW_LINE>DepthAwareXMLStreamReader parser = null;<NEW_LINE>try {<NEW_LINE>parser = new DepthAwareXMLStreamReader(getXMLInputFactory().createXMLStreamReader(reader));<NEW_LINE>ConfigElement configElement = null;<NEW_LINE>int depth = parser.getDepth();<NEW_LINE>while (parser.hasNext(depth)) {<NEW_LINE>int event = parser.next();<NEW_LINE>if (event == XMLStreamConstants.START_ELEMENT) {<NEW_LINE>configElement = parseConfigElement(parser, parser.getLocalName(), <MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>parser.close();<NEW_LINE>return configElement;<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>throw new ConfigParserException(ex);<NEW_LINE>} catch (XMLStreamException e) {<NEW_LINE>throw new ConfigParserException(e);<NEW_LINE>}<NEW_LINE>}
null, null, null, false);
578,949
void handle(SyncVolumeSizeOnPrimaryStorageMsg msg, String hostUuid, final ReturnValueCompletion<SyncVolumeSizeOnPrimaryStorageReply> completion) {<NEW_LINE>final SyncVolumeSizeOnPrimaryStorageReply reply = new SyncVolumeSizeOnPrimaryStorageReply();<NEW_LINE>GetVolumeSizeCmd cmd = new GetVolumeSizeCmd();<NEW_LINE>cmd.installPath = msg.getInstallPath();<NEW_LINE>cmd.volumeUuid = msg.getVolumeUuid();<NEW_LINE>cmd.storagePath = Q.New(PrimaryStorageVO.class).eq(PrimaryStorageVO_.uuid, msg.getPrimaryStorageUuid()).select(PrimaryStorageVO_.url).findValue();<NEW_LINE><MASK><NEW_LINE>sender.send(cmd, GET_VOLUME_SIZE, new KvmCommandFailureChecker() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ErrorCode getError(KvmResponseWrapper wrapper) {<NEW_LINE>GetVolumeSizeRsp rsp = wrapper.getResponse(GetVolumeSizeRsp.class);<NEW_LINE>return rsp.isSuccess() ? null : operr("operation error, because:%s", rsp.getError());<NEW_LINE>}<NEW_LINE>}, new ReturnValueCompletion<KvmResponseWrapper>(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(KvmResponseWrapper returnValue) {<NEW_LINE>GetVolumeSizeRsp rsp = returnValue.getResponse(GetVolumeSizeRsp.class);<NEW_LINE>reply.setActualSize(rsp.actualSize);<NEW_LINE>reply.setSize(rsp.size);<NEW_LINE>completion.success(reply);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>completion.fail(errorCode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
KvmCommandSender sender = new KvmCommandSender(hostUuid);
261,537
public GetContentModerationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetContentModerationResult getContentModerationResult = new GetContentModerationResult();<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("JobStatus")) {<NEW_LINE>getContentModerationResult.setJobStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("StatusMessage")) {<NEW_LINE>getContentModerationResult.setStatusMessage(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("VideoMetadata")) {<NEW_LINE>getContentModerationResult.setVideoMetadata(VideoMetadataJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else if (name.equals("ModerationLabels")) {<NEW_LINE>getContentModerationResult.setModerationLabels(new ListUnmarshaller<ContentModerationDetection>(ContentModerationDetectionJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else if (name.equals("NextToken")) {<NEW_LINE>getContentModerationResult.setNextToken(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("ModerationModelVersion")) {<NEW_LINE>getContentModerationResult.setModerationModelVersion(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return getContentModerationResult;<NEW_LINE>}
().unmarshall(context));
1,549,064
/*-[<NEW_LINE>#pragma clang diagnostic push<NEW_LINE>#pragma clang diagnostic ignored "-Wunused-function"<NEW_LINE>static LibcoreIoStructStat *makeStructStat(const struct stat *sb) {<NEW_LINE>return AUTORELEASE([[LibcoreIoStructStat alloc]<NEW_LINE>initWithLong:sb->st_dev<NEW_LINE>withLong:sb->st_ino<NEW_LINE>withInt:sb->st_mode<NEW_LINE>withLong:sb->st_nlink<NEW_LINE>withInt:sb->st_uid<NEW_LINE>withInt:sb->st_gid<NEW_LINE>withLong:sb->st_rdev<NEW_LINE>withLong:sb->st_size<NEW_LINE>withLong:sb->st_atime<NEW_LINE>withLong:sb->st_mtime<NEW_LINE>withLong:sb->st_ctime<NEW_LINE>withLong:sb->st_blksize<NEW_LINE>withLong:sb->st_blocks]);<NEW_LINE>}<NEW_LINE><NEW_LINE>static LibcoreIoStructStatVfs *makeStructStatVfs(const struct statvfs *sb) {<NEW_LINE>return AUTORELEASE([[LibcoreIoStructStatVfs alloc]<NEW_LINE>initWithLong:(long long)sb->f_bsize<NEW_LINE>withLong:(long long)sb->f_frsize<NEW_LINE>withLong:(long long)sb->f_blocks<NEW_LINE>withLong:(long long)sb->f_bfree<NEW_LINE>withLong:(long long)sb->f_bavail<NEW_LINE>withLong:(long long)sb->f_files<NEW_LINE>withLong:(long long)sb->f_ffree<NEW_LINE>withLong:(long long)sb->f_favail<NEW_LINE>withLong:(long long)sb->f_fsid<NEW_LINE>withLong:(long long)sb->f_flag<NEW_LINE>withLong:255LL]); // __DARWIN_MAXNAMLEN<NEW_LINE>}<NEW_LINE><NEW_LINE>static LibcoreIoStructUtsname *makeStructUtsname(const struct utsname *buf) {<NEW_LINE>NSString *sysname = [NSString stringWithUTF8String:buf->sysname];<NEW_LINE>NSString *nodename = [NSString stringWithUTF8String:buf->nodename];<NEW_LINE>NSString *release = <MASK><NEW_LINE>NSString *version = [NSString stringWithUTF8String:buf->version];<NEW_LINE>NSString *machine = [NSString stringWithUTF8String:buf->machine];<NEW_LINE>return AUTORELEASE([[LibcoreIoStructUtsname alloc] initWithNSString:sysname<NEW_LINE>withNSString:nodename<NEW_LINE>withNSString:release<NEW_LINE>withNSString:version<NEW_LINE>withNSString:machine]);<NEW_LINE>}<NEW_LINE><NEW_LINE>static id doStat(NSString *path, BOOL isLstat) {<NEW_LINE>if (!path) {<NEW_LINE>return nil;<NEW_LINE>}<NEW_LINE>const char* cpath = absolutePath(path);<NEW_LINE>struct stat sb;<NEW_LINE>int rc = isLstat ? TEMP_FAILURE_RETRY(lstat(cpath, &sb))<NEW_LINE>: TEMP_FAILURE_RETRY(stat(cpath, &sb));<NEW_LINE>if (rc == -1) {<NEW_LINE>LibcoreIoPosix_throwErrnoExceptionWithNSString_withInt_(<NEW_LINE>(isLstat ? @"lstat" : @"stat"), errno);<NEW_LINE>}<NEW_LINE>return makeStructStat(&sb);<NEW_LINE>}<NEW_LINE><NEW_LINE>BOOL setBlocking(int fd, bool blocking) {<NEW_LINE>int flags = fcntl(fd, F_GETFL);<NEW_LINE>if (flags == -1) {<NEW_LINE>return NO;<NEW_LINE>}<NEW_LINE><NEW_LINE>if (!blocking) {<NEW_LINE>flags |= O_NONBLOCK;<NEW_LINE>} else {<NEW_LINE>flags &= ~O_NONBLOCK;<NEW_LINE>}<NEW_LINE><NEW_LINE>int rc = fcntl(fd, F_SETFL, flags);<NEW_LINE>return (rc != -1);<NEW_LINE>}<NEW_LINE><NEW_LINE>const char *absolutePath(NSString *path) {<NEW_LINE>if ([path length] == 0) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>if ([path characterAtIndex:0] != '/') {<NEW_LINE>JavaIoFile *f = [[JavaIoFile alloc] initWithNSString:path];<NEW_LINE>path = [f getAbsolutePath];<NEW_LINE>RELEASE_(f);<NEW_LINE>}<NEW_LINE>return [path fileSystemRepresentation];<NEW_LINE>}<NEW_LINE>#pragma clang diagnostic pop<NEW_LINE>]-*/<NEW_LINE>static void throwErrnoException(String message, int errorCode) throws ErrnoException {<NEW_LINE>throw new ErrnoException(message, errorCode);<NEW_LINE>}
[NSString stringWithUTF8String:buf->release];
1,317,336
private RequestContext convertRequest(Query query, GroupingRequest req, int requestId, Map<Integer, Grouping> map) {<NEW_LINE>RequestBuilder builder = new RequestBuilder(requestId);<NEW_LINE>builder.setRootOperation(req.getRootOperation());<NEW_LINE>builder.setDefaultSummaryName(query.getPresentation().getSummary());<NEW_LINE>builder.setTimeZone(req.getTimeZone());<NEW_LINE>builder.addContinuations(req.continuations());<NEW_LINE>builder.setDefaultMaxGroups(req.defaultMaxGroups().orElse(DEFAULT_MAX_GROUPS));<NEW_LINE>builder.setDefaultMaxHits(req.defaultMaxHits().orElse(DEFAULT_MAX_HITS));<NEW_LINE>builder.setGlobalMaxGroups(req.globalMaxGroups().orElse(DEFAULT_GLOBAL_MAX_GROUPS));<NEW_LINE>builder.setDefaultPrecisionFactor(req.defaultPrecisionFactor().orElse(DEFAULT_PRECISION_FACTOR));<NEW_LINE>builder.build();<NEW_LINE>RequestContext ctx = new RequestContext(req, builder.getTransform());<NEW_LINE>List<Grouping<MASK><NEW_LINE>for (Grouping grp : grpList) {<NEW_LINE>int grpId = map.size();<NEW_LINE>grp.setId(grpId);<NEW_LINE>map.put(grpId, grp);<NEW_LINE>ctx.idList.add(grpId);<NEW_LINE>}<NEW_LINE>return ctx;<NEW_LINE>}
> grpList = builder.getRequestList();
1,436,912
private TopologyAPI.Topology cloneWithNewNumContainers(TopologyAPI.Topology initialTopology, int numStreamManagers) {<NEW_LINE>TopologyAPI.Topology.Builder topologyBuilder = TopologyAPI.Topology.newBuilder(initialTopology);<NEW_LINE>TopologyAPI.Config.Builder configBuilder = TopologyAPI.Config.newBuilder();<NEW_LINE>for (TopologyAPI.Config.KeyValue keyValue : initialTopology.getTopologyConfig().getKvsList()) {<NEW_LINE>// override TOPOLOGY_STMGRS value once we find it<NEW_LINE>if (org.apache.heron.api.Config.TOPOLOGY_STMGRS.equals(keyValue.getKey())) {<NEW_LINE>TopologyAPI.Config.KeyValue.Builder kvBuilder = TopologyAPI.Config.KeyValue.newBuilder();<NEW_LINE>kvBuilder.setKey(keyValue.getKey());<NEW_LINE>kvBuilder.setValue(Integer.toString(numStreamManagers));<NEW_LINE>configBuilder.<MASK><NEW_LINE>} else {<NEW_LINE>configBuilder.addKvs(keyValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return topologyBuilder.setTopologyConfig(configBuilder).build();<NEW_LINE>}
addKvs(kvBuilder.build());
714,143
// begin PK10057<NEW_LINE>public static ServletErrorReport constructErrorReport(Throwable th, String path) {<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {<NEW_LINE>logger.logp(Level.FINE, CLASS_NAME, "constructErrorReport", "constructing error report for path -->" + path + " Throwable -->" + th);<NEW_LINE>}<NEW_LINE>WebAppErrorReport r = new WebAppErrorReport(th);<NEW_LINE>r.setTargetServletName(path);<NEW_LINE>Throwable rootCause = th;<NEW_LINE>while (rootCause.getCause() != null) {<NEW_LINE>rootCause = rootCause.getCause();<NEW_LINE>}<NEW_LINE>if (WCCustomProperties.SERVLET_30_FNF_BEHAVIOR && rootCause instanceof IncludeFileNotFoundException) {<NEW_LINE>r.setErrorCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);<NEW_LINE>} else if (rootCause instanceof FileNotFoundException) {<NEW_LINE>r.setErrorCode(HttpServletResponse.SC_NOT_FOUND);<NEW_LINE>} else if (rootCause instanceof UnavailableException) {<NEW_LINE>UnavailableException ue = (UnavailableException) rootCause;<NEW_LINE>if (ue.isPermanent()) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>r.setErrorCode(HttpServletResponse.SC_SERVICE_UNAVAILABLE);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>r.setErrorCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);<NEW_LINE>}<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {<NEW_LINE>logger.logp(Level.FINE, CLASS_NAME, "constructErrorReport", "returning new servlet error report");<NEW_LINE>}<NEW_LINE>return r;<NEW_LINE>}
r.setErrorCode(HttpServletResponse.SC_NOT_FOUND);
330,105
private boolean handleDownwardOutput(boolean simulate) {<NEW_LINE>BlockState blockState = getBlockState();<NEW_LINE>ChuteTileEntity targetChute = getTargetChute(blockState);<NEW_LINE>Direction direction = AbstractChuteBlock.getChuteFacing(blockState);<NEW_LINE>if (level == null || direction == null || !this.canOutputItems())<NEW_LINE>return false;<NEW_LINE>if (!capBelow.isPresent())<NEW_LINE>capBelow = grabCapability(Direction.DOWN);<NEW_LINE>if (capBelow.isPresent()) {<NEW_LINE>if (level.isClientSide && !isVirtual())<NEW_LINE>return false;<NEW_LINE>ItemStack remainder = ItemHandlerHelper.insertItemStacked(capBelow.orElse(null), item, simulate);<NEW_LINE>ItemStack held = getItem();<NEW_LINE>if (!simulate)<NEW_LINE>setItem(remainder, itemPosition.get(0));<NEW_LINE>if (remainder.getCount() != held.getCount())<NEW_LINE>return true;<NEW_LINE>if (direction == Direction.DOWN)<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (targetChute != null) {<NEW_LINE>boolean canInsert = targetChute.canAcceptItem(item);<NEW_LINE>if (!simulate && canInsert) {<NEW_LINE>targetChute.setItem(item, direction == Direction.DOWN ? 1 : .51f);<NEW_LINE>setItem(ItemStack.EMPTY);<NEW_LINE>}<NEW_LINE>return canInsert;<NEW_LINE>}<NEW_LINE>// Diagonal chutes cannot drop items<NEW_LINE>if (direction.getAxis().isHorizontal())<NEW_LINE>return false;<NEW_LINE>if (FunnelBlock.getFunnelFacing(level.getBlockState(worldPosition.below())) == Direction.DOWN)<NEW_LINE>return false;<NEW_LINE>if (Block.canSupportRigidBlock(level, worldPosition.below()))<NEW_LINE>return false;<NEW_LINE>if (!simulate) {<NEW_LINE>Vec3 dropVec = VecHelper.getCenterOf(worldPosition).add(0<MASK><NEW_LINE>ItemEntity dropped = new ItemEntity(level, dropVec.x, dropVec.y, dropVec.z, item.copy());<NEW_LINE>dropped.setDefaultPickUpDelay();<NEW_LINE>dropped.setDeltaMovement(0, -.25f, 0);<NEW_LINE>level.addFreshEntity(dropped);<NEW_LINE>setItem(ItemStack.EMPTY);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
, -12 / 16f, 0);
1,813,274
// Create shortcut as response for ACTION_CREATE_SHORTCUT intent.<NEW_LINE>private void respondToShortcutRequest(Uri uri) {<NEW_LINE>// This is Intent that will be sent when user execute our shortcut on<NEW_LINE>// homescreen. Set our app as target Context. Set Main activity as<NEW_LINE>// target class. Add any parameter as data.<NEW_LINE>Intent shortcutIntent = new Intent(getApplicationContext(), PpssppActivity.class);<NEW_LINE>shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);<NEW_LINE>Log.i(TAG, "Shortcut URI: " + uri.toString());<NEW_LINE>shortcutIntent.setData(uri);<NEW_LINE>String path = uri.toString();<NEW_LINE>shortcutIntent.putExtra(PpssppActivity.SHORTCUT_EXTRA_KEY, path);<NEW_LINE>// We can't call C++ functions here that use storage APIs since there's no<NEW_LINE>// NativeActivity and all the AndroidStorage methods are methods on that.<NEW_LINE>// Should probably change that. In the meantime, let's just process the URI to make<NEW_LINE>// up a name.<NEW_LINE>String name = "PPSSPP Game";<NEW_LINE>String pathStr = "PPSSPP Game";<NEW_LINE>if (path.startsWith("content://")) {<NEW_LINE>String[] segments = path.split("/");<NEW_LINE>try {<NEW_LINE>pathStr = java.net.URLDecoder.decode(segments[segments.length - 1], StandardCharsets.UTF_8.name());<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.i(TAG, "Exception getting name: " + e);<NEW_LINE>}<NEW_LINE>} else if (path.startsWith("file:///")) {<NEW_LINE>try {<NEW_LINE>pathStr = java.net.URLDecoder.decode(path.substring(7), <MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.i(TAG, "Exception getting name: " + e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>pathStr = path;<NEW_LINE>}<NEW_LINE>String[] pathSegments = pathStr.split("/");<NEW_LINE>name = pathSegments[pathSegments.length - 1];<NEW_LINE>Log.i(TAG, "Game name: " + name + " : Creating shortcut to " + uri.toString());<NEW_LINE>// This is Intent that will be returned by this method, as response to<NEW_LINE>// ACTION_CREATE_SHORTCUT. Wrap shortcut intent inside this intent.<NEW_LINE>Intent responseIntent = new Intent();<NEW_LINE>responseIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);<NEW_LINE>responseIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, name);<NEW_LINE>ShortcutIconResource iconResource = ShortcutIconResource.fromContext(this, R.drawable.ic_launcher);<NEW_LINE>responseIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);<NEW_LINE>setResult(RESULT_OK, responseIntent);<NEW_LINE>// Must call finish for result to be returned immediately<NEW_LINE>finish();<NEW_LINE>}
StandardCharsets.UTF_8.name());
29,576
public DynamicTableSink createDynamicTableSink(Context context) {<NEW_LINE>final Map<String, String> options = context.getCatalogTable().getOptions();<NEW_LINE>String serializedRichFunction = null;<NEW_LINE>if (options.containsKey(CONNECTOR_RICH_SINK_FUNCTION)) {<NEW_LINE>serializedRichFunction = options.get(CONNECTOR_RICH_SINK_FUNCTION);<NEW_LINE>}<NEW_LINE>if (serializedRichFunction == null) {<NEW_LINE>return new LogTableStreamSink(context.getCatalogTable().getResolvedSchema());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>RichSinkFunction<RowData> richSinkFunction = <MASK><NEW_LINE>return new LogTableStreamSink(context.getCatalogTable().getResolvedSchema(), richSinkFunction);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Fail to create LogTableStreamSink", e);<NEW_LINE>}<NEW_LINE>return new LogTableStreamSink();<NEW_LINE>}
LogTable.RichSinkFunctionDeserializer.deserialize(serializedRichFunction);
1,437,342
private String prepareMessage() {<NEW_LINE>StringBuilder builder = new StringBuilder("<html>");<NEW_LINE>LayoutCodeInfoCollector notifications = myProcessor.getInfoCollector();<NEW_LINE>LOG.assertTrue(notifications != null);<NEW_LINE>if (notifications.isEmpty() && !myNoChangesDetected) {<NEW_LINE>if (myProcessChangesTextOnly) {<NEW_LINE>builder.append("No lines changed: changes since last revision are already properly formatted").append("<br>");<NEW_LINE>} else {<NEW_LINE>builder.append("No lines changed: code is already properly formatted").append("<br>");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (notifications.hasReformatOrRearrangeNotification()) {<NEW_LINE>String reformatInfo = notifications.getReformatCodeNotification();<NEW_LINE>String rearrangeInfo = notifications.getRearrangeCodeNotification();<NEW_LINE>builder.append(joinWithCommaAndCapitalize(reformatInfo, rearrangeInfo));<NEW_LINE>if (myProcessChangesTextOnly) {<NEW_LINE>builder.append(" in changes since last revision");<NEW_LINE>}<NEW_LINE>builder.append("<br>");<NEW_LINE>} else if (myNoChangesDetected) {<NEW_LINE>builder.append("No lines changed: no changes since last revision").append("<br>");<NEW_LINE>}<NEW_LINE>String optimizeImportsNotification = notifications.getOptimizeImportsNotification();<NEW_LINE>if (optimizeImportsNotification != null) {<NEW_LINE>builder.append(StringUtil.capitalize(optimizeImportsNotification)).append("<br>");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String shortcutText = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction("ShowReformatFileDialog"));<NEW_LINE>String color = <MASK><NEW_LINE>builder.append("<span style='color:#").append(color).append("'>").append("<a href=''>Show</a> reformat dialog: ").append(shortcutText).append("</span>").append("</html>");<NEW_LINE>return builder.toString();<NEW_LINE>}
ColorUtil.toHex(JBColor.gray);
1,727,810
public void testServletSubmitsBeanToManagedExecutor() throws Exception {<NEW_LINE>appScopedBean.setCharacter('c');<NEW_LINE>requestScopedBean.setNumber(2);<NEW_LINE>sessionScopedBean.setText("This is some text");<NEW_LINE>singletonScopedBean.put("Key_TaskBean", "value");<NEW_LINE>Future<String> future = executor.submit(taskBean);<NEW_LINE>try {<NEW_LINE>String result = future.get();<NEW_LINE>if (!"value1".equals(result))<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>future.cancel(true);<NEW_LINE>}<NEW_LINE>char ch = appScopedBean.getCharacter();<NEW_LINE>if (ch != 'C')<NEW_LINE>throw new Exception("Character should have been capitalized by task. Instead: " + ch);<NEW_LINE>boolean bool = dependentScopedBean.getBoolean();<NEW_LINE>if (bool)<NEW_LINE>throw new Exception("Value on @Dependent bean injected into servlet should not be impacted by @Dependent bean injected into TaskBean.");<NEW_LINE>int num = requestScopedBean.getNumber();<NEW_LINE>if (num != 2)<NEW_LINE>throw new Exception("Unexpected number after running task: " + num);<NEW_LINE>String text = sessionScopedBean.getText();<NEW_LINE>if (!"This is some text".equals(text))<NEW_LINE>throw new Exception("Unexpected text after running task: " + text);<NEW_LINE>Object value = singletonScopedBean.get("Key_TaskBean");<NEW_LINE>if (!"value and more text".equals(value))<NEW_LINE>throw new Exception("Unexpected value in map after running task: " + value);<NEW_LINE>}
throw new Exception("Unexpected result: " + result);
14,399
public void aesEncrypt(final byte[] key, InputStream in, OutputStream out, final byte[] iv, boolean useMac) throws CryptoError, IOException {<NEW_LINE>InputStream encrypted = null;<NEW_LINE>try {<NEW_LINE>Cipher cipher = Cipher.getInstance(AES_MODE_PADDING);<NEW_LINE>IvParameterSpec params = new IvParameterSpec(iv);<NEW_LINE>SubKeys subKeys = getSubKeys(bytesToKey(key), useMac);<NEW_LINE>cipher.init(Cipher.ENCRYPT_MODE, subKeys.cKey, params);<NEW_LINE><MASK><NEW_LINE>ByteArrayOutputStream tempOut = new ByteArrayOutputStream();<NEW_LINE>tempOut.write(iv);<NEW_LINE>IOUtils.copy(encrypted, tempOut);<NEW_LINE>if (useMac) {<NEW_LINE>byte[] data = tempOut.toByteArray();<NEW_LINE>out.write(new byte[] { 1 });<NEW_LINE>out.write(data);<NEW_LINE>byte[] macBytes = hmac256(subKeys.mKey, data);<NEW_LINE>out.write(macBytes);<NEW_LINE>} else {<NEW_LINE>out.write(tempOut.toByteArray());<NEW_LINE>}<NEW_LINE>} catch (InvalidKeyException e) {<NEW_LINE>throw new CryptoError(e);<NEW_LINE>} catch (NoSuchPaddingException | InvalidAlgorithmParameterException | NoSuchAlgorithmException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} finally {<NEW_LINE>IOUtils.closeQuietly(in);<NEW_LINE>IOUtils.closeQuietly(encrypted);<NEW_LINE>IOUtils.closeQuietly(out);<NEW_LINE>}<NEW_LINE>}
encrypted = getCipherInputStream(in, cipher);
644,480
final PutRepositoryPermissionsPolicyResult executePutRepositoryPermissionsPolicy(PutRepositoryPermissionsPolicyRequest putRepositoryPermissionsPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putRepositoryPermissionsPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutRepositoryPermissionsPolicyRequest> request = null;<NEW_LINE>Response<PutRepositoryPermissionsPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new PutRepositoryPermissionsPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putRepositoryPermissionsPolicyRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "codeartifact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutRepositoryPermissionsPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutRepositoryPermissionsPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutRepositoryPermissionsPolicyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);