idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
76,452
public void marshall(ConnectPeerSummary connectPeerSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (connectPeerSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(connectPeerSummary.getCoreNetworkId(), CORENETWORKID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(connectPeerSummary.getConnectPeerId(), CONNECTPEERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectPeerSummary.getEdgeLocation(), EDGELOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectPeerSummary.getConnectPeerState(), CONNECTPEERSTATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectPeerSummary.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectPeerSummary.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
connectPeerSummary.getConnectAttachmentId(), CONNECTATTACHMENTID_BINDING);
1,760,443
public static String decrypt(byte[] headerSaltAndCipherText, String password) {<NEW_LINE>try {<NEW_LINE>// --- extract salt & encrypted ---<NEW_LINE>// header is "Salted__", ASCII encoded, if salt is being used (the<NEW_LINE>// default)<NEW_LINE>byte[] salt = copyOfRange(headerSaltAndCipherText, SALT_OFFSET, SALT_OFFSET + SALT_SIZE);<NEW_LINE>byte[] encrypted = copyOfRange(headerSaltAndCipherText, CIPHERTEXT_OFFSET, headerSaltAndCipherText.length);<NEW_LINE>// --- specify cipher and digest for EVP_BytesToKey method ---<NEW_LINE>Cipher aesCBC = Cipher.getInstance("AES/CBC/PKCS5Padding");<NEW_LINE>MessageDigest md5 = MessageDigest.getInstance("MD5");<NEW_LINE>// --- create key and IV ---<NEW_LINE>// the IV is useless, OpenSSL might as well have use zero's<NEW_LINE>final byte[][] keyAndIV = EVP_BytesToKey(KEY_SIZE_BITS / Byte.SIZE, aesCBC.getBlockSize(), md5, salt, password.getBytes("ASCII"), ITERATIONS);<NEW_LINE>SecretKeySpec key = new SecretKeySpec(keyAndIV[INDEX_KEY], "AES");<NEW_LINE>IvParameterSpec iv = new IvParameterSpec(keyAndIV[INDEX_IV]);<NEW_LINE>// --- initialize cipher instance and decrypt ---<NEW_LINE>aesCBC.init(Cipher.DECRYPT_MODE, key, iv);<NEW_LINE>byte[] decrypted = aesCBC.doFinal(encrypted);<NEW_LINE><MASK><NEW_LINE>} catch (BadPaddingException e) {<NEW_LINE>// AKA "something went wrong"<NEW_LINE>throw new IllegalStateException("Bad password, algorithm, mode or padding;" + " no salt, wrong number of iterations or corrupted ciphertext.");<NEW_LINE>} catch (IllegalBlockSizeException e) {<NEW_LINE>throw new IllegalStateException("Bad algorithm, mode or corrupted (resized) ciphertext.");<NEW_LINE>} catch (GeneralSecurityException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>}
return new String(decrypted, "ASCII");
1,635,100
private OutputsInfo outputsInfo(RootInfo rootInfo, IResource res) {<NEW_LINE>try {<NEW_LINE>JavaProject proj = rootInfo == null ? (JavaProject) createElement(res.getProject(), IJavaElement.<MASK><NEW_LINE>if (proj != null) {<NEW_LINE>IPath projectOutput = proj.getOutputLocation();<NEW_LINE>int traverseMode = IGNORE;<NEW_LINE>if (proj.getProject().getFullPath().equals(projectOutput)) {<NEW_LINE>// case of proj==bin==src<NEW_LINE>return new OutputsInfo(new IPath[] { projectOutput }, new int[] { SOURCE }, 1);<NEW_LINE>}<NEW_LINE>IClasspathEntry[] classpath = proj.getResolvedClasspath();<NEW_LINE>IPath[] outputs = new IPath[classpath.length + 1];<NEW_LINE>int[] traverseModes = new int[classpath.length + 1];<NEW_LINE>int outputCount = 1;<NEW_LINE>outputs[0] = projectOutput;<NEW_LINE>traverseModes[0] = traverseMode;<NEW_LINE>for (int i = 0, length = classpath.length; i < length; i++) {<NEW_LINE>IClasspathEntry entry = classpath[i];<NEW_LINE>IPath entryPath = entry.getPath();<NEW_LINE>IPath output = entry.getOutputLocation();<NEW_LINE>if (output != null) {<NEW_LINE>outputs[outputCount] = output;<NEW_LINE>// check case of src==bin<NEW_LINE>if (entryPath.equals(output)) {<NEW_LINE>traverseModes[outputCount++] = (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) ? SOURCE : BINARY;<NEW_LINE>} else {<NEW_LINE>traverseModes[outputCount++] = IGNORE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// check case of src==bin<NEW_LINE>if (entryPath.equals(projectOutput)) {<NEW_LINE>traverseModes[0] = (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) ? SOURCE : BINARY;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new OutputsInfo(outputs, traverseModes, outputCount);<NEW_LINE>}<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>// java project doesn't exist: ignore<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
JAVA_PROJECT, null) : rootInfo.project;
1,622,180
private void assemble() throws Exception {<NEW_LINE>File tf1 = new File(folder, "T1");<NEW_LINE>File tf2 = new File(folder, "T2");<NEW_LINE>File outFile = null;<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>assembleFinished = false;<NEW_LINE>ArrayList<Segment> list1 = new ArrayList<>();<NEW_LINE>ArrayList<Segment> list2 = new ArrayList<>();<NEW_LINE>for (Segment sc : chunks) {<NEW_LINE>if (sc.getTag().equals("T1")) {<NEW_LINE>list1.add(sc);<NEW_LINE>} else {<NEW_LINE>list2.add(sc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assemblePart(tf1, list1);<NEW_LINE>if (stopFlag) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>assemblePart(tf2, list2);<NEW_LINE>if (stopFlag) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> inputFiles = new ArrayList<>();<NEW_LINE>inputFiles.add(tf1.getAbsolutePath());<NEW_LINE>inputFiles.add(tf2.getAbsolutePath());<NEW_LINE>this.converting = true;<NEW_LINE>outFile = new File(getOutputFolder(), UUID.randomUUID() + "_" + getOutputFileName(true));<NEW_LINE>this.ffmpeg = new FFmpeg(inputFiles, outFile.getAbsolutePath(), this, MediaFormats.getSupportedFormats()[outputFormat], outputFormat == 0);<NEW_LINE>int ret = ffmpeg.convert();<NEW_LINE>Logger.log("FFmpeg exit code: " + ret);<NEW_LINE>if (ret != 0) {<NEW_LINE>throw new IOException("FFmpeg failed");<NEW_LINE>} else {<NEW_LINE>long length = outFile.length();<NEW_LINE>if (length > 0) {<NEW_LINE>this.length = length;<NEW_LINE>}<NEW_LINE>setLastModifiedDate(outFile);<NEW_LINE>}<NEW_LINE>// delete the original file if exists and rename the temp file to original<NEW_LINE>File realFile = new File(getOutputFolder(), getOutputFileName(true));<NEW_LINE>if (realFile.exists()) {<NEW_LINE>realFile.delete();<NEW_LINE>}<NEW_LINE>outFile.renameTo(realFile);<NEW_LINE>assembleFinished = true;<NEW_LINE>} finally {<NEW_LINE>if (!assembleFinished) {<NEW_LINE>tf1.delete();<NEW_LINE>tf2.delete();<NEW_LINE>if (outFile != null) {<NEW_LINE>outFile.delete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
XDMUtils.mkdirs(getOutputFolder());
1,588,939
public com.amazonaws.services.kafka.model.ServiceUnavailableException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.kafka.model.ServiceUnavailableException serviceUnavailableException = new com.amazonaws.services.kafka.model.ServiceUnavailableException(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>if (context.testExpression("invalidParameter", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>serviceUnavailableException.setInvalidParameter(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 serviceUnavailableException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
585,382
private void writeImageBorder(DataOutputStream output, Border border) throws IOException {<NEW_LINE>// Write the number of images can be 2, 3, 8 or 9<NEW_LINE>Image[] images = Accessor.getImages(border);<NEW_LINE>int resourceCount = 0;<NEW_LINE>for (int iter = 0; iter < images.length; iter++) {<NEW_LINE>if (images[iter] != null && findId(images[iter], true) != null) {<NEW_LINE>resourceCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (resourceCount != 2 && resourceCount != 3 && resourceCount != 8 && resourceCount != 9) {<NEW_LINE>System.out.println("Odd resource count for image border: " + resourceCount);<NEW_LINE>resourceCount = 2;<NEW_LINE>}<NEW_LINE>output.writeByte(resourceCount);<NEW_LINE>switch(resourceCount) {<NEW_LINE>case 2:<NEW_LINE>output.writeUTF(findId(images[0], true));<NEW_LINE>output.writeUTF(findId(<MASK><NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>output.writeUTF(findId(images[0], true));<NEW_LINE>output.writeUTF(findId(images[4], true));<NEW_LINE>output.writeUTF(findId(images[8], true));<NEW_LINE>break;<NEW_LINE>case 8:<NEW_LINE>for (int iter = 0; iter < 8; iter++) {<NEW_LINE>output.writeUTF(findId(images[iter], true));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 9:<NEW_LINE>for (int iter = 0; iter < 9; iter++) {<NEW_LINE>output.writeUTF(findId(images[iter], true));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
images[4], true));
918,864
public void putCustomMetadataAttributes(final String tempResourceId, final Map<String, Map<String, Serializable>> customAttributesByField) throws DotDataException {<NEW_LINE>final String metadataBucketName = Config.getStringProperty(METADATA_GROUP_NAME, DOT_METADATA);<NEW_LINE>customAttributesByField.forEach((fieldName, customAttributes) -> {<NEW_LINE>try {<NEW_LINE>final String tempResourcePath = tempResourcePath(tempResourceId);<NEW_LINE>fileStorageAPI.putCustomMetadataAttributes((new FetchMetadataParams.Builder().projectionMapForCache(this::filterNonBasicMetadataFields).cache(() -> tempResourcePath).forceInsert(true).storageKey(new StorageKey.Builder().group(metadataBucketName).path(tempResourcePath).storage(StorageType.FILE_SYSTEM).build())<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(FileMetadataAPIImpl.class, "Error saving custom attributes", e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.build()), customAttributes);
1,853,948
private Item combineItems(Item first, Item second, TermType termType) {<NEW_LINE>if (first instanceof NullItem) {<NEW_LINE>return second;<NEW_LINE>} else if (first instanceof NotItem) {<NEW_LINE>NotItem notItem = (NotItem) first;<NEW_LINE>if (termType == TermType.NOT) {<NEW_LINE>notItem.addNegativeItem(second);<NEW_LINE>} else {<NEW_LINE>Item newPositive = combineItems(notItem.<MASK><NEW_LINE>notItem.setPositiveItem(newPositive);<NEW_LINE>}<NEW_LINE>return notItem;<NEW_LINE>} else if (first instanceof CompositeItem) {<NEW_LINE>CompositeItem composite = (CompositeItem) first;<NEW_LINE>CompositeItem combined = createType(termType);<NEW_LINE>if (combined.getClass().equals(composite.getClass())) {<NEW_LINE>composite.addItem(second);<NEW_LINE>return composite;<NEW_LINE>} else {<NEW_LINE>if (combined instanceof EquivItem) {<NEW_LINE>first = makeEquivCompatible(first);<NEW_LINE>second = makeEquivCompatible(second);<NEW_LINE>}<NEW_LINE>combined.addItem(first);<NEW_LINE>// Also works for nots<NEW_LINE>combined.addItem(second);<NEW_LINE>return combined;<NEW_LINE>}<NEW_LINE>} else if (first instanceof TermItem) {<NEW_LINE>CompositeItem combined = createType(termType);<NEW_LINE>combined.addItem(first);<NEW_LINE>combined.addItem(second);<NEW_LINE>return combined;<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Don't know how to add an item to type " + first.getClass());<NEW_LINE>}<NEW_LINE>}
getPositiveItem(), second, termType);
1,654,812
public static void annotateGraph(Graph graph, Session session) {<NEW_LINE>List<String> variableNames = new ArrayList<>();<NEW_LINE>Map<String, GraphOperation> opMap = new HashMap<>();<NEW_LINE>Iterator<GraphOperation> opItr = graph.operations();<NEW_LINE>while (opItr.hasNext()) {<NEW_LINE>GraphOperation op = opItr.next();<NEW_LINE>if (op.type().equals(VARIABLE_V2)) {<NEW_LINE>variableNames.add(op.name());<NEW_LINE>opMap.put(op.name(), op);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Session.Runner runner = session.runner();<NEW_LINE>for (String s : variableNames) {<NEW_LINE>runner.fetch(s);<NEW_LINE>}<NEW_LINE>List<Tensor> output = runner.run();<NEW_LINE>if (output.size() != variableNames.size()) {<NEW_LINE>closeTensorCollection(output);<NEW_LINE>throw new IllegalStateException("Failed to annotate all requested variables. Requested " + variableNames.size() + ", found " + output.size());<NEW_LINE>}<NEW_LINE>Scope scope = graph.baseScope();<NEW_LINE>for (int i = 0; i < output.size(); i++) {<NEW_LINE>GraphOperationBuilder builder = graph.opBuilder(PLACEHOLDER, generatePlaceholderName(variableNames.get(i)), scope);<NEW_LINE>builder.setAttr(DTYPE, output.get(i).dataType());<NEW_LINE>GraphOperation o = builder.build();<NEW_LINE>builder = graph.opBuilder(ASSIGN_OP, variableNames.get(i) + "/" + ASSIGN_PLACEHOLDER, scope);<NEW_LINE>builder.addInput(opMap.get(variableNames.get(i)).output(0));<NEW_LINE>builder.addInput<MASK><NEW_LINE>builder.build();<NEW_LINE>}<NEW_LINE>closeTensorCollection(output);<NEW_LINE>}
(o.output(0));
1,420,797
public Request<ListStreamProcessorsRequest> marshall(ListStreamProcessorsRequest listStreamProcessorsRequest) {<NEW_LINE>if (listStreamProcessorsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListStreamProcessorsRequest)");<NEW_LINE>}<NEW_LINE>Request<ListStreamProcessorsRequest> request = new DefaultRequest<ListStreamProcessorsRequest>(listStreamProcessorsRequest, "AmazonRekognition");<NEW_LINE>String target = "RekognitionService.ListStreamProcessors";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (listStreamProcessorsRequest.getNextToken() != null) {<NEW_LINE>String nextToken = listStreamProcessorsRequest.getNextToken();<NEW_LINE>jsonWriter.name("NextToken");<NEW_LINE>jsonWriter.value(nextToken);<NEW_LINE>}<NEW_LINE>if (listStreamProcessorsRequest.getMaxResults() != null) {<NEW_LINE>Integer maxResults = listStreamProcessorsRequest.getMaxResults();<NEW_LINE>jsonWriter.name("MaxResults");<NEW_LINE>jsonWriter.value(maxResults);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] <MASK><NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
content = snippet.getBytes(UTF8);
569,234
public IotAnalyticsAction unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>IotAnalyticsAction iotAnalyticsAction = new IotAnalyticsAction();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (name.equals("channelArn")) {<NEW_LINE>iotAnalyticsAction.setChannelArn(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("channelName")) {<NEW_LINE>iotAnalyticsAction.setChannelName(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("batchMode")) {<NEW_LINE>iotAnalyticsAction.setBatchMode(BooleanJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("roleArn")) {<NEW_LINE>iotAnalyticsAction.setRoleArn(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return iotAnalyticsAction;<NEW_LINE>}
String name = reader.nextName();
1,137,757
public static void main(String[] args) throws Exception {<NEW_LINE>String hyperlinkStyle = "Hyperlink";<NEW_LINE>// Convenient to read from .xml file,<NEW_LINE>// so it is easy to manually edit it (ie without having to unzip etc etc)<NEW_LINE>String inputfilepath = System.getProperty("user.dir") + "/sample-docs/databinding/picture-bind.docx";<NEW_LINE>// Load the Package<NEW_LINE>WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new java.io.File(inputfilepath));<NEW_LINE>// We want to save images as they're created, so define our saver<NEW_LINE>File baseDir = new File(System.getProperty("user.dir") + "/OUT_unzipped");<NEW_LINE>// TODO: directory should be empty, since old images won't get overwritten<NEW_LINE>baseDir.mkdir();<NEW_LINE>UnzippedPartStore ups = new UnzippedPartStore(baseDir);<NEW_LINE>Save saver = new Save(wordMLPackage, ups);<NEW_LINE>// Apply the bindings<NEW_LINE>// if (hyperlinkStyle!=null) {<NEW_LINE>// BindingHandler.getHyperlinkResolver().setHyperlinkStyle(hyperlinkStyle);<NEW_LINE>// }<NEW_LINE><MASK><NEW_LINE>bh.applyBindings(wordMLPackage.getMainDocumentPart());<NEW_LINE>// If you inspect the output, you should see your data in 2 places:<NEW_LINE>// 1. the custom xml part<NEW_LINE>// 2. (more importantly) the main document part<NEW_LINE>System.out.println(XmlUtils.marshaltoString(wordMLPackage.getMainDocumentPart().getJaxbElement(), true, true));<NEW_LINE>// Strip content controls<NEW_LINE>// RemovalHandler rh = new RemovalHandler(); // NB: this only removes if OpenDoPE tags are present (they aren't in binding-simple.docx)<NEW_LINE>// wordMLPackage.save(new java.io.File(outputfilepath) );<NEW_LINE>saver.save(null);<NEW_LINE>// now zip up that dir, and rename to docx.<NEW_LINE>}
BindingHandler bh = new BindingHandler(wordMLPackage);
1,151,996
public static void generateCustomPolicy(LibertyServer server, String... permissionsToAdd) throws Exception {<NEW_LINE>if (!server.isJava2SecurityEnabled() || permissionsToAdd == null || permissionsToAdd.length == 0)<NEW_LINE>return;<NEW_LINE>String policyPath;<NEW_LINE>if (JavaInfo.JAVA_VERSION >= 9) {<NEW_LINE>policyPath = JavaInfo.forServer(server).javaHome() + "/conf/security/java.policy";<NEW_LINE>} else {<NEW_LINE>policyPath = JavaInfo.forServer(server).javaHome() + "/lib/security/java.policy";<NEW_LINE>}<NEW_LINE>String policyContents = FileUtils.readFile(policyPath);<NEW_LINE>// Add in our custom policy for JAX-B permissions:<NEW_LINE>StringBuilder sb = new StringBuilder(" // Permissions added by FAT bucket\n");<NEW_LINE>for (String permToAdd : permissionsToAdd) sb.append(" ").append<MASK><NEW_LINE>if (!policyContents.contains("grant {"))<NEW_LINE>throw new Exception("Policy file did not contain special token 'grant {'. The contents were: " + policyContents);<NEW_LINE>policyContents = policyContents.replace("grant {", "grant {\n" + sb.toString() + '\n');<NEW_LINE>File outputFile = new File(server.getServerRoot() + "/custom_j2sec.policy");<NEW_LINE>Log.info(PrivHelper.class, "generateCustomPolicy", "Generating custom policy file at: " + outputFile + "\n" + policyContents);<NEW_LINE>try (BufferedWriter writer = new BufferedWriter(new FileWriter(outputFile))) {<NEW_LINE>writer.write(policyContents);<NEW_LINE>}<NEW_LINE>RemoteFile f = server.getServerBootstrapPropertiesFile();<NEW_LINE>try (OutputStream w = f.openForWriting(true)) {<NEW_LINE>String policySetting = "\njava.security.policy=" + outputFile.toURI().toURL();<NEW_LINE>w.write(policySetting.getBytes());<NEW_LINE>w.flush();<NEW_LINE>}<NEW_LINE>}
(permToAdd).append('\n');
766,303
private WritableMap accessTokenResponse(final String providerName, final HashMap<String, Object> cfg, final OAuth1AccessToken accessToken, final String oauthVersion) {<NEW_LINE>WritableMap resp = Arguments.createMap();<NEW_LINE>WritableMap response = Arguments.createMap();<NEW_LINE>Log.d(TAG, "Credential raw response: " + accessToken.getRawResponse());<NEW_LINE>Log.d(TAG, "Credential looks like a querystring; parsing as such");<NEW_LINE>accessTokenMap = new HashMap();<NEW_LINE>accessTokenMap.put("user_id"<MASK><NEW_LINE>accessTokenMap.put("oauth_token_secret", accessToken.getParameter("oauth_token_secret"));<NEW_LINE>accessTokenMap.put("token_type", accessToken.getParameter("token_type"));<NEW_LINE>}<NEW_LINE>resp.putString("status", "ok");<NEW_LINE>resp.putBoolean("authorized", true);<NEW_LINE>resp.putString("provider", providerName);<NEW_LINE>String uuid = accessToken.getParameter("user_id");<NEW_LINE>response.putString("uuid", uuid);<NEW_LINE>String oauthTokenSecret = (String) accessToken.getParameter("oauth_token_secret");<NEW_LINE>String tokenType = (String) accessToken.getParameter("token_type");<NEW_LINE>if (tokenType == null) {<NEW_LINE>tokenType = "Bearer";<NEW_LINE>}<NEW_LINE>String consumerKey = (String) cfg.get("consumer_key");<NEW_LINE>WritableMap credentials = Arguments.createMap();<NEW_LINE>credentials.putString("access_token", accessToken.getToken());<NEW_LINE>credentials.putString("access_token_secret", oauthTokenSecret);<NEW_LINE>credentials.putString("type", tokenType);<NEW_LINE>credentials.putString("consumerKey", consumerKey);<NEW_LINE>response.putMap("credentials", credentials);<NEW_LINE>resp.putMap("response", response);<NEW_LINE>return resp;<NEW_LINE>}
, accessToken.getParameter("user_id"));
1,229,034
public CreateDataSourceResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateDataSourceResult createDataSourceResult = new CreateDataSourceResult();<NEW_LINE>createDataSourceResult.setStatus(context.getHttpResponse().getStatusCode());<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 createDataSourceResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Arn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDataSourceResult.setArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DataSourceId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDataSourceResult.setDataSourceId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CreationStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDataSourceResult.setCreationStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RequestId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDataSourceResult.setRequestId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createDataSourceResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,434,482
public void findAndRevokeAccess(long secretId, long groupId, AuditLog auditLog, String user, Map<String, String> extraInfo) {<NEW_LINE>dslContext.transaction(configuration -> {<NEW_LINE>GroupDAO groupDAO = groupDAOFactory.using(configuration);<NEW_LINE>SecretSeriesDAO secretSeriesDAO = secretSeriesDAOFactory.using(configuration);<NEW_LINE>Optional<Group> group = groupDAO.getGroupById(groupId);<NEW_LINE>if (!group.isPresent()) {<NEW_LINE>logger.<MASK><NEW_LINE>throw new IllegalStateException(format("GroupId %d doesn't exist.", groupId));<NEW_LINE>}<NEW_LINE>Optional<SecretSeries> secret = secretSeriesDAO.getSecretSeriesById(secretId);<NEW_LINE>if (!secret.isPresent()) {<NEW_LINE>logger.info("Failure to revoke access groupId {}, secretId {}: secretId not found.", groupId, secretId);<NEW_LINE>throw new IllegalStateException(format("SecretId %d doesn't exist.", secretId));<NEW_LINE>}<NEW_LINE>revokeAccess(configuration, secretId, groupId);<NEW_LINE>extraInfo.put("group", group.get().getName());<NEW_LINE>extraInfo.put("secret removed", secret.get().name());<NEW_LINE>auditLog.recordEvent(new Event(Instant.now(), EventTag.CHANGEACL_GROUP_SECRET, user, group.get().getName(), extraInfo));<NEW_LINE>});<NEW_LINE>}
info("Failure to revoke access groupId {}, secretId {}: groupId not found.", groupId, secretId);
1,536,738
private void loadNode605() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SubscriptionDiagnosticsType_MaxKeepAliveCount, new QualifiedName(0, "MaxKeepAliveCount"), new LocalizedText("en", "MaxKeepAliveCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UInt32, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsType_MaxKeepAliveCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsType_MaxKeepAliveCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsType_MaxKeepAliveCount, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsType.expanded(), false));<NEW_LINE><MASK><NEW_LINE>}
this.nodeManager.addNode(node);
60,062
public static Automaton reverse(Automaton a, Set<Integer> initialStates) {<NEW_LINE>if (Operations.isEmpty(a)) {<NEW_LINE>return new Automaton();<NEW_LINE>}<NEW_LINE>int numStates = a.getNumStates();<NEW_LINE>// Build a new automaton with all edges reversed<NEW_LINE>Automaton.Builder builder = new Automaton.Builder();<NEW_LINE>// Initial node; we'll add epsilon transitions in the end:<NEW_LINE>builder.createState();<NEW_LINE>for (int s = 0; s < numStates; s++) {<NEW_LINE>builder.createState();<NEW_LINE>}<NEW_LINE>// Old initial state becomes new accept state:<NEW_LINE>builder.setAccept(1, true);<NEW_LINE>Transition t = new Transition();<NEW_LINE>for (int s = 0; s < numStates; s++) {<NEW_LINE>int <MASK><NEW_LINE>a.initTransition(s, t);<NEW_LINE>for (int i = 0; i < numTransitions; i++) {<NEW_LINE>a.getNextTransition(t);<NEW_LINE>builder.addTransition(t.dest + 1, s + 1, t.min, t.max);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Automaton result = builder.finish();<NEW_LINE>int s = 0;<NEW_LINE>BitSet acceptStates = a.getAcceptStates();<NEW_LINE>while (s < numStates && (s = acceptStates.nextSetBit(s)) != -1) {<NEW_LINE>result.addEpsilon(0, s + 1);<NEW_LINE>if (initialStates != null) {<NEW_LINE>initialStates.add(s + 1);<NEW_LINE>}<NEW_LINE>s++;<NEW_LINE>}<NEW_LINE>result.finishState();<NEW_LINE>return result;<NEW_LINE>}
numTransitions = a.getNumTransitions(s);
832,075
protected void activate(ComponentContext context) throws Exception {<NEW_LINE>Dictionary<String, ?> props = context.getProperties();<NEW_LINE>final boolean trace = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.entry(this, tc, "activate", props);<NEW_LINE>adminObjectImplClassName = (String) props.get(CONFIG_PROPS_PREFIX + "adminobject-class");<NEW_LINE>name = (String) props.get("config.id");<NEW_LINE>id = (String) props.get("id");<NEW_LINE>jndiName = (String) props.get("jndiName");<NEW_LINE>for (Enumeration<String> keys = props.keys(); keys.hasMoreElements(); ) {<NEW_LINE><MASK><NEW_LINE>if (key.length() > CONFIG_PROPS_PREFIX_LENGTH && key.charAt(CONFIG_PROPS_PREFIX_LENGTH - 1) == '.' && key.startsWith(CONFIG_PROPS_PREFIX)) {<NEW_LINE>String propName = key.substring(CONFIG_PROPS_PREFIX_LENGTH);<NEW_LINE>if (propName.indexOf('.') < 0 && propName.indexOf('-') < 0)<NEW_LINE>properties.put(propName, props.get(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bootstrapContextRef.activate(context);<NEW_LINE>if (trace && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "activate");<NEW_LINE>}
String key = keys.nextElement();
445,993
static void readCoeffIntra(BitReader br, MPEG4DecodingContext ctx, Macroblock mb, Macroblock aboveMb, Macroblock leftMb, Macroblock aboveLeftMb) {<NEW_LINE>for (int i = 0; i < 6; i++) {<NEW_LINE>Arrays.fill(mb.block[i], (byte) 0);<NEW_LINE>int iDcScaler = getDCScaler(mb.quant, i < 4);<NEW_LINE>int startCoeff;<NEW_LINE>predictAcdc(ctx, mb.x, mb.y, i, mb.quant, iDcScaler, mb.predictors, mb.bound, mb, aboveMb, leftMb, aboveLeftMb);<NEW_LINE>if (!mb.acpredFlag) {<NEW_LINE>mb.acpredDirections[i] = 0;<NEW_LINE>}<NEW_LINE>if (mb.quant < ctx.intraDCThreshold) {<NEW_LINE>int dcSize = i < 4 ? readDCSizeLum(br) : readDCSizeChrom(br);<NEW_LINE>short dcDif = dcSize != 0 ? readDCDif(br, dcSize) : 0;<NEW_LINE>if (dcSize > 8) {<NEW_LINE>br.skip(1);<NEW_LINE>}<NEW_LINE>mb.block[i][0] = dcDif;<NEW_LINE>startCoeff = 1;<NEW_LINE>} else {<NEW_LINE>startCoeff = 0;<NEW_LINE>}<NEW_LINE>if ((mb.cbp & (1 << (5 - i))) != 0) {<NEW_LINE>int direction = ctx.alternateVerticalScan ? <MASK><NEW_LINE>MPEG4Bitstream.readIntraBlock(br, mb.block[i], direction, startCoeff);<NEW_LINE>}<NEW_LINE>addAcdc(mb, ctx.bsVersion, i, iDcScaler);<NEW_LINE>if (!ctx.quantType) {<NEW_LINE>dequantH263Intra(ctx, mb.block[i], mb.quant, iDcScaler);<NEW_LINE>} else {<NEW_LINE>dequantMpegIntra(ctx, mb.block[i], mb.quant, iDcScaler);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
2 : mb.acpredDirections[i];
1,481,533
public MaryData process(MaryData input) {<NEW_LINE><MASK><NEW_LINE>NodeIterator tokenIterator = MaryDomUtils.createNodeIterator(document, MaryXML.TOKEN);<NEW_LINE>Element token;<NEW_LINE>while ((token = (Element) tokenIterator.nextNode()) != null) {<NEW_LINE>String origText = token.getTextContent().trim();<NEW_LINE>// ignore token if these conditions are not met, assume that if the node has the attributes "ph" or "sounds_like" the attributes won't be null<NEW_LINE>if (!hasAncestor(token, MaryXML.SAYAS) && !token.hasAttribute("ph") && !token.hasAttribute("sounds_like")) {<NEW_LINE>// ordinal<NEW_LINE>if (origText.matches("\\d+\\.")) {<NEW_LINE>token.setTextContent(expandOrdinal(Double.parseDouble(origText)));<NEW_LINE>} else // TODO year ~ not sure if formatting is correct as we have no resources. currently based off of German<NEW_LINE>// else if (origText.matches(~/\d{4}/)) {<NEW_LINE>// token.replaceBody expandYear(Double.parseDouble(origText))<NEW_LINE>// }<NEW_LINE>// cardinal<NEW_LINE>if (origText.matches("\\d+")) {<NEW_LINE>token.setTextContent(expandCardinal(Double.parseDouble(origText)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!origText.equals(MaryDomUtils.tokenText(token))) {<NEW_LINE>MaryDomUtils.encloseWithMTU(token, origText, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MaryData output = new MaryData(getOutputType(), input.getLocale());<NEW_LINE>output.setDocument(document);<NEW_LINE>return output;<NEW_LINE>}
Document document = input.getDocument();
1,468,254
public void actionPerformed(ActionContext context) {<NEW_LINE>GTree gTree = (GTree) context.getContextObject();<NEW_LINE>TreePath[] selectionPaths = gTree.getSelectionPaths();<NEW_LINE>TreePath treePath = selectionPaths[0];<NEW_LINE>final DataTypeNode dataTypeNode = (DataTypeNode) treePath.getLastPathComponent();<NEW_LINE>DataType dataType = dataTypeNode.getDataType();<NEW_LINE>DataTypeManager dataTypeManager = dataType.getDataTypeManager();<NEW_LINE>if (dataTypeManager == null) {<NEW_LINE>Msg.error(this, "Can't pack data type " + <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>NumberInputDialog numberInputDialog = new NumberInputDialog("explicit pack value", 0, 0, 16);<NEW_LINE>if (!numberInputDialog.show()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int packSize = numberInputDialog.getValue();<NEW_LINE>int transactionID = -1;<NEW_LINE>boolean commit = false;<NEW_LINE>try {<NEW_LINE>// start a transaction<NEW_LINE>transactionID = dataTypeManager.startTransaction("pack(" + packSize + ") of " + dataType.getName());<NEW_LINE>packDataType(dataType, packSize);<NEW_LINE>commit = true;<NEW_LINE>} catch (IllegalArgumentException iie) {<NEW_LINE>Msg.showError(this, null, "Invalid Pack Value", iie.getMessage());<NEW_LINE>} finally {<NEW_LINE>// commit the changes<NEW_LINE>dataTypeManager.endTransaction(transactionID, commit);<NEW_LINE>}<NEW_LINE>}
dataType.getName() + " without a data type manager.");
7,079
public static DescribeAppVersionResponse unmarshall(DescribeAppVersionResponse describeAppVersionResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeAppVersionResponse.setRequestId(_ctx.stringValue("DescribeAppVersionResponse.RequestId"));<NEW_LINE>AppVersion appVersion = new AppVersion();<NEW_LINE>appVersion.setId(_ctx.longValue("DescribeAppVersionResponse.AppVersion.Id"));<NEW_LINE>appVersion.setAppId(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.AppId"));<NEW_LINE>appVersion.setVersionCode(_ctx.longValue("DescribeAppVersionResponse.AppVersion.VersionCode"));<NEW_LINE>appVersion.setReleaseNote(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.ReleaseNote"));<NEW_LINE>appVersion.setRemark(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.Remark"));<NEW_LINE>appVersion.setStatus(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.Status"));<NEW_LINE>appVersion.setAppVersion(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.AppVersion"));<NEW_LINE>appVersion.setDownloadUrl(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.DownloadUrl"));<NEW_LINE>appVersion.setOriginalUrl(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.OriginalUrl"));<NEW_LINE>appVersion.setIsForceUpgrade(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.IsForceUpgrade"));<NEW_LINE>appVersion.setIsSilentUpgrade(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.IsSilentUpgrade"));<NEW_LINE>appVersion.setMd5(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.Md5"));<NEW_LINE>appVersion.setApkMd5(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.ApkMd5"));<NEW_LINE>appVersion.setSize(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.Size"));<NEW_LINE>appVersion.setGmtCreate(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.GmtCreate"));<NEW_LINE>appVersion.setGmtModify(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.GmtModify"));<NEW_LINE>appVersion.setIsNeedRestart(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.IsNeedRestart"));<NEW_LINE>appVersion.setIsAllowNewInstall(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.IsAllowNewInstall"));<NEW_LINE>appVersion.setRestartType(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.RestartType"));<NEW_LINE>appVersion.setRestartAppType(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.RestartAppType"));<NEW_LINE>appVersion.setRestartAppParam(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.RestartAppParam"));<NEW_LINE>appVersion.setInstallType(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.InstallType"));<NEW_LINE>appVersion.setBlackVersionList(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.BlackVersionList"));<NEW_LINE>appVersion.setWhiteVersionList<MASK><NEW_LINE>appVersion.setAppName(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.AppName"));<NEW_LINE>appVersion.setStatusName(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.StatusName"));<NEW_LINE>appVersion.setPackageName(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.PackageName"));<NEW_LINE>List<AdaptersItem> adapters = new ArrayList<AdaptersItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAppVersionResponse.AppVersion.Adapters.Length"); i++) {<NEW_LINE>AdaptersItem adaptersItem = new AdaptersItem();<NEW_LINE>adaptersItem.setId(_ctx.longValue("DescribeAppVersionResponse.AppVersion.Adapters[" + i + "].Id"));<NEW_LINE>adaptersItem.setVersionId(_ctx.longValue("DescribeAppVersionResponse.AppVersion.Adapters[" + i + "].VersionId"));<NEW_LINE>adaptersItem.setDeviceModelId(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.Adapters[" + i + "].DeviceModelId"));<NEW_LINE>adaptersItem.setMinOsVersion(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.Adapters[" + i + "].MinOsVersion"));<NEW_LINE>adaptersItem.setMaxOsVersion(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.Adapters[" + i + "].MaxOsVersion"));<NEW_LINE>adaptersItem.setDeviceModelName(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.Adapters[" + i + "].DeviceModelName"));<NEW_LINE>adapters.add(adaptersItem);<NEW_LINE>}<NEW_LINE>appVersion.setAdapters(adapters);<NEW_LINE>describeAppVersionResponse.setAppVersion(appVersion);<NEW_LINE>return describeAppVersionResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeAppVersionResponse.AppVersion.WhiteVersionList"));
1,422,918
private String callUrl(String url, Map<String, String> headers, int timeout, Builder builder) throws IOException {<NEW_LINE>for (Entry<String, String> entry : headers.entrySet()) {<NEW_LINE>builder.addHeader(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>Request request = builder.build();<NEW_LINE>OkHttpClient client = requestFactory.getOkHttpClientBuilder(request.url().uri()).readTimeout(timeout, TimeUnit.SECONDS).connectTimeout(timeout, TimeUnit.SECONDS).writeTimeout(timeout, TimeUnit.SECONDS).build();<NEW_LINE>String bodyAsString;<NEW_LINE>try (Response response = client.newCall(request).execute();<NEW_LINE>ResponseBody body = response.body()) {<NEW_LINE>try {<NEW_LINE>bodyAsString = body == null <MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>bodyAsString = null;<NEW_LINE>}<NEW_LINE>if (!response.isSuccessful()) {<NEW_LINE>String error = String.format("URL call to %s returned %d: %s", url, response.code(), response.message());<NEW_LINE>if (response.code() != 429) {<NEW_LINE>// No reason to log 429 errors, they all look more or less the same<NEW_LINE>logger.error(error + "\n" + bodyAsString);<NEW_LINE>}<NEW_LINE>throw new WebAccessException(response.message(), bodyAsString, response.code());<NEW_LINE>}<NEW_LINE>return bodyAsString;<NEW_LINE>} catch (ConnectException | SocketTimeoutException e) {<NEW_LINE>throw new WebAccessException(e);<NEW_LINE>}<NEW_LINE>}
? null : body.string();
337,038
public static AddPlaylistItemsResponse unmarshall(AddPlaylistItemsResponse addPlaylistItemsResponse, UnmarshallerContext _ctx) {<NEW_LINE>addPlaylistItemsResponse.setRequestId(_ctx.stringValue("AddPlaylistItemsResponse.RequestId"));<NEW_LINE>addPlaylistItemsResponse.setProgramId(_ctx.stringValue("AddPlaylistItemsResponse.ProgramId"));<NEW_LINE>Items items = new Items();<NEW_LINE>List<SuccessItem> successItems = new ArrayList<SuccessItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("AddPlaylistItemsResponse.Items.SuccessItems.Length"); i++) {<NEW_LINE>SuccessItem successItem = new SuccessItem();<NEW_LINE>successItem.setItemName(_ctx.stringValue("AddPlaylistItemsResponse.Items.SuccessItems[" + i + "].ItemName"));<NEW_LINE>successItem.setItemId(_ctx.stringValue("AddPlaylistItemsResponse.Items.SuccessItems[" + i + "].ItemId"));<NEW_LINE>successItems.add(successItem);<NEW_LINE>}<NEW_LINE>items.setSuccessItems(successItems);<NEW_LINE>List<FailedItem> failedItems = new ArrayList<FailedItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("AddPlaylistItemsResponse.Items.FailedItems.Length"); i++) {<NEW_LINE>FailedItem failedItem = new FailedItem();<NEW_LINE>failedItem.setItemName(_ctx.stringValue<MASK><NEW_LINE>failedItem.setItemId(_ctx.stringValue("AddPlaylistItemsResponse.Items.FailedItems[" + i + "].ItemId"));<NEW_LINE>failedItems.add(failedItem);<NEW_LINE>}<NEW_LINE>items.setFailedItems(failedItems);<NEW_LINE>addPlaylistItemsResponse.setItems(items);<NEW_LINE>return addPlaylistItemsResponse;<NEW_LINE>}
("AddPlaylistItemsResponse.Items.FailedItems[" + i + "].ItemName"));
1,370,178
public void testCreateTextMessageStr_TCP_SecOn(HttpServletRequest request, HttpServletResponse response) throws Throwable {<NEW_LINE>boolean exceptionFlag = false;<NEW_LINE>JMSContext jmsContext = QCFTCP.createContext();<NEW_LINE>jmsContext.createConsumer<MASK><NEW_LINE>String compare = "Hello";<NEW_LINE>String str = "Hello this is a test case for TextMessage";<NEW_LINE>TextMessage msg = jmsContext.createTextMessage(str);<NEW_LINE>msg.setBooleanProperty("BooleanValue", true);<NEW_LINE>msg.setText(compare);<NEW_LINE>JMSProducer jmsProducer = jmsContext.createProducer().send(queue1, msg);<NEW_LINE>QueueBrowser qb = jmsContext.createBrowser(queue1);<NEW_LINE>Enumeration e = qb.getEnumeration();<NEW_LINE>int numMsgs = 0;<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>e.nextElement();<NEW_LINE>numMsgs++;<NEW_LINE>}<NEW_LINE>if (!(numMsgs == 1 && msg.getText().equals(compare)))<NEW_LINE>exceptionFlag = true;<NEW_LINE>if (exceptionFlag)<NEW_LINE>throw new WrongException("testCreateTextMessageStr_TCP_SecOn failed");<NEW_LINE>jmsContext.close();<NEW_LINE>}
(queue1).receive(30000);
236,592
private static org.jreleaser.model.Snap convertSnap(Snap packager) {<NEW_LINE>org.jreleaser.model.Snap t = new org.jreleaser.model.Snap();<NEW_LINE>convertPackager(packager, t);<NEW_LINE>t.setPackageName(tr(packager.getPackageName()));<NEW_LINE>t.setTemplateDirectory(tr(packager.getTemplateDirectory()));<NEW_LINE>t.setSkipTemplates(tr(packager.getSkipTemplates()));<NEW_LINE>if (isNotBlank(packager.getBase()))<NEW_LINE>t.setBase(packager.getBase());<NEW_LINE>if (isNotBlank(packager.getGrade()))<NEW_LINE>t.setGrade(packager.getGrade());<NEW_LINE>if (isNotBlank(packager.getConfinement()))<NEW_LINE>t.setConfinement(packager.getConfinement());<NEW_LINE>if (null != packager.getExportedLogin())<NEW_LINE>t.setExportedLogin(packager.getExportedLogin().getAbsolutePath());<NEW_LINE>t.setRemoteBuild(packager.isRemoteBuild());<NEW_LINE>t.setLocalPlugs(packager.getLocalPlugs());<NEW_LINE>t.<MASK><NEW_LINE>t.setPlugs(convertPlugs(packager.getPlugs()));<NEW_LINE>t.setSlots(convertSlots(packager.getSlots()));<NEW_LINE>t.setArchitectures(convertArchitectures(packager.getArchitectures()));<NEW_LINE>t.setSnap(convertSnapTap(packager.getSnap()));<NEW_LINE>t.setCommitAuthor(convertCommitAuthor(packager.getCommitAuthor()));<NEW_LINE>return t;<NEW_LINE>}
setLocalSlots(packager.getLocalSlots());
1,305,828
final AssociateConnectionAliasResult executeAssociateConnectionAlias(AssociateConnectionAliasRequest associateConnectionAliasRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateConnectionAliasRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateConnectionAliasRequest> request = null;<NEW_LINE>Response<AssociateConnectionAliasResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateConnectionAliasRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateConnectionAliasRequest));<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, "WorkSpaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateConnectionAlias");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateConnectionAliasResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateConnectionAliasResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
572,142
protected ECCurve createCurve() {<NEW_LINE>// p = 2^192 - 2^32 - 2^12 - 2^8 - 2^7 - 2^6 - 2^3 - 1<NEW_LINE>BigInteger p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37");<NEW_LINE>BigInteger a = ECConstants.ZERO;<NEW_LINE>BigInteger <MASK><NEW_LINE>BigInteger n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D");<NEW_LINE>BigInteger h = BigInteger.valueOf(1);<NEW_LINE>GLVTypeBParameters glv = new GLVTypeBParameters(new BigInteger("bb85691939b869c1d087f601554b96b80cb4f55b35f433c2", 16), new BigInteger("3d84f26c12238d7b4f3d516613c1759033b1a5800175d0b1", 16), new ScalarSplitParameters(new BigInteger[] { new BigInteger("71169be7330b3038edb025f1", 16), new BigInteger("-b3fb3400dec5c4adceb8655c", 16) }, new BigInteger[] { new BigInteger("12511cfe811d0f4e6bc688b4d", 16), new BigInteger("71169be7330b3038edb025f1", 16) }, new BigInteger("71169be7330b3038edb025f1d0f9", 16), new BigInteger("b3fb3400dec5c4adceb8655d4c94", 16), 208));<NEW_LINE>return configureCurveGLV(new ECCurve.Fp(p, a, b, n, h, true), glv);<NEW_LINE>}
b = BigInteger.valueOf(3);
102,215
public DescribeReservedDBInstancesResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeReservedDBInstancesResult describeReservedDBInstancesResult = new DescribeReservedDBInstancesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return describeReservedDBInstancesResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Marker", targetDepth)) {<NEW_LINE>describeReservedDBInstancesResult.setMarker(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ReservedDBInstances", targetDepth)) {<NEW_LINE>describeReservedDBInstancesResult.withReservedDBInstances(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ReservedDBInstances/ReservedDBInstance", targetDepth)) {<NEW_LINE>describeReservedDBInstancesResult.withReservedDBInstances(ReservedDBInstanceStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeReservedDBInstancesResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
new ArrayList<ReservedDBInstance>());
73,140
public void marshall(CreateStackRequest createStackRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createStackRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createStackRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createStackRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createStackRequest.getDisplayName(), DISPLAYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createStackRequest.getRedirectURL(), REDIRECTURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(createStackRequest.getFeedbackURL(), FEEDBACKURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(createStackRequest.getUserSettings(), USERSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createStackRequest.getApplicationSettings(), APPLICATIONSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createStackRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createStackRequest.getAccessEndpoints(), ACCESSENDPOINTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createStackRequest.getEmbedHostDomains(), EMBEDHOSTDOMAINS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createStackRequest.getStorageConnectors(), STORAGECONNECTORS_BINDING);
53,979
protected void doBuild(final DaemonCommandExecution execution, Build build) {<NEW_LINE>LOGGER.debug(DaemonMessages.STARTED_BUILD);<NEW_LINE>LOGGER.debug("Executing build with daemon context: {}", execution.getDaemonContext());<NEW_LINE>runningStats.buildStarted();<NEW_LINE>DaemonConnectionBackedEventConsumer buildEventConsumer = new DaemonConnectionBackedEventConsumer(execution);<NEW_LINE>try {<NEW_LINE>BuildCancellationToken cancellationToken = execution.getDaemonStateControl().getCancellationToken();<NEW_LINE>BuildRequestContext buildRequestContext = new DefaultBuildRequestContext(build.getBuildRequestMetaData(), cancellationToken, buildEventConsumer);<NEW_LINE>if (!build.getAction().getStartParameter().isContinuous()) {<NEW_LINE>buildRequestContext.getCancellationToken().addCallback(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>LOGGER.info(DaemonMessages.CANCELED_BUILD);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>BuildActionResult result = actionExecuter.execute(build.getAction(), build.getParameters(), buildRequestContext);<NEW_LINE>execution.setResult(result);<NEW_LINE>} finally {<NEW_LINE>buildEventConsumer.waitForFinish();<NEW_LINE>runningStats.buildFinished();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// ExecuteBuild should be the last action, but in case we want to decorate the result in the future<NEW_LINE>execution.proceed();<NEW_LINE>}
LOGGER.debug(DaemonMessages.FINISHED_BUILD);
987,372
public boolean apply(Game game, Ability source) {<NEW_LINE>Permanent errantMinion = game.getPermanentOrLKIBattlefield(source.getSourceId());<NEW_LINE>if (errantMinion == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Permanent enchantedCreature = game.<MASK><NEW_LINE>if (enchantedCreature == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Player controllerOfEnchantedCreature = game.getPlayer(enchantedCreature.getControllerId());<NEW_LINE>if (controllerOfEnchantedCreature != null && controllerOfEnchantedCreature.canRespond()) {<NEW_LINE>int manaPaid = ManaUtil.playerPaysXGenericMana(false, "Errant Minion", controllerOfEnchantedCreature, source, game);<NEW_LINE>if (manaPaid > 0) {<NEW_LINE>PreventDamageToTargetEffect effect = new PreventDamageToTargetEffect(Duration.OneUse, manaPaid);<NEW_LINE>effect.setTargetPointer(new FixedTarget(controllerOfEnchantedCreature.getId()));<NEW_LINE>game.addEffect(effect, source);<NEW_LINE>DamageTargetEffect effect2 = new DamageTargetEffect(2);<NEW_LINE>effect2.setTargetPointer(new FixedTarget(controllerOfEnchantedCreature.getId()));<NEW_LINE>effect2.apply(game, source);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getPermanentOrLKIBattlefield(errantMinion.getAttachedTo());
1,141,623
public boolean isChanged(final long tierIndex, final long pos) {<NEW_LINE>throwExceptionIfClosed();<NEW_LINE>updateModificationIteratorsArray();<NEW_LINE>if (tierIndex <= actualSegments) {<NEW_LINE>final long segmentIndex = tierIndex - 1;<NEW_LINE>final long offsetToTierBitSet = segmentIndex * tierModIterBitSetOuterSize;<NEW_LINE>for (ModificationIterator modificationIterator : assignedModificationIterators) {<NEW_LINE>if (modificationIterator.isChangedSegment(offsetToTierBitSet, pos))<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final <MASK><NEW_LINE>final int bulkIndex = (int) (extraTierIndex >> log2TiersInBulk);<NEW_LINE>final long offsetToTierBitSet = (extraTierIndex & (tiersInBulk - 1)) * tierModIterBitSetOuterSize;<NEW_LINE>for (ModificationIterator modificationIterator : assignedModificationIterators) {<NEW_LINE>if (modificationIterator.isChangedTierBulk(bulkIndex, offsetToTierBitSet, pos))<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
long extraTierIndex = tierIndex - 1 - actualSegments;
272,737
private void postParse(Context ctx, IParam sub) {<NEW_LINE>ArrayList<Expression> lsExp = new ArrayList<Expression>();<NEW_LINE>sub.getAllLeafExpression(lsExp);<NEW_LINE>String s = null;<NEW_LINE>Expression e = lsExp.get(0);<NEW_LINE>if (e.isConstExpression()) {<NEW_LINE>// 1.for k1:k2<NEW_LINE>s = ((Expression) lsExp.get(0)).getIdentifierName();<NEW_LINE>m_seg[0] = Integer.parseInt(s);<NEW_LINE>if (m_seg[0] < 0)<NEW_LINE>m_seg[0] = 1;<NEW_LINE>if (lsExp.size() == 2) {<NEW_LINE>e = lsExp.get(1);<NEW_LINE>if (e != null) {<NEW_LINE>s = e.getIdentifierName();<NEW_LINE>m_seg[1] = Integer.parseInt(s);<NEW_LINE>if (m_seg[1] < 0)<NEW_LINE>m_seg[1] = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>m_frag = m_ifxConn.getFragment(m_table);<NEW_LINE>if (m_frag != null) {<NEW_LINE>if (m_seg[0] > m_frag.getPartitionCount())<NEW_LINE>m_seg[<MASK><NEW_LINE>if (m_seg[1] > m_frag.getPartitionCount())<NEW_LINE>m_seg[1] = m_frag.getPartitionCount();<NEW_LINE>m_frag.setSegment(m_seg[0], m_seg[1]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// 2. for ifx_cursor:f<NEW_LINE>INormalCell cell = e.getHome().calculateCell(ctx);<NEW_LINE>ImCursor cursor = (ImCursor) cell.getValue();<NEW_LINE>String cursorTable = cursor.getTableName();<NEW_LINE>if (cursorTable != null) {<NEW_LINE>// System.out.println("cursor = " + cursorTable);<NEW_LINE>m_frag = new Fragment();<NEW_LINE>Fragment frag = m_ifxConn.getFragment(cursorTable);<NEW_LINE>m_frag = frag;<NEW_LINE>if (lsExp.size() == 2 && m_frag != null) {<NEW_LINE>e = lsExp.get(1);<NEW_LINE>if (e != null) {<NEW_LINE>s = e.getIdentifierName().replaceAll("\"", "");<NEW_LINE>m_frag.setFieldName(s);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
0] = m_frag.getPartitionCount();
165,042
private static List<Integer> featurize(final GATKRead read, final VariantContext vc, final Map<GATKRead, Haplotype> bestHaplotypes) {<NEW_LINE>final List<Integer> result = new ArrayList<>();<NEW_LINE>result.add(read.getMappingQuality());<NEW_LINE>result.add(BaseQuality.getBaseQuality(read, vc).orElse(DEFAULT_BASE_QUALITY));<NEW_LINE>result.add(read.isFirstOfPair() ? 1 : 0);<NEW_LINE>result.add(read.isReverseStrand() ? 1 : 0);<NEW_LINE>// distances from ends of read<NEW_LINE>final int readPosition = ReadPosition.getPosition(read, vc).orElse(0);<NEW_LINE>result.add(readPosition);<NEW_LINE>result.add(read.getLength() - readPosition);<NEW_LINE>result.add(Math.abs(read.getFragmentLength()));<NEW_LINE>// distances from ends of fragment<NEW_LINE>final int fragmentStart = Math.min(read.getMateStart(), read.getUnclippedStart());<NEW_LINE>final int fragmentEnd = fragmentStart + Math.abs(read.getFragmentLength());<NEW_LINE>result.add(vc.getStart() - fragmentStart);<NEW_LINE>result.add(fragmentEnd - vc.getEnd());<NEW_LINE>// mismatches versus best haplotype<NEW_LINE>final Haplotype haplotype = bestHaplotypes.get(read);<NEW_LINE>final SmithWatermanAlignment readToHaplotypeAlignment = aligner.align(haplotype.getBases(), read.getBases(), <MASK><NEW_LINE>final GATKRead copy = read.copy();<NEW_LINE>copy.setCigar(readToHaplotypeAlignment.getCigar());<NEW_LINE>final int mismatchCount = AlignmentUtils.getMismatchCount(copy, haplotype.getBases(), readToHaplotypeAlignment.getAlignmentOffset()).numMismatches;<NEW_LINE>result.add(mismatchCount);<NEW_LINE>final long indelsVsBestHaplotype = readToHaplotypeAlignment.getCigar().getCigarElements().stream().filter(el -> el.getOperator().isIndel()).count();<NEW_LINE>result.add((int) indelsVsBestHaplotype);<NEW_LINE>Utils.validate(result.size() == FEATURES_PER_READ, "Wrong number of features");<NEW_LINE>return result;<NEW_LINE>}
SmithWatermanAlignmentConstants.ALIGNMENT_TO_BEST_HAPLOTYPE_SW_PARAMETERS, SWOverhangStrategy.SOFTCLIP);
1,234,577
synchronized void insert(List<String> path, DrawableGroup g, boolean tree) {<NEW_LINE>if (tree) {<NEW_LINE>// Are we at the end of the recursion?<NEW_LINE>if (path.isEmpty()) {<NEW_LINE>getValue().setGroup(g);<NEW_LINE>} else {<NEW_LINE>String prefix = path.get(0);<NEW_LINE>GroupTreeItem prefixTreeItem = childMap.computeIfAbsent(prefix, (String t) -> {<NEW_LINE>final GroupTreeItem newTreeItem = new <MASK><NEW_LINE>Platform.runLater(() -> {<NEW_LINE>getChildren().add(newTreeItem);<NEW_LINE>getChildren().sort(Comparator.comparing(treeItem -> treeItem.getValue().getGroup(), Comparator.nullsLast(comp)));<NEW_LINE>});<NEW_LINE>return newTreeItem;<NEW_LINE>});<NEW_LINE>// recursively go into the path<NEW_LINE>treeInsertTread.execute(() -> {<NEW_LINE>prefixTreeItem.insert(path.subList(1, path.size()), g, true);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String join = StringUtils.join(path, "/");<NEW_LINE>// flat list<NEW_LINE>childMap.computeIfAbsent(join, (String t) -> {<NEW_LINE>final GroupTreeItem newTreeItem = new GroupTreeItem(t, g, true);<NEW_LINE>Platform.runLater(() -> {<NEW_LINE>getChildren().add(newTreeItem);<NEW_LINE>getChildren().sort(Comparator.comparing(treeItem -> treeItem.getValue().getGroup(), Comparator.nullsLast(comp)));<NEW_LINE>});<NEW_LINE>return newTreeItem;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
GroupTreeItem(t, null, false);
82,440
private synchronized <T> T sendScript(String script, Class<T> clazz) throws HomematicClientException {<NEW_LINE>PostMethod post = null;<NEW_LINE>try {<NEW_LINE>script = StringUtils.trim(script);<NEW_LINE>if (StringUtils.isEmpty(script)) {<NEW_LINE>throw new RuntimeException("Homematic TclRegaScript is empty!");<NEW_LINE>}<NEW_LINE>if (TRACE_ENABLED) {<NEW_LINE>logger.trace("TclRegaScript: {}", script);<NEW_LINE>}<NEW_LINE>post = new PostMethod(context.getConfig().getTclRegaUrl());<NEW_LINE>RequestEntity re = new ByteArrayRequestEntity(script.getBytes("ISO-8859-1"));<NEW_LINE>post.setRequestEntity(re);<NEW_LINE>httpClient.executeMethod(post);<NEW_LINE>String result = post.getResponseBodyAsString();<NEW_LINE>result = <MASK><NEW_LINE>if (TRACE_ENABLED) {<NEW_LINE>logger.trace("Result TclRegaScript: {}", result);<NEW_LINE>}<NEW_LINE>Unmarshaller um = JAXBContext.newInstance(clazz).createUnmarshaller();<NEW_LINE>um.setListener(new CommonUnmarshallerListener());<NEW_LINE>return (T) um.unmarshal(new StringReader(result));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new HomematicClientException(ex.getMessage(), ex);<NEW_LINE>} finally {<NEW_LINE>if (post != null) {<NEW_LINE>post.releaseConnection();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
StringUtils.substringBeforeLast(result, "<xml><exec>");
1,593,060
public Result appConfig() {<NEW_LINE>final ObjectNode config = Json.newObject();<NEW_LINE>config.put("application", "datahub-frontend");<NEW_LINE>config.put("appVersion", _config.getString("app.version"));<NEW_LINE>config.put("isInternal", _config.getBoolean("linkedin.internal"));<NEW_LINE>config.put("shouldShowDatasetLineage", _config.getBoolean("linkedin.show.dataset.lineage"));<NEW_LINE>config.put("suggestionConfidenceThreshold", Integer.valueOf(_config.getString("linkedin.suggestion.confidence.threshold")));<NEW_LINE>config.set("wikiLinks", wikiLinks());<NEW_LINE>config.set("tracking", trackingInfo());<NEW_LINE>// In a staging environment, we can trigger this flag to be true so that the UI can handle based on<NEW_LINE>// such config and alert users that their changes will not affect production data<NEW_LINE>config.put("isStagingBanner", _config.getBoolean("ui.show.staging.banner"));<NEW_LINE>config.put("isLiveDataWarning"<MASK><NEW_LINE>config.put("showChangeManagement", _config.getBoolean("ui.show.CM.banner"));<NEW_LINE>// Flag to enable people entity elements<NEW_LINE>config.put("showPeople", _config.getBoolean("ui.show.people"));<NEW_LINE>config.put("changeManagementLink", _config.getString("ui.show.CM.link"));<NEW_LINE>// Flag set in order to warn users that search is experiencing issues<NEW_LINE>config.put("isStaleSearch", _config.getBoolean("ui.show.stale.search"));<NEW_LINE>config.put("showAdvancedSearch", _config.getBoolean("ui.show.advanced.search"));<NEW_LINE>// Flag to use the new api for browsing datasets<NEW_LINE>config.put("useNewBrowseDataset", _config.getBoolean("ui.new.browse.dataset"));<NEW_LINE>// show lineage graph in relationships tabs<NEW_LINE>config.put("showLineageGraph", _config.getBoolean("ui.show.lineage.graph"));<NEW_LINE>// show institutional memory for available entities<NEW_LINE>config.put("showInstitutionalMemory", _config.getBoolean("ui.show.institutional.memory"));<NEW_LINE>// Insert properties for user profile operations<NEW_LINE>config.set("userEntityProps", userEntityProps());<NEW_LINE>final ObjectNode response = Json.newObject();<NEW_LINE>response.put("status", "ok");<NEW_LINE>response.set("config", config);<NEW_LINE>return ok(response);<NEW_LINE>}
, _config.getBoolean("ui.show.live.data.banner"));
275,797
private void startActiveExportingMode() {<NEW_LINE>logStream.registerRecordAvailableListener(this);<NEW_LINE>// start reading<NEW_LINE>for (final ExporterContainer container : containers) {<NEW_LINE>container.initPosition();<NEW_LINE>container.openExporter();<NEW_LINE>}<NEW_LINE>if (state.hasExporters()) {<NEW_LINE>final long snapshotPosition = state.getLowestPosition();<NEW_LINE>final boolean failedToRecoverReader = !logStreamReader.seekToNextEvent(snapshotPosition);<NEW_LINE>if (failedToRecoverReader) {<NEW_LINE>throw new IllegalStateException(String.format(ERROR_MESSAGE_RECOVER_FROM_SNAPSHOT_FAILED<MASK><NEW_LINE>}<NEW_LINE>if (!isPaused) {<NEW_LINE>exporterPhase = ExporterPhase.EXPORTING;<NEW_LINE>actor.submit(this::readNextEvent);<NEW_LINE>} else {<NEW_LINE>exporterPhase = ExporterPhase.PAUSED;<NEW_LINE>}<NEW_LINE>actor.runAtFixedRate(distributionInterval, this::distributeExporterPositions);<NEW_LINE>} else {<NEW_LINE>actor.close();<NEW_LINE>}<NEW_LINE>}
, snapshotPosition, getName()));
36,966
protected JFreeChart createStackedBar3DChart() throws JRException {<NEW_LINE>ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());<NEW_LINE>JFreeChart jfreeChart = ChartFactory.createStackedBarChart3D(evaluateTextExpression(getChart().getTitleExpression()), evaluateTextExpression(((JRBar3DPlot) getPlot()).getCategoryAxisLabelExpression()), evaluateTextExpression(((JRBar3DPlot) getPlot()).getValueAxisLabelExpression()), (CategoryDataset) getDataset(), getPlot().getOrientationValue().getOrientation(), isShowLegend(), true, false);<NEW_LINE>configureChart(jfreeChart, getPlot());<NEW_LINE>CategoryPlot categoryPlot = (CategoryPlot) jfreeChart.getPlot();<NEW_LINE>JRBar3DPlot bar3DPlot = (JRBar3DPlot) getPlot();<NEW_LINE>StackedBarRenderer3D stackedBarRenderer3D = new StackedBarRenderer3D(bar3DPlot.getXOffsetDouble() == null ? StackedBarRenderer3D.DEFAULT_X_OFFSET : bar3DPlot.getXOffsetDouble(), bar3DPlot.getYOffsetDouble() == null ? StackedBarRenderer3D.DEFAULT_Y_OFFSET : bar3DPlot.getYOffsetDouble());<NEW_LINE>boolean isShowLabels = bar3DPlot.getShowLabels() == null ? false : bar3DPlot.getShowLabels();<NEW_LINE>stackedBarRenderer3D.setBaseItemLabelsVisible(isShowLabels);<NEW_LINE>if (isShowLabels) {<NEW_LINE>JRItemLabel itemLabel = bar3DPlot.getItemLabel();<NEW_LINE>stackedBarRenderer3D.setBaseItemLabelFont(getFontUtil().getAwtFont(getFont(itemLabel == null ? null : itemLabel.getFont()), getLocale()));<NEW_LINE>if (itemLabel != null) {<NEW_LINE>if (itemLabel.getColor() != null) {<NEW_LINE>stackedBarRenderer3D.setBaseItemLabelPaint(itemLabel.getColor());<NEW_LINE>} else {<NEW_LINE>stackedBarRenderer3D.setBaseItemLabelPaint(<MASK><NEW_LINE>}<NEW_LINE>// categoryRenderer.setBaseFillPaint(itemLabel.getBackgroundColor());<NEW_LINE>// if(itemLabel.getMask() != null)<NEW_LINE>// {<NEW_LINE>// barRenderer3D.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator(<NEW_LINE>// StandardCategoryItemLabelGenerator.DEFAULT_LABEL_FORMAT_STRING,<NEW_LINE>// new DecimalFormat(itemLabel.getMask())));<NEW_LINE>// }<NEW_LINE>// else<NEW_LINE>// {<NEW_LINE>stackedBarRenderer3D.setBaseItemLabelGenerator((CategoryItemLabelGenerator) getLabelGenerator());<NEW_LINE>// }<NEW_LINE>} else {<NEW_LINE>stackedBarRenderer3D.setBaseItemLabelGenerator((CategoryItemLabelGenerator) getLabelGenerator());<NEW_LINE>stackedBarRenderer3D.setBaseItemLabelPaint(getChart().getForecolor());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>categoryPlot.setRenderer(stackedBarRenderer3D);<NEW_LINE>// Handle the axis formating for the category axis<NEW_LINE>configureAxis(categoryPlot.getDomainAxis(), bar3DPlot.getCategoryAxisLabelFont(), bar3DPlot.getCategoryAxisLabelColor(), bar3DPlot.getCategoryAxisTickLabelFont(), bar3DPlot.getCategoryAxisTickLabelColor(), bar3DPlot.getCategoryAxisTickLabelMask(), bar3DPlot.getCategoryAxisVerticalTickLabels(), bar3DPlot.getOwnCategoryAxisLineColor(), false, (Comparable<?>) evaluateExpression(bar3DPlot.getDomainAxisMinValueExpression()), (Comparable<?>) evaluateExpression(bar3DPlot.getDomainAxisMaxValueExpression()));<NEW_LINE>// Handle the axis formating for the value axis<NEW_LINE>configureAxis(categoryPlot.getRangeAxis(), bar3DPlot.getValueAxisLabelFont(), bar3DPlot.getValueAxisLabelColor(), bar3DPlot.getValueAxisTickLabelFont(), bar3DPlot.getValueAxisTickLabelColor(), bar3DPlot.getValueAxisTickLabelMask(), bar3DPlot.getValueAxisVerticalTickLabels(), bar3DPlot.getOwnValueAxisLineColor(), true, (Comparable<?>) evaluateExpression(bar3DPlot.getRangeAxisMinValueExpression()), (Comparable<?>) evaluateExpression(bar3DPlot.getRangeAxisMaxValueExpression()));<NEW_LINE>return jfreeChart;<NEW_LINE>}
getChart().getForecolor());
343,576
public static Server createServer(int port) throws NamingException, FileNotFoundException {<NEW_LINE>// Create the server<NEW_LINE>Server server = new Server(port);<NEW_LINE>// Create a WebApp<NEW_LINE>WebAppContext webapp = new WebAppContext();<NEW_LINE>// Enable parsing of jndi-related parts of web.xml and jetty-env.xml<NEW_LINE>webapp.addConfiguration(new EnvConfiguration(), new PlusConfiguration(), new AnnotationConfiguration());<NEW_LINE>webapp.setContextPath("/");<NEW_LINE>Path warFile = JettyDemos.find("demo-spec/demo-spec-webapp/target/demo-spec-webapp-@VER@.war");<NEW_LINE>webapp.setWar(warFile.toString());<NEW_LINE>webapp.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern", ".*/jetty-servlet-api-[^/]*\\.jar$");<NEW_LINE>server.setHandler(webapp);<NEW_LINE>// Register new transaction manager in JNDI<NEW_LINE>// At runtime, the webapp accesses this as java:comp/UserTransaction<NEW_LINE>new Transaction(new com.acme.MockUserTransaction());<NEW_LINE>// Define an env entry with webapp scope.<NEW_LINE>// THIS ENTRY IS OVERRIDDEN BY THE ENTRY IN jetty-env.xml<NEW_LINE>new EnvEntry(webapp, "maxAmount", 100d, true);<NEW_LINE>// Register a mock DataSource scoped to the webapp<NEW_LINE>new Resource(server, "jdbc/mydatasource", new com.acme.MockDataSource());<NEW_LINE>// Add JNDI context to server for dump<NEW_LINE>server.addBean(new NamingDump());<NEW_LINE>// Configure a LoginService<NEW_LINE>String realmResourceName = "etc/realm.properties";<NEW_LINE>ClassLoader classLoader = ServerWithAnnotations.class.getClassLoader();<NEW_LINE>URL realmProps = classLoader.getResource(realmResourceName);<NEW_LINE>if (realmProps == null)<NEW_LINE>throw new FileNotFoundException("Unable to find " + realmResourceName);<NEW_LINE>HashLoginService loginService = new HashLoginService();<NEW_LINE>loginService.setName("Test Realm");<NEW_LINE>loginService.<MASK><NEW_LINE>server.addBean(loginService);<NEW_LINE>return server;<NEW_LINE>}
setConfig(realmProps.toExternalForm());
1,465,261
public PiecewisePolynomialResult interpolate(final double[] xValues, final double[][] yValuesMatrix) {<NEW_LINE>ArgChecker.notNull(xValues, "xValues");<NEW_LINE>ArgChecker.notNull(yValuesMatrix, "yValuesMatrix");<NEW_LINE>ArgChecker.isTrue(xValues.length == yValuesMatrix[0].length, "(xValues length = yValuesMatrix's row vector length)");<NEW_LINE>ArgChecker.isTrue(xValues.length > 1, "Data points should be more than 1");<NEW_LINE>final int nDataPts = xValues.length;<NEW_LINE>final int dim = yValuesMatrix.length;<NEW_LINE>for (int i = 0; i < nDataPts; ++i) {<NEW_LINE>ArgChecker.isFalse(Double.isNaN(xValues[i]), "xValues containing NaN");<NEW_LINE>ArgChecker.isFalse(Double.isInfinite(xValues[i]), "xValues containing Infinity");<NEW_LINE>for (int j = 0; j < dim; ++j) {<NEW_LINE>ArgChecker.isFalse(Double.isNaN(yValuesMatrix[j][i]), "yValuesMatrix containing NaN");<NEW_LINE>ArgChecker.isFalse(Double.isInfinite(yValuesMatrix[j][i]), "yValuesMatrix containing Infinity");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double[] xValuesSrt = Arrays.copyOf(xValues, nDataPts);<NEW_LINE>int[] sortedPositions = IntStream.range(0, nDataPts).toArray();<NEW_LINE>DoubleArrayMath.sortPairs(xValuesSrt, sortedPositions);<NEW_LINE>ArgChecker.noDuplicatesSorted(xValuesSrt, "xValues");<NEW_LINE>DoubleMatrix[] coefMatrix = new DoubleMatrix[dim];<NEW_LINE>for (int i = 0; i < dim; ++i) {<NEW_LINE>double[] yValuesSrt = DoubleArrayMath.reorderedCopy(yValuesMatrix[i], sortedPositions);<NEW_LINE>coefMatrix[i] = solve(xValuesSrt, yValuesSrt);<NEW_LINE>}<NEW_LINE>final int nIntervals = <MASK><NEW_LINE>final int nCoefs = coefMatrix[0].columnCount();<NEW_LINE>double[][] resMatrix = new double[dim * nIntervals][nCoefs];<NEW_LINE>for (int i = 0; i < nIntervals; ++i) {<NEW_LINE>for (int j = 0; j < dim; ++j) {<NEW_LINE>resMatrix[dim * i + j] = coefMatrix[j].row(i).toArray();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < (nIntervals * dim); ++i) {<NEW_LINE>for (int j = 0; j < nCoefs; ++j) {<NEW_LINE>ArgChecker.isFalse(Double.isNaN(resMatrix[i][j]), "Too large input");<NEW_LINE>ArgChecker.isFalse(Double.isInfinite(resMatrix[i][j]), "Too large input");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new PiecewisePolynomialResult(DoubleArray.copyOf(xValuesSrt), DoubleMatrix.copyOf(resMatrix), nCoefs, dim);<NEW_LINE>}
coefMatrix[0].rowCount();
869,804
// /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>// DecryptedDirectMessageListener implementation<NEW_LINE>// /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>@Override<NEW_LINE>public void onDirectMessage(DecryptedMessageWithPubKey decryptedMessageWithPubKey, NodeAddress peerNodeAddress) {<NEW_LINE>// Handler for incoming offer availability requests<NEW_LINE>// We get an encrypted message but don't do the signature check as we don't know the peer yet.<NEW_LINE>// A basic sig check is in done also at decryption time<NEW_LINE><MASK><NEW_LINE>if (networkEnvelope instanceof OfferAvailabilityRequest) {<NEW_LINE>handleOfferAvailabilityRequest((OfferAvailabilityRequest) networkEnvelope, peerNodeAddress);<NEW_LINE>} else if (networkEnvelope instanceof AckMessage) {<NEW_LINE>AckMessage ackMessage = (AckMessage) networkEnvelope;<NEW_LINE>if (ackMessage.getSourceType() == AckMessageSourceType.OFFER_MESSAGE) {<NEW_LINE>if (ackMessage.isSuccess()) {<NEW_LINE>log.info("Received AckMessage for {} with offerId {} and uid {}", ackMessage.getSourceMsgClassName(), ackMessage.getSourceId(), ackMessage.getSourceUid());<NEW_LINE>} else {<NEW_LINE>log.warn("Received AckMessage with error state for {} with offerId {} and errorMessage={}", ackMessage.getSourceMsgClassName(), ackMessage.getSourceId(), ackMessage.getErrorMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
NetworkEnvelope networkEnvelope = decryptedMessageWithPubKey.getNetworkEnvelope();
929,650
public void visitMapUpdate(BeamOpcode opcode, int failLabel, Arg src, Arg dst, Arg[] keys, Arg[] vals) {<NEW_LINE>if (!src.type.equals(EMAP_TYPE)) {<NEW_LINE>visitTest(BeamOpcode.<MASK><NEW_LINE>src.type = EMAP_TYPE;<NEW_LINE>}<NEW_LINE>boolean is_exact_no_label = (opcode == BeamOpcode.put_map_exact) && (failLabel == 0);<NEW_LINE>if (opcode == BeamOpcode.put_map_exact && !is_exact_no_label) {<NEW_LINE>for (int i = 0; i < keys.length; i++) {<NEW_LINE>push(src, EMAP_TYPE);<NEW_LINE>push(keys[i], EOBJECT_TYPE);<NEW_LINE>mv.visitMethodInsn(INVOKEVIRTUAL, EMAP_TYPE.getInternalName(), "has_key", "(Lerjang/EObject;)Z");<NEW_LINE>mv.visitJumpInsn(IFEQ, getLabel(failLabel));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>push(src, EMAP_TYPE);<NEW_LINE>for (int i = 0; i < keys.length; i++) {<NEW_LINE>push(keys[i], EOBJECT_TYPE);<NEW_LINE>push(vals[i], EOBJECT_TYPE);<NEW_LINE>mv.visitMethodInsn(INVOKEVIRTUAL, EMAP_TYPE.getInternalName(), is_exact_no_label ? "update" : "put", "(Lerjang/EObject;Lerjang/EObject;)Lerjang/EMap;");<NEW_LINE>}<NEW_LINE>pop(dst, EMAP_TYPE);<NEW_LINE>}
is_map, failLabel, src, EMAP_TYPE);
327,353
public FacetLabel nextFacetLabel(int docId, String facetDimension) throws IOException {<NEW_LINE>if (facetDimension == null) {<NEW_LINE>throw new IllegalArgumentException("Input facet dimension cannot be null");<NEW_LINE>}<NEW_LINE>final int parentOrd = taxoReader.getOrdinal(new FacetLabel(facetDimension));<NEW_LINE>if (parentOrd == INVALID_ORDINAL) {<NEW_LINE>throw new IllegalArgumentException("Category ordinal not found for facet dimension: " + facetDimension);<NEW_LINE>}<NEW_LINE>if (currentDocId != docId) {<NEW_LINE>if (docId < currentDocId) {<NEW_LINE>throw new IllegalArgumentException("docs out of order: previous docId=" + currentDocId + " current docId=" + docId);<NEW_LINE>}<NEW_LINE>currentDocId = docId;<NEW_LINE>currentDocHasValues = ordinalValues.advanceExact(docId);<NEW_LINE>if (currentDocHasValues) {<NEW_LINE>currentDocOrdinalCount = ordinalValues.docValueCount();<NEW_LINE>currentPos = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (currentDocHasValues == false) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>assert currentPos <= currentDocOrdinalCount;<NEW_LINE>if (currentPos == currentDocOrdinalCount) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (parents == null) {<NEW_LINE>parents = taxoReader<MASK><NEW_LINE>}<NEW_LINE>do {<NEW_LINE>int ord = (int) ordinalValues.nextValue();<NEW_LINE>currentPos++;<NEW_LINE>if (isDescendant(ord, parentOrd) == true) {<NEW_LINE>return taxoReader.getPath(ord);<NEW_LINE>}<NEW_LINE>} while (currentPos < currentDocOrdinalCount);<NEW_LINE>return null;<NEW_LINE>}
.getParallelTaxonomyArrays().parents();
916,093
protected void drawGuiContainerBackgroundLayer(float partialTick, int mouseX, int mouseY) {<NEW_LINE>GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);<NEW_LINE>bindGuiTexture();<NEW_LINE>int sx = (width - xSize) / 2;<NEW_LINE>int sy = (height - ySize) / 2;<NEW_LINE>drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize);<NEW_LINE>targetList.drawScreen(mouseX, mouseY, partialTick);<NEW_LINE>super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);<NEW_LINE>if (getOwner().getEnergy().getEnergyStored() < getOwner().getEnergy().getMaxUsage(CapacitorKey.DIALING_DEVICE_POWER_USE_TELEPORT)) {<NEW_LINE>// FIXME I18N<NEW_LINE>String txt = TextFormatting.DARK_RED + "No Power";<NEW_LINE>renderInfoMessage(sx, sy, txt, 0x000000);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (telepad.getEnergy().getEnergyStored() <= 0) {<NEW_LINE>// FIXME I18N<NEW_LINE>String txt = TextFormatting.DARK_RED + "Telepad not powered";<NEW_LINE>renderInfoMessage(sx, sy, txt, 0x000000);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (targetList.getSelectedElement() == null) {<NEW_LINE>// FIXME I18N<NEW_LINE>String txt = TextFormatting.DARK_RED + "Enter Target";<NEW_LINE>renderInfoMessage(sx, sy, txt, 0x000000);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>bindGuiTexture();<NEW_LINE>int progressScaled = Util.getProgressScaled(progressScale, telepad);<NEW_LINE>drawTexturedModalRect(sx + progressX, sy + progressY, 0, ySize, progressScaled, 10);<NEW_LINE>Entity e = telepad.getCurrentTarget();<NEW_LINE>if (e != null) {<NEW_LINE>String name = e.getName();<NEW_LINE>renderInfoMessage(<MASK><NEW_LINE>} else if (telepad.wasBlocked()) {<NEW_LINE>String s = Lang.GUI_TELEPAD_ERROR_BLOCKED.get();<NEW_LINE>renderInfoMessage(sx, sy, s, 0xAA0000);<NEW_LINE>}<NEW_LINE>}
sx, sy, name, 0x000000);
1,377,612
protected void configureGraphicalViewer() {<NEW_LINE>super.configureGraphicalViewer();<NEW_LINE>this.getGraphicalViewer().getControl().setBackground(UIUtils.getColorRegistry().get(ERDUIConstants.COLOR_ERD_DIAGRAM_BACKGROUND));<NEW_LINE>GraphicalViewer graphicalViewer = getGraphicalViewer();<NEW_LINE>DBPPreferenceStore store = ERDUIActivator.getDefault().getPreferences();<NEW_LINE>graphicalViewer.setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, store.getBoolean(ERDUIConstants.PREF_GRID_ENABLED));<NEW_LINE>graphicalViewer.setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, store.getBoolean(ERDUIConstants.PREF_GRID_ENABLED));<NEW_LINE>graphicalViewer.setProperty(SnapToGrid.PROPERTY_GRID_SPACING, new Dimension(store.getInt(ERDUIConstants.PREF_GRID_WIDTH), store.getInt(ERDUIConstants.PREF_GRID_HEIGHT)));<NEW_LINE>// initialize actions<NEW_LINE>createActions();<NEW_LINE>// Setup zoom manager<NEW_LINE>ZoomManager zoomManager = rootPart.getZoomManager();<NEW_LINE>List<String> zoomLevels = new ArrayList<>(3);<NEW_LINE>zoomLevels.add(ZoomManager.FIT_ALL);<NEW_LINE>zoomLevels.add(ZoomManager.FIT_WIDTH);<NEW_LINE>zoomLevels.add(ZoomManager.FIT_HEIGHT);<NEW_LINE>zoomManager.setZoomLevelContributions(zoomLevels);<NEW_LINE>zoomManager.setZoomLevels(new double[] { .1, .1, .2, .3, .5, .6, .7, .8, .9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0<MASK><NEW_LINE>IAction zoomIn = new ZoomInAction(zoomManager);<NEW_LINE>IAction zoomOut = new ZoomOutAction(zoomManager);<NEW_LINE>addAction(zoomIn);<NEW_LINE>addAction(zoomOut);<NEW_LINE>addAction(new DiagramToggleHandAction(editDomain.getPaletteViewer()));<NEW_LINE>graphicalViewer.addSelectionChangedListener(event -> {<NEW_LINE>String status;<NEW_LINE>IStructuredSelection selection = (IStructuredSelection) event.getSelection();<NEW_LINE>if (selection.isEmpty()) {<NEW_LINE>status = "";<NEW_LINE>} else if (selection.size() == 1) {<NEW_LINE>status = CommonUtils.toString(selection.getFirstElement());<NEW_LINE>} else {<NEW_LINE>status = selection.size() + " objects";<NEW_LINE>}<NEW_LINE>if (progressControl != null) {<NEW_LINE>progressControl.setInfo(status);<NEW_LINE>}<NEW_LINE>updateActions(editPartActionIDs);<NEW_LINE>});<NEW_LINE>}
, 2.5, 3, 4 });
839,071
public com.amazonaws.services.iotsitewise.model.TooManyTagsException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.iotsitewise.model.TooManyTagsException tooManyTagsException = new com.amazonaws.services.iotsitewise.model.TooManyTagsException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("resourceName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>tooManyTagsException.setResourceName(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 tooManyTagsException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
85,994
public io.kubernetes.client.proto.V1Certificates.CertificateSigningRequestSpec buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1Certificates.CertificateSigningRequestSpec result = new io.kubernetes.client.<MASK><NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.request_ = request_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.signerName_ = signerName_;<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.expirationSeconds_ = expirationSeconds_;<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>usages_ = usages_.getUnmodifiableView();<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000008);<NEW_LINE>}<NEW_LINE>result.usages_ = usages_;<NEW_LINE>if (((from_bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>to_bitField0_ |= 0x00000008;<NEW_LINE>}<NEW_LINE>result.username_ = username_;<NEW_LINE>if (((from_bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>to_bitField0_ |= 0x00000010;<NEW_LINE>}<NEW_LINE>result.uid_ = uid_;<NEW_LINE>if (((bitField0_ & 0x00000040) == 0x00000040)) {<NEW_LINE>groups_ = groups_.getUnmodifiableView();<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000040);<NEW_LINE>}<NEW_LINE>result.groups_ = groups_;<NEW_LINE>result.extra_ = internalGetExtra();<NEW_LINE>result.extra_.makeImmutable();<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
proto.V1Certificates.CertificateSigningRequestSpec(this);
21,677
public ExpenseDocument unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ExpenseDocument expenseDocument = new ExpenseDocument();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("ExpenseIndex")) {<NEW_LINE>expenseDocument.setExpenseIndex(IntegerJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("SummaryFields")) {<NEW_LINE>expenseDocument.setSummaryFields(new ListUnmarshaller<ExpenseField>(ExpenseFieldJsonUnmarshaller.getInstance(<MASK><NEW_LINE>} else if (name.equals("LineItemGroups")) {<NEW_LINE>expenseDocument.setLineItemGroups(new ListUnmarshaller<LineItemGroup>(LineItemGroupJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return expenseDocument;<NEW_LINE>}
)).unmarshall(context));
931,730
public void updateSession(Song song, int state) {<NEW_LINE>final boolean playing = (state & PlaybackService.FLAG_PLAYING) != 0;<NEW_LINE>final PlaybackService service = PlaybackService.get(mContext);<NEW_LINE>PlaybackStateCompat playbackState = new PlaybackStateCompat.Builder().setState(playing ? PlaybackStateCompat.STATE_PLAYING : PlaybackStateCompat.STATE_PAUSED, service.getPosition(), 1.0f).setActions(PlaybackStateCompat.ACTION_PLAY | PlaybackStateCompat.ACTION_STOP | PlaybackStateCompat.ACTION_PAUSE | PlaybackStateCompat.ACTION_PLAY_PAUSE | PlaybackStateCompat.ACTION_SEEK_TO | PlaybackStateCompat.ACTION_SKIP_TO_NEXT | PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS).build();<NEW_LINE>if (song != null) {<NEW_LINE>final Bitmap cover = song.getMediumCover(mContext);<NEW_LINE>MediaMetadataCompat.Builder metadataBuilder = new MediaMetadataCompat.Builder().putString(MediaMetadataCompat.METADATA_KEY_ARTIST, song.artist).putString(MediaMetadataCompat.METADATA_KEY_ALBUM, song.album).putString(MediaMetadataCompat.METADATA_KEY_TITLE, song.title).putLong(MediaMetadataCompat.METADATA_KEY_DURATION, song.duration);<NEW_LINE>boolean showCover = SharedPrefHelper.getSettings(mContext).getBoolean(PrefKeys.COVER_ON_LOCKSCREEN, PrefDefaults.COVER_ON_LOCKSCREEN);<NEW_LINE>if (showCover) {<NEW_LINE>metadataBuilder.putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, cover);<NEW_LINE>}<NEW_LINE>// logic copied from FullPlaybackActivity.updateQueuePosition()<NEW_LINE>if (PlaybackService.finishAction(service.getState()) != SongTimeline.FINISH_RANDOM) {<NEW_LINE>metadataBuilder.putLong(MediaMetadataCompat.METADATA_KEY_TRACK_NUMBER, service.getTimelinePosition() + 1);<NEW_LINE>metadataBuilder.putLong(MediaMetadataCompat.<MASK><NEW_LINE>}<NEW_LINE>mMediaSession.setMetadata(metadataBuilder.build());<NEW_LINE>}<NEW_LINE>mMediaSession.setPlaybackState(playbackState);<NEW_LINE>mMediaSession.setActive(true);<NEW_LINE>}
METADATA_KEY_NUM_TRACKS, service.getTimelineLength());
1,178,745
void visitYield(Node n) {<NEW_LINE>if (n.getParent().isExprResult()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (decomposer.canExposeExpression(n) != ExpressionDecomposer.DecompositionType.UNDECOMPOSABLE) {<NEW_LINE>decomposer.maybeExposeExpression(n);<NEW_LINE>} else {<NEW_LINE>String link = "https://github.com/google/closure-compiler/wiki/FAQ" + "#i-get-an-undecomposable-expression-error-for-my-yield-or-await-expression" + "-what-do-i-do";<NEW_LINE>String suggestion = "Please rewrite the yield or await as a separate statement.";<NEW_LINE>String message <MASK><NEW_LINE>compiler.report(JSError.make(n, Es6ToEs3Util.CANNOT_CONVERT, message));<NEW_LINE>}<NEW_LINE>}
= "Undecomposable expression: " + suggestion + "\nSee " + link;
1,222,767
public StackConfigurationManager unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StackConfigurationManager stackConfigurationManager = new StackConfigurationManager();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>stackConfigurationManager.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Version", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>stackConfigurationManager.setVersion(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 stackConfigurationManager;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,554,445
ASTNode parse(ResourceBundle language, TokenList tokenList) {<NEW_LINE>TokenList list = tokenList;<NEW_LINE>ASTNode node = new ASTNode(), cr;<NEW_LINE>ArrayList<ASTNode> nodes = new ArrayList<ASTNode>();<NEW_LINE>ArrayList<Object> values = new ArrayList<Object>();<NEW_LINE>while ((cr = subExpression.parse(language, list)).isSuccess()) {<NEW_LINE>nodes.add(cr);<NEW_LINE>values.<MASK><NEW_LINE>list = cr.getRemainingTokens();<NEW_LINE>if (atMostOne) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!(atLeastOne && nodes.size() == 0)) {<NEW_LINE>node.setChildren(nodes.toArray(new ASTNode[0]));<NEW_LINE>node.setRemainingTokens(list);<NEW_LINE>node.setSuccess(true);<NEW_LINE>node.setValue(atMostOne ? (values.size() > 0 ? values.get(0) : null) : values.toArray());<NEW_LINE>generateValue(node);<NEW_LINE>}<NEW_LINE>return node;<NEW_LINE>}
add(cr.getValue());
1,074,624
private void printArbitrageProblem(ArbitrageProblem arbitrageProblem) {<NEW_LINE>if (arbitrageProblem == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuilder arbitrageTable = new StringBuilder();<NEW_LINE>String[] currencyNames = arbitrageProblem.getCurrencyNames();<NEW_LINE>int currencyNamesLength = <MASK><NEW_LINE>int leftColumnSpaceFormat = currencyNamesLength;<NEW_LINE>int currencyNameSpaceFormat = currencyNamesLength + 6;<NEW_LINE>int conversionRateSpaceFormat = 10;<NEW_LINE>// Initial cell is blank<NEW_LINE>arbitrageTable.append(String.format("%" + leftColumnSpaceFormat + "s", ""));<NEW_LINE>// First line<NEW_LINE>for (String currencyName : arbitrageProblem.getCurrencyNames()) {<NEW_LINE>arbitrageTable.append(String.format("%" + currencyNameSpaceFormat + "s", currencyName));<NEW_LINE>}<NEW_LINE>arbitrageTable.append("\n");<NEW_LINE>double[][] conversionRates = arbitrageProblem.getConversionRates();<NEW_LINE>for (int currency1 = 0; currency1 < conversionRates.length; currency1++) {<NEW_LINE>arbitrageTable.append(String.format("%-" + leftColumnSpaceFormat + "s", currencyNames[currency1]));<NEW_LINE>for (int currency2 = 0; currency2 < conversionRates.length; currency2++) {<NEW_LINE>arbitrageTable.append(String.format("%" + conversionRateSpaceFormat + ".4f", conversionRates[currency1][currency2]));<NEW_LINE>}<NEW_LINE>arbitrageTable.append("\n");<NEW_LINE>}<NEW_LINE>StdOut.println(arbitrageTable.toString());<NEW_LINE>}
currencyNames[0].length();
1,322,927
public synchronized // Make it synchronized to guarantee thread-safe<NEW_LINE>void startNewPrimaryClient() {<NEW_LINE>// Exit any running tManagerClient if there is any to release<NEW_LINE>// the thread in tmanagerClientExecutor<NEW_LINE>if (tManagerClient != null) {<NEW_LINE>tManagerClient.stop();<NEW_LINE>tManagerClient.getNIOLooper().exitLoop();<NEW_LINE>}<NEW_LINE>// Construct the new TManagerClient<NEW_LINE>final NIOLooper looper;<NEW_LINE>try {<NEW_LINE>looper = new NIOLooper();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException("Could not create the NIOLooper", e);<NEW_LINE>}<NEW_LINE>SystemConfig systemConfig = (SystemConfig) SingletonRegistry.INSTANCE.getSingleton(SystemConfig.HERON_SYSTEM_CONFIG);<NEW_LINE>HeronSocketOptions socketOptions = new HeronSocketOptions(TypeUtils.getByteAmount(tmanagerClientConfig.get(KEY_NETWORK_WRITE_BATCH_SIZE_BYTES)), TypeUtils.getDuration(tmanagerClientConfig.get(KEY_NETWORK_WRITE_BATCH_TIME_MS), ChronoUnit.MILLIS), TypeUtils.getByteAmount(tmanagerClientConfig.get(KEY_NETWORK_READ_BATCH_SIZE_BYTES)), TypeUtils.getDuration(tmanagerClientConfig.get(KEY_NETWORK_READ_BATCH_TIME_MS), ChronoUnit.MILLIS), TypeUtils.getByteAmount(tmanagerClientConfig.get(KEY_SOCKET_SEND_BUFFER_BYTES)), TypeUtils.getByteAmount(tmanagerClientConfig.get(KEY_SOCKET_RECEIVED_BUFFER_BYTES)<MASK><NEW_LINE>// Reset the Consumer<NEW_LINE>metricsCommunicator.setConsumer(looper);<NEW_LINE>tManagerClient = new TManagerClient(looper, currentTManagerLocation.getHost(), currentTManagerLocation.getServerPort(), socketOptions, metricsCommunicator, TypeUtils.getDuration(tmanagerClientConfig.get(KEY_TMANAGER_RECONNECT_INTERVAL_SEC), ChronoUnit.SECONDS));<NEW_LINE>int attempts = startedAttempts.incrementAndGet();<NEW_LINE>LOG.severe(String.format("Starting TManagerClient for the %d time.", attempts));<NEW_LINE>tmanagerClientExecutor.execute(tManagerClient);<NEW_LINE>}
), systemConfig.getMetricsMgrNetworkOptionsMaximumPacketSize());
1,376,477
public void rawBegin(final OTransaction iTx) {<NEW_LINE>checkOpenness();<NEW_LINE>checkIfActive();<NEW_LINE>if (currentTx.isActive() && iTx.equals(currentTx)) {<NEW_LINE>currentTx.begin();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<ORID, OTransactionAbstract.LockedRecordMetadata> noTxLockedRecords = null;<NEW_LINE>if (!currentTx.isActive() && iTx instanceof OTransactionOptimistic) {<NEW_LINE>noTxLockedRecords = ((OTransactionAbstract) currentTx).getInternalLocks();<NEW_LINE>}<NEW_LINE>currentTx.rollback(true, 0);<NEW_LINE>// WAKE UP LISTENERS<NEW_LINE>for (ODatabaseListener listener : browseListeners()) try {<NEW_LINE>listener.onBeforeTxBegin(this);<NEW_LINE>} catch (Exception e) {<NEW_LINE>final String message = "Error before the transaction begin";<NEW_LINE>OLogManager.instance().error(this, message, e);<NEW_LINE>throw OException.wrapException(<MASK><NEW_LINE>}<NEW_LINE>currentTx = iTx;<NEW_LINE>if (iTx instanceof OTransactionOptimistic) {<NEW_LINE>((OTransactionOptimistic) iTx).setNoTxLocks(noTxLockedRecords);<NEW_LINE>}<NEW_LINE>currentTx.begin();<NEW_LINE>}
new OTransactionBlockedException(message), e);
1,750,807
private UpdateBucketSearchResult findBucketForUpdate(final K key, final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>long pageIndex = ROOT_INDEX;<NEW_LINE>final ArrayList<Long> path = new ArrayList<>(8);<NEW_LINE>final ArrayList<Integer> itemIndexes = new ArrayList<>(8);<NEW_LINE>while (true) {<NEW_LINE>if (path.size() > MAX_PATH_LENGTH) {<NEW_LINE>throw new OCellBTreeSingleValueV1Exception("We reached max level of depth of SBTree but still found nothing, seems like tree is in corrupted state. You should rebuild index related to given query.", this);<NEW_LINE>}<NEW_LINE>path.add(pageIndex);<NEW_LINE>final OCacheEntry bucketEntry = loadPageForRead(atomicOperation, fileId, pageIndex, false);<NEW_LINE>try {<NEW_LINE>@SuppressWarnings("ObjectAllocationInLoop")<NEW_LINE>final CellBTreeBucketSingleValueV1<K> keyBucket = new CellBTreeBucketSingleValueV1<>(bucketEntry);<NEW_LINE>final int index = keyBucket.find(key, keySerializer, encryption);<NEW_LINE>if (keyBucket.isLeaf()) {<NEW_LINE>itemIndexes.add(index);<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>if (index >= 0) {<NEW_LINE>pageIndex = keyBucket.getRight(index);<NEW_LINE>itemIndexes.add(index + 1);<NEW_LINE>} else {<NEW_LINE>final int insertionIndex = -index - 1;<NEW_LINE>if (insertionIndex >= keyBucket.size()) {<NEW_LINE>pageIndex = keyBucket.getRight(insertionIndex - 1);<NEW_LINE>} else {<NEW_LINE>pageIndex = keyBucket.getLeft(insertionIndex);<NEW_LINE>}<NEW_LINE>itemIndexes.add(insertionIndex);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releasePageFromRead(atomicOperation, bucketEntry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
UpdateBucketSearchResult(itemIndexes, path, index);
530,200
public PerformanceInsightsMetricDimensionGroup unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PerformanceInsightsMetricDimensionGroup performanceInsightsMetricDimensionGroup = new PerformanceInsightsMetricDimensionGroup();<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("Group", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>performanceInsightsMetricDimensionGroup.setGroup(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Dimensions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>performanceInsightsMetricDimensionGroup.setDimensions(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Limit", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>performanceInsightsMetricDimensionGroup.setLimit(context.getUnmarshaller(Integer.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 performanceInsightsMetricDimensionGroup;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
89,701
private static boolean createTabs(GridWindowVO mWindowVO) {<NEW_LINE>mWindowVO.Tabs <MASK><NEW_LINE>boolean firstTab = true;<NEW_LINE>int tabNo = 0;<NEW_LINE>for (MTab tab : ASPUtil.getInstance(mWindowVO.ctx).getWindowTabs(mWindowVO.AD_Window_ID)) {<NEW_LINE>if (!tab.isActive()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (mWindowVO.AD_Table_ID == 0)<NEW_LINE>mWindowVO.AD_Table_ID = tab.getAD_Table_ID();<NEW_LINE>// Create TabVO<NEW_LINE>GridTabVO mTabVO = // isRO<NEW_LINE>GridTabVO.// isRO<NEW_LINE>create(// isRO<NEW_LINE>mWindowVO, // isRO<NEW_LINE>tabNo, // isRO<NEW_LINE>tab, // onlyCurrentRows<NEW_LINE>mWindowVO.WindowType.equals(WINDOWTYPE_QUERY), mWindowVO.WindowType.equals(WINDOWTYPE_TRX));<NEW_LINE>if (mTabVO == null && firstTab)<NEW_LINE>// don't continue if first tab is null<NEW_LINE>break;<NEW_LINE>if (mTabVO != null) {<NEW_LINE>if (!mTabVO.IsReadOnly && "N".equals(mWindowVO.IsReadWrite))<NEW_LINE>mTabVO.IsReadOnly = true;<NEW_LINE>mWindowVO.Tabs.add(mTabVO);<NEW_LINE>// must be same as mWindow.getTab(x)<NEW_LINE>tabNo++;<NEW_LINE>firstTab = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// No Tabs<NEW_LINE>if (tabNo == 0 || mWindowVO.Tabs.size() == 0) {<NEW_LINE>CLogger.get().log(Level.SEVERE, "No Tabs - AD_Window_ID = " + mWindowVO.AD_Window_ID);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Put base table of window in ctx (for VDocAction)<NEW_LINE>Env.setContext(mWindowVO.ctx, mWindowVO.WindowNo, "BaseTable_ID", mWindowVO.AD_Table_ID);<NEW_LINE>return true;<NEW_LINE>}
= new ArrayList<GridTabVO>();
928,128
private void AddMenuItemRemove(int x, String FileName) {<NEW_LINE>int y;<NEW_LINE>FilePopupMenuItem.add(new javax.swing.JMenuItem());<NEW_LINE>y = FilePopupMenuItem.size() - 1;<NEW_LINE>FilePopupMenuItem.get(y).setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/trash.png")));<NEW_LINE>FilePopupMenuItem.get(y).setText("Remove " + FileName);<NEW_LINE>FilePopupMenuItem.get(y).<MASK><NEW_LINE>FilePopupMenuItem.get(y).setActionCommand(FileName);<NEW_LINE>FilePopupMenuItem.get(y).addActionListener(new java.awt.event.ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>FileRemoveESP(evt.getActionCommand());<NEW_LINE>// FileListReload not needed<NEW_LINE>}<NEW_LINE>});<NEW_LINE>FilePopupMenu.get(x).add(FilePopupMenuItem.get(y));<NEW_LINE>}
setToolTipText("Execute command file.remove(\"" + FileName + "\") and delete file from NodeMCU filesystem");
1,165,788
public void storeTo(Preferences prefs) {<NEW_LINE>if (prefs == null)<NEW_LINE>return;<NEW_LINE>prefs.put(PREFIX + PROP_FONT_FAMILY, font.getFamily());<NEW_LINE>prefs.putInt(PREFIX + PROP_FONT_STYLE, font.getStyle());<NEW_LINE>prefs.putInt(PREFIX + PROP_FONT_SIZE, fontSize);<NEW_LINE>prefs.putInt(PREFIX + PROP_TAB_SIZE, tabSize);<NEW_LINE>prefs.putInt(PREFIX + PROP_HISTORY_SIZE, historySize);<NEW_LINE>prefs.putInt(PREFIX + PROP_FOREGROUND, foreground.getRGB());<NEW_LINE>prefs.putInt(PREFIX + PROP_BACKGROUND, background.getRGB());<NEW_LINE>prefs.putInt(PREFIX + PROP_SELECTION_BACKGROUND, selectionBackground.getRGB());<NEW_LINE>prefs.put(PREFIX + PROP_SELECT_BY_WORD_DELIMITERS, selectByWordDelimiters);<NEW_LINE>prefs.putBoolean(PREFIX + PROP_CLICK_TO_TYPE, clickToType);<NEW_LINE>prefs.putBoolean(PREFIX + PROP_SCROLL_ON_INPUT, scrollOnInput);<NEW_LINE>prefs.putBoolean(PREFIX + PROP_SCROLL_ON_OUTPUT, scrollOnOutput);<NEW_LINE>prefs.putBoolean(PREFIX + PROP_LINE_WRAP, lineWrap);<NEW_LINE>prefs.putBoolean(PREFIX + PROP_IGNORE_KEYMAP, ignoreKeymap);<NEW_LINE>prefs.<MASK><NEW_LINE>}
putBoolean(PREFIX + PROP_ALT_SENDS_ESCAPE, altSendsEscape);
1,194,312
public static Asset exportStandaloneAsset(String name, Asset a, String dest, boolean printArchiveContents, boolean overWrite) throws IOException {<NEW_LINE>File outputFile = new File(dest, name);<NEW_LINE>if (outputFile.exists() && !overWrite) {<NEW_LINE>Log.info(ShrinkHelper.class, "exportStandaloneAsset", "Not exporting asset because it already exists at " + outputFile.getAbsolutePath());<NEW_LINE>return a;<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>try (<MASK><NEW_LINE>FileOutputStream fos = new FileOutputStream(outputFile)) {<NEW_LINE>byte[] b = new byte[2048];<NEW_LINE>int bytesRead;<NEW_LINE>while ((bytesRead = is.read(b)) > 0) {<NEW_LINE>sb.append(new String(b));<NEW_LINE>fos.write(b);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (printArchiveContents) {<NEW_LINE>Log.info(ShrinkHelper.class, "exportStandaloneAsset", name + ":" + System.lineSeparator() + sb.toString());<NEW_LINE>}<NEW_LINE>return a;<NEW_LINE>}
InputStream is = a.openStream();
806,308
static Authority fromString(String authority) {<NEW_LINE>if (authority == null || authority.length() == 0) {<NEW_LINE>return NoAuthority.INSTANCE;<NEW_LINE>}<NEW_LINE>Matcher matcher = ZOOKEEPER_AUTH.matcher(authority);<NEW_LINE>if (matcher.matches()) {<NEW_LINE>return new ZookeeperAuthority(matcher.group(1)<MASK><NEW_LINE>}<NEW_LINE>matcher = SINGLE_MASTER_AUTH.matcher(authority);<NEW_LINE>if (matcher.matches()) {<NEW_LINE>return new SingleMasterAuthority(matcher.group(1), Integer.parseInt(matcher.group(2)));<NEW_LINE>}<NEW_LINE>matcher = MULTI_MASTERS_AUTH.matcher(authority);<NEW_LINE>if (matcher.matches()) {<NEW_LINE>return new MultiMasterAuthority(authority.replaceAll("[;+]", ","));<NEW_LINE>}<NEW_LINE>matcher = LOGICAL_ZOOKEEPER_AUTH.matcher(authority);<NEW_LINE>if (matcher.matches()) {<NEW_LINE>return new ZookeeperLogicalAuthority(matcher.group(1));<NEW_LINE>}<NEW_LINE>matcher = LOGICAL_MASTER_AUTH.matcher(authority);<NEW_LINE>if (matcher.matches()) {<NEW_LINE>return new EmbeddedLogicalAuthority(matcher.group(1));<NEW_LINE>}<NEW_LINE>return new UnknownAuthority(authority);<NEW_LINE>}
.replaceAll("[;+]", ","));
729,380
private static List<RowResult<Value>> createRowResults(List<RawSqlRow> sqlRows, Map<Long, byte[]> overflowValues, int expectedNumRows) {<NEW_LINE>List<RowResult<Value>> rowResults = new ArrayList<>(expectedNumRows);<NEW_LINE>ImmutableSortedMap.Builder<byte[], Value> currentRowCells = null;<NEW_LINE>byte[] currentRowName = null;<NEW_LINE>for (RawSqlRow sqlRow : sqlRows) {<NEW_LINE>if (currentRowName == null || !Arrays.equals(sqlRow.cell.getRowName(), currentRowName)) {<NEW_LINE>if (currentRowName != null) {<NEW_LINE>rowResults.add(RowResult.create(currentRowName<MASK><NEW_LINE>}<NEW_LINE>currentRowCells = ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator());<NEW_LINE>currentRowName = sqlRow.cell.getRowName();<NEW_LINE>}<NEW_LINE>byte[] value = getValue(sqlRow, overflowValues);<NEW_LINE>currentRowCells.put(sqlRow.cell.getColumnName(), Value.create(value, sqlRow.ts));<NEW_LINE>}<NEW_LINE>if (currentRowName != null) {<NEW_LINE>rowResults.add(RowResult.create(currentRowName, currentRowCells.build()));<NEW_LINE>}<NEW_LINE>return rowResults;<NEW_LINE>}
, currentRowCells.build()));
140,927
public void releaseUsing(ItemStack stack, Level worldIn, LivingEntity entityLiving, int timeLeft) {<NEW_LINE>if (worldIn.isClientSide || !(entityLiving instanceof Player)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Player player = (Player) entityLiving;<NEW_LINE>float f = getForce(stack, timeLeft) / 2;<NEW_LINE>float range = 5F;<NEW_LINE>Vec3 start = player.getEyePosition(1F);<NEW_LINE>Vec3 look = player.getLookAngle();<NEW_LINE>Vec3 direction = start.add(look.x * range, look.y * range, look.z * range);<NEW_LINE>AABB bb = player.getBoundingBox().expandTowards(look.x * range, look.y * range, look.z * range).expandTowards(1, 1, 1);<NEW_LINE>EntityHitResult emop = ProjectileUtil.getEntityHitResult(worldIn, player, start, direction, bb, <MASK><NEW_LINE>if (emop != null) {<NEW_LINE>LivingEntity target = (LivingEntity) emop.getEntity();<NEW_LINE>double targetDist = start.distanceToSqr(target.getEyePosition(1F));<NEW_LINE>// cancel if there's a block in the way<NEW_LINE>BlockHitResult mop = getPlayerPOVHitResult(worldIn, player, ClipContext.Fluid.NONE);<NEW_LINE>double blockDist = mop.getBlockPos().distSqr(start.x, start.y, start.z, true);<NEW_LINE>if (mop.getType() == HitResult.Type.BLOCK && targetDist > blockDist) {<NEW_LINE>playMissSound(player);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>player.getCooldowns().addCooldown(stack.getItem(), 3);<NEW_LINE>target.knockback(f, -look.x, -look.z);<NEW_LINE>if (player instanceof ServerPlayer) {<NEW_LINE>ServerPlayer playerMP = (ServerPlayer) player;<NEW_LINE>TinkerNetwork.getInstance().sendVanillaPacket(new ClientboundSetEntityMotionPacket(player), playerMP);<NEW_LINE>}<NEW_LINE>onSuccess(player, stack);<NEW_LINE>} else {<NEW_LINE>playMissSound(player);<NEW_LINE>}<NEW_LINE>}
(e) -> e instanceof LivingEntity);
403,651
public void prependList(@NotNull ObservableList<T> list) {<NEW_LINE>assert !lists.contains(list) : "List is already contained: " + list;<NEW_LINE>lists.add(0, list);<NEW_LINE>final InternalListModificationListener listener = new InternalListModificationListener(list);<NEW_LINE>list.addListener(listener);<NEW_LINE>// System.out.println("list = " + list + " puttingInMap=" + list.hashCode());<NEW_LINE>sizes.add(<MASK><NEW_LINE>aggregatedList.addAll(0, list);<NEW_LINE>listeners.add(0, listener);<NEW_LINE>assert lists.size() == sizes.size() && lists.size() == listeners.size() : "lists.size=" + lists.size() + " not equal to sizes.size=" + sizes.size() + " or not equal to listeners.size=" + listeners.size();<NEW_LINE>}
0, list.size());
652,137
public DatabaseInputDefinition unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DatabaseInputDefinition databaseInputDefinition = new DatabaseInputDefinition();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("GlueConnectionName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>databaseInputDefinition.setGlueConnectionName(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("DatabaseTableName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>databaseInputDefinition.setDatabaseTableName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TempDirectory", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>databaseInputDefinition.setTempDirectory(S3LocationJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("QueryString", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>databaseInputDefinition.setQueryString(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 databaseInputDefinition;<NEW_LINE>}
class).unmarshall(context));
1,423,636
public byte[] serialize() {<NEW_LINE>int length = 2 + this.chassisId.getLength() + 2 + this.portId.getLength() + 2 + this.ttl.getLength() + 2;<NEW_LINE>for (LLDPTLV tlv : this.optionalTLVList) {<NEW_LINE>if (tlv != null)<NEW_LINE>length += 2 + tlv.getLength();<NEW_LINE>}<NEW_LINE>byte[] data = new byte[length];<NEW_LINE>ByteBuffer bb = ByteBuffer.wrap(data);<NEW_LINE>bb.put(this.chassisId.serialize());<NEW_LINE>bb.put(this.portId.serialize());<NEW_LINE>bb.put(this.ttl.serialize());<NEW_LINE>for (LLDPTLV tlv : this.optionalTLVList) {<NEW_LINE>if (tlv != null)<NEW_LINE>bb.put(tlv.serialize());<NEW_LINE>}<NEW_LINE>// End of LLDPDU<NEW_LINE>bb<MASK><NEW_LINE>if (this.parent != null && this.parent instanceof Ethernet)<NEW_LINE>((Ethernet) this.parent).setEtherType(ethType);<NEW_LINE>return data;<NEW_LINE>}
.putShort((short) 0);
368,415
void oldPaintFeedback(Graphics2D g, Graphics gg, int index) {<NEW_LINE>LayoutSupportManager laysup = targetContainer.getLayoutSupport();<NEW_LINE>Container cont = (Container) formDesigner.getComponent(targetContainer);<NEW_LINE>Container <MASK><NEW_LINE>Point contPos = convertPointFromComponent(0, 0, contDel);<NEW_LINE>g.setColor(formSettings.getSelectionBorderColor());<NEW_LINE>g.translate(contPos.x, contPos.y);<NEW_LINE>Stroke oldStroke = g.getStroke();<NEW_LINE>g.setStroke(ComponentDragger.dashedStroke1);<NEW_LINE>laysup.paintDragFeedback(cont, contDel, showingComponents[0], constraints, this.index, g);<NEW_LINE>g.setStroke(oldStroke);<NEW_LINE>g.translate(-contPos.x, -contPos.y);<NEW_LINE>paintDraggedComponent(showingComponents[0], gg);<NEW_LINE>}
contDel = targetContainer.getContainerDelegate(cont);
768,474
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create schema SomeType ()", path);<NEW_LINE>env.compileDeploy("@name('flow') create dataflow MyDataFlowOne " + "DefaultSupportSourceOp -> outstream<SomeType> {}" + "DefaultSupportCaptureOp(outstream) {}", path);<NEW_LINE>DefaultSupportSourceOp src = new DefaultSupportSourceOp(new Object[] <MASK><NEW_LINE>DefaultSupportCaptureOp<Object> output = new DefaultSupportCaptureOp<Object>();<NEW_LINE>EPDataFlowInstantiationOptions options = new EPDataFlowInstantiationOptions().operatorProvider(new DefaultSupportGraphOpProvider(src, output));<NEW_LINE>final EPDataFlowInstance dfOne = env.runtime().getDataFlowService().instantiate(env.deploymentId("flow"), "MyDataFlowOne", options);<NEW_LINE>dfOne.start();<NEW_LINE>sleep(200);<NEW_LINE>assertEquals(EPDataFlowState.COMPLETE, dfOne.getState());<NEW_LINE>assertEquals(0, output.getAndReset().size());<NEW_LINE>env.undeployAll();<NEW_LINE>}
{ new MyRuntimeException("TestException") });
1,732,615
protected WebRtcServiceState handleStartOutgoingCall(@NonNull WebRtcServiceState currentState, @NonNull RemotePeer remotePeer, @NonNull OfferMessage.Type offerType) {<NEW_LINE>Log.i(TAG, "handleStartOutgoingCall():");<NEW_LINE>WebRtcServiceStateBuilder builder = currentState.builder();<NEW_LINE>remotePeer.dialing();<NEW_LINE>Log.i(TAG, "assign activePeer callId: " + remotePeer.getCallId() + " key: " + remotePeer.hashCode() + " type: " + offerType);<NEW_LINE>boolean isVideoCall = offerType == OfferMessage.Type.VIDEO_CALL;<NEW_LINE>webRtcInteractor.setCallInProgressNotification(TYPE_OUTGOING_RINGING, remotePeer);<NEW_LINE>webRtcInteractor.setDefaultAudioDevice(remotePeer.getId(), isVideoCall ? SignalAudioManager.AudioDevice.SPEAKER_PHONE : SignalAudioManager.AudioDevice.EARPIECE, false);<NEW_LINE>webRtcInteractor.updatePhoneState(WebRtcUtil.getInCallPhoneState(context));<NEW_LINE>webRtcInteractor.initializeAudioForCall();<NEW_LINE>webRtcInteractor.startOutgoingRinger();<NEW_LINE>if (!webRtcInteractor.addNewOutgoingCall(remotePeer.getId(), remotePeer.getCallId().longValue(), isVideoCall)) {<NEW_LINE>Log.i(TAG, "Unable to add new outgoing call");<NEW_LINE>return handleDropCall(currentState, remotePeer.getCallId().longValue());<NEW_LINE>}<NEW_LINE>RecipientUtil.setAndSendUniversalExpireTimerIfNecessary(context, Recipient.resolved(remotePeer.getId()), SignalDatabase.threads().getThreadIdIfExistsFor(remotePeer.getId()));<NEW_LINE>SignalDatabase.sms().insertOutgoingCall(remotePeer.getId(), isVideoCall);<NEW_LINE>EglBaseWrapper.replaceHolder(EglBaseWrapper.OUTGOING_PLACEHOLDER, remotePeer.<MASK><NEW_LINE>webRtcInteractor.retrieveTurnServers(remotePeer);<NEW_LINE>return builder.changeCallSetupState(remotePeer.getCallId()).enableVideoOnCreate(isVideoCall).waitForTelecom(AndroidTelecomUtil.getTelecomSupported()).telecomApproved(false).commit().changeCallInfoState().activePeer(remotePeer).callState(WebRtcViewModel.State.CALL_OUTGOING).commit().changeLocalDeviceState().build();<NEW_LINE>}
getCallId().longValue());
380,449
private void calculateLauncherJvmArgs(GradleInvocation gradleInvocation) {<NEW_LINE>// Add JVM args that were explicitly requested<NEW_LINE>gradleInvocation.launcherJvmArgs.addAll(commandLineJvmOpts);<NEW_LINE>if (isUseDaemon() && !gradleInvocation.buildJvmArgs.isEmpty()) {<NEW_LINE>// Pass build JVM args through to daemon via system property on the launcher JVM<NEW_LINE>String quotedArgs = join(" ", collect(gradleInvocation.buildJvmArgs, input -> String.<MASK><NEW_LINE>gradleInvocation.implicitLauncherJvmArgs.add("-Dorg.gradle.jvmargs=" + quotedArgs);<NEW_LINE>} else {<NEW_LINE>// Have to pass build JVM args directly to launcher JVM<NEW_LINE>gradleInvocation.launcherJvmArgs.addAll(gradleInvocation.buildJvmArgs);<NEW_LINE>}<NEW_LINE>// Set the implicit system properties regardless of whether default JVM args are required or not, this should not interfere with tests' intentions<NEW_LINE>// These will also be copied across to any daemon used<NEW_LINE>for (Map.Entry<String, String> entry : getImplicitJvmSystemProperties().entrySet()) {<NEW_LINE>String key = entry.getKey();<NEW_LINE>String value = entry.getValue();<NEW_LINE>gradleInvocation.implicitLauncherJvmArgs.add(String.format("-D%s=%s", key, value));<NEW_LINE>}<NEW_LINE>if (isDebugLauncher()) {<NEW_LINE>gradleInvocation.implicitLauncherJvmArgs.addAll(DEBUG_ARGS);<NEW_LINE>}<NEW_LINE>gradleInvocation.implicitLauncherJvmArgs.add("-ea");<NEW_LINE>}
format("'%s'", input)));
1,720,542
private void initialize(final Composite composite) {<NEW_LINE>// need to initalize composite now, since getComposite can<NEW_LINE>// be called at any time<NEW_LINE>cConfig = new Composite(composite, SWT.NONE);<NEW_LINE>GridLayout configLayout = new GridLayout();<NEW_LINE>configLayout.marginHeight = 0;<NEW_LINE>configLayout.marginWidth = 0;<NEW_LINE>cConfig.setLayout(configLayout);<NEW_LINE>GridData gridData <MASK><NEW_LINE>cConfig.setLayoutData(gridData);<NEW_LINE>final Label label = new Label(cConfig, SWT.CENTER);<NEW_LINE>Messages.setLanguageText(label, "view.waiting.core");<NEW_LINE>gridData = new GridData(GridData.FILL_BOTH);<NEW_LINE>label.setLayoutData(gridData);<NEW_LINE>// Need to delay initialation until core is done so we can guarantee<NEW_LINE>// all config sections are loaded (ie. plugin ones).<NEW_LINE>// TODO: Maybe add them on the fly?<NEW_LINE>CoreFactory.addCoreRunningListener(core -> Utils.execSWTThread(() -> {<NEW_LINE>_initialize(composite);<NEW_LINE>label.dispose();<NEW_LINE>composite.layout(true, true);<NEW_LINE>}));<NEW_LINE>}
= new GridData(GridData.FILL_BOTH);
144,122
public void printJson(JsonWriter writer) throws IOException {<NEW_LINE>List<ConditionalElement<List<String>>> lists = new ArrayList<>(interfaceLists.size());<NEW_LINE>lists.addAll(interfaceLists);<NEW_LINE>lists.sort(ConditionalElement.comparator(ProxyConfiguration::compareList));<NEW_LINE>writer.append('[');<NEW_LINE>writer.indent();<NEW_LINE>String prefix = "";<NEW_LINE>for (ConditionalElement<List<String>> list : lists) {<NEW_LINE>writer.append(prefix).newline();<NEW_LINE>writer.append('{').indent().newline();<NEW_LINE>ConfigurationConditionPrintable.printConditionAttribute(list.getCondition(), writer);<NEW_LINE>writer.quote("interfaces").append(":").append('[');<NEW_LINE>String typePrefix = "";<NEW_LINE>for (String type : list.getElement()) {<NEW_LINE>writer.append<MASK><NEW_LINE>typePrefix = ",";<NEW_LINE>}<NEW_LINE>writer.append(']');<NEW_LINE>writer.append('}').unindent().newline();<NEW_LINE>prefix = ",";<NEW_LINE>}<NEW_LINE>writer.unindent().newline();<NEW_LINE>writer.append(']');<NEW_LINE>}
(typePrefix).quote(type);
1,792,048
public void changeEntriesTo(List<BibEntry> entries, UndoManager undoManager) {<NEW_LINE>AbstractGroup group = node.getGroup();<NEW_LINE>List<FieldChange> changesRemove = new ArrayList<>();<NEW_LINE>List<FieldChange> changesAdd = new ArrayList<>();<NEW_LINE>// Sort entries into current members and non-members of the group<NEW_LINE>// Current members will be removed<NEW_LINE>// Current non-members will be added<NEW_LINE>List<BibEntry> toRemove = new ArrayList<>(entries.size());<NEW_LINE>List<BibEntry> toAdd = new ArrayList<>(entries.size());<NEW_LINE>for (BibEntry entry : entries) {<NEW_LINE>// Sort according to current state of the entries<NEW_LINE>if (group.contains(entry)) {<NEW_LINE>toRemove.add(entry);<NEW_LINE>} else {<NEW_LINE>toAdd.add(entry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If there are entries to remove<NEW_LINE>if (!toRemove.isEmpty()) {<NEW_LINE>changesRemove = removeEntriesFromGroup(toRemove);<NEW_LINE>}<NEW_LINE>// If there are entries to add<NEW_LINE>if (!toAdd.isEmpty()) {<NEW_LINE>changesAdd = addEntriesToGroup(toAdd);<NEW_LINE>}<NEW_LINE>// Remember undo information<NEW_LINE>if (!changesRemove.isEmpty()) {<NEW_LINE>AbstractUndoableEdit undoRemove = <MASK><NEW_LINE>if (!changesAdd.isEmpty() && (undoRemove != null)) {<NEW_LINE>// we removed and added entries<NEW_LINE>undoRemove.addEdit(UndoableChangeEntriesOfGroup.getUndoableEdit(this, changesAdd));<NEW_LINE>}<NEW_LINE>undoManager.addEdit(undoRemove);<NEW_LINE>} else if (!changesAdd.isEmpty()) {<NEW_LINE>undoManager.addEdit(UndoableChangeEntriesOfGroup.getUndoableEdit(this, changesAdd));<NEW_LINE>}<NEW_LINE>}
UndoableChangeEntriesOfGroup.getUndoableEdit(this, changesRemove);
1,376,428
public RelativeTimeRange unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RelativeTimeRange relativeTimeRange = new RelativeTimeRange();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("StartPercentage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>relativeTimeRange.setStartPercentage(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("EndPercentage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>relativeTimeRange.setEndPercentage(context.getUnmarshaller(Integer.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("First", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>relativeTimeRange.setFirst(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Last", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>relativeTimeRange.setLast(context.getUnmarshaller(Integer.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 relativeTimeRange;<NEW_LINE>}
class).unmarshall(context));
1,304,919
public static void rookAttack(List<List<Integer>> A) {<NEW_LINE>int m = A.size(), n = A.<MASK><NEW_LINE>boolean hasFirstRowZero = A.get(0).contains(0);<NEW_LINE>boolean hasFirstColumnZero = A.stream().anyMatch(row -> row.get(0) == 0);<NEW_LINE>for (int i = 1; i < m; ++i) {<NEW_LINE>for (int j = 1; j < n; ++j) {<NEW_LINE>if (A.get(i).get(j) == 0) {<NEW_LINE>A.get(i).set(0, 0);<NEW_LINE>A.get(0).set(j, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 1; i < m; ++i) {<NEW_LINE>if (A.get(i).get(0) == 0) {<NEW_LINE>Collections.fill(A.get(i), 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int j = 1; j < n; ++j) {<NEW_LINE>if (A.get(0).get(j) == 0) {<NEW_LINE>final int idx = j;<NEW_LINE>A.stream().forEach(row -> row.set(idx, 0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasFirstRowZero) {<NEW_LINE>Collections.fill(A.get(0), 0);<NEW_LINE>}<NEW_LINE>if (hasFirstColumnZero) {<NEW_LINE>A.stream().forEach(row -> row.set(0, 0));<NEW_LINE>}<NEW_LINE>}
get(0).size();
1,565,793
public GetRegexPatternSetResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetRegexPatternSetResult getRegexPatternSetResult = new GetRegexPatternSetResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getRegexPatternSetResult;<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("RegexPatternSet", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getRegexPatternSetResult.setRegexPatternSet(RegexPatternSetJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getRegexPatternSetResult;<NEW_LINE>}
().unmarshall(context));
691,659
public Result updateRdbAnalyze(@RequestBody RDBAnalyze rdbAnalyze) {<NEW_LINE>try {<NEW_LINE>taskService.delTask(<MASK><NEW_LINE>if (rdbAnalyze.isAutoAnalyze()) {<NEW_LINE>if (taskService.vaildCronExpress(rdbAnalyze.getSchedule())) {<NEW_LINE>if (rdbAnalyzeService.updateRdbAnalyze(rdbAnalyze)) {<NEW_LINE>try {<NEW_LINE>taskService.addTask(rdbAnalyze, RDBScheduleJob.class);<NEW_LINE>return Result.successResult("update success!");<NEW_LINE>} catch (SchedulerException e) {<NEW_LINE>LOG.error("schedule job update failed!message:{}", e.getMessage());<NEW_LINE>return Result.failResult("schedule job update failed!");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return Result.failResult("update data failed!");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return Result.failResult("cron expression has error,please check!");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (rdbAnalyzeService.updateRdbAnalyze(rdbAnalyze)) {<NEW_LINE>return Result.successResult("update success!");<NEW_LINE>} else {<NEW_LINE>return Result.failResult("update data failed!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SchedulerException e) {<NEW_LINE>LOG.error("schedule job delete failed!message:{}", e.getMessage());<NEW_LINE>return Result.failResult("schedule job delete failed!");<NEW_LINE>}<NEW_LINE>}
"rdb" + rdbAnalyze.getId());
881,956
public ECPoint.AbstractF2m tau() {<NEW_LINE>if (this.isInfinity()) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>ECCurve curve = this.getCurve();<NEW_LINE>int coord = curve.getCoordinateSystem();<NEW_LINE>ECFieldElement X1 = this.x;<NEW_LINE>switch(coord) {<NEW_LINE>case ECCurve.COORD_AFFINE:<NEW_LINE>case ECCurve.COORD_LAMBDA_AFFINE:<NEW_LINE>{<NEW_LINE>ECFieldElement Y1 = this.y;<NEW_LINE>return (ECPoint.AbstractF2m) curve.createRawPoint(X1.square(), Y1.square());<NEW_LINE>}<NEW_LINE>case ECCurve.COORD_HOMOGENEOUS:<NEW_LINE>case ECCurve.COORD_LAMBDA_PROJECTIVE:<NEW_LINE>{<NEW_LINE>ECFieldElement Y1 = this.y, Z1 = this.zs[0];<NEW_LINE>return (ECPoint.AbstractF2m) curve.createRawPoint(X1.square(), Y1.square(), new ECFieldElement[] <MASK><NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new IllegalStateException("unsupported coordinate system");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
{ Z1.square() });
60,636
public void handle(Request request, Response response) {<NEW_LINE>super.handle(request, response);<NEW_LINE>ResourceObject resourceObject = null;<NEW_LINE>final Reference baseRef = request.getResourceRef().getBaseRef();<NEW_LINE>request.setRootRef(new Reference(baseRef.toString()));<NEW_LINE>// NICE Normally, the "rootRef" property is set by the VirtualHost, each<NEW_LINE>// time a request is handled by one of its routes.<NEW_LINE>// Email from Jerome, 2008-09-22<NEW_LINE>try {<NEW_LINE>CallContext callContext;<NEW_LINE>callContext = new CallContext(request, response);<NEW_LINE>tlContext.set(callContext);<NEW_LINE>try {<NEW_LINE>ResObjAndMeth resObjAndMeth;<NEW_LINE>resObjAndMeth = requestMatching();<NEW_LINE>callContext.setReadOnly();<NEW_LINE>ResourceMethod resourceMethod = resObjAndMeth.resourceMethod;<NEW_LINE>resourceObject = resObjAndMeth.resourceObject;<NEW_LINE>Object <MASK><NEW_LINE>handleResult(result, resourceMethod);<NEW_LINE>} catch (WebApplicationException e) {<NEW_LINE>// the message of the Exception is not used in the<NEW_LINE>// WebApplicationException<NEW_LINE>jaxRsRespToRestletResp(this.providers.convert(e), null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (RequestHandledException e) {<NEW_LINE>// Exception was handled and data were set into the Response.<NEW_LINE>} finally {<NEW_LINE>Representation entity = request.getEntity();<NEW_LINE>if (entity != null)<NEW_LINE>entity.release();<NEW_LINE>}<NEW_LINE>}
result = invokeMethod(resourceMethod, resourceObject);
1,478,614
public PbShape.Builder serializeShape(Shape argShape) {<NEW_LINE>final PbShape.Builder builder = PbShape.newBuilder();<NEW_LINE>if (signer != null) {<NEW_LINE>Long tag = signer.getTag(argShape);<NEW_LINE>if (tag != null) {<NEW_LINE>builder.setTag(tag);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.setRadius(argShape.m_radius);<NEW_LINE>switch(argShape.m_type) {<NEW_LINE>case CIRCLE:<NEW_LINE>CircleShape c = (CircleShape) argShape;<NEW_LINE>builder.setType(PbShapeType.CIRCLE);<NEW_LINE>builder.setCenter(vecToPb(c.m_p));<NEW_LINE>break;<NEW_LINE>case POLYGON:<NEW_LINE>PolygonShape p = (PolygonShape) argShape;<NEW_LINE>builder.setType(PbShapeType.POLYGON);<NEW_LINE>builder.setCentroid(vecToPb(p.m_centroid));<NEW_LINE>for (int i = 0; i < p.m_count; i++) {<NEW_LINE>builder.addPoints(vecToPb(p.m_vertices[i]));<NEW_LINE>builder.addNormals(vecToPb(p.m_normals[i]));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case EDGE:<NEW_LINE>EdgeShape e = (EdgeShape) argShape;<NEW_LINE>builder.setType(PbShapeType.EDGE);<NEW_LINE>builder.setV0(vecToPb(e.m_vertex0));<NEW_LINE>builder.setV1(vecToPb(e.m_vertex1));<NEW_LINE>builder.setV2(vecToPb(e.m_vertex2));<NEW_LINE>builder.setV3(vecToPb(e.m_vertex3));<NEW_LINE>builder.setHas0(e.m_hasVertex0);<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case CHAIN:<NEW_LINE>ChainShape h = (ChainShape) argShape;<NEW_LINE>builder.setType(PbShapeType.CHAIN);<NEW_LINE>for (int i = 0; i < h.m_count; i++) {<NEW_LINE>builder.addPoints(vecToPb(h.m_vertices[i]));<NEW_LINE>}<NEW_LINE>builder.setPrev(vecToPb(h.m_prevVertex));<NEW_LINE>builder.setNext(vecToPb(h.m_nextVertex));<NEW_LINE>builder.setHas0(h.m_hasPrevVertex);<NEW_LINE>builder.setHas3(h.m_hasNextVertex);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>UnsupportedObjectException ex = new UnsupportedObjectException("Currently only encodes circle and polygon shapes", Type.SHAPE);<NEW_LINE>if (listener == null || listener.isUnsupported(ex)) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
builder.setHas3(e.m_hasVertex3);
1,443,777
public static void main(String[] args) throws InterruptedException, MQClientException {<NEW_LINE>Tracer tracer = initTracer();<NEW_LINE><MASK><NEW_LINE>consumer.getDefaultMQPushConsumerImpl().registerConsumeMessageHook(new ConsumeMessageOpenTracingHookImpl(tracer));<NEW_LINE>consumer.subscribe("TopicTest", "*");<NEW_LINE>consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_FIRST_OFFSET);<NEW_LINE>consumer.setConsumeTimestamp("20181109221800");<NEW_LINE>consumer.registerMessageListener(new MessageListenerConcurrently() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext context) {<NEW_LINE>System.out.printf("%s Receive New Messages: %s %n", Thread.currentThread().getName(), msgs);<NEW_LINE>return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>consumer.start();<NEW_LINE>System.out.printf("Consumer Started.%n");<NEW_LINE>}
DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("CID_JODIE_1");
1,854,449
final GetBlacklistReportsResult executeGetBlacklistReports(GetBlacklistReportsRequest getBlacklistReportsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getBlacklistReportsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetBlacklistReportsRequest> request = null;<NEW_LINE>Response<GetBlacklistReportsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetBlacklistReportsRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Pinpoint Email");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetBlacklistReports");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetBlacklistReportsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetBlacklistReportsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(getBlacklistReportsRequest));
987,023
public DetachThingPrincipalResult detachThingPrincipal(DetachThingPrincipalRequest detachThingPrincipalRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(detachThingPrincipalRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DetachThingPrincipalRequest> request = null;<NEW_LINE>Response<DetachThingPrincipalResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new <MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DetachThingPrincipalResult, JsonUnmarshallerContext> unmarshaller = new DetachThingPrincipalResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DetachThingPrincipalResult> responseHandler = new JsonResponseHandler<DetachThingPrincipalResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
DetachThingPrincipalRequestMarshaller().marshall(detachThingPrincipalRequest);
747,463
private static boolean initializeJOpenVR() {<NEW_LINE>hmdErrorStore = IntBuffer.allocate(1);<NEW_LINE>vrSystem = null;<NEW_LINE>JOpenVRLibrary.VR_InitInternal(hmdErrorStore, JOpenVRLibrary.EVRApplicationType.EVRApplicationType_VRApplication_Scene);<NEW_LINE>if (hmdErrorStore.get(0) == 0) {<NEW_LINE>// ok, try and get the vrSystem pointer..<NEW_LINE>vrSystem = new VR_IVRSystem_FnTable(JOpenVRLibrary.VR_GetGenericInterface(JOpenVRLibrary.IVRSystem_Version, hmdErrorStore));<NEW_LINE>}<NEW_LINE>if (vrSystem == null || hmdErrorStore.get(0) != 0) {<NEW_LINE>String errorString = jopenvr.JOpenVRLibrary.VR_GetVRInitErrorAsEnglishDescription(hmdErrorStore.get(<MASK><NEW_LINE>logger.info("vrSystem initialization failed:" + errorString);<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>vrSystem.setAutoSynch(false);<NEW_LINE>vrSystem.read();<NEW_LINE>logger.info("OpenVR initialized & VR connected.");<NEW_LINE>hmdTrackedDevicePoseReference = new TrackedDevicePose_t.ByReference();<NEW_LINE>hmdTrackedDevicePoses = (TrackedDevicePose_t[]) hmdTrackedDevicePoseReference.toArray(JOpenVRLibrary.k_unMaxTrackedDeviceCount);<NEW_LINE>// disable all this stuff which kills performance<NEW_LINE>hmdTrackedDevicePoseReference.setAutoRead(false);<NEW_LINE>hmdTrackedDevicePoseReference.setAutoWrite(false);<NEW_LINE>hmdTrackedDevicePoseReference.setAutoSynch(false);<NEW_LINE>for (int i = 0; i < JOpenVRLibrary.k_unMaxTrackedDeviceCount; i++) {<NEW_LINE>hmdTrackedDevicePoses[i].setAutoRead(false);<NEW_LINE>hmdTrackedDevicePoses[i].setAutoWrite(false);<NEW_LINE>hmdTrackedDevicePoses[i].setAutoSynch(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
0)).getString(0);
1,125,009
public void onRemoveAtmosphereResource(Broadcaster b, AtmosphereResource r) {<NEW_LINE>// We track cancelled and resumed connection only.<NEW_LINE>BroadcasterTracker t = states.get(r.uuid());<NEW_LINE><MASK><NEW_LINE>if (e.isClosedByClient() || !r.isResumed() && !e.isResumedOnTimeout()) {<NEW_LINE>logger.trace("Deleting the state of {} with broadcaster {}", r.uuid(), b.getID());<NEW_LINE>if (t != null) {<NEW_LINE>t.remove(b);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// The BroadcasterTracker was swapped<NEW_LINE>onAddAtmosphereResource(b, r);<NEW_LINE>logger.trace("Keeping the state of {} with broadcaster {}", r.uuid(), b.getID());<NEW_LINE>logger.trace("State for {} with broadcaster {}", r.uuid(), t != null ? t.ids() : "null");<NEW_LINE>}<NEW_LINE>}
AtmosphereResourceEvent e = r.getAtmosphereResourceEvent();
625,531
public Collection<String> wordsNearest(INDArray words, int top) {<NEW_LINE>words = adjustRank(words);<NEW_LINE>if (lookupTable instanceof InMemoryLookupTable) {<NEW_LINE>InMemoryLookupTable l = (InMemoryLookupTable) lookupTable;<NEW_LINE>INDArray syn0 = l.getSyn0();<NEW_LINE>if (!normalized) {<NEW_LINE>synchronized (this) {<NEW_LINE>if (!normalized) {<NEW_LINE>syn0.diviColumnVector(syn0.norm2(1));<NEW_LINE>normalized = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>INDArray similarity = Transforms.unitVec(words).mmul(syn0.transpose());<NEW_LINE>List<Double> highToLowSimList = getTopN(similarity, top + 20);<NEW_LINE>List<WordSimilarity> result = new ArrayList<>();<NEW_LINE>for (int i = 0; i < highToLowSimList.size(); i++) {<NEW_LINE>String word = vocabCache.wordAtIndex(highToLowSimList.get(i).intValue());<NEW_LINE>if (word != null && !word.equals("UNK") && !word.equals("STOP")) {<NEW_LINE>INDArray <MASK><NEW_LINE>double sim = Transforms.cosineSim(words, otherVec);<NEW_LINE>result.add(new WordSimilarity(word, sim));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.sort(result, new SimilarityComparator());<NEW_LINE>return getLabels(result, top);<NEW_LINE>}<NEW_LINE>Counter<String> distances = new Counter<>();<NEW_LINE>for (String s : vocabCache.words()) {<NEW_LINE>INDArray otherVec = lookupTable.vector(s);<NEW_LINE>double sim = Transforms.cosineSim(words, otherVec);<NEW_LINE>distances.incrementCount(s, (float) sim);<NEW_LINE>}<NEW_LINE>distances.keepTopNElements(top);<NEW_LINE>return distances.keySet();<NEW_LINE>}
otherVec = lookupTable.vector(word);
117,067
final CreateAssessmentResult executeCreateAssessment(CreateAssessmentRequest createAssessmentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createAssessmentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateAssessmentRequest> request = null;<NEW_LINE>Response<CreateAssessmentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateAssessmentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createAssessmentRequest));<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, "AuditManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateAssessment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateAssessmentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new CreateAssessmentResultJsonUnmarshaller());
602,127
public void readFields(String value, int index, List<FileField> fileFieldList, List<Integer> ignoreFields, Mapper mapper, FileTab fileTab) throws AxelorException, ClassNotFoundException {<NEW_LINE>FileField fileField = new FileField();<NEW_LINE>fileField.setSequence(index);<NEW_LINE>if (Strings.isNullOrEmpty(value)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String importType = StringUtils.substringBetween(value, "(", ")");<NEW_LINE>if (!Strings.isNullOrEmpty(importType) && (importType.equalsIgnoreCase(forSelectUseValues) || importType.equalsIgnoreCase(forSelectUseTitles) || importType.equalsIgnoreCase(forSelectUseTranslatedTitles))) {<NEW_LINE>fileField.setForSelectUse<MASK><NEW_LINE>} else {<NEW_LINE>fileField.setImportType(this.getImportType(value, importType));<NEW_LINE>}<NEW_LINE>value = value.split("\\(")[0];<NEW_LINE>String importField = null;<NEW_LINE>String subImportField = null;<NEW_LINE>if (value.contains(".")) {<NEW_LINE>importField = value.substring(0, value.indexOf("."));<NEW_LINE>subImportField = value.substring(value.indexOf(".") + 1, value.length());<NEW_LINE>} else {<NEW_LINE>importField = value;<NEW_LINE>}<NEW_LINE>boolean isValid = this.checkFields(mapper, importField, subImportField);<NEW_LINE>if (isValid) {<NEW_LINE>this.setImportFields(mapper, fileField, importField, subImportField);<NEW_LINE>} else {<NEW_LINE>ignoreFields.add(index);<NEW_LINE>}<NEW_LINE>fileFieldList.add(fileField);<NEW_LINE>fileField = fileFieldRepository.save(fileField);<NEW_LINE>fileTab.addFileFieldListItem(fileField);<NEW_LINE>}
(this.getForStatusSelect(importType));
869,937
private void init(Context context) {<NEW_LINE>binding.getRoot().setBackgroundColor(ThemeStore.primaryColor(context));<NEW_LINE>binding.vwBg.setOnClickListener(null);<NEW_LINE>primaryTextColor = MaterialValueHelper.getPrimaryTextColor(context, ColorUtils.isColorLight(ThemeStore.primaryColor(context)));<NEW_LINE>setColor(<MASK><NEW_LINE>setColor(binding.ivSkipNext.getDrawable());<NEW_LINE>setColor(binding.ivChapter.getDrawable());<NEW_LINE>setColor(binding.ivTimer.getDrawable());<NEW_LINE>binding.seekBar.setEnabled(false);<NEW_LINE>binding.seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStartTrackingTouch(SeekBar seekBar) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStopTrackingTouch(SeekBar seekBar) {<NEW_LINE>if (callback != null) {<NEW_LINE>callback.onStopTrackingTouch(seekBar.getProgress());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
binding.ivSkipPrevious.getDrawable());
1,238,063
public int generateTypeAnnotationsOnCodeAttribute() {<NEW_LINE>int attributesNumber = 0;<NEW_LINE>List<AnnotationContext> allTypeAnnotationContexts = ((TypeAnnotationCodeStream) this.codeStream).allTypeAnnotationContexts;<NEW_LINE>for (int i = 0, max = this.codeStream.allLocalsCounter; i < max; i++) {<NEW_LINE>LocalVariableBinding localVariable = this.codeStream.locals[i];<NEW_LINE>if (localVariable.isCatchParameter())<NEW_LINE>continue;<NEW_LINE>LocalDeclaration declaration = localVariable.declaration;<NEW_LINE>if (declaration == null || (declaration.isArgument() && ((declaration.bits & ASTNode.IsUnionType) == 0)) || (localVariable.initializationCount == 0) || ((declaration.bits & ASTNode.HasTypeAnnotations) == 0)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int targetType = ((localVariable.tagBits & TagBits.IsResource) == 0) ? AnnotationTargetTypeConstants.LOCAL_VARIABLE : AnnotationTargetTypeConstants.RESOURCE_VARIABLE;<NEW_LINE>declaration.getAllAnnotationContexts(targetType, localVariable, allTypeAnnotationContexts);<NEW_LINE>}<NEW_LINE>ExceptionLabel[<MASK><NEW_LINE>for (int i = 0, max = this.codeStream.exceptionLabelsCounter; i < max; i++) {<NEW_LINE>ExceptionLabel exceptionLabel = exceptionLabels[i];<NEW_LINE>if (exceptionLabel.exceptionTypeReference != null && (exceptionLabel.exceptionTypeReference.bits & ASTNode.HasTypeAnnotations) != 0) {<NEW_LINE>exceptionLabel.exceptionTypeReference.getAllAnnotationContexts(AnnotationTargetTypeConstants.EXCEPTION_PARAMETER, i, allTypeAnnotationContexts, exceptionLabel.se7Annotations);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int size = allTypeAnnotationContexts.size();<NEW_LINE>attributesNumber = completeRuntimeTypeAnnotations(attributesNumber, null, (node) -> size > 0, () -> allTypeAnnotationContexts);<NEW_LINE>return attributesNumber;<NEW_LINE>}
] exceptionLabels = this.codeStream.exceptionLabels;
797,741
public int execute(String sql, CreateView create, String index) throws SQLException {<NEW_LINE>String alias = create.getName().toString();<NEW_LINE>alias = Heading.findOriginal(sql, alias, "\\s+view\\s+", "\\s+as\\s+");<NEW_LINE>QueryBody queryBody = create.getQuery().getQueryBody();<NEW_LINE>if (!(queryBody instanceof QuerySpecification))<NEW_LINE>throw new SQLException("Statement does not contain expected query specifiction");<NEW_LINE>QuerySpecification querySpec = (QuerySpecification) queryBody;<NEW_LINE>if (!querySpec.getFrom().isPresent())<NEW_LINE>throw new SQLException("Add atleast one INDEX to the query to create the view from");<NEW_LINE>QueryState state = new BasicQueryState(sql, new Heading(), props);<NEW_LINE>List<QuerySource> relations = new RelationParser().process(querySpec.getFrom().get(), null);<NEW_LINE>String[] indices = new String[relations.size()];<NEW_LINE>for (int i = 0; i < relations.size(); i++) indices[i] = relations.get(i).getSource();<NEW_LINE>new SelectParser().process(querySpec.getSelect(), state);<NEW_LINE>IndicesAliasesResponse response;<NEW_LINE>if (querySpec.getWhere().isPresent()) {<NEW_LINE>QueryBuilder query = new WhereParser().process(querySpec.getWhere().get(), state).getQuery();<NEW_LINE>response = client.admin().indices().prepareAliases().addAlias(indices, alias, query).execute().actionGet();<NEW_LINE>} else {<NEW_LINE>response = client.admin().indices().prepareAliases().addAlias(indices, alias)<MASK><NEW_LINE>}<NEW_LINE>if (!response.isAcknowledged())<NEW_LINE>throw new SQLException("Elasticsearch failed to create the specified alias");<NEW_LINE>// trigger a reload of the table&column set for the connection<NEW_LINE>this.statement.getConnection().getTypeMap();<NEW_LINE>// the number of altered rows<NEW_LINE>return 0;<NEW_LINE>}
.execute().actionGet();
1,010,096
public ModelAssembler addImport(Path importPath) {<NEW_LINE>Objects.requireNonNull(importPath, "The importPath provided to ModelAssembler#addImport was null");<NEW_LINE>if (Files.isDirectory(importPath)) {<NEW_LINE>try (Stream<Path> files = Files.walk(importPath, FileVisitOption.FOLLOW_LINKS).filter(p -> !p.equals(importPath)).filter(p -> Files.isDirectory(p) || Files.isRegularFile(p))) {<NEW_LINE>files.forEach(this::addImport);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>} else if (Files.isRegularFile(importPath)) {<NEW_LINE>inputStreamModels.put(importPath.toString(), () -> {<NEW_LINE>try {<NEW_LINE>return Files.newInputStream(importPath);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ModelImportException("Unable to import Smithy model from " + importPath + ": " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>throw new ModelImportException("Cannot find import file: " + importPath);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
ModelImportException("Error loading the contents of " + importPath, e);
297,897
public static void horizontal(Kernel1D_S32 kernel, ImageBorder_S32 input, GrayS32 output) {<NEW_LINE>final int[] dataDst = output.data;<NEW_LINE>final <MASK><NEW_LINE>final int offset = kernel.getOffset();<NEW_LINE>final int kernelWidth = kernel.getWidth();<NEW_LINE>final int width = output.getWidth();<NEW_LINE>final int height = output.getHeight();<NEW_LINE>final int borderRight = kernelWidth - offset - 1;<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>int indexDest = output.startIndex + y * output.stride;<NEW_LINE>for (int x = 0; x < offset; x++) {<NEW_LINE>int total = 0;<NEW_LINE>for (int k = 0; k < kernelWidth; k++) {<NEW_LINE>total += input.get(x + k - offset, y) * dataKer[k];<NEW_LINE>}<NEW_LINE>dataDst[indexDest++] = total;<NEW_LINE>}<NEW_LINE>indexDest = output.startIndex + y * output.stride + width - borderRight;<NEW_LINE>for (int x = width - borderRight; x < width; x++) {<NEW_LINE>int total = 0;<NEW_LINE>for (int k = 0; k < kernelWidth; k++) {<NEW_LINE>total += input.get(x + k - offset, y) * dataKer[k];<NEW_LINE>}<NEW_LINE>dataDst[indexDest++] = total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int[] dataKer = kernel.data;
109,671
public void focusLost(FocusEvent e) {<NEW_LINE>if (// set by actionButton<NEW_LINE>e.isTemporary() || m_lookup == null || !m_button.isEnabled())<NEW_LINE>return;<NEW_LINE>// Text Lost focus<NEW_LINE>if (e.getSource() == m_text) {<NEW_LINE>String text = m_text.getText();<NEW_LINE>log.config(m_columnName + " (Text) " + m_columnName + " = " + m_value + " - " + text);<NEW_LINE>m_haveFocus = false;<NEW_LINE>// Skip if empty<NEW_LINE>if ((m_value == null && m_text.getText().length() == 0))<NEW_LINE>return;<NEW_LINE>if (m_lastDisplay.equals(text))<NEW_LINE>return;<NEW_LINE>//<NEW_LINE>// re-display<NEW_LINE>actionText();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Combo lost focus<NEW_LINE>if (e.getSource() != m_combo && e.getSource() != m_combo.getEditor().getEditorComponent())<NEW_LINE>return;<NEW_LINE>// Advise listeners of the change.<NEW_LINE>ActionEvent evt = new ActionEvent(this, 0, "vlookup-update");<NEW_LINE>processEvent(evt);<NEW_LINE>if (m_lookup.isValidated() && !m_lookup.hasInactive()) {<NEW_LINE>m_haveFocus = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// prevents actionPerformed<NEW_LINE>m_settingFocus = true;<NEW_LINE>//<NEW_LINE>log.config(m_columnName + " = " + m_combo.getSelectedItem());<NEW_LINE>Object obj = m_combo.getSelectedItem();<NEW_LINE>// Set value<NEW_LINE>if (obj != null) {<NEW_LINE>m_combo.setSelectedItem(obj);<NEW_LINE>// original model may not have item<NEW_LINE>if (!m_combo.getSelectedItem().equals(obj)) {<NEW_LINE>log.<MASK><NEW_LINE>m_combo.addItem(obj);<NEW_LINE>m_combo.setSelectedItem(obj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// actionCombo(getValue());<NEW_LINE>m_settingFocus = false;<NEW_LINE>// can gain focus again<NEW_LINE>m_haveFocus = false;<NEW_LINE>}
fine(m_columnName + " - added to combo - " + obj);
420,608
private String handleParameters(HttpServletRequest request) {<NEW_LINE>List<InternetRadio> radios = settingsService.getAllInternetRadios(true);<NEW_LINE>for (InternetRadio radio : radios) {<NEW_LINE>Integer id = radio.getId();<NEW_LINE>String streamUrl = getParameter(request, "streamUrl", id);<NEW_LINE>String homepageUrl = getParameter(request, "homepageUrl", id);<NEW_LINE>String name = getParameter(request, "name", id);<NEW_LINE>boolean enabled = getParameter(request, "enabled", id) != null;<NEW_LINE>boolean delete = getParameter(request, "delete", id) != null;<NEW_LINE>if (delete) {<NEW_LINE>settingsService.deleteInternetRadio(id);<NEW_LINE>} else {<NEW_LINE>if (name == null) {<NEW_LINE>return "internetradiosettings.noname";<NEW_LINE>}<NEW_LINE>if (streamUrl == null) {<NEW_LINE>return "internetradiosettings.nourl";<NEW_LINE>}<NEW_LINE>settingsService.updateInternetRadio(new InternetRadio(id, name, streamUrl, homepageUrl, enabled, new Date()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String name = StringUtils.trimToNull<MASK><NEW_LINE>String streamUrl = StringUtils.trimToNull(request.getParameter("streamUrl"));<NEW_LINE>String homepageUrl = StringUtils.trimToNull(request.getParameter("homepageUrl"));<NEW_LINE>boolean enabled = StringUtils.trimToNull(request.getParameter("enabled")) != null;<NEW_LINE>if (name != null || streamUrl != null || homepageUrl != null) {<NEW_LINE>if (name == null) {<NEW_LINE>return "internetradiosettings.noname";<NEW_LINE>}<NEW_LINE>if (streamUrl == null) {<NEW_LINE>return "internetradiosettings.nourl";<NEW_LINE>}<NEW_LINE>settingsService.createInternetRadio(new InternetRadio(name, streamUrl, homepageUrl, enabled, new Date()));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
(request.getParameter("name"));
1,736,463
private void findTypeParamInUnion(Location loc, BType expType, BUnionType actualType, SymbolEnv env, HashSet<BType> resolvedTypes, FindTypeParamResult result) {<NEW_LINE>LinkedHashSet<BType> members = new LinkedHashSet<>();<NEW_LINE>for (BType type : actualType.getMemberTypes()) {<NEW_LINE>if (type.tag == TypeTags.ARRAY) {<NEW_LINE>members.add(((BArrayType) type).eType);<NEW_LINE>}<NEW_LINE>if (type.tag == TypeTags.MAP) {<NEW_LINE>members.add((<MASK><NEW_LINE>}<NEW_LINE>if (TypeTags.isXMLTypeTag(type.tag)) {<NEW_LINE>if (type.tag == TypeTags.XML) {<NEW_LINE>members.add(((BXMLType) type).constraint);<NEW_LINE>}<NEW_LINE>members.add(type);<NEW_LINE>}<NEW_LINE>if (type.tag == TypeTags.RECORD) {<NEW_LINE>for (BField field : ((BRecordType) type).fields.values()) {<NEW_LINE>members.add(field.type);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (type.tag == TypeTags.TUPLE) {<NEW_LINE>members.addAll(((BTupleType) type).getTupleTypes());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BUnionType tupleElementType = BUnionType.create(null, members);<NEW_LINE>findTypeParam(loc, expType, tupleElementType, env, resolvedTypes, result);<NEW_LINE>}
(BMapType) type).constraint);