idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,711,727
public JSONObject createEncryptedItem(String plaintextValue, KeyStore keyStore, KeyStore.PrivateKeyEntry privateKeyEntry) throws GeneralSecurityException, JSONException {<NEW_LINE>// Generate the IV and symmetric key with which we encrypt the value<NEW_LINE>byte[<MASK><NEW_LINE>mSecureRandom.nextBytes(ivBytes);<NEW_LINE>// constant value will be copied<NEW_LINE>@SuppressLint("InlinedApi")<NEW_LINE>KeyGenerator keyGenerator = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES);<NEW_LINE>keyGenerator.init(AESEncrypter.AES_KEY_SIZE_BITS);<NEW_LINE>SecretKey secretKey = keyGenerator.generateKey();<NEW_LINE>// Encrypt the value with the symmetric key. We need to specify the GCM parameters since the<NEW_LINE>// our secret key isn't tied to the keystore and the cipher can't use the secret key to<NEW_LINE>// generate the parameters.<NEW_LINE>GCMParameterSpec gcmSpec = new GCMParameterSpec(GCM_AUTHENTICATION_TAG_LENGTH_BITS, ivBytes);<NEW_LINE>Cipher aesCipher = Cipher.getInstance(AESEncrypter.AES_CIPHER);<NEW_LINE>aesCipher.init(Cipher.ENCRYPT_MODE, secretKey, gcmSpec);<NEW_LINE>GCMParameterSpec chosenSpec;<NEW_LINE>try {<NEW_LINE>chosenSpec = aesCipher.getParameters().getParameterSpec(GCMParameterSpec.class);<NEW_LINE>} catch (InvalidParameterSpecException e) {<NEW_LINE>// BouncyCastle tried to instantiate GCMParameterSpec using invalid constructor<NEW_LINE>// https://github.com/bcgit/bc-java/commit/507c3917c0c469d10b9f033ad641c1da195e2039#diff-c90a59e823805b6c0dcfeaf7bae65f53<NEW_LINE>// Let's do some sanity checks and use the spec we've initialized the cipher with.<NEW_LINE>if (!"GCM".equals(aesCipher.getParameters().getAlgorithm())) {<NEW_LINE>throw new InvalidAlgorithmParameterException("Algorithm chosen by the cipher (" + aesCipher.getParameters().getAlgorithm() + ") doesn't match requested (GCM).");<NEW_LINE>}<NEW_LINE>chosenSpec = gcmSpec;<NEW_LINE>}<NEW_LINE>JSONObject encryptedItem = mAESEncrypter.createEncryptedItem(plaintextValue, aesCipher, chosenSpec);<NEW_LINE>// Ensure the IV in the encrypted item matches our generated IV<NEW_LINE>String ivString = encryptedItem.getString(AESEncrypter.IV_PROPERTY);<NEW_LINE>String expectedIVString = Base64.encodeToString(ivBytes, Base64.NO_WRAP);<NEW_LINE>if (!ivString.equals(expectedIVString)) {<NEW_LINE>Log.e(TAG, String.format("HybridAESEncrypter generated two different IVs: %s and %s", expectedIVString, ivString));<NEW_LINE>throw new IllegalStateException("HybridAESEncrypter must store the same IV as the one used to parameterize the secret key");<NEW_LINE>}<NEW_LINE>// Encrypt the symmetric key with the asymmetric public key<NEW_LINE>byte[] secretKeyBytes = secretKey.getEncoded();<NEW_LINE>Cipher cipher = getRSACipher();<NEW_LINE>cipher.init(Cipher.ENCRYPT_MODE, privateKeyEntry.getCertificate());<NEW_LINE>byte[] encryptedSecretKeyBytes = cipher.doFinal(secretKeyBytes);<NEW_LINE>String encryptedSecretKeyString = Base64.encodeToString(encryptedSecretKeyBytes, Base64.NO_WRAP);<NEW_LINE>// Store the encrypted symmetric key in the encrypted item<NEW_LINE>return encryptedItem.put(ENCRYPTED_SECRET_KEY_PROPERTY, encryptedSecretKeyString);<NEW_LINE>}
] ivBytes = new byte[GCM_IV_LENGTH_BYTES];
766,999
// snippet-start:[personalize.java2.create_event_tracker.main]<NEW_LINE>public static String createEventTracker(PersonalizeClient personalizeClient, String eventTrackerName, String datasetGroupArn) {<NEW_LINE>String eventTrackerId = "";<NEW_LINE>String eventTrackerArn;<NEW_LINE>// 3 hours<NEW_LINE>long maxTime = 3 * 60 * 60;<NEW_LINE>// 20 seconds<NEW_LINE>long waitInMilliseconds = 20 * 1000;<NEW_LINE>String status;<NEW_LINE>try {<NEW_LINE>CreateEventTrackerRequest createEventTrackerRequest = CreateEventTrackerRequest.builder().name(eventTrackerName).datasetGroupArn(datasetGroupArn).build();<NEW_LINE>CreateEventTrackerResponse createEventTrackerResponse = personalizeClient.createEventTracker(createEventTrackerRequest);<NEW_LINE>eventTrackerArn = createEventTrackerResponse.eventTrackerArn();<NEW_LINE>eventTrackerId = createEventTrackerResponse.trackingId();<NEW_LINE>System.out.println("Event tracker ARN: " + eventTrackerArn);<NEW_LINE>System.out.println("Event tracker ID: " + eventTrackerId);<NEW_LINE>maxTime = Instant.now().getEpochSecond() + maxTime;<NEW_LINE>DescribeEventTrackerRequest describeRequest = DescribeEventTrackerRequest.builder().<MASK><NEW_LINE>while (Instant.now().getEpochSecond() < maxTime) {<NEW_LINE>status = personalizeClient.describeEventTracker(describeRequest).eventTracker().status();<NEW_LINE>System.out.println("EventTracker status: " + status);<NEW_LINE>if (status.equals("ACTIVE") || status.equals("CREATE FAILED")) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(waitInMilliseconds);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>System.out.println(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return eventTrackerId;<NEW_LINE>} catch (PersonalizeException e) {<NEW_LINE>System.out.println(e.awsErrorDetails().errorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>return eventTrackerId;<NEW_LINE>}
eventTrackerArn(eventTrackerArn).build();
1,429,576
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {<NEW_LINE>// current card's part<NEW_LINE>Card cardToCheck = game.getCard(objectId);<NEW_LINE>if (cardToCheck == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// must be you<NEW_LINE>if (!affectedControllerId.equals(source.getControllerId())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// must be your card<NEW_LINE>Player player = game.getPlayer(cardToCheck.getOwnerId());<NEW_LINE>if (player == null || !player.getId().equals(affectedControllerId)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// must be from your library<NEW_LINE>Card topCard = player.getLibrary().getFromTop(game);<NEW_LINE>if (topCard == null || !topCard.getId().equals(cardToCheck.getMainCard().getId())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// allows to play/cast with alternative life cost<NEW_LINE>if (!cardToCheck.isLand(game)) {<NEW_LINE>PayLifeCost lifeCost = new PayLifeCost(cardToCheck.getSpellAbility().getManaCosts().manaValue());<NEW_LINE>Costs newCosts = new CostsImpl();<NEW_LINE>newCosts.add(lifeCost);<NEW_LINE>newCosts.addAll(cardToCheck.getSpellAbility().getCosts());<NEW_LINE>player.setCastSourceIdWithAlternateMana(cardToCheck.<MASK><NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getId(), null, newCosts);
68,714
private Position decodeObd(Position position, String sentence) {<NEW_LINE>Parser parser = new Parser(PATTERN_OBD, sentence);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>getLastLocation(position, null);<NEW_LINE>position.set(Position.KEY_BATTERY, parser.nextDouble());<NEW_LINE>position.set(Position.<MASK><NEW_LINE>position.set(Position.KEY_OBD_SPEED, parser.nextInt());<NEW_LINE>position.set(Position.KEY_THROTTLE, parser.nextDouble());<NEW_LINE>position.set(Position.KEY_ENGINE_LOAD, parser.nextDouble());<NEW_LINE>position.set(Position.KEY_COOLANT_TEMP, parser.nextInt());<NEW_LINE>position.set(Position.KEY_FUEL_CONSUMPTION, parser.nextDouble());<NEW_LINE>position.set("averageFuelConsumption", parser.nextDouble());<NEW_LINE>position.set("drivingRange", parser.nextDouble());<NEW_LINE>position.set(Position.KEY_ODOMETER, parser.nextDouble());<NEW_LINE>position.set("singleFuelConsumption", parser.nextDouble());<NEW_LINE>position.set(Position.KEY_FUEL_USED, parser.nextDouble());<NEW_LINE>position.set(Position.KEY_DTCS, parser.nextInt());<NEW_LINE>position.set("hardAccelerationCount", parser.nextInt());<NEW_LINE>position.set("hardBrakingCount", parser.nextInt());<NEW_LINE>return position;<NEW_LINE>}
KEY_RPM, parser.nextInt());
1,347,709
private static ReadResult<String> readString(@Nonnull ByteBuffer buffer, @Nonnull SeekableByteChannel channel) throws IOException {<NEW_LINE>boolean terminated = false;<NEW_LINE>boolean eof = false;<NEW_LINE>ReadResult<Byte> status = readByte(buffer, channel);<NEW_LINE>eof |= status.eof;<NEW_LINE>if (status.error != null || status.value == null) {<NEW_LINE>return new ReadResult<>(null, eof, NULL, false, "Couldn't read string: " + status.error);<NEW_LINE>}<NEW_LINE>if ((status.value.byteValue() & NULL) != 0) {<NEW_LINE>return new ReadResult<>(null, eof, status.value.byteValue(), false, null);<NEW_LINE>}<NEW_LINE>StringBuilder string = new StringBuilder();<NEW_LINE>while (!terminated && !eof) {<NEW_LINE>if (!buffer.hasRemaining()) {<NEW_LINE>buffer.clear();<NEW_LINE>eof = fillBuffer(buffer, <MASK><NEW_LINE>buffer.flip();<NEW_LINE>}<NEW_LINE>if (buffer.hasRemaining()) {<NEW_LINE>int terminator = -1;<NEW_LINE>for (int i = buffer.position(); i < buffer.limit(); i++) {<NEW_LINE>if (buffer.get(i) == (byte) 0) {<NEW_LINE>terminator = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>byte[] bytes;<NEW_LINE>if (terminator < 0) {<NEW_LINE>bytes = new byte[buffer.remaining()];<NEW_LINE>} else {<NEW_LINE>terminated = true;<NEW_LINE>bytes = new byte[terminator - buffer.position()];<NEW_LINE>}<NEW_LINE>if (bytes.length > 0) {<NEW_LINE>buffer.get(bytes);<NEW_LINE>string.append(new String(bytes, CHARSET));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (buffer.hasRemaining()) {<NEW_LINE>if (buffer.get() != (byte) 0) {<NEW_LINE>throw new AssertionError("Buffer has more data that doesn't start with the terminator");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!terminated) {<NEW_LINE>return new ReadResult<>(string.toString(), eof, status.value.byteValue(), true, "String is truncated");<NEW_LINE>}<NEW_LINE>return new ReadResult<>(string.toString(), eof, status.value.byteValue());<NEW_LINE>}
channel, buffer.capacity());
496,489
protected int runCmd() throws Exception {<NEW_LINE>SortedMap<String, List<Pair<LogSegmentMetadata, List<String>>>> corruptedCandidates = new TreeMap<String, List<Pair<LogSegmentMetadata, List<MASK><NEW_LINE>inspectStreams(corruptedCandidates);<NEW_LINE>System.out.println("Corrupted Candidates : ");<NEW_LINE>if (printStreamsOnly) {<NEW_LINE>System.out.println(corruptedCandidates.keySet());<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, List<Pair<LogSegmentMetadata, List<String>>>> entry : corruptedCandidates.entrySet()) {<NEW_LINE>System.out.println(entry.getKey() + " : \n");<NEW_LINE>for (Pair<LogSegmentMetadata, List<String>> pair : entry.getValue()) {<NEW_LINE>System.out.println("\t - " + pair.getLeft());<NEW_LINE>if (printInprogressOnly && dumpEntries) {<NEW_LINE>int i = 0;<NEW_LINE>for (String entryData : pair.getRight()) {<NEW_LINE>System.out.println("\t" + i + "\t: " + entryData);<NEW_LINE>++i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
<String>>>>();
1,402,606
private int vertexHitTest(float x, float y) {<NEW_LINE>Vector2 tmpVector = new Vector2(x, y);<NEW_LINE>int lineIndex = -1;<NEW_LINE>float circleSqr = ((float) CIRCLE_RADIUS / pixelsPerWU) * ((float) CIRCLE_RADIUS / pixelsPerWU);<NEW_LINE>for (int i = 1; i < drawPoints.length; i++) {<NEW_LINE>Vector2 pointOne = drawPoints[i - 1].cpy().scl(1f / runtimeCamera.zoom * transformComponent.scaleX, 1f / runtimeCamera.zoom * transformComponent.scaleY);<NEW_LINE>Vector2 pointTwo = drawPoints[i].cpy().scl(1f / runtimeCamera.zoom * transformComponent.scaleX, 1f / runtimeCamera.zoom * transformComponent.scaleY);<NEW_LINE>if (Intersector.intersectSegmentCircle(pointOne, pointTwo, tmpVector, circleSqr)) {<NEW_LINE>lineIndex = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Vector2 pointOne = drawPoints[drawPoints.length - 1].cpy().scl(1f / runtimeCamera.zoom * transformComponent.scaleX, 1f / <MASK><NEW_LINE>Vector2 pointTwo = drawPoints[0].cpy().scl(1f / runtimeCamera.zoom * transformComponent.scaleX, 1f / runtimeCamera.zoom * transformComponent.scaleY);<NEW_LINE>if (drawPoints.length > 0 && Intersector.intersectSegmentCircle(pointOne, pointTwo, tmpVector, circleSqr)) {<NEW_LINE>lineIndex = 0;<NEW_LINE>}<NEW_LINE>if (lineIndex > -1) {<NEW_LINE>return lineIndex;<NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>}
runtimeCamera.zoom * transformComponent.scaleY);
621,004
public int startServer() throws IllegalStateException {<NEW_LINE>if (server != null || serverThread != null) {<NEW_LINE>throw new IllegalStateException("Recorder already running");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>server = new ServerSocket(0, -1, InetAddress.getLoopbackAddress());<NEW_LINE>} catch (IOException e) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>serverThread = new Thread() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>while (!isInterrupted() && server != null && !server.isClosed()) {<NEW_LINE>try {<NEW_LINE>Socket socket = server.accept();<NEW_LINE>socket.setKeepAlive(true);<NEW_LINE>executor.submit(new KeepAliveTask(socket));<NEW_LINE>logger.info(<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>// fine, expected<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>serverThread.start();<NEW_LINE>int port = server.getLocalPort();<NEW_LINE>logger.info("Started spawn process manager on port {}", port);<NEW_LINE>return port;<NEW_LINE>}
"Registered remote process from " + socket.getRemoteSocketAddress());
712,036
public AccountTakeoverActionsType unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>AccountTakeoverActionsType accountTakeoverActionsType = new AccountTakeoverActionsType();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (name.equals("LowAction")) {<NEW_LINE>accountTakeoverActionsType.setLowAction(AccountTakeoverActionTypeJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("MediumAction")) {<NEW_LINE>accountTakeoverActionsType.setMediumAction(AccountTakeoverActionTypeJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("HighAction")) {<NEW_LINE>accountTakeoverActionsType.setHighAction(AccountTakeoverActionTypeJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return accountTakeoverActionsType;<NEW_LINE>}
String name = reader.nextName();
402,084
public static void main(String[] args) {<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>parseCommandLine(args);<NEW_LINE>// default location for output files is folder beside input files with the name of the input file<NEW_LINE>if (outputFiles.size() == 1) {<NEW_LINE>File outputFile = outputFiles.get(0);<NEW_LINE>if (!outputFile.exists()) {<NEW_LINE>File parentFile = outputFile.getAbsoluteFile().getParentFile();<NEW_LINE><MASK><NEW_LINE>outputFile = createDir(parentFile, fileName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (outputFiles.size() == 0) {<NEW_LINE>Iterator<File> itr = inputFiles.iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>File inputFile = itr.next();<NEW_LINE>File parentFile = inputFile.getAbsoluteFile().getParentFile();<NEW_LINE>String fileName = inputFile.getName();<NEW_LINE>String nameWithoutExtension = fileName.substring(0, fileName.lastIndexOf('.'));<NEW_LINE>File outputFile = createDir(parentFile, "cubic_" + nameWithoutExtension);<NEW_LINE>outputFiles.add(outputFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (debugMode) {<NEW_LINE>System.out.printf("overlap=%d ", overlap);<NEW_LINE>System.out.printf("interpolation=%s ", interpolation);<NEW_LINE>System.out.printf("quality=%d ", quality);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.out.println("Invalid command: " + e.getMessage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Equi2Rect.init();<NEW_LINE>// Iterator<File> itr = inputFiles.iterator();<NEW_LINE>// while (itr.hasNext())<NEW_LINE>// processImageFile(itr.next(), outputDir);<NEW_LINE>for (int i = 0; i < inputFiles.size(); i++) {<NEW_LINE>processImageFile(inputFiles.get(i), outputFiles.get(i));<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
String fileName = outputFile.getName();
1,081,023
private Group pickObject(String flag) throws Exception {<NEW_LINE>Group o = this.entityManagerContainer().flag(flag, Group.class);<NEW_LINE>if (o != null) {<NEW_LINE>this.entityManagerContainer().get(Group.class).detach(o);<NEW_LINE>} else {<NEW_LINE>String name = flag;<NEW_LINE>Matcher matcher = PersistenceProperties.Group.distinguishedName_pattern.matcher(flag);<NEW_LINE>if (matcher.find()) {<NEW_LINE>name = matcher.group(1);<NEW_LINE>String unique = matcher.group(2);<NEW_LINE>o = this.entityManagerContainer().flag(unique, Group.class);<NEW_LINE>if (null != o) {<NEW_LINE>this.entityManagerContainer().get(Group.class).detach(o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null == o) {<NEW_LINE>EntityManager em = this.entityManagerContainer(<MASK><NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Group> cq = cb.createQuery(Group.class);<NEW_LINE>Root<Group> root = cq.from(Group.class);<NEW_LINE>Predicate p = cb.equal(root.get(Group_.name), name);<NEW_LINE>List<Group> os = em.createQuery(cq.select(root).where(p)).getResultList();<NEW_LINE>if (os.size() == 1) {<NEW_LINE>o = os.get(0);<NEW_LINE>em.detach(o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return o;<NEW_LINE>}
).get(Group.class);
1,310,487
private void changeKeyAuthentication() {<NEW_LINE>boolean enabled = keyAuthButton.getSelection();<NEW_LINE>if (enabled) {<NEW_LINE>FileDialog dlg;<NEW_LINE><MASK><NEW_LINE>while (true) {<NEW_LINE>dlg = new FileDialog(getShell(), SWT.OPEN);<NEW_LINE>dlg.setText(Messages.CommonFTPConnectionPointPropertyDialog_SpecifyPrivateKey);<NEW_LINE>if (ssh_home != null && ssh_home.length() != 0) {<NEW_LINE>File dir = new File(ssh_home);<NEW_LINE>if (dir.exists() && dir.isDirectory()) {<NEW_LINE>dlg.setFilterPath(ssh_home);<NEW_LINE>for (String key : SecureUtils.getPrivateKeys()) {<NEW_LINE>if (new File(dir, key).exists()) {<NEW_LINE>dlg.setFileName(key);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String keyFilePath = dlg.open();<NEW_LINE>if (keyFilePath == null) {<NEW_LINE>keyAuthButton.setSelection(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>boolean passphraseProtected = SecureUtils.isKeyPassphraseProtected(new File(keyFilePath));<NEW_LINE>makeVisible(passwordLabel, passphraseProtected);<NEW_LINE>makeVisible(passwordText, passphraseProtected);<NEW_LINE>makeVisible(savePasswordButton, passphraseProtected);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>UIUtils.showErrorMessage(Messages.CommonFTPConnectionPointPropertyDialog_ERR_PrivateKey, e.getLocalizedMessage());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>keyPathLabel.setText(keyFilePath);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>passwordText.setText("");<NEW_LINE>} else {<NEW_LINE>keyPathLabel.setText(Messages.CommonFTPConnectionPointPropertyDialog_NoPrivateKeySelected);<NEW_LINE>makeVisible(passwordLabel, true);<NEW_LINE>makeVisible(passwordText, true);<NEW_LINE>makeVisible(savePasswordButton, true);<NEW_LINE>}<NEW_LINE>updateLayout();<NEW_LINE>passwordLabel.setText(StringUtil.makeFormLabel(enabled ? Messages.CommonFTPConnectionPointPropertyDialog_Passphrase : Messages.CommonFTPConnectionPointPropertyDialog_Password));<NEW_LINE>savePasswordButton.setSelection(false);<NEW_LINE>}
String ssh_home = SecureUtils.getSSH_HOME();
572,743
// You can mix/match most flags for the desired output format<NEW_LINE>private void sampleDateRange() {<NEW_LINE>List<String> text = new ArrayList<String>();<NEW_LINE>DateTime start = DateTime.now();<NEW_LINE>DateTime end = start.plusMinutes(30).plusHours(2).plusDays(56);<NEW_LINE>text.add("Range: " + DateUtils.formatDateRange(this, start, end, 0));<NEW_LINE>text.add("Range (with year): " + DateUtils.formatDateRange(this, start, end, DateUtils.FORMAT_SHOW_YEAR));<NEW_LINE>text.add("Range (abbreviated): " + DateUtils.formatDateRange(this, start, end, DateUtils.FORMAT_ABBREV_ALL));<NEW_LINE>text.add("Range (with time): " + DateUtils.formatDateRange(this, start<MASK><NEW_LINE>addSample("DateUtils.formatDateRange()", text);<NEW_LINE>}
, end, DateUtils.FORMAT_SHOW_TIME));
1,164,878
public Optional<StateHashReportResult> process(RiskEngine riskEngine) {<NEW_LINE>final SortedMap<StateHashReportResult.SubmoduleKey, Integer> hashCodes = new TreeMap<>();<NEW_LINE>final <MASK><NEW_LINE>hashCodes.put(StateHashReportResult.createKey(moduleId, StateHashReportResult.SubmoduleType.RISK_SYMBOL_SPEC_PROVIDER), riskEngine.getBinaryCommandsProcessor().stateHash());<NEW_LINE>hashCodes.put(StateHashReportResult.createKey(moduleId, StateHashReportResult.SubmoduleType.RISK_USER_PROFILE_SERVICE), riskEngine.getUserProfileService().stateHash());<NEW_LINE>hashCodes.put(StateHashReportResult.createKey(moduleId, StateHashReportResult.SubmoduleType.RISK_BINARY_CMD_PROCESSOR), riskEngine.getBinaryCommandsProcessor().stateHash());<NEW_LINE>hashCodes.put(StateHashReportResult.createKey(moduleId, StateHashReportResult.SubmoduleType.RISK_LAST_PRICE_CACHE), HashingUtils.stateHash(riskEngine.getLastPriceCache()));<NEW_LINE>hashCodes.put(StateHashReportResult.createKey(moduleId, StateHashReportResult.SubmoduleType.RISK_FEES), riskEngine.getFees().hashCode());<NEW_LINE>hashCodes.put(StateHashReportResult.createKey(moduleId, StateHashReportResult.SubmoduleType.RISK_ADJUSTMENTS), riskEngine.getAdjustments().hashCode());<NEW_LINE>hashCodes.put(StateHashReportResult.createKey(moduleId, StateHashReportResult.SubmoduleType.RISK_SUSPENDS), riskEngine.getSuspends().hashCode());<NEW_LINE>hashCodes.put(StateHashReportResult.createKey(moduleId, StateHashReportResult.SubmoduleType.RISK_SHARD_MASK), Long.hashCode(riskEngine.getShardMask()));<NEW_LINE>return Optional.of(new StateHashReportResult(hashCodes));<NEW_LINE>}
int moduleId = riskEngine.getShardId();
1,612,998
public void handle(MigratingInstanceParseContext parseContext, MigratingActivityInstance activityInstance, List<JobEntity> elements) {<NEW_LINE>Map<String, TimerDeclarationImpl> sourceTimerDeclarationsInEventScope = TimerDeclarationImpl.getDeclarationsForScope(activityInstance.getSourceScope());<NEW_LINE>Map<String, TimerDeclarationImpl> targetTimerDeclarationsInEventScope = new HashMap<>(TimerDeclarationImpl.getDeclarationsForScope(activityInstance.getTargetScope()));<NEW_LINE>Map<String, Map<String, TimerDeclarationImpl>> sourceTimeoutListenerDeclarationsInEventScope = TimerDeclarationImpl.<MASK><NEW_LINE>Map<String, Map<String, TimerDeclarationImpl>> targetTimeoutListenerDeclarationsInEventScope = new HashMap<>(TimerDeclarationImpl.getTimeoutListenerDeclarationsForScope(activityInstance.getTargetScope()));<NEW_LINE>for (JobEntity job : elements) {<NEW_LINE>if (!isTimerJob(job)) {<NEW_LINE>// skip non timer jobs<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>MigrationInstruction migrationInstruction = parseContext.findSingleMigrationInstruction(job.getActivityId());<NEW_LINE>ActivityImpl targetActivity = parseContext.getTargetActivity(migrationInstruction);<NEW_LINE>JobHandlerConfiguration jobHandlerConfiguration = job.getJobHandlerConfiguration();<NEW_LINE>if (targetActivity != null && activityInstance.migratesTo(targetActivity.getEventScope()) && isNoTimeoutListenerOrMigrates(job, jobHandlerConfiguration, targetActivity.getActivityId(), targetTimeoutListenerDeclarationsInEventScope)) {<NEW_LINE>// the timer job is migrated<NEW_LINE>JobDefinitionEntity targetJobDefinitionEntity = parseContext.getTargetJobDefinition(targetActivity.getActivityId(), job.getJobHandlerType());<NEW_LINE>TimerDeclarationImpl targetTimerDeclaration = getTargetTimerDeclaration(job, jobHandlerConfiguration, targetActivity.getActivityId(), targetTimeoutListenerDeclarationsInEventScope, targetTimerDeclarationsInEventScope);<NEW_LINE>MigratingJobInstance migratingTimerJobInstance = new MigratingTimerJobInstance(job, targetJobDefinitionEntity, targetActivity, migrationInstruction.isUpdateEventTrigger(), targetTimerDeclaration);<NEW_LINE>activityInstance.addMigratingDependentInstance(migratingTimerJobInstance);<NEW_LINE>parseContext.submit(migratingTimerJobInstance);<NEW_LINE>} else {<NEW_LINE>// the timer job is removed<NEW_LINE>MigratingJobInstance removingJobInstance = new MigratingTimerJobInstance(job);<NEW_LINE>activityInstance.addRemovingDependentInstance(removingJobInstance);<NEW_LINE>parseContext.submit(removingJobInstance);<NEW_LINE>}<NEW_LINE>parseContext.consume(job);<NEW_LINE>}<NEW_LINE>if (activityInstance.migrates()) {<NEW_LINE>addEmergingTimerJobs(parseContext, activityInstance, sourceTimerDeclarationsInEventScope, targetTimerDeclarationsInEventScope);<NEW_LINE>addEmergingTimeoutListenerJobs(parseContext, activityInstance, sourceTimeoutListenerDeclarationsInEventScope, targetTimeoutListenerDeclarationsInEventScope);<NEW_LINE>}<NEW_LINE>}
getTimeoutListenerDeclarationsForScope(activityInstance.getSourceScope());
1,001,175
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {<NEW_LINE>boolean applied = Boolean.TRUE.equals(game.getState().getValue(source.getSourceId() + "applied"));<NEW_LINE>if (!applied && layer == Layer.RulesEffects) {<NEW_LINE>if (!source.isControlledBy(game.getActivePlayerId()) && game.getStep() != null && game.getStep().getType() == PhaseStep.UNTAP) {<NEW_LINE>game.getState().setValue(source.getSourceId() + "applied", true);<NEW_LINE>Permanent permanent = game.getPermanent(source.getSourceId());<NEW_LINE>if (permanent != null) {<NEW_LINE>boolean untap = true;<NEW_LINE>for (RestrictionEffect effect : game.getContinuousEffects().getApplicableRestrictionEffects(permanent, game).keySet()) {<NEW_LINE>untap &= effect.canBeUntapped(<MASK><NEW_LINE>}<NEW_LINE>if (untap) {<NEW_LINE>permanent.untap(game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (applied && layer == Layer.RulesEffects) {<NEW_LINE>if (game.getStep() != null && game.getStep().getType() == PhaseStep.END_TURN) {<NEW_LINE>game.getState().setValue(source.getSourceId() + "applied", false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
permanent, source, game, true);
969,571
private void drawSelectedFilesSplits(Canvas canvas, RotatedTileBox tileBox, List<SelectedGpxFile> selectedGPXFiles, DrawSettings settings) {<NEW_LINE>if (tileBox.getZoom() >= START_ZOOM) {<NEW_LINE>// request to load<NEW_LINE>OsmandApplication app = view.getApplication();<NEW_LINE>for (SelectedGpxFile selectedGpxFile : selectedGPXFiles) {<NEW_LINE>List<GpxDisplayGroup> groups = selectedGpxFile.getDisplayGroups(app);<NEW_LINE>if (!Algorithms.isEmpty(groups)) {<NEW_LINE>int color = getTrackColor(selectedGpxFile.getGpxFile(), cachedColor);<NEW_LINE>paintInnerRect.setColor(color);<NEW_LINE>paintInnerRect.setAlpha(179);<NEW_LINE>int contrastColor = ColorUtilities.getContrastColor(app, color, false);<NEW_LINE>paintTextIcon.setColor(contrastColor);<NEW_LINE>paintOuterRect.setColor(contrastColor);<NEW_LINE>List<GpxDisplayItem> items = groups.get(0).getModifiableList();<NEW_LINE>drawSplitItems(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
canvas, tileBox, items, settings);
319,881
private static boolean equalNextTo(IncludeDesc iDesc1, IncludeDesc iDesc2, int alignment) {<NEW_LINE>if (iDesc1.parent.isSequential() && iDesc1.snappedNextTo != null) {<NEW_LINE>if (iDesc1.parent == iDesc2.parent && iDesc1.snappedNextTo == iDesc2.snappedNextTo) {<NEW_LINE>return iDesc1.paddingType == iDesc2.paddingType;<NEW_LINE>} else if (iDesc2.snappedParallel != null && (iDesc1.parent == iDesc2.parent || (iDesc1.parent.isParentOf(iDesc2.parent) && iDesc1.newSubGroup && (iDesc2.parent.isParallel() || iDesc2.newSubGroup)))) {<NEW_LINE>// snap next to is equal to align in parallel with something that is next to the same thing<NEW_LINE>LayoutInterval neighbor = LayoutInterval.getNeighbor(iDesc2.snappedParallel, alignment, false, true, true);<NEW_LINE>if (// && neighbor.getPaddingType() == iDesc1.paddingType<NEW_LINE>neighbor != null && neighbor.isEmptySpace() && neighbor.getPreferredSize() == NOT_EXPLICITLY_DEFINED) {<NEW_LINE>neighbor = LayoutInterval.getDirectNeighbor(neighbor, alignment, false);<NEW_LINE>if (neighbor == null) {<NEW_LINE>neighbor = <MASK><NEW_LINE>}<NEW_LINE>if (equalSnap(neighbor, iDesc1.snappedNextTo, alignment)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
LayoutInterval.getRoot(iDesc2.snappedParallel);
1,467,511
// -----------------------------------------------------<NEW_LINE>// Actually Crud<NEW_LINE>// -------------<NEW_LINE>@Execute<NEW_LINE>@Secured({ ROLE })<NEW_LINE>public HtmlResponse create(final CreateForm form) {<NEW_LINE>verifyCrudMode(form.crudMode, CrudMode.CREATE);<NEW_LINE>validate(form, messages -> {<NEW_LINE>}, this::asEditHtml);<NEW_LINE>validateAttributes(form.attributes, v -> throwValidationError(v, this::asEditHtml));<NEW_LINE>verifyToken(this::asEditHtml);<NEW_LINE>getGroup(form).ifPresent(entity -> {<NEW_LINE>try {<NEW_LINE>groupService.store(entity);<NEW_LINE>saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));<NEW_LINE>} catch (final Exception e) {<NEW_LINE>logger.<MASK><NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e)), this::asEditHtml);<NEW_LINE>}<NEW_LINE>}).orElse(() -> {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL), this::asEditHtml);<NEW_LINE>});<NEW_LINE>return redirect(getClass());<NEW_LINE>}
error("Failed to add {}", entity, e);
1,696,599
public void OpenShift_StubbedTests_usingSocialConfig_userNameMissingInTokenReviewResponse() throws Exception {<NEW_LINE>// Use a "captured" response from an OpenShift tokenReviews response<NEW_LINE>// remove the UserName<NEW_LINE>String access_token = "{\"kind\":\"TokenReview\",\"apiVersion\":\"authentication.k8s.io/v1\",\"metadata\":{\"creationTimestamp\":null},\"spec\":{\"token\":\"9Gsnl6CnQDrUlgdh1l4E-f5JJ1WC1tDOowbQLYBQ9Vs\"},\"status\":{\"authenticated\":true,\"user\":{\"uid\":\"52a9f1a4-e469-11e9-9be8-0016ac102aea\",\"groups\":[\"system:authenticated:oauth\",\"system:authenticated\"],\"extra\":{\"scopes.authorization.openshift.io\":[\"user:full\"]}}}}";<NEW_LINE>WebClient webClient = getAndSaveWebClient();<NEW_LINE><MASK><NEW_LINE>updatedSocialTestSettings.setProtectedResource(genericTestServer.getServerHttpsString() + "/helloworld/rest/helloworld_accessTokenRequiredTrue");<NEW_LINE>updatedSocialTestSettings.setHeaderName(SocialConstants.BEARER_HEADER);<NEW_LINE>updatedSocialTestSettings.setHeaderValue(cttools.buildBearerTokenCred(access_token));<NEW_LINE>List<validationData> expectations = setBadStubbedTestsExpectations(updatedSocialTestSettings, "username");<NEW_LINE>genericSocial(_testName, webClient, SocialConstants.INVOKE_SOCIAL_RESOURCE_ONLY, updatedSocialTestSettings, expectations);<NEW_LINE>}
SocialTestSettings updatedSocialTestSettings = socialSettings.copyTestSettings();
155,739
private void loadNode453() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Read_OutputArguments, new QualifiedName(0, "OutputArguments"), new LocalizedText("en", "OutputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Read_OutputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Read_OutputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Read_OutputArguments, Identifiers.HasProperty, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Read<MASK><NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>Data</Name><DataType><Identifier>i=15</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), false));
362,267
public void resolveFields(SearchContext searchContext, String indexMapping) throws DorisEsException {<NEW_LINE>JSONObject jsonObject = (JSONObject) JSONValue.parse(indexMapping);<NEW_LINE>// the indexName use alias takes the first mapping<NEW_LINE>Iterator<String> keys = jsonObject.keySet().iterator();<NEW_LINE>String docKey = keys.next();<NEW_LINE>JSONObject docData = (JSONObject) jsonObject.get(docKey);<NEW_LINE>JSONObject mappings = (JSONObject) docData.get("mappings");<NEW_LINE>JSONObject rootSchema = (JSONObject) mappings.get(searchContext.type());<NEW_LINE>JSONObject properties;<NEW_LINE>// After (include) 7.x, type was removed from ES mapping, default type is `_doc`<NEW_LINE>// https://www.elastic.co/guide/en/elasticsearch/reference/7.0/removal-of-types.html<NEW_LINE>if (rootSchema == null) {<NEW_LINE>if (searchContext.type().equals("_doc") == false) {<NEW_LINE>throw new DorisEsException("index[" + searchContext.sourceIndex() + "]'s type must be exists, " + " and after ES7.x type must be `_doc`, but found [" + searchContext.type() + "], for table [" + searchContext.esTable().getName() + "]");<NEW_LINE>}<NEW_LINE>properties = (<MASK><NEW_LINE>} else {<NEW_LINE>properties = (JSONObject) rootSchema.get("properties");<NEW_LINE>}<NEW_LINE>if (properties == null) {<NEW_LINE>throw new DorisEsException("index[" + searchContext.sourceIndex() + "] type[" + searchContext.type() + "] mapping not found for the ES Cluster");<NEW_LINE>}<NEW_LINE>for (Column col : searchContext.columns()) {<NEW_LINE>String colName = col.getName();<NEW_LINE>// if column exists in Doris Table but no found in ES's mapping, we choose to ignore this situation?<NEW_LINE>if (!properties.containsKey(colName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>JSONObject fieldObject = (JSONObject) properties.get(colName);<NEW_LINE>resolveKeywordFields(searchContext, fieldObject, colName);<NEW_LINE>resolveDocValuesFields(searchContext, fieldObject, colName);<NEW_LINE>}<NEW_LINE>}
JSONObject) mappings.get("properties");
320,888
public ResultSet execute() throws SqlExecutionException {<NEW_LINE>Environment env = context.getExecutionContext().getEnvironment();<NEW_LINE>TableEntry tableEntry = env.getTables().get(viewName);<NEW_LINE>if (!(tableEntry instanceof ViewEntry) && !ifExists) {<NEW_LINE>throw new SqlExecutionException("'" + viewName + "' does not exist in the current session.");<NEW_LINE>}<NEW_LINE>// Here we rebuild the ExecutionContext because we want to ensure that all the remaining<NEW_LINE>// views can work fine.<NEW_LINE>// Assume the case:<NEW_LINE>// view1=select 1;<NEW_LINE>// view2=select * from view1;<NEW_LINE>// If we delete view1 successfully, then query view2 will throw exception because view1 does<NEW_LINE>// not exist. we want<NEW_LINE>// all the remaining views are OK, so do the ExecutionContext rebuilding to avoid breaking<NEW_LINE>// the view dependency.<NEW_LINE>Environment newEnv = env.clone();<NEW_LINE>if (newEnv.getTables().remove(viewName) != null) {<NEW_LINE>ExecutionContext oldExecutionContext = context.getExecutionContext();<NEW_LINE>oldExecutionContext.wrapClassLoader(tableEnv -> tableEnv.dropTemporaryView(viewName));<NEW_LINE>// Renew the ExecutionContext.<NEW_LINE>ExecutionContext.Builder builder = context.newExecutionContextBuilder(context.getEnvironmentContext().getDefaultEnv()).env(newEnv).sessionState(context.getExecutionContext().getSessionState());<NEW_LINE>context.setExecutionContext(context.getExecutionContext<MASK><NEW_LINE>}<NEW_LINE>return OperationUtil.OK;<NEW_LINE>}
().cloneExecutionContext(builder));
739,549
public final MatchRecogPatternAtomContext matchRecogPatternAtom() throws RecognitionException {<NEW_LINE>MatchRecogPatternAtomContext _localctx = new MatchRecogPatternAtomContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 294, RULE_matchRecogPatternAtom);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(2029);<NEW_LINE>((MatchRecogPatternAtomContext) _localctx).i = match(IDENT);<NEW_LINE>setState(2038);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (((((_la - 144)) & ~0x3f) == 0 && ((1L << (_la - 144)) & ((1L << (QUESTION - 144)) | (1L << (PLUS - 144)) | (1L << (STAR - 144)))) != 0)) {<NEW_LINE>{<NEW_LINE>setState(2033);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case STAR:<NEW_LINE>{<NEW_LINE>setState(2030);<NEW_LINE>((MatchRecogPatternAtomContext) _localctx).s = match(STAR);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case PLUS:<NEW_LINE>{<NEW_LINE>setState(2031);<NEW_LINE>((MatchRecogPatternAtomContext) _localctx).s = match(PLUS);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case QUESTION:<NEW_LINE>{<NEW_LINE>setState(2032);<NEW_LINE>((MatchRecogPatternAtomContext) _localctx).s = match(QUESTION);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>setState(2036);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == QUESTION) {<NEW_LINE>{<NEW_LINE>setState(2035);<NEW_LINE>((MatchRecogPatternAtomContext) _localctx<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(2041);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == LCURLY) {<NEW_LINE>{<NEW_LINE>setState(2040);<NEW_LINE>matchRecogPatternRepeat();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
).reluctant = match(QUESTION);
831,597
protected QualifiedDeclaration<TypeDeclaration> lookupTypeDeclaration(String name) {<NEW_LINE>if (name == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// NOTE: it is possible to search using the context find methods... it<NEW_LINE>// would be nicer but it may be slower, so we do it this way... to be<NEW_LINE>// thought of<NEW_LINE>Set<String> possibleNames = new LinkedHashSet<String>();<NEW_LINE>String mainModuleName = "";<NEW_LINE>if (getRoot() instanceof CompilationUnit) {<NEW_LINE>mainModuleName = ((CompilationUnit) getRoot()).getMainModule().getName();<NEW_LINE>}<NEW_LINE>// lookup in current compilation unit<NEW_LINE>for (int i = 0; i < getStack().size(); i++) {<NEW_LINE>String containerName = getContainerNameAtIndex(i);<NEW_LINE>String declFullName = StringUtils.isBlank(containerName) ? name : containerName + "." + name;<NEW_LINE>if (declFullName.startsWith(mainModuleName)) {<NEW_LINE>possibleNames.add(declFullName.substring(mainModuleName.length() + 1));<NEW_LINE>}<NEW_LINE>TypeDeclaration match = context.getTypeDeclaration(declFullName);<NEW_LINE>if (match != null) {<NEW_LINE>return new QualifiedDeclaration<>(match, declFullName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// lookup in all compilation units<NEW_LINE>for (CompilationUnit compilUnit : context.compilationUnits) {<NEW_LINE>for (String rootRelativeName : possibleNames) {<NEW_LINE>TypeDeclaration match = context.getTypeDeclaration(compilUnit.getMainModule().<MASK><NEW_LINE>if (match != null) {<NEW_LINE>return new QualifiedDeclaration<>(match, compilUnit.getMainModule().getName() + "." + rootRelativeName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
getName() + "." + rootRelativeName);
853,080
protected void parseDefineButtonSound(InStream in) throws IOException {<NEW_LINE>int id = in.readUI16();<NEW_LINE>int rollOverSoundId = in.readUI16();<NEW_LINE>SoundInfo rollOverSoundInfo = (rollOverSoundId == 0) ? null : new SoundInfo(in);<NEW_LINE>int rollOutSoundId = in.readUI16();<NEW_LINE>SoundInfo rollOutSoundInfo = (rollOutSoundId == 0) ? null : new SoundInfo(in);<NEW_LINE>int pressSoundId = in.readUI16();<NEW_LINE>SoundInfo pressSoundInfo = (pressSoundId == 0) ? null : new SoundInfo(in);<NEW_LINE><MASK><NEW_LINE>SoundInfo releaseSoundInfo = (releaseSoundId == 0) ? null : new SoundInfo(in);<NEW_LINE>tagtypes.tagDefineButtonSound(id, rollOverSoundId, rollOverSoundInfo, rollOutSoundId, rollOutSoundInfo, pressSoundId, pressSoundInfo, releaseSoundId, releaseSoundInfo);<NEW_LINE>}
int releaseSoundId = in.readUI16();
747,915
void UIThreadInit(@NonNull final GLViewHolder viewHolder, @Nullable final HttpHandler handler) {<NEW_LINE>// Use the DefaultHttpHandler if none is provided<NEW_LINE>if (handler == null) {<NEW_LINE>httpHandler = new DefaultHttpHandler();<NEW_LINE>} else {<NEW_LINE>httpHandler = handler;<NEW_LINE>}<NEW_LINE>Context context = viewHolder.getView().getContext();<NEW_LINE>uiThreadHandler = new Handler(context.getMainLooper());<NEW_LINE>mapRenderer = new MapRenderer(this, uiThreadHandler);<NEW_LINE>// Set up MapView<NEW_LINE>this.viewHolder = viewHolder;<NEW_LINE>viewHolder.setRenderer(mapRenderer);<NEW_LINE>viewHolder.setRenderMode(GLViewHolder.RenderMode.RENDER_WHEN_DIRTY);<NEW_LINE>touchInput = new TouchInput(context);<NEW_LINE><MASK><NEW_LINE>touchInput.setScaleResponder(getScaleResponder());<NEW_LINE>touchInput.setRotateResponder(getRotateResponder());<NEW_LINE>touchInput.setShoveResponder(getShoveResponder());<NEW_LINE>touchInput.setSimultaneousDetectionDisabled(Gestures.SHOVE, Gestures.ROTATE);<NEW_LINE>touchInput.setSimultaneousDetectionDisabled(Gestures.ROTATE, Gestures.SHOVE);<NEW_LINE>touchInput.setSimultaneousDetectionDisabled(Gestures.SHOVE, Gestures.SCALE);<NEW_LINE>touchInput.setSimultaneousDetectionDisabled(Gestures.SHOVE, Gestures.PAN);<NEW_LINE>touchInput.setSimultaneousDetectionDisabled(Gestures.SCALE, Gestures.LONG_PRESS);<NEW_LINE>}
touchInput.setPanResponder(getPanResponder());
1,648,958
final DeleteConnectorResult executeDeleteConnector(DeleteConnectorRequest deleteConnectorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteConnectorRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteConnectorRequest> request = null;<NEW_LINE>Response<DeleteConnectorResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteConnectorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteConnectorRequest));<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, "KafkaConnect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteConnector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteConnectorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteConnectorResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
15,677
public Bgpv4Route build() {<NEW_LINE>checkArgument(_originatorIp != null, "Missing %s", PROP_ORIGINATOR_IP);<NEW_LINE>checkArgument(<MASK><NEW_LINE>checkArgument(_srcProtocol != null || (_originMechanism != NETWORK && _originMechanism != REDISTRIBUTE), "Local routes must have a source protocol");<NEW_LINE>checkArgument(_originType != null, "Missing %s", PROP_ORIGIN_TYPE);<NEW_LINE>checkArgument(_protocol != null, "Missing %s", PROP_PROTOCOL);<NEW_LINE>checkArgument(_nextHop != null, "Missing next hop");<NEW_LINE>return new Bgpv4Route(BgpRouteAttributes.create(_asPath, _clusterList, _communities, _localPreference, getMetric(), _originatorIp, _originMechanism, _originType, _protocol, _receivedFromRouteReflectorClient, _srcProtocol, _weight), _receivedFromIp, getNetwork(), _nextHop, getAdmin(), getTag(), getNonForwarding(), getNonRouting());<NEW_LINE>}
_originMechanism != null, "Missing %s", PROP_ORIGIN_MECHANISM);
1,594,299
public void updateUI() {<NEW_LINE><MASK><NEW_LINE>String id = lf.getID();<NEW_LINE>boolean useClean = tableUI && (// NOI18N<NEW_LINE>lf instanceof MetalLookAndFeel || // NOI18N<NEW_LINE>"GTK".equals(id) || // NOI18N<NEW_LINE>"Nimbus".equals(id) || // #217957<NEW_LINE>("Aqua".equals(id) && checkMacSystemVersion()) || // NOI18N<NEW_LINE>PropUtils.isWindowsVistaLaF() || "Kunststoff".equals(id));<NEW_LINE>if (useClean) {<NEW_LINE>super.setUI(PropUtils.createComboUI(this, tableUI));<NEW_LINE>} else {<NEW_LINE>super.updateUI();<NEW_LINE>}<NEW_LINE>if (tableUI & getEditor().getEditorComponent() instanceof JComponent) {<NEW_LINE>((JComponent) getEditor().getEditorComponent()).setBorder(null);<NEW_LINE>}<NEW_LINE>}
LookAndFeel lf = UIManager.getLookAndFeel();
394,079
private static BigInteger valueOfBigInt(final TruffleString string) {<NEW_LINE>TruffleString valueString = removeUnderscores(string);<NEW_LINE>if (ParserStrings.length(valueString) > 2 && ParserStrings.charAt(valueString, 0) == '0') {<NEW_LINE>switch(ParserStrings.charAt(valueString, 1)) {<NEW_LINE>case 'x':<NEW_LINE>case 'X':<NEW_LINE>return new BigInteger(ParserStrings.lazySubstring(valueString, 2).toJavaStringUncached(), 16);<NEW_LINE>case 'o':<NEW_LINE>case 'O':<NEW_LINE>return new BigInteger(ParserStrings.lazySubstring(valueString, 2<MASK><NEW_LINE>case 'b':<NEW_LINE>case 'B':<NEW_LINE>return new BigInteger(ParserStrings.lazySubstring(valueString, 2).toJavaStringUncached(), 2);<NEW_LINE>default:<NEW_LINE>return new BigInteger(valueString.toJavaStringUncached(), 10);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return new BigInteger(valueString.toJavaStringUncached(), 10);<NEW_LINE>}<NEW_LINE>}
).toJavaStringUncached(), 8);
1,168,019
final DescribeReservedInstanceOfferingsResult executeDescribeReservedInstanceOfferings(DescribeReservedInstanceOfferingsRequest describeReservedInstanceOfferingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeReservedInstanceOfferingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeReservedInstanceOfferingsRequest> request = null;<NEW_LINE>Response<DescribeReservedInstanceOfferingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeReservedInstanceOfferingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeReservedInstanceOfferingsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeReservedInstanceOfferings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeReservedInstanceOfferingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeReservedInstanceOfferingsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "OpenSearch");
495,761
private Interface initRoutingInterface(Interface_idContext id) {<NEW_LINE>Map<String, Interface> interfaces;<NEW_LINE>InterfaceId interfaceId = new InterfaceId(id);<NEW_LINE>if (interfaceId.getNode() != null) {<NEW_LINE>String nodeDeviceName = interfaceId.getNode();<NEW_LINE>NodeDevice nodeDevice = _configuration.getNodeDevices().computeIfAbsent(nodeDeviceName, n -> new NodeDevice());<NEW_LINE>interfaces = nodeDevice.getInterfaces();<NEW_LINE>} else {<NEW_LINE>interfaces = _currentLogicalSystem.getInterfaces();<NEW_LINE>}<NEW_LINE>String name = getParentInterfaceName(id);<NEW_LINE>Interface iface = interfaces.get(name);<NEW_LINE>if (iface == null) {<NEW_LINE>// TODO: this is not ideal, interface should not be created here as we are not sure if the<NEW_LINE>// interface was defined<NEW_LINE>iface = new Interface(name);<NEW_LINE>iface.<MASK><NEW_LINE>interfaces.put(name, iface);<NEW_LINE>}<NEW_LINE>String unit = firstNonNull(interfaceId.getUnit(), "0");<NEW_LINE>String unitFullName = name + "." + unit;<NEW_LINE>Map<String, Interface> units = iface.getUnits();<NEW_LINE>Interface unitIface = units.get(unitFullName);<NEW_LINE>if (unitIface == null) {<NEW_LINE>// TODO: this is not ideal, interface should not be created here as we are not sure if the<NEW_LINE>// interface was defined<NEW_LINE>unitIface = new Interface(unitFullName);<NEW_LINE>unitIface.setRoutingInstance(_currentLogicalSystem.getDefaultRoutingInstance());<NEW_LINE>units.put(unitFullName, unitIface);<NEW_LINE>unitIface.setParent(iface);<NEW_LINE>}<NEW_LINE>return unitIface;<NEW_LINE>}
setRoutingInstance(_currentLogicalSystem.getDefaultRoutingInstance());
1,743,483
private void createMissingValues() {<NEW_LINE>String sql = // Not in Registration<NEW_LINE>"SELECT ra.A_RegistrationAttribute_ID " + "FROM A_RegistrationAttribute ra" + " LEFT OUTER JOIN A_RegistrationProduct rp ON (rp.A_RegistrationAttribute_ID=ra.A_RegistrationAttribute_ID)" <MASK><NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, get_TrxName());<NEW_LINE>pstmt.setInt(1, getA_Registration_ID());<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>MRegistrationValue v = new MRegistrationValue(this, rs.getInt(1), "?");<NEW_LINE>v.saveEx();<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>pstmt = null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, null, e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (pstmt != null)<NEW_LINE>pstmt.close();<NEW_LINE>pstmt = null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>}
+ " LEFT OUTER JOIN A_Registration r ON (r.M_Product_ID=rp.M_Product_ID) " + "WHERE r.A_Registration_ID=?" + " AND NOT EXISTS (SELECT A_RegistrationAttribute_ID FROM A_RegistrationValue v " + "WHERE ra.A_RegistrationAttribute_ID=v.A_RegistrationAttribute_ID AND r.A_Registration_ID=v.A_Registration_ID)";
1,210,129
private void sendFileRegion(RandomAccessFile file, long offset, long length, ChannelPromise writeFuture) {<NEW_LINE>if (length < MAX_REGION_SIZE) {<NEW_LINE>writeToChannel(new DefaultFileRegion(file.getChannel(), offset, length), writeFuture);<NEW_LINE>} else {<NEW_LINE>ChannelPromise promise = chctx.newPromise();<NEW_LINE>FileRegion region = new DefaultFileRegion(file.getChannel(), offset, MAX_REGION_SIZE);<NEW_LINE>// Retain explicitly this file region so the underlying channel is not closed by the NIO channel when it<NEW_LINE>// as been sent as we need it again<NEW_LINE>region.retain();<NEW_LINE>writeToChannel(region, promise);<NEW_LINE>promise.addListener(future -> {<NEW_LINE>if (future.isSuccess()) {<NEW_LINE>sendFileRegion(file, offset + MAX_REGION_SIZE, length - MAX_REGION_SIZE, writeFuture);<NEW_LINE>} else {<NEW_LINE>log.error(future.cause().getMessage(), future.cause());<NEW_LINE>writeFuture.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
setFailure(future.cause());
783,322
public static NavTreeSettings readFromRequest(final PwmRequest pwmRequest) throws PwmUnrecoverableException, IOException {<NEW_LINE>final Map<String, Object> inputParameters = pwmRequest.readBodyAsJsonMap(PwmHttpRequestWrapper.Flag.BypassValidation);<NEW_LINE>final boolean modifiedSettingsOnly = (boolean) inputParameters.get("modifiedSettingsOnly");<NEW_LINE>final int level = (int) ((double) inputParameters.get("level"));<NEW_LINE>final String filterText = (String) inputParameters.get("text");<NEW_LINE>final DomainStateReader <MASK><NEW_LINE>final boolean manageHttps = pwmRequest.getPwmApplication().getPwmEnvironment().getFlags().contains(PwmEnvironment.ApplicationFlag.ManageHttps);<NEW_LINE>return NavTreeSettings.builder().modifiedSettingsOnly(modifiedSettingsOnly).domainManageMode(domainStateReader.getMode()).mangeHttps(manageHttps).level(level).filterText(filterText).locale(pwmRequest.getLocale()).build();<NEW_LINE>}
domainStateReader = DomainStateReader.forRequest(pwmRequest);
679,006
public void iteratorwhileSnippet() throws MalformedURLException {<NEW_LINE>HttpHeaders httpHeaders = new HttpHeaders().set("header1", "value1").set("header2", "value2");<NEW_LINE>HttpRequest httpRequest = new HttpRequest(HttpMethod.GET, new URL("http://localhost"));<NEW_LINE>String deserializedHeaders = "header1,value1,header2,value2";<NEW_LINE>IterableStream<PagedResponseBase<String, Integer>> myIterableStream = new IterableStream<>(Flux.just(createPagedResponse(httpRequest, httpHeaders, <MASK><NEW_LINE>// BEGIN: com.azure.core.util.iterableStream.iterator.while<NEW_LINE>// Iterate over iterator<NEW_LINE>for (PagedResponseBase<String, Integer> resp : myIterableStream) {<NEW_LINE>if (resp.getStatusCode() == HttpURLConnection.HTTP_OK) {<NEW_LINE>System.out.printf("Response headers are %s. Url %s%n", resp.getDeserializedHeaders(), resp.getRequest().getUrl());<NEW_LINE>resp.getElements().forEach(value -> System.out.printf("Response value is %d%n", value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// END: com.azure.core.util.iterableStream.iterator.while<NEW_LINE>}
deserializedHeaders, 1, 3)));
1,508,464
public int read(byte[] dest, int bytesToBeRead, int timeoutMillis) throws IOException {<NEW_LINE>int numBytesRead = 0;<NEW_LINE>// synchronized (mReadBufferLock) {<NEW_LINE>int readNow;<NEW_LINE>Log.v(TAG, "TO read : " + bytesToBeRead);<NEW_LINE>int bytesToBeReadTemp = bytesToBeRead;<NEW_LINE>while (numBytesRead < bytesToBeRead) {<NEW_LINE>readNow = mConnection.bulkTransfer(mReadEndpoint, mReadBuffer, bytesToBeReadTemp, timeoutMillis);<NEW_LINE>if (readNow < 0) {<NEW_LINE>Log.<MASK><NEW_LINE>return numBytesRead;<NEW_LINE>} else {<NEW_LINE>// Log.v(TAG, "Read something" + mReadBuffer);<NEW_LINE>System.arraycopy(mReadBuffer, 0, dest, numBytesRead, readNow);<NEW_LINE>numBytesRead += readNow;<NEW_LINE>bytesToBeReadTemp -= readNow;<NEW_LINE>// Log.v(TAG, "READ : " + numBytesRead);<NEW_LINE>// Log.v(TAG, "REMAINING: " + bytesToBeRead);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// }<NEW_LINE>Log.v("Bytes Read", "" + numBytesRead);<NEW_LINE>return numBytesRead;<NEW_LINE>}
e(TAG, "Read Error: " + bytesToBeReadTemp);
1,233,285
public GetPortfolioPreferencesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetPortfolioPreferencesResult getPortfolioPreferencesResult = new GetPortfolioPreferencesResult();<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 getPortfolioPreferencesResult;<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("applicationPreferences", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getPortfolioPreferencesResult.setApplicationPreferences(ApplicationPreferencesJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("databasePreferences", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getPortfolioPreferencesResult.setDatabasePreferences(DatabasePreferencesJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("prioritizeBusinessGoals", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getPortfolioPreferencesResult.setPrioritizeBusinessGoals(PrioritizeBusinessGoalsJsonUnmarshaller.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 getPortfolioPreferencesResult;<NEW_LINE>}
().unmarshall(context));
1,593,772
private void internalInitializeLiveRoom() {<NEW_LINE>LoginInfo loginInfo = new LoginInfo();<NEW_LINE>loginInfo.sdkAppID = GenerateTestUserSig.SDKAPPID;<NEW_LINE>loginInfo.userID = ProfileManager.getInstance().getUserModel().userId;<NEW_LINE>loginInfo.userSig = ProfileManager.getInstance().getUserModel().userSig;<NEW_LINE>loginInfo.userName = mUserName;<NEW_LINE>loginInfo.userAvatar = mUserAvatar;<NEW_LINE>LiveRoomActivity.this.mUserId = ProfileManager.getInstance<MASK><NEW_LINE>mMLVBLiveRoom.login(loginInfo, new IMLVBLiveRoomListener.LoginCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(int errCode, String errInfo) {<NEW_LINE>setTitle(errInfo);<NEW_LINE>printGlobalLog(getString(R.string.mlvb_live_room_init_fail, errInfo));<NEW_LINE>mRetryInitRoomRunnable = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Toast.makeText(LiveRoomActivity.this, getString(R.string.mlvb_retry), Toast.LENGTH_SHORT).show();<NEW_LINE>initializeLiveRoom();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess() {<NEW_LINE>setTitle(getString(R.string.mlvb_phone_live));<NEW_LINE>printGlobalLog(getString(R.string.mlvb_live_room_init_success), mUserId);<NEW_LINE>Fragment fragment = getFragmentManager().findFragmentById(R.id.mlvb_rtmproom_fragment_container);<NEW_LINE>if (!(fragment instanceof LiveRoomChatFragment)) {<NEW_LINE>FragmentTransaction ft = getFragmentManager().beginTransaction();<NEW_LINE>fragment = LiveRoomListFragment.newInstance(mUserId);<NEW_LINE>ft.replace(R.id.mlvb_rtmproom_fragment_container, fragment);<NEW_LINE>ft.commit();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
().getUserModel().userId;
278,146
private Writer createWriter(TypeDefinition type, DecompilerSettings settings, String outputDirectory) throws IOException {<NEW_LINE>if (StringUtilities.isNullOrWhitespace(outputDirectory)) {<NEW_LINE>return new OutputStreamWriter(System.out, settings.isUnicodeOutputEnabled() ? Charset.forName("UTF-8") : Charset.defaultCharset());<NEW_LINE>}<NEW_LINE>String outputPath;<NEW_LINE>String fileName = type.getName() + settings.getLanguage().getFileExtension();<NEW_LINE>String packageName = type.getPackageName();<NEW_LINE>if (StringUtilities.isNullOrWhitespace(packageName)) {<NEW_LINE>outputPath = PathHelper.combine(outputDirectory, fileName);<NEW_LINE>} else {<NEW_LINE>outputPath = PathHelper.combine(outputDirectory, packageName.replace('.'<MASK><NEW_LINE>}<NEW_LINE>File outputFile = new File(outputPath);<NEW_LINE>File parentFile = outputFile.getParentFile();<NEW_LINE>if (parentFile != null && !parentFile.exists() && !parentFile.mkdirs()) {<NEW_LINE>throw new IllegalStateException(String.format("Could not create output directory for file \"%s\".", outputPath));<NEW_LINE>}<NEW_LINE>if (!outputFile.exists() && !outputFile.createNewFile()) {<NEW_LINE>throw new IllegalStateException(String.format("Could not create output file \"%s\".", outputPath));<NEW_LINE>}<NEW_LINE>return new FileOutputWriter(outputFile, settings);<NEW_LINE>}
, PathHelper.DirectorySeparator), fileName);
448,961
final PurgeQueueResult executePurgeQueue(PurgeQueueRequest purgeQueueRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(purgeQueueRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PurgeQueueRequest> request = null;<NEW_LINE>Response<PurgeQueueResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PurgeQueueRequestMarshaller().marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SQS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PurgeQueue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<PurgeQueueResult> responseHandler = new StaxResponseHandler<PurgeQueueResult>(new PurgeQueueResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(purgeQueueRequest));
1,020,877
public MethodInsnAST visit(int lineNo, String line) throws ASTParseException {<NEW_LINE>try {<NEW_LINE>String[] trim = line.<MASK><NEW_LINE>if (trim.length < 2)<NEW_LINE>throw new ASTParseException(lineNo, "Not enough paramters");<NEW_LINE>int start = line.indexOf(trim[0]);<NEW_LINE>// op<NEW_LINE>OpcodeParser opParser = new OpcodeParser();<NEW_LINE>opParser.setOffset(line.indexOf(trim[0]));<NEW_LINE>OpcodeAST op = opParser.visit(lineNo, trim[0]);<NEW_LINE>// owner & name & desc<NEW_LINE>String data = trim[1];<NEW_LINE>int dot = data.indexOf('.');<NEW_LINE>if (dot == -1)<NEW_LINE>throw new ASTParseException(lineNo, "Format error: expecting '<Owner>.<Name><Desc>'" + " - missing '.'");<NEW_LINE>int parenthesis = data.indexOf('(');<NEW_LINE>if (parenthesis < dot)<NEW_LINE>throw new ASTParseException(lineNo, "Format error: Missing valid method descriptor");<NEW_LINE>String typeS = data.substring(0, dot);<NEW_LINE>String nameS = data.substring(dot + 1, parenthesis);<NEW_LINE>String descS = data.substring(parenthesis);<NEW_LINE>// owner<NEW_LINE>TypeParser typeParser = new TypeParser();<NEW_LINE>typeParser.setOffset(line.indexOf(data));<NEW_LINE>TypeAST owner = typeParser.visit(lineNo, typeS);<NEW_LINE>// name<NEW_LINE>NameParser nameParser = new NameParser(this);<NEW_LINE>nameParser.setOffset(line.indexOf('.'));<NEW_LINE>NameAST name = nameParser.visit(lineNo, nameS);<NEW_LINE>// desc<NEW_LINE>DescParser descParser = new DescParser();<NEW_LINE>descParser.setOffset(line.indexOf('('));<NEW_LINE>DescAST desc = descParser.visit(lineNo, descS);<NEW_LINE>return new MethodInsnAST(lineNo, start, op, owner, name, desc);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new ASTParseException(ex, lineNo, "Bad format for method instruction");<NEW_LINE>}<NEW_LINE>}
trim().split("\\s+");
1,530,890
public <T extends Record> void notify(final String key, final DataOperation action, final T value) {<NEW_LINE>if (listenerMap.containsKey(KeyBuilder.SERVICE_META_KEY_PREFIX)) {<NEW_LINE>if (KeyBuilder.matchServiceMetaKey(key) && !KeyBuilder.matchSwitchKey(key)) {<NEW_LINE>for (RecordListener listener : listenerMap.get(KeyBuilder.SERVICE_META_KEY_PREFIX)) {<NEW_LINE>try {<NEW_LINE>if (action == DataOperation.CHANGE) {<NEW_LINE>listener.onChange(key, value);<NEW_LINE>}<NEW_LINE>if (action == DataOperation.DELETE) {<NEW_LINE>listener.onDelete(key);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Loggers.RAFT.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!listenerMap.containsKey(key)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (RecordListener listener : listenerMap.get(key)) {<NEW_LINE>try {<NEW_LINE>if (action == DataOperation.CHANGE) {<NEW_LINE>listener.onChange(key, value);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (action == DataOperation.DELETE) {<NEW_LINE>listener.onDelete(key);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Loggers.RAFT.error("[NACOS-RAFT] error while notifying listener of key: {}", key, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
error("[NACOS-RAFT] error while notifying listener of key: {}", key, e);
33,042
protected StringBuilder renderCommands(StringBuilder sb, Collection<CLI> commands) {<NEW_LINE>final String lpad = createPadding(leftPad);<NEW_LINE>final String dpad = createPadding(descPad);<NEW_LINE>// We need a double loop to compute the longest command name<NEW_LINE>int max = 0;<NEW_LINE>List<StringBuilder> prefixList = new ArrayList<>();<NEW_LINE>for (CLI command : commands) {<NEW_LINE>if (!command.isHidden()) {<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>buf.append(lpad).append(" ").append(command.getName());<NEW_LINE>prefixList.add(buf);<NEW_LINE>max = Math.max(buf.length(), max);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int x = 0;<NEW_LINE>// Use an iterator to detect the last item.<NEW_LINE>for (Iterator<CLI> it = commands.iterator(); it.hasNext(); ) {<NEW_LINE>CLI command = it.next();<NEW_LINE>if (command.isHidden()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>StringBuilder buf = new StringBuilder(prefixList.get(x++).toString());<NEW_LINE>if (buf.length() < max) {<NEW_LINE>buf.append(createPadding(max - buf.length()));<NEW_LINE>}<NEW_LINE>buf.append(dpad);<NEW_LINE>int nextLineTabStop = max + descPad;<NEW_LINE>buf.append(command.getSummary());<NEW_LINE>renderWrappedText(sb, width, <MASK><NEW_LINE>if (it.hasNext()) {<NEW_LINE>sb.append(getNewLine());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb;<NEW_LINE>}
nextLineTabStop, buf.toString());
601,971
public static Drawable createSimpleSelectorDrawable(Context context, int resource, int defaultColor, int pressedColor) {<NEW_LINE>Resources resources = context.getResources();<NEW_LINE>Drawable defaultDrawable = resources.getDrawable(resource).mutate();<NEW_LINE>if (defaultColor != 0) {<NEW_LINE>defaultDrawable.setColorFilter(new PorterDuffColorFilter(defaultColor, PorterDuff.Mode.SRC_IN));<NEW_LINE>}<NEW_LINE>Drawable pressedDrawable = resources.getDrawable(resource).mutate();<NEW_LINE>if (pressedColor != 0) {<NEW_LINE>pressedDrawable.setColorFilter(new PorterDuffColorFilter(pressedColor, PorterDuff.Mode.SRC_IN));<NEW_LINE>}<NEW_LINE>StateListDrawable stateListDrawable = new StateListDrawable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean selectDrawable(int index) {<NEW_LINE>if (Build.VERSION.SDK_INT < 21) {<NEW_LINE>Drawable drawable = Theme.getStateDrawable(this, index);<NEW_LINE>ColorFilter colorFilter = null;<NEW_LINE>if (drawable instanceof BitmapDrawable) {<NEW_LINE>colorFilter = ((BitmapDrawable) drawable).getPaint().getColorFilter();<NEW_LINE>} else if (drawable instanceof NinePatchDrawable) {<NEW_LINE>colorFilter = ((NinePatchDrawable) drawable)<MASK><NEW_LINE>}<NEW_LINE>boolean result = super.selectDrawable(index);<NEW_LINE>if (colorFilter != null) {<NEW_LINE>drawable.setColorFilter(colorFilter);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return super.selectDrawable(index);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>stateListDrawable.addState(new int[] { android.R.attr.state_pressed }, pressedDrawable);<NEW_LINE>stateListDrawable.addState(new int[] { android.R.attr.state_selected }, pressedDrawable);<NEW_LINE>stateListDrawable.addState(StateSet.WILD_CARD, defaultDrawable);<NEW_LINE>return stateListDrawable;<NEW_LINE>}
.getPaint().getColorFilter();
617,535
public OResultSet executeDDL(OCommandContext ctx) {<NEW_LINE>ODatabase db = ctx.getDatabase();<NEW_LINE>int existingId = db.getClusterIdByName(name.getStringValue());<NEW_LINE>if (existingId >= 0) {<NEW_LINE>if (ifNotExists) {<NEW_LINE>return new OInternalResultSet();<NEW_LINE>} else {<NEW_LINE>throw new OCommandExecutionException("Cluster " + name.getStringValue() + " already exists");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (id != null) {<NEW_LINE>String existingName = db.getClusterNameById(id.getValue().intValue());<NEW_LINE>if (existingName != null) {<NEW_LINE>if (ifNotExists) {<NEW_LINE>return new OInternalResultSet();<NEW_LINE>} else {<NEW_LINE>throw new OCommandExecutionException("Cluster " + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OResultInternal result = new OResultInternal();<NEW_LINE>result.setProperty("operation", "create cluster");<NEW_LINE>result.setProperty("clusterName", name.getStringValue());<NEW_LINE>int requestedId = id == null ? -1 : id.getValue().intValue();<NEW_LINE>int finalId = -1;<NEW_LINE>if (blob) {<NEW_LINE>if (requestedId == -1) {<NEW_LINE>finalId = db.addBlobCluster(name.getStringValue());<NEW_LINE>result.setProperty("finalId", finalId);<NEW_LINE>} else {<NEW_LINE>throw new OCommandExecutionException("Request id not supported by blob cluster creation.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (requestedId == -1) {<NEW_LINE>finalId = db.addCluster(name.getStringValue());<NEW_LINE>} else {<NEW_LINE>result.setProperty("requestedId", requestedId);<NEW_LINE>finalId = db.addCluster(name.getStringValue(), requestedId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.setProperty("finalId", finalId);<NEW_LINE>OInternalResultSet rs = new OInternalResultSet();<NEW_LINE>rs.add(result);<NEW_LINE>return rs;<NEW_LINE>}
id.getValue() + " already exists");
96,207
public void updatePmiInRequest(String method, TransactionUserWrapper tuWrapper, SipServletDesc sipDesc) {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>Object[] params = { tuWrapper.getAppName(), tuWrapper.getId(), method };<NEW_LINE>c_logger.traceEntry(tuWrapper.getTuImpl(), "updatePmiInRequest", params);<NEW_LINE>}<NEW_LINE>SipAppDesc appDesc;<NEW_LINE>if (sipDesc != null) {<NEW_LINE>appDesc = sipDesc.getSipApp();<NEW_LINE>} else {<NEW_LINE>appDesc = tuWrapper.getSipServletDesc().getSipApp();<NEW_LINE>}<NEW_LINE>if (null != appDesc) {<NEW_LINE>inRequest(appDesc.getApplicationName(), appDesc.getAppIndexForPmi(), method);<NEW_LINE>} else {<NEW_LINE>// Will happen for application sessions created through the<NEW_LINE>// factory.<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(tuWrapper.getTuImpl(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), "updatePmiInRequest", "Unable to update PerfManager " + "SIP app descriptor not available");
481,288
public void showStatus(String title, String status, String hideLabel, final IMethodResult result) {<NEW_LINE>Map<String, Object> propertyMap = new HashMap<String, Object>();<NEW_LINE>if (title != null) {<NEW_LINE>propertyMap.put(HK_TITLE, title);<NEW_LINE>}<NEW_LINE>if (status != null) {<NEW_LINE>propertyMap.put(HK_MESSAGE, status);<NEW_LINE>}<NEW_LINE>if (hideLabel != null) {<NEW_LINE>List<String> buttons = new ArrayList<String>();<NEW_LINE>buttons.add(hideLabel);<NEW_LINE>propertyMap.put(HK_BUTTONS, buttons);<NEW_LINE>}<NEW_LINE>ArrayList<String> types <MASK><NEW_LINE>types.add(TYPE_DIALOG);<NEW_LINE>types.add(TYPE_TOAST);<NEW_LINE>propertyMap.put(HK_TYPES, types);<NEW_LINE>showPopup(propertyMap, result);<NEW_LINE>}
= new ArrayList<String>();
1,300,548
protected ProductsProposalRowsLoader createRowsLoaderFromRecord(TableRecordReference recordRef) {<NEW_LINE>final IBPartnerDAO bpartnersRepo = Services.get(IBPartnerDAO.class);<NEW_LINE>final IPriceListDAO priceListsRepo = Services.get(IPriceListDAO.class);<NEW_LINE>recordRef.assertTableName(I_C_BPartner.Table_Name);<NEW_LINE>final BPartnerId bpartnerId = BPartnerId.ofRepoId(recordRef.getRecord_ID());<NEW_LINE>final Set<CountryId> countryIds = bpartnersRepo.retrieveBPartnerLocationCountryIds(bpartnerId);<NEW_LINE>if (countryIds.isEmpty()) {<NEW_LINE>throw new AdempiereException("@NotFound@ @C_BPartner_Location_ID@");<NEW_LINE>}<NEW_LINE>final I_C_BPartner bpartnerRecord = bpartnersRepo.getById(bpartnerId);<NEW_LINE>PricingSystemId pricingSystemId = null;<NEW_LINE>SOTrx soTrx = null;<NEW_LINE>if (bpartnerRecord.isCustomer()) {<NEW_LINE>pricingSystemId = PricingSystemId.ofRepoIdOrNull(bpartnerRecord.getM_PricingSystem_ID());<NEW_LINE>soTrx = SOTrx.SALES;<NEW_LINE>}<NEW_LINE>if (pricingSystemId == null && bpartnerRecord.isVendor()) {<NEW_LINE>pricingSystemId = PricingSystemId.ofRepoIdOrNull(bpartnerRecord.getPO_PricingSystem_ID());<NEW_LINE>soTrx = SOTrx.PURCHASE;<NEW_LINE>}<NEW_LINE>if (pricingSystemId == null) {<NEW_LINE>throw new AdempiereException("@NotFound@ @M_PricingSystem_ID@");<NEW_LINE>}<NEW_LINE>final ZonedDateTime today = SystemTime.asZonedDateTime();<NEW_LINE>final Set<PriceListVersionId> priceListVersionIds = priceListsRepo.retrievePriceListsCollectionByPricingSystemId(pricingSystemId).filterAndStreamIds(countryIds).map(priceListId -> priceListsRepo.retrievePriceListVersionId(priceListId, today)).<MASK><NEW_LINE>return ProductsProposalRowsLoader.builder().bpartnerProductStatsService(bpartnerProductStatsService).priceListVersionIds(priceListVersionIds).bpartnerId(bpartnerId).soTrx(soTrx).build();<NEW_LINE>}
collect(ImmutableSet.toImmutableSet());
1,614,816
protected Mono<Void> doExecute(final ServerWebExchange exchange, final ShenyuPluginChain chain, final SelectorData selector, final RuleData rule) {<NEW_LINE>JwtConfig jwtConfig = Singleton.INST.get(JwtConfig.class);<NEW_LINE>String authorization = exchange.getRequest().getHeaders().getFirst(HttpHeaders.AUTHORIZATION);<NEW_LINE>String token = exchange.getRequest().getHeaders().getFirst(TOKEN);<NEW_LINE>// check secreteKey<NEW_LINE>if (StringUtils.isEmpty(jwtConfig.getSecretKey())) {<NEW_LINE>Object error = ShenyuResultWrap.error(exchange, ShenyuResultEnum.SECRET_KEY_MUST_BE_CONFIGURED, null);<NEW_LINE>return WebFluxResultUtils.result(exchange, error);<NEW_LINE>}<NEW_LINE>// compatible processing<NEW_LINE>String finalAuthorization = compatible(token, authorization);<NEW_LINE>Map<String, Object> jwtBody = checkAuthorization(finalAuthorization, jwtConfig.getSecretKey());<NEW_LINE>if (jwtBody != null) {<NEW_LINE>JwtRuleHandle ruleHandle = GsonUtils.getInstance().fromJson(rule.getHandle(), JwtRuleHandle.class);<NEW_LINE>if (ruleHandle == null) {<NEW_LINE>return chain.execute(exchange);<NEW_LINE>}<NEW_LINE>return chain.execute(converter(exchange, jwtBody, ruleHandle.getConverter()));<NEW_LINE>}<NEW_LINE>Object error = ShenyuResultWrap.error(exchange, ShenyuResultEnum.ERROR_TOKEN, null);<NEW_LINE>return <MASK><NEW_LINE>}
WebFluxResultUtils.result(exchange, error);
1,850,060
protected JRTemplateGenericPrintElement createGenericPrintElement() {<NEW_LINE>JRComponentElement element = fillContext.getComponentElement();<NEW_LINE>JRTemplateGenericElement template = new JRTemplateGenericElement(fillContext.getElementOrigin(), fillContext.getDefaultStyleProvider(), fillContext.getComponentElement(), CVPrintElement.CV_ELEMENT_TYPE);<NEW_LINE>template = deduplicate(template);<NEW_LINE>JRTemplateGenericPrintElement printElement = new JRTemplateGenericPrintElement(template, printElementOriginator);<NEW_LINE>printElement.setUUID(element.getUUID());<NEW_LINE>printElement.setX(element.getX());<NEW_LINE>printElement.setY(fillContext.getElementPrintY());<NEW_LINE>printElement.setWidth(element.getWidth());<NEW_LINE>printElement.<MASK><NEW_LINE>if (element.hasProperties()) {<NEW_LINE>if (element.getPropertiesMap().getProperty("cv.keepTemporaryFiles") != null && element.getPropertiesMap().getProperty("cv.keepTemporaryFiles").equals("true")) {<NEW_LINE>printElement.getPropertiesMap().setProperty("cv.keepTemporaryFiles", "true");<NEW_LINE>}<NEW_LINE>// We also want to transfer to the component all the properties starting with CV_PREFIX<NEW_LINE>// FIXME transfer standard print properties?<NEW_LINE>for (String ownPropName : element.getPropertiesMap().getOwnPropertyNames()) {<NEW_LINE>if (ownPropName.startsWith(CVConstants.CV_PREFIX)) {<NEW_LINE>printElement.getPropertiesMap().setProperty(ownPropName, element.getPropertiesMap().getProperty(ownPropName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String elementId = CVUtils.generateElementId();<NEW_LINE>printElement.setParameterValue(CVPrintElement.PARAMETER_ELEMENT_ID, elementId);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("generating element " + elementId);<NEW_LINE>}<NEW_LINE>return printElement;<NEW_LINE>}
setHeight(element.getHeight());
19,793
public void init(FilterConfig config) throws ServletException {<NEW_LINE>mappings = WebSocketMappings.ensureMappings(config.getServletContext());<NEW_LINE>String max = config.getInitParameter("idleTimeout");<NEW_LINE>if (max == null) {<NEW_LINE><MASK><NEW_LINE>if (max != null)<NEW_LINE>LOG.warn("'maxIdleTime' init param is deprecated, use 'idleTimeout' instead");<NEW_LINE>}<NEW_LINE>if (max != null)<NEW_LINE>defaultCustomizer.setIdleTimeout(Duration.ofMillis(Long.parseLong(max)));<NEW_LINE>max = config.getInitParameter("maxTextMessageSize");<NEW_LINE>if (max != null)<NEW_LINE>defaultCustomizer.setMaxTextMessageSize(Integer.parseInt(max));<NEW_LINE>max = config.getInitParameter("maxBinaryMessageSize");<NEW_LINE>if (max != null)<NEW_LINE>defaultCustomizer.setMaxBinaryMessageSize(Integer.parseInt(max));<NEW_LINE>max = config.getInitParameter("inputBufferSize");<NEW_LINE>if (max != null)<NEW_LINE>defaultCustomizer.setInputBufferSize(Integer.parseInt(max));<NEW_LINE>max = config.getInitParameter("outputBufferSize");<NEW_LINE>if (max != null)<NEW_LINE>defaultCustomizer.setOutputBufferSize(Integer.parseInt(max));<NEW_LINE>max = config.getInitParameter("maxFrameSize");<NEW_LINE>if (max == null)<NEW_LINE>max = config.getInitParameter("maxAllowedFrameSize");<NEW_LINE>if (max != null)<NEW_LINE>defaultCustomizer.setMaxFrameSize(Long.parseLong(max));<NEW_LINE>String autoFragment = config.getInitParameter("autoFragment");<NEW_LINE>if (autoFragment != null)<NEW_LINE>defaultCustomizer.setAutoFragment(Boolean.parseBoolean(autoFragment));<NEW_LINE>}
max = config.getInitParameter("maxIdleTime");
1,132,127
protected org.activiti.engine.impl.persistence.entity.JobEntity convertToActiviti5JobEntity(final JobEntity job) {<NEW_LINE>org.activiti.engine.impl.persistence.entity.JobEntity activity5Job = new org.activiti.engine.impl.persistence.entity.JobEntity();<NEW_LINE>activity5Job.setJobType(job.getJobType());<NEW_LINE>activity5Job.setDuedate(job.getDuedate());<NEW_LINE>activity5Job.setExclusive(job.isExclusive());<NEW_LINE>activity5Job.setExecutionId(job.getExecutionId());<NEW_LINE>activity5Job.setId(job.getId());<NEW_LINE>activity5Job.setJobHandlerConfiguration(job.getJobHandlerConfiguration());<NEW_LINE>activity5Job.setJobHandlerType(job.getJobHandlerType());<NEW_LINE>activity5Job.setEndDate(job.getEndDate());<NEW_LINE>activity5Job.setRepeat(job.getRepeat());<NEW_LINE>activity5Job.setProcessDefinitionId(job.getProcessDefinitionId());<NEW_LINE>activity5Job.setProcessInstanceId(job.getProcessInstanceId());<NEW_LINE>activity5Job.setRetries(job.getRetries());<NEW_LINE>activity5Job.setRevision(job.getRevision());<NEW_LINE>activity5Job.setTenantId(job.getTenantId());<NEW_LINE>activity5Job.<MASK><NEW_LINE>return activity5Job;<NEW_LINE>}
setExceptionMessage(job.getExceptionMessage());
188,166
public void add(char[] output, int offset, int len, int endOffset, int posLength) {<NEW_LINE>if (count == outputs.length) {<NEW_LINE>outputs = ArrayUtil.grow(outputs);<NEW_LINE>}<NEW_LINE>if (count == endOffsets.length) {<NEW_LINE>final int[] next = new int[ArrayUtil.oversize(1 <MASK><NEW_LINE>System.arraycopy(endOffsets, 0, next, 0, count);<NEW_LINE>endOffsets = next;<NEW_LINE>}<NEW_LINE>if (count == posLengths.length) {<NEW_LINE>final int[] next = new int[ArrayUtil.oversize(1 + count, Integer.BYTES)];<NEW_LINE>System.arraycopy(posLengths, 0, next, 0, count);<NEW_LINE>posLengths = next;<NEW_LINE>}<NEW_LINE>if (outputs[count] == null) {<NEW_LINE>outputs[count] = new CharsRefBuilder();<NEW_LINE>}<NEW_LINE>outputs[count].copyChars(output, offset, len);<NEW_LINE>// endOffset can be -1, in which case we should simply<NEW_LINE>// use the endOffset of the input token, or X >= 0, in<NEW_LINE>// which case we use X as the endOffset for this output<NEW_LINE>endOffsets[count] = endOffset;<NEW_LINE>posLengths[count] = posLength;<NEW_LINE>count++;<NEW_LINE>}
+ count, Integer.BYTES)];
62,317
public void QueryJPQL() {<NEW_LINE>PersistenceManagerFactory pmf = new JDOPersistenceManagerFactory(pumd, null);<NEW_LINE>PersistenceManager pm = pmf.getPersistenceManager();<NEW_LINE>Transaction tx = pm.currentTransaction();<NEW_LINE>try {<NEW_LINE>tx.begin();<NEW_LINE>// JPQL :<NEW_LINE>LOGGER.log(Level.INFO, "JPQL --------------------------------------------------------------");<NEW_LINE>Query q = pm.newQuery("JPQL", "SELECT p FROM " + Product.class.getName() + " p WHERE p.name = 'Laptop'");<NEW_LINE>List results = (List) q.execute();<NEW_LINE>Iterator<Product<MASK><NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Product p = iter.next();<NEW_LINE>LOGGER.log(Level.WARNING, "Product name: {0} - Price: {1}", new Object[] { p.name, p.price });<NEW_LINE>}<NEW_LINE>LOGGER.log(Level.INFO, "--------------------------------------------------------------");<NEW_LINE>tx.commit();<NEW_LINE>} finally {<NEW_LINE>if (tx.isActive()) {<NEW_LINE>tx.rollback();<NEW_LINE>}<NEW_LINE>pm.close();<NEW_LINE>}<NEW_LINE>}
> iter = results.iterator();
22,349
private void submitForm() {<NEW_LINE>if (!validateForm()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);<NEW_LINE>imm.hideSoftInputFromWindow(et_user.getWindowToken(), 0);<NEW_LINE>if (!isOnline(this)) {<NEW_LINE>loginLoggingIn.setVisibility(View.GONE);<NEW_LINE>loginLogin.setVisibility(View.VISIBLE);<NEW_LINE>loginCreateAccount.setVisibility(View.INVISIBLE);<NEW_LINE>queryingSignupLinkText.setVisibility(View.GONE);<NEW_LINE>confirmingAccountText.setVisibility(View.GONE);<NEW_LINE>generatingKeysText.setVisibility(View.GONE);<NEW_LINE>loggingInText.setVisibility(View.GONE);<NEW_LINE>fetchingNodesText.setVisibility(View.GONE);<NEW_LINE>prepareNodesText.setVisibility(View.GONE);<NEW_LINE>if (serversBusyText != null) {<NEW_LINE>serversBusyText.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>showErrorAlertDialog(getString(R.string.error_server_connection_problem), false, this);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>loginLogin.setVisibility(View.GONE);<NEW_LINE>loginCreateAccount.setVisibility(View.GONE);<NEW_LINE>loginLoggingIn.setVisibility(View.VISIBLE);<NEW_LINE>generatingKeysText.setVisibility(View.VISIBLE);<NEW_LINE>loginProgressBar.setVisibility(View.VISIBLE);<NEW_LINE><MASK><NEW_LINE>queryingSignupLinkText.setVisibility(View.GONE);<NEW_LINE>confirmingAccountText.setVisibility(View.GONE);<NEW_LINE>lastEmail = et_user.getText().toString().toLowerCase(Locale.ENGLISH).trim();<NEW_LINE>lastPassword = et_password.getText().toString();<NEW_LINE>logDebug("Generating keys");<NEW_LINE>onKeysGenerated(lastEmail, lastPassword);<NEW_LINE>}
loginFetchNodesProgressBar.setVisibility(View.GONE);
48,238
final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Cloud9");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(listTagsForResourceRequest));
694,369
final ListDataIngestionJobsResult executeListDataIngestionJobs(ListDataIngestionJobsRequest listDataIngestionJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDataIngestionJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDataIngestionJobsRequest> request = null;<NEW_LINE>Response<ListDataIngestionJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDataIngestionJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDataIngestionJobsRequest));<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, "LookoutEquipment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDataIngestionJobs");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDataIngestionJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDataIngestionJobsResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig);
1,047,577
public void execute() throws Exception {<NEW_LINE>ensureArgCount(2);<NEW_LINE>int numberOfRuns = getIntArg(0);<NEW_LINE>int secondsBetweenRuns = getIntArg(1);<NEW_LINE>AtomicInteger counter = new AtomicInteger(0);<NEW_LINE><MASK><NEW_LINE>Runnable containerRecoveryIteration = () -> {<NEW_LINE>// Recover all the Segment Containers sequentially.<NEW_LINE>for (int i = 0; i < getServiceConfig().getContainerCount(); i++) {<NEW_LINE>try {<NEW_LINE>super.performRecovery(i);<NEW_LINE>output("Completed recovery of container: " + i);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// We found an error while recovering a container. Stop running further recoveries to debug this one.<NEW_LINE>output("Problem recovering container " + i + ", terminating execution of command.");<NEW_LINE>failed.set(true);<NEW_LINE>e.printStackTrace(getOut());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Increment recovery iterations counter.<NEW_LINE>counter.getAndIncrement();<NEW_LINE>};<NEW_LINE>Futures.loop(() -> counter.get() < numberOfRuns && !failed.get(), () -> CompletableFuture.runAsync(containerRecoveryIteration, getCommandArgs().getState().getExecutor()).thenCompose(a -> Futures.delayedFuture(Duration.ofSeconds(secondsBetweenRuns), getCommandArgs().getState().getExecutor())), getCommandArgs().getState().getExecutor()).join();<NEW_LINE>output("Completed continuous Segment Container recovery command.");<NEW_LINE>}
AtomicBoolean failed = new AtomicBoolean(false);
192,374
private int writeData(byte[] result, int offset, DataValue value) {<NEW_LINE><MASK><NEW_LINE>if (type == DataPrimitives.BYTE) {<NEW_LINE>result[offset++] = value.getByte(0);<NEW_LINE>} else if (type == DataPrimitives.SHORT) {<NEW_LINE>offset = align(offset, 2);<NEW_LINE>short v = value.getShort(0);<NEW_LINE>result[offset++] = (byte) v;<NEW_LINE>result[offset++] = (byte) (v >> 8);<NEW_LINE>} else if (type == DataPrimitives.INT) {<NEW_LINE>offset = writeInt(offset, result, value.getInt(0));<NEW_LINE>} else if (type == DataPrimitives.LONG) {<NEW_LINE>offset = writeLong(offset, result, value.getLong(0));<NEW_LINE>} else if (type == DataPrimitives.FLOAT) {<NEW_LINE>int v = Float.floatToRawIntBits(value.getFloat(0));<NEW_LINE>offset = writeInt(offset, result, v);<NEW_LINE>} else if (type == DataPrimitives.DOUBLE) {<NEW_LINE>long v = Double.doubleToRawLongBits(value.getDouble(0));<NEW_LINE>offset = writeLong(offset, result, v);<NEW_LINE>} else if (type == DataPrimitives.ADDRESS) {<NEW_LINE>offset = writeInt(offset, result, (int) value.getAddress(0));<NEW_LINE>} else if (type instanceof DataArray) {<NEW_LINE>DataArray array = (DataArray) type;<NEW_LINE>for (int i = 0; i < array.getSize(); ++i) {<NEW_LINE>offset = writeData(result, offset, value.getValue(i));<NEW_LINE>}<NEW_LINE>} else if (type instanceof DataStructure) {<NEW_LINE>DataStructure structure = (DataStructure) type;<NEW_LINE>if (structure.getAlignment() > 0) {<NEW_LINE>offset = align(offset, structure.getAlignment());<NEW_LINE>}<NEW_LINE>int componentCount = structure.getComponents().length;<NEW_LINE>for (int i = 0; i < componentCount; ++i) {<NEW_LINE>offset = writeData(result, offset, value.getValue(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return offset;<NEW_LINE>}
DataType type = value.getType();
267,077
public void fillExecutableFromMapObject(final TypedMapWrapper<String, Object> wrappedMap) {<NEW_LINE>this.id = wrappedMap.getString(ID_PARAM);<NEW_LINE>this.type = wrappedMap.getString(TYPE_PARAM);<NEW_LINE>this.condition = wrappedMap.getString(CONDITION_PARAM);<NEW_LINE>this.conditionOnJobStatus = ConditionOnJobStatus.fromString<MASK><NEW_LINE>this.status = Status.valueOf(wrappedMap.getString(STATUS_PARAM));<NEW_LINE>this.startTime = wrappedMap.getLong(START_TIME_PARAM);<NEW_LINE>this.endTime = wrappedMap.getLong(END_TIME_PARAM);<NEW_LINE>this.updateTime = wrappedMap.getLong(UPDATE_TIME_PARAM);<NEW_LINE>this.attempt.set(wrappedMap.getInt(ATTEMPT_PARAM, 0));<NEW_LINE>this.inNodes = new HashSet<>();<NEW_LINE>this.inNodes.addAll(wrappedMap.getStringCollection(IN_NODES_PARAM, Collections.<String>emptySet()));<NEW_LINE>this.outNodes = new HashSet<>();<NEW_LINE>this.outNodes.addAll(wrappedMap.getStringCollection(OUT_NODES_PARAM, Collections.<String>emptySet()));<NEW_LINE>this.propsSource = wrappedMap.getString(PROPS_SOURCE_PARAM);<NEW_LINE>this.jobSource = wrappedMap.getString(JOB_SOURCE_PARAM);<NEW_LINE>final Object clusterObj = wrappedMap.getObject(CLUSTER_PARAM);<NEW_LINE>if (clusterObj != null) {<NEW_LINE>this.clusterInfo = ClusterInfo.fromObject(clusterObj);<NEW_LINE>}<NEW_LINE>final Map<String, String> outputProps = wrappedMap.<String, String>getMap(OUTPUT_PROPS_PARAM);<NEW_LINE>if (outputProps != null) {<NEW_LINE>this.outputProps = new Props(null, outputProps);<NEW_LINE>}<NEW_LINE>final Collection<Object> pastAttempts = wrappedMap.<Object>getCollection(PAST_ATTEMPTS_PARAM);<NEW_LINE>if (pastAttempts != null) {<NEW_LINE>final List<ExecutionAttempt> attempts = new ArrayList<>();<NEW_LINE>for (final Object attemptObj : pastAttempts) {<NEW_LINE>final ExecutionAttempt attempt = ExecutionAttempt.fromObject(attemptObj);<NEW_LINE>attempts.add(attempt);<NEW_LINE>}<NEW_LINE>this.pastAttempts = attempts;<NEW_LINE>}<NEW_LINE>}
(wrappedMap.getString(CONDITION_ON_JOB_STATUS_PARAM));
1,574,357
public boolean updatePublicKeyEntry(String domainName, String serviceName, PublicKeyEntry publicKey) {<NEW_LINE>final String caller = "updatePublicKeyEntry";<NEW_LINE>int domainId = getDomainId(domainName);<NEW_LINE>if (domainId == 0) {<NEW_LINE>throw notFoundError(caller, ZMSConsts.OBJECT_DOMAIN, domainName);<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>if (serviceId == 0) {<NEW_LINE>throw notFoundError(caller, ZMSConsts.OBJECT_SERVICE, ResourceUtils.serviceResourceName(domainName, serviceName));<NEW_LINE>}<NEW_LINE>int affectedRows;<NEW_LINE>try (PreparedStatement ps = con.prepareStatement(SQL_UPDATE_PUBLIC_KEY)) {<NEW_LINE>ps.setString(1, publicKey.getKey());<NEW_LINE>ps.setInt(2, serviceId);<NEW_LINE>ps.setString(3, publicKey.getId());<NEW_LINE>affectedRows = executeUpdate(ps, caller);<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>throw sqlError(ex, caller);<NEW_LINE>}<NEW_LINE>return (affectedRows > 0);<NEW_LINE>}
serviceId = getServiceId(domainId, serviceName);
214,732
final DescribeDataRepositoryTasksResult executeDescribeDataRepositoryTasks(DescribeDataRepositoryTasksRequest describeDataRepositoryTasksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDataRepositoryTasksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDataRepositoryTasksRequest> request = null;<NEW_LINE>Response<DescribeDataRepositoryTasksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDataRepositoryTasksRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDataRepositoryTasksRequest));<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, "FSx");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDataRepositoryTasks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDataRepositoryTasksResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDataRepositoryTasksResultJsonUnmarshaller());<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);
516,663
private void parseUrlString(String urlString) throws MalformedURLException {<NEW_LINE>int idx = urlString.lastIndexOf('@');<NEW_LINE>// NOI18N<NEW_LINE>int hostIdx = urlString.indexOf("://");<NEW_LINE>// NOI18N<NEW_LINE>int firstSlashIdx = urlString.indexOf("/", hostIdx + 3);<NEW_LINE>if (urlString.contains("\\")) {<NEW_LINE>// NOI18N<NEW_LINE>throw new MalformedURLException(NbBundle.getMessage(Repository.class, "MSG_Repository_InvalidSvnUrl", urlString));<NEW_LINE>}<NEW_LINE>if (idx < 0 || firstSlashIdx < 0 || idx < firstSlashIdx) {<NEW_LINE>svnRevision = SVNRevision.HEAD;<NEW_LINE>} else /*if (acceptRevision)*/<NEW_LINE>{<NEW_LINE>if (idx + 1 < urlString.length()) {<NEW_LINE>// NOI18N<NEW_LINE>String revisionString = "";<NEW_LINE>try {<NEW_LINE>revisionString = urlString.substring(idx + 1);<NEW_LINE>svnRevision = SvnUtils.getSVNRevision(revisionString);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>// NOI18N<NEW_LINE>throw new MalformedURLException(NbBundle.getMessage(Repository.class, "MSG_Repository_WrongRevision", revisionString));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>svnRevision = SVNRevision.HEAD;<NEW_LINE>}<NEW_LINE>urlString = urlString.substring(0, idx);<NEW_LINE>}<NEW_LINE>SVNUrl normalizedUrl = removeEmptyPathSegments(new SVNUrl(urlString));<NEW_LINE>if (// NOI18N<NEW_LINE>"file".equals(normalizedUrl.getProtocol()) && normalizedUrl.getHost() != null && normalizedUrl.getPathSegments().length == 0) {<NEW_LINE>// NOI18N<NEW_LINE>throw new MalformedURLException(NbBundle.getMessage(Repository.class, "MSG_Repository_InvalidSvnUrl", <MASK><NEW_LINE>}<NEW_LINE>svnUrl = normalizedUrl;<NEW_LINE>}
SvnUtils.decodeToString(normalizedUrl)));
337,804
public boolean onPreDraw() {<NEW_LINE>// rotation fix, if not set, originalTitleY = Na<NEW_LINE>ViewCompat.setTranslationY(mLogo, 0);<NEW_LINE>ViewCompat.setTranslationX(mLogo, 0);<NEW_LINE>originalTitleY = ViewCompat.getY(mLogo);<NEW_LINE>originalTitleX = ViewCompat.getX(mLogo);<NEW_LINE>originalTitleHeight = mLogo.getHeight();<NEW_LINE>finalTitleHeight = dpToPx(21, context);<NEW_LINE>// the final scale of the logo<NEW_LINE>finalScale = finalTitleHeight / originalTitleHeight;<NEW_LINE>finalTitleY = (toolbar.getPaddingTop() + toolbar.getHeight()) / 2 - finalTitleHeight / 2 <MASK><NEW_LINE>// (mLogo.getWidth()/2) *(1-finalScale) is the margin left added by the scale() on the logo<NEW_LINE>// when logo scaledown, the content stay in center, so we have to anually remove the left padding<NEW_LINE>finalTitleX = dpToPx(52f, context) - (mLogo.getWidth() / 2) * (1 - finalScale);<NEW_LINE>toolbarLayout.getViewTreeObserver().removeOnPreDrawListener(this);<NEW_LINE>return false;<NEW_LINE>}
- (1 - finalScale) * finalTitleHeight;
248,014
private void tryUpdateData(String monthUrlString, final String regionUrlString) {<NEW_LINE>GetJsonAsyncTask.OnResponseListener<Protocol.TotalChangesByMonthResponse> onResponseListener = new GetJsonAsyncTask.OnResponseListener<Protocol.TotalChangesByMonthResponse>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(Protocol.TotalChangesByMonthResponse response) {<NEW_LINE>if (response != null) {<NEW_LINE>if (contributorsTextView != null) {<NEW_LINE>contributorsTextView.setText(String.valueOf(response.users));<NEW_LINE>}<NEW_LINE>if (editsTextView != null) {<NEW_LINE>editsTextView.setText(String.valueOf(response.changes));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>disableProgress();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>GetJsonAsyncTask.OnErrorListener onErrorListener = new GetJsonAsyncTask.OnErrorListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(String error) {<NEW_LINE>if (contributorsTextView != null) {<NEW_LINE>contributorsTextView.<MASK><NEW_LINE>}<NEW_LINE>if (editsTextView != null) {<NEW_LINE>editsTextView.setText(R.string.data_is_not_available);<NEW_LINE>}<NEW_LINE>disableProgress();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>enableProgress();<NEW_LINE>GetJsonAsyncTask<Protocol.TotalChangesByMonthResponse> totalChangesByMontAsyncTask = new GetJsonAsyncTask<>(Protocol.TotalChangesByMonthResponse.class);<NEW_LINE>totalChangesByMontAsyncTask.setOnResponseListener(onResponseListener);<NEW_LINE>totalChangesByMontAsyncTask.setOnErrorListener(onErrorListener);<NEW_LINE>String finalUrl = String.format(TOTAL_CHANGES_BY_MONTH_URL_PATTERN, monthUrlString, regionUrlString);<NEW_LINE>totalChangesByMontAsyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, finalUrl);<NEW_LINE>GetJsonAsyncTask<Protocol.RecipientsByMonth> recChangesByMontAsyncTask = new GetJsonAsyncTask<>(Protocol.RecipientsByMonth.class);<NEW_LINE>GetJsonAsyncTask.OnResponseListener<Protocol.RecipientsByMonth> recResponseListener = new GetJsonAsyncTask.OnResponseListener<Protocol.RecipientsByMonth>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(Protocol.RecipientsByMonth response) {<NEW_LINE>if (response != null) {<NEW_LINE>if (recipientsTextView != null) {<NEW_LINE>recipientsTextView.setText(String.valueOf(response.regionCount));<NEW_LINE>}<NEW_LINE>if (donationsTextView != null) {<NEW_LINE>donationsTextView.setText(String.format("%.3f", response.regionBtc * 1000f) + " mBTC");<NEW_LINE>}<NEW_LINE>if (donationsTotalLayout != null && donationsTotalTextView != null) {<NEW_LINE>donationsTotalLayout.setVisibility(regionUrlString.isEmpty() ? View.VISIBLE : View.GONE);<NEW_LINE>donationsTotalTextView.setText(String.format("%.3f", response.btc * 1000f) + " mBTC");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>disableProgress();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>recChangesByMontAsyncTask.setOnResponseListener(recResponseListener);<NEW_LINE>clearTextViewResult(recipientsTextView);<NEW_LINE>clearTextViewResult(donationsTextView);<NEW_LINE>clearTextViewResult(donationsTotalTextView);<NEW_LINE>String recfinalUrl = String.format(RECIPIENTS_BY_MONTH, monthUrlString, regionUrlString);<NEW_LINE>recChangesByMontAsyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, recfinalUrl);<NEW_LINE>}
setText(R.string.data_is_not_available);
339,992
public void solve() {<NEW_LINE>model.getSolver().solve();<NEW_LINE>if (model.getSolver().isFeasible() == ESat.TRUE) {<NEW_LINE>int num_sols = 0;<NEW_LINE>do {<NEW_LINE>System.out.print("wife : ");<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>System.out.print(wife[i].getValue() + " ");<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.print("husband: ");<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>System.out.print(husband[i].getValue() + " ");<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>num_sols++;<NEW_LINE>} while (model.getSolver().<MASK><NEW_LINE>System.out.println("It was " + num_sols + " solutions.");<NEW_LINE>} else {<NEW_LINE>System.out.println("Problem is not feasible.");<NEW_LINE>}<NEW_LINE>}
solve() == Boolean.TRUE);
938,396
public static void remux(String srcFile, String dstFile, int rotation) {<NEW_LINE>AVFormatContext inputContext = new AVFormatContext(null);<NEW_LINE>int ret;<NEW_LINE>if ((ret = avformat_open_input(inputContext, srcFile, null, null)) < 0) {<NEW_LINE>loggerStatic.warn("cannot open input context {} errror code: {}", srcFile, ret);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ret = avformat_find_stream_info(inputContext, (AVDictionary) null);<NEW_LINE>if (ret < 0) {<NEW_LINE>loggerStatic.warn("Cannot find stream info {}", srcFile);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AVFormatContext outputContext = new AVFormatContext(null);<NEW_LINE>avformat_alloc_output_context2(outputContext, null, null, dstFile);<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < streamCount; i++) {<NEW_LINE>AVStream stream = avformat_new_stream(outputContext, null);<NEW_LINE>ret = avcodec_parameters_copy(stream.codecpar(), inputContext.streams(i).codecpar());<NEW_LINE>if (ret < 0) {<NEW_LINE>loggerStatic.warn("Cannot copy codecpar parameters from {} to {} for stream index {}", srcFile, dstFile, i);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>stream.codecpar().codec_tag(0);<NEW_LINE>if (stream.codecpar().codec_type() == AVMEDIA_TYPE_VIDEO) {<NEW_LINE>AVDictionary metadata = new AVDictionary();<NEW_LINE>av_dict_set(metadata, "rotate", rotation + "", 0);<NEW_LINE>stream.metadata(metadata);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AVIOContext pb = new AVIOContext(null);<NEW_LINE>ret = avio_open(pb, dstFile, AVIO_FLAG_WRITE);<NEW_LINE>if (ret < 0) {<NEW_LINE>loggerStatic.warn("Cannot open io context {}", dstFile);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>outputContext.pb(pb);<NEW_LINE>ret = avformat_write_header(outputContext, (AVDictionary) null);<NEW_LINE>if (ret < 0) {<NEW_LINE>loggerStatic.warn("Cannot write header to {}", dstFile);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AVPacket pkt = new AVPacket();<NEW_LINE>while (av_read_frame(inputContext, pkt) == 0) {<NEW_LINE>AVStream inStream = inputContext.streams(pkt.stream_index());<NEW_LINE>AVStream outStream = outputContext.streams(pkt.stream_index());
int streamCount = inputContext.nb_streams();
1,252,925
public void visit(BLangBreak breakStmt) {<NEW_LINE>BIRLockDetailsHolder toUnlock = this.env.unlockVars.peek();<NEW_LINE>if (!toUnlock.isEmpty()) {<NEW_LINE>BIRBasicBlock goToBB = new BIRBasicBlock(this.env.nextBBId(names));<NEW_LINE>this.env.enclBasicBlocks.add(goToBB);<NEW_LINE>this.env.enclBB.terminator = new BIRTerminator.GOTO(breakStmt.<MASK><NEW_LINE>this.env.enclBB = goToBB;<NEW_LINE>}<NEW_LINE>int numLocks = toUnlock.size();<NEW_LINE>while (numLocks > 0) {<NEW_LINE>BIRBasicBlock unlockBB = new BIRBasicBlock(this.env.nextBBId(names));<NEW_LINE>this.env.enclBasicBlocks.add(unlockBB);<NEW_LINE>BIRTerminator.Unlock unlock = new BIRTerminator.Unlock(null, unlockBB, this.currentScope);<NEW_LINE>this.env.enclBB.terminator = unlock;<NEW_LINE>unlock.relatedLock = toUnlock.getLock(numLocks - 1);<NEW_LINE>this.env.enclBB = unlockBB;<NEW_LINE>numLocks--;<NEW_LINE>}<NEW_LINE>this.env.enclBB.terminator = new BIRTerminator.GOTO(breakStmt.pos, this.env.enclLoopEndBB, this.currentScope);<NEW_LINE>}
pos, goToBB, this.currentScope);
712,992
public static void dump(ServletContext ctx) {<NEW_LINE>log.config("ServletContext " + ctx.getServletContextName());<NEW_LINE>log.config("- ServerInfo=" + ctx.getServerInfo());<NEW_LINE>if (!CLogMgt.isLevelFiner())<NEW_LINE>return;<NEW_LINE>boolean first = true;<NEW_LINE>Enumeration e = ctx.getInitParameterNames();<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>if (first)<NEW_LINE>log.finer("InitParameter:");<NEW_LINE>first = false;<NEW_LINE>String key = (String) e.nextElement();<NEW_LINE>Object value = ctx.getInitParameter(key);<NEW_LINE>log.finer("- " + key + " = " + value);<NEW_LINE>}<NEW_LINE>first = true;<NEW_LINE>e = ctx.getAttributeNames();<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>if (first)<NEW_LINE>log.finer("Attributes:");<NEW_LINE>first = false;<NEW_LINE>String key = <MASK><NEW_LINE>Object value = ctx.getAttribute(key);<NEW_LINE>log.finer("- " + key + " = " + value);<NEW_LINE>}<NEW_LINE>}
(String) e.nextElement();
1,146,853
protected boolean isMandatory(Field field) {<NEW_LINE>OneToMany oneToManyAnnotation = field.getAnnotation(OneToMany.class);<NEW_LINE>ManyToMany manyToManyAnnotation = field.getAnnotation(ManyToMany.class);<NEW_LINE>if (oneToManyAnnotation != null || manyToManyAnnotation != null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Column columnAnnotation = field.getAnnotation(Column.class);<NEW_LINE>OneToOne oneToOneAnnotation = field.getAnnotation(OneToOne.class);<NEW_LINE>ManyToOne manyToOneAnnotation = field.getAnnotation(ManyToOne.class);<NEW_LINE>com.haulmont.chile.core.annotations.MetaProperty metaPropertyAnnotation = field.getAnnotation(com.haulmont.chile.core.annotations.MetaProperty.class);<NEW_LINE>boolean superMandatory = (metaPropertyAnnotation != null && metaPropertyAnnotation.mandatory()) || (// @NotNull without groups<NEW_LINE>field.getAnnotation(NotNull.class) != null && isDefinedForDefaultValidationGroup(field.getAnnotation(NotNull.class)));<NEW_LINE>return (columnAnnotation != null && !columnAnnotation.nullable()) || (oneToOneAnnotation != null && !oneToOneAnnotation.optional()) || (manyToOneAnnotation != null && !<MASK><NEW_LINE>}
manyToOneAnnotation.optional()) || superMandatory;
1,773,720
public void dialogChanged() {<NEW_LINE>IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getContainerName()));<NEW_LINE>String fileName = getFileName();<NEW_LINE>IResource file = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getContainerName() + "/" + fileName));<NEW_LINE>if (file != null) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (getContainerName().length() == 0) {<NEW_LINE>updateStatus("File container must be specified");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (container == null || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {<NEW_LINE>updateStatus("File container must exist");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!container.isAccessible()) {<NEW_LINE>updateStatus("Project must be writable");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fileName.length() == 0) {<NEW_LINE>updateStatus("File name must be specified");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {<NEW_LINE>updateStatus("File name must be valid");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int dotLoc = fileName.lastIndexOf('.');<NEW_LINE>if (dotLoc != -1) {<NEW_LINE>String ext = fileName.substring(dotLoc + 1);<NEW_LINE>if (ext.equalsIgnoreCase("go") == false) {<NEW_LINE>updateStatus("File extension must be \"go\"");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sourceFileComposite.getSourceFileType() == SourceFileType.TEST) {<NEW_LINE>if (!sourceFileComposite.getSourceFilename().getText().endsWith("_test.go")) {<NEW_LINE>updateStatus("Tests must end with \"_test.go\" suffix");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateStatus(null);<NEW_LINE>}
updateStatus("File " + fileName + " already exists. Choose a new name.");
1,752,694
private Precedence visitBinOp(Concrete.Expression left, Concrete.ReferenceExpression infix, List<Concrete.Argument> implicitArgs, Concrete.Expression right, Precedence prec, StringBuilder builder) {<NEW_LINE>Precedence infixPrec = ((GlobalReferable) infix.getReferent()).getRepresentablePrecedence();<NEW_LINE>boolean needParens = prec.priority > infixPrec.priority || prec.priority == infixPrec.priority && (prec.associativity != infixPrec.associativity || prec.associativity == Precedence.Associativity.NON_ASSOC);<NEW_LINE>if (needParens)<NEW_LINE>myBuilder.append('(');<NEW_LINE>PrettyPrintVisitor ppVisitor;<NEW_LINE>Precedence leftPrec = infixPrec.associativity != Precedence.Associativity.LEFT_ASSOC ? new Precedence(Precedence.Associativity.NON_ASSOC, infixPrec.<MASK><NEW_LINE>if (left != null) {<NEW_LINE>left.accept(this, leftPrec);<NEW_LINE>ppVisitor = this;<NEW_LINE>} else {<NEW_LINE>ppVisitor = new PrettyPrintVisitor(builder, myIndent, !noIndent);<NEW_LINE>}<NEW_LINE>ppVisitor.myBuilder.append(' ');<NEW_LINE>ppVisitor.printReferenceName(infix, null);<NEW_LINE>for (Concrete.Argument arg : implicitArgs) {<NEW_LINE>ppVisitor.myBuilder.append(" {");<NEW_LINE>arg.expression.accept(ppVisitor, new Precedence(Expression.PREC));<NEW_LINE>ppVisitor.printClosingBrace();<NEW_LINE>}<NEW_LINE>ppVisitor.myBuilder.append(' ');<NEW_LINE>Precedence rightPrec = infixPrec.associativity != Precedence.Associativity.RIGHT_ASSOC ? new Precedence(Precedence.Associativity.NON_ASSOC, infixPrec.priority, infixPrec.isInfix) : infixPrec;<NEW_LINE>if (right != null) {<NEW_LINE>right.accept(ppVisitor, rightPrec);<NEW_LINE>if (needParens)<NEW_LINE>ppVisitor.myBuilder.append(')');<NEW_LINE>return leftPrec;<NEW_LINE>} else {<NEW_LINE>if (needParens)<NEW_LINE>builder.append(')');<NEW_LINE>return rightPrec;<NEW_LINE>}<NEW_LINE>}
priority, infixPrec.isInfix) : infixPrec;
284,312
public static void drawLoadingProgress(Graphics g, float alpha) {<NEW_LINE>String text, file;<NEW_LINE>int progress;<NEW_LINE>// determine current action<NEW_LINE>if ((file = OszUnpacker.getCurrentFileName()) != null) {<NEW_LINE>text = "Unpacking new beatmaps...";<NEW_LINE>progress = OszUnpacker.getUnpackerProgress();<NEW_LINE>} else if ((file = BeatmapParser.getCurrentFileName()) != null) {<NEW_LINE>text = (BeatmapParser.getStatus() == BeatmapParser.Status.INSERTING) ? "Updating database..." : "Loading beatmaps...";<NEW_LINE>progress = BeatmapParser.getParserProgress();<NEW_LINE>} else if ((file = SkinUnpacker.getCurrentFileName()) != null) {<NEW_LINE>text = "Unpacking new skins...";<NEW_LINE>progress = SkinUnpacker.getUnpackerProgress();<NEW_LINE>} else if ((file = ReplayImporter.getCurrentFileName()) != null) {<NEW_LINE>text = "Importing replays...";<NEW_LINE>progress = ReplayImporter.getLoadingProgress();<NEW_LINE>} else if ((file = SoundController.getCurrentFileName()) != null) {<NEW_LINE>text = "Loading sounds...";<NEW_LINE>progress = SoundController.getLoadingProgress();<NEW_LINE>} else<NEW_LINE>return;<NEW_LINE>// draw loading info<NEW_LINE>float marginX = container.getWidth() * 0.02f, marginY = container.getHeight() * 0.02f;<NEW_LINE>float lineY = container.getHeight() - marginY;<NEW_LINE>int lineOffsetY = Fonts.MEDIUM.getLineHeight();<NEW_LINE>float oldWhiteAlpha = Colors.WHITE_FADE.a;<NEW_LINE>Colors.WHITE_FADE.a = alpha;<NEW_LINE>if (Options.isLoadVerbose()) {<NEW_LINE>// verbose: display percentages and file names<NEW_LINE>Fonts.MEDIUM.drawString(marginX, lineY - (lineOffsetY * 2), String.format("%s (%d%%)", text<MASK><NEW_LINE>Fonts.MEDIUM.drawString(marginX, lineY - lineOffsetY, file, Colors.WHITE_FADE);<NEW_LINE>} else {<NEW_LINE>// draw loading bar<NEW_LINE>Fonts.MEDIUM.drawString(marginX, lineY - (lineOffsetY * 2), text, Colors.WHITE_FADE);<NEW_LINE>g.setColor(Colors.WHITE_FADE);<NEW_LINE>g.fillRoundRect(marginX, lineY - (lineOffsetY / 2f), (container.getWidth() - (marginX * 2f)) * progress / 100f, lineOffsetY / 4f, 4);<NEW_LINE>}<NEW_LINE>Colors.WHITE_FADE.a = oldWhiteAlpha;<NEW_LINE>}
, progress), Colors.WHITE_FADE);
620,685
final GetConfigurationProfileResult executeGetConfigurationProfile(GetConfigurationProfileRequest getConfigurationProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getConfigurationProfileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetConfigurationProfileRequest> request = null;<NEW_LINE>Response<GetConfigurationProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetConfigurationProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getConfigurationProfileRequest));<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, "AppConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetConfigurationProfile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetConfigurationProfileResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetConfigurationProfileResultJsonUnmarshaller());<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.endEvent(Field.RequestMarshallTime);
861,546
private void updateDataPoint(IDataPoint dataPoint) {<NEW_LINE><MASK><NEW_LINE>for (Channel channel : getThing().getChannels()) {<NEW_LINE>if (channel.getConfiguration().containsKey("id")) {<NEW_LINE>try {<NEW_LINE>int id = Integer.parseInt(channel.getConfiguration().get("id").toString());<NEW_LINE>if (id == dataPoint.getId()) {<NEW_LINE>this.logger.debug("Ism8 updateDataPoint ID:{} {}", dataPoint.getId(), dataPoint.getValueText());<NEW_LINE>Object val = dataPoint.getValueObject();<NEW_LINE>if (val != null) {<NEW_LINE>updateState(channel.getUID(), new QuantityType<>(val.toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>this.logger.warn("Ism8 updateDataPoint: ID couldn't be converted correctly. Check the configuration of channel {}. {}", channel.getLabel(), e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
this.updateStatus(ThingStatus.ONLINE);
1,451,585
public boolean loginAs(String username) {<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>values.<MASK><NEW_LINE>String urlString = buildUrl(APIConstants.PATH_LOGINAS) + "?" + builderGetParametersString(values);<NEW_LINE>com.newsblur.util.Log.i(this.getClass().getName(), "doing superuser swap: " + urlString);<NEW_LINE>// This API returns a redirect that means the call worked, but we do not want to follow it. To<NEW_LINE>// just get the cookie from the 302 and stop, we directly use a one-off OkHttpClient.<NEW_LINE>Request.Builder requestBuilder = new Request.Builder().url(urlString);<NEW_LINE>addCookieHeader(requestBuilder);<NEW_LINE>OkHttpClient noredirHttpClient = new OkHttpClient.Builder().followRedirects(false).build();<NEW_LINE>try {<NEW_LINE>Response response = noredirHttpClient.newCall(requestBuilder.build()).execute();<NEW_LINE>if (!response.isRedirect())<NEW_LINE>return false;<NEW_LINE>String newCookie = response.header("Set-Cookie");<NEW_LINE>PrefsUtils.saveLogin(context, username, newCookie);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
put(APIConstants.PARAMETER_USER, username);
1,095,983
// CALL WITH THE LOCK<NEW_LINE>private void connect() {<NEW_LINE>if (isInProgress)<NEW_LINE>return;<NEW_LINE>isInProgress = true;<NEW_LINE>// ignore previous client closes<NEW_LINE>receivedClientClose = false;<NEW_LINE>AsyncInvokerImpl invoker = (AsyncInvokerImpl) invocationBuilder.rx();<NEW_LINE>RestClientRequestContext restClientRequestContext = invoker.performRequestInternal("GET", null, null, false);<NEW_LINE>restClientRequestContext.getResult().handle((response, throwable) -> {<NEW_LINE>// errors during connection don't currently lead to a retry<NEW_LINE>if (throwable != null) {<NEW_LINE>receiveThrowable(throwable);<NEW_LINE>notifyCompletion();<NEW_LINE>} else if (Response.Status.Family.familyOf(response.getStatus()) != Response.Status.Family.SUCCESSFUL) {<NEW_LINE>receiveThrowable(new RuntimeException("HTTP call unsuccessful: " + response.getStatus()));<NEW_LINE>notifyCompletion();<NEW_LINE>} else if (!MediaType.SERVER_SENT_EVENTS_TYPE.isCompatible(response.getMediaType())) {<NEW_LINE>receiveThrowable(new RuntimeException("HTTP call did not return an SSE media type: " + response.getMediaType()));<NEW_LINE>notifyCompletion();<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>}
registerOnClient(restClientRequestContext.getVertxClientResponse());
687,061
public void init(List<String> keys, List<ParamValue> values) {<NEW_LINE>keys.add(CommonConstants.VERSION_KEY);<NEW_LINE>values.add(new DynamicValues(null));<NEW_LINE>keys.add(CommonConstants.SIDE_KEY);<NEW_LINE>values.add(new FixedParamValue(CommonConstants.CONSUMER_SIDE, CommonConstants.PROVIDER_SIDE));<NEW_LINE>keys.add(CommonConstants.INTERFACE_KEY);<NEW_LINE>values.add(new DynamicValues(null));<NEW_LINE>keys.add(CommonConstants.PID_KEY);<NEW_LINE>values.add(new DynamicValues(null));<NEW_LINE>keys.add(CommonConstants.THREADPOOL_KEY);<NEW_LINE>values.add(new DynamicValues(null));<NEW_LINE>keys.add(CommonConstants.GROUP_KEY);<NEW_LINE>values.add(new DynamicValues(null));<NEW_LINE>keys.add(CommonConstants.VERSION_KEY);<NEW_LINE>values.add(new DynamicValues(null));<NEW_LINE>keys.add(CommonConstants.METADATA_KEY);<NEW_LINE>values.add(new DynamicValues(null));<NEW_LINE>keys.add(CommonConstants.APPLICATION_KEY);<NEW_LINE>values.<MASK><NEW_LINE>keys.add(CommonConstants.DUBBO_VERSION_KEY);<NEW_LINE>values.add(new DynamicValues(null));<NEW_LINE>keys.add(CommonConstants.RELEASE_KEY);<NEW_LINE>values.add(new DynamicValues(null));<NEW_LINE>keys.add(CommonConstants.PATH_KEY);<NEW_LINE>values.add(new DynamicValues(null));<NEW_LINE>keys.add(CommonConstants.ANYHOST_KEY);<NEW_LINE>values.add(new DynamicValues(null));<NEW_LINE>}
add(new DynamicValues(null));
1,420,491
private FhirVersionIndependentConcept toConcept(IPrimitiveType<String> theCodeType, IPrimitiveType<String> theCodeSystemIdentifierType, IBaseCoding theCodingType) {<NEW_LINE>String code = theCodeType != null ? theCodeType.getValueAsString() : null;<NEW_LINE>String system = theCodeSystemIdentifierType != null ? getUrlFromIdentifier(theCodeSystemIdentifierType.getValueAsString()) : null;<NEW_LINE>String systemVersion = theCodeSystemIdentifierType != null ? getVersionFromIdentifier(<MASK><NEW_LINE>if (theCodingType != null) {<NEW_LINE>Coding canonicalizedCoding = toCanonicalCoding(theCodingType);<NEW_LINE>// Shouldn't be null, since theCodingType isn't<NEW_LINE>assert canonicalizedCoding != null;<NEW_LINE>code = canonicalizedCoding.getCode();<NEW_LINE>system = canonicalizedCoding.getSystem();<NEW_LINE>systemVersion = canonicalizedCoding.getVersion();<NEW_LINE>}<NEW_LINE>return new FhirVersionIndependentConcept(system, code, null, systemVersion);<NEW_LINE>}
theCodeSystemIdentifierType.getValueAsString()) : null;
293,978
public void paint(Graphics g, JComponent c) {<NEW_LINE>JBTabsImpl tabs = (JBTabsImpl) c;<NEW_LINE>if (tabs.getVisibleInfos().isEmpty())<NEW_LINE>return;<NEW_LINE>Graphics2D g2d = (Graphics2D) g;<NEW_LINE>final <MASK><NEW_LINE>config.setAntialiasing(true);<NEW_LINE>try {<NEW_LINE>final Rectangle clip = g2d.getClipBounds();<NEW_LINE>Runnable tabLineRunner = doPaintBackground(tabs, g2d, clip);<NEW_LINE>final TabInfo selected = tabs.getSelectedInfo();<NEW_LINE>if (selected != null) {<NEW_LINE>Rectangle compBounds = selected.getComponent().getBounds();<NEW_LINE>if (compBounds.contains(clip) && !compBounds.intersects(clip))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>tabLineRunner.run();<NEW_LINE>if (!tabs.isStealthModeEffective() && !tabs.isHideTabs()) {<NEW_LINE>paintNonSelectedTabs(tabs, g2d);<NEW_LINE>}<NEW_LINE>doPaintActive(tabs, (Graphics2D) g);<NEW_LINE>final TabLabel selectedLabel = tabs.getSelectedLabel();<NEW_LINE>if (selected != null) {<NEW_LINE>selectedLabel.paintImage(g);<NEW_LINE>}<NEW_LINE>tabs.getSingleRowLayoutInternal().myMoreIcon.paintIcon(tabs, g);<NEW_LINE>if (tabs.isSideComponentVertical()) {<NEW_LINE>JBTabsImpl.Toolbar toolbarComp = tabs.myInfo2Toolbar.get(tabs.getSelectedInfoInternal());<NEW_LINE>if (toolbarComp != null && !toolbarComp.isEmpty()) {<NEW_LINE>Rectangle toolBounds = toolbarComp.getBounds();<NEW_LINE>g2d.setColor(JBColor.border());<NEW_LINE>LinePainter2D.paint(g2d, toolBounds.getMaxX(), toolBounds.y, toolBounds.getMaxX(), toolBounds.getMaxY() - 1);<NEW_LINE>}<NEW_LINE>} else if (!tabs.isSideComponentOnTabs()) {<NEW_LINE>JBTabsImpl.Toolbar toolbarComp = tabs.myInfo2Toolbar.get(tabs.getSelectedInfoInternal());<NEW_LINE>if (toolbarComp != null && !toolbarComp.isEmpty()) {<NEW_LINE>Rectangle toolBounds = toolbarComp.getBounds();<NEW_LINE>g2d.setColor(JBColor.border());<NEW_LINE>LinePainter2D.paint(g2d, toolBounds.x, toolBounds.getMaxY(), toolBounds.getMaxX() - 1, toolBounds.getMaxY());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>config.restore();<NEW_LINE>}<NEW_LINE>}
GraphicsConfig config = new GraphicsConfig(g2d);
1,347,947
public boolean fullEquals(MultiLabel o) {<NEW_LINE>if (this == o)<NEW_LINE>return true;<NEW_LINE>if (o == null || getClass() != o.getClass())<NEW_LINE>return false;<NEW_LINE>if (Double.compare(score, o.score) != 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Map<String, Double> thisMap = new HashMap<>();<NEW_LINE>for (Label l : labels) {<NEW_LINE>thisMap.put(l.getLabel(), l.getScore());<NEW_LINE>}<NEW_LINE>Map<String, Double> thatMap = new HashMap<>();<NEW_LINE>for (Label l : o.labels) {<NEW_LINE>thatMap.put(l.getLabel(), l.getScore());<NEW_LINE>}<NEW_LINE>if (thisMap.size() == thatMap.size()) {<NEW_LINE>for (Map.Entry<String, Double> e : thisMap.entrySet()) {<NEW_LINE>Double thisValue = e.getValue();<NEW_LINE>Double thatValue = thatMap.<MASK><NEW_LINE>if ((thatValue == null) || Double.compare(thisValue, thatValue) != 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
get(e.getKey());
1,570,100
private static void uncompressSlidingFlavor(final CpcSketch target, final CompressedState source) {<NEW_LINE><MASK><NEW_LINE>uncompressTheWindow(target, source);<NEW_LINE>final int srcLgK = source.lgK;<NEW_LINE>final int numPairs = source.numCsv;<NEW_LINE>if (numPairs == 0) {<NEW_LINE>target.pairTable = new PairTable(2, 6 + srcLgK);<NEW_LINE>} else {<NEW_LINE>assert (numPairs > 0);<NEW_LINE>assert (source.csvStream != null);<NEW_LINE>final int[] pairs = uncompressTheSurprisingValues(source);<NEW_LINE>// NB<NEW_LINE>final int pseudoPhase = determinePseudoPhase(srcLgK, source.numCoupons);<NEW_LINE>assert (pseudoPhase < 16);<NEW_LINE>final byte[] permutation = columnPermutationsForDecoding[pseudoPhase];<NEW_LINE>final int offset = source.getWindowOffset();<NEW_LINE>assert (offset > 0) && (offset <= 56);<NEW_LINE>for (int i = 0; i < numPairs; i++) {<NEW_LINE>final int rowCol = pairs[i];<NEW_LINE>final int row = rowCol >>> 6;<NEW_LINE>int col = rowCol & 63;<NEW_LINE>// first undo the permutation<NEW_LINE>col = permutation[col];<NEW_LINE>// then undo the rotation: old = (new + (offset+8)) mod 64<NEW_LINE>col = (col + (offset + 8)) & 63;<NEW_LINE>pairs[i] = (row << 6) | col;<NEW_LINE>}<NEW_LINE>final PairTable table = PairTable.newInstanceFromPairsArray(pairs, numPairs, srcLgK);<NEW_LINE>target.pairTable = table;<NEW_LINE>}<NEW_LINE>}
assert (source.cwStream != null);
869,929
private static byte[] createPrefixDataType(final byte[] prefix, final DataTypeIdentifier nested, final byte[] postfix) {<NEW_LINE>byte[] whole = new byte[prefix.length + 2 + nested.utf8.getByteLength() + postfix.length];<NEW_LINE>for (int i = 0; i < prefix.length; i++) {<NEW_LINE>whole<MASK><NEW_LINE>}<NEW_LINE>whole[prefix.length] = '<';<NEW_LINE>for (int i = 0, m = nested.utf8.getByteLength(); i < m; i++) {<NEW_LINE>whole[prefix.length + 1 + i] = nested.utf8.getByte(i);<NEW_LINE>}<NEW_LINE>whole[prefix.length + 1 + nested.utf8.getByteLength()] = '>';<NEW_LINE>for (int i = 0; i < postfix.length; i++) {<NEW_LINE>whole[prefix.length + 1 + nested.utf8.length() + 1 + i] = postfix[i];<NEW_LINE>}<NEW_LINE>return whole;<NEW_LINE>}
[i] = prefix[i];
1,627,632
public StringBuilder toTEIPages(StringBuilder buffer, Document doc, GrobidAnalysisConfig config) throws Exception {<NEW_LINE>if (!config.isGenerateTeiCoordinates()) {<NEW_LINE>// no cooredinates, nothing to do<NEW_LINE>return buffer;<NEW_LINE>}<NEW_LINE>// page height and width<NEW_LINE>List<Page<MASK><NEW_LINE>int pageNumber = 1;<NEW_LINE>buffer.append("\t<facsimile>\n");<NEW_LINE>for (Page page : pages) {<NEW_LINE>buffer.append("\t\t<surface ");<NEW_LINE>buffer.append("n=\"" + pageNumber + "\" ");<NEW_LINE>buffer.append("ulx=\"0.0\" uly=\"0.0\" ");<NEW_LINE>buffer.append("lrx=\"" + page.getWidth() + "\" lry=\"" + page.getHeight() + "\"");<NEW_LINE>buffer.append("/>\n");<NEW_LINE>pageNumber++;<NEW_LINE>}<NEW_LINE>buffer.append("\t</facsimile>\n");<NEW_LINE>return buffer;<NEW_LINE>}
> pages = doc.getPages();
873,290
public static QueryProjectResponse unmarshall(QueryProjectResponse queryProjectResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryProjectResponse.setRequestId(_ctx.stringValue("QueryProjectResponse.RequestId"));<NEW_LINE>queryProjectResponse.setPageNumber(_ctx.integerValue("QueryProjectResponse.PageNumber"));<NEW_LINE>queryProjectResponse.setPageSize<MASK><NEW_LINE>queryProjectResponse.setTotalCount(_ctx.integerValue("QueryProjectResponse.TotalCount"));<NEW_LINE>List<Items> data = new ArrayList<Items>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryProjectResponse.Data.Length"); i++) {<NEW_LINE>Items items = new Items();<NEW_LINE>items.setTenantId(_ctx.longValue("QueryProjectResponse.Data[" + i + "].TenantId"));<NEW_LINE>items.setName(_ctx.stringValue("QueryProjectResponse.Data[" + i + "].Name"));<NEW_LINE>items.setId(_ctx.longValue("QueryProjectResponse.Data[" + i + "].Id"));<NEW_LINE>data.add(items);<NEW_LINE>}<NEW_LINE>queryProjectResponse.setData(data);<NEW_LINE>return queryProjectResponse;<NEW_LINE>}
(_ctx.integerValue("QueryProjectResponse.PageSize"));
1,484,829
public void createBindings() {<NEW_LINE>DoubleConverter doubleConverter = new DoubleConverter("%f");<NEW_LINE>DoubleConverter degreeConverter = new DoubleConverter(Configuration.get().getLengthDisplayFormat());<NEW_LINE>IntegerConverter integerConverter = new IntegerConverter();<NEW_LINE>LengthConverter lengthConverter = new LengthConverter();<NEW_LINE>addWrappedBinding(machine, "simulationMode", simulationMode, "selectedItem");<NEW_LINE>addWrappedBinding(machine, "simulatedNonSquarenessFactor", simulatedNonSquarenessFactor, "text", doubleConverter);<NEW_LINE>addWrappedBinding(machine, "simulatedRunout", simulatedRunout, "text", lengthConverter);<NEW_LINE>addWrappedBinding(machine, "simulatedRunoutPhase", simulatedRunoutPhase, "text", degreeConverter);<NEW_LINE>addWrappedBinding(<MASK><NEW_LINE>addWrappedBinding(machine, "simulatedVibrationAmplitude", simulatedVibrationAmplitude, "text", doubleConverter);<NEW_LINE>addWrappedBinding(machine, "simulatedVibrationDuration", simulatedVibrationDuration, "text", doubleConverter);<NEW_LINE>addWrappedBinding(machine, "simulatedCameraNoise", simulatedCameraNoise, "text", integerConverter);<NEW_LINE>addWrappedBinding(machine, "simulatedCameraLag", simulatedCameraLag, "text", doubleConverter);<NEW_LINE>MutableLocationProxy homingError = new MutableLocationProxy();<NEW_LINE>bind(UpdateStrategy.READ_WRITE, machine, "homingError", homingError, "location");<NEW_LINE>addWrappedBinding(homingError, "lengthX", homingErrorX, "text", lengthConverter);<NEW_LINE>addWrappedBinding(homingError, "lengthY", homingErrorY, "text", lengthConverter);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(homingErrorX);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(homingErrorY);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(homingErrorX);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(homingErrorY);<NEW_LINE>ComponentDecorators.decorateWithAutoSelectAndLengthConversion(machineTableZ);<NEW_LINE>}
machine, "pickAndPlaceChecking", pickAndPlaceChecking, "selected");
1,232,475
protected String doIt() throws Exception {<NEW_LINE>final IQueryFilter<I_C_Printing_Queue> queryFilter <MASK><NEW_LINE>final Iterator<I_C_Printing_Queue> iterator = Services.get(IQueryBL.class).createQueryBuilder(I_C_Printing_Queue.class, getCtx(), getTrxName()).filter(queryFilter).orderBy().addColumn(I_C_Printing_Queue.COLUMN_C_Printing_Queue_ID).endOrderBy().create().setOption(IQuery.OPTION_GuaranteedIteratorRequired, false).setOption(IQuery.OPTION_IteratorBufferSize, 1000).iterate(I_C_Printing_Queue.class);<NEW_LINE>final IPrintingQueueBL printingQueueBL = Services.get(IPrintingQueueBL.class);<NEW_LINE>for (final I_C_Printing_Queue item : IteratorUtils.asIterable(iterator)) {<NEW_LINE>printingQueueBL.setItemAggregationKey(item);<NEW_LINE>InterfaceWrapperHelper.save(item);<NEW_LINE>}<NEW_LINE>return "@Success@";<NEW_LINE>}
= getProcessInfo().getQueryFilterOrElseFalse();
1,772,500
final UpdateAssessmentResult executeUpdateAssessment(UpdateAssessmentRequest updateAssessmentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateAssessmentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateAssessmentRequest> request = null;<NEW_LINE>Response<UpdateAssessmentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateAssessmentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateAssessmentRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AuditManager");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateAssessmentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateAssessmentResultJsonUnmarshaller());<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, "UpdateAssessment");
758,652
public void parse(XMLStreamReader xtr, Process activeProcess) throws Exception {<NEW_LINE>String <MASK><NEW_LINE>if (StringUtils.isNotEmpty(resourceElement) && "resourceAssignmentExpression".equals(resourceElement)) {<NEW_LINE>String expression = XMLStreamReaderUtil.moveDown(xtr);<NEW_LINE>if (StringUtils.isNotEmpty(expression) && "formalExpression".equals(expression)) {<NEW_LINE>List<String> assignmentList = new ArrayList<String>();<NEW_LINE>String assignmentText = xtr.getElementText();<NEW_LINE>if (assignmentText.contains(",")) {<NEW_LINE>String[] assignmentArray = assignmentText.split(",");<NEW_LINE>assignmentList = asList(assignmentArray);<NEW_LINE>} else {<NEW_LINE>assignmentList.add(assignmentText);<NEW_LINE>}<NEW_LINE>for (String assignmentValue : assignmentList) {<NEW_LINE>if (assignmentValue == null)<NEW_LINE>continue;<NEW_LINE>assignmentValue = assignmentValue.trim();<NEW_LINE>if (assignmentValue.length() == 0)<NEW_LINE>continue;<NEW_LINE>String userPrefix = "user(";<NEW_LINE>String groupPrefix = "group(";<NEW_LINE>if (assignmentValue.startsWith(userPrefix)) {<NEW_LINE>assignmentValue = assignmentValue.substring(userPrefix.length(), assignmentValue.length() - 1).trim();<NEW_LINE>activeProcess.getCandidateStarterUsers().add(assignmentValue);<NEW_LINE>} else if (assignmentValue.startsWith(groupPrefix)) {<NEW_LINE>assignmentValue = assignmentValue.substring(groupPrefix.length(), assignmentValue.length() - 1).trim();<NEW_LINE>activeProcess.getCandidateStarterGroups().add(assignmentValue);<NEW_LINE>} else {<NEW_LINE>activeProcess.getCandidateStarterGroups().add(assignmentValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
resourceElement = XMLStreamReaderUtil.moveDown(xtr);
1,727,686
public void marshall(APNSChannelResponse aPNSChannelResponse, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (aPNSChannelResponse == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getApplicationId(), APPLICATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getCreationDate(), CREATIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getDefaultAuthenticationMethod(), DEFAULTAUTHENTICATIONMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getHasCredential(), HASCREDENTIAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getHasTokenKey(), HASTOKENKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getIsArchived(), ISARCHIVED_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getLastModifiedBy(), LASTMODIFIEDBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getLastModifiedDate(), LASTMODIFIEDDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getPlatform(), PLATFORM_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSChannelResponse.getVersion(), VERSION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
aPNSChannelResponse.getEnabled(), ENABLED_BINDING);
1,236,051
public final GopConfigContext gopConfig() throws RecognitionException {<NEW_LINE>GopConfigContext _localctx = new GopConfigContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 144, RULE_gopConfig);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>setState(1302);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case SELECT:<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(1289);<NEW_LINE>match(SELECT);<NEW_LINE>setState(1290);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (!(_la == EQUALS || _la == COLON)) {<NEW_LINE>_errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>if (_input.LA(1) == Token.EOF)<NEW_LINE>matchedEOF = true;<NEW_LINE>_errHandler.reportMatch(this);<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>setState(1291);<NEW_LINE>match(LPAREN);<NEW_LINE>setState(1292);<NEW_LINE>selectExpr();<NEW_LINE>setState(1293);<NEW_LINE>match(RPAREN);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case IDENT:<NEW_LINE>enterOuterAlt(_localctx, 2);<NEW_LINE>{<NEW_LINE>setState(1295);<NEW_LINE>((GopConfigContext) _localctx).n = match(IDENT);<NEW_LINE>setState(1296);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (!(_la == EQUALS || _la == COLON)) {<NEW_LINE>_errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>if (_input.LA(1) == Token.EOF)<NEW_LINE>matchedEOF = true;<NEW_LINE>_errHandler.reportMatch(this);<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>setState(1300);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(getInterpreter().adaptivePredict(_input, 131, _ctx)) {<NEW_LINE>case 1:<NEW_LINE>{<NEW_LINE>setState(1297);<NEW_LINE>expression();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>{<NEW_LINE>setState(1298);<NEW_LINE>jsonobject();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>{<NEW_LINE>setState(1299);<NEW_LINE>jsonarray();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_errHandler.recover(this, re);
627,062
protected AddressPoolVO scripts() {<NEW_LINE>AddressPoolVO vo = new AddressPoolVO();<NEW_LINE>vo.setUuid(ipr.getUuid() == null ? Platform.getUuid() : ipr.getUuid());<NEW_LINE>vo.setDescription(ipr.getDescription());<NEW_LINE>vo.setEndIp(ipr.getEndIp());<NEW_LINE>vo.setGateway(ipr.getStartIp());<NEW_LINE>vo.<MASK><NEW_LINE>vo.setName(ipr.getName());<NEW_LINE>vo.setNetmask(ipr.getNetmask());<NEW_LINE>vo.setStartIp(ipr.getStartIp());<NEW_LINE>vo.setNetworkCidr(ipr.getNetworkCidr());<NEW_LINE>vo.setAccountUuid(msg.getSession().getAccountUuid());<NEW_LINE>vo.setIpVersion(ipr.getIpVersion());<NEW_LINE>vo.setAddressMode(ipr.getAddressMode());<NEW_LINE>vo.setPrefixLen(ipr.getPrefixLen());<NEW_LINE>dbf.getEntityManager().persist(vo);<NEW_LINE>dbf.getEntityManager().flush();<NEW_LINE>dbf.getEntityManager().refresh(vo);<NEW_LINE>return vo;<NEW_LINE>}
setL3NetworkUuid(ipr.getL3NetworkUuid());
810,286
public UpdateGeofenceCollectionResult updateGeofenceCollection(UpdateGeofenceCollectionRequest updateGeofenceCollectionRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateGeofenceCollectionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateGeofenceCollectionRequest> request = null;<NEW_LINE>Response<UpdateGeofenceCollectionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new <MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<UpdateGeofenceCollectionResult, JsonUnmarshallerContext> unmarshaller = new UpdateGeofenceCollectionResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<UpdateGeofenceCollectionResult> responseHandler = new JsonResponseHandler<UpdateGeofenceCollectionResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
UpdateGeofenceCollectionRequestMarshaller().marshall(updateGeofenceCollectionRequest);
1,140,279
protected PFont createDefaultFont(float size) {<NEW_LINE>Font baseFont = null;<NEW_LINE>try {<NEW_LINE>// For 4.0 alpha 4 and later, include a built-in font<NEW_LINE>InputStream input = getClass().getResourceAsStream("/font/ProcessingSansPro-Regular.ttf");<NEW_LINE>if (input != null) {<NEW_LINE>baseFont = Font.createFont(Font.TRUETYPE_FONT, input);<NEW_LINE>defaultFontName = baseFont.getName();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// dammit<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>// Fall back to how this was handled in 3.x, ugly!<NEW_LINE>if (baseFont == null) {<NEW_LINE>baseFont = new Font(<MASK><NEW_LINE>}<NEW_LINE>// Create a PFont from this java.awt.Font<NEW_LINE>return createFont(baseFont, size, true, null, false);<NEW_LINE>}
"Lucida Sans", Font.PLAIN, 1);
1,470,009
private MethodSpec.Builder handleInitDestroyBeanPostProcessor() {<NEW_LINE>InitDestroyMethodsDiscoverer initDestroyMethodsDiscoverer = new InitDestroyMethodsDiscoverer(this.beanFactory);<NEW_LINE>Map<String, List<Method>> initMethods = initDestroyMethodsDiscoverer.registerInitMethods(this.writerContext.getNativeConfigurationRegistry());<NEW_LINE>Map<String, List<Method>> destroyMethods = initDestroyMethodsDiscoverer.registerDestroyMethods(this.writerContext.getNativeConfigurationRegistry());<NEW_LINE>if (initMethods.isEmpty() && destroyMethods.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Builder code = CodeBlock.builder();<NEW_LINE>writeLifecycleMethods(code, initMethods, "initMethods");<NEW_LINE>writeLifecycleMethods(code, destroyMethods, "destroyMethods");<NEW_LINE>code.addStatement("return new $T($L, $L, $L)", InitDestroyBeanPostProcessor.class, "beanFactory", "initMethods", "destroyMethods");<NEW_LINE>return MethodSpec.methodBuilder("createInitDestroyBeanPostProcessor").addParameter(ConfigurableBeanFactory.class, "beanFactory").returns(InitDestroyBeanPostProcessor.class).addModifiers(Modifier.PRIVATE).<MASK><NEW_LINE>}
addCode(code.build());
923,920
private static Node toHtmlNode(AbstractWmlConversionContext context, AbstractHyperlinkWriterModel model, Node content, Document doc) {<NEW_LINE>Element <MASK><NEW_LINE>String internalTarget = model.getInternalTarget();<NEW_LINE>String externalTarget = model.getExternalTarget();<NEW_LINE>String location = null;<NEW_LINE>if (model.isExternal()) {<NEW_LINE>location = externalTarget;<NEW_LINE>if ((internalTarget != null) && (internalTarget.length() > 0)) {<NEW_LINE>location = location + "#" + internalTarget;<NEW_LINE>}<NEW_LINE>ret.setAttribute("href", location);<NEW_LINE>} else {<NEW_LINE>ret.setAttribute("href", "#" + internalTarget);<NEW_LINE>}<NEW_LINE>if ((model.getTgtFrame() != null) && (model.getTgtFrame().length() > 0)) {<NEW_LINE>ret.setAttribute("target", model.getTgtFrame());<NEW_LINE>}<NEW_LINE>if ((model.getTooltip() != null) && (model.getTooltip().length() > 0)) {<NEW_LINE>ret.setAttribute("alt", model.getTooltip());<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
ret = doc.createElement("a");
912,624
public <T extends NodeInterface> T create(final Class<T> type, final PropertyMap source) throws FrameworkException {<NEW_LINE>if (type == null) {<NEW_LINE>throw new FrameworkException(422, "Empty type (null). Please supply a valid class name in the type property.");<NEW_LINE>}<NEW_LINE>final CreateNodeCommand<T> command = command(CreateNodeCommand.class);<NEW_LINE>final PropertyMap properties = new PropertyMap(source);<NEW_LINE>String finalType = type.getSimpleName();<NEW_LINE>// try to identify the actual type from input set (creation wouldn't work otherwise anyway)<NEW_LINE>final String typeFromInput = properties.get(NodeInterface.type);<NEW_LINE>if (typeFromInput != null) {<NEW_LINE>Class actualType = StructrApp.getConfiguration().getNodeEntityClass(typeFromInput);<NEW_LINE>if (actualType == null) {<NEW_LINE>// overwrite type information when creating a node (adhere to type specified by resource!)<NEW_LINE>properties.put(AbstractNode.type, type.getSimpleName());<NEW_LINE>} else if (actualType.isInterface() || Modifier.isAbstract(actualType.getModifiers())) {<NEW_LINE>throw new FrameworkException(422, "Invalid abstract type " + <MASK><NEW_LINE>} else {<NEW_LINE>finalType = actualType.getSimpleName();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// set type<NEW_LINE>properties.put(AbstractNode.type, finalType);<NEW_LINE>return command.execute(properties);<NEW_LINE>}
type.getSimpleName() + ", please supply a non-abstract class name in the type property");
1,701,577
public static HullCollisionShape makeShapeFromPointMap(Map<Integer, List<Float>> pointsMap, List<Integer> boneIndices, Vector3f initialScale, Vector3f initialPosition) {<NEW_LINE>ArrayList<Float> points = new ArrayList<>();<NEW_LINE>for (Integer index : boneIndices) {<NEW_LINE>List<Float> l = pointsMap.get(index);<NEW_LINE>if (l != null) {<NEW_LINE>for (int i = 0; i < l.size(); i += 3) {<NEW_LINE>Vector3f pos = new Vector3f();<NEW_LINE>pos.x = l.get(i);<NEW_LINE>pos.y = l.get(i + 1);<NEW_LINE>pos.z = <MASK><NEW_LINE>pos.subtractLocal(initialPosition).multLocal(initialScale);<NEW_LINE>points.add(pos.x);<NEW_LINE>points.add(pos.y);<NEW_LINE>points.add(pos.z);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assert !points.isEmpty();<NEW_LINE>float[] p = new float[points.size()];<NEW_LINE>for (int i = 0; i < points.size(); i++) {<NEW_LINE>p[i] = points.get(i);<NEW_LINE>}<NEW_LINE>return new HullCollisionShape(p);<NEW_LINE>}
l.get(i + 2);