idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
85,686 | public static void checkCharset(final File file, final String givenCharset, final boolean concurrent) {<NEW_LINE>Thread t = new Thread("FileUtils.checkCharset") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try (final <MASK><NEW_LINE>final BufferedInputStream imp = new BufferedInputStream(fileStream)) {<NEW_LINE>// try-with-resource to close resources<NEW_LINE>List<String> charsets = FileUtils.detectCharset(imp);<NEW_LINE>if (charsets.contains(givenCharset)) {<NEW_LINE>ConcurrentLog.info("checkCharset", "appropriate charset '" + givenCharset + "' for import of " + file + ", is part one detected " + charsets);<NEW_LINE>} else {<NEW_LINE>ConcurrentLog.warn("checkCharset", "possibly wrong charset '" + givenCharset + "' for import of " + file + ", use one of " + charsets);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (concurrent)<NEW_LINE>t.start();<NEW_LINE>else<NEW_LINE>t.run();<NEW_LINE>} | FileInputStream fileStream = new FileInputStream(file); |
1,381,837 | public float[][][] parse(List<String> words, ProbCNFGrammar grammar) {<NEW_LINE>final int N = length(words);<NEW_LINE>final int M = grammar.vars.size();<NEW_LINE>// initialised to 0.0<NEW_LINE>float[][][] P = new float[<MASK><NEW_LINE>for (int i = 0; i < N; i++) {<NEW_LINE>// for each rule of form( X -> words<sub>i</sub>[p]) do<NEW_LINE>// P[X,i,1] <- p<NEW_LINE>for (int j = 0; j < grammar.rules.size(); j++) {<NEW_LINE>Rule r = (Rule) grammar.rules.get(j);<NEW_LINE>if (r.derives(words.get(i))) {<NEW_LINE>// rule is of form X -> w, where w = words[i]<NEW_LINE>// get the index of rule's LHS variable<NEW_LINE>int x = grammar.vars.indexOf(r.lhs.get(0));<NEW_LINE>// not P[X][i][1] because we use 0-based indexing<NEW_LINE>P[x][i][0] = r.PROB;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int length = 2; length <= N; length++) {<NEW_LINE>for (int start = 1; start <= N - length + 1; start++) {<NEW_LINE>for (int len1 = 1; len1 <= length - 1; len1++) {<NEW_LINE>// N.B. the book incorrectly has N-1 instead of length-1<NEW_LINE>int len2 = length - len1;<NEW_LINE>// for each rule of the form X -> Y Z, where Y,Z are variables of the grammar<NEW_LINE>for (Rule r : grammar.rules) {<NEW_LINE>if (r.rhs.size() == 2) {<NEW_LINE>// get index of rule's variables X, Y, and Z<NEW_LINE>int x = grammar.vars.indexOf(r.lhs.get(0));<NEW_LINE>int y = grammar.vars.indexOf(r.rhs.get(0));<NEW_LINE>int z = grammar.vars.indexOf(r.rhs.get(1));<NEW_LINE>P[x][start - 1][length - 1] = Math.max(P[x][start - 1][length - 1], P[y][start - 1][len1 - 1] * P[z][start + len1 - 1][len2 - 1] * r.PROB);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return P;<NEW_LINE>} | M][N][N]; |
946,276 | public StartSentimentDetectionJobResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StartSentimentDetectionJobResult startSentimentDetectionJobResult = new StartSentimentDetectionJobResult();<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 startSentimentDetectionJobResult;<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("JobId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startSentimentDetectionJobResult.setJobId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("JobArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startSentimentDetectionJobResult.setJobArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("JobStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startSentimentDetectionJobResult.setJobStatus(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 startSentimentDetectionJobResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
601,014 | public void executeWithoutPassword(BaseRequest request, BaseResponse response) throws DdlException {<NEW_LINE>if (redirectToMaster(request, response)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String clusterName = ConnectContext.get().getClusterName();<NEW_LINE>if (Strings.isNullOrEmpty(clusterName)) {<NEW_LINE>throw new DdlException("No cluster selected.");<NEW_LINE>}<NEW_LINE>String dbName = request.getSingleParameter(DB_KEY);<NEW_LINE>if (Strings.isNullOrEmpty(dbName)) {<NEW_LINE>throw new DdlException("No database selected.");<NEW_LINE>}<NEW_LINE>String fullDbName = ClusterNamespace.getFullName(clusterName, dbName);<NEW_LINE>String label = request.getSingleParameter(LABEL_KEY);<NEW_LINE>if (Strings.isNullOrEmpty(label)) {<NEW_LINE>throw new DdlException("No label selected.");<NEW_LINE>}<NEW_LINE>// FIXME(cmy)<NEW_LINE>// checkReadPriv(authInfo.fullUserName, fullDbName);<NEW_LINE>Database db = Catalog.getCurrentCatalog().getDbOrDdlException(fullDbName);<NEW_LINE>String state = Catalog.getCurrentGlobalTransactionMgr().getLabelState(db.getId(), label).toString();<NEW_LINE>sendResult(request, <MASK><NEW_LINE>} | response, new Result(state)); |
79,733 | protected void performOperation() {<NEW_LINE>if (askPermission && neededPermissions.size() > 0) {<NEW_LINE>// Check whether file permissions are granted<NEW_LINE>Iterator<String> i = neededPermissions.iterator();<NEW_LINE>while (i.hasNext()) {<NEW_LINE>String perm = i.next();<NEW_LINE>if (!form.isDeniedPermission(perm)) {<NEW_LINE>i.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (needsPermission()) {<NEW_LINE>Log.d(LOG_TAG, method + " need permissions: " + neededPermissions);<NEW_LINE>form.askPermission(new BulkPermissionRequest(component, method, neededPermissions.toArray(new String[0])) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onGranted() {<NEW_LINE>// TODO(ewpatton): Once we have continuation passing, we would continue doing<NEW_LINE>// work here by invoking the command list.<NEW_LINE>}<NEW_LINE>});<NEW_LINE>throw new StopBlocksExecution();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If granted, proceed to do the operation<NEW_LINE>ScopedFile[] filesArray = scopedFiles.keySet().<MASK><NEW_LINE>for (FileInvocation command : commands) {<NEW_LINE>try {<NEW_LINE>command.call(filesArray);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | toArray(new ScopedFile[0]); |
1,060,040 | public ListServicePipelineOutputsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListServicePipelineOutputsResult listServicePipelineOutputsResult = new ListServicePipelineOutputsResult();<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 listServicePipelineOutputsResult;<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("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listServicePipelineOutputsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("outputs", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listServicePipelineOutputsResult.setOutputs(new ListUnmarshaller<Output>(OutputJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listServicePipelineOutputsResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
480,603 | private void drawSwatches(Canvas canvas) {<NEW_LINE>float[] hsv = new float[3];<NEW_LINE>mText.setTextSize(mTextSizePx);<NEW_LINE>// Draw the original swatch<NEW_LINE>canvas.drawRect(mOldSwatchRect, mSwatchOld);<NEW_LINE>Color.colorToHSV(mOriginalColor, hsv);<NEW_LINE>// if (UberColorPickerDialog.isGray(mColor)) //Don't need this right here, but imp't to note<NEW_LINE>// hsv[1] = 0;<NEW_LINE>if (hsv[2] > .5)<NEW_LINE>mText.setColor(Color.BLACK);<NEW_LINE>canvas.drawText("Revert", mOldSwatchRect.left + mSwatchWidthPx / 2 - mText.measureText("Revert") / 2, mOldSwatchRect.top + mButtonTextMarginPx, mText);<NEW_LINE>mText.setColor(Color.WHITE);<NEW_LINE>// Draw the new swatch<NEW_LINE>canvas.drawRect(mNewSwatchRect, mSwatchNew);<NEW_LINE>if (mHSV[2] > .5)<NEW_LINE>mText.setColor(Color.BLACK);<NEW_LINE>canvas.drawText("Accept", mNewSwatchRect.left + mSwatchWidthPx / 2 - mText.measureText("Accept") / 2, mNewSwatchRect.top + mButtonTextMarginPx, mText);<NEW_LINE><MASK><NEW_LINE>mText.setTextSize(mTextSizePx);<NEW_LINE>} | mText.setColor(Color.WHITE); |
1,561,300 | public void testJSONPointer(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>JsonObject json = Json.createObjectBuilder().add("firstName", "Steve").add("lastName", "Watson").add("age", 45).add("phoneNumber", Json.createArrayBuilder().add(Json.createObjectBuilder().add("type", "office").add("number", "507-253-1234"))).add("~/", "specialCharacters").build();<NEW_LINE>// Test whole document pointer<NEW_LINE>JsonPointer p = Json.createPointer("");<NEW_LINE>JsonObject json2 = (JsonObject) p.getValue(json);<NEW_LINE>assertEquals("Json Objects were not equal. json: " + json + " json2: " + json2, json, json2);<NEW_LINE>// Test Pointer to document element<NEW_LINE>JsonArray json3 = Json.createArrayBuilder().add(Json.createObjectBuilder().add("type", "office").add("number", "507-253-1234")).build();<NEW_LINE><MASK><NEW_LINE>JsonArray json4 = (JsonArray) p.getValue(json);<NEW_LINE>assertEquals("JsonArray was not [\"type\":\"office\",\"number\":\"507-253-1234\"]", json3, json4);<NEW_LINE>// Test pointer to array element<NEW_LINE>p = Json.createPointer("/phoneNumber/0/number");<NEW_LINE>JsonString json5 = Json.createValue("507-253-1234");<NEW_LINE>JsonString json6 = (JsonString) p.getValue(json);<NEW_LINE>assertEquals("JsonString was not \"507-253-1234\"", json5, json6);<NEW_LINE>// Test pointer encoding<NEW_LINE>String ep = Json.encodePointer("~1");<NEW_LINE>assertEquals("Encoded pointers were not equal", "~01", ep);<NEW_LINE>String dp = Json.decodePointer("~01");<NEW_LINE>assertEquals("Decoded pointers were not equal", "~1", dp);<NEW_LINE>ep = Json.encodePointer("~/");<NEW_LINE>assertEquals("Encoded pointers were not equal", "~0~1", ep);<NEW_LINE>dp = Json.decodePointer("~0~1");<NEW_LINE>assertEquals("Decoded pointers were not equal", "~/", dp);<NEW_LINE>p = Json.createPointer("/" + ep);<NEW_LINE>json5 = Json.createValue("specialCharacters");<NEW_LINE>json6 = (JsonString) p.getValue(json);<NEW_LINE>assertEquals("Json Pointer value was not \"specialCharacters\"", json5, json6);<NEW_LINE>} | p = Json.createPointer("/phoneNumber"); |
1,705,297 | protected static com.liferay.portal.model.UserTracker update(com.liferay.portal.model.UserTracker userTracker) throws com.liferay.portal.SystemException {<NEW_LINE>UserTrackerPersistence persistence = (UserTrackerPersistence) InstancePool.get(PERSISTENCE);<NEW_LINE>ModelListener listener = null;<NEW_LINE>if (Validator.isNotNull(LISTENER)) {<NEW_LINE>try {<NEW_LINE>listener = (ModelListener) Class.forName(LISTENER).newInstance();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(UserTrackerUtil.class, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (listener != null) {<NEW_LINE>if (isNew) {<NEW_LINE>listener.onBeforeCreate(userTracker);<NEW_LINE>} else {<NEW_LINE>listener.onBeforeUpdate(userTracker);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>userTracker = persistence.update(userTracker);<NEW_LINE>if (listener != null) {<NEW_LINE>if (isNew) {<NEW_LINE>listener.onAfterCreate(userTracker);<NEW_LINE>} else {<NEW_LINE>listener.onAfterUpdate(userTracker);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return userTracker;<NEW_LINE>} | boolean isNew = userTracker.isNew(); |
1,102,437 | public ArtifactConfigOutput unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ArtifactConfigOutput artifactConfigOutput = new ArtifactConfigOutput();<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("S3Encryption", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>artifactConfigOutput.setS3Encryption(S3EncryptionConfigJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return artifactConfigOutput;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,561,848 | public DataObject execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {<NEW_LINE>Revision virtualRevision = getRevisionByRoid(roid);<NEW_LINE>EObject eObject = null;<NEW_LINE>IfcModelSet ifcModelSet = new IfcModelSet();<NEW_LINE>PackageMetaData lastPackageMetaData = null;<NEW_LINE>Map<Integer, Long> pidRoidMap = new HashMap<>();<NEW_LINE>pidRoidMap.put(virtualRevision.getProject().getId(), virtualRevision.getOid());<NEW_LINE>for (ConcreteRevision concreteRevision : virtualRevision.getConcreteRevisions()) {<NEW_LINE>PackageMetaData packageMetaData = getBimServer().getMetaDataManager().getPackageMetaData(concreteRevision.getProject().getSchema());<NEW_LINE>lastPackageMetaData = packageMetaData;<NEW_LINE>IfcModel subModel = new BasicIfcModel(packageMetaData, pidRoidMap);<NEW_LINE>int highestStopId = findHighestStopRid(concreteRevision.getProject(), concreteRevision);<NEW_LINE>OldQuery query = new OldQuery(packageMetaData, concreteRevision.getProject().getId(), concreteRevision.getId(), virtualRevision.getOid(), Deep.NO, highestStopId);<NEW_LINE>eObject = getDatabaseSession().get(null, oid, subModel, query);<NEW_LINE>subModel.getModelMetaData().setDate(concreteRevision.getDate());<NEW_LINE>ifcModelSet.add(subModel);<NEW_LINE>if (eObject != null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IfcModelInterface ifcModel = new BasicIfcModel(lastPackageMetaData, pidRoidMap);<NEW_LINE>if (ifcModelSet.size() > 1) {<NEW_LINE>try {<NEW_LINE>ifcModel = getBimServer().getMergerFactory().createMerger(getDatabaseSession(), getAuthorization().getUoid()).merge(virtualRevision.getProject(), ifcModelSet, new ModelHelper(getBimServer().getMetaDataManager(), ifcModel));<NEW_LINE>} catch (MergeException e) {<NEW_LINE>throw new UserException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ifcModel = ifcModelSet.iterator().next();<NEW_LINE>}<NEW_LINE>if (eObject == null) {<NEW_LINE>throw new UserException("Object not found in this project/revision");<NEW_LINE>}<NEW_LINE>DataObject dataObject = null;<NEW_LINE>if (eObject instanceof IfcRoot) {<NEW_LINE>IfcRoot ifcRoot = (IfcRoot) eObject;<NEW_LINE>String guid = ifcRoot.getGlobalId() != null <MASK><NEW_LINE>String name = ifcRoot.getName() != null ? ifcRoot.getName() : "";<NEW_LINE>dataObject = StoreFactory.eINSTANCE.createDataObject();<NEW_LINE>dataObject.setType(eObject.eClass().getName());<NEW_LINE>((IdEObjectImpl) dataObject).setOid(oid);<NEW_LINE>dataObject.setGuid(guid);<NEW_LINE>dataObject.setName(name);<NEW_LINE>} else {<NEW_LINE>dataObject = StoreFactory.eINSTANCE.createDataObject();<NEW_LINE>dataObject.setType(eObject.eClass().getName());<NEW_LINE>((IdEObjectImpl) dataObject).setOid(oid);<NEW_LINE>dataObject.setName("");<NEW_LINE>dataObject.setGuid("");<NEW_LINE>}<NEW_LINE>fillDataObject(ifcModel.getObjects(), eObject, dataObject);<NEW_LINE>return dataObject;<NEW_LINE>} | ? ifcRoot.getGlobalId() : ""; |
939,172 | private void parseRGStateFromFile(String tmpfilename, BufferedWriter writer, long startOffset) throws IOException {<NEW_LINE>try (FileInputStream fileInputStream = new FileInputStream(tmpfilename)) {<NEW_LINE>long offset = startOffset;<NEW_LINE>while (fileInputStream.available() > 0) {<NEW_LINE>// read type<NEW_LINE>// type should be 0 as Wirecommand.Event type is 0<NEW_LINE>byte[] type = new byte[HEADER];<NEW_LINE>int read = fileInputStream.read(type);<NEW_LINE>assertEquals("should read 4 bytes header", read, HEADER);<NEW_LINE>ByteBuffer b = ByteBuffer.wrap(type);<NEW_LINE>int t = b.getInt();<NEW_LINE>assertEquals("Wirecommand.Event type should be 0", t, TYPE);<NEW_LINE>// read length<NEW_LINE>byte[] len = new byte[LENGTH];<NEW_LINE>read = fileInputStream.read(len);<NEW_LINE>assertEquals("read payload length", read, LENGTH);<NEW_LINE>b = ByteBuffer.wrap(len);<NEW_LINE>int eventLength = b.getInt();<NEW_LINE>byte[] payload = new byte[eventLength];<NEW_LINE><MASK><NEW_LINE>assertEquals("read payload", read, eventLength);<NEW_LINE>b = ByteBuffer.wrap(payload);<NEW_LINE>val serializer = new UpdateOrInitSerializer<>(new ReaderGroupManagerImpl.ReaderGroupStateUpdatesSerializer(), new ReaderGroupManagerImpl.ReaderGroupStateInitSerializer());<NEW_LINE>val result = serializer.deserialize(b);<NEW_LINE>writer.write("Offset: " + offset + "; State: " + result);<NEW_LINE>writer.newLine();<NEW_LINE>offset = offset + HEADER + LENGTH + eventLength;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>} finally {<NEW_LINE>Files.deleteIfExists(Paths.get(tmpfilename));<NEW_LINE>}<NEW_LINE>} | read = fileInputStream.read(payload); |
281,524 | void decode(Decoder decoder, Instruction instruction) {<NEW_LINE>if (decoder.is64bMode) {<NEW_LINE>if ((decoder.options & DecoderOptions.AMD) == 0 || decoder.state_operandSize != OpSize.SIZE16) {<NEW_LINE>instruction.setCode(code64);<NEW_LINE>instruction.setOp0Kind(OpKind.NEAR_BRANCH64);<NEW_LINE>instruction.setNearBranch64(decoder.readUInt32() + decoder.getCurrentInstructionPointer64());<NEW_LINE>} else {<NEW_LINE>instruction.setCode(code16);<NEW_LINE>instruction.setOp0Kind(OpKind.NEAR_BRANCH16);<NEW_LINE>instruction.setNearBranch16((short) (decoder.readUInt16() + decoder.getCurrentInstructionPointer32()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (decoder.state_operandSize != OpSize.SIZE16) {<NEW_LINE>instruction.setCode(code32);<NEW_LINE><MASK><NEW_LINE>instruction.setNearBranch32(decoder.readUInt32() + decoder.getCurrentInstructionPointer32());<NEW_LINE>} else {<NEW_LINE>instruction.setCode(code16);<NEW_LINE>instruction.setOp0Kind(OpKind.NEAR_BRANCH16);<NEW_LINE>instruction.setNearBranch16((short) (decoder.readUInt16() + decoder.getCurrentInstructionPointer32()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | instruction.setOp0Kind(OpKind.NEAR_BRANCH32); |
1,690,018 | private Map<String, String> parseHeader(final byte[] header) {<NEW_LINE>final byte[] name = new byte[32];<NEW_LINE>for (int i = 0; i < 32; i++) {<NEW_LINE>name[i] = header[i + 16];<NEW_LINE>}<NEW_LINE>final byte[] author = new byte[32];<NEW_LINE>for (int i = 0; i < 32; i++) {<NEW_LINE>author[i] = header[i + 48];<NEW_LINE>}<NEW_LINE>final byte[] copyright = new byte[32];<NEW_LINE>for (int i = 0; i < 32; i++) {<NEW_LINE>copyright[i<MASK><NEW_LINE>}<NEW_LINE>Map<String, String> ret = new HashMap<String, String>();<NEW_LINE>ret.put("name", new String(name, StandardCharsets.ISO_8859_1).trim());<NEW_LINE>ret.put("author", new String(author, StandardCharsets.ISO_8859_1).trim());<NEW_LINE>ret.put("publisher", new String(copyright, StandardCharsets.ISO_8859_1).trim());<NEW_LINE>return ret;<NEW_LINE>} | ] = header[i + 80]; |
690,952 | private void gatewayLogin() {<NEW_LINE>String aUrl = null;<NEW_LINE>moziotToken = null;<NEW_LINE>if (mozIotIP.getSecure() != null && mozIotIP.getSecure())<NEW_LINE>aUrl = "https://";<NEW_LINE>else<NEW_LINE>aUrl = "http://";<NEW_LINE>headers = new NameValue[2];<NEW_LINE>headers[0] = new NameValue();<NEW_LINE>headers<MASK><NEW_LINE>headers[0].setValue("application/json");<NEW_LINE>headers[1] = new NameValue();<NEW_LINE>headers[1].setName("Accept");<NEW_LINE>headers[1].setValue("application/json");<NEW_LINE>aUrl = aUrl + mozIotIP.getIp() + ":" + mozIotIP.getPort() + "/login";<NEW_LINE>log.debug("gateway login URL: {}", aUrl);<NEW_LINE>String commandData = "{\"email\": \"" + mozIotIP.getUsername() + "\", \"password\":\"" + mozIotIP.getPassword() + "\"}";<NEW_LINE>log.debug("The login body: {}", commandData);<NEW_LINE>String theData = anHttpClient.doHttpRequest(aUrl, HttpPost.METHOD_NAME, "application/json", commandData, headers);<NEW_LINE>if (theData != null) {<NEW_LINE>log.debug("GET Mozilla login - data: {}", theData);<NEW_LINE>try {<NEW_LINE>moziotToken = new Gson().fromJson(theData, JWT.class);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn("Cannot get login for Mozilla IOT {} Gson Parse Error.", mozIotIP.getName());<NEW_LINE>moziotToken = null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.warn("Could not login {} error: <<<{}>>>", mozIotIP.getName(), theData);<NEW_LINE>}<NEW_LINE>headers = null;<NEW_LINE>} | [0].setName("Content-Type"); |
150,993 | public void run(RegressionEnvironment env) {<NEW_LINE>env.compileDeploy("@public @buseventtype create json schema JsonEvent(a int, b int);\n" + "@name('s0') select * from JsonEvent#keepall").addListener("s0");<NEW_LINE>env.sendEventJson("{\"a\" : 1, \"b\": 2, \"c\": 3}\n", "JsonEvent");<NEW_LINE>Map<String, Object> expectedOne = new LinkedHashMap<>();<NEW_LINE>expectedOne.put("a", 1);<NEW_LINE>expectedOne.put("b", 2);<NEW_LINE>env.assertEventNew("s0", event -> compareMapWBean(expectedOne, event));<NEW_LINE>env.sendEventJson("{\"a\" : 10}\n", "JsonEvent");<NEW_LINE>Map<String, Object> expectedTwo = new LinkedHashMap<>();<NEW_LINE>expectedTwo.put("a", 10);<NEW_LINE>expectedTwo.put("b", null);<NEW_LINE>env.assertEventNew("s0", event -> compareMapWBean(expectedTwo, event));<NEW_LINE>env.sendEventJson("{}\n", "JsonEvent");<NEW_LINE>Map<String, Object> expectedThree = new LinkedHashMap<>();<NEW_LINE>expectedThree.put("a", null);<NEW_LINE>expectedThree.put("b", null);<NEW_LINE>env.assertEventNew("s0", event -> compareMapWBean(expectedThree, event));<NEW_LINE>env.milestone(0);<NEW_LINE>env.assertIterator("s0", it -> {<NEW_LINE>compareMapWBean(expectedOne, it.next());<NEW_LINE>compareMapWBean(expectedTwo, it.next());<NEW_LINE>compareMapWBean(<MASK><NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>} | expectedThree, it.next()); |
98,031 | // ----------------------------------------------------------------<NEW_LINE>private static // returns line-counter<NEW_LINE>// returns line-counter<NEW_LINE>int handleStream(BufferedReader reader, String filename, MIH256<String> mihWithCenters, Map<Hash256, Integer> centersToIndices, int distanceThreshold, int lineCounter, int traceCount, boolean doBruteForceQuery) {<NEW_LINE>while (true) {<NEW_LINE>Hash256AndMetadata<String> inputPair = null;<NEW_LINE>try {<NEW_LINE>inputPair = HashReaderUtil.loadHashAndMetadataFromStream(reader, lineCounter);<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.printf("%s: could not read line %d of file \"%s\".\n", PROGNAME, lineCounter, filename);<NEW_LINE>System.exit(1);<NEW_LINE>} catch (PDQHashFormatException e) {<NEW_LINE>System.err.printf("%s: unparseable hash \"%s\" at line %d of file \"%s\".\n", PROGNAME, e.getUnacceptableInput(), lineCounter + 1, filename);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>if (inputPair == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (traceCount > 0) {<NEW_LINE>if ((lineCounter % traceCount) == 0) {<NEW_LINE>System.err.printf("-- %d\n", lineCounter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lineCounter++;<NEW_LINE>Vector<Hash256AndMetadata<String>> matches = new Vector<Hash256AndMetadata<String>>();<NEW_LINE>Hash256AndMetadata<String> centerPair = null;<NEW_LINE>try {<NEW_LINE>centerPair = doBruteForceQuery ? mihWithCenters.bruteForceQueryAny(inputPair.hash, distanceThreshold) : mihWithCenters.<MASK><NEW_LINE>} catch (MIHDimensionExceededException e) {<NEW_LINE>System.err.printf("%s: %s\n", PROGNAME, e.getErrorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>boolean isCenter = false;<NEW_LINE>int matchClusterIndex = -1;<NEW_LINE>if (centerPair == null) {<NEW_LINE>isCenter = true;<NEW_LINE>int insertionClusterIndex = mihWithCenters.size();<NEW_LINE>mihWithCenters.insert(inputPair.hash, inputPair.metadata);<NEW_LINE>centersToIndices.put(inputPair.hash, insertionClusterIndex);<NEW_LINE>matchClusterIndex = insertionClusterIndex;<NEW_LINE>centerPair = inputPair;<NEW_LINE>} else {<NEW_LINE>matchClusterIndex = centersToIndices.get(centerPair.hash);<NEW_LINE>}<NEW_LINE>System.out.printf("clidx=%d,hash1=%s,hash2=%s,is_center=%d,d=%d,%s\n", matchClusterIndex, inputPair.hash.toString(), centerPair.hash.toString(), isCenter ? 1 : 0, centerPair.hash.hammingDistance(inputPair.hash), inputPair.metadata);<NEW_LINE>}<NEW_LINE>return lineCounter;<NEW_LINE>} | queryAny(inputPair.hash, distanceThreshold); |
1,849,142 | public boolean onContextMenuClick(final ArrayAdapter<ContextMenuItem> adapter, int itemId, final int pos, boolean isChecked, int[] viewCoordinates) {<NEW_LINE>final OsmandSettings settings = mapActivity<MASK><NEW_LINE>final PoiFiltersHelper poiFiltersHelper = mapActivity.getMyApplication().getPoiFilters();<NEW_LINE>final ContextMenuItem item = menuAdapter.getItem(pos);<NEW_LINE>if (item.getSelected() != null) {<NEW_LINE>item.setColor(mapActivity, isChecked ? R.color.osmand_orange : ContextMenuItem.INVALID_ID);<NEW_LINE>}<NEW_LINE>if (itemId == R.string.layer_poi) {<NEW_LINE>PoiUIFilter wiki = poiFiltersHelper.getTopWikiPoiFilter();<NEW_LINE>poiFiltersHelper.clearSelectedPoiFilters(wiki);<NEW_LINE>if (isChecked) {<NEW_LINE>showPoiFilterDialog(adapter, adapter.getItem(pos));<NEW_LINE>} else {<NEW_LINE>adapter.getItem(pos).setDescription(poiFiltersHelper.getSelectedPoiFiltersName(wiki));<NEW_LINE>}<NEW_LINE>} else if (itemId == R.string.layer_amenity_label) {<NEW_LINE>settings.SHOW_POI_LABEL.set(isChecked);<NEW_LINE>} else if (itemId == R.string.shared_string_favorites) {<NEW_LINE>settings.SHOW_FAVORITES.set(isChecked);<NEW_LINE>} else if (itemId == R.string.layer_gpx_layer) {<NEW_LINE>final GpxSelectionHelper selectedGpxHelper = mapActivity.getMyApplication().getSelectedGpxHelper();<NEW_LINE>if (selectedGpxHelper.isShowingAnyGpxFiles()) {<NEW_LINE>selectedGpxHelper.clearAllGpxFilesToShow(true);<NEW_LINE>adapter.getItem(pos).setDescription(selectedGpxHelper.getGpxDescription());<NEW_LINE>} else {<NEW_LINE>showGpxSelectionDialog(adapter, adapter.getItem(pos));<NEW_LINE>}<NEW_LINE>} else if (itemId == R.string.rendering_category_transport) {<NEW_LINE>boolean selected = TransportLinesMenu.isShowLines(mapActivity.getMyApplication());<NEW_LINE>TransportLinesMenu.toggleTransportLines(mapActivity, !selected, result -> {<NEW_LINE>item.setSelected(result);<NEW_LINE>item.setColor(mapActivity, result ? R.color.osmand_orange : ContextMenuItem.INVALID_ID);<NEW_LINE>adapter.notifyDataSetChanged();<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>} else if (itemId == R.string.map_markers) {<NEW_LINE>settings.SHOW_MAP_MARKERS.set(isChecked);<NEW_LINE>} else if (itemId == R.string.layer_map) {<NEW_LINE>if (!OsmandPlugin.isActive(OsmandRasterMapsPlugin.class)) {<NEW_LINE>PluginsFragment.showInstance(mapActivity.getSupportFragmentManager());<NEW_LINE>} else {<NEW_LINE>ContextMenuItem it = adapter.getItem(pos);<NEW_LINE>mapActivity.getMapLayers().selectMapLayer(mapActivity, it, adapter);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>adapter.notifyDataSetChanged();<NEW_LINE>mapActivity.updateLayers();<NEW_LINE>mapActivity.refreshMap();<NEW_LINE>return false;<NEW_LINE>} | .getMyApplication().getSettings(); |
1,535,316 | public Expr apply(Expr expr, Analyzer analyzer, ExprRewriter.ClauseType clauseType) throws AnalysisException {<NEW_LINE>// meet condition<NEW_LINE>if (!(expr instanceof FunctionCallExpr)) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>FunctionCallExpr fnExpr = (FunctionCallExpr) expr;<NEW_LINE>if (!fnExpr.getFnName().getFunction().equalsIgnoreCase("ndv") && !fnExpr.getFnName().getFunction().equalsIgnoreCase("approx_count_distinct")) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>if (fnExpr.getChildren().size() != 1 || !(fnExpr.getChild(0) instanceof SlotRef)) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>SlotRef fnChild0 = (SlotRef) fnExpr.getChild(0);<NEW_LINE>Column column = fnChild0.getColumn();<NEW_LINE>Table table = fnChild0.getTable();<NEW_LINE>if (column == null || table == null || !(table instanceof OlapTable)) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>OlapTable olapTable = (OlapTable) table;<NEW_LINE>// check column<NEW_LINE>String queryColumnName = column.getName();<NEW_LINE>String mvColumnName = CreateMaterializedViewStmt.mvColumnBuilder(AggregateType.HLL_UNION.name(<MASK><NEW_LINE>Column mvColumn = olapTable.getVisibleColumn(mvColumnName);<NEW_LINE>if (mvColumn == null) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>// rewrite expr<NEW_LINE>return rewriteExpr(fnChild0, mvColumn, analyzer);<NEW_LINE>} | ).toLowerCase(), queryColumnName); |
1,579,066 | private boolean pruneEqPredicate(IndexSegment segment, EqPredicate eqPredicate, Map<String, DataSource> dataSourceCache) {<NEW_LINE>String column = eqPredicate.getLhs().getIdentifier();<NEW_LINE>DataSource dataSource = dataSourceCache.computeIfAbsent(column, segment::getDataSource);<NEW_LINE>// NOTE: Column must exist after DataSchemaSegmentPruner<NEW_LINE>assert dataSource != null;<NEW_LINE><MASK><NEW_LINE>Comparable value = convertValue(eqPredicate.getValue(), dataSourceMetadata.getDataType());<NEW_LINE>// Check min/max value<NEW_LINE>if (!checkMinMaxRange(dataSourceMetadata, value)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Check column partition<NEW_LINE>PartitionFunction partitionFunction = dataSourceMetadata.getPartitionFunction();<NEW_LINE>if (partitionFunction != null) {<NEW_LINE>Set<Integer> partitions = dataSourceMetadata.getPartitions();<NEW_LINE>assert partitions != null;<NEW_LINE>if (!partitions.contains(partitionFunction.getPartition(value))) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Check bloom filter<NEW_LINE>BloomFilterReader bloomFilter = dataSource.getBloomFilter();<NEW_LINE>if (bloomFilter != null) {<NEW_LINE>if (!bloomFilter.mightContain(value.toString())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | DataSourceMetadata dataSourceMetadata = dataSource.getDataSourceMetadata(); |
1,044,491 | final CreateAnalyzerResult executeCreateAnalyzer(CreateAnalyzerRequest createAnalyzerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createAnalyzerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateAnalyzerRequest> request = null;<NEW_LINE>Response<CreateAnalyzerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateAnalyzerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createAnalyzerRequest));<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, "AccessAnalyzer");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateAnalyzerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateAnalyzerResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateAnalyzer"); |
1,272,954 | final DisassociatePhoneNumbersFromVoiceConnectorResult executeDisassociatePhoneNumbersFromVoiceConnector(DisassociatePhoneNumbersFromVoiceConnectorRequest disassociatePhoneNumbersFromVoiceConnectorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociatePhoneNumbersFromVoiceConnectorRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociatePhoneNumbersFromVoiceConnectorRequest> request = null;<NEW_LINE>Response<DisassociatePhoneNumbersFromVoiceConnectorResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociatePhoneNumbersFromVoiceConnectorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociatePhoneNumbersFromVoiceConnectorRequest));<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, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociatePhoneNumbersFromVoiceConnector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociatePhoneNumbersFromVoiceConnectorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociatePhoneNumbersFromVoiceConnectorResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,114,295 | private VanillaChronicleMap<K, V, ?> createWithNewFile(@NotNull final VanillaChronicleMap<K, V, ?> map, @NotNull final File canonicalFile, @NotNull final RandomAccessFile raf, @NotNull final ChronicleHashResources resources, @NotNull final ByteBuffer headerBuffer, final int headerSize) throws IOException {<NEW_LINE>if (MAP_CREATION_DEBUG) {<NEW_LINE>Jvm.warn().on(getClass(), "<map creation debug> File [canonizedMapDataFile=" + canonicalFile.getAbsolutePath() + "] is missing or empty, creating Map from scratch");<NEW_LINE>}<NEW_LINE>map.initBeforeMapping(canonicalFile, raf, headerBuffer.limit(), false);<NEW_LINE>map.createMappedStoreAndSegments(resources);<NEW_LINE>CanonicalRandomAccessFiles.acquireSharedFileLock(canonicalFile, raf.getChannel());<NEW_LINE>map.addCloseable(() -> CanonicalRandomAccessFiles.releaseSharedFileLock(canonicalFile));<NEW_LINE>commitChronicleMapReady(<MASK><NEW_LINE>return map;<NEW_LINE>} | map, raf, headerBuffer, headerSize); |
1,377,974 | public void handleMessage(Message message) throws Fault {<NEW_LINE>AssertionInfoMap aim = message.get(AssertionInfoMap.class);<NEW_LINE>// extract Assertion information<NEW_LINE>if (aim != null) {<NEW_LINE>Collection<AssertionInfo> ais = aim.get(SP12Constants.HTTPS_TOKEN);<NEW_LINE>if (ais == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!isRequestor(message)) {<NEW_LINE>assertHttps(ais, message);<NEW_LINE>// Store the TLS principal on the message context<NEW_LINE>SecurityContext sc = message.get(SecurityContext.class);<NEW_LINE>if (sc == null || sc.getUserPrincipal() == null) {<NEW_LINE>TLSSessionInfo tlsInfo = message.get(TLSSessionInfo.class);<NEW_LINE>if (tlsInfo != null && tlsInfo.getPeerCertificates() != null && tlsInfo.getPeerCertificates().length > 0 && (tlsInfo.getPeerCertificates()[0] instanceof X509Certificate)) {<NEW_LINE>X509Certificate cert = (X509Certificate) tlsInfo.getPeerCertificates()[0];<NEW_LINE>message.put(SecurityContext.class, createSecurityContext<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// client side should be checked on the way out<NEW_LINE>for (AssertionInfo ai : ais) {<NEW_LINE>ai.setAsserted(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (cert.getSubjectX500Principal())); |
1,102,335 | public GetAccessControlEffectResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetAccessControlEffectResult getAccessControlEffectResult = new GetAccessControlEffectResult();<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 getAccessControlEffectResult;<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("Effect", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getAccessControlEffectResult.setEffect(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("MatchedRules", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getAccessControlEffectResult.setMatchedRules(new ListUnmarshaller<String>(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 getAccessControlEffectResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
136,347 | private Future<Void> reconcileOnResourceChange(Reconciliation reconciliation, LogContext logContext, KafkaTopic topicResource, Topic k8sTopic, boolean isModify) {<NEW_LINE>TopicName topicName = new TopicName(topicResource);<NEW_LINE>return checkForNameChange(topicName, topicResource).onComplete(nameChanged -> {<NEW_LINE>if (nameChanged.failed()) {<NEW_LINE>enqueue(logContext, new Event(logContext, topicResource, "Kafka topics cannot be renamed, but KafkaTopic's spec.topicName has changed.", EventType.WARNING, eventResult -> {<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>}).compose(i -> CompositeFuture.all(getFromKafka(logContext.toReconciliation(), topicName), getFromTopicStore(topicName)).compose(compositeResult -> {<NEW_LINE>Topic kafkaTopic = compositeResult.resultAt(0);<NEW_LINE>Topic <MASK><NEW_LINE>if (kafkaTopic == null && privateTopic == null && isModify && topicResource.getMetadata().getDeletionTimestamp() != null) {<NEW_LINE>// When processing a Kafka-side deletion then when we delete the KT<NEW_LINE>// We first receive a modify event (setting deletionTimestamp etc)<NEW_LINE>// then the deleted event. We need to ignore the modify event.<NEW_LINE>LOGGER.debugCr(logContext.toReconciliation(), "Ignoring pre-delete modify event");<NEW_LINE>reconciliation.observedTopicFuture(null);<NEW_LINE>return Future.succeededFuture();<NEW_LINE>} else {<NEW_LINE>return reconcile(reconciliation, logContext, topicResource, k8sTopic, kafkaTopic, privateTopic);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>} | privateTopic = compositeResult.resultAt(1); |
1,262,125 | final DeleteApplicationResult executeDeleteApplication(DeleteApplicationRequest deleteApplicationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteApplicationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteApplicationRequest> request = null;<NEW_LINE>Response<DeleteApplicationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteApplicationRequest));<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, "Service Catalog AppRegistry");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteApplication");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteApplicationResult>> 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 DeleteApplicationResultJsonUnmarshaller()); |
1,415,402 | public List<I_M_HU> packToHU(@NonNull final IHUContext huContext, @NonNull final HuId pickFromHUId, @NonNull final PackToInfo packToInfo, @NonNull final ProductId productId, @NonNull final Quantity qtyPicked, @NonNull final TableRecordReference documentRef, boolean checkIfAlreadyPacked) {<NEW_LINE>final I_M_HU pickFromHU = handlingUnitsBL.getById(pickFromHUId);<NEW_LINE>//<NEW_LINE>// Case: the PickFrom HU can be considered already packed<NEW_LINE>// i.e. it's an HU with exactly required qty and same packing instructions<NEW_LINE>if (checkIfAlreadyPacked && huContext.getHUStorageFactory().isSingleProductWithQtyEqualsTo(pickFromHU, productId, qtyPicked) && HuPackingInstructionsId.equals(packToInfo.getPackingInstructionsId(), handlingUnitsBL.getPackingInstructionsId(pickFromHU))) {<NEW_LINE>handlingUnitsBL.setHUStatus(pickFromHU, PlainContextAware.newWithThreadInheritedTrx(), X_M_HU.HUSTATUS_Picked);<NEW_LINE>return ImmutableList.of(pickFromHU);<NEW_LINE>} else //<NEW_LINE>// Case: We have to split out and pack our HU<NEW_LINE>{<NEW_LINE>final IHUProducerAllocationDestination packToDestination;<NEW_LINE>HULoader.builder().source(HUListAllocationSourceDestination.of(pickFromHU).setDestroyEmptyHUs(true)).destination(packToDestination = getPackToDestination(packToInfo)).load(AllocationUtils.builder().setHUContext(huContext).setProduct(productId).setQuantity(qtyPicked).setFromReferencedTableRecord(documentRef).setForceQtyAllocation<MASK><NEW_LINE>return packToDestination.getCreatedHUs();<NEW_LINE>}<NEW_LINE>} | (true).create()); |
868,710 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>pnlAttributes = new javax.swing.JPanel();<NEW_LINE>jLabel1 = new javax.swing.JLabel();<NEW_LINE>jLabel2 = <MASK><NEW_LINE>pnlAttributes.setLayout(new java.awt.GridBagLayout());<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(jLabel1, NbBundle.getMessage(SortPanel.class, "SortPanel.jLabel1.text"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 10);<NEW_LINE>pnlAttributes.add(jLabel1, gridBagConstraints);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(jLabel2, NbBundle.getMessage(SortPanel.class, "SortPanel.jLabel2.text"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 1;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 10);<NEW_LINE>pnlAttributes.add(jLabel2, gridBagConstraints);<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(pnlAttributes, javax.swing.GroupLayout.DEFAULT_SIZE, 600, Short.MAX_VALUE).addContainerGap()));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addComponent(pnlAttributes, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE).addContainerGap()));<NEW_LINE>} | new javax.swing.JLabel(); |
1,111,088 | public Mono<Response<Void>> deleteOwnershipIdentifierWithResponseAsync(String resourceGroupName, String domainName, String name) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (domainName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>return FluxUtil.withContext(context -> service.deleteOwnershipIdentifier(this.client.getEndpoint(), resourceGroupName, domainName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
656,726 | public void migrate(Schema schema, DatabaseSession databaseSession) {<NEW_LINE>EClass revision = schema.getEClass("store", "Revision");<NEW_LINE>EClass concreteRevision = schema.getEClass("store", "ConcreteRevision");<NEW_LINE>EClass densityCollection = schema.createEClass("store", "DensityCollection");<NEW_LINE>EClass density = schema.createEClass("store", "Density");<NEW_LINE>schema.createEAttribute(density, "type", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(density, "geometryInfoId", EcorePackage.eINSTANCE.getELong());<NEW_LINE>schema.createEAttribute(density, "trianglesBelow", EcorePackage.eINSTANCE.getELong());<NEW_LINE>schema.createEAttribute(density, "trianglesAbove", EcorePackage.eINSTANCE.getELong());<NEW_LINE>schema.createEAttribute(density, "volume", EcorePackage.eINSTANCE.getEFloat());<NEW_LINE>schema.createEAttribute(density, "density", EcorePackage.eINSTANCE.getEFloat());<NEW_LINE>EReference densities = schema.createEReference(densityCollection, "densities", density, Multiplicity.MANY);<NEW_LINE>densities.setUnique(false);<NEW_LINE>densities.getEAnnotations().add(createDbEmbedReferenceAnnotation());<NEW_LINE>densities.getEAnnotations().add(createEmbedsReferenceAnnotation());<NEW_LINE>densities.getEAnnotations().add(createHiddenAnnotation());<NEW_LINE>schema.createEReference(revision, "densityCollection", densityCollection);<NEW_LINE>schema.createEReference(concreteRevision, "densityCollection", densityCollection);<NEW_LINE>schema.createEAttribute(revision, "nrPrimitives", EcorePackage.eINSTANCE.getELong());<NEW_LINE>EClass bounds = schema.getEClass("geometry", "Bounds");<NEW_LINE>EClass geometryInfo = schema.getEClass("geometry", "GeometryInfo");<NEW_LINE>EClass geometryData = schema.getEClass("geometry", "GeometryData");<NEW_LINE>schema.createEAttribute(geometryInfo, "density", EcorePackage.eINSTANCE.getEFloat());<NEW_LINE>EReference boundsMm = schema.createEReference(geometryInfo, "boundsMm", bounds);<NEW_LINE>boundsMm.getEAnnotations().add(createDbEmbedReferenceAnnotation());<NEW_LINE>boundsMm.getEAnnotations().add(createEmbedsReferenceAnnotation());<NEW_LINE>boundsMm.getEAnnotations().add(createHiddenAnnotation());<NEW_LINE>EReference boundsMmGeometryData = schema.createEReference(geometryData, "boundsMm", bounds);<NEW_LINE>boundsMmGeometryData.getEAnnotations().add(createDbEmbedReferenceAnnotation());<NEW_LINE>boundsMmGeometryData.getEAnnotations().add(createEmbedsReferenceAnnotation());<NEW_LINE>boundsMmGeometryData.getEAnnotations().add(createHiddenAnnotation());<NEW_LINE>EReference boundsMmUntransformed = schema.<MASK><NEW_LINE>boundsMmUntransformed.getEAnnotations().add(createDbEmbedReferenceAnnotation());<NEW_LINE>boundsMmUntransformed.getEAnnotations().add(createEmbedsReferenceAnnotation());<NEW_LINE>boundsMmUntransformed.getEAnnotations().add(createHiddenAnnotation());<NEW_LINE>schema.createEAttribute(geometryData, "saveableTriangles", EcorePackage.eINSTANCE.getEInt());<NEW_LINE>} | createEReference(geometryInfo, "boundsUntransformedMm", bounds); |
319,974 | public void actionPerformed(final ActionEvent event) {<NEW_LINE>final Controller controller = Controller.getCurrentController();<NEW_LINE>final ModeController modeController = controller.getModeController();<NEW_LINE>final MFileManager fileManager = MFileManager.getController(modeController);<NEW_LINE>final JFileChooser fileChooser = fileManager.getMindMapFileChooser();<NEW_LINE><MASK><NEW_LINE>fileChooser.setAccessory(previewOptions);<NEW_LINE>fileChooser.setMultiSelectionEnabled(false);<NEW_LINE>final int returnVal = fileChooser.showOpenDialog(controller.getMapViewManager().getMapViewComponent());<NEW_LINE>if (returnVal != JFileChooser.APPROVE_OPTION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File file = fileChooser.getSelectedFile();<NEW_LINE>if (!file.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final MapModel map = controller.getMap();<NEW_LINE>MapStyle mapStyleController = MapStyle.getController(modeController);<NEW_LINE>mapStyleController.copyStyles(file, map, previewOptions.isFollowChecked(), previewOptions.isAssociateChecked());<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>LogUtils.severe(e);<NEW_LINE>}<NEW_LINE>} | MindMapPreviewWithOptions previewOptions = new MindMapPreviewWithOptions(fileChooser); |
817,752 | public NameEnvironmentAnswer findClass(String binaryFileName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName, boolean asBinaryOnly, Predicate<String> moduleNameFilter) {<NEW_LINE>if (this.fs == null) {<NEW_LINE>return super.findClass(binaryFileName, qualifiedPackageName, moduleName, qualifiedBinaryFileName, asBinaryOnly, moduleNameFilter);<NEW_LINE>}<NEW_LINE>if (!isPackage(qualifiedPackageName, moduleName)) {<NEW_LINE>// most common case<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<Path> releaseRoots = this.ctSym.releaseRoots(this.releaseCode);<NEW_LINE>try {<NEW_LINE>IBinaryType reader = null;<NEW_LINE>byte[] content = null;<NEW_LINE>String fileNameWithoutExtension = qualifiedBinaryFileName.substring(0, qualifiedBinaryFileName.length() - SuffixConstants.SUFFIX_CLASS.length);<NEW_LINE>if (!releaseRoots.isEmpty()) {<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>qualifiedBinaryFileName = qualifiedBinaryFileName.replace(".class", ".sig");<NEW_LINE>Path fullPath = this.ctSym.getFullPath(this.releaseCode, qualifiedBinaryFileName, moduleName);<NEW_LINE>// If file is known, read it from ct.sym<NEW_LINE>if (fullPath != null) {<NEW_LINE>content = this.ctSym.getFileBytes(fullPath);<NEW_LINE>if (content != null) {<NEW_LINE>reader = new ClassFileReader(content, qualifiedBinaryFileName.toCharArray());<NEW_LINE>if (moduleName != null) {<NEW_LINE>((ClassFileReader) reader).moduleName = moduleName.toCharArray();<NEW_LINE>} else {<NEW_LINE>if (this.ctSym.isJRE12Plus()) {<NEW_LINE>moduleName = this.ctSym.<MASK><NEW_LINE>if (moduleName != null) {<NEW_LINE>((ClassFileReader) reader).moduleName = moduleName.toCharArray();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Read the file in a "classic" way from the JDK itself<NEW_LINE>reader = ClassFileReader.readFromModule(this.jrtFile, moduleName, qualifiedBinaryFileName, moduleNameFilter);<NEW_LINE>}<NEW_LINE>return createAnswer(fileNameWithoutExtension, reader);<NEW_LINE>} catch (ClassFormatException | IOException e) {<NEW_LINE>// treat as if class file is missing<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | getModuleInJre12plus(this.releaseCode, qualifiedBinaryFileName); |
750,779 | private Map<String, RequestMapper<RuntimeResource>> findTarget(Class<?> locatorClass) {<NEW_LINE>if (locatorClass == Object.class || locatorClass == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Map<String, RequestMapper<RuntimeResource>> res = resourceLocatorHandlers.get(locatorClass);<NEW_LINE>if (res != null) {<NEW_LINE>return res;<NEW_LINE>}<NEW_LINE>// not found, so we need to compute one<NEW_LINE>// we look through all interfaces and superclasses<NEW_LINE>// we need to do this as it could implement multiple interfaces<NEW_LINE>List<Map<String, RequestMapper<RuntimeResource>>> <MASK><NEW_LINE>Set<Class<?>> seen = new HashSet<>();<NEW_LINE>findTargetRecursive(locatorClass, results, seen);<NEW_LINE>Map<String, List<RequestMapper.RequestPath<RuntimeResource>>> newMapper = new HashMap<>();<NEW_LINE>for (Map<String, RequestMapper<RuntimeResource>> i : results) {<NEW_LINE>for (Map.Entry<String, RequestMapper<RuntimeResource>> entry : i.entrySet()) {<NEW_LINE>List<RequestMapper.RequestPath<RuntimeResource>> list = newMapper.get(entry.getKey());<NEW_LINE>if (list == null) {<NEW_LINE>newMapper.put(entry.getKey(), list = new ArrayList<>());<NEW_LINE>}<NEW_LINE>list.addAll(entry.getValue().getTemplates());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, RequestMapper<RuntimeResource>> finalResult = new HashMap<>();<NEW_LINE>for (Map.Entry<String, List<RequestMapper.RequestPath<RuntimeResource>>> i : newMapper.entrySet()) {<NEW_LINE>finalResult.put(i.getKey(), new RequestMapper<RuntimeResource>(i.getValue()));<NEW_LINE>}<NEW_LINE>// it does not matter if this is computed twice<NEW_LINE>resourceLocatorHandlers.put(locatorClass, finalResult);<NEW_LINE>return finalResult;<NEW_LINE>} | results = new ArrayList<>(); |
403,830 | public static void configureEncryptionMenu(@NonNull Conversation conversation, Menu menu) {<NEW_LINE>final MenuItem menuSecure = menu.findItem(R.id.action_security);<NEW_LINE>final boolean participating = conversation.getMode() == Conversational.MODE_SINGLE || conversation.getMucOptions().participating();<NEW_LINE>if (!participating) {<NEW_LINE>menuSecure.setVisible(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final MenuItem none = menu.findItem(R.id.encryption_choice_none);<NEW_LINE>final MenuItem pgp = menu.<MASK><NEW_LINE>final MenuItem axolotl = menu.findItem(R.id.encryption_choice_axolotl);<NEW_LINE>final int next = conversation.getNextEncryption();<NEW_LINE>boolean visible;<NEW_LINE>if (OmemoSetting.isAlways()) {<NEW_LINE>visible = false;<NEW_LINE>} else if (conversation.getMode() == Conversation.MODE_MULTI) {<NEW_LINE>if (next == Message.ENCRYPTION_NONE && !conversation.isPrivateAndNonAnonymous() && !conversation.getBooleanAttribute(Conversation.ATTRIBUTE_FORMERLY_PRIVATE_NON_ANONYMOUS, false)) {<NEW_LINE>visible = false;<NEW_LINE>} else {<NEW_LINE>visible = (Config.supportOpenPgp() || Config.supportOmemo()) && Config.multipleEncryptionChoices();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>visible = Config.multipleEncryptionChoices();<NEW_LINE>}<NEW_LINE>menuSecure.setVisible(visible);<NEW_LINE>if (!visible) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (conversation.getNextEncryption() != Message.ENCRYPTION_NONE) {<NEW_LINE>menuSecure.setIcon(R.drawable.ic_lock_white_24dp);<NEW_LINE>}<NEW_LINE>pgp.setVisible(Config.supportOpenPgp());<NEW_LINE>none.setVisible(Config.supportUnencrypted() || conversation.getMode() == Conversation.MODE_MULTI);<NEW_LINE>axolotl.setVisible(Config.supportOmemo());<NEW_LINE>switch(conversation.getNextEncryption()) {<NEW_LINE>case Message.ENCRYPTION_PGP:<NEW_LINE>menuSecure.setTitle(R.string.encrypted_with_openpgp);<NEW_LINE>pgp.setChecked(true);<NEW_LINE>break;<NEW_LINE>case Message.ENCRYPTION_AXOLOTL:<NEW_LINE>menuSecure.setTitle(R.string.encrypted_with_omemo);<NEW_LINE>axolotl.setChecked(true);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>menuSecure.setTitle(R.string.not_encrypted);<NEW_LINE>none.setChecked(true);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | findItem(R.id.encryption_choice_pgp); |
987,708 | public void handleMessage(GlobalHandlerMessageContext msgctxt) throws Exception {<NEW_LINE>if (msgctxt.getFlowType() == HandlerConstants.FLOW_TYPE_OUT) {<NEW_LINE>HttpServletRequest httpRequest = msgctxt.getHttpServletRequest();<NEW_LINE>System.out.println("in OutHandler3 handlemessage method OutBound");<NEW_LINE>if (httpRequest != null) {<NEW_LINE>System.out.println(httpRequest.getCharacterEncoding());<NEW_LINE>System.out.println(httpRequest.getLocalAddr());<NEW_LINE>}<NEW_LINE>SOAPMessageContext soapmsgctxt = msgctxt.adapt(SOAPMessageContext.class);<NEW_LINE>// get WSDL_OPERATION and WSDL_SERVICE<NEW_LINE>System.out.println("OperationName: " + soapmsgctxt.get(SOAPMessageContext.WSDL_OPERATION));<NEW_LINE>System.out.println("ServiceName: " + soapmsgctxt<MASK><NEW_LINE>// add a new soap header<NEW_LINE>SOAPMessage oldMsg = soapmsgctxt.getMessage();<NEW_LINE>try {<NEW_LINE>SOAPHeader header = oldMsg.getSOAPHeader();<NEW_LINE>QName qname = new QName("http://www.webservice.com", "licenseInfo", "ns");<NEW_LINE>header.addHeaderElement(qname).setValue("12345");<NEW_LINE>} catch (SOAPException e1) {<NEW_LINE>e1.printStackTrace();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.out.println("in OutHandler3 handlemessage() method InBound");<NEW_LINE>}<NEW_LINE>} | .get(SOAPMessageContext.WSDL_SERVICE)); |
601,127 | private Thumb[] scrapePostersAndFanart(boolean doCrop, boolean scrapingExtraFanart) {<NEW_LINE>// the movie poster, on this site it usually has both front and back<NEW_LINE>// cover joined in one image<NEW_LINE>Element postersElement = document.<MASK><NEW_LINE>// the extra screenshots for this movie. It's just the thumbnail as the<NEW_LINE>// actual url requires javascript to find.<NEW_LINE>// We can do some string manipulation on the thumbnail URL to get the<NEW_LINE>// full URL, however<NEW_LINE>Elements extraArtElementsSmallSize = document.select("div#sample-image-block img.mg-b6");<NEW_LINE>ArrayList<Thumb> posters = new ArrayList<>(1 + extraArtElementsSmallSize.size());<NEW_LINE>String posterLink = postersElement.attr("abs:href");<NEW_LINE>if (posterLink == null || posterLink.length() < 1)<NEW_LINE>posterLink = postersElement.attr("abs:src");<NEW_LINE>try {<NEW_LINE>// for the poster, do a crop of the the right side of the dvd case image<NEW_LINE>// (which includes both cover art and back art)<NEW_LINE>// so we only get the cover<NEW_LINE>if (doCrop && !scrapingExtraFanart)<NEW_LINE>// use javCropCoverRoutine version of the new Thumb constructor to handle the cropping<NEW_LINE>posters.add(new Thumb(posterLink, true));<NEW_LINE>else if (!scrapingExtraFanart)<NEW_LINE>posters.add(new Thumb(posterLink));<NEW_LINE>} catch (IOException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>if (scrapingExtraFanart) {<NEW_LINE>// maybe you're someone who doesn't want the movie poster as the cover.<NEW_LINE>// Include the extra art in case<NEW_LINE>// you want to use one of those<NEW_LINE>for (Element item : extraArtElementsSmallSize) {<NEW_LINE>// We need to do some string manipulation and put a "jp" before the<NEW_LINE>// last dash in the URL to get the full size picture<NEW_LINE>String extraArtLinkSmall = item.attr("abs:src");<NEW_LINE>int indexOfLastDash = extraArtLinkSmall.lastIndexOf('-');<NEW_LINE>String URLpath = extraArtLinkSmall.substring(0, indexOfLastDash) + "jp" + extraArtLinkSmall.substring(indexOfLastDash);<NEW_LINE>try {<NEW_LINE>if (Thumb.fileExistsAtUrl(URLpath))<NEW_LINE>posters.add(new Thumb(URLpath));<NEW_LINE>} catch (IOException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return posters.toArray(new Thumb[0]);<NEW_LINE>} | select("a[name=package-image], div#sample-video img[src*=/pics.dmm.co.jp]").first(); |
896,906 | public List<String> listAuxObjects() throws IOException {<NEW_LINE>if (!this.canWrite()) {<NEW_LINE>open();<NEW_LINE>}<NEW_LINE>String prefix = getDestinationKey("");<NEW_LINE>List<String> ret = new ArrayList<>();<NEW_LINE>ListObjectsRequest req = new ListObjectsRequest().withBucketName(bucketName).withPrefix(prefix);<NEW_LINE>ObjectListing storedAuxFilesList = null;<NEW_LINE>try {<NEW_LINE>storedAuxFilesList = s3.listObjects(req);<NEW_LINE>} catch (SdkClientException sce) {<NEW_LINE>throw new IOException("S3 listAuxObjects: failed to get a listing for " + prefix);<NEW_LINE>}<NEW_LINE>if (storedAuxFilesList == null) {<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>List<S3ObjectSummary> storedAuxFilesSummary = storedAuxFilesList.getObjectSummaries();<NEW_LINE>try {<NEW_LINE>while (storedAuxFilesList.isTruncated()) {<NEW_LINE>logger.fine("S3 listAuxObjects: going to next page of list");<NEW_LINE><MASK><NEW_LINE>if (storedAuxFilesList != null) {<NEW_LINE>storedAuxFilesSummary.addAll(storedAuxFilesList.getObjectSummaries());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (AmazonClientException ase) {<NEW_LINE>// logger.warning("Caught an AmazonServiceException in S3AccessIO.listAuxObjects(): " + ase.getMessage());<NEW_LINE>throw new IOException("S3AccessIO: Failed to get aux objects for listing.");<NEW_LINE>}<NEW_LINE>for (S3ObjectSummary item : storedAuxFilesSummary) {<NEW_LINE>String destinationKey = item.getKey();<NEW_LINE>String fileName = destinationKey.substring(destinationKey.lastIndexOf(".") + 1);<NEW_LINE>logger.fine("S3 cached aux object fileName: " + fileName);<NEW_LINE>ret.add(fileName);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | storedAuxFilesList = s3.listNextBatchOfObjects(storedAuxFilesList); |
1,561,062 | private static void remoteSendFormData(final PwmRequest pwmRequest, final NewUserForm newUserForm, final FormDataRequestBean.Mode mode) throws PwmUnrecoverableException, PwmDataValidationException {<NEW_LINE>final RestFormDataClient restFormDataClient = new RestFormDataClient(pwmRequest.getPwmDomain(), pwmRequest.getLabel());<NEW_LINE>if (!restFormDataClient.isEnabled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final NewUserBean newUserBean = NewUserServlet.getNewUserBean(pwmRequest);<NEW_LINE>final NewUserProfile newUserProfile = NewUserServlet.getNewUserProfile(pwmRequest);<NEW_LINE>final FormDataRequestBean.FormInfo formInfo = FormDataRequestBean.FormInfo.builder().mode(mode).moduleProfileID(newUserBean.getProfileID()).sessionID(pwmRequest.getPwmSession().getLoginInfoBean().getGuid()).module(FormDataRequestBean.FormType.NewUser).build();<NEW_LINE>final FormDataRequestBean formDataRequestBean = FormDataRequestBean.builder().formInfo(formInfo).formConfigurations(newUserProfile.readSettingAsForm(PwmSetting.NEWUSER_FORM)).formValues(newUserForm.getFormData()).build();<NEW_LINE>final FormDataResponseBean formDataResponseBean = restFormDataClient.invoke(formDataRequestBean, pwmRequest.getLocale());<NEW_LINE>if (formDataResponseBean.isError()) {<NEW_LINE>final ErrorInformation error = new ErrorInformation(PwmError.ERROR_REMOTE_ERROR_VALUE, formDataResponseBean.getErrorDetail(), new String[] <MASK><NEW_LINE>throw new PwmDataValidationException(error);<NEW_LINE>}<NEW_LINE>} | { formDataResponseBean.getErrorMessage() }); |
1,512,733 | public void execute() {<NEW_LINE>// We can assume we have the named persistence unit and its mapping file in our classpath,<NEW_LINE>// but we may have to allow some properties in that persistence unit to be overridden before<NEW_LINE>// we can successfully get that persistence unit's metamodel.<NEW_LINE>Map<String, String> properties = (configuration != null) ? configuration.getProperties() : null;<NEW_LINE>EntityManagerFactory emf = <MASK><NEW_LINE>// Now we can get the persistence unit's metamodel and export it to Querydsl query types.<NEW_LINE>Metamodel configuration = emf.getMetamodel();<NEW_LINE>JPADomainExporter exporter = new JPADomainExporter(namePrefix, nameSuffix, new File(targetFolder), configuration);<NEW_LINE>try {<NEW_LINE>exporter.execute();<NEW_LINE>generatedFiles = exporter.getGeneratedFiles();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException("Error in JPADomainExporter", e);<NEW_LINE>}<NEW_LINE>} | Persistence.createEntityManagerFactory(persistenceUnitName, properties); |
1,107,994 | public void process(LArrayAccessor<TupleDesc_U8> points, DogArray_I32 assignments, FastAccess<TupleDesc_U8> clusters) {<NEW_LINE>// see if it should run the single thread version instead<NEW_LINE>if (points.size() < minimumForConcurrent) {<NEW_LINE>super.process(points, assignments, clusters);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (assignments.size != points.size())<NEW_LINE>throw new IllegalArgumentException("Points and assignments need to be the same size");<NEW_LINE>// Compute the sum of all points in each cluster<NEW_LINE>BoofConcurrency.loopBlocks(0, points.size(), threadData, (data, idx0, idx1) -> {<NEW_LINE>final TupleDesc_U8 tuple = data.point;<NEW_LINE>final DogArray<int[]> sums = data.clusterSums;<NEW_LINE>sums.resize(clusters.size);<NEW_LINE>for (int i = 0; i < sums.size; i++) {<NEW_LINE>Arrays.fill(sums.data[i], 0);<NEW_LINE>}<NEW_LINE>final DogArray_I32 counts = data.counts;<NEW_LINE>counts.resize(sums.size, 0);<NEW_LINE>for (int pointIdx = idx0; pointIdx < idx1; pointIdx++) {<NEW_LINE>points.getCopy(pointIdx, tuple);<NEW_LINE>final byte[] point = tuple.data;<NEW_LINE>int clusterIdx = assignments.get(pointIdx);<NEW_LINE>counts.data[clusterIdx]++;<NEW_LINE>int[] sum = sums.get(clusterIdx);<NEW_LINE>for (int i = 0; i < point.length; i++) {<NEW_LINE>sum[i] += point[i] & 0xFF;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Stitch results from threads back together<NEW_LINE>counts.reset();<NEW_LINE>counts.resize(clusters.size, 0);<NEW_LINE>means.resize(clusters.size);<NEW_LINE>for (int i = 0; i < clusters.size; i++) {<NEW_LINE>Arrays.fill(means.data[i], 0);<NEW_LINE>}<NEW_LINE>for (int threadIdx = 0; threadIdx < threadData.size(); threadIdx++) {<NEW_LINE>ThreadData data = threadData.get(threadIdx);<NEW_LINE>for (int clusterIdx = 0; clusterIdx < clusters.size; clusterIdx++) {<NEW_LINE>int[] a = data.clusterSums.get(clusterIdx);<NEW_LINE>int[] b = means.get(clusterIdx);<NEW_LINE>for (int i = 0; i < b.length; i++) {<NEW_LINE>b[i] += a[i];<NEW_LINE>}<NEW_LINE>counts.data[clusterIdx] += data.counts.data[clusterIdx];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Divide to get the average value in each cluster<NEW_LINE>for (int clusterIdx = 0; clusterIdx < clusters.size; clusterIdx++) {<NEW_LINE>int[] sum = means.get(clusterIdx);<NEW_LINE>byte[] cluster = clusters.get(clusterIdx).data;<NEW_LINE>double <MASK><NEW_LINE>for (int i = 0; i < cluster.length; i++) {<NEW_LINE>cluster[i] = (byte) (sum[i] / divisor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | divisor = counts.get(clusterIdx); |
101,837 | public Object run(Context cx) {<NEW_LINE>cx.setTrackUnhandledPromiseRejections(true);<NEW_LINE>timers.install(global);<NEW_LINE>if (useRequire) {<NEW_LINE>require = global.<MASK><NEW_LINE>}<NEW_LINE>if (type == PROCESS_FILES) {<NEW_LINE>processFiles(cx, args);<NEW_LINE>printPromiseWarnings(cx);<NEW_LINE>} else if (type == EVAL_INLINE_SCRIPT) {<NEW_LINE>evalInlineScript(cx, scriptText);<NEW_LINE>} else {<NEW_LINE>throw Kit.codeBug();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>timers.runAllTimers(cx, global);<NEW_LINE>} catch (JavaScriptException e) {<NEW_LINE>ToolErrorReporter.reportException(cx.getErrorReporter(), e);<NEW_LINE>exitCode = EXITCODE_RUNTIME_ERROR;<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>// Shell has no facility to handle interrupts so stop now<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | installRequire(cx, modulePath, sandboxed); |
46,747 | public void backupCertificateCodeSnippets() {<NEW_LINE>CertificateAsyncClient certificateAsyncClient = getCertificateAsyncClient();<NEW_LINE>// BEGIN: com.azure.security.keyvault.certificates.CertificateAsyncClient.backupCertificate#string<NEW_LINE>certificateAsyncClient.backupCertificate("certificateName").subscriberContext(Context.of(key1, value1, key2, value2)).subscribe(certificateBackupResponse -> System.out.printf<MASK><NEW_LINE>// END: com.azure.security.keyvault.certificates.CertificateAsyncClient.backupCertificate#string<NEW_LINE>// BEGIN: com.azure.security.keyvault.certificates.CertificateAsyncClient.backupCertificateWithResponse#string<NEW_LINE>certificateAsyncClient.backupCertificateWithResponse("certificateName").subscriberContext(Context.of(key1, value1, key2, value2)).subscribe(certificateBackupResponse -> System.out.printf("Certificate's Backup Byte array's length %s %n", certificateBackupResponse.getValue().length));<NEW_LINE>// END: com.azure.security.keyvault.certificates.CertificateAsyncClient.backupCertificateWithResponse#string<NEW_LINE>} | ("Certificate's Backup Byte array's length %s %n", certificateBackupResponse.length)); |
233,486 | private static Class<?> loadClassLiteral(DynamicClassLiteral dynamicClassLiteralRequest, List<JarTransformationRecord> jarTransformationRecords, ClassLoader initialInputClassLoader, Table<Integer, ClassMemberKey<?>, Member> reflectionBasedMembers, Table<Integer, ClassMemberKey<?>, Set<ClassMemberKey<?>>> missingDescriptorLookupRepo, String workingJavaPackage) throws Throwable {<NEW_LINE>int round = dynamicClassLiteralRequest.round();<NEW_LINE>ClassLoader outputJarClassLoader = round == 0 ? initialInputClassLoader : jarTransformationRecords.get(round - 1).getOutputClassLoader();<NEW_LINE>String requestedClassName = dynamicClassLiteralRequest.value();<NEW_LINE>String qualifiedClassName = workingJavaPackage.isEmpty() || requestedClassName.contains(".") <MASK><NEW_LINE>Class<?> classLiteral = outputJarClassLoader.loadClass(qualifiedClassName);<NEW_LINE>reflectionBasedMembers.putAll(getReflectionBasedClassMembers(round, classLiteral));<NEW_LINE>fillMissingClassMemberDescriptorRepo(round, classLiteral, missingDescriptorLookupRepo);<NEW_LINE>return classLiteral;<NEW_LINE>} | ? requestedClassName : workingJavaPackage + "." + requestedClassName; |
585,725 | public Object onCall(String method, Map<String, Object> param) {<NEW_LINE>Bundle result = new Bundle();<NEW_LINE>ConversationEventListener conversationEventListener = getInstance().getConversationEventListener();<NEW_LINE>if (conversationEventListener == null) {<NEW_LINE>TUIConversationLog.e(TAG, "execute " + method + " failed , conversationEvent listener is null");<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (TextUtils.equals(TUIConstants.TUIConversation.METHOD_IS_TOP_CONVERSATION, method)) {<NEW_LINE>String chatId = (String) param.get(TUIConstants.TUIConversation.CHAT_ID);<NEW_LINE>if (!TextUtils.isEmpty(chatId)) {<NEW_LINE>boolean isTop = conversationEventListener.isTopConversation(chatId);<NEW_LINE>result.putBoolean(TUIConstants.TUIConversation.IS_TOP, isTop);<NEW_LINE>}<NEW_LINE>} else if (TextUtils.equals(TUIConstants.TUIConversation.METHOD_SET_TOP_CONVERSATION, method)) {<NEW_LINE>String chatId = (String) param.get(TUIConstants.TUIConversation.CHAT_ID);<NEW_LINE>boolean isTop = (boolean) param.get(TUIConstants.TUIConversation.IS_SET_TOP);<NEW_LINE>if (!TextUtils.isEmpty(chatId)) {<NEW_LINE>conversationEventListener.setConversationTop(chatId, isTop, new IUIKitCallback<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(Void data) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(String module, int errCode, String errMsg) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} else if (TextUtils.equals(TUIConstants.TUIConversation.METHOD_GET_TOTAL_UNREAD_COUNT, method)) {<NEW_LINE>return conversationEventListener.getUnreadTotal();<NEW_LINE>} else if (TextUtils.equals(TUIConstants.TUIConversation.METHOD_UPDATE_TOTAL_UNREAD_COUNT, method)) {<NEW_LINE>HashMap<String, Object> unreadMap = new HashMap<>();<NEW_LINE>long totalUnread = conversationEventListener.getUnreadTotal();<NEW_LINE>unreadMap.put(TUIConstants.TUIConversation.TOTAL_UNREAD_COUNT, totalUnread);<NEW_LINE>TUICore.notifyEvent(TUIConstants.TUIConversation.EVENT_UNREAD, <MASK><NEW_LINE>} else if (TextUtils.equals(TUIConstants.TUIConversation.METHOD_DELETE_CONVERSATION, method)) {<NEW_LINE>String conversationId = (String) param.get(TUIConstants.TUIConversation.CONVERSATION_ID);<NEW_LINE>conversationEventListener.deleteConversation(conversationId);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | TUIConstants.TUIConversation.EVENT_SUB_KEY_UNREAD_CHANGED, unreadMap); |
357,212 | private void addAttributes(Element e, NamedNodeMap attrs) {<NEW_LINE>if (attrs == null)<NEW_LINE>return;<NEW_LINE>String elPrefix = e.getPrefix();<NEW_LINE>for (int i = 0; i < attrs.getLength(); i++) {<NEW_LINE>Attr a = (Attr) attrs.item(i);<NEW_LINE>// check if attr is ns declaration<NEW_LINE>if ("xmlns".equals(a.getPrefix()) || "xmlns".equals(a.getLocalName())) {<NEW_LINE>if (elPrefix == null && a.getLocalName().equals("xmlns")) {<NEW_LINE>// the target element has already default ns declaration, dont' override it<NEW_LINE>continue;<NEW_LINE>} else if (elPrefix != null && "xmlns".equals(a.getPrefix()) && elPrefix.equals(a.getLocalName())) {<NEW_LINE>// dont bind the prefix to ns again, its already in the target element.<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>e.setAttributeNS(a.getNamespaceURI(), a.getName(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>e.setAttributeNS(a.getNamespaceURI(), a.getName(), a.getValue());<NEW_LINE>}<NEW_LINE>} | ), a.getValue()); |
1,338,437 | private boolean buildVerticalHeader(COSDictionary cidFont) throws IOException {<NEW_LINE>VerticalHeaderTable vhea = ttf.getVerticalHeader();<NEW_LINE>if (vhea == null) {<NEW_LINE>Log.w("PdfBox-Android", "Font to be subset is set to vertical, but has no 'vhea' table");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>float scaling = 1000f / ttf.getHeader().getUnitsPerEm();<NEW_LINE>long v = Math.round(vhea.getAscender() * scaling);<NEW_LINE>long w1 = Math.round(-vhea.getAdvanceHeightMax() * scaling);<NEW_LINE>if (v != 880 || w1 != -1000) {<NEW_LINE>COSArray cosDw2 = new COSArray();<NEW_LINE>cosDw2.add(COSInteger.get(v));<NEW_LINE>cosDw2.add<MASK><NEW_LINE>cidFont.setItem(COSName.DW2, cosDw2);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | (COSInteger.get(w1)); |
1,793,057 | public void startBenchmark(BenchmarkParams params) {<NEW_LINE>String opts = Utils.join(params.getJvmArgs(), " ");<NEW_LINE>if (opts.trim().isEmpty()) {<NEW_LINE>opts = "<none>";<NEW_LINE>}<NEW_LINE>println("# JMH version: " + params.getJmhVersion());<NEW_LINE>println("# VM version: JDK " + params.getJdkVersion() + ", " + params.getVmName() + ", " + params.getVmVersion());<NEW_LINE>println("# VM invoker: " + params.getJvm());<NEW_LINE>println("# VM options: " + opts);<NEW_LINE>println("# Benchmark mode: " + params.getMode().longLabel());<NEW_LINE>hline();<NEW_LINE>String benchName = benchName(params);<NEW_LINE>IterationParams warmup = params.getWarmup();<NEW_LINE>IterationParams measurement = params.getMeasurement();<NEW_LINE>String info = "### %s, %d warmup iterations, %d bench iterations";<NEW_LINE>println(String.format(info, benchName, warmup.getCount()<MASK><NEW_LINE>String s = "";<NEW_LINE>boolean isFirst = true;<NEW_LINE>for (String k : params.getParamsKeys()) {<NEW_LINE>if (isFirst) {<NEW_LINE>isFirst = false;<NEW_LINE>} else {<NEW_LINE>s += ", ";<NEW_LINE>}<NEW_LINE>s += k + " = " + params.getParam(k);<NEW_LINE>}<NEW_LINE>println(String.format("### args = [%s]", s));<NEW_LINE>hline();<NEW_LINE>println("### start benchmark ...");<NEW_LINE>} | , measurement.getCount())); |
238,748 | private void initControllerView(View v) {<NEW_LINE>// By default these are hidden.<NEW_LINE>mPrevButton = v.findViewById(PRV_BUTTON_ID);<NEW_LINE>if (mPrevButton != null) {<NEW_LINE>mPrevButton.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>mNextButton = v.findViewById(NEXT_BUTTON_ID);<NEW_LINE>if (mNextButton != null) {<NEW_LINE>mNextButton.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>mFfwdButton = v.findViewById(FFWD_BUTTON_ID);<NEW_LINE>if (mFfwdButton != null) {<NEW_LINE>mFfwdButton.setOnClickListener(mFfwdListener);<NEW_LINE>if (!mFromXml) {<NEW_LINE>mFfwdButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mRewButton = v.findViewById(REW_BUTTON_ID);<NEW_LINE>if (mRewButton != null) {<NEW_LINE>mRewButton.setOnClickListener(mRewListener);<NEW_LINE>if (!mFromXml) {<NEW_LINE>mRewButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mPauseButton = v.findViewById(PAUSE_BUTTON_ID);<NEW_LINE>if (mPauseButton != null) {<NEW_LINE>mPauseButton.requestFocus();<NEW_LINE>mPauseButton.setOnClickListener(mPauseListener);<NEW_LINE>}<NEW_LINE>mProgress = v.findViewById(MEDIACONTROLLER_PROGRESS_ID);<NEW_LINE>if (mProgress != null) {<NEW_LINE>if (mProgress instanceof SeekBar) {<NEW_LINE>SeekBar seeker = (SeekBar) mProgress;<NEW_LINE>seeker.setOnSeekBarChangeListener(mSeekListener);<NEW_LINE>seeker.setThumbOffset(1);<NEW_LINE>}<NEW_LINE>mProgress.setMax(1000);<NEW_LINE>mProgress.setEnabled(!mDisableProgress);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>mCurrentTime = v.findViewById(CURRENT_TIME_ID);<NEW_LINE>} | mEndTime = v.findViewById(END_TIME_ID); |
836,571 | final CreateDedicatedIpPoolResult executeCreateDedicatedIpPool(CreateDedicatedIpPoolRequest createDedicatedIpPoolRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createDedicatedIpPoolRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateDedicatedIpPoolRequest> request = null;<NEW_LINE>Response<CreateDedicatedIpPoolResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateDedicatedIpPoolRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createDedicatedIpPoolRequest));<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, "CreateDedicatedIpPool");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateDedicatedIpPoolResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateDedicatedIpPoolResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
201,819 | private static int shardingNodeCheck(String stmt, int offset) throws SQLSyntaxErrorException {<NEW_LINE>if (stmt.length() > offset + 10) {<NEW_LINE>char c1 = stmt.charAt(++offset);<NEW_LINE>char c2 = stmt.charAt(++offset);<NEW_LINE>char c3 = stmt.charAt(++offset);<NEW_LINE>char c4 = stmt.charAt(++offset);<NEW_LINE>char c5 = stmt.charAt(++offset);<NEW_LINE>char c6 = stmt.charAt(++offset);<NEW_LINE>char c7 = stmt.charAt(++offset);<NEW_LINE>char c8 = stmt.charAt(++offset);<NEW_LINE>char c9 = stmt.charAt(++offset);<NEW_LINE>char c10 <MASK><NEW_LINE>if ((c1 == 'A' || c1 == 'a') && (c2 == 'R' || c2 == 'r') && (c3 == 'D' || c3 == 'd') && (c4 == 'I' || c4 == 'i') && (c5 == 'N' || c5 == 'n') && (c6 == 'G' || c6 == 'g') && (c7 == 'N' || c7 == 'n') && (c8 == 'O' || c8 == 'o') && (c9 == 'D' || c9 == 'd') && (c10 == 'E' || c10 == 'e')) {<NEW_LINE>offset = ParseUtil.skipSpaceUtil(stmt, ++offset, '=');<NEW_LINE>if (offset == -1) {<NEW_LINE>throw new SQLSyntaxErrorException("please following the dble hint syntax: /*!" + Versions.ANNOTATION_NAME + "shardingNode=? */ sql");<NEW_LINE>} else {<NEW_LINE>return (offset << 8) | SHARDING_NODE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new SQLSyntaxErrorException("please following the dble hint syntax: /*!" + Versions.ANNOTATION_NAME + "shardingNode=? */ sql");<NEW_LINE>} | = stmt.charAt(++offset); |
1,161,126 | static void pick_intra4x4block(Macroblock x, BPredictionMode[] bestmode, int ib, final EnumMap<BPredictionMode, Integer> mode_costs, QualityMetrics best) {<NEW_LINE>BlockD b = x.e_mbd.block.getRel(ib);<NEW_LINE>Block be = x.block.getRel(ib);<NEW_LINE>int dst_stride = x.e_mbd.dst.y_stride;<NEW_LINE>best.error = Long.MAX_VALUE;<NEW_LINE>FullAccessIntArrPointer Above = b.getOffsetPointer(x.e_mbd.dst.<MASK><NEW_LINE>FullAccessIntArrPointer yleft = b.getOffsetPointer(x.e_mbd.dst.y_buffer).shallowCopyWithPosInc(-1);<NEW_LINE>final short top_left = Above.getRel(-1);<NEW_LINE>for (BPredictionMode mode : BPredictionMode.basicbmodes) {<NEW_LINE>long this_rd;<NEW_LINE>int rate = mode_costs.get(mode);<NEW_LINE>x.recon.vp8_intra4x4_predict(Above, yleft, dst_stride, mode, b.predictor, 16, top_left);<NEW_LINE>long distortion = get_prediction_error(be, b);<NEW_LINE>this_rd = RDOpt.RDCOST(x.rdmult, x.rddiv, rate, distortion);<NEW_LINE>if (this_rd < best.error) {<NEW_LINE>best.rateBase = rate;<NEW_LINE>best.distortion = distortion;<NEW_LINE>best.error = this_rd;<NEW_LINE>bestmode[0] = mode;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>b.bmi.as_mode(bestmode[0]);<NEW_LINE>EncodeIntra.vp8_encode_intra4x4block(x, ib);<NEW_LINE>} | y_buffer).shallowCopyWithPosInc(-dst_stride); |
909,202 | private void positionArrow(Pane btn, StackPane arrow, double x, double y, double width, double height) {<NEW_LINE>btn.resize(width, height);<NEW_LINE>positionInArea(btn, x, y, width, height, /*baseline ignored*/<NEW_LINE>0, HPos.CENTER, VPos.CENTER);<NEW_LINE>// center arrow region within arrow button<NEW_LINE>double arrowWidth = snapSize(<MASK><NEW_LINE>double arrowHeight = snapSize(arrow.prefHeight(-1));<NEW_LINE>arrow.resize(arrowWidth, arrowHeight);<NEW_LINE>positionInArea(arrow, btn.snappedLeftInset(), btn.snappedTopInset(), width - btn.snappedLeftInset() - btn.snappedRightInset(), height - btn.snappedTopInset() - btn.snappedBottomInset(), /*baseline ignored*/<NEW_LINE>0, HPos.CENTER, VPos.CENTER);<NEW_LINE>} | arrow.prefWidth(-1)); |
1,480,378 | public void fillSettings(WebSettings settings, IRhoConfig config) {<NEW_LINE>boolean enableZoom = config == null || config.getBool(WebViewConfig.ENABLE_ZOOM);<NEW_LINE>boolean enableCache = config == null || config.getBool(WebViewConfig.ENABLE_CACHE);<NEW_LINE>boolean enableMediaPlaybackWithoutGesture = config != null && config.getBool(WebViewConfig.ENABLE_MEDIA_PLAYBACK_WITHOUT_GESTURE);<NEW_LINE>String customUA = RhoConf.getString("useragent");<NEW_LINE>settings.setMediaPlaybackRequiresUserGesture(!enableMediaPlaybackWithoutGesture);<NEW_LINE>settings.setSavePassword(false);<NEW_LINE>settings.setSaveFormData(false);<NEW_LINE>settings.setJavaScriptEnabled(true);<NEW_LINE>settings.setJavaScriptCanOpenWindowsAutomatically(false);<NEW_LINE>settings.setSupportZoom(enableZoom);<NEW_LINE>settings.setBuiltInZoomControls(enableZoom);<NEW_LINE>settings.setAppCacheEnabled(true);<NEW_LINE>if (!RhoConf.getString("fontFamily").isEmpty())<NEW_LINE>settings.setStandardFontFamily(RhoConf.getString("fontFamily"));<NEW_LINE>// customUA = updateRevesionOfCustomUA(settings.getUserAgentString(), customUA);<NEW_LINE>// settings.setUserAgentString(customUA);<NEW_LINE>if (RhoConf.isExist("ApplicationCachePath")) {<NEW_LINE>if (!RhoConf.getString("ApplicationCachePath").isEmpty())<NEW_LINE>settings.setAppCachePath(RhoConf.getString("ApplicationCachePath"));<NEW_LINE>}<NEW_LINE>if (RhoConf.isExist("ApplicationCacheQuota")) {<NEW_LINE>if (!RhoConf.getString("ApplicationCacheQuota").isEmpty())<NEW_LINE>try {<NEW_LINE>settings.setAppCacheMaxSize(Long.valueOf(RhoConf.getString("ApplicationCacheQuota")).longValue());<NEW_LINE>} catch (NumberFormatException exp) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Logger.T(TAG, "Enable Zoom: " + enableZoom);<NEW_LINE>if (enableCache) {<NEW_LINE>settings.setCacheMode(WebSettings.LOAD_DEFAULT);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Logger.T(TAG, "Enable Cache: " + enableCache);<NEW_LINE>settings.setSupportMultipleWindows(false);<NEW_LINE>setWebPlugins(settings, config);<NEW_LINE>} | settings.setCacheMode(WebSettings.LOAD_NO_CACHE); |
429,722 | public LotteryNumbers performLottery() {<NEW_LINE>var numbers = LotteryNumbers.createRandom();<NEW_LINE>var tickets = getAllSubmittedTickets();<NEW_LINE>for (var id : tickets.keySet()) {<NEW_LINE>var lotteryTicket = tickets.get(id);<NEW_LINE>var playerDetails = lotteryTicket.getPlayerDetails();<NEW_LINE>var playerAccount = playerDetails.getBankAccount();<NEW_LINE>var result = LotteryUtils.checkTicketForPrize(repository, <MASK><NEW_LINE>if (result == LotteryTicketCheckResult.CheckResult.WIN_PRIZE) {<NEW_LINE>if (wireTransfers.transferFunds(PRIZE_AMOUNT, SERVICE_BANK_ACCOUNT, playerAccount)) {<NEW_LINE>notifications.ticketWon(playerDetails, PRIZE_AMOUNT);<NEW_LINE>} else {<NEW_LINE>notifications.prizeError(playerDetails, PRIZE_AMOUNT);<NEW_LINE>}<NEW_LINE>} else if (result == LotteryTicketCheckResult.CheckResult.NO_PRIZE) {<NEW_LINE>notifications.ticketDidNotWin(playerDetails);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return numbers;<NEW_LINE>} | id, numbers).getResult(); |
474,099 | public static void dumpConfiguration(final PrintStream out) {<NEW_LINE>out.print("OrientDB ");<NEW_LINE>out.print(OConstants.getVersion());<NEW_LINE>out.println(" configuration dump:");<NEW_LINE>String lastSection = "";<NEW_LINE>for (OGlobalConfiguration value : values()) {<NEW_LINE>final int index = <MASK><NEW_LINE>String section = value.key;<NEW_LINE>if (index >= 0) {<NEW_LINE>section = value.key.substring(0, index);<NEW_LINE>}<NEW_LINE>if (!lastSection.equals(section)) {<NEW_LINE>out.print("- ");<NEW_LINE>out.println(section.toUpperCase(Locale.ENGLISH));<NEW_LINE>lastSection = section;<NEW_LINE>}<NEW_LINE>out.print(" + ");<NEW_LINE>out.print(value.key);<NEW_LINE>out.print(" = ");<NEW_LINE>out.println(value.isHidden() ? "<hidden>" : String.valueOf((Object) value.getValue()));<NEW_LINE>}<NEW_LINE>} | value.key.indexOf('.'); |
1,732,608 | public ExportingLocation unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ExportingLocation exportingLocation = new ExportingLocation();<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("S3Exporting", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>exportingLocation.setS3Exporting(S3ExportingLocationJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return exportingLocation;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,600,833 | public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>story = (Story) getArguments().getSerializable(STORY);<NEW_LINE>commentUserId = getArguments().getString(COMMENT_USER_ID);<NEW_LINE>final Activity activity = getActivity();<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(activity);<NEW_LINE>String shareString = getResources().getString(R.string.reply_to);<NEW_LINE>builder.setTitle(String.format(shareString, getArguments(<MASK><NEW_LINE>LayoutInflater layoutInflater = LayoutInflater.from(activity);<NEW_LINE>View replyView = layoutInflater.inflate(R.layout.reply_dialog, null);<NEW_LINE>builder.setView(replyView);<NEW_LINE>final EditText reply = (EditText) replyView.findViewById(R.id.reply_field);<NEW_LINE>builder.setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialogInterface, int i) {<NEW_LINE>FeedUtils.replyToComment(story.id, story.feedId, commentUserId, reply.getText().toString(), activity);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.setNegativeButton(R.string.alert_dialog_cancel, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialogInterface, int i) {<NEW_LINE>ReplyDialogFragment.this.dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return builder.create();<NEW_LINE>} | ).getString(COMMENT_USERNAME))); |
19,094 | public void initialize() {<NEW_LINE>try {<NEW_LINE>final NotificationQueueHandler queueHandler = new NotificationQueueHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleReadyNotification(final NotificationEvent inputKey, final DateTime eventDateTime, final UUID fromNotificationQueueUserToken, final Long accountRecordId, final Long tenantRecordId) {<NEW_LINE>if (!(inputKey instanceof SubscriptionNotificationKey)) {<NEW_LINE>log.error("SubscriptionBase service received an unexpected event className='{}'", inputKey.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final SubscriptionNotificationKey key = (SubscriptionNotificationKey) inputKey;<NEW_LINE>final SubscriptionBaseEvent event = dao.getEventById(key.getEventId(), internalCallContextFactory.createInternalTenantContext(tenantRecordId, accountRecordId));<NEW_LINE>if (event == null) {<NEW_LINE>// This can be expected if the event is soft deleted (is_active = '0')<NEW_LINE>log.debug("Failed to extract event for notification key {}", inputKey);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final InternalCallContext context = internalCallContextFactory.createInternalCallContext(tenantRecordId, accountRecordId, "SubscriptionEventQueue", CallOrigin.INTERNAL, UserType.SYSTEM, fromNotificationQueueUserToken);<NEW_LINE>processEventReady(event, key.getSeqId(), context);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>subscriptionEventQueue = notificationQueueService.createNotificationQueue(KILLBILL_SERVICES.SUBSCRIPTION_BASE_SERVICE.getServiceName(), NOTIFICATION_QUEUE_NAME, queueHandler);<NEW_LINE>} catch (final NotificationQueueAlreadyExists e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | getClass().getName()); |
1,345,748 | public void jpa10_Injection_DPU_AppLevel_JNDI_Web_AMRL() throws Exception {<NEW_LINE>final String testName = "jpa10_Injection_DPU_AppLevel_JNDI_Web_AMRL";<NEW_LINE>final String testMethod = "testDefaultPersistenceUnitInjection";<NEW_LINE>final TestExecutionContext testExecCtx = new TestExecutionContext(testName, testLogicClassName, testMethod);<NEW_LINE>final HashMap<String, JPAPersistenceContext> jpaPCInfoMap = testExecCtx.getJpaPCInfoMap();<NEW_LINE>jpaPCInfoMap.put("test-jpa-resource", jpaPctxMap.get("test-jpa-resource-amrl"));<NEW_LINE>HashMap<String, java.io.Serializable<MASK><NEW_LINE>properties.put("dbProductName", getDbProductName());<NEW_LINE>properties.put("dbProductVersion", getDbProductVersion());<NEW_LINE>properties.put("jdbcDriverVersion", getJdbcDriverVersion());<NEW_LINE>// executeDDL("JPA_INJECTION_DPU_DELETE_${dbvendor}.ddl");<NEW_LINE>executeTestVehicle(testExecCtx);<NEW_LINE>} | > properties = testExecCtx.getProperties(); |
919,285 | public boolean init(final Expression<?>[] exprs, final int matchedPattern, final Kleenean isDelayed, final ParseResult parseResult) {<NEW_LINE>amount = (Expression<Number>) exprs[0];<NEW_LINE>switch(matchedPattern) {<NEW_LINE>case 0:<NEW_LINE>direction = new Vector(byMark[parseResult.mark].getModX(), byMark[parseResult.mark].getModY(), byMark[parseResult.mark].getModZ());<NEW_LINE>if (exprs[1] != null) {<NEW_LINE>if (!(exprs[1] instanceof ExprDirection) || ((ExprDirection) exprs[1]).direction == null)<NEW_LINE>return false;<NEW_LINE>next = (ExprDirection) exprs[1];<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>case 2:<NEW_LINE>relativeTo = exprs[1];<NEW_LINE>horizontal <MASK><NEW_LINE>facing = parseResult.mark >= 2;<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>case 4:<NEW_LINE>yaw = Math.PI / 2 * parseResult.mark;<NEW_LINE>horizontal = matchedPattern == 4;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | = parseResult.mark % 2 != 0; |
649,503 | private void parsePartition(Element stepElement, Element partitionElement, AbstractBeanDefinition bd, ParserContext parserContext, boolean stepUnderspecified, String jobFactoryRef) {<NEW_LINE>bd.setBeanClass(StepParserStepFactoryBean.class);<NEW_LINE>bd.setAttribute("isNamespaceStep", true);<NEW_LINE>String stepRef = partitionElement.getAttribute(STEP_ATTR);<NEW_LINE>String partitionerRef = partitionElement.getAttribute(PARTITIONER_ATTR);<NEW_LINE>String <MASK><NEW_LINE>String handlerRef = partitionElement.getAttribute(HANDLER_ATTR);<NEW_LINE>if (!StringUtils.hasText(partitionerRef)) {<NEW_LINE>parserContext.getReaderContext().error("You must specify a partitioner", partitionElement);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MutablePropertyValues propertyValues = bd.getPropertyValues();<NEW_LINE>propertyValues.addPropertyValue("partitioner", new RuntimeBeanReference(partitionerRef));<NEW_LINE>if (StringUtils.hasText(aggregatorRef)) {<NEW_LINE>propertyValues.addPropertyValue("stepExecutionAggregator", new RuntimeBeanReference(aggregatorRef));<NEW_LINE>}<NEW_LINE>boolean customHandler = false;<NEW_LINE>if (!StringUtils.hasText(handlerRef)) {<NEW_LINE>Element handlerElement = DomUtils.getChildElementByTagName(partitionElement, HANDLER_ELE);<NEW_LINE>if (handlerElement != null) {<NEW_LINE>String taskExecutorRef = handlerElement.getAttribute(TASK_EXECUTOR_ATTR);<NEW_LINE>if (StringUtils.hasText(taskExecutorRef)) {<NEW_LINE>propertyValues.addPropertyValue("taskExecutor", new RuntimeBeanReference(taskExecutorRef));<NEW_LINE>}<NEW_LINE>String gridSize = handlerElement.getAttribute(GRID_SIZE_ATTR);<NEW_LINE>if (StringUtils.hasText(gridSize)) {<NEW_LINE>propertyValues.addPropertyValue("gridSize", new TypedStringValue(gridSize));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>customHandler = true;<NEW_LINE>BeanDefinition partitionHandler = BeanDefinitionBuilder.genericBeanDefinition().getRawBeanDefinition();<NEW_LINE>partitionHandler.setParentName(handlerRef);<NEW_LINE>propertyValues.addPropertyValue("partitionHandler", partitionHandler);<NEW_LINE>}<NEW_LINE>Element inlineStepElement = DomUtils.getChildElementByTagName(partitionElement, STEP_ELE);<NEW_LINE>if (inlineStepElement == null && !StringUtils.hasText(stepRef) && !customHandler) {<NEW_LINE>parserContext.getReaderContext().error("You must specify a step", partitionElement);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(stepRef)) {<NEW_LINE>propertyValues.addPropertyValue("step", new RuntimeBeanReference(stepRef));<NEW_LINE>} else if (inlineStepElement != null) {<NEW_LINE>AbstractBeanDefinition stepDefinition = parseStep(inlineStepElement, parserContext, jobFactoryRef);<NEW_LINE>stepDefinition.getPropertyValues().addPropertyValue("name", stepElement.getAttribute(ID_ATTR));<NEW_LINE>propertyValues.addPropertyValue("step", stepDefinition);<NEW_LINE>}<NEW_LINE>} | aggregatorRef = partitionElement.getAttribute(AGGREGATOR_ATTR); |
1,088,797 | private CharSequence generateChoicesDisplay(final String name, final List<Token> tokens) {<NEW_LINE>final String indent = INDENT;<NEW_LINE>final StringBuilder sb = new StringBuilder();<NEW_LINE>final List<Token> choiceTokens = new ArrayList<>();<NEW_LINE>collect(Signal.CHOICE, tokens, 0, choiceTokens);<NEW_LINE>new Formatter(sb).format("\n" + indent + "template<typename CharT, typename Traits>\n" + indent + "friend std::basic_ostream<CharT, Traits> & operator << (\n" + indent + " std::basic_ostream<CharT, Traits> &builder, %1$s writer)\n" + indent + "{\n" + indent + " builder << '[';\n", name);<NEW_LINE>if (choiceTokens.size() > 1) {<NEW_LINE>sb.append(indent + " bool atLeastOne = false;\n");<NEW_LINE>}<NEW_LINE>for (int i = 0, size = choiceTokens.size(); i < size; i++) {<NEW_LINE>final Token token = choiceTokens.get(i);<NEW_LINE>final String choiceName = "writer." + formatPropertyName(token.name());<NEW_LINE>sb.append(indent + " if (").append(choiceName).append("())\n").append<MASK><NEW_LINE>if (i > 0) {<NEW_LINE>sb.append(indent + " if (atLeastOne)\n" + indent + " {\n" + indent + " builder << \",\";\n" + indent + " }\n");<NEW_LINE>}<NEW_LINE>sb.append(indent + " builder << R\"(\"").append(formatPropertyName(token.name())).append("\")\";\n");<NEW_LINE>if (i < (size - 1)) {<NEW_LINE>sb.append(indent + " atLeastOne = true;\n");<NEW_LINE>}<NEW_LINE>sb.append(indent + " }\n");<NEW_LINE>}<NEW_LINE>sb.append(indent + " builder << ']';\n" + indent + " return builder;\n" + indent + "}\n");<NEW_LINE>return sb;<NEW_LINE>} | (indent).append(" {\n"); |
1,004,984 | final DeleteEnvironmentResult executeDeleteEnvironment(DeleteEnvironmentRequest deleteEnvironmentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteEnvironmentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteEnvironmentRequest> request = null;<NEW_LINE>Response<DeleteEnvironmentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteEnvironmentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteEnvironmentRequest));<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, "finspace");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteEnvironmentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteEnvironmentResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteEnvironment"); |
395,010 | public void preInitialise(final String graphId, final Schema schema, final StoreProperties properties) throws StoreException {<NEW_LINE>setProperties(properties);<NEW_LINE>final String deprecatedTableName = getProperties().getTable();<NEW_LINE>if (null == graphId && null != deprecatedTableName) {<NEW_LINE>// Deprecated<NEW_LINE>super.initialise(deprecatedTableName, schema, getProperties());<NEW_LINE>} else if (null != deprecatedTableName && !deprecatedTableName.equals(graphId)) {<NEW_LINE>throw new IllegalArgumentException("The table in store.properties should no longer be used. " + "Please use a graphId instead or for now just set the graphId to be the same value as the store.properties table.");<NEW_LINE>} else {<NEW_LINE>super.initialise(graphId, schema, getProperties());<NEW_LINE>}<NEW_LINE>final String keyPackageClass = getProperties().getKeyPackageClass();<NEW_LINE>try {<NEW_LINE>this.keyPackage = Class.forName(keyPackageClass).asSubclass(AccumuloKeyPackage.class).newInstance();<NEW_LINE>} catch (final InstantiationException | IllegalAccessException | ClassNotFoundException e) {<NEW_LINE>throw new StoreException("Unable to construct an instance of key package: " + keyPackageClass, e);<NEW_LINE>}<NEW_LINE>this.<MASK><NEW_LINE>} | keyPackage.setSchema(getSchema()); |
980,401 | public AwsS3BucketNotificationConfigurationFilter unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsS3BucketNotificationConfigurationFilter awsS3BucketNotificationConfigurationFilter = new AwsS3BucketNotificationConfigurationFilter();<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("S3KeyFilter", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>awsS3BucketNotificationConfigurationFilter.setS3KeyFilter(AwsS3BucketNotificationConfigurationS3KeyFilterJsonUnmarshaller.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 awsS3BucketNotificationConfigurationFilter;<NEW_LINE>} | ().unmarshall(context)); |
660,548 | public void publishHrefAddedEvent(HistoryReference href) {<NEW_LINE>Map<String, String> map = new HashMap<>();<NEW_LINE>map.put(FIELD_HISTORY_REFERENCE_ID, Integer.toString(href.getHistoryId()));<NEW_LINE>map.put(FIELD_URI, href.getURI().toString());<NEW_LINE>map.put(FIELD_METHOD, href.getMethod());<NEW_LINE>map.put(FIELD_TIME_SENT_MS, Long.toString(href.getTimeSentMillis()));<NEW_LINE>map.put(FIELD_STATUS_CODE, Integer.toString(href.getStatusCode()));<NEW_LINE>map.put(FIELD_RTT, Integer.toString(href.getRtt()));<NEW_LINE>map.put(FIELD_RESPONSE_BODY_LENGTH, Integer.toString(href.getResponseBodyLength()));<NEW_LINE>ZAP.getEventBus().publishSyncEvent(getPublisher(), new Event(getPublisher()<MASK><NEW_LINE>} | , EVENT_ADDED, null, map)); |
880,308 | public UpdateResourceShareResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateResourceShareResult updateResourceShareResult = new UpdateResourceShareResult();<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 updateResourceShareResult;<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("resourceShare", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateResourceShareResult.setResourceShare(ResourceShareJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("clientToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateResourceShareResult.setClientToken(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 updateResourceShareResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,837,126 | private void resumeScreenLock(boolean force) {<NEW_LINE>KeyguardManager keyguardManager = (<MASK><NEW_LINE>assert keyguardManager != null;<NEW_LINE>if (!keyguardManager.isKeyguardSecure()) {<NEW_LINE>Log.w(TAG, "Keyguard not secure...");<NEW_LINE>handleAuthenticated();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (Build.VERSION.SDK_INT != 29 && biometricManager.canAuthenticate(ALLOWED_AUTHENTICATORS) == BiometricManager.BIOMETRIC_SUCCESS) {<NEW_LINE>if (force) {<NEW_LINE>Log.i(TAG, "Listening for biometric authentication...");<NEW_LINE>biometricPrompt.authenticate(biometricPromptInfo);<NEW_LINE>} else {<NEW_LINE>Log.i(TAG, "Skipping show system biometric dialog unless forced");<NEW_LINE>}<NEW_LINE>} else if (Build.VERSION.SDK_INT >= 21) {<NEW_LINE>if (force) {<NEW_LINE>Log.i(TAG, "firing intent...");<NEW_LINE>Intent intent = keyguardManager.createConfirmDeviceCredentialIntent(getString(R.string.PassphrasePromptActivity_unlock_signal), "");<NEW_LINE>startActivityForResult(intent, AUTHENTICATE_REQUEST_CODE);<NEW_LINE>} else {<NEW_LINE>Log.i(TAG, "Skipping firing intent unless forced");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.w(TAG, "Not compatible...");<NEW_LINE>handleAuthenticated();<NEW_LINE>}<NEW_LINE>} | KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE); |
1,367,559 | private void insertJobMetadata() {<NEW_LINE>final String baseURL = this.azkabanProps.get(AZKABAN_WEBSERVER_URL);<NEW_LINE>if (baseURL != null) {<NEW_LINE>URL webserverURL = null;<NEW_LINE>try {<NEW_LINE>webserverURL = new URL(baseURL);<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>logger.error(String.format("Exception in parsing url: %s", baseURL), e);<NEW_LINE>}<NEW_LINE>final String azkabanWebserverHost = (webserverURL != null) ? webserverURL.getHost() : null;<NEW_LINE>final String flowName = this.node.getParentFlow().getFlowId();<NEW_LINE>final String projectName = this.node.getParentFlow().getProjectName();<NEW_LINE>this.props.put(CommonJobProperties.AZKABAN_URL, baseURL);<NEW_LINE>this.props.put(CommonJobProperties.AZKABAN_WEBSERVERHOST, azkabanWebserverHost);<NEW_LINE>this.props.put(CommonJobProperties.EXECUTION_LINK, String.format("%s/executor?execid=%d", baseURL, this.executionId));<NEW_LINE>this.props.put(CommonJobProperties.JOBEXEC_LINK, String.format("%s/executor?execid=%d&job=%s", baseURL, this.executionId, this.node.getNestedId()));<NEW_LINE>this.props.put(CommonJobProperties.ATTEMPT_LINK, String.format("%s/executor?execid=%d&job=%s&attempt=%d", baseURL, this.executionId, this.node.getNestedId(), this.node.getAttempt()));<NEW_LINE>this.props.put(CommonJobProperties.WORKFLOW_LINK, String.format("%s/manager?project=%s&flow=%s", baseURL, projectName, flowName));<NEW_LINE>this.props.put(CommonJobProperties.JOB_LINK, String.format("%s/manager?project=%s&flow=%s&job=%s", baseURL, projectName<MASK><NEW_LINE>} else {<NEW_LINE>if (this.logger != null) {<NEW_LINE>this.logger.info(AZKABAN_WEBSERVER_URL + " property was not set");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// out nodes<NEW_LINE>this.props.put(CommonJobProperties.OUT_NODES, StringUtils.join2(this.node.getOutNodes(), ","));<NEW_LINE>// in nodes<NEW_LINE>this.props.put(CommonJobProperties.IN_NODES, StringUtils.join2(this.node.getInNodes(), ","));<NEW_LINE>} | , flowName, this.jobId)); |
1,344,083 | static public void init() {<NEW_LINE>try {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Class<?> <MASK><NEW_LINE>if (Platform.isMacOS()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>platformClass = Class.forName("processing.app.platform.MacPlatform");<NEW_LINE>} else if (Platform.isWindows()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>platformClass = Class.forName("processing.app.platform.WindowsPlatform");<NEW_LINE>} else if (Platform.isLinux()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>platformClass = Class.forName("processing.app.platform.LinuxPlatform");<NEW_LINE>}<NEW_LINE>inst = (DefaultPlatform) platformClass.getDeclaredConstructor().newInstance();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Messages.showError("Problem Setting the Platform", "An unknown error occurred while trying to load\n" + "platform-specific code for your machine.", e);<NEW_LINE>}<NEW_LINE>} | platformClass = Class.forName("processing.app.Platform"); |
1,070,826 | public ChatThreadAsyncClient createChatThreadAsyncClient() {<NEW_LINE>String endpoint = "https://<RESOURCE_NAME>.communcationservices.azure.com";<NEW_LINE>// Your user access token retrieved from your trusted service<NEW_LINE>String threadId = "ID";<NEW_LINE>String token = "SECRET";<NEW_LINE>CommunicationTokenCredential credential = new CommunicationTokenCredential(token);<NEW_LINE>// BEGIN: com.azure.communication.chat.chatthreadasyncclient.instantiation<NEW_LINE>// Initialize the chat client builder<NEW_LINE>final ChatClientBuilder builder = new ChatClientBuilder().endpoint(endpoint).credential(credential);<NEW_LINE>// Build the chat client<NEW_LINE><MASK><NEW_LINE>// Get the chat thread client for your thread's id<NEW_LINE>ChatThreadAsyncClient chatThreadClient = chatClient.getChatThreadClient(threadId);<NEW_LINE>// END: com.azure.communication.chat.chatthreadasyncclient.instantiation<NEW_LINE>return chatThreadClient;<NEW_LINE>} | ChatAsyncClient chatClient = builder.buildAsyncClient(); |
101,230 | private void commandMemDispl(int flags, int extraDispl) {<NEW_LINE>if ((flags & Flags.NO_MEMORY_USAGE) == 0) {<NEW_LINE>if (info.usedMemoryLocations.size() == 1) {<NEW_LINE>UsedMemory mem = info.usedMemoryLocations.get(0);<NEW_LINE>long mask;<NEW_LINE>switch(mem.getAddressSize()) {<NEW_LINE>case CodeSize.CODE16:<NEW_LINE>mask = 0xFFFF;<NEW_LINE>break;<NEW_LINE>case CodeSize.CODE32:<NEW_LINE>mask = 0xFFFF_FFFFL;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>mask = 0xFFFF_FFFF_FFFF_FFFFL;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>long displ = (mem.getDisplacement() + extraDispl) & mask;<NEW_LINE>info.usedMemoryLocations.set(0, new UsedMemory(mem.getSegment(), mem.getBase(), mem.getIndex(), mem.getScale(), displ, mem.getMemorySize(), mem.getAccess(), mem.getAddressSize()<MASK><NEW_LINE>} else<NEW_LINE>assert false;<NEW_LINE>}<NEW_LINE>} | , mem.getVsibSize())); |
1,720,191 | protected JComponent createLeftTop() {<NEW_LINE>varList = new VarListPanel();<NEW_LINE>varList.setType(DataPanel.VAR_LIST);<NEW_LINE>varList.addListMouseListener(new LocalListMouseListener());<NEW_LINE>varList.setPreferredSize(new Dimension(325, 300));<NEW_LINE>varList.getJList().setTransferHandler(new DataTransferHandler());<NEW_LINE>varList.getJList().setDragEnabled(true);<NEW_LINE>Border loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);<NEW_LINE>varList.setBorder(BorderFactory.createTitledBorder(loweredetched, "Vars"));<NEW_LINE>varList.getJList(<MASK><NEW_LINE>String[] popupMenuActions = { "addVar", "expandVar", "contractVar", "changeUnits" };<NEW_LINE>varList.setPopup(createPopupMenu(popupMenuActions), 0);<NEW_LINE>return varList;<NEW_LINE>} | ).setBackground(Color.white); |
539,499 | public void SetData(Buffer data) {<NEW_LINE>if (data instanceof ByteBuffer) {<NEW_LINE>if (!data.isDirect()) {<NEW_LINE>ByteBuffer buff = ByteBuffer.<MASK><NEW_LINE>buff.order(ByteOrder.nativeOrder());<NEW_LINE>buff.put((ByteBuffer) data);<NEW_LINE>data.rewind();<NEW_LINE>buff.rewind();<NEW_LINE>data = buff;<NEW_LINE>}<NEW_LINE>} else if (data instanceof FloatBuffer) {<NEW_LINE>if (GetType() != Type.FLOAT32) {<NEW_LINE>throw new IllegalArgumentException("Can't set a float buffer to the non-float blob.");<NEW_LINE>}<NEW_LINE>if (!data.isDirect()) {<NEW_LINE>ByteBuffer buff = ByteBuffer.allocateDirect(data.capacity() * (Float.SIZE / Byte.SIZE));<NEW_LINE>buff.order(ByteOrder.nativeOrder());<NEW_LINE>buff.asFloatBuffer().put((FloatBuffer) data);<NEW_LINE>data.rewind();<NEW_LINE>buff.rewind();<NEW_LINE>data = buff;<NEW_LINE>}<NEW_LINE>} else if (data instanceof IntBuffer) {<NEW_LINE>if (GetType() != Type.INT32) {<NEW_LINE>throw new IllegalArgumentException("Can't set an int buffer to the non-int blob.");<NEW_LINE>}<NEW_LINE>if (!data.isDirect()) {<NEW_LINE>ByteBuffer buff = ByteBuffer.allocateDirect(data.capacity() * (Integer.SIZE / Byte.SIZE));<NEW_LINE>buff.order(ByteOrder.nativeOrder());<NEW_LINE>buff.asIntBuffer().put((IntBuffer) data);<NEW_LINE>data.rewind();<NEW_LINE>buff.rewind();<NEW_LINE>data = buff;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unexpected buffer type: " + data);<NEW_LINE>}<NEW_LINE>setData(nativeHandle, data);<NEW_LINE>} | allocateDirect(data.capacity()); |
366,908 | private void createArea(final NodeModel node) {<NEW_LINE>final NodeView nodeView = mapView.getNodeView(node);<NEW_LINE>if (nodeView != null) {<NEW_LINE>final AreaHolder holder = new AreaHolder();<NEW_LINE>holder.title = TextController.getController().getShortPlainText(node);<NEW_LINE>holder.alt = TextController.getController().getShortPlainText(node);<NEW_LINE>holder.href = node.createID();<NEW_LINE>final Point contentXY = mapView.getNodeContentLocation(nodeView);<NEW_LINE>final <MASK><NEW_LINE>holder.coordinates.x = (int) (contentXY.x - innerBounds.getMinX());<NEW_LINE>holder.coordinates.y = (int) (contentXY.y - innerBounds.getMinY());<NEW_LINE>holder.coordinates.width = content.getWidth();<NEW_LINE>holder.coordinates.height = content.getHeight();<NEW_LINE>area.add(holder);<NEW_LINE>for (final NodeModel child : node.getChildren()) {<NEW_LINE>createArea(child);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | JComponent content = nodeView.getContent(); |
980,254 | // http://download.oracle.com/javase/1.3/docs/guide/rmi/spec/rmi-protocol.html<NEW_LINE>public static void main(String[] args) throws Exception {<NEW_LINE>FileOutputStream fos = new FileOutputStream("build/rmipacket");<NEW_LINE>ServerSocket ss = new ServerSocket(11099);<NEW_LINE>Thread t = new Thread(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>RMISender.main(new String[] { "file:./rmidummy.jar", "localhost", "11099" });<NEW_LINE>} catch (UnmarshalException ex) {<NEW_LINE>// expected<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>t.setDaemon(true);<NEW_LINE>t.start();<NEW_LINE><MASK><NEW_LINE>ss.close();<NEW_LINE>DataInputStream in = new DataInputStream(s.getInputStream());<NEW_LINE>DataOutputStream out = new DataOutputStream(s.getOutputStream());<NEW_LINE>byte[] hdr = new byte[7];<NEW_LINE>in.readFully(hdr);<NEW_LINE>if (!new String(hdr, "ISO-8859-1").equals("JRMI\0\2K")) {<NEW_LINE>throw new IOException("Unsupported RMI header");<NEW_LINE>}<NEW_LINE>out.write('N');<NEW_LINE>out.writeUTF("127.0.0.1");<NEW_LINE>out.writeInt(11099);<NEW_LINE>out.flush();<NEW_LINE>in.readUTF();<NEW_LINE>in.readInt();<NEW_LINE>s.setSoTimeout(1000);<NEW_LINE>try {<NEW_LINE>byte[] buf = new byte[4096];<NEW_LINE>int len;<NEW_LINE>while ((len = in.read(buf)) != -1) {<NEW_LINE>fos.write(buf, 0, len);<NEW_LINE>}<NEW_LINE>} catch (InterruptedIOException ex) {<NEW_LINE>// we are done<NEW_LINE>}<NEW_LINE>fos.close();<NEW_LINE>} | Socket s = ss.accept(); |
346,878 | private void convertTCPSampler(MsTCPSampler msTCPSampler, TCPSampler tcpSampler) {<NEW_LINE>msTCPSampler.<MASK><NEW_LINE>msTCPSampler.setType("TCPSampler");<NEW_LINE>msTCPSampler.setServer(tcpSampler.getServer());<NEW_LINE>msTCPSampler.setPort(tcpSampler.getPort() + "");<NEW_LINE>msTCPSampler.setCtimeout(tcpSampler.getConnectTimeout() + "");<NEW_LINE>msTCPSampler.setReUseConnection(tcpSampler.getProperty(TCPSampler.RE_USE_CONNECTION).getBooleanValue());<NEW_LINE>msTCPSampler.setNodelay(tcpSampler.getProperty(TCPSampler.NODELAY).getBooleanValue());<NEW_LINE>msTCPSampler.setCloseConnection(tcpSampler.isCloseConnection());<NEW_LINE>msTCPSampler.setSoLinger(tcpSampler.getSoLinger() + "");<NEW_LINE>msTCPSampler.setEolByte(tcpSampler.getEolByte() + "");<NEW_LINE>msTCPSampler.setRequest(tcpSampler.getRequestData());<NEW_LINE>msTCPSampler.setUsername(tcpSampler.getProperty(ConfigTestElement.USERNAME).getStringValue());<NEW_LINE>msTCPSampler.setPassword(tcpSampler.getProperty(ConfigTestElement.PASSWORD).getStringValue());<NEW_LINE>msTCPSampler.setClassname(tcpSampler.getClassname());<NEW_LINE>} | setName(tcpSampler.getName()); |
337,856 | public TransformationStatus transform(TransformWork work) throws IOException, ValidationException, RepoException {<NEW_LINE>SkylarkConsole skylarkConsole = new SkylarkConsole(work.getConsole());<NEW_LINE>TransformWork skylarkWork = work.withConsole(skylarkConsole).withParams(params);<NEW_LINE>TransformationStatus status = TransformationStatus.success();<NEW_LINE>try (Mutability mu = Mutability.create("dynamic_transform")) {<NEW_LINE>StarlarkThread thread = new StarlarkThread(mu, StarlarkSemantics.DEFAULT);<NEW_LINE>thread.setPrintHandler(printHandler);<NEW_LINE>Object result = Starlark.call(thread, function, ImmutableList.of(skylarkWork), /*kwargs=*/<NEW_LINE>ImmutableMap.of());<NEW_LINE>result = result == Starlark.NONE ? TransformationStatus.success() : result;<NEW_LINE>checkCondition(result instanceof TransformationStatus, "Dynamic transforms functions should return nothing or objects of type %s, but '%s'" + " returned: %s", TransformationStatus.STARLARK_TYPE_NAME, describe(), result);<NEW_LINE>status = (TransformationStatus) result;<NEW_LINE>} catch (EvalException e) {<NEW_LINE>if (e.getCause() instanceof EmptyChangeException) {<NEW_LINE>throw ((<MASK><NEW_LINE>}<NEW_LINE>if (e.getCause() instanceof RepoException) {<NEW_LINE>throw new RepoException(String.format("Error while executing the skylark transformation %s: %s", describe(), e.getMessageWithStack()), e);<NEW_LINE>}<NEW_LINE>throw new ValidationException(String.format("Error while executing the skylark transformation %s: %s", describe(), e.getMessageWithStack()), e);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>throw new RuntimeException("This should not happen.", e);<NEW_LINE>} finally {<NEW_LINE>work.updateFrom(skylarkWork);<NEW_LINE>}<NEW_LINE>checkCondition(skylarkConsole.getErrorCount() == 0, "%d error(s) while executing %s", skylarkConsole.getErrorCount(), describe());<NEW_LINE>return status;<NEW_LINE>} | EmptyChangeException) e.getCause()); |
1,127,707 | protected int XXX_get_pending_length_with_no_symbol_tables() {<NEW_LINE>int buffer_length = _manager.buffer().size();<NEW_LINE>int patch_amount = 0;<NEW_LINE>for (int patch_idx = 0; patch_idx < _patch_count; patch_idx++) {<NEW_LINE>// int vlen = _patch_list[patch_idx + IonBinaryWriter.POSITION_OFFSET];<NEW_LINE>int vlen = _patch_lengths[patch_idx];<NEW_LINE>if (vlen >= _Private_IonConstants.lnIsVarLen) {<NEW_LINE>int <MASK><NEW_LINE>patch_amount += ln;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int symbol_table_length = 0;<NEW_LINE>int total_length = 0;<NEW_LINE>total_length += buffer_length + patch_amount + symbol_table_length;<NEW_LINE>return total_length;<NEW_LINE>} | ln = IonBinary.lenVarUInt(vlen); |
328,032 | protected Boolean doInBackground(Uri... uris) {<NEW_LINE>try {<NEW_LINE>InputStream accountInputStream = mContext.getContentResolver().openInputStream(uris[0]);<NEW_LINE>mImportedBookUID = GncXmlImporter.parse(accountInputStream);<NEW_LINE>} catch (Exception exception) {<NEW_LINE>Log.e(ImportAsyncTask.class.getName(), "" + exception.getMessage());<NEW_LINE>Crashlytics.log("Could not open: " + uris[0].toString());<NEW_LINE>Crashlytics.logException(exception);<NEW_LINE>exception.printStackTrace();<NEW_LINE>final <MASK><NEW_LINE>Crashlytics.log(err_msg);<NEW_LINE>mContext.runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Toast.makeText(mContext, mContext.getString(R.string.toast_error_importing_accounts) + "\n" + err_msg, Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Cursor cursor = mContext.getContentResolver().query(uris[0], null, null, null, null);<NEW_LINE>if (cursor != null && cursor.moveToFirst()) {<NEW_LINE>int nameIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);<NEW_LINE>String displayName = cursor.getString(nameIndex);<NEW_LINE>ContentValues contentValues = new ContentValues();<NEW_LINE>contentValues.put(DatabaseSchema.BookEntry.COLUMN_DISPLAY_NAME, displayName);<NEW_LINE>contentValues.put(DatabaseSchema.BookEntry.COLUMN_SOURCE_URI, uris[0].toString());<NEW_LINE>BooksDbAdapter.getInstance().updateRecord(mImportedBookUID, contentValues);<NEW_LINE>cursor.close();<NEW_LINE>}<NEW_LINE>// set the preferences to their default values<NEW_LINE>mContext.getSharedPreferences(mImportedBookUID, Context.MODE_PRIVATE).edit().putBoolean(mContext.getString(R.string.key_use_double_entry), true).apply();<NEW_LINE>return true;<NEW_LINE>} | String err_msg = exception.getLocalizedMessage(); |
958,636 | public void deleteProcessRule(HttpServletRequest request, RuleEngineEntity engineEntity) throws GovernanceException {<NEW_LINE>try {<NEW_LINE>if (!this.checkProcessorExist(request)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String deleteUrl = new StringBuffer(this.getProcessorUrl()).append(ConstantProperties.PROCESSOR_DELETE_CEP_RULE).append(ConstantProperties.QUESTION_MARK).append("id=").append(engineEntity.getId()).toString();<NEW_LINE>log.info("processor delete begin,id:{}", engineEntity.getId());<NEW_LINE>CloseableHttpResponse closeResponse = commonService.getCloseResponse(request, deleteUrl);<NEW_LINE>String mes = EntityUtils.toString(closeResponse.getEntity());<NEW_LINE>log.info("delete rule result:{}", mes);<NEW_LINE>// deal processor result<NEW_LINE>int statusCode = closeResponse.getStatusLine().getStatusCode();<NEW_LINE>if (200 != statusCode) {<NEW_LINE>log.error(ErrorCode.PROCESS_CONNECT_ERROR.getCodeDesc());<NEW_LINE>throw new GovernanceException(ErrorCode.PROCESS_CONNECT_ERROR);<NEW_LINE>}<NEW_LINE>Map jsonObject = JsonHelper.json2Object(mes, Map.class);<NEW_LINE>Integer code = Integer.valueOf(jsonObject.get("errorCode").toString());<NEW_LINE>if (PROCESSOR_SUCCESS_CODE != code) {<NEW_LINE>String msg = jsonObject.get("errorMsg").toString();<NEW_LINE>throw new GovernanceException(msg);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("processor delete ruleEngine fail ! {}", e.getMessage());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new GovernanceException("processor delete ruleEngine fail ", e); |
187,397 | public boolean apply(Game game, Ability source) {<NEW_LINE>Token token = new KorWarriorToken();<NEW_LINE>token.putOntoBattlefield(1, game, source, source.getControllerId());<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<Permanent> tokens = token.getLastAddedTokenIds().stream().map(game::getPermanent).filter(Objects::nonNull).<MASK><NEW_LINE>int equipCount = game.getBattlefield().count(filter, source.getControllerId(), source, game);<NEW_LINE>if (tokens.isEmpty() || equipCount == 0 || !player.chooseUse(outcome, "Attach an equipment to the token?", source, game)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Permanent tokenCreature = tokens.get(0);<NEW_LINE>if (tokens.size() > 1) {<NEW_LINE>FilterPermanent tokenFilter = new FilterPermanent("token");<NEW_LINE>tokenFilter.add(Predicates.or(tokens.stream().map(MageObject::getId).map(PermanentIdPredicate::new).collect(Collectors.toSet())));<NEW_LINE>TargetPermanent target = new TargetPermanent(tokenFilter);<NEW_LINE>target.setNotTarget(true);<NEW_LINE>player.choose(outcome, target, source, game);<NEW_LINE>tokenCreature = game.getPermanent(target.getFirstTarget());<NEW_LINE>}<NEW_LINE>TargetPermanent target = new TargetPermanent(filter);<NEW_LINE>target.setNotTarget(true);<NEW_LINE>player.choose(outcome, target, source, game);<NEW_LINE>tokenCreature.addAttachment(target.getFirstTarget(), source, game);<NEW_LINE>return true;<NEW_LINE>} | collect(Collectors.toList()); |
331,266 | public List<Object> findByRelation(String colName, Object colValue, Class entityClazz) {<NEW_LINE>EntityMetadata m = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClazz);<NEW_LINE>// you got column name and column value.<NEW_LINE>DBCollection dbCollection = mongoDb.getCollection(m.getTableName());<NEW_LINE>BasicDBObject query = new BasicDBObject();<NEW_LINE>query.put(colName, MongoDBUtils.populateValue(colValue<MASK><NEW_LINE>KunderaCoreUtils.printQuery("Find by relation:" + query, showQuery);<NEW_LINE>DBCursor cursor = dbCollection.find(query);<NEW_LINE>DBObject fetchedDocument = null;<NEW_LINE>List<Object> results = new ArrayList<Object>();<NEW_LINE>while (cursor.hasNext()) {<NEW_LINE>fetchedDocument = cursor.next();<NEW_LINE>populateEntity(m, results, fetchedDocument);<NEW_LINE>}<NEW_LINE>return results.isEmpty() ? null : results;<NEW_LINE>} | , colValue.getClass())); |
1,500,056 | private static Bundle toBundle(@Nullable RemoteMessage.Notification notification) {<NEW_LINE>if (notification == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Bundle serializedNotification = new Bundle();<NEW_LINE>serializedNotification.putString("body", notification.getBody());<NEW_LINE>serializedNotification.putStringArray("bodyLocalizationArgs", notification.getBodyLocalizationArgs());<NEW_LINE>serializedNotification.putString("bodyLocalizationKey", notification.getBodyLocalizationKey());<NEW_LINE>serializedNotification.putString("channelId", notification.getChannelId());<NEW_LINE>serializedNotification.putString("clickAction", notification.getClickAction());<NEW_LINE>serializedNotification.putString("color", notification.getColor());<NEW_LINE>serializedNotification.putBoolean("usesDefaultLightSettings", notification.getDefaultLightSettings());<NEW_LINE>serializedNotification.putBoolean("usesDefaultSound", notification.getDefaultSound());<NEW_LINE>serializedNotification.putBoolean("usesDefaultVibrateSettings", notification.getDefaultVibrateSettings());<NEW_LINE>if (notification.getEventTime() != null) {<NEW_LINE>serializedNotification.putLong("eventTime", notification.getEventTime());<NEW_LINE>} else {<NEW_LINE>serializedNotification.putString("eventTime", null);<NEW_LINE>}<NEW_LINE>serializedNotification.putString("icon", notification.getIcon());<NEW_LINE>if (notification.getImageUrl() != null) {<NEW_LINE>serializedNotification.putString("imageUrl", notification.getImageUrl().toString());<NEW_LINE>} else {<NEW_LINE>serializedNotification.putString("imageUrl", null);<NEW_LINE>}<NEW_LINE>serializedNotification.putIntArray("lightSettings", notification.getLightSettings());<NEW_LINE>if (notification.getLink() != null) {<NEW_LINE>serializedNotification.putString("link", notification.getLink().toString());<NEW_LINE>} else {<NEW_LINE>serializedNotification.putString("link", null);<NEW_LINE>}<NEW_LINE>serializedNotification.putBoolean("localOnly", notification.getLocalOnly());<NEW_LINE>if (notification.getNotificationCount() != null) {<NEW_LINE>serializedNotification.putInt("notificationCount", notification.getNotificationCount());<NEW_LINE>} else {<NEW_LINE>serializedNotification.putString("notificationCount", null);<NEW_LINE>}<NEW_LINE>if (notification.getNotificationPriority() != null) {<NEW_LINE>serializedNotification.putInt("notificationPriority", notification.getNotificationPriority());<NEW_LINE>} else {<NEW_LINE>serializedNotification.putString("notificationPriority", null);<NEW_LINE>}<NEW_LINE>serializedNotification.putString("sound", notification.getSound());<NEW_LINE>serializedNotification.putBoolean(<MASK><NEW_LINE>serializedNotification.putString("tag", notification.getTag());<NEW_LINE>serializedNotification.putString("ticker", notification.getTicker());<NEW_LINE>serializedNotification.putString("title", notification.getTitle());<NEW_LINE>serializedNotification.putStringArray("titleLocalizationArgs", notification.getTitleLocalizationArgs());<NEW_LINE>serializedNotification.putString("titleLocalizationKey", notification.getTitleLocalizationKey());<NEW_LINE>serializedNotification.putLongArray("vibrateTimings", notification.getVibrateTimings());<NEW_LINE>if (notification.getVisibility() != null) {<NEW_LINE>serializedNotification.putInt("visibility", notification.getVisibility());<NEW_LINE>} else {<NEW_LINE>serializedNotification.putString("visibility", null);<NEW_LINE>}<NEW_LINE>return serializedNotification;<NEW_LINE>} | "sticky", notification.getSticky()); |
1,247,191 | private void buildMustQueryListByCondition(final EventQueryCondition condition, final BoolQueryBuilder query) {<NEW_LINE>if (!isNullOrEmpty(condition.getUuid())) {<NEW_LINE>query.must(Query.term(Event.UUID, condition.getUuid()));<NEW_LINE>}<NEW_LINE>final Source source = condition.getSource();<NEW_LINE>if (source != null) {<NEW_LINE>if (!isNullOrEmpty(source.getService())) {<NEW_LINE>query.must(Query.term(Event.SERVICE<MASK><NEW_LINE>}<NEW_LINE>if (!isNullOrEmpty(source.getServiceInstance())) {<NEW_LINE>query.must(Query.term(Event.SERVICE_INSTANCE, source.getServiceInstance()));<NEW_LINE>}<NEW_LINE>if (!isNullOrEmpty(source.getEndpoint())) {<NEW_LINE>query.must(Query.matchPhrase(MatchCNameBuilder.INSTANCE.build(Event.ENDPOINT), source.getEndpoint()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isNullOrEmpty(condition.getName())) {<NEW_LINE>query.must(Query.term(Event.NAME, condition.getName()));<NEW_LINE>}<NEW_LINE>if (condition.getType() != null) {<NEW_LINE>query.must(Query.term(Event.TYPE, condition.getType().name()));<NEW_LINE>}<NEW_LINE>final Duration startTime = condition.getTime();<NEW_LINE>if (startTime != null) {<NEW_LINE>if (startTime.getStartTimestamp() > 0) {<NEW_LINE>query.must(Query.range(Event.START_TIME).gt(startTime.getStartTimestamp()));<NEW_LINE>}<NEW_LINE>if (startTime.getEndTimestamp() > 0) {<NEW_LINE>query.must(Query.range(Event.END_TIME).lt(startTime.getEndTimestamp()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , source.getService())); |
365,487 | public static ASTNode addChildren(ASTNode parent, @Nonnull ASTNode first, @Nonnull ASTNode last, ASTNode anchorBefore) {<NEW_LINE><MASK><NEW_LINE>ASTNode current = first;<NEW_LINE>while (current != lastChild) {<NEW_LINE>saveWhitespacesInfo(current);<NEW_LINE>checkForOuters(current);<NEW_LINE>current = current.getTreeNext();<NEW_LINE>}<NEW_LINE>if (anchorBefore != null && CommentUtilCore.isComment(anchorBefore)) {<NEW_LINE>final ASTNode anchorPrev = anchorBefore.getTreePrev();<NEW_LINE>if (anchorPrev != null && anchorPrev.getElementType() == TokenType.WHITE_SPACE) {<NEW_LINE>anchorBefore = anchorPrev;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>parent.addChildren(first, lastChild, anchorBefore);<NEW_LINE>ASTNode firstAddedLeaf = findFirstLeaf(first, last);<NEW_LINE>ASTNode prevLeaf = TreeUtil.prevLeaf(first);<NEW_LINE>ASTNode result = first;<NEW_LINE>if (firstAddedLeaf != null) {<NEW_LINE>ASTNode placeHolderEnd = makePlaceHolderBetweenTokens(prevLeaf, firstAddedLeaf, isFormattingRequired(prevLeaf, first), false);<NEW_LINE>if (placeHolderEnd != prevLeaf && first == firstAddedLeaf) {<NEW_LINE>result = placeHolderEnd;<NEW_LINE>}<NEW_LINE>ASTNode lastAddedLeaf = findLastLeaf(first, last);<NEW_LINE>placeHolderEnd = makePlaceHolderBetweenTokens(lastAddedLeaf, TreeUtil.nextLeaf(last), true, false);<NEW_LINE>if (placeHolderEnd != lastAddedLeaf && lastAddedLeaf == first) {<NEW_LINE>result = placeHolderEnd;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>makePlaceHolderBetweenTokens(prevLeaf, TreeUtil.nextLeaf(last), isFormattingRequired(prevLeaf, first), false);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | ASTNode lastChild = last.getTreeNext(); |
223,151 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {<NEW_LINE>super.onMeasure(widthMeasureSpec, heightMeasureSpec);<NEW_LINE>View view = resolveView();<NEW_LINE>if (view != null) {<NEW_LINE>int width = MeasureSpec.getSize(widthMeasureSpec);<NEW_LINE>int <MASK><NEW_LINE>int leftLineWidth = leftBorder == BorderMode.LINE ? 1 : getBorderWidth(leftPageBorder);<NEW_LINE>int rightLineWidth = rightBorder == BorderMode.HIDDEN ? 0 : getBorderWidth(rightPageBorder);<NEW_LINE>width = width - (leftLineWidth + rightLineWidth);<NEW_LINE>if (!isFullWidth) {<NEW_LINE>int headerFooterHeight = 0;<NEW_LINE>width = width - (viewPaddingSmall + viewPaddingLarge);<NEW_LINE>height = height - 2 * headerFooterHeight;<NEW_LINE>}<NEW_LINE>view.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));<NEW_LINE>}<NEW_LINE>} | height = MeasureSpec.getSize(heightMeasureSpec); |
1,628,893 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see java.lang.Runnable#run()<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Datapoint dp = null;<NEW_LINE>try {<NEW_LINE>while (true) {<NEW_LINE>sLogger.debug("Autorefresh: Waiting for new item in reader queue");<NEW_LINE>dp = readQueue.take();<NEW_LINE>sLogger.debug("Autorefresh: got new item {} in reader queue", dp.getName());<NEW_LINE>if (mKNXConnected) {<NEW_LINE><MASK><NEW_LINE>readFromKNXBus(dp);<NEW_LINE>long readingPause = KNXConnection.getReadingPause();<NEW_LINE>if (readingPause > 0) {<NEW_LINE>try {<NEW_LINE>sLogger.debug("Autorefresh: DatapointReaderTask Waiting {} msecs to prevent KNX bus overload", readingPause);<NEW_LINE>Thread.sleep(readingPause);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>sLogger.debug("Autorefresh: DatapointReaderTask KNX reading pause has been interrupted: {}", e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>sLogger.debug("Autorefresh: Not connected. Skipping bus read.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>sLogger.debug("Autorefresh: DatapointReaderTask wait on blockingqueue interrupted: {}", ex.getMessage());<NEW_LINE>}<NEW_LINE>sLogger.debug("Autorefresh: DatapointReaderTask interrupted.");<NEW_LINE>} | sLogger.debug("Autorefresh: Trying to read from KNX bus: {}", dp); |
338,688 | private void whileStatement() {<NEW_LINE>move(true);<NEW_LINE>// prepare to call __reducer_callcc(LOOP, iterator, statements)<NEW_LINE>getCodeGeneratorWithTimes().onMethodName(Constants.ReducerFn);<NEW_LINE>getCodeGeneratorWithTimes().onConstant(Constants.REDUCER_LOOP);<NEW_LINE>getCodeGeneratorWithTimes().onMethodParameter(this.lookhead);<NEW_LINE>// create a lambda function wraps while body(iterator)<NEW_LINE>boolean newLexicalScope = this.scope.newLexicalScope;<NEW_LINE>this.scope.newLexicalScope = true;<NEW_LINE>{<NEW_LINE>getCodeGeneratorWithTimes().onLambdaDefineStart(getPrevToken().withMeta(Constants.SCOPE_META, this.scope.newLexicalScope));<NEW_LINE>getCodeGeneratorWithTimes(<MASK><NEW_LINE>ifStatement(true, false);<NEW_LINE>getCodeGeneratorWithTimes().onLambdaBodyEnd(this.lookhead);<NEW_LINE>getCodeGenerator().onMethodParameter(this.lookhead);<NEW_LINE>}<NEW_LINE>if (expectChar(';')) {<NEW_LINE>// the statement is ended.<NEW_LINE>getCodeGenerator().onConstant(Constants.ReducerEmptyVal);<NEW_LINE>} else {<NEW_LINE>// create a lambda function wraps statements after while(statements)<NEW_LINE>//<NEW_LINE>getCodeGeneratorWithTimes().//<NEW_LINE>onLambdaDefineStart(getPrevToken().withMeta(Constants.SCOPE_META, this.scope.newLexicalScope).withMeta(Constants.INHERIT_ENV_META, true));<NEW_LINE>getCodeGeneratorWithTimes().onLambdaBodyStart(this.lookhead);<NEW_LINE>if (statements() == StatementType.Empty) {<NEW_LINE>getCodeGenerator().onConstant(Constants.ReducerEmptyVal);<NEW_LINE>}<NEW_LINE>getCodeGeneratorWithTimes().onLambdaBodyEnd(this.lookhead);<NEW_LINE>}<NEW_LINE>getCodeGeneratorWithTimes().onMethodParameter(this.lookhead);<NEW_LINE>// call __reducer_callcc(LOOP, iterator, statements)<NEW_LINE>getCodeGeneratorWithTimes().onMethodInvoke(this.lookhead);<NEW_LINE>// restore newLexicalScope<NEW_LINE>this.scope.newLexicalScope = newLexicalScope;<NEW_LINE>} | ).onLambdaBodyStart(this.lookhead); |
1,631,974 | public List<ValidateError> validate() {<NEW_LINE>List<ValidateError> errors = new ArrayList<>();<NEW_LINE>Validator validator;<NEW_LINE>ValidateError error;<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.systemName, convLabelName("System Name"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(this.systemName, convLabelName("System Name"), 64);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.version, convLabelName("Version"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(this.version, convLabelName("Version"), 16);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(this.rowId, convLabelName("Row Id"), 64);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = <MASK><NEW_LINE>error = validator.validate(this.insertUser, convLabelName("Insert User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.updateUser, convLabelName("Update User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.deleteFlag, convLabelName("Delete Flag"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>} | ValidatorFactory.getInstance(Validator.INTEGER); |
1,044,302 | public RouteInfoDTO insertRoute(RouteInfoDTO routeInfoDTO) throws OperatorRouteException {<NEW_LINE>try {<NEW_LINE>// todo<NEW_LINE>validator(routeInfoDTO);<NEW_LINE>if (StringUtils.isBlank(routeInfoDTO.getRouteId())) {<NEW_LINE>String routeId = RouteIdGenerator.gen(routeInfoDTO);<NEW_LINE>routeInfoDTO.setRouteId(routeId);<NEW_LINE>}<NEW_LINE>RouteInfoDO infoDO = this.routeInfoDtoConvert.from(routeInfoDTO);<NEW_LINE>if (routeInfoDTO.getOrder() <= 0) {<NEW_LINE>TeslaRouteOrderUtil.setDefaultOrder(infoDO);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(infoDO.getUrl()) && infoDO.getUrl().startsWith(ServerNameCheckUtil.SERVER_NAME_PREFIX)) {<NEW_LINE>ServerNameCheckUtil.check(infoDO.getUrl());<NEW_LINE>}<NEW_LINE>List<RouteInfoDO> routeInfos = this.routeInfoRepository.listAll();<NEW_LINE>boolean exist = routeInfos.stream().anyMatch(route -> Objects.equals(route.getRouteId(), infoDO.getRouteId()));<NEW_LINE>if (exist) {<NEW_LINE>throw new OperatorRouteException("route config exist, routeId=" + infoDO.getRouteId());<NEW_LINE>}<NEW_LINE>infoDO.setGmtCreate(new Date());<NEW_LINE>infoDO.setGmtModified(new Date());<NEW_LINE>routeInfos.add(infoDO);<NEW_LINE>boolean result = this.routeInfoRepository.saveAll(routeInfos);<NEW_LINE>log.info("insertRoute||routeId={}||routeInfo={}||res={}", infoDO.getRouteId(), infoDO.toString(), result);<NEW_LINE>List<RouteInfoDO> routeInfoDOS = this.routeInfoRepository.listAll();<NEW_LINE>if (CollectionUtils.isEmpty(routeInfoDOS)) {<NEW_LINE>throw new RuntimeException("route is empty.");<NEW_LINE>}<NEW_LINE>Optional<RouteInfoDO> any = routeInfoDOS.stream().filter(routeInfoDO -> Objects.equals(routeInfoDO.getRouteId(), routeInfoDTO.getRouteId())).findAny();<NEW_LINE>if (!any.isPresent()) {<NEW_LINE>throw new RuntimeException(String.format("route insert failed, routeId=%s"<MASK><NEW_LINE>}<NEW_LINE>return this.routeInfoDtoConvert.to(infoDO);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>log.error("error, ", e);<NEW_LINE>throw new OperatorRouteException(e);<NEW_LINE>}<NEW_LINE>} | , routeInfoDTO.getRouteId())); |
1,718,241 | private static void sortAndAddMapEntriesToList(@NonNull final Multimap<IPair<String, AttributeId>, AttributeValueId> groupNameToAttributeValueIds, @NonNull final Builder<DimensionSpecGroup> list) {<NEW_LINE>final Collection<Entry<IPair<String, AttributeId>, Collection<AttributeValueId>>> //<NEW_LINE>entrySet = groupNameToAttributeValueIds.asMap().entrySet();<NEW_LINE>final ArrayList<DimensionSpecGroup> newGroups = new ArrayList<>();<NEW_LINE>for (final Entry<IPair<String, AttributeId>, Collection<AttributeValueId>> entry : entrySet) {<NEW_LINE>final String groupName = entry<MASK><NEW_LINE>final ITranslatableString groupNameTrl = TranslatableStrings.constant(groupName);<NEW_LINE>final Optional<AttributeId> groupAttributeId = Optional.ofNullable(entry.getKey().getRight());<NEW_LINE>final AttributesKey attributesKey = createAttributesKey(entry.getValue());<NEW_LINE>final DimensionSpecGroup newGroup = new DimensionSpecGroup(() -> groupNameTrl, attributesKey, groupAttributeId);<NEW_LINE>newGroups.add(newGroup);<NEW_LINE>}<NEW_LINE>newGroups.sort(Comparator.comparing(DimensionSpecGroup::getAttributesKey));<NEW_LINE>list.addAll(newGroups);<NEW_LINE>} | .getKey().getLeft(); |
822,853 | public static ByteBuf copiedBuffer(ByteBuf... buffers) {<NEW_LINE>switch(buffers.length) {<NEW_LINE>case 0:<NEW_LINE>return EMPTY_BUFFER;<NEW_LINE>case 1:<NEW_LINE>return copiedBuffer(buffers[0]);<NEW_LINE>}<NEW_LINE>// Merge the specified buffers into one buffer.<NEW_LINE>ByteOrder order = null;<NEW_LINE>int length = 0;<NEW_LINE>for (ByteBuf b : buffers) {<NEW_LINE>int bLen = b.readableBytes();<NEW_LINE>if (bLen <= 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (Integer.MAX_VALUE - length < bLen) {<NEW_LINE>throw new IllegalArgumentException("The total length of the specified buffers is too big.");<NEW_LINE>}<NEW_LINE>length += bLen;<NEW_LINE>if (order != null) {<NEW_LINE>if (!order.equals(b.order())) {<NEW_LINE>throw new IllegalArgumentException("inconsistent byte order");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>order = b.order();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (length == 0) {<NEW_LINE>return EMPTY_BUFFER;<NEW_LINE>}<NEW_LINE>byte[] mergedArray = PlatformDependent.allocateUninitializedArray(length);<NEW_LINE>for (int i = 0, j = 0; i < buffers.length; i++) {<NEW_LINE>ByteBuf b = buffers[i];<NEW_LINE><MASK><NEW_LINE>b.getBytes(b.readerIndex(), mergedArray, j, bLen);<NEW_LINE>j += bLen;<NEW_LINE>}<NEW_LINE>return wrappedBuffer(mergedArray).order(order);<NEW_LINE>} | int bLen = b.readableBytes(); |
808,809 | public boolean apply(Game game, Ability source) {<NEW_LINE>FilterCard filterCardInHand = new FilterCard();<NEW_LINE>filterCardInHand.add(<MASK><NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Permanent academyResearchers = game.getPermanent(source.getSourceId());<NEW_LINE>if (controller != null && academyResearchers != null) {<NEW_LINE>filterCardInHand.add(new AuraCardCanAttachToPermanentId(academyResearchers.getId()));<NEW_LINE>TargetCardInHand target = new TargetCardInHand(0, 1, filterCardInHand);<NEW_LINE>if (controller.choose(Outcome.PutCardInPlay, target, source, game)) {<NEW_LINE>Card auraInHand = game.getCard(target.getFirstTarget());<NEW_LINE>if (auraInHand != null) {<NEW_LINE>game.getState().setValue("attachTo:" + auraInHand.getId(), academyResearchers);<NEW_LINE>controller.moveCards(auraInHand, Zone.BATTLEFIELD, source, game);<NEW_LINE>if (academyResearchers.addAttachment(auraInHand.getId(), source, game)) {<NEW_LINE>game.informPlayers(controller.getLogName() + " put " + auraInHand.getLogName() + " on the battlefield attached to " + academyResearchers.getLogName() + '.');<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | SubType.AURA.getPredicate()); |
710,120 | public // }<NEW_LINE>int createParticle(ParticleDef def) {<NEW_LINE>if (m_count >= m_internalAllocatedCapacity) {<NEW_LINE>int capacity = m_count != 0 ? 2 * m_count : Settings.minParticleBufferCapacity;<NEW_LINE>capacity = limitCapacity(capacity, m_maxCount);<NEW_LINE>capacity = <MASK><NEW_LINE>capacity = limitCapacity(capacity, m_positionBuffer.userSuppliedCapacity);<NEW_LINE>capacity = limitCapacity(capacity, m_velocityBuffer.userSuppliedCapacity);<NEW_LINE>capacity = limitCapacity(capacity, m_colorBuffer.userSuppliedCapacity);<NEW_LINE>capacity = limitCapacity(capacity, m_userDataBuffer.userSuppliedCapacity);<NEW_LINE>if (m_internalAllocatedCapacity < capacity) {<NEW_LINE>m_flagsBuffer.data = reallocateBuffer(m_flagsBuffer, m_internalAllocatedCapacity, capacity, false);<NEW_LINE>m_positionBuffer.data = reallocateBuffer(m_positionBuffer, m_internalAllocatedCapacity, capacity, false);<NEW_LINE>m_velocityBuffer.data = reallocateBuffer(m_velocityBuffer, m_internalAllocatedCapacity, capacity, false);<NEW_LINE>m_accumulationBuffer = BufferUtils.reallocateBuffer(m_accumulationBuffer, 0, m_internalAllocatedCapacity, capacity, false);<NEW_LINE>m_accumulation2Buffer = BufferUtils.reallocateBuffer(Vec2.class, m_accumulation2Buffer, 0, m_internalAllocatedCapacity, capacity, true);<NEW_LINE>m_depthBuffer = BufferUtils.reallocateBuffer(m_depthBuffer, 0, m_internalAllocatedCapacity, capacity, true);<NEW_LINE>m_colorBuffer.data = reallocateBuffer(m_colorBuffer, m_internalAllocatedCapacity, capacity, true);<NEW_LINE>m_groupBuffer = BufferUtils.reallocateBuffer(ParticleGroup.class, m_groupBuffer, 0, m_internalAllocatedCapacity, capacity, false);<NEW_LINE>m_userDataBuffer.data = reallocateBuffer(m_userDataBuffer, m_internalAllocatedCapacity, capacity, true);<NEW_LINE>m_internalAllocatedCapacity = capacity;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (m_count >= m_internalAllocatedCapacity) {<NEW_LINE>return Settings.invalidParticleIndex;<NEW_LINE>}<NEW_LINE>int index = m_count++;<NEW_LINE>m_flagsBuffer.data[index] = def.flags;<NEW_LINE>m_positionBuffer.data[index].set(def.position);<NEW_LINE>// assertNotSamePosition();<NEW_LINE>m_velocityBuffer.data[index].set(def.velocity);<NEW_LINE>m_groupBuffer[index] = null;<NEW_LINE>if (m_depthBuffer != null) {<NEW_LINE>m_depthBuffer[index] = 0;<NEW_LINE>}<NEW_LINE>if (m_colorBuffer.data != null || def.color != null) {<NEW_LINE>m_colorBuffer.data = requestParticleBuffer(m_colorBuffer.dataClass, m_colorBuffer.data);<NEW_LINE>m_colorBuffer.data[index].set(def.color);<NEW_LINE>}<NEW_LINE>if (m_userDataBuffer.data != null || def.userData != null) {<NEW_LINE>m_userDataBuffer.data = requestParticleBuffer(m_userDataBuffer.dataClass, m_userDataBuffer.data);<NEW_LINE>m_userDataBuffer.data[index] = def.userData;<NEW_LINE>}<NEW_LINE>if (m_proxyCount >= m_proxyCapacity) {<NEW_LINE>int oldCapacity = m_proxyCapacity;<NEW_LINE>int newCapacity = m_proxyCount != 0 ? 2 * m_proxyCount : Settings.minParticleBufferCapacity;<NEW_LINE>m_proxyBuffer = BufferUtils.reallocateBuffer(Proxy.class, m_proxyBuffer, oldCapacity, newCapacity);<NEW_LINE>m_proxyCapacity = newCapacity;<NEW_LINE>}<NEW_LINE>m_proxyBuffer[m_proxyCount++].index = index;<NEW_LINE>return index;<NEW_LINE>} | limitCapacity(capacity, m_flagsBuffer.userSuppliedCapacity); |
824,046 | public static void main(String[] args) throws FileNotFoundException, IOException {<NEW_LINE>// Process the command-line options<NEW_LINE>CommandOption.setSummary(SvmLight2Classify.class, "A tool for classifying a stream of unlabeled instances");<NEW_LINE>CommandOption.process(SvmLight2Classify.class, args);<NEW_LINE>// Print some helpful messages for error cases<NEW_LINE>if (args.length == 0) {<NEW_LINE>CommandOption.getList(SvmLight2Classify.class).printUsage(false);<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>if (inputFile == null) {<NEW_LINE>throw new IllegalArgumentException("You must include `--input FILE ...' in order to specify a" + "file containing the instances, one per line.");<NEW_LINE>}<NEW_LINE>// Read classifier from file<NEW_LINE>Classifier classifier = null;<NEW_LINE>try {<NEW_LINE>ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(new FileInputStream(classifierFile.value)));<NEW_LINE>classifier = (Classifier) ois.readObject();<NEW_LINE>ois.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalArgumentException("Problem loading classifier from file " + classifierFile.value + ": " + e.getMessage());<NEW_LINE>}<NEW_LINE>// gdruck@cs.umass.edu<NEW_LINE>// Stop growth on the alphabets. If this is not done and new<NEW_LINE>// features are added, the feature and classifier parameter<NEW_LINE>// indices will not match.<NEW_LINE>classifier.getInstancePipe().getDataAlphabet().stopGrowth();<NEW_LINE>classifier.getInstancePipe().getTargetAlphabet().stopGrowth();<NEW_LINE>// Build a new pipe<NEW_LINE>InstanceList instances = new InstanceList(classifier.getInstancePipe());<NEW_LINE>Reader fileReader;<NEW_LINE>if (inputFile.value.toString().equals("-")) {<NEW_LINE>fileReader = new InputStreamReader(System.in);<NEW_LINE>} else {<NEW_LINE>fileReader = new InputStreamReader(new FileInputStream(inputFile.value), encoding.value);<NEW_LINE>}<NEW_LINE>// Read instances from the file<NEW_LINE>instances.addThruPipe(new SelectiveFileLineIterator(fileReader, "^\\s*#.+"));<NEW_LINE>Iterator<Instance> iterator = instances.iterator();<NEW_LINE>// Write classifications to the output file<NEW_LINE>PrintStream out = null;<NEW_LINE>if (outputFile.value.toString().equals("-")) {<NEW_LINE>out = System.out;<NEW_LINE>} else {<NEW_LINE>out = new PrintStream(outputFile.value, encoding.value);<NEW_LINE>}<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Instance instance = iterator.next();<NEW_LINE>Labeling labeling = classifier.<MASK><NEW_LINE>StringBuilder output = new StringBuilder();<NEW_LINE>output.append(instance.getName());<NEW_LINE>for (int location = 0; location < labeling.numLocations(); location++) {<NEW_LINE>output.append("\t" + labeling.labelAtLocation(location));<NEW_LINE>output.append("\t" + labeling.valueAtLocation(location));<NEW_LINE>}<NEW_LINE>out.println(output);<NEW_LINE>}<NEW_LINE>if (!outputFile.value.toString().equals("-")) {<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>} | classify(instance).getLabeling(); |
680,355 | private void recordAttributes(SpanEventRecorder recorder, MethodDescriptor methodDescriptor, Object[] args) {<NEW_LINE>if (methodDescriptor.getMethodName().equals("execute")) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_URL_ANNOTATION_KEY, args[0]);<NEW_LINE>if (recordDsl) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_DSL_ANNOTATION_KEY, chunkDsl((String) args[1]));<NEW_LINE>}<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_ACTION_ANNOTATION_KEY, "POST");<NEW_LINE>if (recordResponseHandler) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_RESPONSEHANDLE_ANNOTATION_KEY, args[2]);<NEW_LINE>}<NEW_LINE>} else if (methodDescriptor.getMethodName().equals("executeHttp")) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_URL_ANNOTATION_KEY, args[0]);<NEW_LINE>if (recordDsl) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_DSL_ANNOTATION_KEY, chunkDsl((String) args[1]));<NEW_LINE>}<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_ACTION_ANNOTATION_KEY, args[2]);<NEW_LINE>if (recordResponseHandler) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_RESPONSEHANDLE_ANNOTATION_KEY, args[3]);<NEW_LINE>}<NEW_LINE>} else if (methodDescriptor.getMethodName().equals("executeSimpleRequest")) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_URL_ANNOTATION_KEY, args[0]);<NEW_LINE>if (recordDsl) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_DSL_ANNOTATION_KEY, chunkDsl((String) args[1]));<NEW_LINE>}<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_ACTION_ANNOTATION_KEY, "POST");<NEW_LINE>if (recordResponseHandler) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_RESPONSEHANDLE_ANNOTATION_KEY, args[2]);<NEW_LINE>}<NEW_LINE>} else if (methodDescriptor.getMethodName().equals("executeRequest")) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_URL_ANNOTATION_KEY, args[0]);<NEW_LINE>if (recordDsl) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_DSL_ANNOTATION_KEY, chunkDsl((String) args[1]));<NEW_LINE>}<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants<MASK><NEW_LINE>if (recordResponseHandler) {<NEW_LINE>recorder.recordAttribute(ElasticsearchConstants.ARGS_RESPONSEHANDLE_ANNOTATION_KEY, args[3]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .ARGS_ACTION_ANNOTATION_KEY, args[2]); |
783,844 | final RevokeSignatureResult executeRevokeSignature(RevokeSignatureRequest revokeSignatureRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(revokeSignatureRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<RevokeSignatureRequest> request = null;<NEW_LINE>Response<RevokeSignatureResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RevokeSignatureRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(revokeSignatureRequest));<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, "signer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RevokeSignature");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RevokeSignatureResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RevokeSignatureResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
313,413 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Map<Player, Cards> playerCardsMap = new LinkedHashMap<>();<NEW_LINE>for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {<NEW_LINE>Player player = game.getPlayer(playerId);<NEW_LINE>if (player == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int cardCount = Math.min(player.getGraveyard().size(), 3);<NEW_LINE>if (cardCount < 1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>TargetCard target = new TargetCardInGraveyard(cardCount, StaticFilters.FILTER_CARD);<NEW_LINE>target.setNotTarget(true);<NEW_LINE>controller.chooseTarget(outcome, player.getGraveyard(<MASK><NEW_LINE>playerCardsMap.put(player, new CardsImpl(target.getTargets()));<NEW_LINE>}<NEW_LINE>for (Map.Entry<Player, Cards> entry : playerCardsMap.entrySet()) {<NEW_LINE>entry.getKey().shuffleCardsToLibrary(entry.getValue(), game, source);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | ), target, source, game); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.