idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
842,673
private void cleanupRecentHandshakes(int calls) {<NEW_LINE>boolean started = false;<NEW_LINE>long time = ClockUtil.nanoRealtime();<NEW_LINE>int loop = 0;<NEW_LINE>int count = 0;<NEW_LINE>int size = recentHandshakesCounter.get();<NEW_LINE>int log = Math.max(10000, size / 5);<NEW_LINE>boolean full = (calls % 6) == 0;<NEW_LINE>String qualifier = full ? " (full)" : "";<NEW_LINE>try {<NEW_LINE>long expires = calculateRecentHandshakeExpires();<NEW_LINE>Iterator<Connection> iterator = recentHandshakes.iterator();<NEW_LINE>while (running.get()) {<NEW_LINE>if (!iterator.hasNext()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Connection connection = iterator.next();<NEW_LINE>if ((loop++ % log) == 0) {<NEW_LINE>started = true;<NEW_LINE>LOGGER.trace("{} recent handshakes, cleaning up {} - {}", size, count, connection.getConnectionId());<NEW_LINE>}<NEW_LINE>Long startNanos = connection.getStartNanos();<NEW_LINE>if (startNanos == null || (expires - startNanos) >= 0) {<NEW_LINE>connection.startByClientHello(null);<NEW_LINE>size = recentHandshakesCounter.decrementAndGet();<NEW_LINE>iterator.remove();<NEW_LINE>++count;<NEW_LINE>} else if (!full) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (started) {<NEW_LINE>time = ClockUtil.nanoRealtime() - time;<NEW_LINE>LOGGER.debug("{} left recent handshakes, {} removed in {}ms{}!", size, count, TimeUnit.NANOSECONDS<MASK><NEW_LINE>}<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>time = ClockUtil.nanoRealtime() - time;<NEW_LINE>LOGGER.error("{} recent handshakes, cleanup failed after {} in {}ms{}!", size, count, TimeUnit.NANOSECONDS.toMillis(time), qualifier, ex);<NEW_LINE>}<NEW_LINE>if (running.get() && connectionStore instanceof ReadWriteLockConnectionStore) {<NEW_LINE>((ReadWriteLockConnectionStore) connectionStore).shrink(calls, running);<NEW_LINE>}<NEW_LINE>}
.toMillis(time), qualifier);
285,983
ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {<NEW_LINE>logger.debug(effectivePerson.getDistinguishedName());<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>HotPictureInfoService hotPictureInfoService = new HotPictureInfoService();<NEW_LINE>Wi wi = this.<MASK><NEW_LINE>if (wi.getTitle() == null || wi.getTitle().isEmpty()) {<NEW_LINE>throw new InfoTitleEmptyException();<NEW_LINE>}<NEW_LINE>if (wi.getUrl() == null || wi.getUrl().isEmpty()) {<NEW_LINE>throw new InfoUrlEmptyException();<NEW_LINE>}<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>HotPictureInfo hotPictureInfo = null;<NEW_LINE>if (StringUtils.isNotBlank(wi.getId())) {<NEW_LINE>hotPictureInfo = emc.find(wi.getId(), HotPictureInfo.class);<NEW_LINE>if (hotPictureInfo == null) {<NEW_LINE>hotPictureInfo = hotPictureInfoService.getByApplicationInfoId(emc, wi.getApplication(), wi.getInfoId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>emc.beginTransaction(HotPictureInfo.class);<NEW_LINE>if (hotPictureInfo != null) {<NEW_LINE>hotPictureInfo.setPicId(wi.getPicId());<NEW_LINE>hotPictureInfo.setSummary(wi.getSummary());<NEW_LINE>hotPictureInfo.setTitle(wi.getTitle());<NEW_LINE>hotPictureInfo.setUrl(wi.getUrl());<NEW_LINE>emc.check(hotPictureInfo, CheckPersistType.all);<NEW_LINE>} else {<NEW_LINE>hotPictureInfo = new HotPictureInfo();<NEW_LINE>hotPictureInfo.setInfoId(wi.getInfoId());<NEW_LINE>hotPictureInfo.setApplication(wi.getApplication());<NEW_LINE>hotPictureInfo.setCreator(wi.getCreator());<NEW_LINE>hotPictureInfo.setPicId(wi.getPicId());<NEW_LINE>hotPictureInfo.setSummary(wi.getSummary());<NEW_LINE>hotPictureInfo.setTitle(wi.getTitle());<NEW_LINE>hotPictureInfo.setUrl(wi.getUrl());<NEW_LINE>emc.persist(hotPictureInfo, CheckPersistType.all);<NEW_LINE>}<NEW_LINE>emc.commit();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(hotPictureInfo.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>CacheManager.notify(HotPictureInfo.class);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
convertToWrapIn(jsonElement, Wi.class);
1,382,479
private void configureChannelPipelineHandlers() {<NEW_LINE>Configs configs = this.httpClientConfig.getConfigs();<NEW_LINE>if (this.httpClientConfig.getProxy() != null) {<NEW_LINE>this.httpClient = this.httpClient.proxy(typeSpec -> typeSpec.type(ProxyProvider.Proxy.HTTP).address(this.httpClientConfig.getProxy().getAddress()));<NEW_LINE>}<NEW_LINE>if (LoggerFactory.getLogger(REACTOR_NETWORK_LOG_CATEGORY).isTraceEnabled()) {<NEW_LINE>this.httpClient = this.httpClient.<MASK><NEW_LINE>}<NEW_LINE>this.httpClient = this.httpClient.secure(sslContextSpec -> sslContextSpec.sslContext(configs.getSslContext())).option(ChannelOption.CONNECT_TIMEOUT_MILLIS, (int) configs.getConnectionAcquireTimeout().toMillis()).httpResponseDecoder(httpResponseDecoderSpec -> httpResponseDecoderSpec.maxInitialLineLength(configs.getMaxHttpInitialLineLength()).maxHeaderSize(configs.getMaxHttpHeaderSize()).maxChunkSize(configs.getMaxHttpChunkSize()).validateHeaders(true));<NEW_LINE>}
wiretap(REACTOR_NETWORK_LOG_CATEGORY, LogLevel.INFO);
507,161
public void validateJoinRequest(JoinMessage joinMessage) {<NEW_LINE>// check joining member's major.minor version is same as current cluster version's major.minor numbers<NEW_LINE>MemberVersion memberVersion = joinMessage.getMemberVersion();<NEW_LINE>Version clusterVersion = node.getClusterService().getClusterVersion();<NEW_LINE>if (!memberVersion.asVersion().equals(clusterVersion)) {<NEW_LINE>String msg <MASK><NEW_LINE>if (clusterVersion.getMajor() != memberVersion.getMajor()) {<NEW_LINE>msg += " (Rolling Member Upgrades are only supported for the same major version)";<NEW_LINE>}<NEW_LINE>if (clusterVersion.getMinor() > memberVersion.getMinor()) {<NEW_LINE>msg += " (Rolling Member Upgrades are only supported for the next minor version)";<NEW_LINE>}<NEW_LINE>if (!BuildInfoProvider.getBuildInfo().isEnterprise()) {<NEW_LINE>msg += " (Rolling Member Upgrades are only supported in Hazelcast Enterprise)";<NEW_LINE>}<NEW_LINE>throw new VersionMismatchException(msg);<NEW_LINE>}<NEW_LINE>}
= "Joining node's version " + memberVersion + " is not compatible with cluster version " + clusterVersion;
369,072
private boolean parseFile(File directory, String file) {<NEW_LINE>BufferedInputStream inputStream;<NEW_LINE>CharStream input;<NEW_LINE>try {<NEW_LINE>inputStream = new BufferedInputStream(new FileInputStream(new File(directory, file)));<NEW_LINE>currentFile = file;<NEW_LINE>input = CharStreams.fromStream(inputStream);<NEW_LINE>// create a lexer that feeds off of input CharStream<NEW_LINE>Python3Lexer lexer = new Python3Lexer(input);<NEW_LINE>// create a buffer of tokens pulled from the lexer<NEW_LINE>CommonTokenStream tokens = new CommonTokenStream(lexer);<NEW_LINE>// create a parser that feeds off the tokens buffer<NEW_LINE>Python3Parser parser = new Python3Parser(tokens);<NEW_LINE>File_inputContext in = parser.file_input();<NEW_LINE>ParseTreeWalker ptw = new ParseTreeWalker();<NEW_LINE>for (int i = 0; i < in.getChildCount(); i++) {<NEW_LINE>ParseTree pt = in.getChild(i);<NEW_LINE>ptw.walk(new JplagPython3Listener(this), pt);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>getErrorConsumer().addError("Parsing Error in '" + file + <MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
"':\n" + e.getMessage());
1,561,505
private void denormalizeSdata(Sdata theSdata) {<NEW_LINE>Map<String, Room> roomMap = new HashMap<String, Room>();<NEW_LINE>for (Room i : theSdata.getRooms()) roomMap.put(i.getId(), i);<NEW_LINE>Map<String, Categorie> categoryMap = new HashMap<String, Categorie>();<NEW_LINE>for (Categorie i : theSdata.getCategoriess()) categoryMap.put(i.getId(), i);<NEW_LINE>Categorie controllerCat = new Categorie();<NEW_LINE>controllerCat.setName("Controller");<NEW_LINE>controllerCat.setId("0");<NEW_LINE>categoryMap.put(controllerCat.getId(), controllerCat);<NEW_LINE>ListIterator<Device> theIterator = theSdata.getDevices().listIterator();<NEW_LINE>Device theDevice = null;<NEW_LINE>while (theIterator.hasNext()) {<NEW_LINE>theDevice = theIterator.next();<NEW_LINE>if (theDevice.getRoom() != null && roomMap.get(theDevice.getRoom()) != null)<NEW_LINE>theDevice.setRoom(roomMap.get(theDevice.getRoom<MASK><NEW_LINE>else<NEW_LINE>theDevice.setRoom("no room");<NEW_LINE>if (theDevice.getCategory() != null && categoryMap.get(theDevice.getCategory()) != null)<NEW_LINE>theDevice.setCategory(categoryMap.get(theDevice.getCategory()).getName());<NEW_LINE>else<NEW_LINE>theDevice.setCategory("<unknown>");<NEW_LINE>theDevice.setVeraaddress(veraAddress.getIp());<NEW_LINE>theDevice.setVeraname(veraAddress.getName());<NEW_LINE>}<NEW_LINE>ListIterator<Scene> theSecneIter = theSdata.getScenes().listIterator();<NEW_LINE>Scene theScene = null;<NEW_LINE>while (theSecneIter.hasNext()) {<NEW_LINE>theScene = theSecneIter.next();<NEW_LINE>if (theScene.getRoom() != null && roomMap.get(theScene.getRoom()) != null)<NEW_LINE>theScene.setRoom(roomMap.get(theScene.getRoom()).getName());<NEW_LINE>else<NEW_LINE>theScene.setRoom("no room");<NEW_LINE>theScene.setVeraaddress(veraAddress.getIp());<NEW_LINE>theScene.setVeraname(veraAddress.getName());<NEW_LINE>}<NEW_LINE>}
()).getName());
570,621
private Criterion mergeCriteria(final Criterion one, final Criterion two) throws IllegalArgumentException {<NEW_LINE>final Criterion.Builder builder = new Criterion.Builder();<NEW_LINE>builder.withId(this.mergeCriteriaStrings(one.getId().orElse(null), two.getId().orElse(null), ID_FIELD));<NEW_LINE>builder.withName(this.mergeCriteriaStrings(one.getName().orElse(null), two.getName().orElse(null), NAME_FIELD));<NEW_LINE>builder.withStatus(this.mergeCriteriaStrings(one.getStatus().orElse(null), two.getStatus().orElse(null), STATUS_FIELD));<NEW_LINE>builder.withVersion(this.mergeCriteriaStrings(one.getVersion().orElse(null), two.getVersion().<MASK><NEW_LINE>final Set<String> tags = Sets.newHashSet(one.getTags());<NEW_LINE>tags.addAll(two.getTags());<NEW_LINE>builder.withTags(tags);<NEW_LINE>return builder.build();<NEW_LINE>}
orElse(null), VERSION_FIELD));
337,905
private void processJarFile(String filename) {<NEW_LINE>File f = findJarFile(filename);<NEW_LINE>if (f == null) {<NEW_LINE>ErrorUtil.error("No such file: " + filename);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Warn if source debugging is specified for a jar file, since native debuggers<NEW_LINE>// don't support Java-like source paths.<NEW_LINE>if (options.emitLineDirectives() && options.isVerbose()) {<NEW_LINE>ErrorUtil.warning("source debugging of jar files is not supported: " + filename);<NEW_LINE>}<NEW_LINE>GenerationUnit combinedUnit = null;<NEW_LINE>if (globalCombinedUnit != null) {<NEW_LINE>combinedUnit = globalCombinedUnit;<NEW_LINE>} else if (options.getHeaderMap().combineSourceJars()) {<NEW_LINE>combinedUnit = GenerationUnit.newCombinedJarUnit(filename, options);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ZipFile zfile = new ZipFile(f);<NEW_LINE>try {<NEW_LINE>boolean containsJavaFile = false;<NEW_LINE>Enumeration<? extends ZipEntry> enumerator = zfile.entries();<NEW_LINE>File tempDir = FileUtil.createTempDir(J2OBJC_TEMP_DIR_PREFIX);<NEW_LINE>String tempDirPath = tempDir.getAbsolutePath();<NEW_LINE>options.fileUtil().addTempDir(tempDirPath);<NEW_LINE>options.fileUtil().appendSourcePath(tempDirPath);<NEW_LINE>while (enumerator.hasMoreElements()) {<NEW_LINE>ZipEntry entry = enumerator.nextElement();<NEW_LINE>String internalPath = entry.getName();<NEW_LINE>if (internalPath.endsWith(".java") || (options.translateClassfiles() && internalPath.endsWith(".class"))) {<NEW_LINE>// Extract JAR file to a temporary directory<NEW_LINE>File outputFile = options.fileUtil().extractZipEntry(tempDir, zfile, entry);<NEW_LINE>InputFile newFile = new RegularInputFile(outputFile.getAbsolutePath(), internalPath);<NEW_LINE>if (combinedUnit != null) {<NEW_LINE>inputs.add(new ProcessingContext(newFile, combinedUnit));<NEW_LINE>} else {<NEW_LINE>addExtractedJarSource(newFile, filename, internalPath);<NEW_LINE>}<NEW_LINE>containsJavaFile = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!options.translateClassfiles() && !containsJavaFile) {<NEW_LINE>ErrorUtil.warning(filename + " does not contain any Java source files.");<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>// Also closes input stream.<NEW_LINE>zfile.close();<NEW_LINE>}<NEW_LINE>} catch (ZipException e) {<NEW_LINE>// Also catches JarExceptions<NEW_LINE>logger.fine(e.getMessage());<NEW_LINE>ErrorUtil.error("Error reading file " + filename + " as a zip or jar file.");<NEW_LINE>} catch (IOException e) {<NEW_LINE>ErrorUtil.<MASK><NEW_LINE>}<NEW_LINE>}
error(e.getMessage());
1,031,098
public boolean isSystem64Bit() {<NEW_LINE>if (isSystem64Bit == null) {<NEW_LINE>isSystem64Bit = false;<NEW_LINE>try {<NEW_LINE>Process p = Runtime.getRuntime().exec("uname -m");<NEW_LINE>// Try if command exited. Wait max 1s.<NEW_LINE>for (int i = 0; i < 5; i++) {<NEW_LINE>try {<NEW_LINE>p.exitValue();<NEW_LINE>break;<NEW_LINE>} catch (IllegalThreadStateException ex) {<NEW_LINE>// Exception should be ignored - do nothing.<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(200);<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>// Exception should be ignored - do nothing.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));<NEW_LINE>if (br.ready()) {<NEW_LINE><MASK><NEW_LINE>isSystem64Bit = line.endsWith("64");<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LogManager.log(ErrorLevel.WARNING, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return isSystem64Bit;<NEW_LINE>}
String line = br.readLine();
1,721,917
public byte[] encode(final int[] ld) {<NEW_LINE>final BitCoderContext ctx = ctxEndode;<NEW_LINE>ctx.reset();<NEW_LINE>int skippedTags = 0;<NEW_LINE>int nonNullTags = 0;<NEW_LINE>// (skip first bit ("reversedirection") )<NEW_LINE>// all others are generic<NEW_LINE>for (int inum = 1; inum < lookupValues.size(); inum++) {<NEW_LINE>// loop over lookup names<NEW_LINE><MASK><NEW_LINE>if (d == 0) {<NEW_LINE>skippedTags++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ctx.encodeVarBits(skippedTags + 1);<NEW_LINE>nonNullTags++;<NEW_LINE>skippedTags = 0;<NEW_LINE>// 0 excluded already, 1 (=unknown) we rotate up to 8<NEW_LINE>// to have the good code space for the popular values<NEW_LINE>final int dd = d < 2 ? 7 : (d < 9 ? d - 2 : d - 1);<NEW_LINE>ctx.encodeVarBits(dd);<NEW_LINE>}<NEW_LINE>ctx.encodeVarBits(0);<NEW_LINE>if (nonNullTags == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final int len = ctx.closeAndGetEncodedLength();<NEW_LINE>final byte[] ab = new byte[len];<NEW_LINE>System.arraycopy(abBuf, 0, ab, 0, len);<NEW_LINE>// crosscheck: decode and compare<NEW_LINE>final int[] ld2 = new int[lookupValues.size()];<NEW_LINE>decode(ld2, false, ab);<NEW_LINE>for (int inum = 1; inum < lookupValues.size(); inum++) {<NEW_LINE>// loop over lookup names (except reverse dir)<NEW_LINE>if (ld2[inum] != ld[inum]) {<NEW_LINE>throw new RuntimeException("assertion failed encoding inum=" + inum + " val=" + ld[inum] + " " + getKeyValueDescription(false, ab));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ab;<NEW_LINE>}
final int d = ld[inum];
1,181,114
private JComponent buildWadlContentTab() {<NEW_LINE>partTabs = new JTabbedPane();<NEW_LINE>partTabs.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);<NEW_LINE>rootNode = new DefaultMutableTreeNode(restService.getName());<NEW_LINE>treeModel = new DefaultTreeModel(rootNode);<NEW_LINE>tree = new JTree(treeModel);<NEW_LINE>tree.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));<NEW_LINE>tree.setExpandsSelectedPaths(true);<NEW_LINE>tree.addTreeSelectionListener(new InternalTreeSelectionListener());<NEW_LINE>tree.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseClicked(MouseEvent arg0) {<NEW_LINE>if (arg0.getClickCount() > 1) {<NEW_LINE>TreePath selectionPath = tree.getSelectionPath();<NEW_LINE>if (selectionPath != null) {<NEW_LINE>DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) selectionPath.getLastPathComponent();<NEW_LINE>Object userObject = treeNode.getUserObject();<NEW_LINE>if (userObject instanceof InspectItem) {<NEW_LINE>InspectItem item = (InspectItem) userObject;<NEW_LINE>if (item != null && item.selector != null) {<NEW_LINE>item.selector.selectNode(item);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE><MASK><NEW_LINE>UISupport.addPreviewCorner(scrollPane, true);<NEW_LINE>JSplitPane split = UISupport.createHorizontalSplit(scrollPane, UISupport.createTabPanel(partTabs, true));<NEW_LINE>split.setDividerLocation(250);<NEW_LINE>split.setResizeWeight(0.3);<NEW_LINE>initTreeModel(restService);<NEW_LINE>JPanel panel = new JPanel(new BorderLayout());<NEW_LINE>panel.add(split, BorderLayout.CENTER);<NEW_LINE>panel.add(buildWadlTabToolbar(), BorderLayout.PAGE_START);<NEW_LINE>statusBar = new JEditorStatusBar();<NEW_LINE>panel.add(statusBar, BorderLayout.PAGE_END);<NEW_LINE>setPreferredSize(new Dimension(600, 500));<NEW_LINE>return panel;<NEW_LINE>}
JScrollPane scrollPane = new JScrollPane(tree);
1,168,562
private synchronized void initBloomFilter(AccumuloConfiguration acuconf, boolean useAccumuloStart) {<NEW_LINE>numKeys = acuconf.getCount(Property.TABLE_BLOOM_SIZE);<NEW_LINE>// vector size should be <code>-kn / (ln(1 - c^(1/k)))</code> bits for<NEW_LINE>// single key, where <code> is the number of hash functions,<NEW_LINE>// <code>n</code> is the number of keys and <code>c</code> is the desired<NEW_LINE>// max. error rate.<NEW_LINE>// Our desired error rate is by default 0.005, i.e. 0.5%<NEW_LINE>double errorRate = acuconf.getFraction(Property.TABLE_BLOOM_ERRORRATE);<NEW_LINE>vectorSize = (int) Math.ceil(-HASH_COUNT * numKeys / Math.log(1.0 - Math.pow(errorRate, 1.0 / HASH_COUNT)));<NEW_LINE>bloomFilter = new DynamicBloomFilter(vectorSize, HASH_COUNT, Hash.parseHashType(acuconf.get(Property.TABLE_BLOOM_HASHTYPE)), numKeys);<NEW_LINE>try {<NEW_LINE>String context = ClassLoaderUtil.tableContext(acuconf);<NEW_LINE>String classname = acuconf.get(Property.TABLE_BLOOM_KEY_FUNCTOR);<NEW_LINE>Class<? extends KeyFunctor> clazz;<NEW_LINE>if (!useAccumuloStart)<NEW_LINE>clazz = Writer.class.getClassLoader().loadClass(classname).asSubclass(KeyFunctor.class);<NEW_LINE>else<NEW_LINE>clazz = ClassLoaderUtil.loadClass(context, classname, KeyFunctor.class);<NEW_LINE>transformer = clazz<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to find KeyFunctor: " + acuconf.get(Property.TABLE_BLOOM_KEY_FUNCTOR), e);<NEW_LINE>throw new IllegalArgumentException("Failed to find KeyFunctor: " + acuconf.get(Property.TABLE_BLOOM_KEY_FUNCTOR));<NEW_LINE>}<NEW_LINE>}
.getDeclaredConstructor().newInstance();
774,835
public void write(JsonWriter out, FruitReq value) throws IOException {<NEW_LINE>if (value == null || value.getActualInstance() == null) {<NEW_LINE>elementAdapter.write(out, null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check if the actual instance is of the type `AppleReq`<NEW_LINE>if (value.getActualInstance() instanceof AppleReq) {<NEW_LINE>JsonObject obj = adapterAppleReq.toJsonTree((AppleReq) value.getActualInstance()).getAsJsonObject();<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check if the actual instance is of the type `BananaReq`<NEW_LINE>if (value.getActualInstance() instanceof BananaReq) {<NEW_LINE>JsonObject obj = adapterBananaReq.toJsonTree((BananaReq) value.getActualInstance()).getAsJsonObject();<NEW_LINE>elementAdapter.write(out, obj);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: AppleReq, BananaReq");<NEW_LINE>}
elementAdapter.write(out, obj);
517,120
public MaryData process(MaryData d) throws Exception {<NEW_LINE>String phoneString = d.getPlainText();<NEW_LINE>MaryData result = new MaryData(getOutputType(), d.getLocale(), true);<NEW_LINE>Document doc = result.getDocument();<NEW_LINE>Element root = doc.getDocumentElement();<NEW_LINE>root.setAttribute("xml:lang", MaryUtils.locale2xmllang(d.getLocale()));<NEW_LINE>Element insertHere = root;<NEW_LINE>Voice defaultVoice = d.getDefaultVoice();<NEW_LINE>if (defaultVoice != null) {<NEW_LINE>Element voiceElement = MaryXML.createElement(doc, MaryXML.VOICE);<NEW_LINE>voiceElement.setAttribute("name", defaultVoice.getName());<NEW_LINE>root.appendChild(voiceElement);<NEW_LINE>insertHere = voiceElement;<NEW_LINE>}<NEW_LINE>int cumulDur = 0;<NEW_LINE>boolean isFirst = true;<NEW_LINE>StringTokenizer stTokens = new StringTokenizer(phoneString);<NEW_LINE>while (stTokens.hasMoreTokens()) {<NEW_LINE>Element token = MaryXML.createElement(doc, MaryXML.TOKEN);<NEW_LINE>insertHere.appendChild(token);<NEW_LINE>String tokenPhonemes = stTokens.nextToken();<NEW_LINE>token.setAttribute("ph", tokenPhonemes);<NEW_LINE>StringTokenizer stSyllables = new StringTokenizer(tokenPhonemes, "-_");<NEW_LINE>while (stSyllables.hasMoreTokens()) {<NEW_LINE>Element syllable = MaryXML.<MASK><NEW_LINE>token.appendChild(syllable);<NEW_LINE>String syllablePhonemes = stSyllables.nextToken();<NEW_LINE>syllable.setAttribute("ph", syllablePhonemes);<NEW_LINE>int stress = 0;<NEW_LINE>if (syllablePhonemes.startsWith("'"))<NEW_LINE>stress = 1;<NEW_LINE>else if (syllablePhonemes.startsWith(","))<NEW_LINE>stress = 2;<NEW_LINE>if (stress != 0) {<NEW_LINE>// Simplified: Give a "pressure accent" do stressed syllables<NEW_LINE>syllable.setAttribute("accent", "*");<NEW_LINE>token.setAttribute("accent", "*");<NEW_LINE>}<NEW_LINE>Allophone[] phones = allophoneSet.splitIntoAllophones(syllablePhonemes);<NEW_LINE>for (int i = 0; i < phones.length; i++) {<NEW_LINE>Element ph = MaryXML.createElement(doc, MaryXML.PHONE);<NEW_LINE>ph.setAttribute("p", phones[i].name());<NEW_LINE>int dur = 70;<NEW_LINE>if (phones[i].isVowel()) {<NEW_LINE>dur = 100;<NEW_LINE>if (stress == 1)<NEW_LINE>dur *= 1.5;<NEW_LINE>else if (stress == 2)<NEW_LINE>dur *= 1.2;<NEW_LINE>}<NEW_LINE>ph.setAttribute("d", String.valueOf(dur));<NEW_LINE>cumulDur += dur;<NEW_LINE>ph.setAttribute("end", String.valueOf(cumulDur));<NEW_LINE>syllable.appendChild(ph);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Element boundary = MaryXML.createElement(doc, MaryXML.BOUNDARY);<NEW_LINE>boundary.setAttribute("bi", "4");<NEW_LINE>boundary.setAttribute("duration", "400");<NEW_LINE>insertHere.appendChild(boundary);<NEW_LINE>return result;<NEW_LINE>}
createElement(doc, MaryXML.SYLLABLE);
1,528,982
public void apply(Skeleton skeleton, float lastTime, float time, @Null Array<Event> events, float alpha, MixBlend blend, MixDirection direction) {<NEW_LINE>PathConstraint constraint = skeleton.pathConstraints.get(pathConstraintIndex);<NEW_LINE>if (!constraint.active)<NEW_LINE>return;<NEW_LINE>float[] frames = this.frames;<NEW_LINE>if (time < frames[0]) {<NEW_LINE>// Time is before first frame.<NEW_LINE>PathConstraintData data = constraint.data;<NEW_LINE>switch(blend) {<NEW_LINE>case setup:<NEW_LINE>constraint.mixRotate = data.mixRotate;<NEW_LINE>constraint.mixX = data.mixX;<NEW_LINE>constraint.mixY = data.mixY;<NEW_LINE>return;<NEW_LINE>case first:<NEW_LINE>constraint.mixRotate += (data.mixRotate - constraint.mixRotate) * alpha;<NEW_LINE>constraint.mixX += (data.mixX - constraint.mixX) * alpha;<NEW_LINE>constraint.mixY += (data.mixY - constraint.mixY) * alpha;<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float rotate, x, y;<NEW_LINE>int i = search(frames, time, ENTRIES), curveType = (int) curves[i >> 2];<NEW_LINE>switch(curveType) {<NEW_LINE>case LINEAR:<NEW_LINE>float before = frames[i];<NEW_LINE><MASK><NEW_LINE>x = frames[i + X];<NEW_LINE>y = frames[i + Y];<NEW_LINE>float t = (time - before) / (frames[i + ENTRIES] - before);<NEW_LINE>rotate += (frames[i + ENTRIES + ROTATE] - rotate) * t;<NEW_LINE>x += (frames[i + ENTRIES + X] - x) * t;<NEW_LINE>y += (frames[i + ENTRIES + Y] - y) * t;<NEW_LINE>break;<NEW_LINE>case STEPPED:<NEW_LINE>rotate = frames[i + ROTATE];<NEW_LINE>x = frames[i + X];<NEW_LINE>y = frames[i + Y];<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>rotate = getBezierValue(time, i, ROTATE, curveType - BEZIER);<NEW_LINE>x = getBezierValue(time, i, X, curveType + BEZIER_SIZE - BEZIER);<NEW_LINE>y = getBezierValue(time, i, Y, curveType + BEZIER_SIZE * 2 - BEZIER);<NEW_LINE>}<NEW_LINE>if (blend == setup) {<NEW_LINE>PathConstraintData data = constraint.data;<NEW_LINE>constraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha;<NEW_LINE>constraint.mixX = data.mixX + (x - data.mixX) * alpha;<NEW_LINE>constraint.mixY = data.mixY + (y - data.mixY) * alpha;<NEW_LINE>} else {<NEW_LINE>constraint.mixRotate += (rotate - constraint.mixRotate) * alpha;<NEW_LINE>constraint.mixX += (x - constraint.mixX) * alpha;<NEW_LINE>constraint.mixY += (y - constraint.mixY) * alpha;<NEW_LINE>}<NEW_LINE>}
rotate = frames[i + ROTATE];
700,668
protected void updateVelocity(int particleIndex, double[] particlePosition) {<NEW_LINE>int i = particleIndex;<NEW_LINE>double[] vtmp = new double[particlePosition.length];<NEW_LINE>// Standard PSO formula<NEW_LINE>// inertia weight<NEW_LINE>m_va.mul<MASK><NEW_LINE>// cognitive term<NEW_LINE>m_va.copy(vtmp, m_bestVectors[i]);<NEW_LINE>m_va.sub(vtmp, particlePosition);<NEW_LINE>m_va.mulRand(vtmp, m_c1);<NEW_LINE>m_va.add(m_velocities[i], vtmp);<NEW_LINE>// social term<NEW_LINE>if (i != m_bestVectorIndex) {<NEW_LINE>m_va.copy(vtmp, m_pseudoAsynchronousUpdate ? m_bestVectors[m_bestVectorIndex] : m_bestVector);<NEW_LINE>m_va.sub(vtmp, particlePosition);<NEW_LINE>m_va.mulRand(vtmp, m_c2);<NEW_LINE>m_va.add(m_velocities[i], vtmp);<NEW_LINE>}<NEW_LINE>}
(m_velocities[i], m_inertiaWeight);
66,100
private void generateBinarySearch(List<TableEntry> entries, int lower, int upper, WasmBlock consumer, WasmBlock defaultTarget, WasmLocal conditionVar) {<NEW_LINE>if (upper - lower == 0) {<NEW_LINE>int label = entries.get(lower).label;<NEW_LINE>WasmExpression condition = new WasmIntBinary(WasmIntType.INT32, WasmIntBinaryOperation.EQ, new WasmGetLocal(conditionVar), new WasmInt32Constant(label));<NEW_LINE>WasmConditional conditional = new WasmConditional(condition);<NEW_LINE>consumer.getBody().add(conditional);<NEW_LINE>conditional.getThenBlock().getBody().add(new WasmBreak(entries.get(lower).target));<NEW_LINE>conditional.getElseBlock().getBody().<MASK><NEW_LINE>} else if (upper - lower <= 0) {<NEW_LINE>consumer.getBody().add(new WasmBreak(defaultTarget));<NEW_LINE>} else {<NEW_LINE>int mid = (upper + lower) / 2;<NEW_LINE>int label = entries.get(mid).label;<NEW_LINE>WasmExpression condition = new WasmIntBinary(WasmIntType.INT32, WasmIntBinaryOperation.GT_SIGNED, new WasmGetLocal(conditionVar), new WasmInt32Constant(label));<NEW_LINE>WasmConditional conditional = new WasmConditional(condition);<NEW_LINE>consumer.getBody().add(conditional);<NEW_LINE>generateBinarySearch(entries, mid + 1, upper, conditional.getThenBlock(), defaultTarget, conditionVar);<NEW_LINE>generateBinarySearch(entries, lower, mid, conditional.getElseBlock(), defaultTarget, conditionVar);<NEW_LINE>}<NEW_LINE>}
add(new WasmBreak(defaultTarget));
1,119,601
public boolean isLaxType(BType type, Map<BType, Boolean> visited) {<NEW_LINE>if (visited.containsKey(type)) {<NEW_LINE>return visited.get(type);<NEW_LINE>}<NEW_LINE>switch(type.tag) {<NEW_LINE>case TypeTags.JSON:<NEW_LINE>case TypeTags.XML:<NEW_LINE>case TypeTags.XML_ELEMENT:<NEW_LINE><MASK><NEW_LINE>return true;<NEW_LINE>case TypeTags.MAP:<NEW_LINE>boolean result = isLaxType(((BMapType) type).constraint, visited);<NEW_LINE>visited.put(type, result);<NEW_LINE>return result;<NEW_LINE>case TypeTags.UNION:<NEW_LINE>// TODO: remove<NEW_LINE>if (type == symTable.jsonType || isSameType(type, symTable.jsonType)) {<NEW_LINE>visited.put(type, true);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>for (BType member : ((BUnionType) type).getMemberTypes()) {<NEW_LINE>if (!isLaxType(member, visited)) {<NEW_LINE>visited.put(type, false);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>visited.put(type, true);<NEW_LINE>return true;<NEW_LINE>case TypeTags.TYPEREFDESC:<NEW_LINE>return isLaxType(getReferredType(type), visited);<NEW_LINE>}<NEW_LINE>visited.put(type, false);<NEW_LINE>return false;<NEW_LINE>}
visited.put(type, true);
953,932
public static void main(String[] args) {<NEW_LINE>Map<Integer, String> L = new HashMap<Integer, String>();<NEW_LINE>L.put(1, "Sun");<NEW_LINE>L.put(2, "Mon");<NEW_LINE>L.put(3, "Tue");<NEW_LINE>L.put(4, "Wed");<NEW_LINE>L.put(5, "Thurs");<NEW_LINE>L.put(6, "Fri");<NEW_LINE>L.put(7, "Sat");<NEW_LINE>// Start at Monday, 1st, 1900<NEW_LINE>int counter = 1;<NEW_LINE>int tally = 0;<NEW_LINE>// Year<NEW_LINE>for (int yr = 1900; yr < 2001; ++yr) {<NEW_LINE>System.out.println("Year = " + yr);<NEW_LINE>// Month<NEW_LINE>for (int month = 1; month < 13; month++) {<NEW_LINE>int <MASK><NEW_LINE>// Number of month days<NEW_LINE>for (int monthDays = 1; monthDays <= y; monthDays++) {<NEW_LINE>// Start at Monday, 1st, 1900<NEW_LINE>counter = (counter % 7) + 1;<NEW_LINE>if ((monthDays == 1) && (L.get(counter) == "Sun")) {<NEW_LINE>System.out.println("month_days = " + monthDays);<NEW_LINE>if (yr != 1900)<NEW_LINE>tally += 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>System.out.println("tally = " + tally);<NEW_LINE>}
y = findDays(month, yr);
903,080
public final int[] executeBatch() throws SQLException {<NEW_LINE>if (this.isClosed())<NEW_LINE>throw new SQLException("The Statement is closed");<NEW_LINE>// Issue warning where appropriate<NEW_LINE>if (this.commands.size() > 1 && this.autoCommit && this.holdability == ResultSet.CLOSE_CURSORS_AT_COMMIT) {<NEW_LINE>this.setWarning("Executing this batch of commands may lead to unexpectedly closed result sets because auto-commit is enabled and commit behaviour is set to close cursors at commit");<NEW_LINE>}<NEW_LINE>// Go ahead and process the batch<NEW_LINE>int[] rets = new int[this.commands.size()];<NEW_LINE>ResultSet curr = this.currResults;<NEW_LINE>for (int i = 0; i < this.commands.size(); i++) {<NEW_LINE>if (this.execute(this.commands.get(i))) {<NEW_LINE>// True means it returned a ResultSet<NEW_LINE>this.results.add(this.getResultSet());<NEW_LINE>this.currResults = null;<NEW_LINE>rets[i] = SUCCESS_NO_INFO;<NEW_LINE>} else {<NEW_LINE>// Need to add a null to getMoreResults() to produce correct<NEW_LINE>// behavior across subsequent calls to getMoreResults()<NEW_LINE><MASK><NEW_LINE>rets[i] = this.getUpdateCount();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.currResults = curr;<NEW_LINE>// Make the next available results the current results if there<NEW_LINE>// are no current results<NEW_LINE>if (this.currResults == null && !this.results.isEmpty()) {<NEW_LINE>this.currResults = this.results.poll();<NEW_LINE>}<NEW_LINE>return rets;<NEW_LINE>}
this.results.add(null);
1,817,039
private void jbInit() throws Exception {<NEW_LINE>this.setLayout(mainLayout);<NEW_LINE>CompiereColor.setBackground(this);<NEW_LINE>southPanel.setLayout(southLayout);<NEW_LINE>// Center<NEW_LINE>this.add(new JScrollPane(centerPanel), BorderLayout.CENTER);<NEW_LINE>// Info<NEW_LINE>infoScrollPane.getViewport().add(infoTextPane, null);<NEW_LINE>infoScrollPane.setPreferredSize(new Dimension(200, 140));<NEW_LINE>infoTextPane.setBackground(AdempierePLAF.getFieldBackground_Inactive());<NEW_LINE>infoTextPane.setEditable(false);<NEW_LINE>infoTextPane.setRequestFocusEnabled(false);<NEW_LINE>infoTextPane.setContentType("text/html");<NEW_LINE>// South<NEW_LINE>this.add(southPanel, BorderLayout.SOUTH);<NEW_LINE>southPanel.add(infoScrollPane, BorderLayout.CENTER);<NEW_LINE>southPanel.add(buttonPanel, BorderLayout.SOUTH);<NEW_LINE>//<NEW_LINE>wfStart.setIcon(Env.getImageIcon("wfStart24.gif"));<NEW_LINE>wfStart.setMargin(new Insets(0, 10, 0, 10));<NEW_LINE>wfStart.setRequestFocusEnabled(false);<NEW_LINE>wfStart.addActionListener(this);<NEW_LINE>wfStart.setToolTipText(Msg.getMsg(m_ctx, "WFStart"));<NEW_LINE>wfBack.setIcon(Env.getImageIcon("wfBack24.gif"));<NEW_LINE>wfBack.setMargin(new Insets(0, 15, 0, 15));<NEW_LINE>wfBack.setRequestFocusEnabled(false);<NEW_LINE>wfBack.addActionListener(this);<NEW_LINE>wfBack.setToolTipText(Msg.getMsg(m_ctx, "WFPrevious"));<NEW_LINE>wfNext.setIcon(Env.getImageIcon("wfNext24.gif"));<NEW_LINE>wfNext.setMargin(new Insets(0, 15, 0, 15));<NEW_LINE>wfNext.setRequestFocusEnabled(false);<NEW_LINE>wfNext.addActionListener(this);<NEW_LINE>wfNext.setToolTipText(Msg.getMsg(m_ctx, "WFNext"));<NEW_LINE>wfEnd.setIcon(Env.getImageIcon("wfEnd24.gif"));<NEW_LINE>wfEnd.setMargin(new Insets(0, 10, 0, 10));<NEW_LINE>wfEnd.setRequestFocusEnabled(false);<NEW_LINE>wfEnd.addActionListener(this);<NEW_LINE>wfEnd.setToolTipText(Msg.getMsg(m_ctx, "WFExit"));<NEW_LINE>buttonPanel.add(wfStart, null);<NEW_LINE>buttonPanel.add(wfBack, null);<NEW_LINE><MASK><NEW_LINE>buttonPanel.add(wfEnd, null);<NEW_LINE>}
buttonPanel.add(wfNext, null);
717,562
public void resetAllCalibrations(View v) {<NEW_LINE>final AlertDialog.Builder builder = new AlertDialog.Builder(this);<NEW_LINE>builder.setTitle(gs(R.string.are_you_sure));<NEW_LINE>builder.setMessage(gs(R.string.do_you_want_to_delete_and_reset_the_calibrations_for_this_sensor));<NEW_LINE>builder.setNegativeButton(gs(R.string.no), new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>dialog.dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.setPositiveButton(gs(R.string.yes), new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>Calibration.invalidateAllForSensor();<NEW_LINE>dialog.dismiss();<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder<MASK><NEW_LINE>}
.create().show();
1,035,280
private boolean loadFacesInitPluginsJDK6() {<NEW_LINE>String[] pluginEntries = null;<NEW_LINE>try {<NEW_LINE>Class serviceLoader = ClassUtils.getContextClassLoader().loadClass("java.util.ServiceLoader");<NEW_LINE>Method m = serviceLoader.getDeclaredMethod("load", Class.class, ClassLoader.class);<NEW_LINE>Object loader = m.invoke(serviceLoader, StartupListener.class, ClassUtils.getContextClassLoader());<NEW_LINE>m = loader.getClass().getDeclaredMethod("iterator");<NEW_LINE>Iterator<StartupListener> it = (Iterator<StartupListener>) m.invoke(loader);<NEW_LINE>List<StartupListener> listeners = new LinkedList<StartupListener>();<NEW_LINE>if (!it.hasNext()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>while (it.hasNext()) {<NEW_LINE>listeners.add(it.next());<NEW_LINE>}<NEW_LINE>// StartupListener[] listeners1 = listeners.toArray(new StartupListener[listeners.size()]);<NEW_LINE>_servletContext.setAttribute(FACES_INIT_PLUGINS, listeners);<NEW_LINE>return true;<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>log.log(Level.SEVERE, <MASK><NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>log.log(Level.SEVERE, e.getMessage(), e);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>log.log(Level.SEVERE, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
e.getMessage(), e);
1,161,235
private // TODO Use identity type to determine if this check should be performed<NEW_LINE>boolean isSameIdentityAsInServicesXml(ApplicationId applicationId, String domain, String service) {<NEW_LINE>Optional<ApplicationInfo> applicationInfo = superModelProvider.getSuperModel().getApplicationInfo(applicationId);<NEW_LINE>if (!applicationInfo.isPresent()) {<NEW_LINE>log.info(String.format("Could not find application info for %s, existing applications: %s", applicationId.serializedForm(), superModelProvider.getSuperModel().getAllApplicationInfos()));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (tenantDockerContainerIdentity.equals(new AthenzService(domain, service))) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Optional<ServiceInfo> matchingServiceInfo = applicationInfo.get().getModel().getHosts().stream().flatMap(hostInfo -> hostInfo.getServices().stream()).filter(serviceInfo -> serviceInfo.getProperty(SERVICE_PROPERTIES_DOMAIN_KEY).isPresent()).filter(serviceInfo -> serviceInfo.getProperty(SERVICE_PROPERTIES_SERVICE_KEY).isPresent()).findFirst();<NEW_LINE>if (!matchingServiceInfo.isPresent()) {<NEW_LINE>log.info(String.format("Application %s has not specified domain/service", applicationId.serializedForm()));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String domainInConfig = matchingServiceInfo.get().getProperty(SERVICE_PROPERTIES_DOMAIN_KEY).get();<NEW_LINE>String serviceInConfig = matchingServiceInfo.get().getProperty(SERVICE_PROPERTIES_SERVICE_KEY).get();<NEW_LINE>if (!domainInConfig.equals(domain) || !serviceInConfig.equals(service)) {<NEW_LINE>log.warning(String.format("domain '%s' or service '%s' does not match the one in config for application %s", domain, service<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
, applicationId.serializedForm()));
1,672,588
public boolean saveEvent(Event e) {<NEW_LINE>Util.assertEvent(e);<NEW_LINE>CqlSession cqlSession = getCqlSession();<NEW_LINE>BatchStatementBuilder batchBuilder = new BatchStatementBuilder(BatchType.LOGGED);<NEW_LINE>BoundStatement bsInsertEvent = psInsertEvent.bind();<NEW_LINE>bsInsertEvent = bsInsertEvent.setUuid(AUDIT_ATT_UID, UUID.fromString(e.getUuid()));<NEW_LINE>bsInsertEvent = bsInsertEvent.setString(<MASK><NEW_LINE>bsInsertEvent = bsInsertEvent.setInstant(AUDIT_ATT_TIME, Instant.ofEpochMilli(e.getTimestamp()));<NEW_LINE>bsInsertEvent = bsInsertEvent.setString(AUDIT_ATT_NAME, e.getName());<NEW_LINE>bsInsertEvent = bsInsertEvent.setString(AUDIT_ATT_ACTION, e.getAction());<NEW_LINE>bsInsertEvent = bsInsertEvent.setString(AUDIT_ATT_SOURCE, e.getSource());<NEW_LINE>bsInsertEvent = bsInsertEvent.setString(AUDIT_ATT_HOSTNAME, e.getHostName());<NEW_LINE>bsInsertEvent = bsInsertEvent.setInt(AUDIT_ATT_DURATION, new Long(e.getDuration()).intValue());<NEW_LINE>bsInsertEvent = bsInsertEvent.setString(AUDIT_ATT_USER, e.getUser());<NEW_LINE>bsInsertEvent = bsInsertEvent.setString(AUDIT_ATT_VALUE, e.getValue());<NEW_LINE>bsInsertEvent = bsInsertEvent.setMap(AUDIT_ATT_CUSTOM, e.getCustomKeys(), String.class, String.class);<NEW_LINE>batchBuilder.addStatement(bsInsertEvent);<NEW_LINE>if (EventConstants.ACTION_CHECK_OK.equalsIgnoreCase(e.getAction())) {<NEW_LINE>BoundStatement bsInsertEventByType = psInsertEventByType.bind();<NEW_LINE>bsInsertEventByType = bsInsertEventByType.setUuid(AUDIT_ATT_UID, UUID.fromString(e.getUuid()));<NEW_LINE>bsInsertEventByType = bsInsertEventByType.setInstant(AUDIT_ATT_TIME, Instant.ofEpochMilli(e.getTimestamp()));<NEW_LINE>bsInsertEventByType = bsInsertEventByType.setString(AUDIT_ATT_NAME, e.getName());<NEW_LINE>bsInsertEventByType = bsInsertEventByType.setString(AUDIT_ATT_SOURCE, e.getSource());<NEW_LINE>bsInsertEventByType = bsInsertEventByType.setString(AUDIT_ATT_HOSTNAME, e.getHostName());<NEW_LINE>bsInsertEventByType = bsInsertEventByType.setInt(AUDIT_ATT_DURATION, new Long(e.getDuration()).intValue());<NEW_LINE>bsInsertEventByType = bsInsertEventByType.setString(AUDIT_ATT_USER, e.getUser());<NEW_LINE>bsInsertEventByType = bsInsertEventByType.setString(AUDIT_ATT_VALUE, e.getValue());<NEW_LINE>bsInsertEventByType = bsInsertEventByType.setMap(AUDIT_ATT_CUSTOM, e.getCustomKeys(), String.class, String.class);<NEW_LINE>batchBuilder.addStatement(bsInsertEventByType);<NEW_LINE>}<NEW_LINE>cqlSession.execute(batchBuilder.build());<NEW_LINE>return true;<NEW_LINE>}
AUDIT_ATT_TYPE, e.getType());
1,740,600
private static void parseCompoundSortField(XContentParser parser, List<SortBuilder<?>> sortFields) throws IOException {<NEW_LINE>XContentParser.Token token;<NEW_LINE>while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {<NEW_LINE>if (token == XContentParser.Token.FIELD_NAME) {<NEW_LINE>String fieldName = parser.currentName();<NEW_LINE>token = parser.nextToken();<NEW_LINE>if (token == XContentParser.Token.VALUE_STRING) {<NEW_LINE>SortOrder order = SortOrder.fromString(parser.text());<NEW_LINE>sortFields.add(fieldOrScoreSort(<MASK><NEW_LINE>} else {<NEW_LINE>if (PARSERS.containsKey(fieldName)) {<NEW_LINE>sortFields.add(PARSERS.get(fieldName).fromXContent(parser, fieldName));<NEW_LINE>} else {<NEW_LINE>sortFields.add(FieldSortBuilder.fromXContent(parser, fieldName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
fieldName).order(order));
592,189
private List<SeriesSpec> toSeriesSpecs(AggregationConfigDTO config) {<NEW_LINE>return config.series().stream().map(seriesDTO -> {<NEW_LINE>String function = seriesDTO.function();<NEW_LINE>Pattern pattern = Pattern.compile("\\((.*?)\\)");<NEW_LINE>Matcher matcher = pattern.matcher(function);<NEW_LINE>String field = "";<NEW_LINE>if (matcher.find()) {<NEW_LINE>field = matcher.group(1);<NEW_LINE>}<NEW_LINE>if (function.startsWith("card")) {<NEW_LINE>return Cardinality.builder().field(field).id(function).build();<NEW_LINE>}<NEW_LINE>if (function.startsWith("avg")) {<NEW_LINE>return Average.builder().field(field).id(function).build();<NEW_LINE>}<NEW_LINE>if (function.startsWith("max")) {<NEW_LINE>return Max.builder().field(field).id(function).build();<NEW_LINE>}<NEW_LINE>if (function.startsWith("min")) {<NEW_LINE>return Min.builder().field(field).id(function).build();<NEW_LINE>}<NEW_LINE>if (function.startsWith("sum")) {<NEW_LINE>return Sum.builder().field(field).id(function).build();<NEW_LINE>}<NEW_LINE>if (function.startsWith("variance")) {<NEW_LINE>return Variance.builder().field(field).id(function).build();<NEW_LINE>}<NEW_LINE>if (function.startsWith("stddev")) {<NEW_LINE>return StdDev.builder().field(field).id(function).build();<NEW_LINE>}<NEW_LINE>if (function.startsWith("count")) {<NEW_LINE>final Count.Builder countBuilder = Count.<MASK><NEW_LINE>if (!field.isEmpty()) {<NEW_LINE>countBuilder.field(field);<NEW_LINE>}<NEW_LINE>return countBuilder.build();<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("The provided entity does not have a valid function type: " + function);<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>}
builder().id(function);
900,274
public Void migrateProcessInstance(CommandContext commandContext, String processInstanceId, MigrationPlan migrationPlan, ProcessDefinitionEntity targetProcessDefinition, boolean skipJavaSerializationFormatCheck) {<NEW_LINE>ensureNotNull(BadUserRequestException.class, "Process instance id cannot be null", "process instance id", processInstanceId);<NEW_LINE>final ExecutionEntity processInstance = commandContext.<MASK><NEW_LINE>ensureProcessInstanceExist(processInstanceId, processInstance);<NEW_LINE>ensureOperationAllowed(commandContext, processInstance, targetProcessDefinition);<NEW_LINE>ensureSameProcessDefinition(processInstance, migrationPlan.getSourceProcessDefinitionId());<NEW_LINE>MigratingProcessInstanceValidationReportImpl processInstanceReport = new MigratingProcessInstanceValidationReportImpl();<NEW_LINE>// Initialize migration: match migration instructions to activity instances and collect required entities<NEW_LINE>ProcessEngineImpl processEngine = commandContext.getProcessEngineConfiguration().getProcessEngine();<NEW_LINE>MigratingInstanceParser migratingInstanceParser = new MigratingInstanceParser(processEngine);<NEW_LINE>final MigratingProcessInstance migratingProcessInstance = migratingInstanceParser.parse(processInstanceId, migrationPlan, processInstanceReport);<NEW_LINE>validateInstructions(commandContext, migratingProcessInstance, processInstanceReport);<NEW_LINE>if (processInstanceReport.hasFailures()) {<NEW_LINE>throw LOGGER.failingMigratingProcessInstanceValidation(processInstanceReport);<NEW_LINE>}<NEW_LINE>executeInContext(() -> deleteUnmappedActivityInstances(migratingProcessInstance), migratingProcessInstance.getSourceDefinition());<NEW_LINE>executeInContext(() -> migrateProcessInstance(migratingProcessInstance), migratingProcessInstance.getTargetDefinition());<NEW_LINE>Map<String, ?> variables = migrationPlan.getVariables();<NEW_LINE>if (variables != null) {<NEW_LINE>// we don't need a context switch here since when setting an execution triggering variable,<NEW_LINE>// a context switch is performed at a later point via command invocation context<NEW_LINE>commandContext.executeWithOperationLogPrevented(new SetExecutionVariablesCmd(processInstanceId, variables, false, skipJavaSerializationFormatCheck));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
getExecutionManager().findExecutionById(processInstanceId);
139,323
public static ListSnapshotResponse unmarshall(ListSnapshotResponse listSnapshotResponse, UnmarshallerContext _ctx) {<NEW_LINE>listSnapshotResponse.setRequestId(_ctx.stringValue("ListSnapshotResponse.RequestId"));<NEW_LINE>listSnapshotResponse.setTotalCount(_ctx.integerValue("ListSnapshotResponse.TotalCount"));<NEW_LINE>listSnapshotResponse.setPageNumber(_ctx.integerValue("ListSnapshotResponse.PageNumber"));<NEW_LINE>listSnapshotResponse.setPageSize(_ctx.integerValue("ListSnapshotResponse.PageSize"));<NEW_LINE>List<SnapshotsItem> snapshots = new ArrayList<SnapshotsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListSnapshotResponse.Snapshots.Length"); i++) {<NEW_LINE>SnapshotsItem snapshotsItem = new SnapshotsItem();<NEW_LINE>snapshotsItem.setCategory(_ctx.stringValue("ListSnapshotResponse.Snapshots[" + i + "].Category"));<NEW_LINE>snapshotsItem.setCreationTime(_ctx.stringValue("ListSnapshotResponse.Snapshots[" + i + "].CreationTime"));<NEW_LINE>snapshotsItem.setDescription(_ctx.stringValue("ListSnapshotResponse.Snapshots[" + i + "].Description"));<NEW_LINE>snapshotsItem.setLastModifiedTime(_ctx.stringValue("ListSnapshotResponse.Snapshots[" + i + "].LastModifiedTime"));<NEW_LINE>snapshotsItem.setProgress(_ctx.stringValue("ListSnapshotResponse.Snapshots[" + i + "].Progress"));<NEW_LINE>snapshotsItem.setRemainTime(_ctx.integerValue("ListSnapshotResponse.Snapshots[" + i + "].RemainTime"));<NEW_LINE>snapshotsItem.setRetentionDays(_ctx.integerValue("ListSnapshotResponse.Snapshots[" + i + "].RetentionDays"));<NEW_LINE>snapshotsItem.setSnapshotId(_ctx.stringValue("ListSnapshotResponse.Snapshots[" + i + "].SnapshotId"));<NEW_LINE>snapshotsItem.setSnapshotName(_ctx.stringValue("ListSnapshotResponse.Snapshots[" + i + "].SnapshotName"));<NEW_LINE>snapshotsItem.setSnapshotType(_ctx.stringValue<MASK><NEW_LINE>snapshotsItem.setStatus(_ctx.stringValue("ListSnapshotResponse.Snapshots[" + i + "].Status"));<NEW_LINE>snapshotsItem.setSourceFsId(_ctx.stringValue("ListSnapshotResponse.Snapshots[" + i + "].SourceFsId"));<NEW_LINE>snapshotsItem.setSourceFsSize(_ctx.integerValue("ListSnapshotResponse.Snapshots[" + i + "].SourceFsSize"));<NEW_LINE>snapshots.add(snapshotsItem);<NEW_LINE>}<NEW_LINE>listSnapshotResponse.setSnapshots(snapshots);<NEW_LINE>return listSnapshotResponse;<NEW_LINE>}
("ListSnapshotResponse.Snapshots[" + i + "].SnapshotType"));
553,829
public void run() {<NEW_LINE>if (roomChat.getMultiUserChat() != multiUserChat) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>roomChat.setState(RoomState.error);<NEW_LINE>addAuthorizationError(account, room);<NEW_LINE>XMPPError xmppError = e.getXMPPError();<NEW_LINE>if (xmppError != null && xmppError.getCondition() == XMPPError.Condition.conflict) {<NEW_LINE>Application.getInstance().onError(R.string.NICK_ALREADY_USED);<NEW_LINE>} else if (xmppError != null && xmppError.getCondition() == XMPPError.Condition.not_authorized) {<NEW_LINE>Application.getInstance().onError(R.string.AUTHENTICATION_FAILED);<NEW_LINE>} else {<NEW_LINE>Application.getInstance().onError(R.string.NOT_CONNECTED);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>RosterManager.onContactChanged(account<MASK><NEW_LINE>} catch (UserJid.UserJidCreateException e) {<NEW_LINE>LogManager.exception(this, e);<NEW_LINE>}<NEW_LINE>}
, UserJid.from(room));
1,229,073
public void queueForPumping(BlockPos pos, Set<BlockPos> visitedBlocks, Deque<BlockPos> fluidsFound, Fluid pumpingFluid) {<NEW_LINE>BlockPos index = new BlockPos(pos);<NEW_LINE>if (visitedBlocks.add(index)) {<NEW_LINE>if ((pos.getX() - this.pos.getX()) * (pos.getX() - this.pos.getX()) + (pos.getZ() - this.pos.getZ()) * (pos.getZ() - this.pos.getZ()) > 64 * 64) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>IBlockState state = <MASK><NEW_LINE>if (BlockUtil.getFluid(state.getBlock()) == pumpingFluid) {<NEW_LINE>fluidsFound.add(index);<NEW_LINE>}<NEW_LINE>if (canDrainBlock(state, pos, pumpingFluid)) {<NEW_LINE>getLayerQueue(pos.getY()).add(index);<NEW_LINE>numFluidBlocksFound++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
BlockUtil.getBlockState(worldObj, pos);
695,748
public void onCreate(Bundle icicle) {<NEW_LINE>super.onCreate(icicle);<NEW_LINE>try {<NEW_LINE>View view;<NEW_LINE>String packageName = Utils.pName(this);<NEW_LINE>CustomClientConfigFileReader configFileReader = new CustomClientConfigFileReader(getAssets().open(packageName + ".yaml"));<NEW_LINE>Map<String, Map> configData = configFileReader.getConfigData();<NEW_LINE>Map<String, Integer> visibility = (Map<String, Integer>) configData.get("mainConfiguration").get("visibility");<NEW_LINE>for (String s : visibility.keySet()) {<NEW_LINE>android.util.<MASK><NEW_LINE>int resID = getResources().getIdentifier(s, "id", packageName);<NEW_LINE>view = findViewById(resID);<NEW_LINE>view.setVisibility(visibility.get(s));<NEW_LINE>}<NEW_LINE>Locale current = getResources().getConfiguration().locale;<NEW_LINE>String currentLanguage = current.getLanguage();<NEW_LINE>Map mainConfiguration = configData.get("mainConfiguration");<NEW_LINE>String title = (String) ((Map) configData.get("mainConfiguration").get("title")).get("default");<NEW_LINE>String subtitle = (String) ((Map) configData.get("mainConfiguration").get("subtitle")).get("default");<NEW_LINE>String currentLanguageTitle = (String) ((Map) configData.get("mainConfiguration").get("title")).get(currentLanguage);<NEW_LINE>if (currentLanguageTitle != null) {<NEW_LINE>title = currentLanguageTitle;<NEW_LINE>}<NEW_LINE>String currentLanguageSubTitle = (String) ((Map) configData.get("mainConfiguration").get("subtitle")).get(currentLanguage);<NEW_LINE>if (currentLanguageSubTitle != null) {<NEW_LINE>subtitle = currentLanguageSubTitle;<NEW_LINE>}<NEW_LINE>ActionBar ab = getActionBar();<NEW_LINE>ab.setTitle(title);<NEW_LINE>ab.setSubtitle(subtitle);<NEW_LINE>} catch (IOException e) {<NEW_LINE>android.util.Log.e(TAG, "Error opening config file from assets.");<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
Log.d(TAG, s);
779,127
public static void resolve(String dbName, int revision, String moduleKey) throws SQLException {<NEW_LINE>Connection connection = getNewConnection(dbName);<NEW_LINE>PreparedStatement <MASK><NEW_LINE>ps.setString(1, EvolutionState.APPLIED.getStateWord());<NEW_LINE>ps.setString(2, "");<NEW_LINE>ps.setString(3, EvolutionState.APPLYING_UP.getStateWord());<NEW_LINE>ps.setInt(4, revision);<NEW_LINE>ps.setString(5, moduleKey);<NEW_LINE>ps.execute();<NEW_LINE>closeStatement(ps);<NEW_LINE>PreparedStatement ps2 = connection.prepareStatement("delete from play_evolutions where state = ? and id = ? and module_key = ?");<NEW_LINE>ps2.setString(1, EvolutionState.APPLYING_DOWN.getStateWord());<NEW_LINE>ps2.setInt(2, revision);<NEW_LINE>ps2.setString(3, moduleKey);<NEW_LINE>ps2.execute();<NEW_LINE>closeStatement(ps2);<NEW_LINE>}
ps = connection.prepareStatement("update play_evolutions set state = ?, last_problem = ? where state = ? and id = ? and module_key = ?");
1,621,355
private boolean checkSimilarConstMatchPattern(BLangConstPattern firstConstMatchPattern, BLangConstPattern secondConstMatchPattern) {<NEW_LINE>Object firstConstValue = getConstValue(firstConstMatchPattern).keySet().iterator().next();<NEW_LINE>Object secondConstValue = getConstValue(secondConstMatchPattern).keySet()<MASK><NEW_LINE>BType firstConstType = getConstValue(firstConstMatchPattern).values().iterator().next();<NEW_LINE>BType secondConstType = getConstValue(secondConstMatchPattern).values().iterator().next();<NEW_LINE>if (firstConstValue == null || secondConstValue == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (firstConstValue.equals(secondConstValue)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (firstConstType != null && Types.getReferredType(firstConstType).tag == TypeTags.FINITE) {<NEW_LINE>firstConstValue = getConstValueFromFiniteType(((BFiniteType) firstConstType));<NEW_LINE>}<NEW_LINE>if (secondConstType != null && Types.getReferredType(secondConstType).tag == TypeTags.FINITE) {<NEW_LINE>secondConstValue = getConstValueFromFiniteType(((BFiniteType) secondConstType));<NEW_LINE>}<NEW_LINE>if (firstConstValue == null || secondConstValue == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return firstConstValue.equals(secondConstValue);<NEW_LINE>}
.iterator().next();
678,780
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View rootView = inflater.inflate(R.layout.fragment_folder_browser, container, false);<NEW_LINE>unbinder = ButterKnife.bind(this, rootView);<NEW_LINE>if (displayedInTabs) {<NEW_LINE>breadcrumbsView = new BreadcrumbsView(currentDir);<NEW_LINE>showBreadcrumbsInList = true;<NEW_LINE>changeBreadcrumbPath();<NEW_LINE>appBarLayout.setVisibility(View.GONE);<NEW_LINE>statusBarView.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>showBreadcrumbsInList = false;<NEW_LINE>breadcrumb.addBreadcrumbListener(this);<NEW_LINE>if (!TextUtils.isEmpty(currentDir)) {<NEW_LINE>breadcrumb.changeBreadcrumbPath(currentDir);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!displayedInTabs) {<NEW_LINE>toolbar.inflateMenu(R.menu.menu_folders);<NEW_LINE>toolbar.setNavigationOnClickListener(v -> getNavigationController().popViewController());<NEW_LINE>toolbar.setOnMenuItemClickListener(this);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>recyclerView.setRecyclerListener(new RecyclerListener());<NEW_LINE>recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));<NEW_LINE>recyclerView.setAdapter(adapter);<NEW_LINE>compositeDisposable.add(Aesthetic.get(getContext()).colorPrimary().compose(distinctToMainThread()).subscribe(color -> ViewBackgroundAction.create(appBarLayout).accept(color), onErrorLogAndRethrow()));<NEW_LINE>return rootView;<NEW_LINE>}
updateMenuItems(toolbar.getMenu());
1,148,028
public synchronized void startDiscovery() {<NEW_LINE>if (running) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>serverSocket = new ServerSocket(0);<NEW_LINE>logger.debug("Creating Harmony server on port {}", serverSocket.getLocalPort());<NEW_LINE>server = new HarmonyServer(serverSocket);<NEW_LINE>server.start();<NEW_LINE>broadcastFuture = scheduler.scheduleAtFixedRate(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>sendDiscoveryMessage(String.format(DISCO_STRING<MASK><NEW_LINE>}<NEW_LINE>}, 0, 2, TimeUnit.SECONDS);<NEW_LINE>timeoutFuture = scheduler.schedule(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>stopDiscovery();<NEW_LINE>}<NEW_LINE>}, timeout, TimeUnit.SECONDS);<NEW_LINE>running = true;<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("Could not start Harmony discovery server ", e);<NEW_LINE>}<NEW_LINE>}
, serverSocket.getLocalPort()));
26,563
private StarPredicate makeUnaryPredicate(RolapCubeMember member, RolapCube baseCube, Evaluator evaluator) {<NEW_LINE>TupleConstraintStruct constraint = new TupleConstraintStruct();<NEW_LINE>SqlConstraintUtils.expandSupportedCalculatedMember(member, evaluator, constraint);<NEW_LINE>List<Member> expandedMemberList = constraint.getMembers();<NEW_LINE>for (Member checkMember : expandedMemberList) {<NEW_LINE>if (checkMember == null || checkMember.isCalculated() || !(checkMember instanceof RolapCubeMember)) {<NEW_LINE>throw MondrianResource.instance().UnsupportedCalculatedMember.ex(member.getName(), null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<StarPredicate> predicates = new ArrayList<StarPredicate>(expandedMemberList.size());<NEW_LINE>for (Member iMember : expandedMemberList) {<NEW_LINE>RolapCubeMember iCubeMember = ((RolapCubeMember) iMember);<NEW_LINE>RolapCubeLevel iLevel = iCubeMember.getLevel();<NEW_LINE>RolapStar.Column iColumn = iLevel.getBaseStarKeyColumn(baseCube);<NEW_LINE>Object iKey = iCubeMember.getKey();<NEW_LINE>StarPredicate iPredicate = new ValueColumnPredicate(iColumn, iKey);<NEW_LINE>predicates.add(iPredicate);<NEW_LINE>}<NEW_LINE>StarPredicate r = null;<NEW_LINE>if (predicates.size() == 1) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>r = new OrPredicate(predicates);<NEW_LINE>}<NEW_LINE>return r;<NEW_LINE>}
r = predicates.get(0);
965,158
public static MessageData decode(JSONObject data, Map<String, String> userIds) throws ParseException {<NEW_LINE>if (data == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String topic = (<MASK><NEW_LINE>String message = (String) data.get("message");<NEW_LINE>Debugging.println("pubsub-msg", "%s: %s", topic, message);<NEW_LINE>if (topic.startsWith("chat_moderator_actions")) {<NEW_LINE>return ModeratorActionData.decode(topic, message, userIds);<NEW_LINE>} else if (topic.startsWith("automod-queue.")) {<NEW_LINE>return ModeratorActionData.decodeAutoMod(topic, message, userIds);<NEW_LINE>} else if (topic.startsWith("channel-points-channel-v1") || topic.startsWith("community-points-channel-v1")) {<NEW_LINE>RewardRedeemedMessageData result = RewardRedeemedMessageData.decode(topic, message, userIds);<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} else if (topic.startsWith("user-moderation-notifications")) {<NEW_LINE>UserModerationMessageData result = UserModerationMessageData.decode(topic, message, userIds);<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new MessageData(topic, message);<NEW_LINE>}
String) data.get("topic");
1,387,624
private SqlDynamicParam visitOneDynamicParam(SqlDynamicParam dynamicParam) {<NEW_LINE>if (autoIncrementColumn != curFieldIndex) {<NEW_LINE>return SqlNode.clone(dynamicParam);<NEW_LINE>}<NEW_LINE>final Map<Integer, ParameterContext> curParams = parameterSettings.getCurrentParameter();<NEW_LINE>final int dynamicParamIndex = dynamicParam.getIndex();<NEW_LINE>if (dynamicParam instanceof SqlSequenceParam) {<NEW_LINE>Long nextVal = assignImplicitValue(true);<NEW_LINE>// use setObject1 instead of oldPc.getParameterMethod, because<NEW_LINE>// the method is 'setString' when users inserts '0'.<NEW_LINE>ParameterContext newPc = new ParameterContext(ParameterMethod.setObject1, new Object[] { dynamicParamIndex + 1, nextVal });<NEW_LINE>curParams.<MASK><NEW_LINE>}<NEW_LINE>ParameterContext oldPc = curParams.get(dynamicParamIndex + 1);<NEW_LINE>Object autoIncValue = oldPc.getValue();<NEW_LINE>final Long newValue = RexUtils.valueOfObject1(autoIncValue);<NEW_LINE>// if NO_AUTO_VALUE_ON_ZERO is set, last_insert_id and returned_last_insert_id won't change.<NEW_LINE>boolean explicitLastInsertId = (null != newValue) && (0L != newValue);<NEW_LINE>boolean assignSequence = (null == newValue) || (0L == newValue && autoValueOnZero);<NEW_LINE>if (explicitLastInsertId) {<NEW_LINE>returnedLastInsertId = newValue;<NEW_LINE>SequenceManagerProxy.getInstance().updateValue(schemaName, seqName, newValue);<NEW_LINE>} else if (assignSequence) {<NEW_LINE>Long nextVal = assignImplicitValue(true);<NEW_LINE>// use setObject1 instead of oldPc.getParameterMethod, because<NEW_LINE>// the method is 'setString' when users inserts '0'.<NEW_LINE>ParameterContext newPc = new ParameterContext(ParameterMethod.setObject1, new Object[] { dynamicParamIndex + 1, nextVal });<NEW_LINE>curParams.put(dynamicParamIndex + 1, newPc);<NEW_LINE>}<NEW_LINE>return SqlNode.clone(dynamicParam);<NEW_LINE>}
put(dynamicParamIndex + 1, newPc);
1,113,204
private void chunkize(BufferedImage image) throws IOException {<NEW_LINE>for (int scaleIndex = 0; scaleIndex < getScaleCount(); scaleIndex++) {<NEW_LINE>int chunksX = getChunkCountX(scaleIndex);<NEW_LINE>int chunksY = getChunkCountY(scaleIndex);<NEW_LINE>double scaledChunkSize = CHUNK_SIZE / getScaleArray()[scaleIndex];<NEW_LINE>BufferedImage tmpImage = new BufferedImage(CHUNK_SIZE, CHUNK_SIZE, Transparency.OPAQUE);<NEW_LINE>for (int row = 0; row < chunksY; row++) {<NEW_LINE>for (int col = 0; col < chunksX; col++) {<NEW_LINE>// Don't bother if it's already been created<NEW_LINE>File filename = getChunkFilename(col, row, scaleIndex);<NEW_LINE>if (filename.exists()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int width = (int) Math.min(scaledChunkSize, image.getWidth() - col * scaledChunkSize);<NEW_LINE>int height = (int) Math.min(scaledChunkSize, image.getHeight() - row * scaledChunkSize);<NEW_LINE>BufferedImage chunkImage = image.getSubimage((int) (col * scaledChunkSize), (int) (row * scaledChunkSize), width, height);<NEW_LINE><MASK><NEW_LINE>g.drawImage(chunkImage, 0, 0, CHUNK_SIZE, CHUNK_SIZE, null);<NEW_LINE>g.dispose();<NEW_LINE>ImageIO.write(tmpImage, "jpg", filename);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Graphics2D g = tmpImage.createGraphics();
341,447
public static void convertToBoof(Picture input, ImageBase output) {<NEW_LINE>output.reshape(input.getWidth(), input.getHeight());<NEW_LINE>if (input.getColor() == ColorSpace.RGB) {<NEW_LINE>ImplConvertJCodecPicture.RGB_to_PLU8(input, (Planar<GrayU8>) output);<NEW_LINE>} else if (input.getColor() == ColorSpace.YUV420) {<NEW_LINE>if (output instanceof Planar) {<NEW_LINE>Planar ms = (Planar) output;<NEW_LINE>if (ms.getImageType().getDataType() == ImageDataType.U8) {<NEW_LINE>ImplConvertJCodecPicture.yuv420_to_PlRgb_U8(input, (Planar<GrayU8>) ms);<NEW_LINE>} else if (ms.getImageType().getDataType() == ImageDataType.F32) {<NEW_LINE>ImplConvertJCodecPicture.yuv420_to_PlRgb_F32(input, (Planar<GrayF32>) ms);<NEW_LINE>}<NEW_LINE>} else if (output instanceof GrayU8) {<NEW_LINE>ImplConvertJCodecPicture.yuv420_to_U8(input, (GrayU8) output);<NEW_LINE>} else if (output instanceof GrayF32) {<NEW_LINE>ImplConvertJCodecPicture.yuv420_to_F32<MASK><NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unexpected output image type");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(input, (GrayF32) output);
1,554,830
public boolean isTargetInterceptor(HttpServletRequest req) throws WebTrustAssociationException {<NEW_LINE><MASK><NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "openidClientConfig:(" + openidClientConfig + ")");<NEW_LINE>}<NEW_LINE>if (openidClientConfig == null)<NEW_LINE>return false;<NEW_LINE>// handle filter if any<NEW_LINE>String authFilterId = openidClientConfig.getAuthFilterId();<NEW_LINE>if (authFilterId != null && authFilterId.length() > 0) {<NEW_LINE>AuthenticationFilter authFilter = authFilterServiceRef.getService(authFilterId);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "authFilter id:" + authFilterId + " authFilter:" + authFilter);<NEW_LINE>}<NEW_LINE>if (authFilter != null) {<NEW_LINE>if (!authFilter.isAccepted(req))<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String providerIdentifier = openidClientConfig.getProviderIdentifier();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "providerIdentifier(openid_identifier):(" + providerIdentifier + ")");<NEW_LINE>}<NEW_LINE>return !(providerIdentifier == null || providerIdentifier.isEmpty());<NEW_LINE>}
OpenidClientConfig openidClientConfig = openidClientConfigRef.getService();
1,271,766
public final ClassdefContext classdef() throws RecognitionException {<NEW_LINE>ClassdefContext _localctx = new <MASK><NEW_LINE>enterRule(_localctx, 154, RULE_classdef);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(1551);<NEW_LINE>match(CLASS);<NEW_LINE>setState(1552);<NEW_LINE>_localctx.NAME = match(NAME);<NEW_LINE>ArgListBuilder baseClasses = null;<NEW_LINE>setState(1559);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == OPEN_PAREN) {<NEW_LINE>{<NEW_LINE>setState(1554);<NEW_LINE>match(OPEN_PAREN);<NEW_LINE>setState(1555);<NEW_LINE>_localctx.arglist = arglist();<NEW_LINE>setState(1556);<NEW_LINE>match(CLOSE_PAREN);<NEW_LINE>baseClasses = _localctx.arglist.result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// we need to create the scope here to resolve base classes in the outer scope<NEW_LINE>factory.getScopeEnvironment().createLocal((_localctx.NAME != null ? _localctx.NAME.getText() : null));<NEW_LINE>ScopeInfo classScope = scopeEnvironment.pushScope((_localctx.NAME != null ? _localctx.NAME.getText() : null), ScopeInfo.ScopeKind.Class);<NEW_LINE>LoopState savedLoopState = saveLoopState();<NEW_LINE>setState(1563);<NEW_LINE>match(COLON);<NEW_LINE>setState(1564);<NEW_LINE>_localctx.suite = suite();<NEW_LINE>push(factory.createClassDefinition((_localctx.NAME != null ? _localctx.NAME.getText() : null), baseClasses, optimize(_localctx.suite.result), getStartIndex(_localctx), getStopIndex((_localctx.suite != null ? (_localctx.suite.stop) : null))));<NEW_LINE>scopeEnvironment.popScope();<NEW_LINE>loopState = savedLoopState;<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
ClassdefContext(_ctx, getState());
1,674,131
public static double dotProduct(Long2DoubleMap v1, Long2DoubleMap v2) {<NEW_LINE>if (v1.size() > v2.size()) {<NEW_LINE>// compute dot product the other way around for speed<NEW_LINE>return dotProduct(v2, v1);<NEW_LINE>}<NEW_LINE>if (v1 instanceof Long2DoubleSortedArrayMap && v2 instanceof Long2DoubleSortedArrayMap) {<NEW_LINE>return dotProduct((Long2DoubleSortedArrayMap) v1, (Long2DoubleSortedArrayMap) v2);<NEW_LINE>} else {<NEW_LINE>double result = 0;<NEW_LINE>Long2DoubleFunction v2d = adaptDefaultValue(v2, 0.0);<NEW_LINE>Iterator<Long2DoubleMap.Entry> iter = fastEntryIterator(v1);<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Long2DoubleMap.Entry e = iter.next();<NEW_LINE><MASK><NEW_LINE>// since default is 0<NEW_LINE>result += e.getDoubleValue() * v2d.get(k);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
long k = e.getLongKey();
1,721,512
// The following code was copied from the jumpToLocation<NEW_LINE>// method in UIHelper.java<NEW_LINE>IDocument moduleNameToIDocument(String moduleName) {<NEW_LINE>IDocument result = this.moduleNameToDoc.get(moduleName);<NEW_LINE>if (result == null) {<NEW_LINE>IFile moduleIFile = (IFile) ResourceHelper.getResourceByModuleName(moduleName);<NEW_LINE>FileEditorInput fileEditorInput = new FileEditorInput(moduleIFile);<NEW_LINE>FileDocumentProvider moduleFileDocProvider = new FileDocumentProvider();<NEW_LINE>try {<NEW_LINE>moduleFileDocProvider.connect(fileEditorInput);<NEW_LINE>} catch (CoreException e1) {<NEW_LINE>// I don't know what to do here<NEW_LINE>MessageDialog.openError(UIHelper.getShellProvider().getShell(), "Decompose Proof Command", "An error that should not happen has occurred in " + "line 4239 of DecomposeProofHandler.");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
result = moduleFileDocProvider.getDocument(fileEditorInput);
1,338,029
final GetComponentVersionArtifactResult executeGetComponentVersionArtifact(GetComponentVersionArtifactRequest getComponentVersionArtifactRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getComponentVersionArtifactRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetComponentVersionArtifactRequest> request = null;<NEW_LINE>Response<GetComponentVersionArtifactResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetComponentVersionArtifactRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GreengrassV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetComponentVersionArtifact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetComponentVersionArtifactResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetComponentVersionArtifactResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(getComponentVersionArtifactRequest));
1,015,080
private void initComponents() {<NEW_LINE>Font labelEstimatedFont = new Font(Font.SANS_SERIF, Font.PLAIN, 12);<NEW_LINE>navigationButtons = new NavigationButtons(getBackend(), 1.0, (int) getBackend().getSettings().getJogFeedRate());<NEW_LINE>buttonUpdateSettingsX = new JButton(Localization.getString("platform.plugin.setupwizard.update"));<NEW_LINE>labelEstimatedStepsX = new JLabel("0 steps/mm");<NEW_LINE>labelEstimatedStepsX.setFont(labelEstimatedFont);<NEW_LINE>labelPositionX = new JLabel(" 0.0 mm", JLabel.RIGHT);<NEW_LINE>textFieldMeasuredX = new JTextField("0.0");<NEW_LINE>textFieldMeasuredX.addKeyListener(createKeyListener(Axis.X, labelEstimatedStepsX));<NEW_LINE>textFieldSettingStepsX = new JTextField("0.0");<NEW_LINE>textFieldSettingStepsX.addKeyListener(createKeyListenerChangeSetting());<NEW_LINE>buttonUpdateSettingsX.setEnabled(false);<NEW_LINE>buttonUpdateSettingsX.addActionListener(createListenerUpdateSetting(Axis.X, textFieldSettingStepsX));<NEW_LINE>buttonUpdateSettingsY = new JButton(Localization.getString("platform.plugin.setupwizard.update"));<NEW_LINE>labelEstimatedStepsY = new JLabel(Localization.getString("platform.plugin.setupwizard.calibration.setting"));<NEW_LINE>labelEstimatedStepsY.setFont(labelEstimatedFont);<NEW_LINE>labelPositionY = new JLabel(" 0.0 mm", JLabel.RIGHT);<NEW_LINE>textFieldMeasuredY = new JTextField("0.0");<NEW_LINE>textFieldMeasuredY.addKeyListener(createKeyListener(Axis.Y, labelEstimatedStepsY));<NEW_LINE>textFieldSettingStepsY = new JTextField("0.0");<NEW_LINE>textFieldSettingStepsY.addKeyListener(createKeyListenerChangeSetting());<NEW_LINE>buttonUpdateSettingsY.setEnabled(false);<NEW_LINE>buttonUpdateSettingsY.addActionListener(createListenerUpdateSetting(Axis.Y, textFieldSettingStepsY));<NEW_LINE>buttonUpdateSettingsZ = new JButton(Localization.getString("platform.plugin.setupwizard.update"));<NEW_LINE>labelEstimatedStepsZ = new JLabel("0 steps/mm");<NEW_LINE>labelEstimatedStepsZ.setFont(labelEstimatedFont);<NEW_LINE>labelPositionZ = new JLabel(" 0.0 mm", JLabel.RIGHT);<NEW_LINE>textFieldMeasuredZ = new JTextField("0.0");<NEW_LINE>textFieldMeasuredZ.addKeyListener(createKeyListener(Axis.Z, labelEstimatedStepsZ));<NEW_LINE>textFieldSettingStepsZ = new JTextField("0.0");<NEW_LINE>textFieldSettingStepsZ.addKeyListener(createKeyListenerChangeSetting());<NEW_LINE>buttonUpdateSettingsZ.setEnabled(false);<NEW_LINE>buttonUpdateSettingsZ.addActionListener(createListenerUpdateSetting<MASK><NEW_LINE>}
(Axis.Z, textFieldSettingStepsZ));
66,100
private void generateBinarySearch(List<TableEntry> entries, int lower, int upper, WasmBlock consumer, WasmBlock defaultTarget, WasmLocal conditionVar) {<NEW_LINE>if (upper - lower == 0) {<NEW_LINE>int label = entries.get(lower).label;<NEW_LINE>WasmExpression condition = new WasmIntBinary(WasmIntType.INT32, WasmIntBinaryOperation.EQ, new WasmGetLocal(conditionVar), new WasmInt32Constant(label));<NEW_LINE>WasmConditional conditional = new WasmConditional(condition);<NEW_LINE>consumer.getBody().add(conditional);<NEW_LINE>conditional.getThenBlock().getBody().add(new WasmBreak(entries.<MASK><NEW_LINE>conditional.getElseBlock().getBody().add(new WasmBreak(defaultTarget));<NEW_LINE>} else if (upper - lower <= 0) {<NEW_LINE>consumer.getBody().add(new WasmBreak(defaultTarget));<NEW_LINE>} else {<NEW_LINE>int mid = (upper + lower) / 2;<NEW_LINE>int label = entries.get(mid).label;<NEW_LINE>WasmExpression condition = new WasmIntBinary(WasmIntType.INT32, WasmIntBinaryOperation.GT_SIGNED, new WasmGetLocal(conditionVar), new WasmInt32Constant(label));<NEW_LINE>WasmConditional conditional = new WasmConditional(condition);<NEW_LINE>consumer.getBody().add(conditional);<NEW_LINE>generateBinarySearch(entries, mid + 1, upper, conditional.getThenBlock(), defaultTarget, conditionVar);<NEW_LINE>generateBinarySearch(entries, lower, mid, conditional.getElseBlock(), defaultTarget, conditionVar);<NEW_LINE>}<NEW_LINE>}
get(lower).target));
582,829
private static void calculateSubTypes() {<NEW_LINE>if (subTypes != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>subTypes = new ArrayList<>(1000);<NEW_LINE>FacadeItem itemFacade = AEItems.FACADE.asItem();<NEW_LINE>for (var b : Registry.BLOCK) {<NEW_LINE>try {<NEW_LINE>var item = Item.byBlock(b);<NEW_LINE>if (item == Items.AIR) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Item blockItem = b.asItem();<NEW_LINE>if (blockItem != Items.AIR && blockItem.getItemCategory() != null) {<NEW_LINE>final NonNullList<ItemStack<MASK><NEW_LINE>b.fillItemCategory(blockItem.getItemCategory(), tmpList);<NEW_LINE>for (ItemStack l : tmpList) {<NEW_LINE>final ItemStack facade = itemFacade.createFacadeForItem(l, false);<NEW_LINE>if (!facade.isEmpty()) {<NEW_LINE>subTypes.add(facade);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// just absorb..<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
> tmpList = NonNullList.create();
1,801,398
private DrillIndexDescriptor buildIndexDescriptor(String tableName, IndexDesc desc) throws InvalidIndexDefinitionException {<NEW_LINE>if (desc.isExternal()) {<NEW_LINE>// External index is not currently supported<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>IndexDescriptor.IndexType idxType = IndexDescriptor.IndexType.NATIVE_SECONDARY_INDEX;<NEW_LINE>List<LogicalExpression> indexFields = field2SchemaPath(desc.getIndexedFields());<NEW_LINE>List<LogicalExpression> coveringFields = field2SchemaPath(desc.getIncludedFields());<NEW_LINE>coveringFields.add(SchemaPath.getSimplePath("_id"));<NEW_LINE>CollationContext collationContext = null;<NEW_LINE>if (!desc.isHashed()) {<NEW_LINE>// hash index has no collation property<NEW_LINE>List<RelFieldCollation> indexFieldCollations = getFieldCollations(desc, desc.getIndexedFields());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>DrillIndexDescriptor idx = new MapRDBIndexDescriptor(indexFields, collationContext, coveringFields, null, desc.getIndexName(), tableName, idxType, desc, this.getOriginalScan(), desc.getMissingAndNullOrdering() == MissingAndNullOrdering.MissingAndNullFirst ? NullDirection.FIRST : (desc.getMissingAndNullOrdering() == MissingAndNullOrdering.MissingAndNullLast ? NullDirection.LAST : NullDirection.UNSPECIFIED));<NEW_LINE>String storageName = this.getOriginalScan().getStoragePlugin().getName();<NEW_LINE>materializeIndex(storageName, idx);<NEW_LINE>return idx;<NEW_LINE>}
collationContext = buildCollationContext(indexFields, indexFieldCollations);
1,094,108
public void uploadFile(String httpMethod, String urlString, String localFileName) throws Exception {<NEW_LINE>HttpURLConnection conn = getRawHTTPConnection(urlString);<NEW_LINE>conn.setDoOutput(true);<NEW_LINE>conn.setUseCaches(false);<NEW_LINE>conn.setChunkedStreamingMode(ChunkSize);<NEW_LINE>conn.setRequestMethod(httpMethod);<NEW_LINE><MASK><NEW_LINE>String contentType = "application/octet-stream";<NEW_LINE>conn.setRequestProperty("Content-Type", contentType);<NEW_LINE>conn.setRequestProperty("Content-Length", Long.toString(new File(localFileName).length()));<NEW_LINE>connectWithRetry(conn);<NEW_LINE>OutputStream out = null;<NEW_LINE>InputStream in = null;<NEW_LINE>BufferedReader br = null;<NEW_LINE>try {<NEW_LINE>out = conn.getOutputStream();<NEW_LINE>in = new FileInputStream(localFileName);<NEW_LINE>byte[] buf = new byte[ChunkSize];<NEW_LINE>int len = 0;<NEW_LINE>while ((len = in.read(buf)) > 0) {<NEW_LINE>out.write(buf, 0, len);<NEW_LINE>}<NEW_LINE>out.flush();<NEW_LINE>} finally {<NEW_LINE>if (in != null)<NEW_LINE>in.close();<NEW_LINE>if (out != null)<NEW_LINE>out.close();<NEW_LINE>if (br != null)<NEW_LINE>br.close();<NEW_LINE>conn.disconnect();<NEW_LINE>}<NEW_LINE>}
conn.setRequestProperty("Connection", "Keep-Alive");
192,267
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>contentView = View.inflate(getContext(), R.layout.bottom_sheet_contact_attachment_item, null);<NEW_LINE>itemsLayout = contentView.findViewById(R.id.items_layout);<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>chatId = savedInstanceState.getLong(CHAT_ID, INVALID_HANDLE);<NEW_LINE>messageId = <MASK><NEW_LINE>email = savedInstanceState.getString(EMAIL);<NEW_LINE>MegaChatMessage messageMega = megaChatApi.getMessage(chatId, messageId);<NEW_LINE>if (messageMega != null) {<NEW_LINE>message = new AndroidMegaChatMessage(messageMega);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>chatId = ((ContactAttachmentActivity) requireActivity()).chatId;<NEW_LINE>messageId = ((ContactAttachmentActivity) requireActivity()).messageId;<NEW_LINE>email = ((ContactAttachmentActivity) requireActivity()).selectedEmail;<NEW_LINE>}<NEW_LINE>MegaChatMessage messageMega = megaChatApi.getMessage(chatId, messageId);<NEW_LINE>if (messageMega != null) {<NEW_LINE>message = new AndroidMegaChatMessage(messageMega);<NEW_LINE>}<NEW_LINE>logDebug("Chat ID: " + chatId + ", Message ID: " + messageId);<NEW_LINE>chatC = new ChatController(requireActivity());<NEW_LINE>return contentView;<NEW_LINE>}
savedInstanceState.getLong(MESSAGE_ID, INVALID_HANDLE);
191,843
private static Map<Integer, String> make() {<NEW_LINE>final Map<Integer, String> map = new HashMap<>(0);<NEW_LINE>map.put(HttpURLConnection.HTTP_OK, "OK");<NEW_LINE>map.put(HttpURLConnection.HTTP_CREATED, "Created");<NEW_LINE>map.put(HttpURLConnection.HTTP_ACCEPTED, "Accepted");<NEW_LINE>map.put(HttpURLConnection.HTTP_NOT_AUTHORITATIVE, "Non-Authoritative Information");<NEW_LINE>map.put(HttpURLConnection.HTTP_NO_CONTENT, "No Content");<NEW_LINE>map.put(HttpURLConnection.HTTP_RESET, "Reset Content");<NEW_LINE>map.put(HttpURLConnection.HTTP_PARTIAL, "Partial Content");<NEW_LINE>map.put(HttpURLConnection.HTTP_MULT_CHOICE, "Multiple Choices");<NEW_LINE>map.put(HttpURLConnection.HTTP_MOVED_PERM, "Moved Permanently");<NEW_LINE>map.put(HttpURLConnection.HTTP_MOVED_TEMP, "Found");<NEW_LINE>map.put(HttpURLConnection.HTTP_SEE_OTHER, "See Other");<NEW_LINE>map.put(HttpURLConnection.HTTP_NOT_MODIFIED, "Not Modified");<NEW_LINE>map.put(HttpURLConnection.HTTP_USE_PROXY, "Use Proxy");<NEW_LINE>map.put(HttpURLConnection.HTTP_BAD_REQUEST, "Bad Request");<NEW_LINE>map.put(HttpURLConnection.HTTP_UNAUTHORIZED, "Unauthorized");<NEW_LINE>map.put(HttpURLConnection.HTTP_PAYMENT_REQUIRED, "Payment Required");<NEW_LINE>map.put(HttpURLConnection.HTTP_FORBIDDEN, "Forbidden");<NEW_LINE>map.put(HttpURLConnection.HTTP_NOT_FOUND, "Not Found");<NEW_LINE>map.put(HttpURLConnection.HTTP_BAD_METHOD, "Method Not Allowed");<NEW_LINE>map.put(HttpURLConnection.HTTP_NOT_ACCEPTABLE, "Not Acceptable");<NEW_LINE>map.<MASK><NEW_LINE>map.put(HttpURLConnection.HTTP_CLIENT_TIMEOUT, "Request Timeout");<NEW_LINE>map.put(HttpURLConnection.HTTP_CONFLICT, "Conflict");<NEW_LINE>map.put(HttpURLConnection.HTTP_GONE, "Gone");<NEW_LINE>map.put(HttpURLConnection.HTTP_LENGTH_REQUIRED, "Length Required");<NEW_LINE>map.put(HttpURLConnection.HTTP_PRECON_FAILED, "Precondition Failed");<NEW_LINE>map.put(HttpURLConnection.HTTP_ENTITY_TOO_LARGE, "Payload Too Large");<NEW_LINE>map.put(HttpURLConnection.HTTP_REQ_TOO_LONG, "URI Too Long");<NEW_LINE>map.put(HttpURLConnection.HTTP_UNSUPPORTED_TYPE, "Unsupported Media Type");<NEW_LINE>map.put(HttpURLConnection.HTTP_INTERNAL_ERROR, "Internal Server Error");<NEW_LINE>map.put(HttpURLConnection.HTTP_NOT_IMPLEMENTED, "Not Implemented");<NEW_LINE>map.put(HttpURLConnection.HTTP_BAD_GATEWAY, "Bad Gateway");<NEW_LINE>map.put(HttpURLConnection.HTTP_UNAVAILABLE, "Service Unavailable");<NEW_LINE>map.put(HttpURLConnection.HTTP_GATEWAY_TIMEOUT, "Gateway Timeout");<NEW_LINE>map.put(HttpURLConnection.HTTP_VERSION, "HTTP Version Not Supported");<NEW_LINE>return map;<NEW_LINE>}
put(HttpURLConnection.HTTP_PROXY_AUTH, "Proxy Authentication Required");
1,051,844
final CancelElasticsearchServiceSoftwareUpdateResult executeCancelElasticsearchServiceSoftwareUpdate(CancelElasticsearchServiceSoftwareUpdateRequest cancelElasticsearchServiceSoftwareUpdateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(cancelElasticsearchServiceSoftwareUpdateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CancelElasticsearchServiceSoftwareUpdateRequest> request = null;<NEW_LINE>Response<CancelElasticsearchServiceSoftwareUpdateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CancelElasticsearchServiceSoftwareUpdateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(cancelElasticsearchServiceSoftwareUpdateRequest));<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, "Elasticsearch Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelElasticsearchServiceSoftwareUpdate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CancelElasticsearchServiceSoftwareUpdateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new CancelElasticsearchServiceSoftwareUpdateResultJsonUnmarshaller());
1,459,687
private void decodePulseData(BitReader _in) throws AACException {<NEW_LINE>pulseCount = _in.readNBit(2) + 1;<NEW_LINE>pulseStartSWB = _in.readNBit(6);<NEW_LINE>if (pulseStartSWB >= info.getSWBCount())<NEW_LINE>throw new AACException("pulse SWB out of range: " + pulseStartSWB + " > " + info.getSWBCount());<NEW_LINE>if (pulseOffset == null || pulseCount != pulseOffset.length) {<NEW_LINE>// only reallocate if needed<NEW_LINE>pulseOffset = new int[pulseCount];<NEW_LINE>pulseAmp = new int[pulseCount];<NEW_LINE>}<NEW_LINE>pulseOffset[0] = info.getSWBOffsets()[pulseStartSWB];<NEW_LINE>pulseOffset[0] += _in.readNBit(5);<NEW_LINE>pulseAmp[0] = _in.readNBit(4);<NEW_LINE>for (int i = 1; i < pulseCount; i++) {<NEW_LINE>pulseOffset[i] = _in.readNBit(5<MASK><NEW_LINE>if (pulseOffset[i] > 1023)<NEW_LINE>throw new AACException("pulse offset out of range: " + pulseOffset[0]);<NEW_LINE>pulseAmp[i] = _in.readNBit(4);<NEW_LINE>}<NEW_LINE>}
) + pulseOffset[i - 1];
863,247
public boolean isEnabledForContext(ActionContext context) {<NEW_LINE>if (!(context instanceof DecompilerActionContext)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>DecompilerActionContext decompilerContext = (DecompilerActionContext) context;<NEW_LINE>return decompilerContext.checkActionEnablement(() -> {<NEW_LINE>Function function = controller.getFunction();<NEW_LINE>if (function == null || function instanceof UndefinedFunction) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>DataType dt = null;<NEW_LINE>boolean isThisParam = false;<NEW_LINE>// get the data type at the location and see if it is OK<NEW_LINE><MASK><NEW_LINE>ClangToken tokenAtCursor = decompilerPanel.getTokenAtCursor();<NEW_LINE>if (tokenAtCursor == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int maxPointerSize = controller.getProgram().getDefaultPointerSize();<NEW_LINE>HighVariable var = tokenAtCursor.getHighVariable();<NEW_LINE>if (var != null && !(var instanceof HighConstant)) {<NEW_LINE>dt = var.getDataType();<NEW_LINE>isThisParam = testForAutoParameterThis(var, function);<NEW_LINE>}<NEW_LINE>if (dt == null || dt.getLength() > maxPointerSize) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>adjustCreateStructureMenuText(dt, isThisParam);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>}
DecompilerPanel decompilerPanel = controller.getDecompilerPanel();
983,026
void shareScreen(final Bitmap bitmap) {<NEW_LINE>try {<NEW_LINE>final File file = new File(getExternalCacheDir(), "screen.png");<NEW_LINE>final FileOutputStream fileOutputStream = new FileOutputStream(file);<NEW_LINE>bitmap.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream);<NEW_LINE>fileOutputStream.flush();<NEW_LINE>fileOutputStream.close();<NEW_LINE>file.setReadable(true, false);<NEW_LINE>final Uri fileUri = FileProvider.getUriForFile(getApplicationContext(), getPackageName() + ".provider", file);<NEW_LINE>grantUriPermission(getPackageName(), fileUri, Intent.FLAG_GRANT_READ_URI_PERMISSION);<NEW_LINE>final Intent intent = new Intent(android.content.Intent.ACTION_SEND);<NEW_LINE>intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>intent.<MASK><NEW_LINE>intent.setType("image/png");<NEW_LINE>startActivity(Intent.createChooser(intent, getString(R.string.share_image_via)));<NEW_LINE>} catch (final IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
putExtra(Intent.EXTRA_STREAM, fileUri);
180,057
public void run() {<NEW_LINE>while (rpcService != null) {<NEW_LINE>try {<NEW_LINE>// Batch up sync tasks so we use fewer, larger messages<NEW_LINE>// XXX - todo - handle hints targeted to specific nodes<NEW_LINE>storeRegistry.takeHints(tasks, 50);<NEW_LINE>for (Hint task : tasks) {<NEW_LINE>counterHints.increment();<NEW_LINE>SynchronizingStorageEngine store = storeRegistry.get(task.getHintKey().getStoreName());<NEW_LINE>SyncMessage bsm = getMessage(store);<NEW_LINE>KeyedValues kv = TProtocolUtil.getTKeyedValues(task.getHintKey().getKey(), task.getValues());<NEW_LINE>bsm.getSyncValue().addToValues(kv);<NEW_LINE>}<NEW_LINE>Iterable<Node> nodes = getClusterConfig().getNodes();<NEW_LINE>short localDomainId = getClusterConfig().getNode().getDomainId();<NEW_LINE>short localNodeId = getClusterConfig().getNode().getNodeId();<NEW_LINE>for (Node n : nodes) {<NEW_LINE>if (localNodeId == n.getNodeId())<NEW_LINE>continue;<NEW_LINE>for (SyncMessage bsm : messages.values()) {<NEW_LINE><MASK><NEW_LINE>if (svm.getStore().getScope().equals(org.sdnplatform.sync.thrift.Scope.LOCAL) && n.getDomainId() != localDomainId) {<NEW_LINE>// This message is only for local domain<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>svm.getHeader().setTransactionId(rpcService.getTransactionId());<NEW_LINE>counterSentValues.add(bsm.getSyncValue().getValuesSize());<NEW_LINE>rpcService.writeToNode(n.getNodeId(), bsm);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tasks.clear();<NEW_LINE>clearMessages();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Error occured in synchronization worker", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
SyncValueMessage svm = bsm.getSyncValue();
1,213,439
protected PwEntry populateNewEntry(PwEntry entry) {<NEW_LINE>PwEntry newEntry;<NEW_LINE>if (entry == null) {<NEW_LINE>newEntry = mEntry.clone(true);<NEW_LINE>} else {<NEW_LINE>newEntry = entry;<NEW_LINE>}<NEW_LINE>Date now = Calendar.getInstance().getTime();<NEW_LINE>newEntry.setLastAccessTime(now);<NEW_LINE>newEntry.setLastModificationTime(now);<NEW_LINE>PwDatabase db = App.getDB().pm;<NEW_LINE>newEntry.setTitle(Util.getEditText(this, R<MASK><NEW_LINE>newEntry.setUrl(Util.getEditText(this, R.id.entry_url), db);<NEW_LINE>newEntry.setUsername(Util.getEditText(this, R.id.entry_user_name), db);<NEW_LINE>newEntry.setNotes(Util.getEditText(this, R.id.entry_comment), db);<NEW_LINE>newEntry.setPassword(Util.getEditText(this, R.id.entry_password), db);<NEW_LINE>return newEntry;<NEW_LINE>}
.id.entry_title), db);
418,930
public emu.grasscutter.net.proto.WorldPlayerInfoNotifyOuterClass.WorldPlayerInfoNotify buildPartial() {<NEW_LINE>emu.grasscutter.net.proto.WorldPlayerInfoNotifyOuterClass.WorldPlayerInfoNotify result = new emu.grasscutter.net.proto.WorldPlayerInfoNotifyOuterClass.WorldPlayerInfoNotify(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>if (playerInfoListBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000001) != 0)) {<NEW_LINE>playerInfoList_ = java.util.Collections.unmodifiableList(playerInfoList_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>}<NEW_LINE>result.playerInfoList_ = playerInfoList_;<NEW_LINE>} else {<NEW_LINE>result.playerInfoList_ = playerInfoListBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) != 0)) {<NEW_LINE>playerUidList_.makeImmutable();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>result.playerUidList_ = playerUidList_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
bitField0_ = (bitField0_ & ~0x00000002);
758,839
public RScheduledFuture<?> scheduleAtFixedRateAsync(Runnable task, long initialDelay, long period, TimeUnit unit) {<NEW_LINE>check(task);<NEW_LINE>ClassBody classBody = getClassBody(task);<NEW_LINE>byte[] state = encode(task);<NEW_LINE>long startTime = System.currentTimeMillis() + unit.toMillis(initialDelay);<NEW_LINE>ScheduledAtFixedRateParameters params = new ScheduledAtFixedRateParameters();<NEW_LINE>params.setClassName(classBody.getClazzName());<NEW_LINE>params.setClassBody(classBody.getClazz());<NEW_LINE>params.setLambdaBody(classBody.getLambda());<NEW_LINE>params.setState(state);<NEW_LINE>params.setStartTime(startTime);<NEW_LINE>params.setPeriod(unit.toMillis(period));<NEW_LINE>params.setExecutorId(executorId);<NEW_LINE>RemotePromise<Void> result = (RemotePromise<Void>) asyncScheduledServiceAtFixed.<MASK><NEW_LINE>addListener(result);<NEW_LINE>return createFuture(result, startTime);<NEW_LINE>}
scheduleAtFixedRate(params).toCompletableFuture();
1,752,587
private TransferSettings askPluginSettings(TransferSettings settings, Map<String, String> knownPluginSettings) throws StorageException {<NEW_LINE>if (isInteractive) {<NEW_LINE>out.println();<NEW_LINE>out.println("Connection details for " + settings.getType() + " connection:");<NEW_LINE>} else {<NEW_LINE>logger.log(Level.INFO, "Non interactive mode");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Show OAuth output<NEW_LINE>printOAuthInformation(settings);<NEW_LINE>// Ask for plugin settings<NEW_LINE>List<TransferPluginOption> pluginOptions = TransferPluginOptions.getOrderedOptions(settings.getClass());<NEW_LINE>for (TransferPluginOption option : pluginOptions) {<NEW_LINE>askPluginSettings(<MASK><NEW_LINE>}<NEW_LINE>} catch (NoSuchFieldException e) {<NEW_LINE>logger.log(Level.SEVERE, "No token could be found, maybe user denied access", e);<NEW_LINE>throw new StorageException("No token found. Did you accept the authorization?", e);<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>logger.log(Level.SEVERE, "No token was received in the given time interval", e);<NEW_LINE>throw new StorageException("No token was received in the given time interval", e);<NEW_LINE>} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException | IOException | InterruptedException | ExecutionException e) {<NEW_LINE>logger.log(Level.SEVERE, "Unable to execute option generator", e);<NEW_LINE>throw new RuntimeException("Unable to execute option generator: " + e.getMessage());<NEW_LINE>}<NEW_LINE>if (!settings.isValid()) {<NEW_LINE>if (askRetryInvalidSettings(settings.getReasonForLastValidationFail())) {<NEW_LINE>return askPluginSettings(settings, knownPluginSettings);<NEW_LINE>}<NEW_LINE>throw new StorageException("Validation failed: " + settings.getReasonForLastValidationFail());<NEW_LINE>}<NEW_LINE>logger.log(Level.INFO, "Settings are " + settings.toString());<NEW_LINE>return settings;<NEW_LINE>}
settings, option, knownPluginSettings, "");
38,377
private String stripOffVariableKeys(String rawProvider) {<NEW_LINE>String[] keys = getVariableKeys();<NEW_LINE>if (keys == null || keys.length == 0) {<NEW_LINE>return rawProvider;<NEW_LINE>}<NEW_LINE>for (String key : keys) {<NEW_LINE>int <MASK><NEW_LINE>if (idxStart == -1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int idxEnd = rawProvider.indexOf(ENCODED_AND_MARK, idxStart);<NEW_LINE>String part1 = rawProvider.substring(0, idxStart);<NEW_LINE>if (idxEnd == -1) {<NEW_LINE>rawProvider = part1;<NEW_LINE>} else {<NEW_LINE>String part2 = rawProvider.substring(idxEnd + ENCODED_AND_MARK.length());<NEW_LINE>rawProvider = part1 + part2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (rawProvider.endsWith(ENCODED_AND_MARK)) {<NEW_LINE>rawProvider = rawProvider.substring(0, rawProvider.length() - ENCODED_AND_MARK.length());<NEW_LINE>}<NEW_LINE>if (rawProvider.endsWith(ENCODED_QUESTION_MARK)) {<NEW_LINE>rawProvider = rawProvider.substring(0, rawProvider.length() - ENCODED_QUESTION_MARK.length());<NEW_LINE>}<NEW_LINE>return rawProvider;<NEW_LINE>}
idxStart = rawProvider.indexOf(key);
718,002
final DescribeDefaultEncryptionConfigurationResult executeDescribeDefaultEncryptionConfiguration(DescribeDefaultEncryptionConfigurationRequest describeDefaultEncryptionConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDefaultEncryptionConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDefaultEncryptionConfigurationRequest> request = null;<NEW_LINE>Response<DescribeDefaultEncryptionConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDefaultEncryptionConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDefaultEncryptionConfigurationRequest));<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, "IoTSiteWise");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDefaultEncryptionConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "api.";<NEW_LINE>String resolvedHostPrefix = String.format("api.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDefaultEncryptionConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDefaultEncryptionConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,632,847
public static void upload(VideoFrame vf, ByteBuffer buffer, int texture) {<NEW_LINE>GLES10.glBindTexture(GLES10.GL_TEXTURE_2D, texture);<NEW_LINE>try (VideoStreamProfile profile = vf.getProfile()) {<NEW_LINE>switch(profile.getFormat()) {<NEW_LINE>case RGB8:<NEW_LINE>case BGR8:<NEW_LINE>GLES10.glTexImage2D(GLES10.GL_TEXTURE_2D, 0, GLES10.GL_RGB, vf.getWidth(), vf.getHeight(), 0, GLES10.GL_RGB, GLES10.GL_UNSIGNED_BYTE, buffer);<NEW_LINE>break;<NEW_LINE>case RGBA8:<NEW_LINE>GLES10.glTexImage2D(GLES10.GL_TEXTURE_2D, 0, GLES10.GL_RGBA, vf.getWidth(), vf.getHeight(), 0, GLES10.GL_RGBA, GLES10.GL_UNSIGNED_BYTE, buffer);<NEW_LINE>break;<NEW_LINE>case Y8:<NEW_LINE>GLES10.glTexImage2D(GLES10.GL_TEXTURE_2D, 0, GLES10.GL_LUMINANCE, vf.getWidth(), vf.getHeight(), 0, GLES10.<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("The requested format is not supported by the viewer");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>GLES10.glTexParameterx(GLES10.GL_TEXTURE_2D, GLES10.GL_TEXTURE_MAG_FILTER, GLES10.GL_LINEAR);<NEW_LINE>GLES10.glTexParameterx(GLES10.GL_TEXTURE_2D, GLES10.GL_TEXTURE_MIN_FILTER, GLES10.GL_LINEAR);<NEW_LINE>GLES10.glTexParameterx(GLES10.GL_TEXTURE_2D, GLES10.GL_TEXTURE_WRAP_S, 0x2900);<NEW_LINE>GLES10.glTexParameterx(GLES10.GL_TEXTURE_2D, GLES10.GL_TEXTURE_WRAP_T, 0x2900);<NEW_LINE>GLES10.glPixelStorei(0x0CF2, 0);<NEW_LINE>GLES10.glBindTexture(GLES10.GL_TEXTURE_2D, 0);<NEW_LINE>}
GL_LUMINANCE, GLES10.GL_UNSIGNED_BYTE, buffer);
101,538
private DisposerInfo findDisposer(Set<Type> beanTypes, BeanInfo declaringBean, AnnotationTarget annotationTarget, List<DisposerInfo> disposers) {<NEW_LINE>List<DisposerInfo> found = new ArrayList<>();<NEW_LINE>Set<AnnotationInstance> qualifiers = new HashSet<>();<NEW_LINE>Collection<AnnotationInstance> allAnnotations = getAnnotations(annotationTarget);<NEW_LINE>allAnnotations.forEach(a -> extractQualifiers(a).forEach(qualifiers::add));<NEW_LINE>for (DisposerInfo disposer : disposers) {<NEW_LINE>if (disposer.getDeclaringBean().equals(declaringBean)) {<NEW_LINE>boolean hasQualifier = true;<NEW_LINE>for (AnnotationInstance disposerQualifier : disposer.getDisposedParameterQualifiers()) {<NEW_LINE>if (!Beans.hasQualifier(declaringBean.getDeployment(), disposerQualifier, qualifiers)) {<NEW_LINE>hasQualifier = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasQualifier) {<NEW_LINE>Type disposedParamType = disposer.getDisposedParameterType();<NEW_LINE>for (Type beanType : beanTypes) {<NEW_LINE>if (beanResolver.matches(disposedParamType, beanType)) {<NEW_LINE>found.add(disposer);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (found.size() > 1) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return found.isEmpty() ? null : found.get(0);<NEW_LINE>}
throw new DefinitionException("Multiple disposer methods found for " + annotationTarget);
259,049
final DeleteUserPermissionsBoundaryResult executeDeleteUserPermissionsBoundary(DeleteUserPermissionsBoundaryRequest deleteUserPermissionsBoundaryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteUserPermissionsBoundaryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteUserPermissionsBoundaryRequest> request = null;<NEW_LINE>Response<DeleteUserPermissionsBoundaryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteUserPermissionsBoundaryRequestMarshaller().marshall(super.beforeMarshalling(deleteUserPermissionsBoundaryRequest));<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, "IAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteUserPermissionsBoundary");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteUserPermissionsBoundaryResult> responseHandler = new StaxResponseHandler<DeleteUserPermissionsBoundaryResult>(new DeleteUserPermissionsBoundaryResultStaxUnmarshaller());<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,282,818
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) {<NEW_LINE>long queryArrivalTimeMs = 0;<NEW_LINE>InstanceRequest instanceRequest = null;<NEW_LINE>byte[] requestBytes = null;<NEW_LINE>String tableNameWithType = null;<NEW_LINE>try {<NEW_LINE>// Put all code inside try block to catch all exceptions.<NEW_LINE>int requestSize = msg.readableBytes();<NEW_LINE>instanceRequest = new InstanceRequest();<NEW_LINE>ServerQueryRequest queryRequest;<NEW_LINE>requestBytes = new byte[requestSize];<NEW_LINE>queryArrivalTimeMs = System.currentTimeMillis();<NEW_LINE>_serverMetrics.addMeteredGlobalValue(ServerMeter.QUERIES, 1);<NEW_LINE>_serverMetrics.addMeteredGlobalValue(ServerMeter.NETTY_CONNECTION_BYTES_RECEIVED, requestSize);<NEW_LINE>// Parse instance request into ServerQueryRequest.<NEW_LINE>msg.readBytes(requestBytes);<NEW_LINE>_deserializer.deserialize(instanceRequest, requestBytes);<NEW_LINE>queryRequest = new ServerQueryRequest(instanceRequest, _serverMetrics, queryArrivalTimeMs);<NEW_LINE>queryRequest.getTimerContext().startNewPhaseTimer(ServerQueryPhase.REQUEST_DESERIALIZATION, queryArrivalTimeMs).stopAndRecord();<NEW_LINE>tableNameWithType = queryRequest.getTableNameWithType();<NEW_LINE>// Submit query for execution and register callback for execution results.<NEW_LINE>Futures.addCallback(_queryScheduler.submit(queryRequest), createCallback(ctx, tableNameWithType, queryArrivalTimeMs, instanceRequest, queryRequest), MoreExecutors.directExecutor());<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (e instanceof TException) {<NEW_LINE>// Deserialization exception<NEW_LINE>_serverMetrics.<MASK><NEW_LINE>}<NEW_LINE>// Send error response<NEW_LINE>String hexString = requestBytes != null ? BytesUtils.toHexString(requestBytes) : "";<NEW_LINE>long reqestId = instanceRequest != null ? instanceRequest.getRequestId() : 0;<NEW_LINE>LOGGER.error("Exception while processing instance request: {}", hexString, e);<NEW_LINE>sendErrorResponse(ctx, reqestId, tableNameWithType, queryArrivalTimeMs, DataTableBuilder.getEmptyDataTable(), e);<NEW_LINE>}<NEW_LINE>}
addMeteredGlobalValue(ServerMeter.REQUEST_DESERIALIZATION_EXCEPTIONS, 1);
1,581,641
private boolean addTransition(ArrayList<Transition> transitions, Transition tr) {<NEW_LINE>int size = transitions.size();<NEW_LINE>if (size == 0) {<NEW_LINE>// System.out.println("Adding " + tr);<NEW_LINE>transitions.add(tr);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Transition last = transitions.get(size - 1);<NEW_LINE>if (!tr.isTransitionFrom(last)) {<NEW_LINE>// System.out.println("Rejected " + tr);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// If local time of new transition is same as last local time, just<NEW_LINE>// replace last transition with new one.<NEW_LINE>int offsetForLast = 0;<NEW_LINE>if (size >= 2) {<NEW_LINE>offsetForLast = transitions.get(size - 2).getWallOffset();<NEW_LINE>}<NEW_LINE>int offsetForNew = last.getWallOffset();<NEW_LINE>long lastLocal <MASK><NEW_LINE>long newLocal = tr.getMillis() + offsetForNew;<NEW_LINE>if (newLocal != lastLocal) {<NEW_LINE>transitions.add(tr);<NEW_LINE>// System.out.println("Adding " + tr);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Transition previous = transitions.remove(size - 1);<NEW_LINE>Transition adjusted = tr.withMillis(previous.getMillis());<NEW_LINE>// System.out.println("Current " + tr);<NEW_LINE>// System.out.println("Previous " + previous);<NEW_LINE>// System.out.println("Adjusted " + adjusted);<NEW_LINE>return addTransition(transitions, adjusted);<NEW_LINE>}
= last.getMillis() + offsetForLast;
1,450,081
public void sendRequest(final MetaInfoRequest request) {<NEW_LINE>try {<NEW_LINE>String metaServer = queryMetaServerAddress();<NEW_LINE>if (metaServer == null)<NEW_LINE>return;<NEW_LINE>final Channel channel = getOrCreateChannel(metaServer);<NEW_LINE>final Datagram datagram = RemotingBuilder.buildRequestDatagram(CommandCode.CLIENT_REGISTER, new MetaInfoRequestPayloadHolder(request));<NEW_LINE>channel.writeAndFlush(datagram).addListener(new ChannelFutureListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void operationComplete(ChannelFuture future) {<NEW_LINE>if (future.isSuccess()) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>LOGGER.debug("request meta info send fail. {}", request);<NEW_LINE>Metrics.counter("qmq_pull_metainfo_request_fail", SUBJECT_GROUP_ARRAY, new String[] { request.getSubject(), request.getConsumerGroup() }).inc();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.debug("request meta info exception. {}", request, e);<NEW_LINE>Metrics.counter("qmq_pull_metainfo_request_fail", SUBJECT_GROUP_ARRAY, new String[] { request.getSubject(), request.getConsumerGroup() }).inc();<NEW_LINE>}<NEW_LINE>}
LOGGER.debug("request meta info send success. {}", request);
932,124
private void scanFile(File file) {<NEW_LINE>if (!file.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (file.isDirectory()) {<NEW_LINE>File[] files = file.listFiles();<NEW_LINE>if (files != null) {<NEW_LINE>for (File file1 : files) {<NEW_LINE>scanFile(file1);<NEW_LINE>if (Thread.interrupted()) {<NEW_LINE>Thread<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long hardLinkCreateTime = getHardLinkCreateTime(file);<NEW_LINE>long currentTime = System.currentTimeMillis();<NEW_LINE>if (hardLinkCreateTime != -1 && currentTime - hardLinkCreateTime >= HARDLINK_LIFE_MS) {<NEW_LINE>try {<NEW_LINE>Files.delete(file.toPath());<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.debug("Hardlink {} cannot be removed, leave it to the next try: {}", file, e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.currentThread().interrupt();
1,803,222
public void write(org.apache.thrift.protocol.TProtocol prot, bulkImport_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetTid()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetFiles()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetSetTime()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 5);<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>struct.tinfo.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>struct.credentials.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetTid()) {<NEW_LINE>oprot.writeI64(struct.tid);<NEW_LINE>}<NEW_LINE>if (struct.isSetFiles()) {<NEW_LINE>{<NEW_LINE>oprot.writeI32(struct.files.size());<NEW_LINE>for (java.util.Map.Entry<org.apache.accumulo.core.dataImpl.thrift.TKeyExtent, java.util.Map<java.lang.String, org.apache.accumulo.core.dataImpl.thrift.MapFileInfo>> _iter320 : struct.files.entrySet()) {<NEW_LINE>_iter320.<MASK><NEW_LINE>{<NEW_LINE>oprot.writeI32(_iter320.getValue().size());<NEW_LINE>for (java.util.Map.Entry<java.lang.String, org.apache.accumulo.core.dataImpl.thrift.MapFileInfo> _iter321 : _iter320.getValue().entrySet()) {<NEW_LINE>oprot.writeString(_iter321.getKey());<NEW_LINE>_iter321.getValue().write(oprot);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (struct.isSetSetTime()) {<NEW_LINE>oprot.writeBool(struct.setTime);<NEW_LINE>}<NEW_LINE>}
getKey().write(oprot);
853,171
public static void main(String... args) throws Exception {<NEW_LINE>OkHttpClient client = new OkHttpClient();<NEW_LINE>// Create request for remote resource.<NEW_LINE>Request request = new Request.Builder().url(ENDPOINT).build();<NEW_LINE>// Execute the request and retrieve the response.<NEW_LINE>try (Response response = client.newCall(request).execute()) {<NEW_LINE>// Deserialize HTTP response to concrete type.<NEW_LINE>ResponseBody body = response.body();<NEW_LINE>List<Contributor> contributors = CONTRIBUTORS_JSON_ADAPTER.fromJson(body.source());<NEW_LINE>// Sort list by the most contributions.<NEW_LINE>Collections.sort(contributors, (c1, c2) -> <MASK><NEW_LINE>// Output list of contributors.<NEW_LINE>for (Contributor contributor : contributors) {<NEW_LINE>System.out.println(contributor.login + ": " + contributor.contributions);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
c2.contributions - c1.contributions);
1,040,681
public CreateJobResult createJob(CreateJobRequest createJobRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateJobRequest> request = null;<NEW_LINE>Response<CreateJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateJobRequestMarshaller().marshall(createJobRequest);<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<CreateJobResult, JsonUnmarshallerContext> unmarshaller = new CreateJobResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<CreateJobResult> responseHandler = new JsonResponseHandler<CreateJobResult>(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,369,871
public void flatMap(BaseRow value, Collector<BaseRow> out) throws Exception {<NEW_LINE>GenericRow genericRow = (GenericRow) value;<NEW_LINE>List<Object> inputParams = Lists.newArrayList();<NEW_LINE>for (Integer conValIndex : sideInfo.getEqualValIndex()) {<NEW_LINE>Object equalObj = genericRow.getField(conValIndex);<NEW_LINE>if (equalObj == null) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>inputParams.add(equalObj);<NEW_LINE>}<NEW_LINE>String key = buildKey(inputParams);<NEW_LINE>List<Map<String, Object>> cacheList = cacheRef.get().get(key);<NEW_LINE>if (CollectionUtils.isEmpty(cacheList)) {<NEW_LINE>sendOutputRow(value, null, out);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Map<String, Object> one : cacheList) {<NEW_LINE>sendOutputRow(value, one, out);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Map<String, Object> one : cacheList) {<NEW_LINE>sendOutputRow(value, one, out);<NEW_LINE>}<NEW_LINE>}
sendOutputRow(value, null, out);
728,236
private void update_bmatrix(List<Config> configs, TDFAstate fromState, XclosureResult res) {<NEW_LINE>int[][] bmatrix = null;<NEW_LINE>if (fromState != null) {<NEW_LINE>bmatrix = fromState.bmatrix;<NEW_LINE>}<NEW_LINE>int N = configs.size();<NEW_LINE>int M = 0;<NEW_LINE>M = N;<NEW_LINE>int m = 0;<NEW_LINE>M++;<NEW_LINE>int[][] bmatrixp = null;<NEW_LINE>if (this.useTnfa) {<NEW_LINE>if (this.prevBmatrix == null || this.prevBmatrix.length < M) {<NEW_LINE>if (this.prevBmatrix != null) {<NEW_LINE>}<NEW_LINE>this.prevBmatrix = new int[M][M];<NEW_LINE>}<NEW_LINE>bmatrixp = this.prevBmatrix;<NEW_LINE>} else {<NEW_LINE>bmatrixp = new int[M][M];<NEW_LINE>}<NEW_LINE>for (int i = 0; i < N; i++) {<NEW_LINE>Config c1 = configs.get(i);<NEW_LINE>for (int j = 0; j < N; j++) {<NEW_LINE>Config c2 = configs.get(j);<NEW_LINE>int dm = <MASK><NEW_LINE>int c1n = i;<NEW_LINE>int c2n = j;<NEW_LINE>bmatrixp[c1n][c2n] = RES_rho1;<NEW_LINE>bmatrixp[c2n][c1n] = RES_rho2;<NEW_LINE>if (dm < 0) {<NEW_LINE>bmatrixp[c1n][c2n] |= 0x80000000;<NEW_LINE>} else {<NEW_LINE>bmatrixp[c2n][c1n] |= 0x80000000;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>res.bmatrix = bmatrixp;<NEW_LINE>if (this.useTnfa) {<NEW_LINE>this.prevBmatrix = bmatrix;<NEW_LINE>}<NEW_LINE>}
compare_posix(c1, c2, fromState);
40,785
protected void updateStatus(boolean report_change) {<NEW_LINE>synchronized (this) {<NEW_LINE>if (download_ok) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long downloaded = file.getDownloaded();<NEW_LINE>long length = file.getLength();<NEW_LINE>if (download == null || downloaded == length) {<NEW_LINE>download_ok = true;<NEW_LINE>} else {<NEW_LINE>int percent_done = (int) (100 * downloaded / length);<NEW_LINE>if (percent_done >= TRANSCODE_OK_DL_PERCENT) {<NEW_LINE>download_ok = true;<NEW_LINE>} else {<NEW_LINE>PeerManager pm = download.getPeerManager();<NEW_LINE>if (pm != null) {<NEW_LINE>PeerManagerStats stats = pm.getStats();<NEW_LINE>int connected_seeds = stats.getConnectedSeeds();<NEW_LINE><MASK><NEW_LINE>if (connected_seeds > 10 && connected_seeds > connected_leechers) {<NEW_LINE>download_ok = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int state = download.getState();<NEW_LINE>if (state == Download.ST_STOPPED) {<NEW_LINE>try {<NEW_LINE>download.restart();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (download_ok && report_change) {<NEW_LINE>queue.jobChanged(this, true, false);<NEW_LINE>}<NEW_LINE>}
int connected_leechers = stats.getConnectedLeechers();
1,791,169
private void collectSelectedItems() {<NEW_LINE>for (String filePath : selectedItems.keySet()) {<NEW_LINE>SelectedGpxFile sf;<NEW_LINE>if (!filePath.equals(CURRENT_TRACK)) {<NEW_LINE>sf = getSelectedFileByPath(filePath);<NEW_LINE>if (sf == null) {<NEW_LINE>sf = new SelectedGpxFile();<NEW_LINE>sf.setGpxFile(new GPXFile(null), app);<NEW_LINE>}<NEW_LINE>sf.getGpxFile().path = filePath;<NEW_LINE>} else {<NEW_LINE>sf = getSelectedCurrentRecordingTrack();<NEW_LINE>if (sf == null) {<NEW_LINE>sf = savingTrackHelper.getCurrentTrack();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean visible = false;<NEW_LINE>if (selectedItems.get(filePath) != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (visible) {<NEW_LINE>if (!sf.isShowCurrentTrack()) {<NEW_LINE>sf.getGpxFile().modifiedTime = -1;<NEW_LINE>}<NEW_LINE>originalSelectedItems.add(sf.getGpxFile());<NEW_LINE>}<NEW_LINE>addRemoveSelected(visible, sf);<NEW_LINE>}<NEW_LINE>}
visible = selectedItems.get(filePath);
1,439,095
private Map<String, Object> processUserListWithPermissionOnInode(String assetInode, String permission, String query, int start, int limit) {<NEW_LINE>Map<String, Object> results;<NEW_LINE>try {<NEW_LINE>final int permissionType = toInt(permission, 0);<NEW_LINE>results = new UsersListTemplate(assetInode, permissionType, query, start, limit) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int getUserCount() {<NEW_LINE>return permissionAPI.getUserCount(inode, permissionType, filter);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public List<User> getUsers() {<NEW_LINE>return permissionAPI.getUsers(inode, permissionType, filter, start, limit);<NEW_LINE>}<NEW_LINE>}.perform();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.warn(UserServiceImpl.class, String.format<MASK><NEW_LINE>results = Collections.EMPTY_MAP;<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
("::getUsersList -> Invalid parameters inode(%s) permission(%s).", assetInode, permission));
1,353,203
public com.amazonaws.services.devopsguru.model.ServiceQuotaExceededException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.devopsguru.model.ServiceQuotaExceededException serviceQuotaExceededException = new com.amazonaws.services.devopsguru.model.ServiceQuotaExceededException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 serviceQuotaExceededException;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,392,004
public ServiceStatus update(String userId, String json) {<NEW_LINE>JSONObject jsonObject = JSONObject.parseObject(json);<NEW_LINE>DashboardJob job = new DashboardJob();<NEW_LINE>job.setId(jsonObject.getLong("id"));<NEW_LINE>job.setName(jsonObject.getString("name"));<NEW_LINE>job.setConfig(jsonObject.getString("config"));<NEW_LINE>job.setCronExp(jsonObject.getString("cronExp"));<NEW_LINE>SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");<NEW_LINE>format.setTimeZone(TimeZone.getTimeZone("UTC"));<NEW_LINE>try {<NEW_LINE>job.setStartDate(format.parse(jsonObject.getJSONObject("daterange").getString("startDate")));<NEW_LINE>job.setEndDate(format.parse(jsonObject.getJSONObject("daterange").getString("endDate")));<NEW_LINE>} catch (ParseException e) {<NEW_LINE>LOG.error("", e);<NEW_LINE>}<NEW_LINE>job.setJobType(jsonObject.getString("jobType"));<NEW_LINE>jobDao.update(job);<NEW_LINE>configScheduler();<NEW_LINE>return new ServiceStatus(<MASK><NEW_LINE>}
ServiceStatus.Status.Success, "success");
789,115
protected void genSemPred(String pred, int line) {<NEW_LINE>// translate $ and # references<NEW_LINE>ActionTransInfo tInfo = new ActionTransInfo();<NEW_LINE>pred = processActionForSpecialSymbols(pred, line, currentRule, tInfo);<NEW_LINE>// ignore translation info...we don't need to do anything with it.<NEW_LINE>String escapedPred = charFormatter.escapeString(pred);<NEW_LINE>// if debugging, wrap the semantic predicate evaluation in a method<NEW_LINE>// that can tell SemanticPredicateListeners the result<NEW_LINE>if (grammar.debuggingOutput && ((grammar instanceof ParserGrammar) || (grammar instanceof LexerGrammar)))<NEW_LINE>pred = "fireSemanticPredicateEvaluated(antlr.debug.SemanticPredicateEvent.VALIDATING," + addSemPred(escapedPred) + "," + pred + ")";<NEW_LINE><MASK><NEW_LINE>println(" raise SemanticException(\"" + escapedPred + "\")");<NEW_LINE>}
println("if (!(" + pred + ")):");
955,803
public static final Optional<IProductPriceAware> ofModel(final Object model) {<NEW_LINE>if (model == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (model instanceof IProductPriceAware) {<NEW_LINE><MASK><NEW_LINE>return Optional.of(productPriceAware);<NEW_LINE>}<NEW_LINE>// If model does not have product price column we consider that it's not product price aware<NEW_LINE>if (!InterfaceWrapperHelper.hasModelColumnName(model, COLUMNNAME_M_ProductPrice_ID)) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final Integer productPriceId = InterfaceWrapperHelper.getValueOrNull(model, COLUMNNAME_M_ProductPrice_ID);<NEW_LINE>final boolean productPriceIdSet = productPriceId != null && productPriceId > 0;<NEW_LINE>final boolean isExplicitProductPrice;<NEW_LINE>if (InterfaceWrapperHelper.hasModelColumnName(model, COLUMNNAME_IsExplicitProductPriceAttribute)) {<NEW_LINE>final Object isExplicitObj = InterfaceWrapperHelper.getValueOrNull(model, COLUMNNAME_IsExplicitProductPriceAttribute);<NEW_LINE>isExplicitProductPrice = DisplayType.toBoolean(isExplicitObj, false);<NEW_LINE>} else {<NEW_LINE>// In case the "IsExplicit" column is missing,<NEW_LINE>// we are considering it as Explicit if the actual M_ProductPrice_ID is set.<NEW_LINE>isExplicitProductPrice = productPriceIdSet;<NEW_LINE>}<NEW_LINE>final IProductPriceAware productPriceAware = new ProductPriceAware(isExplicitProductPrice, productPriceIdSet ? productPriceId : -1);<NEW_LINE>return Optional.of(productPriceAware);<NEW_LINE>}
final IProductPriceAware productPriceAware = (IProductPriceAware) model;
188,896
private void addVariable(String name, Object value, QueryOperator operator, boolean localScope) {<NEW_LINE>if (name == null) {<NEW_LINE>throw new ActivitiIllegalArgumentException("name is null");<NEW_LINE>}<NEW_LINE>if (value == null || isBoolean(value)) {<NEW_LINE>// Null-values and booleans can only be used in EQUALS and NOT_EQUALS<NEW_LINE>switch(operator) {<NEW_LINE>case GREATER_THAN:<NEW_LINE>throw new ActivitiIllegalArgumentException("Booleans and null cannot be used in 'greater than' condition");<NEW_LINE>case LESS_THAN:<NEW_LINE>throw new ActivitiIllegalArgumentException("Booleans and null cannot be used in 'less than' condition");<NEW_LINE>case GREATER_THAN_OR_EQUAL:<NEW_LINE>throw new ActivitiIllegalArgumentException("Booleans and null cannot be used in 'greater than or equal' condition");<NEW_LINE>case LESS_THAN_OR_EQUAL:<NEW_LINE>throw new ActivitiIllegalArgumentException("Booleans and null cannot be used in 'less than or equal' condition");<NEW_LINE>}<NEW_LINE>if (operator == QueryOperator.EQUALS_IGNORE_CASE && !(value instanceof String)) {<NEW_LINE>throw new ActivitiIllegalArgumentException("Only string values can be used with 'equals ignore case' condition");<NEW_LINE>}<NEW_LINE>if (operator == QueryOperator.NOT_EQUALS_IGNORE_CASE && !(value instanceof String)) {<NEW_LINE>throw new ActivitiIllegalArgumentException("Only string values can be used with 'not equals ignore case' condition");<NEW_LINE>}<NEW_LINE>if ((operator == QueryOperator.LIKE || operator == QueryOperator.LIKE_IGNORE_CASE) && !(value instanceof String)) {<NEW_LINE>throw new ActivitiIllegalArgumentException("Only string values can be used with 'like' condition");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>queryVariableValues.add(new QueryVariableValue(name<MASK><NEW_LINE>}
, value, operator, localScope));
507,372
private Object binarySearchNames(int firstIndex, int lastIndex, String name) {<NEW_LINE>if (firstIndex > lastIndex)<NEW_LINE>return NOT_FOUND;<NEW_LINE>int pivot = firstIndex + ((lastIndex - firstIndex) / 2);<NEW_LINE>// Clear LSB to ensure even index<NEW_LINE>pivot &= 0xFFFFFFFE;<NEW_LINE>// System.out.print("binarySearchNames [ " + firstIndex + ", " + lastIndex + " ] pivot: " + pivot + " size: " + namesAndValues.size() + " compare " + name + " to " + namesAndValues.get(pivot).toString() + " ... ");<NEW_LINE>int cmp = namesAndValues.get(pivot).compareTo(name);<NEW_LINE>if (cmp == 0) {<NEW_LINE>// System.out.println("nEQUAL");<NEW_LINE>Object ob = namesAndValues.get(pivot + 1);<NEW_LINE>if (ob instanceof Reference)<NEW_LINE>ob = library<MASK><NEW_LINE>return ob;<NEW_LINE>} else if (cmp > 0) {<NEW_LINE>// System.out.println("nLESSER");<NEW_LINE>return binarySearchNames(firstIndex, pivot - 1, name);<NEW_LINE>} else if (cmp < 0) {<NEW_LINE>// System.out.println("nGREATER");<NEW_LINE>return binarySearchNames(pivot + 2, lastIndex, name);<NEW_LINE>}<NEW_LINE>return NOT_FOUND;<NEW_LINE>}
.getObject((Reference) ob);
89,049
public int compareTo(submitTopology_result other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = Boolean.valueOf(is_set_success()).compareTo(other.is_set_success());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_success()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = Boolean.valueOf(is_set_e()).compareTo(other.is_set_e());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_e()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = Boolean.valueOf(is_set_ite()).compareTo(other.is_set_ite());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_ite()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = Boolean.valueOf(is_set_tae()).compareTo(other.is_set_tae());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_tae()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tae, other.tae);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
this.ite, other.ite);
1,579,836
public void refresh() {<NEW_LINE>// Setup trees for each resource<NEW_LINE>List<JavaResource> resources = resources();<NEW_LINE>if (resources.size() > 1) {<NEW_LINE>boolean firstTime = false;<NEW_LINE>// Resource switcher<NEW_LINE>if (comboResources == null) {<NEW_LINE>firstTime = true;<NEW_LINE>comboResources = new ResourceComboBox(controller);<NEW_LINE>comboResources.getSelectionModel().selectedItemProperty().addListener((v, o, n) -> setCurrent(n));<NEW_LINE>BorderPane.setAlignment(comboResources, Pos.CENTER);<NEW_LINE>setTop(comboResources);<NEW_LINE>}<NEW_LINE>// Reset content<NEW_LINE>comboResources.<MASK><NEW_LINE>// Select first item if nothing is selected already<NEW_LINE>if (firstTime)<NEW_LINE>comboResources.getSelectionModel().select(0);<NEW_LINE>} else if (controller.getWorkspace() != null) {<NEW_LINE>// Only one resource to show<NEW_LINE>setCurrent(controller.getWorkspace().getPrimary());<NEW_LINE>} else {<NEW_LINE>// Set placeholder<NEW_LINE>enablePlaceholder();<NEW_LINE>clear(LangUtil.translate("ui.looaddrop.prompt"));<NEW_LINE>}<NEW_LINE>}
getItems().setAll(resources);
445,725
private boolean isAnnotationEnabled(Class<? extends Annotation> clazz) {<NEW_LINE>LookupResult<? extends Annotation> lookupResult = lookupAnnotation(beanClass, method, clazz);<NEW_LINE>if (lookupResult == null) {<NEW_LINE>// not present<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String value;<NEW_LINE>final String annotationType = clazz.getSimpleName();<NEW_LINE>// Check if property defined at method level<NEW_LINE>value = getParameter(method.getDeclaringClass().getName(), method.getName(), annotationType, "enabled");<NEW_LINE>if (value != null) {<NEW_LINE>return Boolean.parseBoolean(value);<NEW_LINE>}<NEW_LINE>// Check if property defined at class level<NEW_LINE>value = getParameter(method.getDeclaringClass().getName(), annotationType, "enabled");<NEW_LINE>if (value != null) {<NEW_LINE>return Boolean.parseBoolean(value);<NEW_LINE>}<NEW_LINE>// Check if property defined at global level<NEW_LINE><MASK><NEW_LINE>if (value != null) {<NEW_LINE>return Boolean.parseBoolean(value);<NEW_LINE>}<NEW_LINE>// Default is enabled<NEW_LINE>return clazz == Fallback.class || FaultToleranceExtension.isFaultToleranceEnabled();<NEW_LINE>}
value = getParameter(annotationType, "enabled");
1,459,736
private ServiceModuleEnum cover(Business business, Wi wi) throws Exception {<NEW_LINE>List<JpaObject> persistObjects = new ArrayList<>();<NEW_LINE>List<JpaObject> removeObjects = new ArrayList<>();<NEW_LINE>ServiceModuleEnum serviceModuleEnum = ServiceModuleEnum.getEnumByValue(wi.getId());<NEW_LINE>if (null == serviceModuleEnum) {<NEW_LINE>throw new ExceptionAppInfoNotExist(wi.getId());<NEW_LINE>}<NEW_LINE>for (WrapAgent _o : wi.getAgentList()) {<NEW_LINE>Agent obj = business.entityManagerContainer().find(_o.getId(), Agent.class);<NEW_LINE>if (null != obj) {<NEW_LINE>WrapAgent.inCopier.copy(_o, obj);<NEW_LINE>} else {<NEW_LINE>obj = WrapAgent.inCopier.copy(_o);<NEW_LINE>persistObjects.add(obj);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(obj.getAlias())) {<NEW_LINE>obj.setAlias(this.idleAliasWithEntity(business, obj.getAlias(), Agent.class, obj.getId()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(obj.getName())) {<NEW_LINE>obj.setName(this.idleNameWithEntity(business, obj.getName(), Agent.class, obj.getId()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (WrapInvoke _o : wi.getInvokeList()) {<NEW_LINE>Invoke obj = business.entityManagerContainer().find(_o.getId(), Invoke.class);<NEW_LINE>if (null != obj) {<NEW_LINE>WrapInvoke.inCopier.copy(_o, obj);<NEW_LINE>} else {<NEW_LINE>obj = WrapInvoke.inCopier.copy(_o);<NEW_LINE>persistObjects.add(obj);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(obj.getAlias())) {<NEW_LINE>obj.setAlias(this.idleAliasWithEntity(business, obj.getAlias(), Invoke.class, obj.getId()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(obj.getName())) {<NEW_LINE>obj.setName(this.idleNameWithEntity(business, obj.getName(), Invoke.class, obj.getId()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>business.entityManagerContainer().beginTransaction(Invoke.class);<NEW_LINE>business.entityManagerContainer().beginTransaction(Agent.class);<NEW_LINE>for (JpaObject o : removeObjects) {<NEW_LINE>business.entityManagerContainer().remove(o);<NEW_LINE>}<NEW_LINE>for (JpaObject o : persistObjects) {<NEW_LINE>business.entityManagerContainer().persist(o);<NEW_LINE>}<NEW_LINE>business.entityManagerContainer().commit();<NEW_LINE>if (!wi.getAgentList().isEmpty()) {<NEW_LINE>CacheManager.notify(Agent.class);<NEW_LINE>}<NEW_LINE>if (!wi.getInvokeList().isEmpty()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return serviceModuleEnum;<NEW_LINE>}
CacheManager.notify(Invoke.class);
1,085,321
public void measureChild(@NonNull View child, int widthUsed, int heightUsed) {<NEW_LINE>int columnPosition = getPosition(child);<NEW_LINE>// Get cached width size of column and cell<NEW_LINE>int cacheWidth = mCellLayoutManager.getCacheWidth(mYPosition, columnPosition);<NEW_LINE>int columnCacheWidth = mColumnHeaderLayoutManager.getCacheWidth(columnPosition);<NEW_LINE>// Already each of them is same width size.<NEW_LINE>if (cacheWidth != -1 && cacheWidth == columnCacheWidth) {<NEW_LINE>// Control whether we need to set width or not.<NEW_LINE>if (child.getMeasuredWidth() != cacheWidth) {<NEW_LINE>TableViewUtils.setWidth(child, cacheWidth);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>View columnHeaderChild = mColumnHeaderLayoutManager.findViewByPosition(columnPosition);<NEW_LINE>if (columnHeaderChild == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Need to calculate which one has the broadest width ?<NEW_LINE>fitWidthSize(child, mYPosition, columnPosition, cacheWidth, columnCacheWidth, columnHeaderChild);<NEW_LINE>}<NEW_LINE>// Control all of the rows which has same column position.<NEW_LINE>if (shouldFitColumns(columnPosition, mYPosition)) {<NEW_LINE>if (mLastDx < 0) {<NEW_LINE>Log.e(LOG_TAG, "x: " + columnPosition + " y: " + mYPosition + " fitWidthSize " + "left side ");<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>mCellLayoutManager.fitWidthSize(columnPosition, false);<NEW_LINE>Log.e(LOG_TAG, "x: " + columnPosition + " y: " + mYPosition + " fitWidthSize " + "right side");<NEW_LINE>}<NEW_LINE>mNeedFitForVerticalScroll = false;<NEW_LINE>}<NEW_LINE>// It need to be cleared to prevent unnecessary calculation.<NEW_LINE>mNeedFitForHorizontalScroll = false;<NEW_LINE>}
mCellLayoutManager.fitWidthSize(columnPosition, true);
1,105,430
private String createJikesClasspath(String string, String javaHomePath) {<NEW_LINE>StringBuffer classpath = new StringBuffer();<NEW_LINE>classpath.append(javaHomePath + File.separator + "lib" + File.<MASK><NEW_LINE>classpath.append(javaHomePath + File.separator + "lib" + File.separator + "graphics.jar" + File.pathSeparatorChar);<NEW_LINE>classpath.append(javaHomePath + File.separator + "lib" + File.separator + "security.jar" + File.pathSeparatorChar);<NEW_LINE>classpath.append(javaHomePath + File.separator + "lib" + File.separator + "server.jar" + File.pathSeparatorChar);<NEW_LINE>classpath.append(javaHomePath + File.separator + "lib" + File.separator + "xml.jar" + File.pathSeparatorChar);<NEW_LINE>classpath.append(string);<NEW_LINE>return classpath.toString();<NEW_LINE>}
separator + "core.jar" + File.pathSeparatorChar);
1,132,250
protected void asMap(boolean full, Map<String, Object> props) {<NEW_LINE>super.asMap(full, props);<NEW_LINE>props.put("imageName", imageName);<NEW_LINE>props.put("imageNameTransform", imageNameTransform);<NEW_LINE>props.put("archiveFormat", archiveFormat);<NEW_LINE>Map<String, Map<String, Object>> mappedJdks = new LinkedHashMap<>();<NEW_LINE>int i = 0;<NEW_LINE>for (Artifact graalJdk : getGraalJdks()) {<NEW_LINE>mappedJdks.put("jdk " + (i++), graalJdk.asMap(full));<NEW_LINE>}<NEW_LINE>props.put("graal", graal.asMap(full));<NEW_LINE><MASK><NEW_LINE>props.put("args", args);<NEW_LINE>props.put("upx", upx.asMap(full));<NEW_LINE>props.putAll(linux.asMap(full));<NEW_LINE>props.putAll(osx.asMap(full));<NEW_LINE>props.putAll(windows.asMap(full));<NEW_LINE>}
props.put("graalJdks", mappedJdks);
1,766,430
public // }<NEW_LINE>void startStopRouteAnimation(@Nullable Activity activity, boolean useGpx, final Runnable runnable) {<NEW_LINE>if (!isRouteAnimating()) {<NEW_LINE>if (useGpx) {<NEW_LINE>if (activity == null) {<NEW_LINE>stop();<NEW_LINE>if (runnable != null) {<NEW_LINE>runnable.run();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean nightMode = app.getDaynightHelper().isNightModeForMapControls();<NEW_LINE>int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;<NEW_LINE>ApplicationMode appMode = app.getSettings().getApplicationMode();<NEW_LINE>int selectedModeColor = appMode.getProfileColor(nightMode);<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(activity, themeRes));<NEW_LINE>builder.setTitle(R.string.animate_route);<NEW_LINE>final View view = activity.getLayoutInflater().inflate(R.layout.animate_route, null);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>((TextView) view.findViewById(R.id.MinSpeedup)).setText("1");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>((TextView) view.findViewById(R.id.MaxSpeedup)).setText("4");<NEW_LINE>final Slider speedup = view.findViewById(R.id.Speedup);<NEW_LINE>speedup.setValueTo(3);<NEW_LINE>UiUtilities.setupSlider(speedup, nightMode, selectedModeColor, true);<NEW_LINE>builder.setView(view);<NEW_LINE>builder.setPositiveButton(R.string.shared_string_ok, (dialog, which) -> {<NEW_LINE>boolean nightMode1 = activity instanceof MapActivity ? app.getDaynightHelper().isNightModeForMapControls() : !app.getSettings().isLightContent();<NEW_LINE>GpxUiHelper.selectGPXFile(activity, false, false, result -> {<NEW_LINE>GPXRouteParamsBuilder gpxParamsBuilder = new GPXRouteParamsBuilder(result[0], app.getSettings());<NEW_LINE>startAnimationThread(app, gpxParamsBuilder.getSimulatedLocations(app), true, speedup.getValue() + 1);<NEW_LINE>if (runnable != null) {<NEW_LINE>runnable.run();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}, nightMode1);<NEW_LINE>});<NEW_LINE>builder.setNegativeButton(<MASK><NEW_LINE>builder.show();<NEW_LINE>} else {<NEW_LINE>List<SimulatedLocation> currentRoute = app.getRoutingHelper().getRoute().getImmutableSimulatedLocations();<NEW_LINE>if (currentRoute.isEmpty()) {<NEW_LINE>Toast.makeText(app, R.string.animate_routing_route_not_calculated, Toast.LENGTH_LONG).show();<NEW_LINE>} else {<NEW_LINE>startAnimationThread(app, new ArrayList<>(currentRoute), false, 1);<NEW_LINE>if (runnable != null) {<NEW_LINE>runnable.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>stop();<NEW_LINE>if (runnable != null) {<NEW_LINE>runnable.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
R.string.shared_string_cancel, null);
54,267
public boolean apply(Game game, Ability source) {<NEW_LINE>Permanent target = game.getPermanent(targetPointer<MASK><NEW_LINE>boolean scepter = false;<NEW_LINE>boolean throne = false;<NEW_LINE>for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) {<NEW_LINE>if (CardUtil.haveSameNames(permanent, "Scepter of Empires", game)) {<NEW_LINE>scepter = true;<NEW_LINE>} else if (CardUtil.haveSameNames(permanent, "Throne of Empires", game)) {<NEW_LINE>throne = true;<NEW_LINE>}<NEW_LINE>if (scepter && throne)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (scepter && throne) {<NEW_LINE>ContinuousEffect effect = new CrownOfEmpiresControlEffect();<NEW_LINE>effect.setTargetPointer(new FixedTarget(target.getId(), game));<NEW_LINE>game.getState().setValue(source.getSourceId().toString(), source.getControllerId());<NEW_LINE>game.addEffect(effect, source);<NEW_LINE>} else {<NEW_LINE>target.tap(source, game);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
.getFirst(game, source));
1,089,478
private void initialize() {<NEW_LINE>// setup<NEW_LINE>iStreamCoder.setNumPicturesInGroupOfPictures(25);<NEW_LINE>iStreamCoder.setBitRate(200000);<NEW_LINE>iStreamCoder.setBitRateTolerance(10000);<NEW_LINE>iStreamCoder.setPixelType(Type.YUV420P);<NEW_LINE>iStreamCoder.setHeight(dimension.height);<NEW_LINE>iStreamCoder.setWidth(dimension.width);<NEW_LINE>iStreamCoder.setFlag(IStreamCoder.Flags.FLAG_QSCALE, true);<NEW_LINE>iStreamCoder.setGlobalQuality(0);<NEW_LINE>// rate<NEW_LINE>IRational rate = IRational.make(25, 1);<NEW_LINE>iStreamCoder.setFrameRate(rate);<NEW_LINE>// time base<NEW_LINE>// iStreamCoder.setAutomaticallyStampPacketsForStream(true);<NEW_LINE>iStreamCoder.setTimeBase(IRational.make(rate.getDenominator(), rate.getNumerator()));<NEW_LINE>IMetaData codecOptions = IMetaData.make();<NEW_LINE>// equals -tune zerolatency in ffmpeg<NEW_LINE>codecOptions.setValue("tune", "zerolatency");<NEW_LINE>// open it<NEW_LINE>int revl = <MASK><NEW_LINE>if (revl < 0) {<NEW_LINE>throw new RuntimeException("could not open the coder");<NEW_LINE>}<NEW_LINE>}
iStreamCoder.open(codecOptions, null);
1,020,303
public void run() {<NEW_LINE>final VirtualFile[] files = virtualFile.getChildren();<NEW_LINE>try {<NEW_LINE>for (final VirtualFile inspectionFile : files) {<NEW_LINE>if (inspectionFile.isDirectory())<NEW_LINE>continue;<NEW_LINE>final String shortName = inspectionFile.getNameWithoutExtension();<NEW_LINE>final <MASK><NEW_LINE>if (shortName.equals(InspectionApplication.DESCRIPTIONS)) {<NEW_LINE>profileName[0] = ApplicationManager.getApplication().runReadAction(new Computable<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@Nullable<NEW_LINE>public String compute() {<NEW_LINE>return OfflineViewParseUtil.parseProfileName(inspectionFile);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else if (XML_EXTENSION.equals(extension)) {<NEW_LINE>resMap.put(shortName, ApplicationManager.getApplication().runReadAction(new Computable<Map<String, Set<OfflineProblemDescriptor>>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Map<String, Set<OfflineProblemDescriptor>> compute() {<NEW_LINE>return OfflineViewParseUtil.parse(inspectionFile);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>// all parse exceptions<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Messages.showInfoMessage(e.getMessage(), InspectionsBundle.message("offline.view.parse.exception.title"));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// cancel process<NEW_LINE>throw new ProcessCanceledException();<NEW_LINE>}<NEW_LINE>}
String extension = inspectionFile.getExtension();
1,015,537
private static void searchWithAsyncClient() {<NEW_LINE>SearchAsyncClient client = new SearchClientBuilder().endpoint(ENDPOINT).credential(new AzureKeyCredential(API_KEY)).indexName(INDEX_NAME).buildAsyncClient();<NEW_LINE>// Add additional options for the search<NEW_LINE>SearchOptions parameters = // items having a geo-location distance which is less than 5 km from Redmond<NEW_LINE>new SearchOptions().// items having a geo-location distance which is less than 5 km from Redmond<NEW_LINE>setFilter("geo.distance(Location,geography'POINT(-122.121513 47.673988)') le 5").setFacets("Tags,sort:value").setOrderBy("Rating").setTop<MASK><NEW_LINE>// Perform a search and subscribe to the results and log additional information<NEW_LINE>Flux<SearchResult> results = client.search("hotel", parameters).log().doOnSubscribe(__ -> System.out.println("Subscribed to PagedFlux results"));<NEW_LINE>// Subscribe and process all results across all pages in the response<NEW_LINE>results.subscribe(result -> {<NEW_LINE>SearchDocument doc = result.getDocument(SearchDocument.class);<NEW_LINE>String hotelName = (String) doc.get("HotelName");<NEW_LINE>Integer rating = (Integer) doc.get("Rating");<NEW_LINE>System.out.printf("%s: %d%n", hotelName, rating);<NEW_LINE>}, err -> System.out.printf("error: %s%n", err), () -> System.out.println("Completed processing"));<NEW_LINE>results.blockLast();<NEW_LINE>}
(5).setIncludeTotalCount(true);
361,131
protected void onContentViewCreated(View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>super.onContentViewCreated(view, savedInstanceState);<NEW_LINE>setTitle(R.string.auto_theme_title);<NEW_LINE>getNegativeButton().setOnClickListener(v -> dismiss());<NEW_LINE>getPositiveButton().setOnClickListener(v -> {<NEW_LINE>if (mMode == MODE_CHOOSE) {<NEW_LINE>OnDarkLightThemesChosenListener listener = Utils.getParentAs(this, OnDarkLightThemesChosenListener.class);<NEW_LINE>if (listener != null)<NEW_LINE>listener.onThemesChosen(getTag(), mViewModel.getLightTheme().getValue(), mViewModel.getDarkTheme().getValue());<NEW_LINE>} else {<NEW_LINE>Theme theme = Theme.getInstance(requireContext());<NEW_LINE>theme.setLightTheme(mViewModel.getLightTheme().getValue());<NEW_LINE>theme.setDarkTheme(mViewModel.getDarkTheme().getValue());<NEW_LINE>}<NEW_LINE>dismiss();<NEW_LINE>});<NEW_LINE>ThemeView lightThemeView = view.findViewById(R.id.themeview_dl_selection_light);<NEW_LINE>ThemeView darkThemeView = view.findViewById(R.id.themeview_dl_selection_dark);<NEW_LINE>lightThemeView.<MASK><NEW_LINE>darkThemeView.setMessage(R.string.auto_theme_selection_hint);<NEW_LINE>lightThemeView.setOnClickListener(v -> ThemeSelectionDialogFragment.newInstance(ThemeSelectionDialogFragment.MODE_CHOOSE).show(getChildFragmentManager(), TAG_CHOOSE_LIGHT_THEME));<NEW_LINE>darkThemeView.setOnClickListener(v -> ThemeSelectionDialogFragment.newInstance(ThemeSelectionDialogFragment.MODE_CHOOSE).show(getChildFragmentManager(), TAG_CHOOSE_DARK_THEME));<NEW_LINE>mViewModel.getLightTheme().observe(this, lightThemeView::setTheme);<NEW_LINE>mViewModel.getDarkTheme().observe(this, darkThemeView::setTheme);<NEW_LINE>view.requestFocus();<NEW_LINE>revealBottomSheet();<NEW_LINE>}
setMessage(R.string.auto_theme_selection_hint);
641,533
private void executeTest(String testName, CommandLineProgramTester testClass, String args, Class<?> expectedException) {<NEW_LINE>String[] command = Utils.escapeExpressions(args);<NEW_LINE>// run the executable<NEW_LINE>boolean gotAnException = false;<NEW_LINE>try {<NEW_LINE>final String now = LocalDateTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss"));<NEW_LINE>System.out.println(String.format("[%s] Executing test %s:%s", now, testClass.getClass().getSimpleName(), testName));<NEW_LINE>testClass.runCommandLine(command);<NEW_LINE>} catch (Exception e) {<NEW_LINE>gotAnException = true;<NEW_LINE>if (expectedException == null) {<NEW_LINE>// we didn't expect an exception but we got one :-(<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>// we expect an exception<NEW_LINE>if (!expectedException.isInstance(e)) {<NEW_LINE>final String message = String.format("Test %s:%s expected exception %s but instead got %s with error message %s", testClass, testName, expectedException, e.getClass(), e.getMessage());<NEW_LINE>if (e.getCause() != null) {<NEW_LINE><MASK><NEW_LINE>final PrintStream ps = new PrintStream(baos);<NEW_LINE>e.getCause().printStackTrace(ps);<NEW_LINE>BaseTest.log(message);<NEW_LINE>BaseTest.log(baos.toString());<NEW_LINE>}<NEW_LINE>Assert.fail(message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (expectedException != null && !gotAnException) {<NEW_LINE>// we expected an exception but didn't see it<NEW_LINE>Assert.fail(String.format("Test %s:%s expected exception %s but none was thrown", testClass.getClass().getSimpleName(), testName, expectedException.toString()));<NEW_LINE>}<NEW_LINE>}
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
437,534
private static void runEveryDistinctOverFollowedBy(RegressionEnvironment env, String expression, AtomicInteger milestone) {<NEW_LINE>env.compileDeploy(expression).addListener("s0");<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(new SupportBean("A1", 1));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(new SupportBean("B1", 1));<NEW_LINE>env.assertPropsNew("s0", "a.theString,b.theString".split(","), new Object[] { "A1", "B1" });<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(new SupportBean("A2", 1));<NEW_LINE>env.sendEventBean(new SupportBean("B2", 1));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.sendEventBean(new SupportBean("B3", -8));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(new SupportBean("A4", 2));<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(new SupportBean("B4", 1));<NEW_LINE>env.assertPropsNew("s0", "a.theString,b.theString".split(","), new Object[] { "A4", "B4" });<NEW_LINE>env.sendEventBean(new SupportBean("A5", 3));<NEW_LINE>env.sendEventBean(new SupportBean("B5", 0));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.undeployAll();<NEW_LINE>}
new SupportBean("A3", 10));