idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
321,345
protected String buildString() {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>String ls = System.getProperty("line.separator");<NEW_LINE>sb.append("[SSH2 KEX init Header (").append(length()).append(" bytes)]").append(ls);<NEW_LINE>sb.append(" Message Number: ").append(messageNumber).append(ls);<NEW_LINE>sb.append(" cookie: ").append(ByteArrays.toHexString(cookie, " ")).append(ls);<NEW_LINE>sb.append(" kex_algorithms: ").append(kexAlgorithms).append(ls);<NEW_LINE>sb.append(" server_host_key_algorithms: ").append(serverHostKeyAlgorithms).append(ls);<NEW_LINE>sb.append(" encryption_algorithms_client_to_server: ").append(encryptionAlgorithmsClientToServer).append(ls);<NEW_LINE>sb.append(" encryption_algorithms_server_to_client: ").append(encryptionAlgorithmsServerToClient).append(ls);<NEW_LINE>sb.append(" mac_algorithms_client_to_server: ").append(macAlgorithmsClientToServer).append(ls);<NEW_LINE>sb.append(" mac_algorithms_server_to_client: ").append<MASK><NEW_LINE>sb.append(" compression_algorithms_client_to_server: ").append(compressionAlgorithmsClientToServer).append(ls);<NEW_LINE>sb.append(" compression_algorithms_server_to_client: ").append(compressionAlgorithmsServerToClient).append(ls);<NEW_LINE>sb.append(" languages_client_to_server: ").append(languagesClientToServer).append(ls);<NEW_LINE>sb.append(" languages_server_to_client: ").append(languagesServerToClient).append(ls);<NEW_LINE>sb.append(" first_kex_packet_follows: ").append(firstKexPacketFollows).append(ls);<NEW_LINE>sb.append(" reserved: ").append(ByteArrays.toHexString(reserved, " ")).append(ls);<NEW_LINE>return sb.toString();<NEW_LINE>}
(macAlgorithmsServerToClient).append(ls);
455,221
protected String toDisplayString(boolean allowSideEffects) {<NEW_LINE>final <MASK><NEW_LINE>final ConditionProfile profile = ConditionProfile.getUncached();<NEW_LINE>String result = "SpecialVariableStorage($~: ";<NEW_LINE>if (lastMatch != null) {<NEW_LINE>try {<NEW_LINE>result += interop.asString(interop.toDisplayString(lastMatch.get(profile), allowSideEffects));<NEW_LINE>} catch (UnsupportedMessageException e) {<NEW_LINE>throw TranslateInteropExceptionNode.getUncached().execute(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result += "nil";<NEW_LINE>}<NEW_LINE>result += ", $_: ";<NEW_LINE>if (lastLine != null) {<NEW_LINE>try {<NEW_LINE>result += interop.asString(interop.toDisplayString(lastLine.get(profile), allowSideEffects));<NEW_LINE>} catch (UnsupportedMessageException e) {<NEW_LINE>throw TranslateInteropExceptionNode.getUncached().execute(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result += "nil";<NEW_LINE>}<NEW_LINE>return result + ")";<NEW_LINE>}
InteropLibrary interop = InteropLibrary.getUncached();
1,053,867
public static boolean containsItems(EditorOperator editor, String... items) {<NEW_LINE>Set<String> actItems = new HashSet<String>();<NEW_LINE>List<String> expItems = Arrays.asList(items);<NEW_LINE>editor.pushKey(KeyEvent.VK_INSERT, KeyEvent.ALT_DOWN_MASK);<NEW_LINE>JDialogOperator jdo = new JDialogOperator();<NEW_LINE>JListOperator list = new JListOperator(jdo);<NEW_LINE>ListModel lm = list.getModel();<NEW_LINE>for (int i = 0; i < lm.getSize(); i++) {<NEW_LINE>CodeGenerator cg = (<MASK><NEW_LINE>actItems.add(cg.getDisplayName());<NEW_LINE>if (!expItems.contains(cg.getDisplayName()))<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (String string : expItems) {<NEW_LINE>if (!actItems.contains(string))<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
CodeGenerator) lm.getElementAt(i);
461,156
public static void main(String[] args) {<NEW_LINE>System.out.println("Starting minimizer test...");<NEW_LINE>List<List<String>> pathList = new ArrayList<>();<NEW_LINE>TransducerGraph randomFA = TransducerGraph.createRandomGraph(5000, 5, 1.0, 5, pathList);<NEW_LINE>List<Double> outputs = randomFA.getPathOutputs(pathList);<NEW_LINE>TransducerGraph.GraphProcessor quasiDeterminizer = new QuasiDeterminizer();<NEW_LINE>AutomatonMinimizer minimizer = new FastExactAutomatonMinimizer();<NEW_LINE>TransducerGraph.NodeProcessor ntsp = new TransducerGraph.SetToStringNodeProcessor(new PennTreebankLanguagePack());<NEW_LINE>TransducerGraph.ArcProcessor isp = new TransducerGraph.InputSplittingProcessor();<NEW_LINE>TransducerGraph.ArcProcessor ocp = new TransducerGraph.OutputCombiningProcessor();<NEW_LINE>TransducerGraph detGraph = quasiDeterminizer.processGraph(randomFA);<NEW_LINE>// combine outputs into inputs<NEW_LINE>TransducerGraph combGraph = new TransducerGraph(detGraph, ocp);<NEW_LINE>// minimize the thing<NEW_LINE>TransducerGraph result = minimizer.minimizeFA(combGraph);<NEW_LINE>System.out.println("Minimized from " + randomFA.getNodes().size() + " to " + result.getNodes().size());<NEW_LINE>// pull out strings from sets returned by minimizer<NEW_LINE>result = new TransducerGraph(result, ntsp);<NEW_LINE>// split outputs from inputs<NEW_LINE>result = new TransducerGraph(result, isp);<NEW_LINE>List<Double> minOutputs = result.getPathOutputs(pathList);<NEW_LINE>System.out.println("Equal? " <MASK><NEW_LINE>}
+ outputs.equals(minOutputs));
1,270,349
protected boolean isCollectionEmpty(MetaProperty property) {<NEW_LINE>MetaProperty inverseProperty = property.getInverse();<NEW_LINE>if (inverseProperty == null) {<NEW_LINE><MASK><NEW_LINE>Collection<Entity> value = entity.getValue(property.getName());<NEW_LINE>return value == null || value.isEmpty();<NEW_LINE>}<NEW_LINE>String invPropName = inverseProperty.getName();<NEW_LINE>String collectionPkName = metadata.getTools().getPrimaryKeyName(property.getRange().asClass());<NEW_LINE>String qlStr = "select e." + collectionPkName + " from " + property.getRange().asClass().getName() + " e where e." + invPropName + "." + primaryKeyName + " = ?1";<NEW_LINE>Query query = entityManager.createQuery(qlStr);<NEW_LINE>query.setParameter(1, entity.getId());<NEW_LINE>query.setMaxResults(1);<NEW_LINE>List<Entity> list = query.getResultList();<NEW_LINE>return list.isEmpty();<NEW_LINE>}
log.warn("Inverse property not found for property {}", property);
1,486,933
public void acceptEx(Configuration configuration) throws Exception {<NEW_LINE>try {<NEW_LINE>configuration.setBoolean(FileInputFormat.INPUT_DIR_NONRECURSIVE_IGNORE_SUBDIRS, true);<NEW_LINE>configuration.setBoolean(FileInputFormat.INPUT_DIR_RECURSIVE, false);<NEW_LINE>configuration.setBoolean(HadoopSources.SHARED_LOCAL_FS, fsc.isSharedFileSystem());<NEW_LINE>configuration.setBoolean(HadoopSources.IGNORE_FILE_NOT_FOUND, fsc.isIgnoreFileNotFound());<NEW_LINE>for (Entry<String, String> option : fsc.getOptions().entrySet()) {<NEW_LINE>configuration.set(option.getKey(), option.getValue());<NEW_LINE>}<NEW_LINE>// Some methods we use to configure actually take a Job<NEW_LINE>Job job = Job.getInstance(configuration);<NEW_LINE>Path inputPath = getInputPath(fsc, configuration);<NEW_LINE>FileInputFormat.addInputPath(job, inputPath);<NEW_LINE>configurer.configure(job, fileFormat);<NEW_LINE>// The job creates a copy of the configuration, so we need to copy the new setting to the<NEW_LINE>// original configuration instance<NEW_LINE>for (Entry<String, String> entry : job.getConfiguration()) {<NEW_LINE>configuration.set(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new JetException("Could not create a source", e);
1,775,191
public Object calculate(Context ctx) {<NEW_LINE>ArrayList<Number> num = new ArrayList<Number>();<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("gcd" + mm.getMessage("function.missingParam"));<NEW_LINE>} else if (param.isLeaf()) {<NEW_LINE>Object result = param.getLeafExpression().calculate(ctx);<NEW_LINE>if (result != null && result instanceof Number) {<NEW_LINE>num.add((Number) result);<NEW_LINE>} else if (result != null && result instanceof Sequence) {<NEW_LINE>int n = ((Sequence) result).length();<NEW_LINE>for (int i = 1; i <= n; i++) {<NEW_LINE>Object tmp = ((Sequence) result).get(i);<NEW_LINE>if (tmp != null && tmp instanceof Number) {<NEW_LINE>num.add((Number) tmp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int size = param.getSubSize();<NEW_LINE>for (int j = 0; j < size; j++) {<NEW_LINE>IParam subj = param.getSub(j);<NEW_LINE>if (subj != null) {<NEW_LINE>Object result = subj.getLeafExpression().calculate(ctx);<NEW_LINE>if (result != null && result instanceof Number) {<NEW_LINE>num.add((Number) result);<NEW_LINE>} else if (result != null && result instanceof Sequence) {<NEW_LINE>int n = ((<MASK><NEW_LINE>for (int i = 1; i <= n; i++) {<NEW_LINE>Object tmp = ((Sequence) result).get(i);<NEW_LINE>if (tmp != null && tmp instanceof Number) {<NEW_LINE>num.add((Number) tmp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int k = num.size();<NEW_LINE>Number[] nums = new Number[k];<NEW_LINE>num.toArray(nums);<NEW_LINE>return new Long(gcd(nums, k));<NEW_LINE>}
Sequence) result).length();
1,107,294
public void testFlowableRxInvoker_getIbmReceiveTimeout(Map<String, String> param, StringBuilder ret) {<NEW_LINE>long timeout = messageTimeout;<NEW_LINE>if (isZOS()) {<NEW_LINE>timeout = zTimeout;<NEW_LINE>}<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder();<NEW_LINE>cb.property("com.ibm.ws.jaxrs.client.receive.timeout", TIMEOUT);<NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(FlowableRxInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/" + SLEEP);<NEW_LINE>Builder builder = t.request();<NEW_LINE>Flowable<Response> flowable = builder.rx(FlowableRxInvoker.class).get(Response.class);<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>final Holder<Response> holder = new Holder<Response>();<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>flowable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>}, throwable -> {<NEW_LINE>if (throwable.getMessage().contains("SocketTimeoutException")) {<NEW_LINE>// OnError<NEW_LINE>ret.append("Timeout as expected");<NEW_LINE>} else {<NEW_LINE>ret.append("throwable");<NEW_LINE>throwable.printStackTrace();<NEW_LINE>}<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, // OnCompleted<NEW_LINE>() -> ret.append("OnCompleted"));<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(timeout, TimeUnit.SECONDS))) {<NEW_LINE>throw new RuntimeException("testFlowableRxInvoker_getIbmReceiveTimeout: Response took too long. Waited " + timeout);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>long elapsed <MASK><NEW_LINE>System.out.println("testFlowableRxInvoker_getIbmReceiveTimeout with TIMEOUT " + TIMEOUT + " OnError elapsed time " + elapsed);<NEW_LINE>c.close();<NEW_LINE>}
= System.currentTimeMillis() - startTime;
118,522
void writeFiles() throws IOException {<NEW_LINE>int numFiles = pkg.files.size();<NEW_LINE>if (numFiles == 0)<NEW_LINE>return;<NEW_LINE>int options = archiveOptions;<NEW_LINE>boolean haveSizeHi = testBit(options, AO_HAVE_FILE_SIZE_HI);<NEW_LINE>boolean haveModtime = testBit(options, AO_HAVE_FILE_MODTIME);<NEW_LINE>boolean haveOptions = testBit(options, AO_HAVE_FILE_OPTIONS);<NEW_LINE>if (!haveOptions) {<NEW_LINE>for (File file : pkg.files) {<NEW_LINE>if (file.isClassStub()) {<NEW_LINE>haveOptions = true;<NEW_LINE>options |= AO_HAVE_FILE_OPTIONS;<NEW_LINE>archiveOptions = options;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (haveSizeHi || haveModtime || haveOptions || !pkg.files.isEmpty()) {<NEW_LINE>options |= AO_HAVE_FILE_HEADERS;<NEW_LINE>archiveOptions = options;<NEW_LINE>}<NEW_LINE>for (File file : pkg.files) {<NEW_LINE>file_name.putRef(file.name);<NEW_LINE>long len = file.getFileLength();<NEW_LINE>file_size_lo.putInt((int) len);<NEW_LINE>if (haveSizeHi)<NEW_LINE>file_size_hi.putInt((int) <MASK><NEW_LINE>if (haveModtime)<NEW_LINE>file_modtime.putInt(file.modtime - pkg.default_modtime);<NEW_LINE>if (haveOptions)<NEW_LINE>file_options.putInt(file.options);<NEW_LINE>file.writeTo(file_bits.collectorStream());<NEW_LINE>if (verbose > 1)<NEW_LINE>Utils.log.fine("Wrote " + len + " bytes of " + file.name.stringValue());<NEW_LINE>}<NEW_LINE>if (verbose > 0)<NEW_LINE>Utils.log.info("Wrote " + numFiles + " resource files");<NEW_LINE>}
(len >>> 32));
1,609,565
private void contribute(Map<String, Object> details, Dependency dependency) {<NEW_LINE>if (!ObjectUtils.isEmpty(dependency.getMappings())) {<NEW_LINE>Map<String, VersionRange> dep = new LinkedHashMap<>();<NEW_LINE>dependency.getMappings().forEach((it) -> {<NEW_LINE>if (it.getRange() != null && it.getVersion() != null) {<NEW_LINE>dep.put(it.getVersion(), it.getRange());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (!dep.isEmpty()) {<NEW_LINE>if (dependency.getRange() == null) {<NEW_LINE>boolean openRange = dep.values().stream().anyMatch((v) -> v.getHigherVersion() == null);<NEW_LINE>if (!openRange) {<NEW_LINE>Version higher = getHigher(dep);<NEW_LINE>dep.put("managed", new VersionRange(higher));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, Object> depInfo = new LinkedHashMap<>();<NEW_LINE>dep.forEach((k, r) -> depInfo.put<MASK><NEW_LINE>details.put(dependency.getId(), depInfo);<NEW_LINE>}<NEW_LINE>} else if (dependency.getVersion() != null && dependency.getRange() != null) {<NEW_LINE>Map<String, Object> dep = new LinkedHashMap<>();<NEW_LINE>String requirement = "Spring Boot " + dependency.getRange();<NEW_LINE>dep.put(dependency.getVersion(), requirement);<NEW_LINE>details.put(dependency.getId(), dep);<NEW_LINE>}<NEW_LINE>}
(k, "Spring Boot " + r));
1,195,623
public void readFully(long pos, ByteBuffer buffer) {<NEW_LINE>checkOpen();<NEW_LINE>if (pos < 0 || pos > size) {<NEW_LINE>throw new IAE("pos %d out of range [%d, %d]", pos, 0, size);<NEW_LINE>}<NEW_LINE>int ourBufferIndex = Ints.checkedCast(pos / BUFFER_SIZE);<NEW_LINE>int ourBufferOffset = Ints.checkedCast(pos % BUFFER_SIZE);<NEW_LINE>for (int bytesLeft = buffer.remaining(); bytesLeft > 0; ) {<NEW_LINE>int bytesToWrite = Math.min(BUFFER_SIZE - ourBufferOffset, bytesLeft);<NEW_LINE>ByteBuffer <MASK><NEW_LINE>int ourBufferPosition = ourBuffer.position();<NEW_LINE>if (bytesToWrite > ourBufferPosition - ourBufferOffset) {<NEW_LINE>throw new BufferUnderflowException();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ourBuffer.position(ourBufferOffset);<NEW_LINE>ourBuffer.limit(ourBufferOffset + bytesToWrite);<NEW_LINE>buffer.put(ourBuffer);<NEW_LINE>} finally {<NEW_LINE>// switch back to the initial state<NEW_LINE>ourBuffer.limit(ourBuffer.capacity());<NEW_LINE>ourBuffer.position(ourBufferPosition);<NEW_LINE>}<NEW_LINE>ourBufferIndex++;<NEW_LINE>ourBufferOffset = 0;<NEW_LINE>bytesLeft -= bytesToWrite;<NEW_LINE>}<NEW_LINE>}
ourBuffer = buffers.get(ourBufferIndex);
429,710
private static int[][] unpackFromString(int size1, int size2, String st) {<NEW_LINE>int colonIndex = -1;<NEW_LINE>String lengthString;<NEW_LINE>int sequenceLength = 0;<NEW_LINE>int sequenceInteger = 0;<NEW_LINE>int commaIndex;<NEW_LINE>String workString;<NEW_LINE>int[][] res = new int[size1][size2];<NEW_LINE>for (int i = 0; i < size1; i++) {<NEW_LINE>for (int j = 0; j < size2; j++) {<NEW_LINE>if (sequenceLength != 0) {<NEW_LINE>res[i][j] = sequenceInteger;<NEW_LINE>sequenceLength--;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>commaIndex = st.indexOf(',');<NEW_LINE>workString = (commaIndex == -1) ? st : st.substring(0, commaIndex);<NEW_LINE>st = st.substring(commaIndex + 1);<NEW_LINE>colonIndex = workString.indexOf(':');<NEW_LINE>if (colonIndex == -1) {<NEW_LINE>res[i][j<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>lengthString = workString.substring(colonIndex + 1);<NEW_LINE>sequenceLength = Integer.parseInt(lengthString);<NEW_LINE>workString = workString.substring(0, colonIndex);<NEW_LINE>sequenceInteger = Integer.parseInt(workString);<NEW_LINE>res[i][j] = sequenceInteger;<NEW_LINE>sequenceLength--;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
] = Integer.parseInt(workString);
204,450
public static void main(String[] args) {<NEW_LINE>Locale.setDefault(Locale.ENGLISH);<NEW_LINE><MASK><NEW_LINE>System.setProperty(FlatSystemProperties.UI_SCALE, "1x");<NEW_LINE>File dir = new File("dumps/uidefaults");<NEW_LINE>dump(FlatLightLaf.class.getName(), dir, false);<NEW_LINE>dump(FlatDarkLaf.class.getName(), dir, false);<NEW_LINE>if (SystemInfo.isWindows) {<NEW_LINE>dump(FlatIntelliJLaf.class.getName(), dir, false);<NEW_LINE>dump(FlatDarculaLaf.class.getName(), dir, false);<NEW_LINE>}<NEW_LINE>dump(FlatTestLaf.class.getName(), dir, false);<NEW_LINE>// dump( MyBasicLookAndFeel.class.getName(), dir, false );<NEW_LINE>// dump( MetalLookAndFeel.class.getName(), dir, false );<NEW_LINE>// dump( NimbusLookAndFeel.class.getName(), dir, false );<NEW_LINE>//<NEW_LINE>// if( SystemInfo.isWindows )<NEW_LINE>// dump( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel", dir, false );<NEW_LINE>// else if( SystemInfo.isMacOS )<NEW_LINE>// dump( "com.apple.laf.AquaLookAndFeel", dir, false );<NEW_LINE>// else if( SystemInfo.isLinux )<NEW_LINE>// dump( "com.sun.java.swing.plaf.gtk.GTKLookAndFeel", dir, false );<NEW_LINE>//<NEW_LINE>// dump( "com.jgoodies.looks.plastic.PlasticLookAndFeel", dir, false );<NEW_LINE>// dump( "com.jgoodies.looks.windows.WindowsLookAndFeel", dir, false );<NEW_LINE>// dump( "com.alee.laf.WebLookAndFeel", dir, false );<NEW_LINE>// try {<NEW_LINE>// EventQueue.invokeAndWait( () -> {<NEW_LINE>// dump( "org.pushingpixels.substance.api.skin.SubstanceGraphiteAquaLookAndFeel", dir, false );<NEW_LINE>// } );<NEW_LINE>// } catch( Exception ex ) {<NEW_LINE>// // TODO Auto-generated catch block<NEW_LINE>// ex.printStackTrace();<NEW_LINE>// }<NEW_LINE>// dumpIntelliJThemes( dir );<NEW_LINE>// JIDE<NEW_LINE>// dump( FlatLightLaf.class.getName(), dir, true );<NEW_LINE>// dump( FlatDarkLaf.class.getName(), dir, true );<NEW_LINE>// dump( MyBasicLookAndFeel.class.getName(), dir, true );<NEW_LINE>// dump( MetalLookAndFeel.class.getName(), dir, true );<NEW_LINE>// if( SystemInfo.isWindows )<NEW_LINE>// dump( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel", dir, true );<NEW_LINE>// dump UI keys<NEW_LINE>UIDefaultsKeysDump.main(new String[0]);<NEW_LINE>}
System.setProperty("sun.java2d.uiScale", "1x");
1,081,612
public Map<String, Object> invoke() {<NEW_LINE>Map<String, Object> details = new HashMap<>();<NEW_LINE>try {<NEW_LINE>if (userSessionData.getValue("idor-authenticated-as").equals("tom")) {<NEW_LINE>// going to use session auth to view this one<NEW_LINE>String authUserId = (String) userSessionData.getValue("idor-authenticated-user-id");<NEW_LINE>UserProfile userProfile = new UserProfile(authUserId);<NEW_LINE>details.put("userId", userProfile.getUserId());<NEW_LINE>details.put("name", userProfile.getName());<NEW_LINE>details.put("color", userProfile.getColor());<NEW_LINE>details.put("size", userProfile.getSize());<NEW_LINE>details.put(<MASK><NEW_LINE>} else {<NEW_LINE>details.put("error", "You do not have privileges to view the profile. Authenticate as tom first please.");<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>log.error("something went wrong", ex.getMessage());<NEW_LINE>}<NEW_LINE>return details;<NEW_LINE>}
"role", userProfile.getRole());
1,478,528
protected Promise<List<T>> run(final Context context) throws Exception {<NEW_LINE>if (_tasks.length == 0) {<NEW_LINE>return Promises.value(Collections.emptyList());<NEW_LINE>}<NEW_LINE>final SettablePromise<List<T>> result = Promises.settable();<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final PromiseListener<?> listener = resolvedPromise -> {<NEW_LINE>boolean allEarlyFinish = true;<NEW_LINE>final List<T> taskResult = new ArrayList<T>(_tasks.length);<NEW_LINE>List<Throwable> errors = null;<NEW_LINE>for (Task<?> task : _tasks) {<NEW_LINE>if (task.isFailed()) {<NEW_LINE>if (allEarlyFinish && ResultType.fromTask(task) != ResultType.EARLY_FINISH) {<NEW_LINE>allEarlyFinish = false;<NEW_LINE>}<NEW_LINE>if (errors == null) {<NEW_LINE>errors = new ArrayList<Throwable>();<NEW_LINE>}<NEW_LINE>errors.add(task.getError());<NEW_LINE>} else {<NEW_LINE>taskResult.add((<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (errors != null) {<NEW_LINE>result.fail(allEarlyFinish ? errors.get(0) : new MultiException("Multiple errors in 'ParTask' task.", errors));<NEW_LINE>} else {<NEW_LINE>result.done(taskResult);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>InternalUtil.after(listener, _tasks);<NEW_LINE>for (Task<?> task : _tasks) {<NEW_LINE>context.run(task);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
T) task.get());
1,102,778
private void importIntoTrieLog(final TrieLogLayer layer, final Hash blockHash) {<NEW_LINE>layer.setBlockHash(blockHash);<NEW_LINE>for (final Map.Entry<Address, BonsaiValue<BonsaiAccount>> updatedAccount : accountsToUpdate.entrySet()) {<NEW_LINE>final BonsaiValue<BonsaiAccount> bonsaiValue = updatedAccount.getValue();<NEW_LINE>final BonsaiAccount oldValue = bonsaiValue.getPrior();<NEW_LINE>final StateTrieAccountValue oldAccount = oldValue == null ? null : new StateTrieAccountValue(oldValue.getNonce(), oldValue.getBalance(), oldValue.getStorageRoot(), oldValue.getCodeHash());<NEW_LINE>final <MASK><NEW_LINE>final StateTrieAccountValue newAccount = newValue == null ? null : new StateTrieAccountValue(newValue.getNonce(), newValue.getBalance(), newValue.getStorageRoot(), newValue.getCodeHash());<NEW_LINE>layer.addAccountChange(updatedAccount.getKey(), oldAccount, newAccount);<NEW_LINE>}<NEW_LINE>for (final Map.Entry<Address, BonsaiValue<Bytes>> updatedCode : codeToUpdate.entrySet()) {<NEW_LINE>layer.addCodeChange(updatedCode.getKey(), updatedCode.getValue().getPrior(), updatedCode.getValue().getUpdated(), blockHash);<NEW_LINE>}<NEW_LINE>for (final Map.Entry<Address, Map<Hash, BonsaiValue<UInt256>>> updatesStorage : storageToUpdate.entrySet()) {<NEW_LINE>final Address address = updatesStorage.getKey();<NEW_LINE>for (final Map.Entry<Hash, BonsaiValue<UInt256>> slotUpdate : updatesStorage.getValue().entrySet()) {<NEW_LINE>layer.addStorageChange(address, slotUpdate.getKey(), slotUpdate.getValue().getPrior(), slotUpdate.getValue().getUpdated());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
BonsaiAccount newValue = bonsaiValue.getUpdated();
1,610,382
public static FileObject createJaxWsFileObject(final Project project) throws IOException {<NEW_LINE>try {<NEW_LINE>return ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<FileObject>() {<NEW_LINE><NEW_LINE>public FileObject run() throws IOException {<NEW_LINE>retrieveJaxWsFromResource(project.getProjectDirectory());<NEW_LINE>FileObject jaxWsFo = findJaxWsFileObject(project);<NEW_LINE>// NOI18N<NEW_LINE>assert jaxWsFo != null : "Cannot find jax-ws.xml in project's nbproject directory";<NEW_LINE>if (jaxWsFo != null) {<NEW_LINE>JaxWsModel jaxWsModel = project.getLookup().lookup(JaxWsModel.class);<NEW_LINE>if (jaxWsModel != null)<NEW_LINE>jaxWsModel.setJaxWsFile(jaxWsFo);<NEW_LINE>}<NEW_LINE>return jaxWsFo;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (MutexException e) {<NEW_LINE>throw <MASK><NEW_LINE>}<NEW_LINE>}
(IOException) e.getException();
207,005
public ConsumeQueue findConsumeQueue(String topic, int queueId) {<NEW_LINE>ConcurrentMap<Integer, ConsumeQueue> map = consumeQueueTable.get(topic);<NEW_LINE>if (null == map) {<NEW_LINE>ConcurrentMap<Integer, ConsumeQueue> newMap = new ConcurrentHashMap<Integer, ConsumeQueue>(128);<NEW_LINE>ConcurrentMap<Integer, ConsumeQueue> oldMap = <MASK><NEW_LINE>if (oldMap != null) {<NEW_LINE>map = oldMap;<NEW_LINE>} else {<NEW_LINE>map = newMap;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ConsumeQueue logic = map.get(queueId);<NEW_LINE>if (null == logic) {<NEW_LINE>ConsumeQueue newLogic = new ConsumeQueue(topic, queueId, StorePathConfigHelper.getStorePathConsumeQueue(this.messageStoreConfig.getStorePathRootDir()), this.getMessageStoreConfig().getMappedFileSizeConsumeQueue(), this);<NEW_LINE>ConsumeQueue oldLogic = map.putIfAbsent(queueId, newLogic);<NEW_LINE>if (oldLogic != null) {<NEW_LINE>logic = oldLogic;<NEW_LINE>} else {<NEW_LINE>if (MixAll.isLmq(topic)) {<NEW_LINE>lmqConsumeQueueNum.getAndIncrement();<NEW_LINE>}<NEW_LINE>logic = newLogic;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return logic;<NEW_LINE>}
consumeQueueTable.putIfAbsent(topic, newMap);
1,804,354
private int deducePropertyCategory(Exp memberExp, Exp propertyNameExp) {<NEW_LINE>if (!(propertyNameExp instanceof Literal)) {<NEW_LINE>return Category.Value;<NEW_LINE>}<NEW_LINE>String propertyName = (String) ((Literal) propertyNameExp).getValue();<NEW_LINE>Hierarchy hierarchy = memberExp.getType().getHierarchy();<NEW_LINE>if (hierarchy == null) {<NEW_LINE>return Category.Value;<NEW_LINE>}<NEW_LINE>Level[] levels = hierarchy.getLevels();<NEW_LINE>Property property = lookupProperty(levels[levels.length - 1], propertyName);<NEW_LINE>if (property == null) {<NEW_LINE>// we'll likely get a runtime error<NEW_LINE>return Category.Value;<NEW_LINE>} else {<NEW_LINE>switch(property.getType()) {<NEW_LINE>case TYPE_BOOLEAN:<NEW_LINE>return Category.Logical;<NEW_LINE>case TYPE_NUMERIC:<NEW_LINE>case TYPE_INTEGER:<NEW_LINE>case TYPE_LONG:<NEW_LINE>return Category.Numeric;<NEW_LINE>case TYPE_STRING:<NEW_LINE>return Category.String;<NEW_LINE>case TYPE_DATE:<NEW_LINE>case TYPE_TIME:<NEW_LINE>case TYPE_TIMESTAMP:<NEW_LINE>return Category.DateTime;<NEW_LINE>default:<NEW_LINE>throw Util.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
badValue(property.getType());
264,993
private void handleCryptoOperationSuccess(MimeBodyPart outputPart) {<NEW_LINE>OpenPgpDecryptionResult decryptionResult = currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_DECRYPTION);<NEW_LINE>OpenPgpSignatureResult signatureResult = currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_SIGNATURE);<NEW_LINE>if (decryptionResult.getResult() == OpenPgpDecryptionResult.RESULT_ENCRYPTED) {<NEW_LINE>parseAutocryptGossipHeadersFromDecryptedPart(outputPart);<NEW_LINE>}<NEW_LINE>PendingIntent pendingIntent = currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_INTENT);<NEW_LINE>PendingIntent insecureWarningPendingIntent = currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_INSECURE_DETAIL_INTENT);<NEW_LINE>boolean overrideCryptoWarning = currentCryptoResult.getBooleanExtra(OpenPgpApi.RESULT_OVERRIDE_CRYPTO_WARNING, false);<NEW_LINE>CryptoResultAnnotation resultAnnotation = CryptoResultAnnotation.createOpenPgpResultAnnotation(decryptionResult, signatureResult, <MASK><NEW_LINE>onCryptoOperationSuccess(resultAnnotation);<NEW_LINE>}
pendingIntent, insecureWarningPendingIntent, outputPart, overrideCryptoWarning);
1,544,213
public Object visitInheritDoc(IType currentType, ITypeHierarchy typeHierarchy) throws JavaModelException {<NEW_LINE>ArrayList<IType> visited = new ArrayList<>();<NEW_LINE>visited.add(currentType);<NEW_LINE>Object result = visitInheritDocInterfaces(visited, currentType, typeHierarchy);<NEW_LINE>if (result != InheritDocVisitor.CONTINUE) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>IType superClass;<NEW_LINE>if (currentType.isInterface()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>superClass = currentType.getJavaProject().findType("java.lang.Object");<NEW_LINE>} else {<NEW_LINE>superClass = typeHierarchy.getSuperclass(currentType);<NEW_LINE>}<NEW_LINE>while (superClass != null && !visited.contains(superClass)) {<NEW_LINE>result = visit(superClass);<NEW_LINE>if (result == InheritDocVisitor.STOP_BRANCH) {<NEW_LINE>return null;<NEW_LINE>} else if (result == InheritDocVisitor.CONTINUE) {<NEW_LINE>visited.add(superClass);<NEW_LINE>result = <MASK><NEW_LINE>if (result != InheritDocVisitor.CONTINUE) {<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>superClass = typeHierarchy.getSuperclass(superClass);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
visitInheritDocInterfaces(visited, superClass, typeHierarchy);
1,839,598
protected <T> HttpResponse<T> validateFile(String executionId, URI path, String redirect) {<NEW_LINE>Optional<Execution> execution = executionRepository.findById(executionId);<NEW_LINE>if (execution.isEmpty()) {<NEW_LINE>throw new NoSuchElementException("Unable to find execution id '" + executionId + "'");<NEW_LINE>}<NEW_LINE>Optional<Flow> flow = flowRepository.findById(execution.get().getNamespace(), execution.get().getFlowId());<NEW_LINE>if (flow.isEmpty()) {<NEW_LINE>throw new NoSuchElementException("Unable to find flow id '" + executionId + "'");<NEW_LINE>}<NEW_LINE>String prefix = storageInterface.executionPrefix(flow.get(<MASK><NEW_LINE>if (path.getPath().substring(1).startsWith(prefix)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// maybe state<NEW_LINE>prefix = storageInterface.statePrefix(flow.get().getNamespace(), flow.get().getId(), null, null);<NEW_LINE>if (path.getPath().substring(1).startsWith(prefix)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// maybe redirect to correct execution<NEW_LINE>Optional<String> redirectedExecution = storageInterface.extractExecutionId(path);<NEW_LINE>if (redirectedExecution.isPresent()) {<NEW_LINE>return HttpResponse.redirect(URI.create((basePath != null ? basePath : "") + redirect.replace("{executionId}", redirectedExecution.get())));<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("Invalid prefix path");<NEW_LINE>}
), execution.get());
493,725
public void run(RegressionEnvironment env) {<NEW_LINE>EPStage stageA = env.stageService().getStage("ST");<NEW_LINE>tryIllegalArgument(() <MASK><NEW_LINE>tryOp(() -> stageA.stage(Collections.emptyList()));<NEW_LINE>tryIllegalArgument(() -> stageA.stage(Arrays.asList(new String[] { null })));<NEW_LINE>tryIllegalArgument(() -> stageA.stage(Arrays.asList(new String[] { "a", null })));<NEW_LINE>tryIllegalArgument(() -> stageA.unstage(null));<NEW_LINE>tryOp(() -> stageA.unstage(Collections.emptyList()));<NEW_LINE>tryIllegalArgument(() -> stageA.unstage(Arrays.asList(new String[] { null })));<NEW_LINE>tryIllegalArgument(() -> stageA.unstage(Arrays.asList(new String[] { "a", null })));<NEW_LINE>tryDeploymentNotFound(() -> stageA.stage(Arrays.asList(new String[] { "x" })), "Deployment 'x' was not found");<NEW_LINE>tryDeploymentNotFound(() -> stageA.unstage(Arrays.asList(new String[] { "x" })), "Deployment 'x' was not found");<NEW_LINE>}
-> stageA.stage(null));
215,772
public static Bech32Data decode(final String str) throws AddressFormatException {<NEW_LINE>boolean lower = false, upper = false;<NEW_LINE>if (str.length() < 8)<NEW_LINE>throw new AddressFormatException.InvalidDataLength("Input too short: " + str.length());<NEW_LINE>if (str.length() > 90)<NEW_LINE>throw new AddressFormatException.InvalidDataLength("Input too long: " + str.length());<NEW_LINE>for (int i = 0; i < str.length(); ++i) {<NEW_LINE>char c = str.charAt(i);<NEW_LINE>if (c < 33 || c > 126)<NEW_LINE>throw new AddressFormatException.InvalidCharacter(c, i);<NEW_LINE>if (c >= 'a' && c <= 'z') {<NEW_LINE>if (upper)<NEW_LINE>throw new AddressFormatException.InvalidCharacter(c, i);<NEW_LINE>lower = true;<NEW_LINE>}<NEW_LINE>if (c >= 'A' && c <= 'Z') {<NEW_LINE>if (lower)<NEW_LINE>throw new AddressFormatException.InvalidCharacter(c, i);<NEW_LINE>upper = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int pos = str.lastIndexOf('1');<NEW_LINE>if (pos < 1)<NEW_LINE>throw new AddressFormatException.InvalidPrefix("Missing human-readable part");<NEW_LINE>final int dataPartLength = str.length() - 1 - pos;<NEW_LINE>if (dataPartLength < 6)<NEW_LINE>throw new AddressFormatException.InvalidDataLength("Data part too short: " + dataPartLength);<NEW_LINE>byte[] values = new byte[dataPartLength];<NEW_LINE>for (int i = 0; i < dataPartLength; ++i) {<NEW_LINE>char c = str.charAt(i + pos + 1);<NEW_LINE>if (CHARSET_REV[c] == -1)<NEW_LINE>throw new AddressFormatException.InvalidCharacter(<MASK><NEW_LINE>values[i] = CHARSET_REV[c];<NEW_LINE>}<NEW_LINE>String hrp = str.substring(0, pos).toLowerCase(Locale.ROOT);<NEW_LINE>Encoding encoding = verifyChecksum(hrp, values);<NEW_LINE>if (encoding == null)<NEW_LINE>throw new AddressFormatException.InvalidChecksum();<NEW_LINE>return new Bech32Data(encoding, hrp, Arrays.copyOfRange(values, 0, values.length - 6));<NEW_LINE>}
c, i + pos + 1);
457,683
public List<ValidateError> validate() {<NEW_LINE>List<ValidateError> errors = new ArrayList<>();<NEW_LINE>Validator validator;<NEW_LINE>ValidateError error;<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.stockName, convLabelName("Stock Name"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(this.stockName, convLabelName("Stock Name"), 256);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.stockType, convLabelName("Stock Type"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.stockType, convLabelName("Stock Type"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = <MASK><NEW_LINE>error = validator.validate(this.description, convLabelName("Description"), 1024);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.insertUser, convLabelName("Insert User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.updateUser, convLabelName("Update User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.deleteFlag, convLabelName("Delete Flag"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>}
ValidatorFactory.getInstance(Validator.MAX_LENGTH);
623,145
public static boolean isDatabaseOK(Properties ctx) {<NEW_LINE>// Validate UUID supported<NEW_LINE>DB.validateSupportedUUIDFromDB();<NEW_LINE>// Check Version<NEW_LINE>String version = "?";<NEW_LINE>String sql = "SELECT Version FROM AD_System";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = prepareStatement(sql, null);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next())<NEW_LINE>version = rs.getString(1);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, "Problem with AD_System Table - Run system.sql script - " + e.toString());<NEW_LINE>return false;<NEW_LINE>} finally {<NEW_LINE>close(rs);<NEW_LINE>close(pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>log.info("DB_Version=" + version);<NEW_LINE>// Identical DB version<NEW_LINE>if (Adempiere.DB_VERSION.equals(version))<NEW_LINE>return true;<NEW_LINE>String AD_Message = "DatabaseVersionError";<NEW_LINE>String title = org.compiere.Adempiere.getName() + " " + Msg.getMsg(ctx, AD_Message, true);<NEW_LINE>// Code assumes Database version {0}, but Database has Version {1}.<NEW_LINE>// complete message<NEW_LINE>String msg = Msg.getMsg(ctx, AD_Message);<NEW_LINE>msg = MessageFormat.format(msg, new Object[] <MASK><NEW_LINE>Object[] options = { "Migrate" };<NEW_LINE>JOptionPane.showOptionDialog(null, msg, title, JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon"), options, options[0]);<NEW_LINE>JOptionPane.showMessageDialog(null, "Start RUN_Migrate (in utils)\nSee: http://wiki.adempiere.net/maintain", title, JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>Env.exitEnv(1);<NEW_LINE>return false;<NEW_LINE>}
{ Adempiere.DB_VERSION, version });
62,645
Packet toNormalResponsePacket(long callId, int backupAcks, boolean urgent, Object value) {<NEW_LINE>byte[] bytes;<NEW_LINE>boolean isData = value instanceof Data;<NEW_LINE>if (isData) {<NEW_LINE>Data data = (Data) value;<NEW_LINE>int dataLengthInBytes = data.totalSize();<NEW_LINE>bytes = new byte[OFFSET_DATA_PAYLOAD + dataLengthInBytes];<NEW_LINE>writeInt(bytes, OFFSET_DATA_LENGTH, dataLengthInBytes, useBigEndian);<NEW_LINE>// this is a crucial part. If data is NativeMemoryData, instead of calling Data.toByteArray which causes a<NEW_LINE>// byte-array to be created and a intermediate copy of the data, we immediately copy the NativeMemoryData<NEW_LINE>// into the bytes for the packet.<NEW_LINE>data.copyTo(bytes, OFFSET_DATA_PAYLOAD);<NEW_LINE>} else if (value == null) {<NEW_LINE>// since there are many 'null' responses we optimize this case as well.<NEW_LINE>bytes = new byte[OFFSET_NOT_DATA + INT_SIZE_IN_BYTES];<NEW_LINE>writeInt(bytes, OFFSET_NOT_DATA, CONSTANT_TYPE_NULL, useBigEndian);<NEW_LINE>} else {<NEW_LINE>// for regular object we currently can't guess how big the bytes will be; so we just hand it<NEW_LINE>// over to the serializationService to deal with it. The negative part is that this does lead to<NEW_LINE>// an intermediate copy of the data.<NEW_LINE>bytes = serializationService.<MASK><NEW_LINE>}<NEW_LINE>writeResponsePrologueBytes(bytes, NORMAL_RESPONSE, callId, urgent);<NEW_LINE>// backup-acks (will fit in a byte)<NEW_LINE>bytes[OFFSET_BACKUP_ACKS] = (byte) backupAcks;<NEW_LINE>// isData<NEW_LINE>bytes[OFFSET_IS_DATA] = (byte) (isData ? 1 : 0);<NEW_LINE>// the remaining part of the byte array is already filled, so we are done.<NEW_LINE>return newResponsePacket(bytes, urgent);<NEW_LINE>}
toBytes(value, OFFSET_NOT_DATA, false);
1,591,122
public void perform(final TimerEvent event) {<NEW_LINE>if (shell.isDisposed()) {<NEW_LINE>event.cancel();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Utils.execSWTThread(new AERunnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void runSupport() {<NEW_LINE>if (shell.isDisposed()) {<NEW_LINE>event.cancel();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean isOver = shell.getBounds().contains(shell.<MASK><NEW_LINE>if (isOver != wasOver) {<NEW_LINE>wasOver = isOver;<NEW_LINE>if (isOver) {<NEW_LINE>lblCloseIn.setData("DelayPaused", "");<NEW_LINE>lEnterOn = SystemTime.getCurrentTime();<NEW_LINE>lblCloseIn.setText("");<NEW_LINE>} else {<NEW_LINE>lblCloseIn.setData("DelayPaused", null);<NEW_LINE>if (lEnterOn > 0) {<NEW_LINE>long diff = SystemTime.getCurrentTime() - lEnterOn;<NEW_LINE>long endOn = ((Long) lblCloseIn.getData("CloseOn")).longValue() + diff;<NEW_LINE>lblCloseIn.setData("CloseOn", new Long(endOn));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
getDisplay().getCursorLocation());
987,734
public static DescribeNASFileSystemsResponse unmarshall(DescribeNASFileSystemsResponse describeNASFileSystemsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeNASFileSystemsResponse.setRequestId(_ctx.stringValue("DescribeNASFileSystemsResponse.RequestId"));<NEW_LINE>describeNASFileSystemsResponse.setNextToken(_ctx.stringValue("DescribeNASFileSystemsResponse.NextToken"));<NEW_LINE>List<FileSystem> fileSystems = new ArrayList<FileSystem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeNASFileSystemsResponse.FileSystems.Length"); i++) {<NEW_LINE>FileSystem fileSystem = new FileSystem();<NEW_LINE>fileSystem.setCapacity(_ctx.longValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].Capacity"));<NEW_LINE>fileSystem.setMountTargetStatus(_ctx.stringValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].MountTargetStatus"));<NEW_LINE>fileSystem.setCreateTime(_ctx.stringValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].CreateTime"));<NEW_LINE>fileSystem.setOfficeSiteId(_ctx.stringValue<MASK><NEW_LINE>fileSystem.setSupportAcl(_ctx.booleanValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].SupportAcl"));<NEW_LINE>fileSystem.setStorageType(_ctx.stringValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].StorageType"));<NEW_LINE>fileSystem.setOfficeSiteName(_ctx.stringValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].OfficeSiteName"));<NEW_LINE>fileSystem.setRegionId(_ctx.stringValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].RegionId"));<NEW_LINE>fileSystem.setFileSystemId(_ctx.stringValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].FileSystemId"));<NEW_LINE>fileSystem.setFileSystemType(_ctx.stringValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].FileSystemType"));<NEW_LINE>fileSystem.setFileSystemName(_ctx.stringValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].FileSystemName"));<NEW_LINE>fileSystem.setMeteredSize(_ctx.longValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].MeteredSize"));<NEW_LINE>fileSystem.setMountTargetDomain(_ctx.stringValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].MountTargetDomain"));<NEW_LINE>fileSystem.setDescription(_ctx.stringValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].Description"));<NEW_LINE>fileSystem.setZoneId(_ctx.stringValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].ZoneId"));<NEW_LINE>fileSystem.setFileSystemStatus(_ctx.stringValue("DescribeNASFileSystemsResponse.FileSystems[" + i + "].FileSystemStatus"));<NEW_LINE>fileSystems.add(fileSystem);<NEW_LINE>}<NEW_LINE>describeNASFileSystemsResponse.setFileSystems(fileSystems);<NEW_LINE>return describeNASFileSystemsResponse;<NEW_LINE>}
("DescribeNASFileSystemsResponse.FileSystems[" + i + "].OfficeSiteId"));
574,812
public com.amazonaws.services.lookoutforvision.model.ConflictException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.lookoutforvision.model.ConflictException conflictException = new com.amazonaws.services.lookoutforvision.model.ConflictException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ResourceId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>conflictException.setResourceId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ResourceType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>conflictException.setResourceType(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return conflictException;<NEW_LINE>}
class).unmarshall(context));
1,458,838
public static ListFunctionFilesResponse unmarshall(ListFunctionFilesResponse listFunctionFilesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listFunctionFilesResponse.setRequestId(_ctx.stringValue("ListFunctionFilesResponse.RequestId"));<NEW_LINE>FileList fileList = new FileList();<NEW_LINE>Pagination pagination = new Pagination();<NEW_LINE>pagination.setPageIndex(_ctx.integerValue("ListFunctionFilesResponse.FileList.Pagination.PageIndex"));<NEW_LINE>pagination.setPageSize(_ctx.integerValue("ListFunctionFilesResponse.FileList.Pagination.PageSize"));<NEW_LINE>pagination.setTotalCount(_ctx.integerValue("ListFunctionFilesResponse.FileList.Pagination.TotalCount"));<NEW_LINE>pagination.setTotalPageCount(_ctx.integerValue("ListFunctionFilesResponse.FileList.Pagination.TotalPageCount"));<NEW_LINE>fileList.setPagination(pagination);<NEW_LINE>List<File> files = new ArrayList<File>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListFunctionFilesResponse.FileList.Files.Length"); i++) {<NEW_LINE>File file = new File();<NEW_LINE>file.setId(_ctx.longValue<MASK><NEW_LINE>file.setName(_ctx.stringValue("ListFunctionFilesResponse.FileList.Files[" + i + "].Name"));<NEW_LINE>file.setContentId(_ctx.longValue("ListFunctionFilesResponse.FileList.Files[" + i + "].ContentId"));<NEW_LINE>file.setStatus(_ctx.integerValue("ListFunctionFilesResponse.FileList.Files[" + i + "].Status"));<NEW_LINE>file.setGmtCreate(_ctx.longValue("ListFunctionFilesResponse.FileList.Files[" + i + "].GmtCreate"));<NEW_LINE>file.setGmtModified(_ctx.longValue("ListFunctionFilesResponse.FileList.Files[" + i + "].GmtModified"));<NEW_LINE>file.setDescription(_ctx.stringValue("ListFunctionFilesResponse.FileList.Files[" + i + "].Description"));<NEW_LINE>file.setSandboxDeployTime(_ctx.longValue("ListFunctionFilesResponse.FileList.Files[" + i + "].SandboxDeployTime"));<NEW_LINE>file.setProductionDeployTime(_ctx.longValue("ListFunctionFilesResponse.FileList.Files[" + i + "].ProductionDeployTime"));<NEW_LINE>file.setSandboxDeployStatus(_ctx.integerValue("ListFunctionFilesResponse.FileList.Files[" + i + "].SandboxDeployStatus"));<NEW_LINE>file.setProductionDeployStatus(_ctx.integerValue("ListFunctionFilesResponse.FileList.Files[" + i + "].ProductionDeployStatus"));<NEW_LINE>files.add(file);<NEW_LINE>}<NEW_LINE>fileList.setFiles(files);<NEW_LINE>listFunctionFilesResponse.setFileList(fileList);<NEW_LINE>return listFunctionFilesResponse;<NEW_LINE>}
("ListFunctionFilesResponse.FileList.Files[" + i + "].Id"));
1,621,943
private void initLayout() {<NEW_LINE>parent.setLayout(new FillLayout());<NEW_LINE>Composite comp = new Composite(parent, SWT.NONE);<NEW_LINE>tableColumnLayout = new TableColumnLayout();<NEW_LINE>comp.setLayout(tableColumnLayout);<NEW_LINE>viewer = new TableViewer(comp, SWT.FULL_SELECTION | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);<NEW_LINE>createColumns();<NEW_LINE>final Table table = viewer.getTable();<NEW_LINE>table.setHeaderVisible(true);<NEW_LINE>table.setLinesVisible(true);<NEW_LINE>viewer.setContentProvider(new ArrayContentProvider());<NEW_LINE>viewer.setComparator(new TableLabelSorter(viewer));<NEW_LINE>viewer.addDoubleClickListener(new IDoubleClickListener() {<NEW_LINE><NEW_LINE>public void doubleClick(DoubleClickEvent e) {<NEW_LINE>StructuredSelection sel = (StructuredSelection) viewer.getSelection();<NEW_LINE>Object o = sel.getFirstElement();<NEW_LINE>if (o instanceof XLogPack) {<NEW_LINE>XLogPack data = (XLogPack) o;<NEW_LINE>XLogData d = new XLogData(data, serverId);<NEW_LINE>d.objName = TextProxy.object.getLoadText(<MASK><NEW_LINE>d.serviceName = TextProxy.service.getLoadText(yyyymmdd, data.service, serverId);<NEW_LINE>new OpenXLogProfileJob(ServiceTableComposite.this.getDisplay(), d, serverId).schedule();<NEW_LINE>} else {<NEW_LINE>System.out.println(o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
yyyymmdd, data.objHash, serverId);
1,679,737
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>// Inflate the layout for this fragment<NEW_LINE>View view = inflater.inflate(R.layout.fragment_arp_replay_dialog, container, false);<NEW_LINE>getDialog().setTitle("ARP Replay Attack");<NEW_LINE>btnArpStart = (Button) view.findViewById(R.id.btn_start_arpreplay);<NEW_LINE>spinnerStations = (Spinner) view.findViewById(R.id.spinner_arpreplay_stations);<NEW_LINE>// btnSelectArpFile = (Button) view.findViewById(R.id.btn_arpreplay_arp_file);<NEW_LINE>// cbUseArpFile = (CheckBox) view.findViewById(R.id.cb_arpreplay_use_arp_file);<NEW_LINE>ArrayList<String> stations = new ArrayList<String>();<NEW_LINE>stations.addAll(ap.getStations().keySet());<NEW_LINE>stationsAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_item, stations);<NEW_LINE>stationsAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);<NEW_LINE>spinnerStations.setAdapter(stationsAdapter);<NEW_LINE>btnArpStart.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>try {<NEW_LINE>String station = ((String) spinnerStations.getSelectedItem()).trim();<NEW_LINE>attack = new ArpReplayAttack(ap, station, false, "", false);<NEW_LINE>String ob = new Gson().toJson(attack);<NEW_LINE>Intent intent = new Intent("de.tu_darmstadt.seemoo.nexmon.ATTACK_SERVICE");<NEW_LINE><MASK><NEW_LINE>intent.putExtra("ATTACK_TYPE", Attack.ATTACK_ARP_REPLAY);<NEW_LINE>MyApplication.getAppContext().sendBroadcast(intent);<NEW_LINE>dismiss();<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return view;<NEW_LINE>}
intent.putExtra("ATTACK", ob);
1,237,330
public com.amazonaws.services.waf.model.WAFInternalErrorException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.waf.model.WAFInternalErrorException wAFInternalErrorException = new com.amazonaws.services.waf.model.WAFInternalErrorException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return wAFInternalErrorException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,201,440
public byte[] decodeMessage() {<NEW_LINE>byte[] data = new byte[12];<NEW_LINE>data[0] = 0x0B;<NEW_LINE>data[1] = LIGHTING2.toByte();<NEW_LINE>data[<MASK><NEW_LINE>data[3] = seqNbr;<NEW_LINE>data[4] = (byte) ((sensorId >> 24) & 0xFF);<NEW_LINE>data[5] = (byte) ((sensorId >> 16) & 0xFF);<NEW_LINE>data[6] = (byte) ((sensorId >> 8) & 0xFF);<NEW_LINE>data[7] = (byte) (sensorId & 0xFF);<NEW_LINE>data[8] = unitcode;<NEW_LINE>data[9] = command.toByte();<NEW_LINE>data[10] = dimmingLevel;<NEW_LINE>data[11] = (byte) ((signalLevel & 0x0F) << 4);<NEW_LINE>return data;<NEW_LINE>}
2] = subType.toByte();
1,562,276
protected Control createCustomArea(Composite parent) {<NEW_LINE>loadable = new LoadablePanel<Text>(parent, widgets, panel -> new Text(panel, SWT.MULTI | SWT.READ_ONLY | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL));<NEW_LINE>loadable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));<NEW_LINE>loadable.startLoading();<NEW_LINE>Rpc.listen(text, new UiErrorCallback<String, String, String>(parent, LOG) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected ResultOrError<String, String> onRpcThread(Rpc.Result<String> result) {<NEW_LINE>try {<NEW_LINE>return success(result.get());<NEW_LINE>} catch (RpcException e) {<NEW_LINE>return <MASK><NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>return error(e.getCause().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onUiThreadSuccess(String result) {<NEW_LINE>loadable.getContents().setText(result);<NEW_LINE>loadable.stopLoading();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onUiThreadError(String error) {<NEW_LINE>loadable.showMessage(MessageType.Error, error);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return loadable;<NEW_LINE>}
error(e.getMessage());
1,692,891
@RequestMapping(value = "/persistent/{rpcId}", method = RequestMethod.DELETE)<NEW_LINE>@ResponseBody<NEW_LINE>public void deleteRpc(@ApiParam(value = RPC_ID_PARAM_DESCRIPTION, required = true) @PathVariable(RPC_ID) String strRpc) throws ThingsboardException {<NEW_LINE>checkParameter("RpcId", strRpc);<NEW_LINE>try {<NEW_LINE>RpcId rpcId = new RpcId(UUID.fromString(strRpc));<NEW_LINE>Rpc rpc = checkRpcId(rpcId, Operation.DELETE);<NEW_LINE>if (rpc != null) {<NEW_LINE>if (rpc.getStatus().equals(RpcStatus.QUEUED)) {<NEW_LINE>RemoveRpcActorMsg removeMsg = new RemoveRpcActorMsg(getTenantId(), rpc.getDeviceId(), rpc.getUuidId());<NEW_LINE>log.trace("[{}] Forwarding msg {} to queue actor!", rpc.getDeviceId(), rpc);<NEW_LINE>tbClusterService.pushMsgToCore(removeMsg, null);<NEW_LINE>}<NEW_LINE>rpcService.deleteRpc(getTenantId(), rpcId);<NEW_LINE><MASK><NEW_LINE>TbMsg msg = TbMsg.newMsg(RPC_DELETED, rpc.getDeviceId(), TbMsgMetaData.EMPTY, JacksonUtil.toString(rpc));<NEW_LINE>tbClusterService.pushMsgToRuleEngine(getTenantId(), rpc.getDeviceId(), msg, null);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw handleException(e);<NEW_LINE>}<NEW_LINE>}
rpc.setStatus(RpcStatus.DELETED);
651,317
public void moveChild(String name, int index) throws NotFoundException {<NEW_LINE>lock.acquire();<NEW_LINE>try {<NEW_LINE>checkDeleted();<NEW_LINE>int currentIndex = 0;<NEW_LINE>boolean foundName = false;<NEW_LINE>Group group = null;<NEW_LINE>// TODO: this could be slow and may need monitor<NEW_LINE>List<DBRecord> list = getParentChildRecords();<NEW_LINE>for (int i = 0; i < list.size(); i++) {<NEW_LINE>DBRecord rec = list.get(i);<NEW_LINE>long childID = rec.getLongValue(ParentChildDBAdapter.CHILD_ID_COL);<NEW_LINE>String childName = null;<NEW_LINE>DBRecord childRec = null;<NEW_LINE>if (childID < 0) {<NEW_LINE>childRec <MASK><NEW_LINE>childName = childRec.getString(FragmentDBAdapter.FRAGMENT_NAME_COL);<NEW_LINE>} else {<NEW_LINE>childRec = moduleAdapter.getModuleRecord(childID);<NEW_LINE>childName = childRec.getString(ModuleDBAdapter.MODULE_NAME_COL);<NEW_LINE>}<NEW_LINE>if (childName.equals(name)) {<NEW_LINE>foundName = true;<NEW_LINE>currentIndex = i;<NEW_LINE>if (childID < 0) {<NEW_LINE>group = moduleMgr.getFragmentDB(childRec);<NEW_LINE>} else {<NEW_LINE>group = moduleMgr.getModuleDB(childRec);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!foundName) {<NEW_LINE>throw new NotFoundException(name + " is not a child of " + getName());<NEW_LINE>}<NEW_LINE>DBRecord pcRec = list.remove(currentIndex);<NEW_LINE>list.add(index, pcRec);<NEW_LINE>updateChildOrder(list);<NEW_LINE>moduleMgr.childReordered(this, group);<NEW_LINE>} catch (IOException e) {<NEW_LINE>moduleMgr.dbError(e);<NEW_LINE>} finally {<NEW_LINE>lock.release();<NEW_LINE>}<NEW_LINE>}
= fragmentAdapter.getFragmentRecord(-childID);
1,492,658
private Tree fixNonUnaryRoot(Tree t, TreeFactory tf) {<NEW_LINE>List<Tree> kids = t.getChildrenAsList();<NEW_LINE>if (kids.size() == 2 && t.firstChild().isPhrasal() && tlp.isSentenceFinalPunctuationTag(t.lastChild().value())) {<NEW_LINE>List<Tree> grandKids = t.firstChild().getChildrenAsList();<NEW_LINE>grandKids.add(t.lastChild());<NEW_LINE>t.firstChild().setChildren(grandKids);<NEW_LINE>kids.remove(kids.size() - 1);<NEW_LINE>t.setChildren(kids);<NEW_LINE>t.setValue(tlp.startSymbol());<NEW_LINE>} else {<NEW_LINE>t.setValue(nonUnaryRoot);<NEW_LINE>t = tf.newTreeNode(tlp.startSymbol()<MASK><NEW_LINE>}<NEW_LINE>return t;<NEW_LINE>}
, Collections.singletonList(t));
1,559,743
public void onSaveInstanceState(@NonNull Bundle outState) {<NEW_LINE>super.onSaveInstanceState(outState);<NEW_LINE>outState.putInt(KEY_SELECTED_YEAR, mCalendar.get(Calendar.YEAR));<NEW_LINE>outState.putInt(KEY_SELECTED_MONTH, mCalendar.get(Calendar.MONTH));<NEW_LINE>outState.putInt(KEY_SELECTED_DAY, mCalendar.get(Calendar.DAY_OF_MONTH));<NEW_LINE>outState.putInt(KEY_WEEK_START, mWeekStart);<NEW_LINE>outState.putInt(KEY_CURRENT_VIEW, mCurrentView);<NEW_LINE>int listPosition = -1;<NEW_LINE>if (mCurrentView == MONTH_AND_DAY_VIEW) {<NEW_LINE>listPosition = mDayPickerView.getMostVisiblePosition();<NEW_LINE>} else if (mCurrentView == YEAR_VIEW) {<NEW_LINE>listPosition = mYearPickerView.getFirstVisiblePosition();<NEW_LINE>outState.putInt(KEY_LIST_POSITION_OFFSET, mYearPickerView.getFirstPositionOffset());<NEW_LINE>}<NEW_LINE>outState.putInt(KEY_LIST_POSITION, listPosition);<NEW_LINE>outState.putSerializable(KEY_HIGHLIGHTED_DAYS, highlightedDays);<NEW_LINE>outState.putBoolean(KEY_THEME_DARK, mThemeDark);<NEW_LINE>outState.putBoolean(KEY_THEME_DARK_CHANGED, mThemeDarkChanged);<NEW_LINE>if (mAccentColor != null)<NEW_LINE><MASK><NEW_LINE>outState.putBoolean(KEY_VIBRATE, mVibrate);<NEW_LINE>outState.putBoolean(KEY_DISMISS, mDismissOnPause);<NEW_LINE>outState.putBoolean(KEY_AUTO_DISMISS, mAutoDismiss);<NEW_LINE>outState.putInt(KEY_DEFAULT_VIEW, mDefaultView);<NEW_LINE>outState.putString(KEY_TITLE, mTitle);<NEW_LINE>outState.putInt(KEY_OK_RESID, mOkResid);<NEW_LINE>outState.putString(KEY_OK_STRING, mOkString);<NEW_LINE>if (mOkColor != null)<NEW_LINE>outState.putInt(KEY_OK_COLOR, mOkColor);<NEW_LINE>outState.putInt(KEY_CANCEL_RESID, mCancelResid);<NEW_LINE>outState.putString(KEY_CANCEL_STRING, mCancelString);<NEW_LINE>if (mCancelColor != null)<NEW_LINE>outState.putInt(KEY_CANCEL_COLOR, mCancelColor);<NEW_LINE>outState.putSerializable(KEY_VERSION, mVersion);<NEW_LINE>outState.putSerializable(KEY_SCROLL_ORIENTATION, mScrollOrientation);<NEW_LINE>outState.putSerializable(KEY_TIMEZONE, mTimezone);<NEW_LINE>outState.putParcelable(KEY_DATERANGELIMITER, mDateRangeLimiter);<NEW_LINE>outState.putSerializable(KEY_LOCALE, mLocale);<NEW_LINE>}
outState.putInt(KEY_ACCENT, mAccentColor);
619,475
public PutObjectResult handleRequest(Object input, Context context) {<NEW_LINE>String filename = "java11.tgz";<NEW_LINE>String cmd = "tar -cpzf /tmp/" + filename + " --numeric-owner --ignore-failed-read /var/runtime /var/lang";<NEW_LINE>AmazonS3 s3client = AmazonS3ClientBuilder.standard().withRegion("us-east-1").build();<NEW_LINE>System.out.println(ManagementFactory.getRuntimeMXBean().getInputArguments().toString());<NEW_LINE>System.out.println(System.getProperty("sun.java.command"));<NEW_LINE>System.out.println(System.getProperty("java.home"));<NEW_LINE>System.out.println(System.getProperty("java.library.path"));<NEW_LINE>System.out.println(System.getProperty("java.class.path"));<NEW_LINE>System.out.println(System.getProperty("user.dir"));<NEW_LINE>System.out.println(System.getProperty("user.home"));<NEW_LINE>System.out.println(System.getProperty("user.name"));<NEW_LINE>System.out.println(new File(".").getAbsolutePath());<NEW_LINE>Map<String, String> env = System.getenv();<NEW_LINE>for (String envName : env.keySet()) {<NEW_LINE>System.out.println(envName + "=" + env.get(envName));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Process process = Runtime.getRuntime().exec(new String[] { "sh", "-c", cmd });<NEW_LINE>try (Scanner stdoutScanner = new Scanner(process.getInputStream());<NEW_LINE>Scanner stderrScanner = new Scanner(process.getErrorStream())) {<NEW_LINE>// Echo all stdout first<NEW_LINE>while (stdoutScanner.hasNextLine()) {<NEW_LINE>System.out.<MASK><NEW_LINE>}<NEW_LINE>// Then echo stderr<NEW_LINE>while (stderrScanner.hasNextLine()) {<NEW_LINE>System.err.println(stderrScanner.nextLine());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>process.waitFor();<NEW_LINE>if (process.exitValue() != 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>System.out.println("Zipping done! Uploading...");<NEW_LINE>return s3client.putObject(new PutObjectRequest("lambci", "fs/" + filename, new File("/tmp/" + filename)).withCannedAcl(CannedAccessControlList.PublicRead));<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
println(stdoutScanner.nextLine());
1,760,188
final ListExplainabilityExportsResult executeListExplainabilityExports(ListExplainabilityExportsRequest listExplainabilityExportsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listExplainabilityExportsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListExplainabilityExportsRequest> request = null;<NEW_LINE>Response<ListExplainabilityExportsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListExplainabilityExportsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listExplainabilityExportsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "forecast");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListExplainabilityExports");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListExplainabilityExportsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListExplainabilityExportsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,495,853
private static String prettyPrint(SkyFunctionName skyFunctionName, Object arg) {<NEW_LINE>if (arg instanceof Artifact) {<NEW_LINE>return prettyPrintArtifact(((Artifact) arg));<NEW_LINE>} else if (arg instanceof ActionLookupData) {<NEW_LINE>return "action from: " + arg;<NEW_LINE>} else if (arg instanceof TopLevelActionLookupKey) {<NEW_LINE>TopLevelActionLookupKey key = (TopLevelActionLookupKey) arg;<NEW_LINE>if (skyFunctionName.equals(SkyFunctions.TARGET_COMPLETION)) {<NEW_LINE>return "configured target: " + key.actionLookupKey().getLabel();<NEW_LINE>}<NEW_LINE>return "top-level aspect: " + ((AspectCompletionValue.AspectCompletionKey) key).actionLookupKey().prettyPrint();<NEW_LINE>} else if (arg instanceof TestCompletionKey && skyFunctionName.equals(SkyFunctions.TEST_COMPLETION)) {<NEW_LINE>return "test target: " + ((TestCompletionKey) arg).configuredTargetKey().getLabel();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
throw new IllegalStateException("Argument is not Action, TargetCompletion, AspectCompletion, or TestCompletion: " + arg);
193,634
public CreateUserImportJobResult createUserImportJob(CreateUserImportJobRequest createUserImportJobRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createUserImportJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateUserImportJobRequest> request = null;<NEW_LINE>Response<CreateUserImportJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateUserImportJobRequestMarshaller().marshall(createUserImportJobRequest);<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<CreateUserImportJobResult, JsonUnmarshallerContext> unmarshaller = new CreateUserImportJobResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<CreateUserImportJobResult> responseHandler = new JsonResponseHandler<CreateUserImportJobResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
1,317,435
final void tryRemoveAndExec(ForkJoinTask<?> task) {<NEW_LINE>ForkJoinTask<?>[] wa;<NEW_LINE>int s, wal;<NEW_LINE>if (// traverse from top<NEW_LINE>base - (s = top) < 0 && (wa = array) != null && (wal = wa.length) > 0) {<NEW_LINE>for (int m = wal - 1, ns = s - 1, i = ns; ; --i) {<NEW_LINE>int index = i & m;<NEW_LINE>long offset = (index << ASHIFT) + ABASE;<NEW_LINE>ForkJoinTask<?> t = (ForkJoinTask<?>) U.getObject(wa, offset);<NEW_LINE>if (t == null)<NEW_LINE>break;<NEW_LINE>else if (t == task) {<NEW_LINE>if (U.compareAndSwapObject(wa, offset, t, null)) {<NEW_LINE>// safely shift down<NEW_LINE>top = ns;<NEW_LINE>for (int j = i; j != ns; ++j) {<NEW_LINE>ForkJoinTask<?> f;<NEW_LINE>int pindex = (j + 1) & m;<NEW_LINE>long pOffset = (pindex << ASHIFT) + ABASE;<NEW_LINE>f = (ForkJoinTask<?>) U.getObject(wa, pOffset);<NEW_LINE>U.putObjectVolatile(wa, pOffset, null);<NEW_LINE>int jindex = j & m;<NEW_LINE>long jOffset = (jindex << ASHIFT) + ABASE;<NEW_LINE>U.<MASK><NEW_LINE>}<NEW_LINE>U.storeFence();<NEW_LINE>t.doExec();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
putOrderedObject(wa, jOffset, f);
790,031
public KafkaAction 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>KafkaAction kafkaAction = new KafkaAction();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("destinationArn")) {<NEW_LINE>kafkaAction.setDestinationArn(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("topic")) {<NEW_LINE>kafkaAction.setTopic(StringJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else if (name.equals("key")) {<NEW_LINE>kafkaAction.setKey(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("partition")) {<NEW_LINE>kafkaAction.setPartition(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("clientProperties")) {<NEW_LINE>kafkaAction.setClientProperties(new MapUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return kafkaAction;<NEW_LINE>}
().unmarshall(context));
1,351,443
protected void showDialog(Bundle state) {<NEW_LINE>Context context = getContext();<NEW_LINE>Resources res = context.getResources();<NEW_LINE>int topOffset = res.getDimensionPixelOffset(R.dimen.settings_fragment_dialog_vertical_inset);<NEW_LINE>AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context).setBackgroundInsetTop<MASK><NEW_LINE>mWhichButtonClicked = DialogInterface.BUTTON_NEGATIVE;<NEW_LINE>builder.setPositiveButton(android.R.string.ok, this);<NEW_LINE>builder.setNegativeButton(res.getString(android.R.string.cancel).toUpperCase(Locale.getDefault()), this);<NEW_LINE>if (mDetails == null) {<NEW_LINE>mDetails = new String[getEntries() == null ? 1 : getEntries().length];<NEW_LINE>}<NEW_LINE>mListAdapter = new DetailListAdapter(getContext(), R.layout.detail_list_preference, mDetails);<NEW_LINE>mStartingValue = getValue();<NEW_LINE>mSelectedIndex = findIndexOfValue(mStartingValue);<NEW_LINE>builder.setSingleChoiceItems(mListAdapter, mSelectedIndex, (dialog, which) -> mSelectedIndex = which);<NEW_LINE>View titleView = View.inflate(getContext(), R.layout.detail_list_preference_title, null);<NEW_LINE>if (titleView != null) {<NEW_LINE>TextView titleText = titleView.findViewById(R.id.title);<NEW_LINE>if (titleText != null) {<NEW_LINE>titleText.setText(getTitle());<NEW_LINE>}<NEW_LINE>builder.setCustomTitle(titleView);<NEW_LINE>} else {<NEW_LINE>builder.setTitle(getTitle());<NEW_LINE>}<NEW_LINE>mDialog = builder.create();<NEW_LINE>if (state != null) {<NEW_LINE>mDialog.onRestoreInstanceState(state);<NEW_LINE>}<NEW_LINE>mDialog.setOnDismissListener(this);<NEW_LINE>mDialog.show();<NEW_LINE>ListView listView = mDialog.getListView();<NEW_LINE>if (listView != null) {<NEW_LINE>listView.setDividerHeight(0);<NEW_LINE>listView.setClipToPadding(true);<NEW_LINE>listView.setPadding(0, 0, 0, res.getDimensionPixelSize(R.dimen.site_settings_divider_height));<NEW_LINE>}<NEW_LINE>UiHelpers.Companion.adjustDialogSize(mDialog);<NEW_LINE>}
(topOffset).setBackgroundInsetBottom(topOffset);
802,505
private SearchResponse doSearch(Object[] searchAfterValues) {<NEW_LINE>SearchRequest searchRequest = new SearchRequest(index);<NEW_LINE>searchRequest.indicesOptions(MlIndicesUtils.addIgnoreUnavailable(SearchRequest.DEFAULT_INDICES_OPTIONS));<NEW_LINE>SearchSourceBuilder sourceBuilder = (new SearchSourceBuilder().size(batchSize).query(getQuery()).fetchSource(shouldFetchSource())<MASK><NEW_LINE>if (trackTotalHits && totalHits.get() == 0L) {<NEW_LINE>sourceBuilder.trackTotalHits(true);<NEW_LINE>}<NEW_LINE>if (searchAfterValues != null) {<NEW_LINE>sourceBuilder.searchAfter(searchAfterValues);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, String> docValueFieldAndFormat : docValueFieldAndFormatPairs().entrySet()) {<NEW_LINE>sourceBuilder.docValueField(docValueFieldAndFormat.getKey(), docValueFieldAndFormat.getValue());<NEW_LINE>}<NEW_LINE>searchRequest.source(sourceBuilder);<NEW_LINE>return executeSearchRequest(searchRequest);<NEW_LINE>}
.sort(sortField()));
72,327
public ResourcePath unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ResourcePath resourcePath = new ResourcePath();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Components", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resourcePath.setComponents(new ListUnmarshaller<ResourcePathComponent>(ResourcePathComponentJsonUnmarshaller.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 resourcePath;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,613,837
private void runBuilder(HttpServletRequest request, HttpServletResponse response) throws IOException {<NEW_LINE>try {<NEW_LINE>pw = appUtils.<MASK><NEW_LINE>String configId = request.getParameter(JWTBuilderConstants.JWT_BUILDER_PARAM_BUILDER_ID);<NEW_LINE>createBuilder(configId);<NEW_LINE>// we should now have a populated builder - build the token, and log the contents/test the claim apis, ...<NEW_LINE>JwtToken newJwtToken = myJwtBuilder.buildJwt();<NEW_LINE>appUtils.logIt(pw, "JwtToken: " + newJwtToken.toString());<NEW_LINE>appUtils.outputHeader(pw, JWTBuilderConstants.JWT_TOKEN_HEADER, newJwtToken);<NEW_LINE>appUtils.outputClaims(pw, JWTBuilderConstants.JWT_CLAIM, newJwtToken);<NEW_LINE>jwtTokenString = newJwtToken.compact();<NEW_LINE>appUtils.logIt(pw, JWTBuilderConstants.BUILT_JWT_TOKEN + jwtTokenString);<NEW_LINE>System.out.println("exiting the svc client");<NEW_LINE>appUtils.logIt(pw, "******************* End of JWTBuilderClient output ******************* ");<NEW_LINE>pw.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>appUtils.handleException(pw, response, e);<NEW_LINE>}<NEW_LINE>appUtils.outputExit(pw, JWTBuilderConstants.JWT_BUILDER_CREATE_ENDPOINT);<NEW_LINE>}
outputEntry(response, JWTBuilderConstants.JWT_BUILDER_CREATE_ENDPOINT);
165,753
public List<? super PsiElement> process(@NotNull PsiClass psiClass, @Nullable String nameHint) {<NEW_LINE>final Optional<<MASK><NEW_LINE>final Optional<PsiAnnotation> builderAnnotation = parentClass.map(this::getSupportedAnnotation);<NEW_LINE>if (builderAnnotation.isPresent()) {<NEW_LINE>final PsiClass psiParentClass = parentClass.get();<NEW_LINE>final PsiAnnotation psiBuilderAnnotation = builderAnnotation.get();<NEW_LINE>// use parent class as source!<NEW_LINE>if (validate(psiBuilderAnnotation, psiParentClass, ProblemEmptyBuilder.getInstance())) {<NEW_LINE>return processAnnotation(psiParentClass, null, psiBuilderAnnotation, psiClass, nameHint);<NEW_LINE>}<NEW_LINE>} else if (parentClass.isPresent()) {<NEW_LINE>final PsiClass psiParentClass = parentClass.get();<NEW_LINE>final Collection<PsiMethod> psiMethods = PsiClassUtil.collectClassMethodsIntern(psiParentClass);<NEW_LINE>for (PsiMethod psiMethod : psiMethods) {<NEW_LINE>final PsiAnnotation psiBuilderAnnotation = PsiAnnotationSearchUtil.findAnnotation(psiMethod, getSupportedAnnotationClasses());<NEW_LINE>if (null != psiBuilderAnnotation) {<NEW_LINE>final String builderClassNameOfThisMethod = getBuilderHandler().getBuilderClassName(psiParentClass, psiBuilderAnnotation, psiMethod);<NEW_LINE>// check we found right method for this existing builder class<NEW_LINE>if (Objects.equals(builderClassNameOfThisMethod, psiClass.getName())) {<NEW_LINE>return processAnnotation(psiParentClass, psiMethod, psiBuilderAnnotation, psiClass, nameHint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.emptyList();<NEW_LINE>}
PsiClass> parentClass = getSupportedParentClass(psiClass);
1,448,520
final PutMailboxPermissionsResult executePutMailboxPermissions(PutMailboxPermissionsRequest putMailboxPermissionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putMailboxPermissionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutMailboxPermissionsRequest> request = null;<NEW_LINE>Response<PutMailboxPermissionsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new PutMailboxPermissionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putMailboxPermissionsRequest));<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, "WorkMail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutMailboxPermissions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutMailboxPermissionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutMailboxPermissionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
246,186
private AndroidManifest parse(File androidManifestFile, boolean libraryProject) throws AndroidManifestNotFoundException {<NEW_LINE>DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();<NEW_LINE>Document doc;<NEW_LINE>try {<NEW_LINE>DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();<NEW_LINE>doc = docBuilder.parse(androidManifestFile);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Could not parse the AndroidManifest.xml file at path {}", androidManifestFile, e);<NEW_LINE>throw new AndroidManifestNotFoundException("Could not parse the AndroidManifest.xml file at path {}" + androidManifestFile, e);<NEW_LINE>}<NEW_LINE>Element documentElement = doc.getDocumentElement();<NEW_LINE>documentElement.normalize();<NEW_LINE>String applicationPackage = documentElement.getAttribute("package");<NEW_LINE>int minSdkVersion = -1;<NEW_LINE>int maxSdkVersion = -1;<NEW_LINE>int targetSdkVersion = -1;<NEW_LINE>NodeList sdkNodes = documentElement.getElementsByTagName("uses-sdk");<NEW_LINE>if (sdkNodes.getLength() > 0) {<NEW_LINE>Node sdkNode = sdkNodes.item(0);<NEW_LINE>minSdkVersion = extractAttributeIntValue(sdkNode, "android:minSdkVersion", -1);<NEW_LINE>maxSdkVersion = extractAttributeIntValue(sdkNode, "android:maxSdkVersion", -1);<NEW_LINE>targetSdkVersion = extractAttributeIntValue(sdkNode, "android:targetSdkVersion", -1);<NEW_LINE>}<NEW_LINE>if (libraryProject) {<NEW_LINE>return AndroidManifest.createLibraryManifest(applicationPackage, minSdkVersion, maxSdkVersion, targetSdkVersion);<NEW_LINE>}<NEW_LINE>NodeList applicationNodes = documentElement.getElementsByTagName("application");<NEW_LINE>String applicationClassQualifiedName = null;<NEW_LINE>boolean applicationDebuggableMode = false;<NEW_LINE>if (applicationNodes.getLength() > 0) {<NEW_LINE>Node applicationNode = applicationNodes.item(0);<NEW_LINE>Node nameAttribute = applicationNode.getAttributes().getNamedItem("android:name");<NEW_LINE>applicationClassQualifiedName = manifestNameToValidQualifiedName(applicationPackage, nameAttribute);<NEW_LINE>if (applicationClassQualifiedName == null) {<NEW_LINE>if (nameAttribute != null) {<NEW_LINE>LOGGER.warn("The class application declared in the AndroidManifest.xml cannot be found in the compile path: [{}]", nameAttribute.getNodeValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Node debuggableAttribute = applicationNode.getAttributes().getNamedItem("android:debuggable");<NEW_LINE>if (debuggableAttribute != null) {<NEW_LINE>applicationDebuggableMode = debuggableAttribute.getNodeValue().equalsIgnoreCase("true");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>NodeList activityNodes = documentElement.getElementsByTagName("activity");<NEW_LINE>List<String> activityQualifiedNames = extractComponentNames(applicationPackage, activityNodes);<NEW_LINE>NodeList serviceNodes = documentElement.getElementsByTagName("service");<NEW_LINE>List<String> serviceQualifiedNames = extractComponentNames(applicationPackage, serviceNodes);<NEW_LINE>NodeList receiverNodes = documentElement.getElementsByTagName("receiver");<NEW_LINE>List<String> receiverQualifiedNames = extractComponentNames(applicationPackage, receiverNodes);<NEW_LINE>NodeList providerNodes = documentElement.getElementsByTagName("provider");<NEW_LINE>List<String> providerQualifiedNames = extractComponentNames(applicationPackage, providerNodes);<NEW_LINE>List<String> componentQualifiedNames = new ArrayList<>();<NEW_LINE>componentQualifiedNames.addAll(activityQualifiedNames);<NEW_LINE>componentQualifiedNames.addAll(serviceQualifiedNames);<NEW_LINE>componentQualifiedNames.addAll(receiverQualifiedNames);<NEW_LINE>componentQualifiedNames.addAll(providerQualifiedNames);<NEW_LINE>NodeList metaDataNodes = documentElement.getElementsByTagName("meta-data");<NEW_LINE>Map<String, AndroidManifest.MetaDataInfo> metaDataQualifiedNames = extractMetaDataQualifiedNames(metaDataNodes);<NEW_LINE>NodeList usesPermissionNodes = documentElement.getElementsByTagName("uses-permission");<NEW_LINE>List<<MASK><NEW_LINE>List<String> permissionQualifiedNames = new ArrayList<>();<NEW_LINE>permissionQualifiedNames.addAll(usesPermissionQualifiedNames);<NEW_LINE>return AndroidManifest.createManifest(applicationPackage, applicationClassQualifiedName, componentQualifiedNames, metaDataQualifiedNames, permissionQualifiedNames, minSdkVersion, maxSdkVersion, targetSdkVersion, applicationDebuggableMode);<NEW_LINE>}
String> usesPermissionQualifiedNames = extractUsesPermissionNames(usesPermissionNodes);
1,630,438
private void doExec(String args) throws IOException, InterruptedException, ConfigurationException {<NEW_LINE>int pos = args.indexOf(',');<NEW_LINE>if (pos == -1) {<NEW_LINE>// weird stuff<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Everything after the "," is what we're supposed to run<NEW_LINE>// First make note of jars we got<NEW_LINE>File[] oldJar = new File(CONFIGURATION.getPluginDirectory()).listFiles();<NEW_LINE>// Before we start external installers better save the config<NEW_LINE>CONFIGURATION.save();<NEW_LINE>ProcessBuilder pb = new ProcessBuilder(args.substring(pos + 1));<NEW_LINE>pb.redirectErrorStream(true);<NEW_LINE>Map<String, String> env = pb.environment();<NEW_LINE>env.put(<MASK><NEW_LINE>env.put("UMS_VERSION", PMS.getVersion());<NEW_LINE>LOGGER.debug("running '" + args + "'");<NEW_LINE>Process pid = pb.start();<NEW_LINE>// Consume and log any output<NEW_LINE>Scanner output = new Scanner(pid.getInputStream());<NEW_LINE>while (output.hasNextLine()) {<NEW_LINE>LOGGER.debug("[" + args + "] " + output.nextLine());<NEW_LINE>}<NEW_LINE>CONFIGURATION.reload();<NEW_LINE>pid.waitFor();<NEW_LINE>File[] newJar = new File(CONFIGURATION.getPluginDirectory()).listFiles();<NEW_LINE>for (File f : newJar) {<NEW_LINE>if (!f.getAbsolutePath().endsWith(".jar")) {<NEW_LINE>// skip non jar files<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (File oldJar1 : oldJar) {<NEW_LINE>if (f.getAbsolutePath().equals(oldJar1.getAbsolutePath())) {<NEW_LINE>// old jar file break out, and set f to null to skip adding it<NEW_LINE>f = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if f is null this is an jar that is old<NEW_LINE>if (f != null) {<NEW_LINE>jars.add(f.toURI().toURL());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"PROFILE_PATH", CONFIGURATION.getProfilePath());
1,528,787
public void execute() throws UserException {<NEW_LINE>if (MailSystem.isValidEmailAddress(user.getUsername())) {<NEW_LINE>EmailMessage message = bimServer.getMailSystem().createMessage();<NEW_LINE>String body = null;<NEW_LINE>String subject = null;<NEW_LINE>try {<NEW_LINE>InternetAddress addressFrom = new InternetAddress(bimServer.getServerSettingsCache().getServerSettings().getEmailSenderAddress());<NEW_LINE>message.setFrom(addressFrom);<NEW_LINE>InternetAddress[] addressTo = new InternetAddress[1];<NEW_LINE>addressTo[0] = new InternetAddress(user.getUsername());<NEW_LINE>message.setRecipients(Message.RecipientType.TO, addressTo);<NEW_LINE>Map<String, Object> context = new HashMap<String, Object>();<NEW_LINE>context.put("name", user.getName());<NEW_LINE>context.put("username", user.getUsername());<NEW_LINE>if (includeSiteAddress) {<NEW_LINE>context.put("siteaddress", bimServer.getServerSettingsCache().getServerSettings().getSiteAddress());<NEW_LINE>}<NEW_LINE>context.put("validationlink", resetUrl + "&username=" + user.getUsername() + "&uoid=" + user.getOid() + "&validationtoken=" + token + (includeSiteAddress ? ("&address=" + bimServer.getServerSettingsCache().getServerSettings().getSiteAddress()) : ""));<NEW_LINE>body = bimServer.getTemplateEngine().process(context, TemplateIdentifier.PASSWORD_RESET_EMAIL_BODY);<NEW_LINE>subject = bimServer.getTemplateEngine().process(context, TemplateIdentifier.PASSWORD_RESET_EMAIL_SUBJECT);<NEW_LINE>message.setContent(body, "text/html");<NEW_LINE>message.setSubject(subject.trim());<NEW_LINE>message.send();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error(body);<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
UserException(e.getMessage());
782,906
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 1, driver_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 2, volumeHandle_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>output.writeBool(3, readOnly_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 4, fsType_);<NEW_LINE>}<NEW_LINE>com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(output, internalGetVolumeAttributes(), VolumeAttributesDefaultEntryHolder.defaultEntry, 5);<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>output.writeMessage(6, getControllerPublishSecretRef());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>output.writeMessage(7, getNodeStageSecretRef());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000040) == 0x00000040)) {<NEW_LINE>output.writeMessage(8, getNodePublishSecretRef());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000080) == 0x00000080)) {<NEW_LINE>output.<MASK><NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>}
writeMessage(9, getControllerExpandSecretRef());
479,131
private void checkAndNormalizeBackupObjs() throws AnalysisException {<NEW_LINE>for (TableRef tblRef : tblRefs) {<NEW_LINE>if (!Strings.isNullOrEmpty(tblRef.getName().getDb())) {<NEW_LINE>throw new AnalysisException("Cannot specify database name on backup objects: " + tblRef.getName().getTbl() + ". Sepcify database name before label");<NEW_LINE>}<NEW_LINE>// set db name because we can not persist empty string when writing bdbje log<NEW_LINE>tblRef.getName().setDb(labelName.getDbName());<NEW_LINE>}<NEW_LINE>// normalize<NEW_LINE>// table name => table ref<NEW_LINE>Map<String, TableRef> tblPartsMap = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>for (TableRef tblRef : tblRefs) {<NEW_LINE>String tblName = tblRef.getName().getTbl();<NEW_LINE>if (!tblPartsMap.containsKey(tblName)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>throw new AnalysisException("Duplicated restore table: " + tblName);<NEW_LINE>}<NEW_LINE>CatalogUtils.checkOlapTableHasStarOSPartition(labelName.getDbName(), tblName);<NEW_LINE>}<NEW_LINE>// update table ref<NEW_LINE>tblRefs.clear();<NEW_LINE>for (TableRef tableRef : tblPartsMap.values()) {<NEW_LINE>tblRefs.add(tableRef);<NEW_LINE>}<NEW_LINE>LOG.debug("table refs after normalization: \n{}", Joiner.on("\n").join(tblRefs));<NEW_LINE>}
tblPartsMap.put(tblName, tblRef);
1,599,267
public void marshall(SharePointConfiguration sharePointConfiguration, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (sharePointConfiguration == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(sharePointConfiguration.getSharePointVersion(), SHAREPOINTVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(sharePointConfiguration.getUrls(), URLS_BINDING);<NEW_LINE>protocolMarshaller.marshall(sharePointConfiguration.getSecretArn(), SECRETARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(sharePointConfiguration.getCrawlAttachments(), CRAWLATTACHMENTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(sharePointConfiguration.getUseChangeLog(), USECHANGELOG_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(sharePointConfiguration.getExclusionPatterns(), EXCLUSIONPATTERNS_BINDING);<NEW_LINE>protocolMarshaller.marshall(sharePointConfiguration.getVpcConfiguration(), VPCCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(sharePointConfiguration.getFieldMappings(), FIELDMAPPINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(sharePointConfiguration.getDocumentTitleFieldName(), DOCUMENTTITLEFIELDNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(sharePointConfiguration.getDisableLocalGroups(), DISABLELOCALGROUPS_BINDING);<NEW_LINE>protocolMarshaller.marshall(sharePointConfiguration.getSslCertificateS3Path(), SSLCERTIFICATES3PATH_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
sharePointConfiguration.getInclusionPatterns(), INCLUSIONPATTERNS_BINDING);
173,980
public void marshall(UpdateAppRequest updateAppRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateAppRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getAppId(), APPID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getPlatform(), PLATFORM_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getIamServiceRoleArn(), IAMSERVICEROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getEnvironmentVariables(), ENVIRONMENTVARIABLES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getEnableBranchAutoBuild(), ENABLEBRANCHAUTOBUILD_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getEnableBasicAuth(), ENABLEBASICAUTH_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getBasicAuthCredentials(), BASICAUTHCREDENTIALS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getCustomRules(), CUSTOMRULES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getBuildSpec(), BUILDSPEC_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getCustomHeaders(), CUSTOMHEADERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getEnableAutoBranchCreation(), ENABLEAUTOBRANCHCREATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getAutoBranchCreationPatterns(), AUTOBRANCHCREATIONPATTERNS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getAutoBranchCreationConfig(), AUTOBRANCHCREATIONCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getRepository(), REPOSITORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getOauthToken(), OAUTHTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAppRequest.getAccessToken(), ACCESSTOKEN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
updateAppRequest.getEnableBranchAutoDeletion(), ENABLEBRANCHAUTODELETION_BINDING);
132,296
private void loadRemote(String parent, byte level, ArrayList<String> patterns) throws Exception {<NEW_LINE>if (!parent.endsWith("/"))<NEW_LINE>parent = parent + "/";<NEW_LINE>Vector fs = chSftp.ls(parent);<NEW_LINE>System.out.println(parent + ", " + fs.size());<NEW_LINE>// String status = ftp.getStatus(parent);<NEW_LINE>// if (status == null) return;<NEW_LINE>// String[] fs = status.split("\r\n");<NEW_LINE>for (int i = 0; i < fs.size(); i++) {<NEW_LINE>LsEntry fsi = (LsEntry) fs.get(i);<NEW_LINE>String name = fsi.getFilename();<NEW_LINE>System.out.println(fsi.getFilename());<NEW_LINE>if (name.endsWith(".") || name.endsWith(".."))<NEW_LINE>continue;<NEW_LINE>boolean dir = fsi<MASK><NEW_LINE>if (_remoteFiles.size() >= maxFileNum) {<NEW_LINE>Logger.warn("ftp server has too many files, more than [" + maxFileNum + "]");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String fi = parent + name + (dir ? "/" : "");<NEW_LINE>if (_remoteFiles.indexOf(fi) == -1) {<NEW_LINE>_remoteFiles.add(fi);<NEW_LINE>_remoteIsDir.add(dir);<NEW_LINE>_remoteLevels.add(level);<NEW_LINE>}<NEW_LINE>// System.out.println(fi+" : "+dir + " : "+level);<NEW_LINE>if (dir) {<NEW_LINE>loadRemote(parent + name, (byte) (level + 1), patterns);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getAttrs().isDir();
1,763,071
public void handleChunkUnload(ChunkEvent.Unload event) {<NEW_LINE>if (!onchunkgenerate)<NEW_LINE>return;<NEW_LINE>IWorld w = event.getWorld();<NEW_LINE>if (!(w instanceof ServerWorld))<NEW_LINE>return;<NEW_LINE>IChunk c = event.getChunk();<NEW_LINE>if ((c != null) && (c.getStatus() == ChunkStatus.FULL)) {<NEW_LINE>ForgeWorld <MASK><NEW_LINE>ChunkPos cp = c.getPos();<NEW_LINE>if (fw != null) {<NEW_LINE>if (!checkIfKnownChunk(fw, cp)) {<NEW_LINE>int ymax = 0;<NEW_LINE>ChunkSection[] sections = c.getSections();<NEW_LINE>for (int i = 0; i < sections.length; i++) {<NEW_LINE>if ((sections[i] != null) && (sections[i].isEmpty() == false)) {<NEW_LINE>ymax = 16 * (i + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int x = cp.x << 4;<NEW_LINE>int z = cp.z << 4;<NEW_LINE>// If not empty AND not initial scan<NEW_LINE>if (ymax > 0) {<NEW_LINE>// Log.info("New generated chunk detected at " + cp + " for " + fw.getName());<NEW_LINE>mapManager.touchVolume(fw.getName(), x, 0, z, x + 15, ymax, z + 16, "chunkgenerate");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>removeKnownChunk(fw, cp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
fw = getWorld(w, false);
257,855
public boolean processCommandLineArgs(String[] cliArgs) throws IOException, DatabusException {<NEW_LINE>CommandLineParser cliParser = new GnuParser();<NEW_LINE>_cmd = null;<NEW_LINE>try {<NEW_LINE>_cmd = cliParser.parse(_cliOptions, cliArgs);<NEW_LINE>} catch (ParseException pe) {<NEW_LINE>System.err.println(NAME + ": failed to parse command-line options: " + pe.toString());<NEW_LINE>printCliHelp();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (_cmd.hasOption(HELP_OPT_CHAR)) {<NEW_LINE>printCliHelp();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!_cmd.hasOption(SCHEMA_REGISTRY_LOCATION_OPT_CHAR)) {<NEW_LINE>System.err.println("Please specify the schema registry location");<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>_schemaRegistryLocation = _cmd.getOptionValue(SCHEMA_REGISTRY_LOCATION_OPT_CHAR);<NEW_LINE>File f = new File(_schemaRegistryLocation);<NEW_LINE>if (!f.isDirectory()) {<NEW_LINE>System.err.println("Schema Registry (" + _schemaRegistryLocation + ") is not a valid directory !! Please specify one");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!_cmd.hasOption(OUTPUT_DIRECTORY_OPT_CHAR)) {<NEW_LINE>System.err.println("Please specify the output directory");<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>File f = new File(_outputDirectory);<NEW_LINE>if (!f.isDirectory()) {<NEW_LINE>System.err.println("Output Directory (" + _outputDirectory + ") is not a valid directory !! Please specify one");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!_cmd.hasOption(SCHEMA_NAME_OPT_CHAR)) {<NEW_LINE>System.out.println("Please specify the Schema name !!");<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>_schemaName = _cmd.getOptionValue(SCHEMA_NAME_OPT_CHAR);<NEW_LINE>}<NEW_LINE>if (!_cmd.hasOption(DB_URI_OPT_CHAR)) {<NEW_LINE>System.err.println("Plase specify the DB URI !!");<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>_dbUri = _cmd.getOptionValue(DB_URI_OPT_CHAR);<NEW_LINE>}<NEW_LINE>if (!_cmd.hasOption(SRC_NAMES_OPT_CHAR)) {<NEW_LINE>System.err.println("Please specify comma seperated list of source names");<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>_srcNames = Arrays.asList(_cmd.getOptionValue(SRC_NAMES_LONG_STR).split(","));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
_outputDirectory = _cmd.getOptionValue(OUTPUT_DIRECTORY_LONG_STR);
1,377,612
protected void configureGraphicalViewer() {<NEW_LINE>super.configureGraphicalViewer();<NEW_LINE>this.getGraphicalViewer().getControl().setBackground(UIUtils.getColorRegistry().get(ERDUIConstants.COLOR_ERD_DIAGRAM_BACKGROUND));<NEW_LINE>GraphicalViewer graphicalViewer = getGraphicalViewer();<NEW_LINE>DBPPreferenceStore store = ERDUIActivator.getDefault().getPreferences();<NEW_LINE>graphicalViewer.setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, store.getBoolean(ERDUIConstants.PREF_GRID_ENABLED));<NEW_LINE>graphicalViewer.setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, store.getBoolean(ERDUIConstants.PREF_GRID_ENABLED));<NEW_LINE>graphicalViewer.setProperty(SnapToGrid.PROPERTY_GRID_SPACING, new Dimension(store.getInt(ERDUIConstants.PREF_GRID_WIDTH), store.getInt(ERDUIConstants.PREF_GRID_HEIGHT)));<NEW_LINE>// initialize actions<NEW_LINE>createActions();<NEW_LINE>// Setup zoom manager<NEW_LINE>ZoomManager zoomManager = rootPart.getZoomManager();<NEW_LINE>List<String> zoomLevels = new ArrayList<>(3);<NEW_LINE>zoomLevels.add(ZoomManager.FIT_ALL);<NEW_LINE>zoomLevels.add(ZoomManager.FIT_WIDTH);<NEW_LINE>zoomLevels.add(ZoomManager.FIT_HEIGHT);<NEW_LINE>zoomManager.setZoomLevelContributions(zoomLevels);<NEW_LINE>zoomManager.setZoomLevels(new double[] { .1, .1, .2, .3, .5, .6, .7, .8, .9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.5, 3, 4 });<NEW_LINE><MASK><NEW_LINE>IAction zoomOut = new ZoomOutAction(zoomManager);<NEW_LINE>addAction(zoomIn);<NEW_LINE>addAction(zoomOut);<NEW_LINE>addAction(new DiagramToggleHandAction(editDomain.getPaletteViewer()));<NEW_LINE>graphicalViewer.addSelectionChangedListener(event -> {<NEW_LINE>String status;<NEW_LINE>IStructuredSelection selection = (IStructuredSelection) event.getSelection();<NEW_LINE>if (selection.isEmpty()) {<NEW_LINE>status = "";<NEW_LINE>} else if (selection.size() == 1) {<NEW_LINE>status = CommonUtils.toString(selection.getFirstElement());<NEW_LINE>} else {<NEW_LINE>status = selection.size() + " objects";<NEW_LINE>}<NEW_LINE>if (progressControl != null) {<NEW_LINE>progressControl.setInfo(status);<NEW_LINE>}<NEW_LINE>updateActions(editPartActionIDs);<NEW_LINE>});<NEW_LINE>}
IAction zoomIn = new ZoomInAction(zoomManager);
1,558,627
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject sourceObject = game.getObject(source);<NEW_LINE>if (controller == null || sourceObject == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Cards cards = new CardsImpl();<NEW_LINE>int xValue = source.getManaCostsToPay().getX();<NEW_LINE>cards.addAll(controller.getLibrary()<MASK><NEW_LINE>if (!cards.isEmpty()) {<NEW_LINE>controller.revealCards(sourceObject.getIdName(), cards, game);<NEW_LINE>Set<Card> toBattlefield = new LinkedHashSet<>();<NEW_LINE>for (Card card : cards.getCards(new FilterLandCard(), source.getControllerId(), source, game)) {<NEW_LINE>cards.remove(card);<NEW_LINE>toBattlefield.add(card);<NEW_LINE>}<NEW_LINE>controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, true, false, true, null);<NEW_LINE>controller.putCardsOnBottomOfLibrary(cards, game, source, true);<NEW_LINE>if (SpellMasteryCondition.instance.apply(game, source)) {<NEW_LINE>for (Card card : toBattlefield) {<NEW_LINE>Permanent land = game.getPermanent(card.getId());<NEW_LINE>if (land != null) {<NEW_LINE>land.untap(game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
.getTopCards(game, xValue));
731,622
public static byte[] writeTime(Date date, Calendar cal) {<NEW_LINE>if (date == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>byte[] buf = new byte[5];<NEW_LINE>if (cal == null) {<NEW_LINE>cal = Calendar.getInstance();<NEW_LINE>}<NEW_LINE>cal.setTime(date);<NEW_LINE>int year = cal.get(Calendar.YEAR);<NEW_LINE>// File format is a 1 based month, java Calendar uses a zero based month<NEW_LINE>int month = cal.get(Calendar.MONTH) + 1;<NEW_LINE>int day = cal.get(Calendar.DAY_OF_MONTH);<NEW_LINE>int hour = cal.get(Calendar.HOUR_OF_DAY);<NEW_LINE>int minute = cal.get(Calendar.MINUTE);<NEW_LINE>int second = cal.get(Calendar.SECOND);<NEW_LINE>buf[0] = Types.writeUByte(((year >> 6) & 0x0000003F));<NEW_LINE>buf[1] = Types.writeUByte(((year & 0x0000003F) << 2) | ((month >> 2) & 0x00000003));<NEW_LINE>buf[2] = (byte) (((month & 0x00000003) << 6) | ((day & 0x0000001F) << 1) | ((hour <MASK><NEW_LINE>buf[3] = (byte) (((hour & 0x0000000F) << 4) | ((minute >> 2) & 0x0000000F));<NEW_LINE>buf[4] = (byte) (((minute & 0x00000003) << 6) | (second & 0x0000003F));<NEW_LINE>return buf;<NEW_LINE>}
>> 4) & 0x00000001));
379,273
public AwsElasticBeanstalkEnvironmentTier unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsElasticBeanstalkEnvironmentTier awsElasticBeanstalkEnvironmentTier = new AwsElasticBeanstalkEnvironmentTier();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>awsElasticBeanstalkEnvironmentTier.setName(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>awsElasticBeanstalkEnvironmentTier.setType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Version", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>awsElasticBeanstalkEnvironmentTier.setVersion(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return awsElasticBeanstalkEnvironmentTier;<NEW_LINE>}
class).unmarshall(context));
400,856
// OPERATIONS<NEW_LINE>public MessagingSubscription[] listSubscriptions() throws Exception {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "getSubscriptions");<NEW_LINE>List list = new ArrayList();<NEW_LINE>Iterator iter = _c.getTopicSpace().getLocalSubscriptionIterator();<NEW_LINE>while (iter != null && iter.hasNext()) {<NEW_LINE>SIMPLocalSubscriptionControllable o = (SIMPLocalSubscriptionControllable) iter.next();<NEW_LINE>list.add(o);<NEW_LINE>}<NEW_LINE>MessagingSubscription[] retValue = new MessagingSubscription[list.size()];<NEW_LINE>iter = list.iterator();<NEW_LINE>int i = 0;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Object o = iter.next();<NEW_LINE>retValue[i++] = SIBMBeanResultFactory<MASK><NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "getSubscriptions");<NEW_LINE>return retValue;<NEW_LINE>}
.createSIBSubscription((SIMPLocalSubscriptionControllable) o);
1,012,950
public void preparedData() {<NEW_LINE>AlterTableGroupModifyPartition alterTableGroupModifyPartition = (AlterTableGroupModifyPartition) relDdl;<NEW_LINE>String tableGroupName = alterTableGroupModifyPartition.getTableGroupName();<NEW_LINE>String tableName = alterTableGroupModifyPartition<MASK><NEW_LINE>SqlAlterTableGroup sqlAlterTableGroup = (SqlAlterTableGroup) alterTableGroupModifyPartition.getAst();<NEW_LINE>SqlAlterTableModifyPartitionValues sqlAlterTableModifyPartitionValues = (SqlAlterTableModifyPartitionValues) sqlAlterTableGroup.getAlters().get(0);<NEW_LINE>boolean isDropVal = sqlAlterTableModifyPartitionValues.isDrop();<NEW_LINE>List<GroupDetailInfoExRecord> targetGroupDetailInfoExRecords = TableGroupLocation.getOrderedGroupList(schemaName);<NEW_LINE>preparedData = new AlterTableGroupModifyPartitionPreparedData();<NEW_LINE>preparedData.setTableGroupName(tableGroupName);<NEW_LINE>preparedData.setSchemaName(schemaName);<NEW_LINE>preparedData.setTableName(tableName);<NEW_LINE>preparedData.setWithHint(targetTablesHintCache != null);<NEW_LINE>preparedData.setTargetGroupDetailInfoExRecords(targetGroupDetailInfoExRecords);<NEW_LINE>List<String> oldPartition = new ArrayList<>();<NEW_LINE>oldPartition.add(((SqlIdentifier) sqlAlterTableModifyPartitionValues.getPartition().getName()).getLastName());<NEW_LINE>preparedData.setOldPartitionNames(oldPartition);<NEW_LINE>preparedData.setDropVal(isDropVal);<NEW_LINE>preparedData.prepareInvisiblePartitionGroup();<NEW_LINE>List<String> newPartitionNames = preparedData.getInvisiblePartitionGroups().stream().map(o -> o.getPartition_name()).collect(Collectors.toList());<NEW_LINE>preparedData.setNewPartitionNames(newPartitionNames);<NEW_LINE>preparedData.setTaskType(ComplexTaskMetaManager.ComplexTaskType.MODIFY_PARTITION);<NEW_LINE>}
.getTableName().toString();
118,294
public static List<Column> createQueryColumnTemplateList(String[] cols, Query theQuery, String[] querySQLOutput) {<NEW_LINE>ArrayList<Column> columnTemplateList = new ArrayList<>();<NEW_LINE>theQuery.prepare();<NEW_LINE>// String array of length 1 is to receive extra 'output' field in<NEW_LINE>// addition to<NEW_LINE>// return value<NEW_LINE>querySQLOutput[0] = StringUtils.cache(theQuery.getPlanSQL(ADD_PLAN_INFORMATION));<NEW_LINE>SessionLocal session = theQuery.getSession();<NEW_LINE>ArrayList<Expression<MASK><NEW_LINE>for (int i = 0; i < withExpressions.size(); ++i) {<NEW_LINE>Expression columnExp = withExpressions.get(i);<NEW_LINE>// use the passed in column name if supplied, otherwise use alias<NEW_LINE>// (if found) otherwise use column name derived from column<NEW_LINE>// expression<NEW_LINE>String columnName = cols != null && cols.length > i ? cols[i] : columnExp.getColumnNameForView(session, i);<NEW_LINE>columnTemplateList.add(new Column(columnName, columnExp.getType()));<NEW_LINE>}<NEW_LINE>return columnTemplateList;<NEW_LINE>}
> withExpressions = theQuery.getExpressions();
132,080
public void showHomeFollowingArticles(final RequestContext context) {<NEW_LINE>final Request request = context.getRequest();<NEW_LINE>final JSONObject user = (JSONObject) context.attr(User.USER);<NEW_LINE>final AbstractFreeMarkerRenderer renderer = new SkinRenderer(context, "home/following-articles.ftl");<NEW_LINE>final Map<String, Object> dataModel = renderer.getDataModel();<NEW_LINE>dataModelService.fillHeaderAndFooter(context, dataModel);<NEW_LINE>final int pageNum = Paginator.getPage(request);<NEW_LINE>final int pageSize = Symphonys.USER_HOME_LIST_CNT;<NEW_LINE>final int windowSize = Symphonys.USER_HOME_LIST_WIN_SIZE;<NEW_LINE>fillHomeUser(dataModel, user, roleQueryService);<NEW_LINE>final String followingId = user.optString(Keys.OBJECT_ID);<NEW_LINE>dataModel.put(Follow.FOLLOWING_ID, followingId);<NEW_LINE>avatarQueryService.fillUserAvatarURL(user);<NEW_LINE>final JSONObject followingArticlesResult = followQueryService.getFollowingArticles(followingId, pageNum, pageSize);<NEW_LINE>final List<JSONObject> followingArticles = (List<JSONObject>) followingArticlesResult.opt(Keys.RESULTS);<NEW_LINE>dataModel.put(Common.USER_HOME_FOLLOWING_ARTICLES, followingArticles);<NEW_LINE>final boolean isLoggedIn = (Boolean) dataModel.get(Common.IS_LOGGED_IN);<NEW_LINE>if (isLoggedIn) {<NEW_LINE>final JSONObject currentUser = Sessions.getUser();<NEW_LINE>final String followerId = currentUser.optString(Keys.OBJECT_ID);<NEW_LINE>final boolean isFollowing = followQueryService.isFollowing(followerId, followingId, Follow.FOLLOWING_TYPE_C_USER);<NEW_LINE>dataModel.put(Common.IS_FOLLOWING, isFollowing);<NEW_LINE>for (final JSONObject followingArticle : followingArticles) {<NEW_LINE>final String homeUserFollowingArticleId = followingArticle.optString(Keys.OBJECT_ID);<NEW_LINE>followingArticle.put(Common.IS_FOLLOWING, followQueryService.isFollowing(followerId, homeUserFollowingArticleId, Follow.FOLLOWING_TYPE_C_ARTICLE));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int followingArticleCnt = followingArticlesResult.optInt(Pagination.PAGINATION_RECORD_COUNT);<NEW_LINE>final int pageCount = (int) Math.ceil<MASK><NEW_LINE>final List<Integer> pageNums = Paginator.paginate(pageNum, pageSize, pageCount, windowSize);<NEW_LINE>if (!pageNums.isEmpty()) {<NEW_LINE>dataModel.put(Pagination.PAGINATION_FIRST_PAGE_NUM, pageNums.get(0));<NEW_LINE>dataModel.put(Pagination.PAGINATION_LAST_PAGE_NUM, pageNums.get(pageNums.size() - 1));<NEW_LINE>}<NEW_LINE>dataModel.put(Pagination.PAGINATION_CURRENT_PAGE_NUM, pageNum);<NEW_LINE>dataModel.put(Pagination.PAGINATION_PAGE_COUNT, pageCount);<NEW_LINE>dataModel.put(Pagination.PAGINATION_PAGE_NUMS, pageNums);<NEW_LINE>dataModel.put(Pagination.PAGINATION_RECORD_COUNT, followingArticleCnt);<NEW_LINE>dataModel.put(Common.TYPE, "followingArticles");<NEW_LINE>}
(followingArticleCnt / (double) pageSize);
384,439
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle bundle) {<NEW_LINE>final View view = inflater.inflate(R.layout.conversation_fragment, container, false);<NEW_LINE>list = ViewUtil.findById(view, android.R.id.list);<NEW_LINE>scrollToBottomButton = ViewUtil.findById(view, R.id.scroll_to_bottom_button);<NEW_LINE>floatingLocationButton = ViewUtil.findById(view, R.id.floating_location_button);<NEW_LINE>noMessageTextView = ViewUtil.findById(view, R.id.no_messages_text_view);<NEW_LINE>scrollToBottomButton.<MASK><NEW_LINE>final SetStartingPositionLinearLayoutManager layoutManager = new SetStartingPositionLinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, true);<NEW_LINE>list.setHasFixedSize(false);<NEW_LINE>list.setLayoutManager(layoutManager);<NEW_LINE>list.setItemAnimator(null);<NEW_LINE>new ConversationItemSwipeCallback(msg -> actionMode == null, this::handleReplyMessage).attachToRecyclerView(list);<NEW_LINE>// setLayerType() is needed to allow larger items (long texts in our case)<NEW_LINE>// with hardware layers, drawing may result in errors as "OpenGLRenderer: Path too large to be rendered into a texture"<NEW_LINE>list.setLayerType(View.LAYER_TYPE_SOFTWARE, null);<NEW_LINE>return view;<NEW_LINE>}
setOnClickListener(v -> scrollToBottom());
1,449,468
public ArrayList<Character> transaction(int[] data, int listen, int timeout) throws IOException {<NEW_LINE><MASK><NEW_LINE>packetHandler.sendByte(commandsProto.NRF_TRANSACTION);<NEW_LINE>packetHandler.sendByte(data.length);<NEW_LINE>packetHandler.sendInt(timeout);<NEW_LINE>for (int _data : data) {<NEW_LINE>packetHandler.sendByte(_data);<NEW_LINE>}<NEW_LINE>ArrayList<Character> characterData = new ArrayList<>();<NEW_LINE>int numBytes = packetHandler.getByte();<NEW_LINE>byte[] readData;<NEW_LINE>if (numBytes != -1) {<NEW_LINE>readData = new byte[numBytes];<NEW_LINE>packetHandler.read(readData, numBytes);<NEW_LINE>} else {<NEW_LINE>readData = null;<NEW_LINE>}<NEW_LINE>int val = packetHandler.getAcknowledgement() >> 4;<NEW_LINE>if ((val & 0x1) != 0)<NEW_LINE>Log.e(TAG, "Node not found " + CURRENT_ADDRESS);<NEW_LINE>if ((val & 0x2) != 0)<NEW_LINE>Log.e(TAG, "NRF on-board transmitter not found " + CURRENT_ADDRESS);<NEW_LINE>if ((val & 0x4) != 0 & (listen == 1))<NEW_LINE>Log.e(TAG, "Node received command but did not reply " + CURRENT_ADDRESS);<NEW_LINE>if ((val & 0x7) != 0) {<NEW_LINE>flush();<NEW_LINE>sigs.put(CURRENT_ADDRESS, sigs.get(CURRENT_ADDRESS) * 50 / 51);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>sigs.put(CURRENT_ADDRESS, (sigs.get(CURRENT_ADDRESS) * 50 + 1) / 51);<NEW_LINE>if (readData == null)<NEW_LINE>return characterData;<NEW_LINE>for (int i = 0; i < numBytes; i++) {<NEW_LINE>characterData.add((char) readData[i]);<NEW_LINE>}<NEW_LINE>return characterData;<NEW_LINE>}
packetHandler.sendByte(commandsProto.NRFL01);
103,729
private static Vector apply(CompIntLongVector v1, IntDummyVector v2, Binary op) {<NEW_LINE>IntLongVector[] parts = v1.getPartitions();<NEW_LINE>Storage[] resParts = StorageSwitch.applyComp(v1, v2, op);<NEW_LINE>if (!op.isKeepStorage()) {<NEW_LINE>for (int i = 0; i < parts.length; i++) {<NEW_LINE>if (parts[i].getStorage() instanceof IntLongSortedVectorStorage) {<NEW_LINE>resParts[i] = new IntLongSparseVectorStorage(parts[i].getDim(), parts[i].getStorage().getIndices(), parts[i].<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int subDim = (v1.getDim() + v1.getNumPartitions() - 1) / v1.getNumPartitions();<NEW_LINE>for (int i = 0; i < v1.getDim(); i++) {<NEW_LINE>int pidx = (int) (i / subDim);<NEW_LINE>int subidx = i % subDim;<NEW_LINE>((IntLongVectorStorage) resParts[pidx]).set(subidx, op.apply(parts[pidx].get(subidx), v2.get(i)));<NEW_LINE>}<NEW_LINE>IntLongVector[] res = new IntLongVector[parts.length];<NEW_LINE>int i = 0;<NEW_LINE>for (IntLongVector part : parts) {<NEW_LINE>res[i] = new IntLongVector(part.getMatrixId(), part.getRowId(), part.getClock(), part.getDim(), (IntLongVectorStorage) resParts[i]);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>v1.setPartitions(res);<NEW_LINE>return v1;<NEW_LINE>}
getStorage().getValues());
1,516,359
@SuppressWarnings("FutureReturnValueIgnored")<NEW_LINE>public void run() {<NEW_LINE>if (evicts()) {<NEW_LINE>long weightedSize = weightedSize();<NEW_LINE>setWeightedSize(weightedSize + weight);<NEW_LINE>setWindowWeightedSize(windowWeightedSize() + weight);<NEW_LINE>node.setPolicyWeight(node.getPolicyWeight() + weight);<NEW_LINE>long maximum = maximum();<NEW_LINE>if (weightedSize >= (maximum >>> 1)) {<NEW_LINE>// Lazily initialize when close to the maximum<NEW_LINE>long capacity = isWeighted() <MASK><NEW_LINE>frequencySketch().ensureCapacity(capacity);<NEW_LINE>}<NEW_LINE>K key = node.getKey();<NEW_LINE>if (key != null) {<NEW_LINE>frequencySketch().increment(key);<NEW_LINE>}<NEW_LINE>setMissesInSample(missesInSample() + 1);<NEW_LINE>}<NEW_LINE>// ignore out-of-order write operations<NEW_LINE>boolean isAlive;<NEW_LINE>synchronized (node) {<NEW_LINE>isAlive = node.isAlive();<NEW_LINE>}<NEW_LINE>if (isAlive) {<NEW_LINE>if (expiresAfterWrite()) {<NEW_LINE>writeOrderDeque().add(node);<NEW_LINE>}<NEW_LINE>if (evicts() && (weight > windowMaximum())) {<NEW_LINE>accessOrderWindowDeque().offerFirst(node);<NEW_LINE>} else if (evicts() || expiresAfterAccess()) {<NEW_LINE>accessOrderWindowDeque().offerLast(node);<NEW_LINE>}<NEW_LINE>if (expiresVariable()) {<NEW_LINE>timerWheel().schedule(node);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Ensure that in-flight async computation cannot expire (reset on a completion callback)<NEW_LINE>if (isComputingAsync(node)) {<NEW_LINE>synchronized (node) {<NEW_LINE>if (!Async.isReady((CompletableFuture<?>) node.getValue())) {<NEW_LINE>long expirationTime = expirationTicker().read() + ASYNC_EXPIRY;<NEW_LINE>setVariableTime(node, expirationTime);<NEW_LINE>setAccessTime(node, expirationTime);<NEW_LINE>setWriteTime(node, expirationTime);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
? data.mappingCount() : maximum;
616,375
private BackupState fetchAndBackupItems(BackupConfig config) {<NEW_LINE>BackupCursors cursors = null;<NEW_LINE>try {<NEW_LINE>final ContactGroupIds groupIds = contactAccessor.getGroupContactIds(service.getContentResolver(), config.groupToBackup);<NEW_LINE>cursors = new BulkFetcher(fetcher).fetch(config.<MASK><NEW_LINE>final int itemsToSync = cursors.count();<NEW_LINE>if (itemsToSync > 0) {<NEW_LINE>appLog(R.string.app_log_backup_messages, cursors.count(SMS), cursors.count(MMS), cursors.count(CALLLOG));<NEW_LINE>if (config.debug) {<NEW_LINE>appLog(R.string.app_log_backup_messages_with_config, config);<NEW_LINE>}<NEW_LINE>return backupCursors(cursors, config.imapStore, config.backupType, itemsToSync);<NEW_LINE>} else {<NEW_LINE>appLog(R.string.app_log_skip_backup_no_items);<NEW_LINE>if (preferences.isFirstBackup()) {<NEW_LINE>// If this is the first backup we need to write something to MAX_SYNCED_DATE<NEW_LINE>// such that we know that we've performed a backup before.<NEW_LINE>preferences.getDataTypePreferences().setMaxSyncedDate(SMS, MAX_SYNCED_DATE);<NEW_LINE>preferences.getDataTypePreferences().setMaxSyncedDate(MMS, MAX_SYNCED_DATE);<NEW_LINE>}<NEW_LINE>Log.i(TAG, "Nothing to do.");<NEW_LINE>return transition(FINISHED_BACKUP, null);<NEW_LINE>}<NEW_LINE>} catch (XOAuth2AuthenticationFailedException e) {<NEW_LINE>return handleAuthError(config, e);<NEW_LINE>} catch (AuthenticationFailedException e) {<NEW_LINE>return transition(ERROR, e);<NEW_LINE>} catch (MessagingException e) {<NEW_LINE>return transition(ERROR, e);<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>return transition(ERROR, e);<NEW_LINE>} finally {<NEW_LINE>if (cursors != null) {<NEW_LINE>cursors.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
typesToBackup, groupIds, config.maxItemsPerSync);
1,324,289
protected void onBindPreferenceViewHolder(Preference preference, PreferenceViewHolder holder) {<NEW_LINE>super.onBindPreferenceViewHolder(preference, holder);<NEW_LINE>String key = preference.getKey();<NEW_LINE>if (key == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final View itemView = holder.itemView;<NEW_LINE>if (preference instanceof CheckBoxPreference) {<NEW_LINE>SimulationMode mode = SimulationMode.getMode(key);<NEW_LINE>if (mode != null) {<NEW_LINE>TextView description = itemView.findViewById(R.id.description);<NEW_LINE>boolean checked = ((CheckBoxPreference) preference).isChecked();<NEW_LINE>description.setVisibility(checked ? View.VISIBLE : View.GONE);<NEW_LINE>String str = <MASK><NEW_LINE>SpannableString spanDescription = new SpannableString(str);<NEW_LINE>if (mode == SimulationMode.REALISTIC) {<NEW_LINE>int startLine = 0;<NEW_LINE>int endLine = 0;<NEW_LINE>int dp8 = AndroidUtils.dpToPx(itemView.getContext(), 8f);<NEW_LINE>while (endLine < str.length()) {<NEW_LINE>endLine = str.indexOf("\n", startLine);<NEW_LINE>endLine = endLine > 0 ? endLine : str.length();<NEW_LINE>spanDescription.setSpan(new BulletSpan(dp8), startLine, endLine, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);<NEW_LINE>startLine = endLine + 1;<NEW_LINE>}<NEW_LINE>AndroidUtils.setPadding(description, dp8, 0, 0, 0);<NEW_LINE>}<NEW_LINE>description.setText(spanDescription);<NEW_LINE>View slider = itemView.findViewById(R.id.slider_group);<NEW_LINE>if (slider != null) {<NEW_LINE>slider.setVisibility(checked ? View.VISIBLE : View.GONE);<NEW_LINE>if (checked) {<NEW_LINE>setupSpeedSlider(itemView, mode.getTitle());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>View divider = itemView.findViewById(R.id.divider);<NEW_LINE>if (mode != SimulationMode.REALISTIC) {<NEW_LINE>divider.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>divider.setVisibility(View.INVISIBLE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getString(mode.getDescription());
1,525,591
public CompletableFuture<JobResponse> nodeOperation(final JobRequest request) {<NEW_LINE>RootTask.Builder contextBuilder = tasksService.newBuilder(request.jobId(), request.sessionSettings().userName(), request.coordinatorNodeId(), Collections.emptySet());<NEW_LINE>SharedShardContexts sharedShardContexts = maybeInstrumentProfiler(<MASK><NEW_LINE>List<CompletableFuture<StreamBucket>> directResponseFutures = jobSetup.prepareOnRemote(request.sessionSettings(), request.nodeOperations(), contextBuilder, sharedShardContexts);<NEW_LINE>try {<NEW_LINE>RootTask context = tasksService.createTask(contextBuilder);<NEW_LINE>context.start();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>return CompletableFuture.failedFuture(t);<NEW_LINE>}<NEW_LINE>if (directResponseFutures.size() == 0) {<NEW_LINE>return CompletableFuture.completedFuture(new JobResponse(List.of()));<NEW_LINE>} else {<NEW_LINE>return CompletableFutures.allAsList(directResponseFutures).thenApply(JobResponse::new);<NEW_LINE>}<NEW_LINE>}
request.enableProfiling(), contextBuilder);
1,444,063
// for api level >=23<NEW_LINE>public static Object makeNativeLibraryElement(File dir) throws IOException {<NEW_LINE>if (Build.VERSION.SDK_INT > 25 || Build.VERSION.SDK_INT == 25 && Build.VERSION.PREVIEW_SDK_INT > 0) {<NEW_LINE>try {<NEW_LINE>Class NativeLibraryElement = Class.forName("dalvik.system.DexPathList$NativeLibraryElement");<NEW_LINE>Class[] oconstructorArgs = { File.class };<NEW_LINE>Constructor constructor = NativeLibraryElement.getDeclaredConstructor(oconstructorArgs);<NEW_LINE>constructor.setAccessible(true);<NEW_LINE>return constructor.newInstance(dir);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IOException("make nativeElement fail", e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>Class Element = Class.forName("dalvik.system.DexPathList$Element");<NEW_LINE>Constructor <MASK><NEW_LINE>if (cons != null) {<NEW_LINE>return cons.newInstance(dir, true, null, null);<NEW_LINE>} else {<NEW_LINE>throw new IOException("make nativeElement fail | error constructor");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IOException("make nativeElement fail", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
cons = getElementConstructor(Element, constructorArgs1);
1,513,545
protected void onPollingResponse(HttpClientRequest request, Response response, AttributeRef attributeRef, HTTPAgentLink agentLink) {<NEW_LINE>int responseCode = response != null ? response.getStatus() : 500;<NEW_LINE>Object value = null;<NEW_LINE>if (response != null && response.hasEntity() && response.getStatusInfo().getFamily() == Response.Status.Family.SUCCESSFUL) {<NEW_LINE>try {<NEW_LINE>boolean binaryMode = agent.getMessageConvertBinary().orElse(agentLink.isMessageConvertBinary());<NEW_LINE>boolean hexMode = agent.getMessageConvertHex().orElse(agentLink.isMessageConvertHex());<NEW_LINE>if (hexMode || binaryMode) {<NEW_LINE>byte[] bytes = response.readEntity(byte[].class);<NEW_LINE>value = hexMode ? ProtocolUtil.bytesToHexString(bytes<MASK><NEW_LINE>} else {<NEW_LINE>value = response.readEntity(String.class);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.log(Level.WARNING, "Error occurred whilst trying to read response body", e);<NEW_LINE>response.close();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.fine(prefixLogMessage("Request returned an un-successful response code (" + responseCode + "):" + request.requestTarget.getUriBuilder().build().toString()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (attributeRef != null) {<NEW_LINE>updateLinkedAttribute(new AttributeState(attributeRef, value));<NEW_LINE>// Look for any attributes that also want to use this polling response<NEW_LINE>synchronized (pollingLinkedAttributeMap) {<NEW_LINE>Set<AttributeRef> linkedRefs = pollingLinkedAttributeMap.get(attributeRef);<NEW_LINE>if (linkedRefs != null) {<NEW_LINE>Object finalValue = value;<NEW_LINE>linkedRefs.forEach(ref -> updateLinkedAttribute(new AttributeState(ref, finalValue)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
) : ProtocolUtil.bytesToBinaryString(bytes);
567,250
public void lazyEnlist(LazyEnlistableConnectionManager lazyEnlistableConnectionManager) throws ResourceException {<NEW_LINE>if (tc.isEntryEnabled()) {<NEW_LINE>Tr.entry(tc, "lazyEnlist", this);<NEW_LINE>}<NEW_LINE>// Signal the ConnectionManager directly to lazily enlist.<NEW_LINE>// ['if/else' block added under LIDB2110.16]<NEW_LINE>if (// Already enlisted; don't need to do anything.<NEW_LINE>isLazyEnlisted) {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "lazyEnlist", new Object[] { Boolean.FALSE, "ManagedConnection is already enlisted in a transaction.", this });<NEW_LINE>} else {<NEW_LINE>lazyEnlistableConnectionManager.lazyEnlist(this);<NEW_LINE>// Indicate we lazily enlisted in the current transaction, if so.<NEW_LINE>isLazyEnlisted = stateMgr.transtate != StateManager.NO_TRANSACTION_ACTIVE;<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "lazyEnlist", isLazyEnlisted ? <MASK><NEW_LINE>}<NEW_LINE>}
Boolean.TRUE : Boolean.FALSE);
1,196,156
public static void validateBiomeNames() {<NEW_LINE>Set<ResourceLocation> invalids = new HashSet<>();<NEW_LINE>addInvalidBiomeNames(excessiveBiomes, invalids);<NEW_LINE>addInvalidBiomeNames(excludedBiomes, invalids);<NEW_LINE>addInvalidBiomeNames(surfaceDepositBiomes, invalids);<NEW_LINE>if (invalids.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<ResourceLocation> invalidList = new ArrayList<>();<NEW_LINE>invalidList.addAll(invalids);<NEW_LINE>Collections.sort(invalidList, Comparator.comparing(ResourceLocation::toString));<NEW_LINE>List<ResourceLocation> allValid = new ArrayList<>();<NEW_LINE>allValid.addAll(ForgeRegistries.BIOMES.getKeys());<NEW_LINE>Collections.sort(allValid, Comparator<MASK><NEW_LINE>BCLog.logger.warn("****************************************************");<NEW_LINE>BCLog.logger.warn("*");<NEW_LINE>BCLog.logger.warn("* Unknown biome name detected in buildcraft config!");<NEW_LINE>BCLog.logger.warn("* (Config file = " + BCCoreConfig.config.getConfigFile().getAbsolutePath() + ")");<NEW_LINE>BCLog.logger.warn("*");<NEW_LINE>BCLog.logger.warn("* Unknown biomes: ");<NEW_LINE>printList(Level.WARN, invalidList);<NEW_LINE>BCLog.logger.warn("*");<NEW_LINE>BCLog.logger.info("* All possible known names: ");<NEW_LINE>printList(Level.INFO, allValid);<NEW_LINE>BCLog.logger.info("*");<NEW_LINE>BCLog.logger.warn("****************************************************");<NEW_LINE>}
.comparing(ResourceLocation::toString));
1,365,638
public AdminUserGlobalSignOutResult adminUserGlobalSignOut(AdminUserGlobalSignOutRequest adminUserGlobalSignOutRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(adminUserGlobalSignOutRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AdminUserGlobalSignOutRequest> request = null;<NEW_LINE>Response<AdminUserGlobalSignOutResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AdminUserGlobalSignOutRequestMarshaller().marshall(adminUserGlobalSignOutRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Unmarshaller<AdminUserGlobalSignOutResult, JsonUnmarshallerContext> unmarshaller = new AdminUserGlobalSignOutResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<AdminUserGlobalSignOutResult> responseHandler = new JsonResponseHandler<AdminUserGlobalSignOutResult>(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>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
827,181
String dumpTx(ZooStore<FateCommand> zs, String[] args) {<NEW_LINE>List<Long> txids;<NEW_LINE>if (args.length == 1) {<NEW_LINE>txids = zs.list();<NEW_LINE>} else {<NEW_LINE>txids = new ArrayList<>();<NEW_LINE>for (int i = 1; i < args.length; i++) {<NEW_LINE>txids.add(parseTxid(args[i]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Gson gson = new GsonBuilder().registerTypeAdapter(ReadOnlyRepo.class, new InterfaceSerializer<>()).registerTypeAdapter(Repo.class, new InterfaceSerializer<>()).registerTypeAdapter(byte[].class, new ByteArraySerializer()).setPrettyPrinting().create();<NEW_LINE>List<FateStack> <MASK><NEW_LINE>for (Long txid : txids) {<NEW_LINE>List<ReadOnlyRepo<FateCommand>> repoStack = zs.getStack(txid);<NEW_LINE>txStacks.add(new FateStack(txid, repoStack));<NEW_LINE>}<NEW_LINE>return gson.toJson(txStacks);<NEW_LINE>}
txStacks = new ArrayList<>();
1,254,959
private static Timestamp<?> on(@SuppressWarnings("rawtypes") Map map, boolean meta) {<NEW_LINE>String tsField = meta ? MongoDBRiver.LAST_TIMESTAMP_FIELD : MongoDBRiver.OPLOG_TIMESTAMP;<NEW_LINE>Object timestamp = map.get(tsField);<NEW_LINE>if (timestamp == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (timestamp instanceof String) {<NEW_LINE>timestamp = JSON.parse((String) timestamp);<NEW_LINE>}<NEW_LINE>if (timestamp instanceof BSONTimestamp) {<NEW_LINE>BSON result = new Timestamp.BSON((BSONTimestamp) timestamp);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (timestamp instanceof Date) {<NEW_LINE>String gtidField = meta ? MongoDBRiver.LAST_GTID_FIELD : MongoDBRiver.MONGODB_ID_FIELD;<NEW_LINE>Object id = map.get(gtidField);<NEW_LINE>GTID result = null;<NEW_LINE>if (id == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (id instanceof String) {<NEW_LINE>id = JSON.parse((String) id);<NEW_LINE>}<NEW_LINE>if (id instanceof Binary) {<NEW_LINE>result = new Timestamp.GTID(((Binary) id).getData(), (Date) timestamp);<NEW_LINE>} else if (id instanceof byte[]) {<NEW_LINE>result = new Timestamp.GTID((byte[]) id, (Date) timestamp);<NEW_LINE>}<NEW_LINE>if (result == null) {<NEW_LINE>throw new IllegalStateException("Unable to parse " + gtidField + " " + id + " of type " + id.getClass());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>throw new IllegalStateException("Unable to parse " + tsField + " " + timestamp + " of type " + timestamp.getClass());<NEW_LINE>}
throw new IllegalStateException("Missing property: " + gtidField);
78,485
private void copyDeclarations(JavascriptClass superClass, JavascriptClass subClass, Node inheritsCall) {<NEW_LINE>for (Node staticGetProp : superClass.staticFieldAccess) {<NEW_LINE>checkState(staticGetProp.isGetProp());<NEW_LINE>String memberName = staticGetProp.getString();<NEW_LINE>// We only copy declarations that have corresponding Object.defineProperties<NEW_LINE>if (!superClass.definedProperties.contains(memberName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// If the subclass already declares the property no need to redeclare it.<NEW_LINE>if (isOverriden(subClass, memberName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Node subclassNameNode = inheritsCall.getSecondChild();<NEW_LINE>Node getprop = IR.getprop(subclassNameNode.cloneTree(), memberName);<NEW_LINE>getprop.setJSDocInfo(null);<NEW_LINE>Node declaration = IR.exprResult(getprop);<NEW_LINE>declaration.srcrefTreeIfMissing(inheritsCall);<NEW_LINE><MASK><NEW_LINE>declaration.insertBefore(parent);<NEW_LINE>compiler.reportChangeToEnclosingScope(parent);<NEW_LINE>// Copy over field access so that subclasses of this subclass can also make the declarations<NEW_LINE>if (!subClass.definedProperties.contains(memberName)) {<NEW_LINE>subClass.staticFieldAccess.add(getprop);<NEW_LINE>subClass.definedProperties.add(memberName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Node parent = inheritsCall.getParent();
1,761,515
private void generateRangeCoordinatesRecursive(final List<String> vars, final int idx, final String praefix, final List<Pair<String, Geopoint>> result) {<NEW_LINE>if (idx < vars.size()) {<NEW_LINE>final String var = vars.get(idx);<NEW_LINE>final VariableMap.VariableState <MASK><NEW_LINE>for (int i = 0; i < Objects.requireNonNull(Objects.requireNonNull(state).getFormula()).getRangeIndexSize(); i++) {<NEW_LINE>varList.setRangeIndex(var, i);<NEW_LINE>generateRangeCoordinatesRecursive(vars, idx + 1, (praefix == null ? "" : praefix + ", ") + var + "=" + varList.getValue(var), result);<NEW_LINE>}<NEW_LINE>varList.setRangeIndex(var, 0);<NEW_LINE>} else {<NEW_LINE>final Geopoint gp = calcCoord.calculateGeopoint(varList::getValue);<NEW_LINE>if (gp != null) {<NEW_LINE>result.add(new Pair<>(praefix, gp));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
state = varList.getState(var);
746,868
private static void validateArgumentCombination(CommandLine args) throws CliArgumentsException {<NEW_LINE>if (!args.hasOption(HELP_OPTION) && !args.hasOption(VERSION_OPTION)) {<NEW_LINE>if (!args.hasOption(ENDPOINT_OPTION)) {<NEW_LINE>throw new CliArgumentsException("Endpoint must be specified");<NEW_LINE>}<NEW_LINE>if (args.hasOption(FILE_OPTION) == args.hasOption(STDIN_OPTION)) {<NEW_LINE>throw new CliArgumentsException(String.format("Either option '%s' or '%s' must be specified", FILE_OPTION, STDIN_OPTION));<NEW_LINE>}<NEW_LINE>if (args.hasOption(CERTIFICATE_OPTION) != args.hasOption(PRIVATE_KEY_OPTION)) {<NEW_LINE>throw new CliArgumentsException(String.format<MASK><NEW_LINE>}<NEW_LINE>} else if (args.hasOption(HELP_OPTION) && args.hasOption(VERSION_OPTION)) {<NEW_LINE>throw new CliArgumentsException(String.format("Cannot specify both '%s' and '%s'", HELP_OPTION, VERSION_OPTION));<NEW_LINE>}<NEW_LINE>}
("Both '%s' and '%s' must be specified together", CERTIFICATE_OPTION, PRIVATE_KEY_OPTION));
1,604,554
public static ValueSetAutocompleteOptions validateAndParseOptions(DaoConfig theDaoConfig, IPrimitiveType<String> theContext, IPrimitiveType<String> theFilter, IPrimitiveType<Integer> theCount, IIdType theId, IPrimitiveType<String> theUrl, IBaseResource theValueSet) {<NEW_LINE>boolean haveId = theId <MASK><NEW_LINE>boolean haveIdentifier = theUrl != null && isNotBlank(theUrl.getValue());<NEW_LINE>boolean haveValueSet = theValueSet != null && !theValueSet.isEmpty();<NEW_LINE>if (haveId || haveIdentifier || haveValueSet) {<NEW_LINE>throw new InvalidRequestException(Msg.code(2020) + "$expand with contexDirection='existing' is only supported at the type leve. It is not supported at instance level, with a url specified, or with a ValueSet .");<NEW_LINE>}<NEW_LINE>if (!theDaoConfig.isAdvancedLuceneIndexing()) {<NEW_LINE>throw new InvalidRequestException(Msg.code(2022) + "$expand with contexDirection='existing' requires Extended Lucene Indexing.");<NEW_LINE>}<NEW_LINE>if (theContext == null || theContext.isEmpty()) {<NEW_LINE>throw new InvalidRequestException(Msg.code(2021) + "$expand with contexDirection='existing' requires a context");<NEW_LINE>}<NEW_LINE>String filter = theFilter == null ? null : theFilter.getValue();<NEW_LINE>ValueSetAutocompleteOptions result = new ValueSetAutocompleteOptions(theContext.getValue(), filter, IPrimitiveType.toValueOrNull(theCount));<NEW_LINE>if (!ourSupportedModifiers.contains(defaultString(result.getSearchParamModifier()))) {<NEW_LINE>throw new InvalidRequestException(Msg.code(2069) + "$expand with contexDirection='existing' only supports plain token search, or the :text modifier. Received " + result.getSearchParamModifier());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
!= null && theId.hasIdPart();
768,596
public FileEntity postFoldersPath(String path) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'path' is set<NEW_LINE>if (path == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'path' when calling postFoldersPath");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/folders/{path}".replaceAll("\\{" + "path" + "\\}", apiClient.escapeString(path.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] <MASK><NEW_LINE>GenericType<FileEntity> localVarReturnType = new GenericType<FileEntity>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
localVarAuthNames = new String[] {};
1,564,550
private void genBitSet(BitSet p, int id) {<NEW_LINE>int _tabs_ = tabs;<NEW_LINE>// wanna have bitsets on module scope, so they are available<NEW_LINE>// when module gets loaded.<NEW_LINE>tabs = 0;<NEW_LINE>println("");<NEW_LINE>println("### generate bit set");<NEW_LINE>println("def mk" + getBitsetName(id) + "(): ");<NEW_LINE>tabs++;<NEW_LINE><MASK><NEW_LINE>if (n < BITSET_OPTIMIZE_INIT_THRESHOLD) {<NEW_LINE>println("### var1");<NEW_LINE>println("data = [ " + p.toStringOfWords() + "]");<NEW_LINE>} else {<NEW_LINE>// will init manually, allocate space then set values<NEW_LINE>println("data = [0L] * " + n + " ### init list");<NEW_LINE>long[] elems = p.toPackedArray();<NEW_LINE>for (int i = 0; i < elems.length; ) {<NEW_LINE>if (elems[i] == 0) {<NEW_LINE>// done automatically by Java, don't waste time/code<NEW_LINE>i++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if ((i + 1) == elems.length || elems[i] != elems[i + 1]) {<NEW_LINE>// last number or no run of numbers, just dump assignment<NEW_LINE>println("data[" + i + "] =" + elems[i] + "L");<NEW_LINE>i++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// scan to find end of run<NEW_LINE>int j;<NEW_LINE>for (j = i + 1; j < elems.length && elems[j] == elems[i]; j++) {<NEW_LINE>}<NEW_LINE>long e = elems[i];<NEW_LINE>// E0007: fixed<NEW_LINE>println("for x in xrange(" + i + ", " + j + "):");<NEW_LINE>tabs++;<NEW_LINE>println("data[x] = " + e + "L");<NEW_LINE>tabs--;<NEW_LINE>i = j;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>println("return data");<NEW_LINE>tabs--;<NEW_LINE>// BitSet object<NEW_LINE>println(getBitsetName(id) + " = antlr.BitSet(mk" + getBitsetName(id) + "())");<NEW_LINE>// restore tabs<NEW_LINE>tabs = _tabs_;<NEW_LINE>}
int n = p.lengthInLongWords();
1,499,556
public static void main(String[] args) throws Exception {<NEW_LINE>if (args.length != 4 && args.length != 5) {<NEW_LINE>System.err.printf("Expected 4 or 5 parameters, got %d\n", args.length);<NEW_LINE>System.err.println("Usage: java AeadExample encrypt/decrypt key-file input-file output-file" + " [associated-data]");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>String mode = args[0];<NEW_LINE>File keyFile = new File(args[1]);<NEW_LINE>File inputFile = new File(args[2]);<NEW_LINE>File outputFile = <MASK><NEW_LINE>byte[] associatedData = new byte[0];<NEW_LINE>if (args.length == 5) {<NEW_LINE>associatedData = args[4].getBytes(UTF_8);<NEW_LINE>}<NEW_LINE>// Register all AEAD key types with the Tink runtime.<NEW_LINE>AeadConfig.register();<NEW_LINE>// Read the keyset into a KeysetHandle.<NEW_LINE>KeysetHandle handle = null;<NEW_LINE>try {<NEW_LINE>handle = CleartextKeysetHandle.read(JsonKeysetReader.withFile(keyFile));<NEW_LINE>} catch (GeneralSecurityException | IOException ex) {<NEW_LINE>System.err.println("Cannot read keyset, got error: " + ex);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>// Get the primitive.<NEW_LINE>Aead aead = null;<NEW_LINE>try {<NEW_LINE>aead = handle.getPrimitive(Aead.class);<NEW_LINE>} catch (GeneralSecurityException ex) {<NEW_LINE>System.err.println("Cannot create primitive, got error: " + ex);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>// Use the primitive to encrypt/decrypt files.<NEW_LINE>if (MODE_ENCRYPT.equals(mode)) {<NEW_LINE>byte[] plaintext = Files.readAllBytes(inputFile.toPath());<NEW_LINE>byte[] ciphertext = aead.encrypt(plaintext, associatedData);<NEW_LINE>try (FileOutputStream stream = new FileOutputStream(outputFile)) {<NEW_LINE>stream.write(ciphertext);<NEW_LINE>}<NEW_LINE>} else if (MODE_DECRYPT.equals(mode)) {<NEW_LINE>byte[] ciphertext = Files.readAllBytes(inputFile.toPath());<NEW_LINE>byte[] plaintext = aead.decrypt(ciphertext, associatedData);<NEW_LINE>try (FileOutputStream stream = new FileOutputStream(outputFile)) {<NEW_LINE>stream.write(plaintext);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.err.println("The first argument must be either encrypt or decrypt, got: " + mode);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>System.exit(0);<NEW_LINE>}
new File(args[3]);
653,819
public void run(Transaction tx, Key userKey, Void arg) {<NEW_LINE>Entity user = tx.get(userKey);<NEW_LINE>if (user == null) {<NEW_LINE>System.out.printf("User '%s' does not exist.%n", userKey.getName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (user.contains("contact")) {<NEW_LINE>FullEntity<IncompleteKey> contact = user.getEntity("contact");<NEW_LINE>String email = contact.getString("email");<NEW_LINE>String phone = contact.getString("phone");<NEW_LINE>System.out.printf("User '%s' email is '%s', phone is '%s'.%n", userKey.getName(), email, phone);<NEW_LINE>}<NEW_LINE>System.out.printf("User '%s' has %d comment[s].%n", userKey.getName(), user.getLong("count"));<NEW_LINE>int limit = 200;<NEW_LINE>Map<Timestamp, String> sortedComments = new TreeMap<>();<NEW_LINE>StructuredQuery<Entity> query = Query.newEntityQueryBuilder().setNamespace(NAMESPACE).setKind(COMMENT_KIND).setFilter(PropertyFilter.hasAncestor(userKey)).<MASK><NEW_LINE>while (true) {<NEW_LINE>QueryResults<Entity> results = tx.run(query);<NEW_LINE>int resultCount = 0;<NEW_LINE>while (results.hasNext()) {<NEW_LINE>Entity result = results.next();<NEW_LINE>sortedComments.put(result.getTimestamp("timestamp"), result.getString("content"));<NEW_LINE>resultCount++;<NEW_LINE>}<NEW_LINE>if (resultCount < limit) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>query = query.toBuilder().setStartCursor(results.getCursorAfter()).build();<NEW_LINE>}<NEW_LINE>// We could have added "ORDER BY timestamp" to the query to avoid sorting, but that would<NEW_LINE>// require adding an ancestor index for timestamp.<NEW_LINE>// See: https://cloud.google.com/datastore/docs/tools/indexconfig<NEW_LINE>for (Map.Entry<Timestamp, String> entry : sortedComments.entrySet()) {<NEW_LINE>System.out.printf("\t%s: %s%n", entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}
setLimit(limit).build();
727,592
final CreateEventTrackerResult executeCreateEventTracker(CreateEventTrackerRequest createEventTrackerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createEventTrackerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateEventTrackerRequest> request = null;<NEW_LINE>Response<CreateEventTrackerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateEventTrackerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createEventTrackerRequest));<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, "Personalize");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateEventTracker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateEventTrackerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateEventTrackerResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,026,280
private BaseBottomSheetItem createAddNewCategoryItem() {<NEW_LINE>OsmandApplication app = requiredMyApplication();<NEW_LINE>View container = UiUtilities.getInflater(app, nightMode).inflate(R.layout.bottom_sheet_item_with_descr_64dp, null);<NEW_LINE>container.setMinimumHeight(getResources().getDimensionPixelSize(R.dimen.bottom_sheet_list_item_height));<NEW_LINE>TextView title = container.findViewById(R.id.title);<NEW_LINE>Typeface typeface = FontCache.getRobotoMedium(getContext());<NEW_LINE>title.setTypeface(typeface);<NEW_LINE>AndroidUiHelper.updateVisibility(container.findViewById(R<MASK><NEW_LINE>return new SimpleBottomSheetItem.Builder().setTitle(getString(R.string.add_group)).setTitleColorId(ColorUtilities.getActiveColorId(nightMode)).setIcon(getActiveIcon(R.drawable.ic_action_folder_add)).setOnClickListener(v -> showAddNewCategoryFragment()).setCustomView(container).create();<NEW_LINE>}
.id.description), false);
7,159
public static DescribeHotDbListResponse unmarshall(DescribeHotDbListResponse describeHotDbListResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeHotDbListResponse.setRequestId(_ctx.stringValue("DescribeHotDbListResponse.RequestId"));<NEW_LINE>describeHotDbListResponse.setSuccess(_ctx.booleanValue("DescribeHotDbListResponse.Success"));<NEW_LINE>describeHotDbListResponse.setMsg(_ctx.stringValue("DescribeHotDbListResponse.Msg"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setRandomCode(_ctx.stringValue("DescribeHotDbListResponse.Data.RandomCode"));<NEW_LINE>List<InstanceDb> list = new ArrayList<InstanceDb>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeHotDbListResponse.Data.List.Length"); i++) {<NEW_LINE>InstanceDb instanceDb = new InstanceDb();<NEW_LINE>instanceDb.setInstanceName(_ctx.stringValue("DescribeHotDbListResponse.Data.List[" + i + "].InstanceName"));<NEW_LINE>List<String> hotDbList <MASK><NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeHotDbListResponse.Data.List[" + i + "].HotDbList.Length"); j++) {<NEW_LINE>hotDbList.add(_ctx.stringValue("DescribeHotDbListResponse.Data.List[" + i + "].HotDbList[" + j + "]"));<NEW_LINE>}<NEW_LINE>instanceDb.setHotDbList(hotDbList);<NEW_LINE>list.add(instanceDb);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>describeHotDbListResponse.setData(data);<NEW_LINE>return describeHotDbListResponse;<NEW_LINE>}
= new ArrayList<String>();
1,102,225
public void testCopyFuture() throws Exception {<NEW_LINE>ManagedExecutor executor = ManagedExecutor.builder().propagated(TestContextTypes.STATE).cleared(ThreadContext.ALL_REMAINING).build();<NEW_LINE>CurrentLocation.setLocation("Minneapolis", "Minnesota");<NEW_LINE>CompletableFuture<String> unmanagedFuture = new CompletableFuture<String>();<NEW_LINE>CompletableFuture<String> copy = executor.copy(unmanagedFuture);<NEW_LINE>CompletableFuture<String> dependentStage = copy.thenApplyAsync(s -> {<NEW_LINE>try {<NEW_LINE>fail("Should not be able to look up " + InitialContext.doLookup("java:module/env/defaultExecutorRef"));<NEW_LINE>} catch (NamingException x) {<NEW_LINE>// expected because application context should be cleared<NEW_LINE>}<NEW_LINE>String city = CurrentLocation.getCity();<NEW_LINE>return s + ("".equals(city) ? CurrentLocation.getState() : (city + ", " + CurrentLocation.getState()));<NEW_LINE>});<NEW_LINE>CurrentLocation.setLocation("Des Moines", "Iowa");<NEW_LINE>assertFalse(copy.isDone());<NEW_LINE>unmanagedFuture.complete("Arriving in ");<NEW_LINE>assertEquals("Arriving in Minnesota", dependentStage.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertTrue(copy.isDone());<NEW_LINE>// Complete the copy stage before the original<NEW_LINE>unmanagedFuture = new CompletableFuture<String>();<NEW_LINE>copy = executor.copy(unmanagedFuture);<NEW_LINE>dependentStage = copy.thenApplyAsync(s -> s + CurrentLocation.getState());<NEW_LINE>CurrentLocation.setLocation("Madison", "Wisconsin");<NEW_LINE>assertFalse(copy.isDone());<NEW_LINE>copy.complete("You are now in ");<NEW_LINE>assertEquals("You are now in Iowa", dependentStage.get<MASK><NEW_LINE>assertTrue(copy.isDone());<NEW_LINE>// Because the copy was completed separately, the original can complete after this point with a different value.<NEW_LINE>assertTrue(unmanagedFuture.complete("ABCDE"));<NEW_LINE>assertEquals("ABCDE", unmanagedFuture.getNow("F"));<NEW_LINE>assertEquals("You are now in ", copy.getNow("G"));<NEW_LINE>executor.shutdown();<NEW_LINE>}
(TIMEOUT_NS, TimeUnit.NANOSECONDS));
1,630,228
// TODO: convert to for loops?<NEW_LINE>@Override<NEW_LINE>public boolean fillTemplate(IFilledTemplate filledTemplate, IStatementParameter[] params) {<NEW_LINE>PatternParameterYDir yDir = getParam(0, params, PatternParameterYDir.UP);<NEW_LINE>PatternParameterXZDir xzDir = getParam(1, params, PatternParameterXZDir.EAST);<NEW_LINE>int y = yDir == PatternParameterYDir.UP ? 0 : filledTemplate.getMax().getY();<NEW_LINE>final int yStep = yDir == <MASK><NEW_LINE>final int yEnd = yDir == PatternParameterYDir.UP ? filledTemplate.getMax().getY() + 1 : -1;<NEW_LINE>int fx = 0;<NEW_LINE>int fz = 0;<NEW_LINE>int tx = filledTemplate.getMax().getX();<NEW_LINE>int tz = filledTemplate.getMax().getZ();<NEW_LINE>while (y != yEnd) {<NEW_LINE>filledTemplate.setAreaXZ(fx, tx, y, fz, tz, true);<NEW_LINE>fx += xzDir.dir.getFrontOffsetX() > 0 ? 1 : 0;<NEW_LINE>fz += xzDir.dir.getFrontOffsetZ() > 0 ? 1 : 0;<NEW_LINE>tx += xzDir.dir.getFrontOffsetX() < 0 ? -1 : 0;<NEW_LINE>tz += xzDir.dir.getFrontOffsetZ() < 0 ? -1 : 0;<NEW_LINE>y += yStep;<NEW_LINE>if (fx > tx)<NEW_LINE>break;<NEW_LINE>if (fz > tz)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
PatternParameterYDir.UP ? 1 : -1;
263,632
public Block readBlock(SliceInput sliceInput) {<NEW_LINE>SliceType dataType = null;<NEW_LINE>CharsetName charsetName = Optional.of(sliceInput.readInt()).map(i -> {<NEW_LINE>byte[] bs = new byte[i];<NEW_LINE>sliceInput.readBytes(bs);<NEW_LINE>String c = new String(bs, UTF8);<NEW_LINE>return c;<NEW_LINE>}).map(CharsetName::of).orElse(CharsetName.defaultCharset());<NEW_LINE>CollationName collationName = Optional.of(sliceInput.readInt()).map(i -> {<NEW_LINE>byte[] bs = new byte[i];<NEW_LINE>sliceInput.readBytes(bs);<NEW_LINE>String c = new String(bs, UTF8);<NEW_LINE>return c;<NEW_LINE>}).map(CollationName::of).orElse(CollationName.defaultCollation());<NEW_LINE>dataType <MASK><NEW_LINE>int positionCount = sliceInput.readInt();<NEW_LINE>boolean[] valueIsNull = decodeNullBits(sliceInput, positionCount);<NEW_LINE>boolean existNonNull = sliceInput.readBoolean();<NEW_LINE>int[] offset = new int[0];<NEW_LINE>Slice data = Slices.EMPTY_SLICE;<NEW_LINE>if (existNonNull) {<NEW_LINE>offset = new int[positionCount];<NEW_LINE>for (int position = 0; position < positionCount; position++) {<NEW_LINE>offset[position] = sliceInput.readInt();<NEW_LINE>}<NEW_LINE>int maxOffset = offset[positionCount - 1];<NEW_LINE>if (maxOffset > 0) {<NEW_LINE>int length = sliceInput.readInt();<NEW_LINE>Slice subRegion = sliceInput.readSlice(length);<NEW_LINE>data = Slices.copyOf(subRegion);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new SliceBlock(dataType, 0, positionCount, valueIsNull, offset, data);<NEW_LINE>}
= new SliceType(charsetName, collationName);
852,562
private List<Wo> listLike(Business business, Wi wi) throws Exception {<NEW_LINE>List<Wo> wos = new ArrayList<>();<NEW_LINE>if (StringUtils.isEmpty(wi.getKey())) {<NEW_LINE>return wos;<NEW_LINE>}<NEW_LINE>String str = StringUtils.lowerCase(StringTools.escapeSqlLikeKey(wi.getKey()));<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Identity.class);<NEW_LINE><MASK><NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Identity> root = cq.from(Identity.class);<NEW_LINE>Predicate p = cb.conjunction();<NEW_LINE>p = cb.and(p, cb.or(cb.like(cb.lower(root.get(Identity_.name)), str + "%", StringTools.SQL_ESCAPE_CHAR), cb.like(cb.lower(root.get(Identity_.unique)), str + "%", StringTools.SQL_ESCAPE_CHAR), cb.like(cb.lower(root.get(Identity_.pinyin)), str + "%", StringTools.SQL_ESCAPE_CHAR), cb.like(cb.lower(root.get(Identity_.pinyinInitial)), str + "%", StringTools.SQL_ESCAPE_CHAR), cb.like(cb.lower(root.get(Identity_.distinguishedName)), str + "%", StringTools.SQL_ESCAPE_CHAR)));<NEW_LINE>ListOrderedSet<String> set = new ListOrderedSet<>();<NEW_LINE>if (ListTools.isNotEmpty(wi.getUnitDutyList())) {<NEW_LINE>List<UnitDuty> unitDuties = business.unitDuty().pick(wi.getUnitDutyList());<NEW_LINE>List<String> unitDutyIdentities = new ArrayList<>();<NEW_LINE>for (UnitDuty o : unitDuties) {<NEW_LINE>unitDutyIdentities.addAll(o.getIdentityList());<NEW_LINE>}<NEW_LINE>unitDutyIdentities = ListTools.trim(unitDutyIdentities, true, true);<NEW_LINE>set.addAll(unitDutyIdentities);<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(wi.getUnitList())) {<NEW_LINE>List<String> units = business.expendUnitToUnit(wi.getUnitList());<NEW_LINE>if (!units.isEmpty()) {<NEW_LINE>p = cb.and(p, root.get(Identity_.unit).in(units));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(wi.getGroupList())) {<NEW_LINE>List<String> identityIds = business.expendGroupToIdentity(wi.getGroupList());<NEW_LINE>set.addAll(identityIds);<NEW_LINE>}<NEW_LINE>if (!set.isEmpty()) {<NEW_LINE>p = cb.and(p, root.get(Identity_.id).in(set.asList()));<NEW_LINE>}<NEW_LINE>List<String> ids = em.createQuery(cq.select(root.get(Identity_.id)).where(p)).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>List<Identity> os = business.entityManagerContainer().list(Identity.class, ids);<NEW_LINE>wos = Wo.copier.copy(os);<NEW_LINE>wos = business.identity().sort(wos);<NEW_LINE>return wos;<NEW_LINE>}
CriteriaBuilder cb = em.getCriteriaBuilder();
717,579
// fill tuple life cycle time to edges<NEW_LINE>private static void fillTLCValue2Edge(List<MetricInfo> componentMetrics, Map<String, TopologyEdge> edges) {<NEW_LINE>String EDGE_DIM = "." + MetricDef.TUPLE_LIEF_CYCLE;<NEW_LINE>for (MetricInfo info : componentMetrics) {<NEW_LINE>if (info == null)<NEW_LINE>continue;<NEW_LINE>for (Map.Entry<String, Map<Integer, MetricSnapshot>> metric : info.get_metrics().entrySet()) {<NEW_LINE>String name = metric.getKey();<NEW_LINE>String[] <MASK><NEW_LINE>String metricName = UIMetricUtils.extractMetricName(split_name);<NEW_LINE>// only handle with `.TupleLifeCycle` metrics<NEW_LINE>if (metricName == null || !metricName.contains(EDGE_DIM)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String componentId = UIMetricUtils.extractComponentName(split_name);<NEW_LINE>String src = metricName.split("\\.")[0];<NEW_LINE>String key = src + ":" + componentId;<NEW_LINE>// get 60 window metric<NEW_LINE>MetricSnapshot snapshot = metric.getValue().get(AsmWindow.M1_WINDOW);<NEW_LINE>TopologyEdge edge = edges.get(key);<NEW_LINE>if (edge != null) {<NEW_LINE>double value = snapshot.get_mean() / 1000;<NEW_LINE>edge.setCycleValue(value);<NEW_LINE>edge.appendTitle("TupleLifeCycle: " + UIMetricUtils.format.format(value) + "ms");<NEW_LINE>for (Map.Entry<Integer, MetricSnapshot> winData : metric.getValue().entrySet()) {<NEW_LINE>// put the tuple life cycle time , unit is ms<NEW_LINE>double v = winData.getValue().get_mean() / 1000;<NEW_LINE>edge.putMapValue(MetricDef.TUPLE_LIEF_CYCLE + "(ms)", winData.getKey(), UIMetricUtils.format.format(v));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
split_name = name.split("@");