idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
182,698
private void writeRoundInternal(long seq, V round) {<NEW_LINE>String name = getFilenameFromSeq(seq);<NEW_LINE>File tmpFile = new File(path, name + TMP_FILE_SUFFIX);<NEW_LINE>// compute checksum hash<NEW_LINE>byte[] bytes = round.persistToBytes();<NEW_LINE>byte[] hash = Sha256Hash.<MASK><NEW_LINE>PaxosPersistence.PaxosHeader header = PaxosPersistence.PaxosHeader.newBuilder().setChecksum(ByteString.copyFrom(hash)).build();<NEW_LINE>FileOutputStream fileOut = null;<NEW_LINE>try {<NEW_LINE>fileOut = new FileOutputStream(tmpFile);<NEW_LINE>header.writeDelimitedTo(fileOut);<NEW_LINE>CodedOutputStream out = CodedOutputStream.newInstance(fileOut);<NEW_LINE>out.writeBytesNoTag(ByteString.copyFrom(bytes));<NEW_LINE>out.flush();<NEW_LINE>fileOut.getFD().sync();<NEW_LINE>fileOut.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("problem writing paxos state", e);<NEW_LINE>throw Throwables.throwUncheckedException(e);<NEW_LINE>} finally {<NEW_LINE>IOUtils.closeQuietly(fileOut);<NEW_LINE>}<NEW_LINE>// overwrite file with tmp<NEW_LINE>File file = new File(path, name);<NEW_LINE>tmpFile.renameTo(file);<NEW_LINE>// update version<NEW_LINE>seqToVersionMap.put(seq, round.getVersion());<NEW_LINE>}
computeHash(bytes).getBytes();
1,011,848
private synchronized int loadData(final Uri uri) {<NEW_LINE>int numBytesLoaded = 0;<NEW_LINE>String msg;<NEW_LINE>InputStream inStr;<NEW_LINE>try {<NEW_LINE>inStr = context.getContentResolver().openInputStream(uri);<NEW_LINE>numBytesLoaded = inStr != null ? inStr.available() : 0;<NEW_LINE>msg = context.getString(R.string.loaded).concat(String.format(" %d Bytes", numBytesLoaded));<NEW_LINE>ObjectInputStream oIn = new ObjectInputStream(inStr);<NEW_LINE>int currService = oIn.readInt();<NEW_LINE>ObdProt.PidPvs = (PvList) oIn.readObject();<NEW_LINE>ObdProt.VidPvs = <MASK><NEW_LINE>ObdProt.tCodes = (PvList) oIn.readObject();<NEW_LINE>MainActivity.mPluginPvs = (PvList) oIn.readObject();<NEW_LINE>oIn.close();<NEW_LINE>log.log(Level.INFO, msg);<NEW_LINE>Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Toast.makeText(context, ex.toString(), Toast.LENGTH_SHORT).show();<NEW_LINE>log.log(Level.SEVERE, uri.toString(), ex);<NEW_LINE>}<NEW_LINE>return numBytesLoaded;<NEW_LINE>}
(PvList) oIn.readObject();
1,204,384
private void verifyUpdateAllowed(Update command, DomainBase existingDomain, DateTime now) throws EppException {<NEW_LINE>verifyOptionalAuthInfo(authInfo, existingDomain);<NEW_LINE>AddRemove add = command.getInnerAdd();<NEW_LINE>AddRemove remove = command.getInnerRemove();<NEW_LINE>String tld = existingDomain.getTld();<NEW_LINE>if (!isSuperuser) {<NEW_LINE>verifyNoDisallowedStatuses(existingDomain, UPDATE_DISALLOWED_STATUSES);<NEW_LINE>verifyResourceOwnership(registrarId, existingDomain);<NEW_LINE>verifyClientUpdateNotProhibited(command, existingDomain);<NEW_LINE>verifyAllStatusesAreClientSettable(union(add.getStatusValues(), remove.getStatusValues()));<NEW_LINE>checkAllowedAccessToTld(registrarId, tld);<NEW_LINE>}<NEW_LINE>Registry registry = Registry.get(tld);<NEW_LINE>Optional<FeeUpdateCommandExtension> feeUpdate = eppInput.getSingleExtension(FeeUpdateCommandExtension.class);<NEW_LINE>FeesAndCredits feesAndCredits = pricingLogic.<MASK><NEW_LINE>validateFeesAckedIfPresent(feeUpdate, feesAndCredits);<NEW_LINE>verifyNotInPendingDelete(add.getContacts(), command.getInnerChange().getRegistrant(), add.getNameservers());<NEW_LINE>validateContactsHaveTypes(add.getContacts());<NEW_LINE>validateContactsHaveTypes(remove.getContacts());<NEW_LINE>validateRegistrantAllowedOnTld(tld, command.getInnerChange().getRegistrantContactId());<NEW_LINE>validateNameserversAllowedOnTld(tld, add.getNameserverFullyQualifiedHostNames());<NEW_LINE>}
getUpdatePrice(registry, targetId, now);
1,803,269
public void init(GameServer gameServer) {<NEW_LINE>IServerConfiguration configuration = gameServer.getConfig();<NEW_LINE>GameRegistry registry = gameServer.getRegistry();<NEW_LINE>listeners.add(new WorldCreationListener(configuration.getInt("settlement_spawn_rate")));<NEW_LINE>listeners.add(new CpuInitialisationListener());<NEW_LINE>listeners.add(new VaultWorldUpdateListener(configuration));<NEW_LINE>listeners.add(new VaultCompleteListener());<NEW_LINE>registry.registerGameObject(HarvesterNPC.class);<NEW_LINE>registry.registerGameObject(Factory.class);<NEW_LINE>registry.registerGameObject(RadioTower.class);<NEW_LINE>registry.registerGameObject(VaultDoor.class);<NEW_LINE>registry.registerGameObject(Obstacle.class);<NEW_LINE>registry.registerGameObject(ElectricBox.class);<NEW_LINE>registry.registerGameObject(Portal.class);<NEW_LINE>registry.registerGameObject(VaultExitPortal.class);<NEW_LINE><MASK><NEW_LINE>registry.registerHardware(RadioReceiverHardware.class);<NEW_LINE>registry.registerHardware(NpcBattery.class);<NEW_LINE>registry.registerHardware(NpcInventory.class);<NEW_LINE>registry.registerTile(TileVaultFloor.ID, TileVaultFloor.class);<NEW_LINE>registry.registerTile(TileVaultWall.ID, TileVaultWall.class);<NEW_LINE>settlementMap = new ConcurrentHashMap<>();<NEW_LINE>LogManager.LOGGER.fine("(NPC Plugin) Loading default HackedNPC settings from" + " defaultHackedCubotHardware.json");<NEW_LINE>InputStream is = getClass().getClassLoader().getResourceAsStream("defaultHackedCubotHardware.json");<NEW_LINE>Scanner scanner = new Scanner(is).useDelimiter("\\A");<NEW_LINE>String json = scanner.next();<NEW_LINE>DEFAULT_HACKED_NPC = Document.parse(json);<NEW_LINE>LogManager.LOGGER.info("(NPC Plugin) Initialised NPC plugin");<NEW_LINE>}
registry.registerGameObject(HackedNPC.class);
386,682
private void recalculateLineIndexes() throws BadLocationException {<NEW_LINE>for (List<Line> lines : formattingContext.getIndentationData()) {<NEW_LINE>List<Line> l = new ArrayList<Line>();<NEW_LINE>Line previousLine = null;<NEW_LINE>for (Line line : lines) {<NEW_LINE><MASK><NEW_LINE>// Java formatter is touching lines it should not, for example:<NEW_LINE>//<NEW_LINE>// 01: <html><NEW_LINE>// 02: <%= response.SC_ACCEPTED<NEW_LINE>// 03: %><NEW_LINE>// 04: </html><NEW_LINE>//<NEW_LINE>// will be changed by Java formatter to:<NEW_LINE>//<NEW_LINE>// 01: <html><NEW_LINE>// 02: <%= response.SC_ACCEPTED %><NEW_LINE>// 03: </html><NEW_LINE>//<NEW_LINE>// which screws up line 3 previously owned by JSP formatter<NEW_LINE>//<NEW_LINE>if (previousLine != null && previousLine.index == line.index) {<NEW_LINE>if (DEBUG) {<NEW_LINE>System.err.println("WARNING: some lines where deleted by " + "other formatter. merging " + previousLine + " with " + line);<NEW_LINE>}<NEW_LINE>// TODO: review / test this:<NEW_LINE>// add all commands to previous line and drop it:<NEW_LINE>previousLine.lineIndent.addAll(line.lineIndent);<NEW_LINE>} else {<NEW_LINE>l.add(line);<NEW_LINE>}<NEW_LINE>previousLine = line;<NEW_LINE>}<NEW_LINE>if (l.size() != lines.size()) {<NEW_LINE>lines.clear();<NEW_LINE>lines.addAll(l);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
line.recalculateLineIndex(getDocument());
608,491
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "value".split(",");<NEW_LINE>String text = "@name('s0') select * from SupportRecogBean#length(10) " + "match_recognize (" + " partition by value" + " measures E1.value as value" + " pattern (E1 E2 | E2 E1 ) " + " define " + " E1 as E1.theString = 'A', " + " E2 as E2.theString = 'B' " + ")";<NEW_LINE>env.compileDeploy(text).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportRecogBean("A", 1));<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportRecogBean("B", 1));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 1 });<NEW_LINE>env.milestone(1);<NEW_LINE>env.sendEventBean(new SupportRecogBean("B", 2));<NEW_LINE>env.milestone(2);<NEW_LINE>env.sendEventBean(new SupportRecogBean("A", 2));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 2 });<NEW_LINE>env.milestone(3);<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.sendEventBean(new SupportRecogBean("A", 4));<NEW_LINE>env.sendEventBean(new SupportRecogBean("A", 3));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 3 });<NEW_LINE>env.milestone(4);<NEW_LINE>env.sendEventBean(new SupportRecogBean("B", 4));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 4 });<NEW_LINE>env.milestone(5);<NEW_LINE>env.sendEventBean(new SupportRecogBean("A", 6));<NEW_LINE>env.sendEventBean(new SupportRecogBean("B", 7));<NEW_LINE>env.sendEventBean(new SupportRecogBean("B", 8));<NEW_LINE>env.sendEventBean(new SupportRecogBean("A", 7));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 7 });<NEW_LINE>for (int i = 0; i < 10000; i++) {<NEW_LINE>env.sendEventBean(new SupportRecogBean("A", i));<NEW_LINE>// System.out.println(i);<NEW_LINE>// env.sendEventBean(new SupportRecogBean("B", i));<NEW_LINE>// env.assertPropsListenerNew("s0", fields, new Object[] {i});<NEW_LINE>}<NEW_LINE>env.undeployAll();<NEW_LINE>}
new SupportRecogBean("B", 3));
399,060
public // 25.846: [Full GC 25.847: [CMS: 0K->7019K(2015232K), 5.6129510 secs] 11161K->7019K(2097088K), [CMS Perm : 68104K->67271K(13520K)] icms_dc=0 , 25.6146105 secs]<NEW_LINE>void fullGCiCMS(GCLogTrace trace, String line) {<NEW_LINE>FullGC collection;<NEW_LINE>if (trace.gcCause() == GCCause.JAVA_LANG_SYSTEM)<NEW_LINE>collection = new SystemGC(getClock(), trace.gcCause(), trace.getDoubleGroup(trace.groupCount()));<NEW_LINE>else<NEW_LINE>collection = new FullGC(getClock(), trace.gcCause(), trace.getDoubleGroup(trace.groupCount()));<NEW_LINE>MemoryPoolSummary tenured = trace.getOccupancyBeforeAfterWithMemoryPoolSizeSummary(5);<NEW_LINE>MemoryPoolSummary heap = getTotalOccupancyBeforeAfterWithTotalHeapPoolSizeSummary(trace, 12);<NEW_LINE>collection.add(heap.minus(tenured), tenured, heap);<NEW_LINE>collection.recordDutyCycle<MASK><NEW_LINE>collection.addPermOrMetaSpaceRecord(extractPermOrMetaspaceRecord(line));<NEW_LINE>collection.add(extractCPUSummary(line));<NEW_LINE>record(collection);<NEW_LINE>}
(trace.getIntegerGroup(25));
760,551
public static SSLConfiguration load(String filePath) throws FileNotFoundException, IOException {<NEW_LINE>checkNotNull(filePath, "Argument [filePath] may not be null");<NEW_LINE>logger.debug("load SSL configuration file:{}", filePath);<NEW_LINE>KeyStoreInfo keyStoreInfo = null;<NEW_LINE>KeyStoreInfo trustKeyStoreInfo = null;<NEW_LINE>Properties properties = new Properties();<NEW_LINE>properties.load(new FileInputStream(filePath));<NEW_LINE>String keystorePath = PathUtil.getAbstractPath(properties.getProperty("ssl.keystore.location"));<NEW_LINE>String password = properties.getProperty("ssl.keystore.password");<NEW_LINE>String type = properties.getProperty("ssl.keystore.type", "JSK");<NEW_LINE>String trustKeystorePath = PathUtil.getAbstractPath(properties.getProperty("ssl.trustStore.location"));<NEW_LINE>String trustPassword = properties.getProperty("ssl.trustStore.password");<NEW_LINE>String trustType = properties.getProperty("ssl.trustStore.type", "JSK");<NEW_LINE>if (!Strings.isNullOrEmpty(keystorePath)) {<NEW_LINE>keyStoreInfo = new KeyStoreInfo(keystorePath, password, type);<NEW_LINE>}<NEW_LINE>if (!Strings.isNullOrEmpty(trustKeystorePath)) {<NEW_LINE>trustKeyStoreInfo = new <MASK><NEW_LINE>}<NEW_LINE>String clientAuthValue = properties.getProperty("ssl.client.auth", "false");<NEW_LINE>boolean clientAuth = false;<NEW_LINE>if (clientAuthValue.equalsIgnoreCase("true")) {<NEW_LINE>clientAuth = true;<NEW_LINE>}<NEW_LINE>return new SSLConfiguration(keyStoreInfo, trustKeyStoreInfo, clientAuth);<NEW_LINE>}
KeyStoreInfo(trustKeystorePath, trustPassword, trustType);
625,824
public <K> KVScatterGatherResult<K, EntityResponse<T>> buildRequests(BatchGetEntityRequest<K, T> request, RequestContext requestContext) throws ServiceUnavailableException {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Set<K> idObjects = (Set<<MASK><NEW_LINE>final MapKeyResult<URI, K> mapKeyResult = mapKeys(request, idObjects);<NEW_LINE>final Map<URI, Collection<K>> batches = mapKeyResult.getMapResult();<NEW_LINE>final Collection<KVRequestInfo<K, EntityResponse<T>>> scatterGatherRequests = new ArrayList<>(batches.size());<NEW_LINE>for (Map.Entry<URI, Collection<K>> batch : batches.entrySet()) {<NEW_LINE>final BatchGetEntityRequestBuilder<K, T> builder = new BatchGetEntityRequestBuilder<>(request.getBaseUriTemplate(), request.getResponseDecoder(), request.getResourceSpec(), request.getRequestOptions());<NEW_LINE>builder.ids(batch.getValue());<NEW_LINE>for (Map.Entry<String, Object> param : request.getQueryParamsObjects().entrySet()) {<NEW_LINE>if (!param.getKey().equals(RestConstants.QUERY_BATCH_IDS_PARAM)) {<NEW_LINE>// keep all non-batch query parameters since they could be request specific<NEW_LINE>builder.setParam(param.getKey(), param.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, String> header : request.getHeaders().entrySet()) {<NEW_LINE>builder.setHeader(header.getKey(), header.getValue());<NEW_LINE>}<NEW_LINE>final RequestContext context = requestContext.clone();<NEW_LINE>KeyMapper.TargetHostHints.setRequestContextTargetHost(context, batch.getKey());<NEW_LINE>scatterGatherRequests.add(new KVRequestInfo<>(builder.build(), context));<NEW_LINE>}<NEW_LINE>return new KVScatterGatherResult<>(scatterGatherRequests, mapKeyResult.getUnmappedKeys());<NEW_LINE>}
K>) request.getObjectIds();
1,725,812
private double _modelToView(int line, double componentHeight, double usableHeight) {<NEW_LINE>try {<NEW_LINE>int r = getModelToViewImpl(line);<NEW_LINE>if (r == (-1))<NEW_LINE>return -1.0;<NEW_LINE>if (ERR.isLoggable(ErrorManager.INFORMATIONAL)) {<NEW_LINE>// NOI18N<NEW_LINE>ERR.log(<MASK><NEW_LINE>// ERR.log(ErrorManager.INFORMATIONAL, "AnnotationView.modelToView: lineOffset=" + lineOffset); // NOI18N<NEW_LINE>// NOI18N<NEW_LINE>ERR.log(ErrorManager.INFORMATIONAL, "AnnotationView.modelToView: r=" + r);<NEW_LINE>// NOI18N<NEW_LINE>ERR.log(ErrorManager.INFORMATIONAL, "AnnotationView.modelToView: getComponentHeight()=" + getComponentHeight());<NEW_LINE>// NOI18N<NEW_LINE>ERR.log(ErrorManager.INFORMATIONAL, "AnnotationView.modelToView: getUsableHeight()=" + getUsableHeight());<NEW_LINE>}<NEW_LINE>if (componentHeight <= usableHeight) {<NEW_LINE>// 1:1 mapping:<NEW_LINE>return r + topOffset();<NEW_LINE>} else {<NEW_LINE>double position = r / componentHeight;<NEW_LINE>int blocksCount = (int) (usableHeight / (PIXELS_FOR_LINE + LINE_SEPARATOR_SIZE));<NEW_LINE>int block = (int) (position * blocksCount);<NEW_LINE>return block * (PIXELS_FOR_LINE + LINE_SEPARATOR_SIZE) + topOffset();<NEW_LINE>}<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>ErrorManager.getDefault().notify(e);<NEW_LINE>return -1.0;<NEW_LINE>}<NEW_LINE>}
ErrorManager.INFORMATIONAL, "AnnotationView.modelToView: line=" + line);
1,444,680
public static void bitmapToInterleaved(Bitmap input, InterleavedF32 output) {<NEW_LINE>final int h = output.height;<NEW_LINE>final int w = output.width;<NEW_LINE>// read one row at a time instead of the entire image to reduce memory requirements<NEW_LINE>int[] pixels = new int[w];<NEW_LINE>for (int y = 0; y < h; y++) {<NEW_LINE>int indexDst = output.startIndex + y * output.stride;<NEW_LINE>int indexSrc = 0;<NEW_LINE>input.getPixels(pixels, 0, w, 0, y, w, 1);<NEW_LINE>for (int x = 0; x < w; x++) {<NEW_LINE>int rgb = pixels[indexSrc++];<NEW_LINE>output.data[indexDst++] = <MASK><NEW_LINE>output.data[indexDst++] = (rgb >> 16) & 0xFF;<NEW_LINE>output.data[indexDst++] = (rgb >> 8) & 0xFF;<NEW_LINE>output.data[indexDst++] = rgb & 0xFF;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(rgb >> 24) & 0xFF;
1,549,016
public void removeServiceEntry(String linkName) {<NEW_LINE>// remove servlet entry in web.xml<NEW_LINE>WebApp webApp = getWebApp();<NEW_LINE>Servlet[] servlets = webApp.getServlet();<NEW_LINE>for (int i = 0; i < servlets.length; i++) {<NEW_LINE>Servlet servlet = servlets[i];<NEW_LINE>if (servlet.getServletName().equals(linkName)) {<NEW_LINE>webApp.removeServlet(servlet);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ServletMapping[] mappings = webApp.getServletMapping();<NEW_LINE>for (int j = 0; j < mappings.length; j++) {<NEW_LINE>ServletMapping mapping = mappings[j];<NEW_LINE>if (mapping.getServletName().equals(linkName)) {<NEW_LINE>webApp.removeServletMapping(mapping);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// This also saves server specific configuration, if necessary.<NEW_LINE>webApp.write(getDeploymentDescriptor());<NEW_LINE>} catch (java.io.IOException e) {<NEW_LINE>NotifyDescriptor ndd = new // NOI18N<NEW_LINE>// NOI18N<NEW_LINE>NotifyDescriptor.Message(NbBundle.getMessage(this.getClass(), "MSG_Unable_WRITE_WS_DD"), NotifyDescriptor.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.<MASK><NEW_LINE>}<NEW_LINE>}
getDefault().notify(ndd);
1,671,850
public long next(long instant, int standardOffset, int saveMillis, GregorianCalendar calendar) {<NEW_LINE>int offset;<NEW_LINE>if (iMode == 'w') {<NEW_LINE>offset = standardOffset + saveMillis;<NEW_LINE>} else if (iMode == 's') {<NEW_LINE>offset = standardOffset;<NEW_LINE>} else {<NEW_LINE>offset = 0;<NEW_LINE>}<NEW_LINE>// Convert from UTC to local time.<NEW_LINE>instant += offset;<NEW_LINE>calendar.setTimeInMillis(instant);<NEW_LINE>calendar.set(Calendar.MONTH, iMonthOfYear - 1);<NEW_LINE>calendar.set(Calendar.DATE, 1);<NEW_LINE>calendar.set(Calendar.HOUR_OF_DAY, 0);<NEW_LINE>calendar.<MASK><NEW_LINE>calendar.set(Calendar.SECOND, 0);<NEW_LINE>calendar.set(Calendar.MILLISECOND, 0);<NEW_LINE>calendar.add(Calendar.MILLISECOND, iMillisOfDay);<NEW_LINE>setDayOfMonthNext(calendar);<NEW_LINE>if (iDayOfWeek == 0) {<NEW_LINE>if (calendar.getTimeInMillis() <= instant) {<NEW_LINE>calendar.add(Calendar.YEAR, 1);<NEW_LINE>setDayOfMonthNext(calendar);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>setDayOfWeek(calendar);<NEW_LINE>if (calendar.getTimeInMillis() <= instant) {<NEW_LINE>calendar.add(Calendar.YEAR, 1);<NEW_LINE>calendar.set(Calendar.MONTH, iMonthOfYear - 1);<NEW_LINE>setDayOfMonthNext(calendar);<NEW_LINE>setDayOfWeek(calendar);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Convert from local time to UTC.<NEW_LINE>return calendar.getTimeInMillis() - offset;<NEW_LINE>}
set(Calendar.MINUTE, 0);
448,177
public BossBarMessage decode(ByteBuf buffer) throws IOException {<NEW_LINE>UUID uuid = GlowBufUtils.readUuid(buffer);<NEW_LINE>Action action = Action.fromInt(ByteBufUtils.readVarInt(buffer));<NEW_LINE>switch(action) {<NEW_LINE>case ADD:<NEW_LINE>TextMessage title = GlowBufUtils.readChat(buffer);<NEW_LINE>float health = buffer.readFloat();<NEW_LINE>Color color = Color.fromInt<MASK><NEW_LINE>Division division = Division.fromInt(ByteBufUtils.readVarInt(buffer));<NEW_LINE>byte flags = buffer.readByte();<NEW_LINE>return new BossBarMessage(uuid, action, title, health, color, division, flags);<NEW_LINE>case REMOVE:<NEW_LINE>return new BossBarMessage(uuid, action);<NEW_LINE>case UPDATE_HEALTH:<NEW_LINE>health = buffer.readFloat();<NEW_LINE>return new BossBarMessage(uuid, action, health);<NEW_LINE>case UPDATE_TITLE:<NEW_LINE>title = GlowBufUtils.readChat(buffer);<NEW_LINE>return new BossBarMessage(uuid, action, title);<NEW_LINE>case UPDATE_STYLE:<NEW_LINE>color = Color.fromInt(ByteBufUtils.readVarInt(buffer));<NEW_LINE>division = Division.fromInt(ByteBufUtils.readVarInt(buffer));<NEW_LINE>return new BossBarMessage(uuid, action, color, division);<NEW_LINE>case UPDATE_FLAGS:<NEW_LINE>flags = buffer.readByte();<NEW_LINE>return new BossBarMessage(uuid, action, flags);<NEW_LINE>default:<NEW_LINE>// INFO: This return is dead code. We would NPE before on the action line.<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
(ByteBufUtils.readVarInt(buffer));
130,903
private void makeConstructor() {<NEW_LINE>this.mv = this.classWriter.visitMethod(ACC_PUBLIC, CONSTRUCTOR_METHOD_NAME, "(Lcom/googlecode/aviator/AviatorEvaluatorInstance;Ljava/util/List;Lcom/googlecode/aviator/lexer/SymbolTable;)V", null, null);<NEW_LINE>this.mv.visitCode();<NEW_LINE>this.mv.visitVarInsn(ALOAD, 0);<NEW_LINE>this.mv.visitVarInsn(ALOAD, 1);<NEW_LINE>this.mv.visitVarInsn(ALOAD, 2);<NEW_LINE>this.mv.visitVarInsn(ALOAD, 3);<NEW_LINE>this.mv.visitMethodInsn(INVOKESPECIAL, "com/googlecode/aviator/ClassExpression", CONSTRUCTOR_METHOD_NAME, "(Lcom/googlecode/aviator/AviatorEvaluatorInstance;Ljava/util/List;Lcom/googlecode/aviator/lexer/SymbolTable;)V");<NEW_LINE>if (!this.innerVars.isEmpty()) {<NEW_LINE>for (Map.Entry<String, String> entry : this.innerVars.entrySet()) {<NEW_LINE>String outterName = entry.getKey();<NEW_LINE>String innerName = entry.getValue();<NEW_LINE>this.mv.visitVarInsn(ALOAD, 0);<NEW_LINE>this.mv.visitTypeInsn(NEW, JAVA_TYPE_OWNER);<NEW_LINE>this.mv.visitInsn(DUP);<NEW_LINE><MASK><NEW_LINE>this.mv.visitVarInsn(ALOAD, 3);<NEW_LINE>this.mv.visitMethodInsn(INVOKESPECIAL, JAVA_TYPE_OWNER, CONSTRUCTOR_METHOD_NAME, "(Ljava/lang/String;Lcom/googlecode/aviator/lexer/SymbolTable;)V");<NEW_LINE>this.mv.visitFieldInsn(PUTFIELD, this.className, innerName, "Lcom/googlecode/aviator/runtime/type/AviatorJavaType;");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!this.innerMethodMap.isEmpty()) {<NEW_LINE>for (Map.Entry<String, String> entry : this.innerMethodMap.entrySet()) {<NEW_LINE>String outterName = entry.getKey();<NEW_LINE>String innerName = entry.getValue();<NEW_LINE>this.mv.visitVarInsn(ALOAD, 0);<NEW_LINE>this.mv.visitVarInsn(ALOAD, 1);<NEW_LINE>this.mv.visitLdcInsn(outterName);<NEW_LINE>this.mv.visitVarInsn(ALOAD, 3);<NEW_LINE>this.mv.visitMethodInsn(INVOKEVIRTUAL, "com/googlecode/aviator/AviatorEvaluatorInstance", "getFunction", "(Ljava/lang/String;Lcom/googlecode/aviator/lexer/SymbolTable;)Lcom/googlecode/aviator/runtime/type/AviatorFunction;");<NEW_LINE>this.mv.visitFieldInsn(PUTFIELD, this.className, innerName, "Lcom/googlecode/aviator/runtime/type/AviatorFunction;");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!this.constantPool.isEmpty()) {<NEW_LINE>for (Map.Entry<Token<?>, String> entry : this.constantPool.entrySet()) {<NEW_LINE>Token<?> token = entry.getKey();<NEW_LINE>String fieldName = entry.getValue();<NEW_LINE>this.mv.visitVarInsn(ALOAD, 0);<NEW_LINE>onConstant0(token, true);<NEW_LINE>this.popOperand();<NEW_LINE>this.mv.visitFieldInsn(PUTFIELD, this.className, fieldName, OBJECT_DESC);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mv.visitInsn(RETURN);<NEW_LINE>this.mv.visitMaxs(4, 1);<NEW_LINE>this.mv.visitEnd();<NEW_LINE>}
this.mv.visitLdcInsn(outterName);
679,801
private Set<String> parseHandlesOutput(File pluginOutputFile) {<NEW_LINE>String line;<NEW_LINE>Set<String> fileSet = new HashSet<>();<NEW_LINE>try (BufferedReader br = new BufferedReader(new FileReader(pluginOutputFile))) {<NEW_LINE>// Ignore the first two header lines<NEW_LINE>br.readLine();<NEW_LINE>br.readLine();<NEW_LINE>while ((line = br.readLine()) != null) {<NEW_LINE>// 0x89ab7878 4 0x718 0x2000003 File \Device\HarddiskVolume1\Documents and Settings\QA\Local Settings\Application<NEW_LINE>if (line.startsWith("0x") == false) {<NEW_LINE>// NON-NLS<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// NON-NLS<NEW_LINE>String TAG = " File ";<NEW_LINE>String file_path;<NEW_LINE>if ((line.contains(TAG)) && (line.length() > 57)) {<NEW_LINE><MASK><NEW_LINE>if (file_path.contains("\"")) {<NEW_LINE>// NON-NLS<NEW_LINE>// NON-NLS<NEW_LINE>file_path = file_path.substring(0, file_path.indexOf('\"'));<NEW_LINE>}<NEW_LINE>// this file has a lot of device entries that are not files<NEW_LINE>if (file_path.startsWith("\\Device\\")) {<NEW_LINE>// NON-NLS<NEW_LINE>if (file_path.contains("HardDiskVolume") == false) {<NEW_LINE>// NON-NLS<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fileSet.add(normalizePath(file_path));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>errorMsgs.add(Bundle.VolatilityProcessor_errorMessage_outputParsingError("handles"));<NEW_LINE>logger.log(Level.SEVERE, Bundle.VolatilityProcessor_errorMessage_outputParsingError("handles"), ex);<NEW_LINE>}<NEW_LINE>return fileSet;<NEW_LINE>}
file_path = line.substring(57);
1,457,909
public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException {<NEW_LINE>final HttpServletRequest request = (HttpServletRequest) servletRequest;<NEW_LINE>final HttpServletResponse response = (HttpServletResponse) servletResponse;<NEW_LINE>if (!decoraManager.decorateRequest(request)) {<NEW_LINE>filterChain.doFilter(servletRequest, servletResponse);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final HttpServletRequest decoraRequest = wrapRequest(request);<NEW_LINE>boolean decorated = false;<NEW_LINE>// content was buffered, so try to decorate it<NEW_LINE>final String actionPath = DispatcherUtil.getServletPath(request);<NEW_LINE>final String decoratorPath = decoraManager.resolveDecorator(request, actionPath);<NEW_LINE>if (decoratorPath != null) {<NEW_LINE>char[] decoraContent = decoraManager.lookupDecoratorContent(decoratorPath);<NEW_LINE>if (decoraContent == null) {<NEW_LINE>final BufferResponseWrapper decoratorWrapper = new BufferResponseWrapper(response, lastModifiedData);<NEW_LINE>DispatcherUtil.forward(decoraRequest, decoratorWrapper, decoratorPath);<NEW_LINE>decoraContent = decoratorWrapper.getBufferedChars();<NEW_LINE>if (cached) {<NEW_LINE>decoraManager.registerDecorator(decoratorPath, decoraContent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>decoraParser.decorate(writer, pageContent, decoraContent);<NEW_LINE>writer.flush();<NEW_LINE>decorated = true;<NEW_LINE>log.debug("Decora applied on " + actionPath);<NEW_LINE>} else {<NEW_LINE>log.debug("Decora not applied on " + actionPath);<NEW_LINE>}<NEW_LINE>// if (response.isCommitted() == false) {<NEW_LINE>// pageWrapper.preResponseCommit();<NEW_LINE>// }<NEW_LINE>pageWrapper.commitResponse();
Writer writer = servletResponse.getWriter();
1,803,074
private String[] sortedCopy(String... labels) {<NEW_LINE>if (labels.length % 2 != 0) {<NEW_LINE>throw new IllegalArgumentException("labels are name/value pairs, expecting an even number");<NEW_LINE>}<NEW_LINE>String[] result = new String[labels.length];<NEW_LINE>int charsTotal = 0;<NEW_LINE>for (int i = 0; i < labels.length; i += 2) {<NEW_LINE>if (labels[i] == null) {<NEW_LINE>throw new IllegalArgumentException("labels[" + i + "] is null");<NEW_LINE>}<NEW_LINE>if (labels[i + 1] == null) {<NEW_LINE>throw new IllegalArgumentException("labels[" + (i + 1) + "] is null");<NEW_LINE>}<NEW_LINE>if (!labelNameRegex.matcher(labels[i]).matches()) {<NEW_LINE>throw new IllegalArgumentException(labels[i] + " is not a valid label name");<NEW_LINE>}<NEW_LINE>// name<NEW_LINE>result[i] = labels[i];<NEW_LINE>// value<NEW_LINE>result[i + 1] = labels[i + 1];<NEW_LINE>charsTotal += labels[i].length() + labels[i + 1].length();<NEW_LINE>// Move the current tuple down while the previous name is greater than current name.<NEW_LINE>for (int j = i - 2; j >= 0; j -= 2) {<NEW_LINE>int compareResult = result[j + 2].compareTo(result[j]);<NEW_LINE>if (compareResult == 0) {<NEW_LINE>throw new IllegalArgumentException(result[j] + ": label name is not unique");<NEW_LINE>} else if (compareResult < 0) {<NEW_LINE>String tmp = result[j];<NEW_LINE>result[j] = result[j + 2];<NEW_LINE>result[j + 2] = tmp;<NEW_LINE>tmp = result[j + 1];<NEW_LINE>result[j + 1] = result[j + 3];<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (charsTotal > 128) {<NEW_LINE>throw new IllegalArgumentException("the combined length of the label names and values must not exceed 128 UTF-8 characters");<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
result[j + 3] = tmp;
27,582
private void createDropAllTable(PrintWriter pw, Collection<TableDefinition> tableDefinitions, DaoGenConfig config) {<NEW_LINE>pw.println(" /** Drop all tables */");<NEW_LINE>pw.println(" public void dropAllTable() {");<NEW_LINE>pw.println(" String[] sqls = new String[" + tableDefinitions.size() + "];");<NEW_LINE>int count = 0;<NEW_LINE>for (TableDefinition tableDefinition : tableDefinitions) {<NEW_LINE>String sql = "DROP TABLE IF EXISTS " <MASK><NEW_LINE>pw.println(" sqls[" + count + "] = \"" + sql + "\";");<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>pw.println(" for (String sql : sqls) {");<NEW_LINE>pw.println(" LOG.debug(sql);");<NEW_LINE>pw.println(" executeUpdate(sql);");<NEW_LINE>pw.println(" }");<NEW_LINE>pw.println(" }");<NEW_LINE>}
+ tableDefinition.getTable_name() + " CASCADE;";
537,029
public Response load(Uri uri, int networkPolicy) throws IOException {<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {<NEW_LINE>installCacheIfNeeded(context);<NEW_LINE>}<NEW_LINE>HttpURLConnection connection = openConnection(uri);<NEW_LINE>connection.setUseCaches(true);<NEW_LINE>if (networkPolicy != 0) {<NEW_LINE>String headerValue;<NEW_LINE>if (NetworkPolicy.isOfflineOnly(networkPolicy)) {<NEW_LINE>headerValue = FORCE_CACHE;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>builder.setLength(0);<NEW_LINE>if (!NetworkPolicy.shouldReadFromDiskCache(networkPolicy)) {<NEW_LINE>builder.append("no-cache");<NEW_LINE>}<NEW_LINE>if (!NetworkPolicy.shouldWriteToDiskCache(networkPolicy)) {<NEW_LINE>if (builder.length() > 0) {<NEW_LINE>builder.append(',');<NEW_LINE>}<NEW_LINE>builder.append("no-store");<NEW_LINE>}<NEW_LINE>headerValue = builder.toString();<NEW_LINE>}<NEW_LINE>connection.setRequestProperty("Cache-Control", headerValue);<NEW_LINE>}<NEW_LINE>int responseCode = connection.getResponseCode();<NEW_LINE>if (responseCode >= 300) {<NEW_LINE>connection.disconnect();<NEW_LINE>throw new ResponseException(responseCode + " " + connection.getResponseMessage(), networkPolicy, responseCode);<NEW_LINE>}<NEW_LINE>long contentLength = connection.getHeaderFieldInt("Content-Length", -1);<NEW_LINE>boolean fromCache = parseResponseSourceHeader(connection.getHeaderField(RESPONSE_SOURCE));<NEW_LINE>return new Response(connection.getInputStream(), fromCache, contentLength);<NEW_LINE>}
StringBuilder builder = CACHE_HEADER_BUILDER.get();
1,331,772
public List<String> processCommand(String command, GcodeState state) throws GcodeParserException {<NEW_LINE>Position c = state.currentPoint;<NEW_LINE>if (c != null) {<NEW_LINE>Position p = new Position(c.x, c.y, c.z, state.isMetric ? Units.MM : Units.INCH).getPositionIn(defaultUnits);<NEW_LINE>// Update min<NEW_LINE>min.x = Math.min(min.x, p.x);<NEW_LINE>min.y = Math.min(<MASK><NEW_LINE>min.z = Math.min(min.z, p.z);<NEW_LINE>// Update max<NEW_LINE>max.x = Math.max(max.x, p.x);<NEW_LINE>max.y = Math.max(max.y, p.y);<NEW_LINE>max.z = Math.max(max.z, p.z);<NEW_LINE>// Num commands<NEW_LINE>commandCount++;<NEW_LINE>}<NEW_LINE>return Collections.singletonList(command);<NEW_LINE>}
min.y, p.y);
293,597
public Macro read(Decoder decoder) throws Exception {<NEW_LINE><MASK><NEW_LINE>if (tag == SIMPLE) {<NEW_LINE>String name = decoder.readString();<NEW_LINE>IncludeType type = enumSerializer.read(decoder);<NEW_LINE>String value = decoder.readNullableString();<NEW_LINE>return new MacroWithSimpleExpression(name, type, value);<NEW_LINE>} else if (tag == COMPLEX) {<NEW_LINE>String name = decoder.readString();<NEW_LINE>IncludeType type = enumSerializer.read(decoder);<NEW_LINE>String value = decoder.readNullableString();<NEW_LINE>List<Expression> args = ImmutableList.copyOf(expressionSerializer.read(decoder));<NEW_LINE>return new MacroWithComplexExpression(name, type, value, args);<NEW_LINE>} else if (tag == UNRESOLVED) {<NEW_LINE>String name = decoder.readString();<NEW_LINE>return new UnresolvableMacro(name);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>}
byte tag = decoder.readByte();
1,776,369
public void marshall(BatchWriteOperationResponse batchWriteOperationResponse, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (batchWriteOperationResponse == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(batchWriteOperationResponse.getCreateObject(), CREATEOBJECT_BINDING);<NEW_LINE>protocolMarshaller.marshall(batchWriteOperationResponse.getAttachObject(), ATTACHOBJECT_BINDING);<NEW_LINE>protocolMarshaller.marshall(batchWriteOperationResponse.getDetachObject(), DETACHOBJECT_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(batchWriteOperationResponse.getDeleteObject(), DELETEOBJECT_BINDING);<NEW_LINE>protocolMarshaller.marshall(batchWriteOperationResponse.getAddFacetToObject(), ADDFACETTOOBJECT_BINDING);<NEW_LINE>protocolMarshaller.marshall(batchWriteOperationResponse.getRemoveFacetFromObject(), REMOVEFACETFROMOBJECT_BINDING);<NEW_LINE>protocolMarshaller.marshall(batchWriteOperationResponse.getAttachPolicy(), ATTACHPOLICY_BINDING);<NEW_LINE>protocolMarshaller.marshall(batchWriteOperationResponse.getDetachPolicy(), DETACHPOLICY_BINDING);<NEW_LINE>protocolMarshaller.marshall(batchWriteOperationResponse.getCreateIndex(), CREATEINDEX_BINDING);<NEW_LINE>protocolMarshaller.marshall(batchWriteOperationResponse.getAttachToIndex(), ATTACHTOINDEX_BINDING);<NEW_LINE>protocolMarshaller.marshall(batchWriteOperationResponse.getDetachFromIndex(), DETACHFROMINDEX_BINDING);<NEW_LINE>protocolMarshaller.marshall(batchWriteOperationResponse.getAttachTypedLink(), ATTACHTYPEDLINK_BINDING);<NEW_LINE>protocolMarshaller.marshall(batchWriteOperationResponse.getDetachTypedLink(), DETACHTYPEDLINK_BINDING);<NEW_LINE>protocolMarshaller.marshall(batchWriteOperationResponse.getUpdateLinkAttributes(), UPDATELINKATTRIBUTES_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
batchWriteOperationResponse.getUpdateObjectAttributes(), UPDATEOBJECTATTRIBUTES_BINDING);
1,372,993
public synchronized StringBuffer insert(int index, char[] chars) {<NEW_LINE>int currentLength = lengthInternalUnsynchronized();<NEW_LINE>if (0 <= index && index <= currentLength) {<NEW_LINE>move(chars.length, index);<NEW_LINE>if (String.COMPACT_STRINGS) {<NEW_LINE>// Check if the StringBuffer is compressed<NEW_LINE>if (count >= 0 && String.canEncodeAsLatin1(chars, 0, chars.length)) {<NEW_LINE>String.compress(chars, 0, <MASK><NEW_LINE>count = currentLength + chars.length;<NEW_LINE>return this;<NEW_LINE>} else {<NEW_LINE>// Check if the StringBuffer is compressed<NEW_LINE>if (count >= 0) {<NEW_LINE>decompress(value.length);<NEW_LINE>}<NEW_LINE>String.decompressedArrayCopy(chars, 0, value, index, chars.length);<NEW_LINE>count = (currentLength + chars.length) | uncompressedBit;<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String.decompressedArrayCopy(chars, 0, value, index, chars.length);<NEW_LINE>count = currentLength + chars.length;<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new StringIndexOutOfBoundsException(index);<NEW_LINE>}<NEW_LINE>}
value, index, chars.length);
809,289
public EdgeLabel build() {<NEW_LINE>Id id = this.validOrGenerateId(HugeType.EDGE_LABEL, this.id, this.name);<NEW_LINE><MASK><NEW_LINE>EdgeLabel edgeLabel = new EdgeLabel(graph, id, this.name);<NEW_LINE>edgeLabel.sourceLabel(graph.vertexLabel(this.sourceLabel).id());<NEW_LINE>edgeLabel.targetLabel(graph.vertexLabel(this.targetLabel).id());<NEW_LINE>edgeLabel.frequency(this.frequency == Frequency.DEFAULT ? Frequency.SINGLE : this.frequency);<NEW_LINE>edgeLabel.ttl(this.ttl);<NEW_LINE>if (this.ttlStartTime != null) {<NEW_LINE>edgeLabel.ttlStartTime(this.graph().propertyKey(this.ttlStartTime).id());<NEW_LINE>}<NEW_LINE>edgeLabel.enableLabelIndex(this.enableLabelIndex == null || this.enableLabelIndex);<NEW_LINE>for (String key : this.properties) {<NEW_LINE>PropertyKey propertyKey = graph.propertyKey(key);<NEW_LINE>edgeLabel.property(propertyKey.id());<NEW_LINE>}<NEW_LINE>for (String key : this.sortKeys) {<NEW_LINE>PropertyKey propertyKey = graph.propertyKey(key);<NEW_LINE>edgeLabel.sortKey(propertyKey.id());<NEW_LINE>}<NEW_LINE>for (String key : this.nullableKeys) {<NEW_LINE>PropertyKey propertyKey = graph.propertyKey(key);<NEW_LINE>edgeLabel.nullableKey(propertyKey.id());<NEW_LINE>}<NEW_LINE>edgeLabel.userdata(this.userdata);<NEW_LINE>return edgeLabel;<NEW_LINE>}
HugeGraph graph = this.graph();
1,752,021
// Call on EDT<NEW_LINE>private void addMBeanInfo(XMBean mbean, MBeanInfo mbeanInfo) {<NEW_LINE>// NOI18N<NEW_LINE>String border = Resources.getText("LBL_MBeanInfo");<NEW_LINE>// NOI18N<NEW_LINE>String text = Resources.getText("LBL_Info");<NEW_LINE>DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();<NEW_LINE>Object[] rowData = new Object[2];<NEW_LINE>rowData[0] <MASK><NEW_LINE>// NOI18N<NEW_LINE>rowData[1] = new TableRowDivider("", lightSalmon);<NEW_LINE>tableModel.addRow(rowData);<NEW_LINE>// NOI18N<NEW_LINE>rowData[0] = new TableRowDivider(text + ":", lightYellow);<NEW_LINE>// NOI18N<NEW_LINE>rowData[1] = new TableRowDivider("", lightYellow);<NEW_LINE>tableModel.addRow(rowData);<NEW_LINE>// NOI18N<NEW_LINE>rowData[0] = Resources.getText("LBL_ObjectName");<NEW_LINE>rowData[1] = mbean.getObjectName();<NEW_LINE>tableModel.addRow(rowData);<NEW_LINE>// NOI18N<NEW_LINE>rowData[0] = Resources.getText("LBL_ClassName");<NEW_LINE>rowData[1] = mbeanInfo.getClassName();<NEW_LINE>tableModel.addRow(rowData);<NEW_LINE>// NOI18N<NEW_LINE>rowData[0] = Resources.getText("LBL_Description");<NEW_LINE>rowData[1] = mbeanInfo.getDescription();<NEW_LINE>tableModel.addRow(rowData);<NEW_LINE>addDescriptor(mbeanInfo.getDescriptor(), text);<NEW_LINE>// MBeanConstructorInfo<NEW_LINE>//<NEW_LINE>int i = 0;<NEW_LINE>for (MBeanConstructorInfo mbci : mbeanInfo.getConstructors()) {<NEW_LINE>// NOI18N<NEW_LINE>addMBeanConstructorInfo(// NOI18N<NEW_LINE>mbci, Resources.getText("LBL_Constructor") + "-" + i);<NEW_LINE>// MBeanParameterInfo<NEW_LINE>//<NEW_LINE>int j = 0;<NEW_LINE>for (MBeanParameterInfo mbpi : mbci.getSignature()) {<NEW_LINE>// NOI18N<NEW_LINE>addMBeanParameterInfo(// NOI18N<NEW_LINE>mbpi, Resources.getText("LBL_Parameter") + "-" + i + "-" + j);<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>tableModel.newDataAvailable(new TableModelEvent(tableModel));<NEW_LINE>}
= new TableRowDivider(border, lightSalmon);
324,510
protected void checkLink(XMLElement e, String attrNS, String attr) {<NEW_LINE>String href = e.getAttributeNS(attrNS, attr);<NEW_LINE>String rel = e.getAttributeNS(attrNS, "rel");<NEW_LINE>if (xrefChecker.isPresent() && href != null && rel != null && rel.toLowerCase(Locale.ROOT).contains("stylesheet")) {<NEW_LINE>href = PathUtil.resolveRelativeReference(base, href);<NEW_LINE>xrefChecker.get().registerReference(path, parser.getLineNumber(), parser.getColumnNumber(), <MASK><NEW_LINE>// Check the mimetype to record possible non-standard stylesheets<NEW_LINE>// with no fallback<NEW_LINE>String mimetype = xrefChecker.get().getMimeType(href);<NEW_LINE>if (mimetype != null) {<NEW_LINE>if (OPFChecker.isBlessedStyleType(mimetype) || OPFChecker.isDeprecatedBlessedStyleType(mimetype)) {<NEW_LINE>hasCss = true;<NEW_LINE>} else {<NEW_LINE>nonStandardStylesheetLink = Optional.of(EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), href));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
href, XRefChecker.Type.STYLESHEET);
91,580
public static ProjectViewEdit editLocalProjectView(Project project, ProjectViewEditor editor) {<NEW_LINE>List<Modification> modifications = Lists.newArrayList();<NEW_LINE>ProjectViewSet oldProjectViewSet = reloadProjectView(project);<NEW_LINE>if (oldProjectViewSet == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ProjectViewSet.<MASK><NEW_LINE>if (projectViewFile == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ProjectView.Builder builder = ProjectView.builder(projectViewFile.projectView);<NEW_LINE>if (editor.editProjectView(builder)) {<NEW_LINE>Modification modification = new Modification();<NEW_LINE>modification.newProjectView = builder.build();<NEW_LINE>modification.oldProjectView = projectViewFile.projectView;<NEW_LINE>modification.projectViewFile = projectViewFile.projectViewFile;<NEW_LINE>modifications.add(modification);<NEW_LINE>}<NEW_LINE>return new ProjectViewEdit(project, modifications);<NEW_LINE>}
ProjectViewFile projectViewFile = oldProjectViewSet.getTopLevelProjectViewFile();
370,661
public DataStreamSource build(CDCBuilder cdcBuilder, StreamExecutionEnvironment env, CustomTableEnvironment customTableEnvironment, DataStreamSource<String> dataStreamSource) {<NEW_LINE>final List<Schema<MASK><NEW_LINE>final String schemaFieldName = config.getSchemaFieldName();<NEW_LINE>if (Asserts.isNotNullCollection(schemaList)) {<NEW_LINE>SingleOutputStreamOperator<Map> mapOperator = deserialize(dataStreamSource);<NEW_LINE>for (Schema schema : schemaList) {<NEW_LINE>for (Table table : schema.getTables()) {<NEW_LINE>SingleOutputStreamOperator<Map> filterOperator = shunt(mapOperator, table, schemaFieldName);<NEW_LINE>List<String> columnNameList = new ArrayList<>();<NEW_LINE>List<LogicalType> columnTypeList = new ArrayList<>();<NEW_LINE>buildColumn(columnNameList, columnTypeList, table.getColumns());<NEW_LINE>DataStream<RowData> rowDataDataStream = buildRowData(filterOperator, columnNameList, columnTypeList);<NEW_LINE>addSink(env, rowDataDataStream, table, columnNameList, columnTypeList);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dataStreamSource;<NEW_LINE>}
> schemaList = config.getSchemaList();
176,349
public Either<Failure, CatchEventTuple> findCatchEvent(final DirectBuffer errorCode, ElementInstance instance, final Optional<DirectBuffer> jobErrorMessage) {<NEW_LINE>// assuming that error events are used rarely<NEW_LINE>// - just walk through the scope hierarchy and look for a matching catch event<NEW_LINE>final ArrayList<DirectBuffer> availableCatchEvents = new ArrayList<>();<NEW_LINE>while (instance != null && instance.isActive()) {<NEW_LINE>final <MASK><NEW_LINE>final var process = getProcess(instanceRecord.getProcessDefinitionKey());<NEW_LINE>final var found = findCatchEventInProcess(errorCode, process, instance);<NEW_LINE>if (found.isRight()) {<NEW_LINE>return Either.right(found.get());<NEW_LINE>} else {<NEW_LINE>availableCatchEvents.addAll(found.getLeft());<NEW_LINE>}<NEW_LINE>// find in parent process instance if exists<NEW_LINE>final var parentElementInstanceKey = instanceRecord.getParentElementInstanceKey();<NEW_LINE>instance = elementInstanceState.getInstance(parentElementInstanceKey);<NEW_LINE>}<NEW_LINE>final String incidentErrorMessage = String.format("Expected to throw an error event with the code '%s'%s, but it was not caught.%s", BufferUtil.bufferAsString(errorCode), jobErrorMessage.isPresent() && jobErrorMessage.get().capacity() > 0 ? String.format(" with message '%s'", BufferUtil.bufferAsString(jobErrorMessage.get())) : "", availableCatchEvents.isEmpty() ? " No error events are available in the scope." : String.format(" Available error events are [%s]", availableCatchEvents.stream().map(BufferUtil::bufferAsString).collect(Collectors.joining(", "))));<NEW_LINE>// no matching catch event found<NEW_LINE>return Either.left(new Failure(incidentErrorMessage, ErrorType.UNHANDLED_ERROR_EVENT));<NEW_LINE>}
var instanceRecord = instance.getValue();
203,325
private static /* We arrange some constants description to better fit in narrow space<NEW_LINE>* in property sheet, e.g. instead of HORIZONTAL_SCROLLBAR_AS_NEEDED we<NEW_LINE>* show only AS_NEEDED. We keep the uppercase letters to preserve the<NEW_LINE>* feeling that the value is a constant.<NEW_LINE>*/<NEW_LINE>void translateEnumLabels(Object[] enumerationValues) {<NEW_LINE>int n1 = enumerationValues.length / 3;<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < n1; i++) {<NEW_LINE>String code = (String) enumerationValues[i * 3 + 2];<NEW_LINE>for (int j = 0; j < n2; j++) if (code.endsWith(arrangedEnumLabels[j * 2])) {<NEW_LINE>enumerationValues[i * 3] = arrangedEnumLabels[j * 2 + 1];<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int n2 = arrangedEnumLabels.length / 2;
167,602
protected void toXmlP(StringBuilder sb, boolean pretty, String indent, String... attributeNames) {<NEW_LINE>String topTag = underscore(getClass().getSimpleName());<NEW_LINE>if (pretty) {<NEW_LINE>sb.append(indent);<NEW_LINE>}<NEW_LINE>sb.append('<').append(topTag).append('>');<NEW_LINE>if (pretty) {<NEW_LINE>sb.append('\n');<NEW_LINE>}<NEW_LINE>String[] names = !empty(attributeNames) ? attributeNames : attributeNamesLowerCased();<NEW_LINE>for (String name : names) {<NEW_LINE>if (pretty) {<NEW_LINE>sb.append(" ").append(indent);<NEW_LINE>}<NEW_LINE>sb.append('<').append(name).append('>');<NEW_LINE>Object v = attributes.get(name);<NEW_LINE>if (v != null) {<NEW_LINE>Escape.xml(sb, Convert.toString(v));<NEW_LINE>}<NEW_LINE>sb.append("</").append<MASK><NEW_LINE>if (pretty) {<NEW_LINE>sb.append('\n');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Entry<Class, List<Model>> cachedChild : cachedChildren.entrySet()) {<NEW_LINE>if (pretty) {<NEW_LINE>sb.append(" ").append(indent);<NEW_LINE>}<NEW_LINE>String tag = pluralize(underscore(cachedChild.getKey().getSimpleName()));<NEW_LINE>sb.append('<').append(tag).append('>');<NEW_LINE>if (pretty) {<NEW_LINE>sb.append('\n');<NEW_LINE>}<NEW_LINE>for (Model child : cachedChild.getValue()) {<NEW_LINE>child.toXmlP(sb, pretty, " " + indent);<NEW_LINE>}<NEW_LINE>if (pretty) {<NEW_LINE>sb.append(" ").append(indent);<NEW_LINE>}<NEW_LINE>sb.append("</").append(tag).append('>');<NEW_LINE>if (pretty) {<NEW_LINE>sb.append('\n');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>beforeClosingTag(sb, pretty, pretty ? " " + indent : "", attributeNames);<NEW_LINE>if (pretty) {<NEW_LINE>sb.append(indent);<NEW_LINE>}<NEW_LINE>sb.append("</").append(topTag).append('>');<NEW_LINE>if (pretty) {<NEW_LINE>sb.append('\n');<NEW_LINE>}<NEW_LINE>}
(name).append('>');
1,787,355
public com.squareup.okhttp.Call throttleGetCall(String query, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/throttle";<NEW_LINE>List<Pair> localVarQueryParams <MASK><NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (query != null)<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPair("query", query));<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>}
= new ArrayList<Pair>();
821,212
/*-[<NEW_LINE>void *start_routine(void *arg) {<NEW_LINE>JavaLangThread <MASK><NEW_LINE>pthread_setspecific(java_thread_key, thread);<NEW_LINE>pthread_setname_np([thread->name_ UTF8String]);<NEW_LINE>@autoreleasepool {<NEW_LINE>@try {<NEW_LINE>[thread run];<NEW_LINE>} @catch (JavaLangThrowable *t) {<NEW_LINE>JavaLangThread_rethrowWithJavaLangThrowable_(thread, t);<NEW_LINE>} @catch (id error) {<NEW_LINE>JavaLangThread_rethrowWithJavaLangThrowable_(<NEW_LINE>thread, create_JavaLangThrowable_initWithNSString_(<NEW_LINE>[NSString stringWithFormat:@"Unknown error: %@", [error description]]));<NEW_LINE>}<NEW_LINE>return NULL;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>]-*/<NEW_LINE>private static Thread createMainThread(Object nativeThread) {<NEW_LINE>return new Thread(ThreadGroup.mainThreadGroup, null, "main", 0, nativeThread);<NEW_LINE>}
*thread = (JavaLangThread *)arg;
1,852,551
public void run() {<NEW_LINE>for (TransactionPair<PortfolioTransaction> transaction : transactionList) {<NEW_LINE>Portfolio portfolio = (Portfolio) transaction.getOwner();<NEW_LINE>Account account = portfolio.getReferenceAccount();<NEW_LINE>PortfolioTransaction deliveryTransaction = transaction.getTransaction();<NEW_LINE>// check if the transaction currency fits to the reference account<NEW_LINE>// (and if not, fail fast)<NEW_LINE>if (!deliveryTransaction.getCurrencyCode().equals(account.getCurrencyCode()))<NEW_LINE>throw new IllegalArgumentException(MessageFormat.format(Messages.MsgErrorConvertToBuySellCurrencyMismatch, deliveryTransaction.getCurrencyCode(), account.getCurrencyCode(), account.getName()));<NEW_LINE>// delete existing transaction<NEW_LINE>transaction.getOwner().deleteTransaction(deliveryTransaction, client);<NEW_LINE>// create new buy / sell<NEW_LINE>BuySellEntry entry = new BuySellEntry(portfolio, account);<NEW_LINE>entry.setType(deliveryTransaction.getType() == PortfolioTransaction.Type.DELIVERY_INBOUND ? PortfolioTransaction.Type.BUY : PortfolioTransaction.Type.SELL);<NEW_LINE>entry.setDate(deliveryTransaction.getDateTime());<NEW_LINE>entry.setMonetaryAmount(deliveryTransaction.getMonetaryAmount());<NEW_LINE>entry.setSecurity(deliveryTransaction.getSecurity());<NEW_LINE>entry.setNote(deliveryTransaction.getNote());<NEW_LINE>entry.setShares(deliveryTransaction.getShares());<NEW_LINE>deliveryTransaction.getUnits().forEach(<MASK><NEW_LINE>entry.insert();<NEW_LINE>}<NEW_LINE>client.markDirty();<NEW_LINE>}
entry.getPortfolioTransaction()::addUnit);
1,311,864
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@public create window PointWindow#keepall as (id string, px double, py double);\n" + "create index MyIndex on PointWindow((px,py) pointregionquadtree(0,0,100,100,2,12));\n" + "insert into PointWindow select id, px, py from SupportSpatialPoint;\n" + "@name('s0') on SupportSpatialAABB as aabb select pt.id as c0 from PointWindow as pt where point(px,py).inside(rectangle(x,y,width,height));\n";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>sendPoint(env, "P0", 1.9290410254557688, 79.2596477701767);<NEW_LINE>sendPoint(env, "P1", 22.481380138332298, 38.21826613078289);<NEW_LINE>sendPoint(env, "P2", 96.68069967422869, 60.135596079815734);<NEW_LINE>sendPoint(env, "P3", 2.013086221651661, 79.96973017670842);<NEW_LINE>sendPoint(env, "P4", 72.7141155566794, 34.769073156981754);<NEW_LINE>sendPoint(env, "P5", 99.3778672522394, 97.26599233260606);<NEW_LINE>sendPoint(env, "P6", 92.5721971936789, 45.52450892745069);<NEW_LINE>sendPoint(<MASK><NEW_LINE>sendPoint(env, "P8", 34.431526832055994, 77.1868630618566);<NEW_LINE>sendPoint(env, "P9", 63.94019334876596, 60.49807218353348);<NEW_LINE>sendPoint(env, "P10", 72.6304354938367, 33.08578043563804);<NEW_LINE>sendPoint(env, "P11", 67.34486150692311, 23.93727603716781);<NEW_LINE>sendPoint(env, "P12", 3.2289468086465156, 21.0564103499303);<NEW_LINE>sendPoint(env, "P13", 54.93362964889536, 76.95495628291773);<NEW_LINE>sendPoint(env, "P14", 62.626040886628786, 37.228228790772334);<NEW_LINE>sendPoint(env, "P15", 31.89777659905859, 15.41080966535403);<NEW_LINE>sendPoint(env, "P16", 54.54495428051385, 50.57461489577466);<NEW_LINE>sendPoint(env, "P17", 72.07758279891948, 47.84348117893323);<NEW_LINE>sendPoint(env, "P18", 96.10730711977887, 59.22231623726726);<NEW_LINE>sendPoint(env, "P19", 1.4354270415599113, 20.003636602020634);<NEW_LINE>sendPoint(env, "P20", 17.252052662019757, 10.711353613675922);<NEW_LINE>sendPoint(env, "P21", 9.460168333656016, 76.32486040394515);<NEW_LINE>env.milestone(0);<NEW_LINE>BoundingBox bb = new BoundingBox(32.53403315866078, 2.7359221041404314, 69.34282527128134, 80.49662463068397);<NEW_LINE>env.sendEventBean(new SupportSpatialAABB("", bb.getMinX(), bb.getMinY(), bb.getMaxX() - bb.getMinX(), bb.getMaxY() - bb.getMinY()));<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>String received = sortJoinProperty(listener.getAndResetLastNewData(), "c0");<NEW_LINE>assertEquals("P7,P8,P9,P11,P13,P14,P16", received);<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
env, "P7", 64.81513547235994, 74.40317040273223);
1,167,555
protected void initializePrivilege(String restAdminId, String privilegeName) {<NEW_LINE>boolean restApiPrivilegeMappingExists = false;<NEW_LINE>Privilege privilege = idmIdentityService.createPrivilegeQuery().privilegeName(privilegeName).singleResult();<NEW_LINE>if (privilege != null) {<NEW_LINE>restApiPrivilegeMappingExists = restApiPrivilegeMappingExists(restAdminId, privilege);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>privilege = idmIdentityService.createPrivilege(privilegeName);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Could be created by another server, retrying fetch<NEW_LINE>privilege = idmIdentityService.createPrivilegeQuery().privilegeName(privilegeName).singleResult();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (privilege == null) {<NEW_LINE>throw new FlowableException("Could not find or create " + privilegeName + " privilege");<NEW_LINE>}<NEW_LINE>if (!restApiPrivilegeMappingExists) {<NEW_LINE>idmIdentityService.addUserPrivilegeMapping(<MASK><NEW_LINE>}<NEW_LINE>}
privilege.getId(), restAdminId);
522,506
private void collectContextTraits(final CdmAttributeContext subAttCtx, final HashSet<String> inheritedTraitNames, final Map<CdmAttributeContext, HashSet<String>> ctx2traitNames) {<NEW_LINE>final LinkedHashSet<String> traitNamesHere = new LinkedHashSet<>(inheritedTraitNames);<NEW_LINE>final CdmTraitCollection traitsHere = subAttCtx.getExhibitsTraits();<NEW_LINE>if (traitsHere != null) {<NEW_LINE>traitsHere.forEach(tat -> traitNamesHere.add(tat.getNamedReference()));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>for (final Object cr : subAttCtx.getContents().getAllItems()) {<NEW_LINE>if (((CdmObject) cr).getObjectType() == CdmObjectType.AttributeContextDef) {<NEW_LINE>// do this for all types?<NEW_LINE>collectContextTraits((CdmAttributeContext) cr, traitNamesHere, ctx2traitNames);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ctx2traitNames.put(subAttCtx, traitNamesHere);
340,345
public void run(RegressionEnvironment env) {<NEW_LINE>AtomicInteger milestone = new AtomicInteger();<NEW_LINE>String epl = "@name('s0') select " + "first(intPrimitive, 0) as f0, " + "first(intPrimitive, 1) as f1, " + "first(intPrimitive, 2) as f2, " + "first(intPrimitive, 3) as f3, " + "last(intPrimitive, 0) as l0, " + "last(intPrimitive, 1) as l1, " + "last(intPrimitive, 2) as l2, " + "last(intPrimitive, 3) as l3 " + "from SupportBean#length(3)";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>tryAssertionFirstLastIndexed(env, milestone);<NEW_LINE>// test join<NEW_LINE>env.undeployAll();<NEW_LINE>epl += ", SupportBean_A#lastevent";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean_A("A1"));<NEW_LINE>tryAssertionFirstLastIndexed(env, milestone);<NEW_LINE>// test variable<NEW_LINE>env.undeployAll();<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@name('var') @public create variable int indexvar = 2", path);<NEW_LINE>epl = "@name('s0') select first(intPrimitive, indexvar) as f0 from SupportBean#keepall";<NEW_LINE>env.compileDeploy(epl, path).addListener("s0");<NEW_LINE>String[] fields = "f0".split(",");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 10));<NEW_LINE>env.sendEventBean(new SupportBean("E1", 11));<NEW_LINE>env.listenerReset("s0");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 12));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 12 });<NEW_LINE>env.runtimeSetVariable("var", "indexvar", 0);<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(new SupportBean("E1", 13));<NEW_LINE>env.assertPropsNew("s0", fields, <MASK><NEW_LINE>env.undeployAll();<NEW_LINE>// test as part of function<NEW_LINE>env.compileDeploy("select Math.abs(last(intPrimitive)) from SupportBean").undeployAll();<NEW_LINE>}
new Object[] { 10 });
37,497
protected boolean afterSave(boolean newRecord, boolean success) {<NEW_LINE>if (!success)<NEW_LINE>return false;<NEW_LINE>//<NEW_LINE>String sql = "SELECT count(*) FROM AD_Package_Exp_Detail WHERE AD_Package_Exp_ID = ?";<NEW_LINE>int recordCount = DB.getSQLValue(get_TrxName(<MASK><NEW_LINE>if (recordCount == 0) {<NEW_LINE>sql = "SELECT * FROM AD_Package_Exp_Common";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, get_TrxName());<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>int i = 1;<NEW_LINE>while (rs.next()) {<NEW_LINE>X_AD_Package_Exp_Detail PackDetail = new X_AD_Package_Exp_Detail(Env.getCtx(), 0, null);<NEW_LINE>PackDetail.setAD_Client_ID(this.getAD_Client_ID());<NEW_LINE>PackDetail.setAD_Org_ID(this.getAD_Org_ID());<NEW_LINE>PackDetail.setAD_Package_Exp_ID(getAD_Package_Exp_ID());<NEW_LINE>PackDetail.setType(rs.getString("TYPE"));<NEW_LINE>PackDetail.setFileName(rs.getString("FILENAME"));<NEW_LINE>PackDetail.setDescription(rs.getString("DESCRIPTION"));<NEW_LINE>PackDetail.setTarget_Directory(rs.getString("TARGET_DIRECTORY"));<NEW_LINE>PackDetail.setFile_Directory(rs.getString("FILE_DIRECTORY"));<NEW_LINE>PackDetail.setDestination_Directory(rs.getString("DESTINATION_DIRECTORY"));<NEW_LINE>PackDetail.setSQLStatement(rs.getString("SQLSTATEMENT"));<NEW_LINE>PackDetail.setAD_Workflow_ID(rs.getInt("AD_WORKFLOW_ID"));<NEW_LINE>PackDetail.setAD_Window_ID(rs.getInt("AD_WINDOW_ID"));<NEW_LINE>PackDetail.setAD_Role_ID(rs.getInt("AD_ROLE_ID"));<NEW_LINE>PackDetail.setAD_Process_ID(rs.getInt("AD_PROCESS_ID"));<NEW_LINE>PackDetail.setAD_Menu_ID(rs.getInt("AD_MENU_ID"));<NEW_LINE>PackDetail.setDBType(rs.getString("DBTYPE"));<NEW_LINE>PackDetail.setAD_ImpFormat_ID(rs.getInt("AD_IMPFORMAT_ID"));<NEW_LINE>PackDetail.setAD_Workbench_ID(rs.getInt("AD_WORKBENCH_ID"));<NEW_LINE>PackDetail.setAD_Table_ID(rs.getInt("AD_TABLE_ID"));<NEW_LINE>PackDetail.setAD_Form_ID(rs.getInt("AD_FORM_ID"));<NEW_LINE>PackDetail.setAD_ReportView_ID(rs.getInt("AD_REPORTVIEW_ID"));<NEW_LINE>PackDetail.setLine(i * 10);<NEW_LINE>PackDetail.saveEx();<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
), sql, getAD_Package_Exp_ID());
84,125
public Object apply(final ActionContext ctx, final Object caller, final Object[] sources) {<NEW_LINE>try {<NEW_LINE>assertArrayHasLengthAndAllElementsNotNull(sources, 1);<NEW_LINE>final SecurityContext securityContext = ctx.getSecurityContext();<NEW_LINE>final String name = sources[0].toString();<NEW_LINE>if (securityContext != null) {<NEW_LINE>final HttpServletRequest request = securityContext.getRequest();<NEW_LINE>if (request != null) {<NEW_LINE>Cookie[] cookies = request.getCookies();<NEW_LINE>if (cookies != null) {<NEW_LINE>for (Cookie c : cookies) {<NEW_LINE>if (c.getName().equals(name)) {<NEW_LINE>return c.getValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ctx.isJavaScriptContext()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>} catch (ArgumentNullException pe) {<NEW_LINE>// silently ignore null arguments<NEW_LINE>return null;<NEW_LINE>} catch (ArgumentCountException pe) {<NEW_LINE>logParameterError(caller, sources, pe.getMessage(<MASK><NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>}
), ctx.isJavaScriptContext());
1,007,167
protected Object dateGetter(Object thisObj, @Cached("create(getContext())") TemporalCalendarGetterNode calendarGetterNode) {<NEW_LINE>JSTemporalPlainYearMonthObject temporalYM = (JSTemporalPlainYearMonthObject) thisObj;<NEW_LINE>switch(property) {<NEW_LINE>case calendar:<NEW_LINE>return temporalYM.getCalendar();<NEW_LINE>case year:<NEW_LINE>return TemporalUtil.calendarYear(calendarGetterNode, <MASK><NEW_LINE>case month:<NEW_LINE>return TemporalUtil.calendarMonth(calendarGetterNode, temporalYM.getCalendar(), temporalYM);<NEW_LINE>case monthCode:<NEW_LINE>return TemporalUtil.calendarMonthCode(calendarGetterNode, temporalYM.getCalendar(), temporalYM);<NEW_LINE>case daysInYear:<NEW_LINE>return TemporalUtil.calendarDaysInYear(calendarGetterNode, temporalYM.getCalendar(), temporalYM);<NEW_LINE>case daysInMonth:<NEW_LINE>return TemporalUtil.calendarDaysInMonth(calendarGetterNode, temporalYM.getCalendar(), temporalYM);<NEW_LINE>case monthsInYear:<NEW_LINE>return TemporalUtil.calendarMonthsInYear(calendarGetterNode, temporalYM.getCalendar(), temporalYM);<NEW_LINE>case inLeapYear:<NEW_LINE>return TemporalUtil.calendarInLeapYear(calendarGetterNode, temporalYM.getCalendar(), temporalYM);<NEW_LINE>}<NEW_LINE>CompilerDirectives.transferToInterpreter();<NEW_LINE>throw Errors.shouldNotReachHere();<NEW_LINE>}
temporalYM.getCalendar(), temporalYM);
539,503
public DeleteImageBuilderResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteImageBuilderResult deleteImageBuilderResult = new DeleteImageBuilderResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return deleteImageBuilderResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ImageBuilder", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteImageBuilderResult.setImageBuilder(ImageBuilderJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return deleteImageBuilderResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
697,449
public Query writeQuery(Query query) {<NEW_LINE><MASK><NEW_LINE>// Serialize edge condition query (TODO: add VEQ(for EOUT/EIN))<NEW_LINE>if (type.isEdge() && query.conditionsSize() > 0) {<NEW_LINE>if (query.idsSize() > 0) {<NEW_LINE>throw new BackendException("Not supported query edge by id " + "and by condition at the same time");<NEW_LINE>}<NEW_LINE>Query result = this.writeQueryEdgeCondition(query);<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Serialize id in query<NEW_LINE>if (query.idsSize() == 1 && query instanceof IdQuery.OneIdQuery) {<NEW_LINE>IdQuery.OneIdQuery result = (IdQuery.OneIdQuery) query.copy();<NEW_LINE>result.resetId(this.writeQueryId(type, result.id()));<NEW_LINE>query = result;<NEW_LINE>} else if (query.idsSize() > 0 && query instanceof IdQuery) {<NEW_LINE>IdQuery result = (IdQuery) query.copy();<NEW_LINE>result.resetIds();<NEW_LINE>for (Id id : query.ids()) {<NEW_LINE>result.query(this.writeQueryId(type, id));<NEW_LINE>}<NEW_LINE>query = result;<NEW_LINE>}<NEW_LINE>// Serialize condition(key/value) in query<NEW_LINE>if (query instanceof ConditionQuery && query.conditionsSize() > 0) {<NEW_LINE>query = this.writeQueryCondition(query);<NEW_LINE>}<NEW_LINE>return query;<NEW_LINE>}
HugeType type = query.resultType();
1,667,996
private Map<String, Object> readPrivateDict(DictData privateDict) {<NEW_LINE>Map<String, Object> privDict = new LinkedHashMap<String, Object>(17);<NEW_LINE>privDict.put("BlueValues", privateDict.getDelta("BlueValues", null));<NEW_LINE>privDict.put("OtherBlues", privateDict.getDelta("OtherBlues", null));<NEW_LINE>privDict.put("FamilyBlues", privateDict.getDelta("FamilyBlues", null));<NEW_LINE>privDict.put("FamilyOtherBlues", privateDict.getDelta("FamilyOtherBlues", null));<NEW_LINE>privDict.put("BlueScale", privateDict.getNumber("BlueScale", 0.039625));<NEW_LINE>privDict.put("BlueShift", privateDict.getNumber("BlueShift", 7));<NEW_LINE>privDict.put("BlueFuzz", privateDict.getNumber("BlueFuzz", 1));<NEW_LINE>privDict.put("StdHW", privateDict.getNumber("StdHW", null));<NEW_LINE>privDict.put("StdVW", privateDict.getNumber("StdVW", null));<NEW_LINE>privDict.put("StemSnapH", privateDict.getDelta("StemSnapH", null));<NEW_LINE>privDict.put("StemSnapV", privateDict.getDelta("StemSnapV", null));<NEW_LINE>privDict.put("ForceBold", privateDict.getBoolean("ForceBold", false));<NEW_LINE>privDict.put("LanguageGroup", privateDict.getNumber("LanguageGroup", 0));<NEW_LINE>privDict.put("ExpansionFactor", privateDict.getNumber("ExpansionFactor", 0.06));<NEW_LINE>privDict.put("initialRandomSeed", privateDict.getNumber("initialRandomSeed", 0));<NEW_LINE>privDict.put("defaultWidthX", privateDict.getNumber("defaultWidthX", 0));<NEW_LINE>privDict.put("nominalWidthX", privateDict<MASK><NEW_LINE>return privDict;<NEW_LINE>}
.getNumber("nominalWidthX", 0));
660,514
public String generateUserKey(String username, String keyname) throws ServletException {<NEW_LINE>// set key type<NEW_LINE>int type = KeyPair.RSA;<NEW_LINE>if ("dsa".equals(SSHUtil.KEY_TYPE)) {<NEW_LINE>type = KeyPair.DSA;<NEW_LINE>} else if ("ecdsa".equals(SSHUtil.KEY_TYPE)) {<NEW_LINE>type = KeyPair.ECDSA;<NEW_LINE>}<NEW_LINE>JSch jsch = new JSch();<NEW_LINE>String pubKey;<NEW_LINE>try {<NEW_LINE>KeyPair keyPair = KeyPair.genKeyPair(jsch, type, SSHUtil.KEY_LENGTH);<NEW_LINE>OutputStream os = new ByteArrayOutputStream();<NEW_LINE>keyPair.writePrivateKey(os, publicKey.<MASK><NEW_LINE>// set private key<NEW_LINE>try {<NEW_LINE>getRequest().getSession().setAttribute(PVT_KEY, EncryptionUtil.encrypt(os.toString()));<NEW_LINE>} catch (GeneralSecurityException ex) {<NEW_LINE>log.error(ex.toString(), ex);<NEW_LINE>throw new ServletException(ex.toString(), ex);<NEW_LINE>}<NEW_LINE>os = new ByteArrayOutputStream();<NEW_LINE>keyPair.writePublicKey(os, username + "@" + keyname);<NEW_LINE>pubKey = os.toString();<NEW_LINE>keyPair.dispose();<NEW_LINE>} catch (JSchException ex) {<NEW_LINE>log.error(ex.toString(), ex);<NEW_LINE>throw new ServletException(ex.toString(), ex);<NEW_LINE>}<NEW_LINE>return pubKey;<NEW_LINE>}
getPassphrase().getBytes());
1,016,590
public void actionPerformed(ActionEvent ev) {<NEW_LINE>CoverageManagerImpl manager = CoverageManagerImpl.getInstance();<NEW_LINE>switch(action) {<NEW_LINE>case ACTION_TOGGLE_COLLECT:<NEW_LINE>{<NEW_LINE>boolean enabled = ((JCheckBoxMenuItem) ev.getSource()).isSelected();<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case ACTION_TOGGLE_AGGREGATION:<NEW_LINE>{<NEW_LINE>boolean enabled = ((JCheckBoxMenuItem) ev.getSource()).isSelected();<NEW_LINE>manager.setAggregating(project, enabled);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case ACTION_SHOW_REPORT:<NEW_LINE>{<NEW_LINE>manager.showReport(project);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case ACTION_CLEAR_RESULTS:<NEW_LINE>{<NEW_LINE>manager.clear(project);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case ACTION_TOGGLE_EDITORBAR:<NEW_LINE>{<NEW_LINE>boolean enabled = ((JCheckBoxMenuItem) ev.getSource()).isSelected();<NEW_LINE>manager.setShowEditorBar(enabled);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
manager.setEnabled(project, enabled);
1,226,704
public final void write(final byte[] bytes, final int off, final int len) throws IOException {<NEW_LINE>int start = off;<NEW_LINE>for (int i = off; i < off + len; i++) {<NEW_LINE>int b = bytes[i];<NEW_LINE>if (inString) {<NEW_LINE>if (b == '"' && !inEscape) {<NEW_LINE>inString = false;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else if (b == '"') {<NEW_LINE>inString = true;<NEW_LINE>if (beginObjectOrList) {<NEW_LINE>writeNewLineWithIndent();<NEW_LINE>beginObjectOrList = false;<NEW_LINE>}<NEW_LINE>} else if (b == ',') {<NEW_LINE>out.write(bytes, start, i - start + 1);<NEW_LINE>start = i + 1;<NEW_LINE>writeNewLineWithIndent();<NEW_LINE>} else if (b == ':') {<NEW_LINE>out.write(bytes, start, i - start + 1);<NEW_LINE>start = i + 1;<NEW_LINE>out.write(' ');<NEW_LINE>} else if (b == '{' || b == '[') {<NEW_LINE>if (beginObjectOrList) {<NEW_LINE>writeNewLineWithIndent();<NEW_LINE>}<NEW_LINE>beginObjectOrList = true;<NEW_LINE>currentIndent += indentLength;<NEW_LINE>out.write(bytes, start, i - start + 1);<NEW_LINE>start = i + 1;<NEW_LINE>} else if (b == '}' || b == ']') {<NEW_LINE>currentIndent -= indentLength;<NEW_LINE>out.write(bytes, start, i - start);<NEW_LINE>if (beginObjectOrList) {<NEW_LINE>beginObjectOrList = false;<NEW_LINE>} else {<NEW_LINE>writeNewLineWithIndent();<NEW_LINE>}<NEW_LINE>out.write(b);<NEW_LINE>start = i + 1;<NEW_LINE>} else if (WHITESPACE[b]) {<NEW_LINE>out.write(bytes, start, i - start);<NEW_LINE>start = i + 1;<NEW_LINE>} else if (beginObjectOrList) {<NEW_LINE>writeNewLineWithIndent();<NEW_LINE>beginObjectOrList = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int remaining = off + len - start;<NEW_LINE>if (remaining > 0) {<NEW_LINE>out.write(bytes, start, remaining);<NEW_LINE>}<NEW_LINE>}
inEscape = !inEscape && b == '\\';
832,489
private static void attemptWriteAndDeleteDynamodbItem(final DynamodbDestinationConfig dynamodbDestinationConfig, final String outputTableName) throws Exception {<NEW_LINE>final DynamoDB dynamoDB = new DynamoDB(getAmazonDynamoDB(dynamodbDestinationConfig));<NEW_LINE>final // create table<NEW_LINE>Table // create table<NEW_LINE>table = // create table<NEW_LINE>dynamoDB.// create table<NEW_LINE>createTable(outputTableName, Arrays.asList(new KeySchemaElement(JavaBaseConstants.COLUMN_NAME_AB_ID, KeyType.HASH), new KeySchemaElement("sync_time", KeyType.RANGE)), Arrays.asList(new AttributeDefinition(JavaBaseConstants.COLUMN_NAME_AB_ID, ScalarAttributeType.S), new AttributeDefinition("sync_time", ScalarAttributeType.N)), new ProvisionedThroughput(1L, 1L));<NEW_LINE>table.waitForActive();<NEW_LINE>try {<NEW_LINE>final PutItemOutcome outcome = table.putItem(new Item().withPrimaryKey(JavaBaseConstants.COLUMN_NAME_AB_ID, UUID.randomUUID().toString(), "sync_time", System.currentTimeMillis()));<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOGGER.<MASK><NEW_LINE>}<NEW_LINE>// delete table<NEW_LINE>table.delete();<NEW_LINE>table.waitForDelete();<NEW_LINE>}
error(e.getMessage());
430,674
public //<NEW_LINE>ResponseEntity<JsonAttachment> //<NEW_LINE>attachFile(//<NEW_LINE>@PathVariable("dataSourceName") final String dataSourceName, @ApiParam(required = true, value = "`externalheaderId` of the order line candidates to which the given file shall be attached") @PathVariable("externalHeaderId") final String externalHeaderId, @//<NEW_LINE>ApiParam(//<NEW_LINE>value = "List with an even number of items;\n" + "transformed to a map of key-value pairs and added to the new attachment as tags.\n" + "If the number of items is odd, the last item is discarded.", //<NEW_LINE>allowEmptyValue = true) @RequestParam("tags") @Nullable final List<String> //<NEW_LINE>tagKeyValuePairs, @ApiParam(required = true, value = "The file to attach; the attachment's MIME type will be determined from the file extenstion", allowEmptyValue = false) @RequestBody @NonNull final MultipartFile file) throws IOException {<NEW_LINE>final IOLCandBL olCandsService = Services.get(IOLCandBL.class);<NEW_LINE>final OLCandQuery query = OLCandQuery.builder().inputDataSourceName(dataSourceName).externalHeaderId(externalHeaderId).build();<NEW_LINE>final <MASK><NEW_LINE>final byte[] data = file.getBytes();<NEW_LINE>final AttachmentTags attachmentTags = AttachmentTags.builder().tags(extractTags(tagKeyValuePairs)).build();<NEW_LINE>final AttachmentEntryCreateRequest request = AttachmentEntryCreateRequest.builderFromByteArray(fileName, data).tags(attachmentTags).build();<NEW_LINE>final AttachmentEntry attachmentEntry = olCandsService.addAttachment(query, request);<NEW_LINE>final JsonAttachment jsonAttachment = toJsonAttachment(externalHeaderId, dataSourceName, attachmentEntry);<NEW_LINE>return new ResponseEntity<>(jsonAttachment, HttpStatus.CREATED);<NEW_LINE>}
String fileName = file.getOriginalFilename();
181,630
public ListenerResult listen(WorkflowContext context) throws WorkflowListenerException {<NEW_LINE>GroupResourceProcessForm form = (GroupResourceProcessForm) context.getProcessForm();<NEW_LINE>String groupId = form.getInlongGroupId();<NEW_LINE>log.info("try to create consumer group for groupId {}", groupId);<NEW_LINE>InlongGroupInfo <MASK><NEW_LINE>String topicName = groupInfo.getMqResourceObj();<NEW_LINE>int clusterId = Integer.parseInt(commonOperateService.getSpecifiedParam(Constant.CLUSTER_TUBE_CLUSTER_ID));<NEW_LINE>QueryTubeTopicRequest queryTubeTopicRequest = QueryTubeTopicRequest.builder().topicName(topicName).clusterId(clusterId).user(groupInfo.getCreator()).build();<NEW_LINE>// Query whether the tube topic exists<NEW_LINE>boolean topicExist = tubeMqOptService.queryTopicIsExist(queryTubeTopicRequest);<NEW_LINE>Integer tryNumber = reTryConfigBean.getMaxAttempts();<NEW_LINE>Long delay = reTryConfigBean.getDelay();<NEW_LINE>while (!topicExist && --tryNumber > 0) {<NEW_LINE>log.info("check whether the tube topic exists, try count={}", tryNumber);<NEW_LINE>try {<NEW_LINE>Thread.sleep(delay);<NEW_LINE>delay *= reTryConfigBean.getMultiplier();<NEW_LINE>topicExist = tubeMqOptService.queryTopicIsExist(queryTubeTopicRequest);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.error("check the tube topic exists error", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AddTubeConsumeGroupRequest addTubeConsumeGroupRequest = new AddTubeConsumeGroupRequest();<NEW_LINE>addTubeConsumeGroupRequest.setClusterId(clusterId);<NEW_LINE>addTubeConsumeGroupRequest.setCreateUser(groupInfo.getCreator());<NEW_LINE>GroupNameJsonSetBean groupNameJsonSetBean = new GroupNameJsonSetBean();<NEW_LINE>groupNameJsonSetBean.setTopicName(topicName);<NEW_LINE>String consumeGroupName = "sort_" + topicName + "_group";<NEW_LINE>groupNameJsonSetBean.setGroupName(consumeGroupName);<NEW_LINE>addTubeConsumeGroupRequest.setGroupNameJsonSet(Collections.singletonList(groupNameJsonSetBean));<NEW_LINE>try {<NEW_LINE>tubeMqOptService.createNewConsumerGroup(addTubeConsumeGroupRequest);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new WorkflowListenerException("create tube consumer group for groupId=" + groupId + " error", e);<NEW_LINE>}<NEW_LINE>log.info("finish to create consumer group for {}", groupId);<NEW_LINE>return ListenerResult.success();<NEW_LINE>}
groupInfo = groupService.get(groupId);
921,254
public com.amazonaws.services.cloudtrail.model.InvalidInsightSelectorsException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.cloudtrail.model.InvalidInsightSelectorsException invalidInsightSelectorsException = new com.amazonaws.services.cloudtrail.model.InvalidInsightSelectorsException(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 invalidInsightSelectorsException;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,046,092
protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException {<NEW_LINE>SearchResultItem searchResultItem = new SearchResultItem();<NEW_LINE>String link = getEnclosureUrl(item);<NEW_LINE>searchResultItem.setLink(link);<NEW_LINE>if (item.getRssGuid().isPermaLink()) {<NEW_LINE>searchResultItem.setDetails(item.getRssGuid().getGuid());<NEW_LINE>Matcher matcher = GUID_PATTERN.matcher(item.getRssGuid().getGuid());<NEW_LINE>if (matcher.matches()) {<NEW_LINE>searchResultItem.setIndexerGuid(matcher.group(2));<NEW_LINE>} else {<NEW_LINE>searchResultItem.setIndexerGuid(item.getRssGuid().getGuid());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>searchResultItem.setIndexerGuid(item.getRssGuid().getGuid());<NEW_LINE>}<NEW_LINE>if (!Strings.isNullOrEmpty(item.getComments()) && Strings.isNullOrEmpty(searchResultItem.getDetails())) {<NEW_LINE>searchResultItem.setDetails(item.getComments().replace("#comments", ""));<NEW_LINE>}<NEW_LINE>// LATER If details link still not set build it using the GUID which is sure to be not a link at this point. Perhaps this isn't necessary because all indexers should have a comments link<NEW_LINE>searchResultItem.setFirstFound(Instant.now());<NEW_LINE>searchResultItem.setIndexer(this);<NEW_LINE>searchResultItem.setTitle(cleanUpTitle(item.getTitle()));<NEW_LINE>searchResultItem.setSize(item.getEnclosure().getLength());<NEW_LINE>searchResultItem.<MASK><NEW_LINE>searchResultItem.setIndexerScore(config.getScore());<NEW_LINE>searchResultItem.setGuid(SearchResultIdCalculator.calculateSearchResultId(searchResultItem));<NEW_LINE>searchResultItem.setAgePrecise(true);<NEW_LINE>searchResultItem.setDescription(item.getDescription());<NEW_LINE>searchResultItem.setDownloadType(DownloadType.NZB);<NEW_LINE>searchResultItem.setCommentsLink(item.getComments());<NEW_LINE>// May be overwritten by mapping in attributes<NEW_LINE>searchResultItem.setOriginalCategory(item.getCategory());<NEW_LINE>parseAttributes(item, searchResultItem);<NEW_LINE>return searchResultItem;<NEW_LINE>}
setPubDate(item.getPubDate());
332,136
private void generateAnnotatedSourceFile(final MutationTestSummaryData mutationMetaData) {<NEW_LINE>final String fileName = mutationMetaData.getPackageName() + File.separator + mutationMetaData.getFileName() + ".html";<NEW_LINE>try (Writer writer = this.outputStrategy.createWriterForFile(fileName)) {<NEW_LINE>final StringTemplateGroup group = new StringTemplateGroup("mutation_test");<NEW_LINE>final StringTemplate st = group.getInstanceOf("templates/mutation/mutation_report");<NEW_LINE>st.setAttribute("css", this.css);<NEW_LINE>st.setAttribute(<MASK><NEW_LINE>st.setAttribute("mutators", mutationMetaData.getMutators());<NEW_LINE>final SourceFile sourceFile = createAnnotatedSourceFile(mutationMetaData);<NEW_LINE>st.setAttribute("sourceFile", sourceFile);<NEW_LINE>st.setAttribute("mutatedClasses", mutationMetaData.getMutatedClasses());<NEW_LINE>writer.write(st.toString());<NEW_LINE>} catch (final IOException ex) {<NEW_LINE>Log.getLogger().log(Level.WARNING, "Error while writing report", ex);<NEW_LINE>}<NEW_LINE>}
"tests", mutationMetaData.getTests());
1,559,980
private Image createDelegatePaintedImage(Component c) {<NEW_LINE>double toolkitScale = Toolkit.getDefaultToolkit().getScreenResolution() / 96.0;<NEW_LINE>final int EXTRA_PIXELS = 2;<NEW_LINE>BufferedImage img = new BufferedImage(EXTRA_PIXELS + (int) Math.ceil(delegate.getIconWidth() * toolkitScale), EXTRA_PIXELS + (int) Math.ceil(delegate.getIconHeight() * toolkitScale), BufferedImage.TYPE_INT_ARGB);<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>addScalingRenderingHints(g);<NEW_LINE>g.scale(Math.round(width * toolkitScale) / (double) width, Math.round(height * toolkitScale) / (double) height);<NEW_LINE>delegate.paintIcon(c, g, 0, 0);<NEW_LINE>} finally {<NEW_LINE>g.dispose();<NEW_LINE>}<NEW_LINE>return img;<NEW_LINE>}
Graphics2D g = img.createGraphics();
58,057
static Map<String, Uri> buildCidToAttachmentUriMap(AttachmentInfoExtractor attachmentInfoExtractor, Part rootPart) {<NEW_LINE>HashMap<String, Uri> result = new HashMap<>();<NEW_LINE>Stack<Part> partsToCheck = new Stack<>();<NEW_LINE>partsToCheck.push(rootPart);<NEW_LINE>while (!partsToCheck.isEmpty()) {<NEW_LINE>Part part = partsToCheck.pop();<NEW_LINE>Body body = part.getBody();<NEW_LINE>if (body instanceof Multipart) {<NEW_LINE>Multipart multipart = (Multipart) body;<NEW_LINE>for (Part bodyPart : multipart.getBodyParts()) {<NEW_LINE>partsToCheck.push(bodyPart);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>String contentId = part.getContentId();<NEW_LINE>if (contentId != null) {<NEW_LINE>AttachmentViewInfo attachmentInfo = attachmentInfoExtractor.extractAttachmentInfo(part);<NEW_LINE>result.<MASK><NEW_LINE>}<NEW_LINE>} catch (MessagingException e) {<NEW_LINE>Timber.e(e, "Error extracting attachment info");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.unmodifiableMap(result);<NEW_LINE>}
put(contentId, attachmentInfo.internalUri);
783,987
static CodeBlock generateStateUpdateDelegatingCall(SpecModel specModel, int methodIndex, SpecMethodModel<UpdateStateMethod, Void> updateStateMethod, boolean withTransition) {<NEW_LINE>final CodeBlock.Builder codeBlock = CodeBlock.builder();<NEW_LINE>codeBlock.add("case $L:\n$>", methodIndex);<NEW_LINE>final StringBuilder format = new StringBuilder();<NEW_LINE>final List<Object> args = new LinkedList<>();<NEW_LINE>if (withTransition) {<NEW_LINE>format.append("$L = ");<NEW_LINE>args.add(GeneratorConstants.STATE_TRANSITION_FIELD_NAME);<NEW_LINE>}<NEW_LINE>format.append("$N.$N(");<NEW_LINE>args.add(SpecModelUtils.getSpecAccessor(specModel));<NEW_LINE>args.add(updateStateMethod.name);<NEW_LINE>int paramIndex = 0;<NEW_LINE>for (int i = 0; i < updateStateMethod.methodParams.size(); i++) {<NEW_LINE>if (i > 0) {<NEW_LINE>format.append(", ");<NEW_LINE>}<NEW_LINE>final MethodParamModel methodParam = updateStateMethod.methodParams.get(i);<NEW_LINE>if (MethodParamModelUtils.isAnnotatedWith(methodParam, Param.class)) {<NEW_LINE>final TypeName paramTypeName = methodParam.getTypeName();<NEW_LINE>if (!paramTypeName.equals(TypeName.OBJECT)) {<NEW_LINE>format.append("($T) ");<NEW_LINE>args.add(paramTypeName);<NEW_LINE>}<NEW_LINE>format.append("$L[$L]");<NEW_LINE>args.add(VAR_NAME_PARAMS);<NEW_LINE>args.add(paramIndex++);<NEW_LINE>} else {<NEW_LINE>// Must be a StateValue<.><NEW_LINE>final String name = methodParam.getName();<NEW_LINE>codeBlock.addStatement("$L = new $T()", name, methodParam.getTypeName()).<MASK><NEW_LINE>format.append("$L");<NEW_LINE>args.add(name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>format.append(')');<NEW_LINE>codeBlock.addStatement(format.toString(), args.toArray());<NEW_LINE>for (int i = 0; i < updateStateMethod.methodParams.size(); i++) {<NEW_LINE>final MethodParamModel methodParam = updateStateMethod.methodParams.get(i);<NEW_LINE>if (MethodParamModelUtils.isAnnotatedWith(methodParam, Param.class)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final String name = methodParam.getName();<NEW_LINE>codeBlock.addStatement("this.$L = $L.get()", name, name);<NEW_LINE>}<NEW_LINE>codeBlock.addStatement("break$<");<NEW_LINE>return codeBlock.build();<NEW_LINE>}
addStatement("$L.set(this.$L)", name, name);
607,881
public void deleteHistory(Model model, String timeBucketColumnName, int ttl) {<NEW_LINE>ElasticSearchClient client = getClient();<NEW_LINE>if (!model.isRecord()) {<NEW_LINE>if (!DownSampling.Minute.equals(model.getDownsampling())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long deadline = Long.parseLong(new DateTime().plusDays(-ttl).toString("yyyyMMdd"));<NEW_LINE>String tableName = IndexController.INSTANCE.getTableName(model);<NEW_LINE>Collection<String> indices = client.retrievalIndexByAliases(tableName);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Deadline = {}, indices = {}, ttl = {}", deadline, indices, ttl);<NEW_LINE>}<NEW_LINE>List<String> prepareDeleteIndexes = new ArrayList<>();<NEW_LINE>List<String> leftIndices = new ArrayList<>();<NEW_LINE>for (String index : indices) {<NEW_LINE>long timeSeries = TimeSeriesUtils.isolateTimeFromIndexName(index);<NEW_LINE>if (deadline >= timeSeries) {<NEW_LINE>prepareDeleteIndexes.add(index);<NEW_LINE>} else {<NEW_LINE>leftIndices.add(index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Indices to be deleted: {}", prepareDeleteIndexes);<NEW_LINE>}<NEW_LINE>for (String prepareDeleteIndex : prepareDeleteIndexes) {<NEW_LINE>client.deleteByIndexName(prepareDeleteIndex);<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>String formattedLatestIndex = client.formatIndexName(latestIndex);<NEW_LINE>if (!leftIndices.contains(formattedLatestIndex)) {<NEW_LINE>client.createIndex(latestIndex);<NEW_LINE>}<NEW_LINE>}
latestIndex = TimeSeriesUtils.latestWriteIndexName(model);
844,861
protected boolean isDelimiter(String peek, ParserContext context, int col, int colIgnoringWhitespace) {<NEW_LINE>Delimiter delimiter = context.getDelimiter();<NEW_LINE>if (peek.startsWith(delimiter.getEscape() + delimiter.getDelimiter())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (delimiter.shouldBeAloneOnLine()) {<NEW_LINE>// Only consider alone-on-line delimiters (such as "/" for PL/SQL) if<NEW_LINE>// it's the first character on the line<NEW_LINE>if (colIgnoringWhitespace == 1 && peek == delimiter.getDelimiter()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (colIgnoringWhitespace != 1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (colIgnoringWhitespace == 1 && "/".equals(peek.trim())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.isDelimiter(<MASK><NEW_LINE>}
peek, context, col, colIgnoringWhitespace);
908,306
protected void initDisplayOptions(Options displayOptions) {<NEW_LINE>// display options for local variables handled by FieldFactory base class<NEW_LINE>colorOptionName = "Variable Color";<NEW_LINE>styleOptionName = "Variable Style";<NEW_LINE>super.initDisplayOptions();<NEW_LINE>parameterFieldOptions = new ParameterFieldOptions[2];<NEW_LINE>parameterFieldOptions[CUSTOM_PARAM_INDEX] <MASK><NEW_LINE>parameterFieldOptions[DYNAMIC_PARAM_INDEX] = new ParameterFieldOptions(OptionsGui.PARAMETER_DYNAMIC);<NEW_LINE>for (int i = 0; i < 2; i++) {<NEW_LINE>parameterFieldOptions[i].color = displayOptions.getColor(parameterFieldOptions[i].getColorOptionName(), parameterFieldOptions[i].getDefaultColor());<NEW_LINE>parameterFieldOptions[i].style = displayOptions.getInt(parameterFieldOptions[i].getStyleOptionName(), -1);<NEW_LINE>setMetrics(baseFont, parameterFieldOptions[i]);<NEW_LINE>}<NEW_LINE>}
= new ParameterFieldOptions(OptionsGui.PARAMETER_CUSTOM);
765,469
public void run() {<NEW_LINE>CassandraConnector connector = new CassandraConnector();<NEW_LINE>connector.connect("127.0.0.1", 9042, "datacenter1");<NEW_LINE>CqlSession session = connector.getSession();<NEW_LINE><MASK><NEW_LINE>keyspaceRepository.createKeyspace("testKeyspace", 1);<NEW_LINE>keyspaceRepository.useKeyspace("testKeyspace");<NEW_LINE>ProductRepository productRepository = new ProductRepository(session);<NEW_LINE>productRepository.createProductTable("testKeyspace");<NEW_LINE>productRepository.createProductByIdTable("testKeyspace");<NEW_LINE>productRepository.createProductByIdTable("testKeyspace");<NEW_LINE>Product product = getProduct();<NEW_LINE>productRepository.insertProductBatch(product);<NEW_LINE>Product productV1 = getProduct();<NEW_LINE>Product productV2 = getProduct();<NEW_LINE>productRepository.insertProductVariantBatch(productV1, productV2);<NEW_LINE>List<Product> products = productRepository.selectAllProduct("testKeyspace");<NEW_LINE>products.forEach(x -> LOG.info(x.toString()));<NEW_LINE>connector.close();<NEW_LINE>}
KeyspaceRepository keyspaceRepository = new KeyspaceRepository(session);
700,954
protected JPanel positionTab() {<NEW_LINE>JPanel panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::]", ""));<NEW_LINE>// // Radial position<NEW_LINE>// // Radial distance:<NEW_LINE>panel.add(new JLabel(trans.get("MassComponentCfg.lbl.Radialdistance")));<NEW_LINE>DoubleModel m = new DoubleModel(component, "RadialPosition", UnitGroup.UNITS_LENGTH, 0);<NEW_LINE>JSpinner spin = new JSpinner(m.getSpinnerModel());<NEW_LINE>spin.setEditor(new SpinnerEditor(spin));<NEW_LINE>panel.add(spin, "growx");<NEW_LINE>panel.add(new UnitSelector(m), "growx");<NEW_LINE>panel.add(new BasicSlider(m.getSliderModel(0, 0.1, 1.0)), "w 100lp, wrap");<NEW_LINE>// // Radial direction:<NEW_LINE>panel.add(new JLabel(trans.get("MassComponentCfg.lbl.Radialdirection")));<NEW_LINE>m = new DoubleModel(<MASK><NEW_LINE>spin = new JSpinner(m.getSpinnerModel());<NEW_LINE>spin.setEditor(new SpinnerEditor(spin));<NEW_LINE>panel.add(spin, "growx");<NEW_LINE>panel.add(new UnitSelector(m), "growx");<NEW_LINE>panel.add(new BasicSlider(m.getSliderModel(-Math.PI, Math.PI)), "w 100lp, wrap");<NEW_LINE>// // Reset button<NEW_LINE>JButton button = new SelectColorButton(trans.get("MassComponentCfg.but.Reset"));<NEW_LINE>button.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>((MassComponent) component).setRadialDirection(0.0);<NEW_LINE>((MassComponent) component).setRadialPosition(0.0);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>panel.add(button, "spanx, right");<NEW_LINE>return panel;<NEW_LINE>}
component, "RadialDirection", UnitGroup.UNITS_ANGLE);
37,177
static ByteBuf encodeMetadataHeader(ByteBufAllocator allocator, String customMime, int metadataLength) {<NEW_LINE>ByteBuf metadataHeader = allocator.buffer(4 + customMime.length());<NEW_LINE>// reserve 1 byte for the customMime length<NEW_LINE>// /!\ careful not to read that first byte, which is random at this point<NEW_LINE>int writerIndexInitial = metadataHeader.writerIndex();<NEW_LINE>metadataHeader.writerIndex(writerIndexInitial + 1);<NEW_LINE>// write the custom mime in UTF8 but validate it is all ASCII-compatible<NEW_LINE>// (which produces the right result since ASCII chars are still encoded on 1 byte in UTF8)<NEW_LINE>int customMimeLength = ByteBufUtil.writeUtf8(metadataHeader, customMime);<NEW_LINE>if (!ByteBufUtil.isText(metadataHeader, metadataHeader.readerIndex() + 1, customMimeLength, CharsetUtil.US_ASCII)) {<NEW_LINE>metadataHeader.release();<NEW_LINE>throw new IllegalArgumentException("custom mime type must be US_ASCII characters only");<NEW_LINE>}<NEW_LINE>if (customMimeLength < 1 || customMimeLength > 128) {<NEW_LINE>metadataHeader.release();<NEW_LINE>throw new IllegalArgumentException("custom mime type must have a strictly positive length that fits on 7 unsigned bits, ie 1-128");<NEW_LINE>}<NEW_LINE>metadataHeader.markWriterIndex();<NEW_LINE>// go back to beginning and write the length<NEW_LINE>// encoded length is one less than actual length, since 0 is never a valid length, which gives<NEW_LINE>// wider representation range<NEW_LINE>metadataHeader.writerIndex(writerIndexInitial);<NEW_LINE>metadataHeader.writeByte(customMimeLength - 1);<NEW_LINE>// go back to post-mime type and write the metadata content length<NEW_LINE>metadataHeader.resetWriterIndex();<NEW_LINE><MASK><NEW_LINE>return metadataHeader;<NEW_LINE>}
NumberUtils.encodeUnsignedMedium(metadataHeader, metadataLength);
620,656
protected void filterDirectory(List<String> dirContent, DirPattern dirPattern, String parentPath) throws IOException {<NEW_LINE>// setup the working directory<NEW_LINE>File workingDirectory = new File(source, parentPath);<NEW_LINE>// If the directory doesn't exist, we should not archive it.<NEW_LINE>if (workingDirectory.exists()) {<NEW_LINE>// List, filter, and add the files<NEW_LINE>File[] dirListing = workingDirectory.listFiles();<NEW_LINE>if (dirListing != null) {<NEW_LINE>for (int i = 0; i < dirListing.length; i++) {<NEW_LINE>File file = dirListing[i];<NEW_LINE>boolean includeFileInArchive;<NEW_LINE>if (dirPattern.getStrategy() == PatternStrategy.IncludePreference) {<NEW_LINE>includeFileInArchive = DirPattern.includePreference(file, dirPattern.getExcludePatterns(), dirPattern.getIncludePatterns(), dirPattern.includeByDefault);<NEW_LINE>} else {<NEW_LINE>includeFileInArchive = DirPattern.excludePreference(file, dirPattern.getExcludePatterns(), dirPattern.getIncludePatterns(), dirPattern.includeByDefault);<NEW_LINE>}<NEW_LINE>if (includeFileInArchive) {<NEW_LINE>// Add the entry<NEW_LINE>dirContent.add(<MASK><NEW_LINE>}<NEW_LINE>// Recurse into directories<NEW_LINE>if (file.isDirectory()) {<NEW_LINE>filterDirectory(dirContent, dirPattern, parentPath + file.getName() + "/");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
parentPath + file.getName());
1,288,767
public final // JPA2.g:542:1: entity_type_literal : WORD ;<NEW_LINE>JPA2Parser.entity_type_literal_return entity_type_literal() throws RecognitionException {<NEW_LINE>JPA2Parser.entity_type_literal_return retval = new JPA2Parser.entity_type_literal_return();<NEW_LINE>retval.start = input.LT(1);<NEW_LINE>Object root_0 = null;<NEW_LINE>Token WORD628 = null;<NEW_LINE>Object WORD628_tree = null;<NEW_LINE>try {<NEW_LINE>// JPA2.g:543:5: ( WORD )<NEW_LINE>// JPA2.g:543:7: WORD<NEW_LINE>{<NEW_LINE>root_0 = (Object) adaptor.nil();<NEW_LINE>WORD628 = (Token) match(input, WORD, FOLLOW_WORD_in_entity_type_literal4973);<NEW_LINE>if (state.failed)<NEW_LINE>return retval;<NEW_LINE>if (state.backtracking == 0) {<NEW_LINE>WORD628_tree = (Object) adaptor.create(WORD628);<NEW_LINE>adaptor.addChild(root_0, WORD628_tree);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>retval.stop = input.LT(-1);<NEW_LINE>if (state.backtracking == 0) {<NEW_LINE>retval.tree = (Object) adaptor.rulePostProcessing(root_0);<NEW_LINE>adaptor.setTokenBoundaries(retval.tree, <MASK><NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>reportError(re);<NEW_LINE>recover(input, re);<NEW_LINE>retval.tree = (Object) adaptor.errorNode(input, retval.start, input.LT(-1), re);<NEW_LINE>} finally {<NEW_LINE>// do for sure before leaving<NEW_LINE>}<NEW_LINE>return retval;<NEW_LINE>}
retval.start, retval.stop);
881,990
/*<NEW_LINE>* RunningQuery factory.<NEW_LINE>*/<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>protected AbstractRunningQuery newRunningQuery(/*final QueryEngine queryEngine,*/<NEW_LINE>final UUID queryId, final boolean controller, final IQueryClient clientProxy, final UUID queryControllerId, final PipelineOp query, final IChunkMessage<IBindingSet> realSource) {<NEW_LINE>final String className = query.getProperty(Annotations.RUNNING_QUERY_CLASS, Annotations.DEFAULT_RUNNING_QUERY_CLASS);<NEW_LINE>final Class<IRunningQuery> cls;<NEW_LINE>try {<NEW_LINE>cls = (Class<IRunningQuery>) Class.forName(className);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new RuntimeException("Bad option: " + Annotations.RUNNING_QUERY_CLASS, e);<NEW_LINE>}<NEW_LINE>if (!IRunningQuery.class.isAssignableFrom(cls)) {<NEW_LINE>throw new RuntimeException(Annotations.RUNNING_QUERY_CLASS + ": Must extend: " + IRunningQuery.class.getName());<NEW_LINE>}<NEW_LINE>final IRunningQuery runningQuery;<NEW_LINE>try {<NEW_LINE>final Constructor<? extends IRunningQuery> ctor = cls.getConstructor(new Class[] { QueryEngine.class, UUID.class, Boolean.TYPE, IQueryClient.class, PipelineOp<MASK><NEW_LINE>// save reference.<NEW_LINE>runningQuery = ctor.newInstance(new Object[] { this, queryId, controller, clientProxy, query, realSource });<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>return (AbstractRunningQuery) runningQuery;<NEW_LINE>// return new ChunkedRunningQuery(this, queryId, true/* controller */,<NEW_LINE>// this/* clientProxy */, query);<NEW_LINE>}
.class, IChunkMessage.class });
1,492,189
public void resourceChanged(IResourceChangeEvent event) {<NEW_LINE>try {<NEW_LINE>if (event.getDelta() == null && event.getSource() != ResourcesPlugin.getWorkspace()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<IPath, IProject> renamedFrom = new HashMap<>();<NEW_LINE>Map<IPath, IProject> renamedTo = new HashMap<>();<NEW_LINE>List<IProject> removedProjects = new ArrayList<>();<NEW_LINE>for (IResourceDelta delta : event.getDelta().getAffectedChildren(IResourceDelta.CHANGED | IResourceDelta.ADDED | IResourceDelta.REMOVED)) {<NEW_LINE>IResource resource = delta.getResource();<NEW_LINE>if (resource instanceof IProject) {<NEW_LINE>IProject project = (IProject) resource;<NEW_LINE>if (delta.getKind() == IResourceDelta.REMOVED) {<NEW_LINE>if ((delta.getFlags() & IResourceDelta.MOVED_TO) != 0) {<NEW_LINE>renamedFrom.put(delta.getMovedToPath(), project);<NEW_LINE>} else {<NEW_LINE>removedProjects.add(project);<NEW_LINE>}<NEW_LINE>} else if (delta.getKind() == IResourceDelta.ADDED && (delta.getFlags() & IResourceDelta.MOVED_FROM) != 0) {<NEW_LINE>renamedTo.put(project.getFullPath(), project);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<CloudAppDashElement> appsToRefresh = new ArrayList<>();<NEW_LINE>for (IProject project : removedProjects) {<NEW_LINE>CloudAppDashElement app = getApplication(project);<NEW_LINE>if (app != null && app.setProject(null)) {<NEW_LINE>appsToRefresh.add(app);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<IPath, IProject> entry : renamedFrom.entrySet()) {<NEW_LINE>IPath path = entry.getKey();<NEW_LINE>IProject oldProject = entry.getValue();<NEW_LINE>IProject <MASK><NEW_LINE>if (oldProject != null) {<NEW_LINE>CloudAppDashElement app = getApplication(oldProject);<NEW_LINE>if (app != null && app.setProject(newProject)) {<NEW_LINE>appsToRefresh.add(app);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (CloudAppDashElement app : appsToRefresh) {<NEW_LINE>notifyElementChanged(app, "resourceChanged");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.log(e);<NEW_LINE>}<NEW_LINE>}
newProject = renamedTo.get(path);
335,566
protected void read(Node node) {<NEW_LINE>String nodeName;<NEW_LINE>boolean ignoreUnknown = false;<NEW_LINE>boolean keepText = false;<NEW_LINE>if (peekCurrent() instanceof AnyNode || peekCurrent() instanceof Documentation || peekCurrent() instanceof AppInfo || peekCurrent() instanceof TextNode) {<NEW_LINE>keepText = true;<NEW_LINE>ignoreUnknown = true;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>AnyNode anyNode = new AnyNode("dummy1", "dummy2");<NEW_LINE>// NOI18N<NEW_LINE>TextNode textNode = new TextNode("dummy");<NEW_LINE>NodeList children = node.getChildNodes();<NEW_LINE>for (int i = 0; i < children.getLength(); ++i) {<NEW_LINE>Node childNode = children.item(i);<NEW_LINE>if (childNode instanceof org.w3c.dom.Element) {<NEW_LINE>org.w3c.dom.Element childElement = (org.w3c.dom.Element) childNode;<NEW_LINE>// nodeName = childElement.getNodeName().intern();<NEW_LINE>nodeName = childElement<MASK><NEW_LINE>// System.out.println("Found a "+nodeName);<NEW_LINE>ElementExpr ee = getSampleNode(nodeName);<NEW_LINE>if (ee == null) {<NEW_LINE>if (!ignoreUnknown)<NEW_LINE>System.out.println("SchemaRep Warning: unknown node at " + getXPathExpr(childElement));<NEW_LINE>anyNode.readSchema(childElement);<NEW_LINE>} else {<NEW_LINE>ee.readSchema(childElement);<NEW_LINE>}<NEW_LINE>} else if (keepText && childNode instanceof Text) {<NEW_LINE>textNode.readSchema((Text) childNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getLocalName().intern();
711,275
private EncryptionPolicy selectPolicy(byte[] crypto_provide, EncryptionPolicy localEncryptionPolicy) {<NEW_LINE>boolean plaintextProvided = (crypto_provide[3] & 0x01) == 0x01;<NEW_LINE>boolean encryptionProvided = (crypto_provide[3] & 0x02) == 0x02;<NEW_LINE>EncryptionPolicy selected = null;<NEW_LINE>if (plaintextProvided || encryptionProvided) {<NEW_LINE>switch(localEncryptionPolicy) {<NEW_LINE>case REQUIRE_PLAINTEXT:<NEW_LINE>{<NEW_LINE>if (plaintextProvided) {<NEW_LINE>selected = EncryptionPolicy.REQUIRE_PLAINTEXT;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case PREFER_PLAINTEXT:<NEW_LINE>{<NEW_LINE>selected = plaintextProvided ? EncryptionPolicy.REQUIRE_PLAINTEXT : EncryptionPolicy.REQUIRE_ENCRYPTED;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case PREFER_ENCRYPTED:<NEW_LINE>{<NEW_LINE>selected = encryptionProvided <MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case REQUIRE_ENCRYPTED:<NEW_LINE>{<NEW_LINE>if (encryptionProvided) {<NEW_LINE>selected = EncryptionPolicy.REQUIRE_ENCRYPTED;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new IllegalStateException("Unknown encryption policy: " + localEncryptionPolicy.name());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (selected == null) {<NEW_LINE>throw new IllegalStateException("Failed to negotiate the encryption policy: local policy (" + localEncryptionPolicy.name() + "), peer's policy (" + Arrays.toString(crypto_provide) + ")");<NEW_LINE>}<NEW_LINE>return selected;<NEW_LINE>}
? EncryptionPolicy.REQUIRE_ENCRYPTED : EncryptionPolicy.REQUIRE_PLAINTEXT;
183,616
public StateMachineModel<String, String> build() {<NEW_LINE>ResourcerResolver resourceResolver = null;<NEW_LINE>if (this.location != null) {<NEW_LINE>resourceResolver = new ResourcerResolver(getResourceLoader(), location, additionalLocations);<NEW_LINE>} else if (this.resource != null) {<NEW_LINE>resourceResolver = new ResourcerResolver(resource, additionalResources);<NEW_LINE>}<NEW_LINE>Holder holder = null;<NEW_LINE>Model model = null;<NEW_LINE>org.eclipse.emf.ecore.resource.Resource resource = null;<NEW_LINE>try {<NEW_LINE>Holder[] resources = resourceResolver.resolve();<NEW_LINE>holder = resources != null && resources.length > 0 ? resources[0] : null;<NEW_LINE>resource = UmlUtils.getResource(holder.uri.getPath());<NEW_LINE>model = (Model) EcoreUtil.getObjectByType(resource.getContents(), UMLPackage.Literals.MODEL);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalArgumentException("Cannot build build model from resource " + resource + " or location " + location, e);<NEW_LINE>} finally {<NEW_LINE>// if we have a path, tmp file were created, clean it<NEW_LINE>if (holder != null && holder.path != null) {<NEW_LINE>try {<NEW_LINE>Files.deleteIfExists(holder.path);<NEW_LINE>} catch (Exception e2) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>UmlModelParser parser = new UmlModelParser(model, this);<NEW_LINE>DataHolder dataHolder = parser.parseModel();<NEW_LINE>// clean up<NEW_LINE>if (resource != null) {<NEW_LINE>try {<NEW_LINE>resource.unload();<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (holder != null && holder.path != null) {<NEW_LINE>try {<NEW_LINE>Files.deleteIfExists(holder.path);<NEW_LINE>} catch (Exception e2) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// we don't set configurationData here, so assume null<NEW_LINE>return new DefaultStateMachineModel<String, String>(null, dataHolder.getStatesData(<MASK><NEW_LINE>}
), dataHolder.getTransitionsData());
1,827,594
public void call(ClientSide clientSide, String data) {<NEW_LINE>Room room = ServerContains.getRoom(clientSide.getRoomId());<NEW_LINE>LinkedList<ClientSide> roomClientList = room.getClientSideList();<NEW_LINE>// Send the points of poker<NEW_LINE>List<List<Poker>> pokersList = PokerHelper.distributePoker();<NEW_LINE>int cursor = 0;<NEW_LINE>for (ClientSide client : roomClientList) {<NEW_LINE>client.setPokers(pokersList.get(cursor++));<NEW_LINE>}<NEW_LINE>room.setLandlordPokers<MASK><NEW_LINE>// Push information about the robber<NEW_LINE>int startGrabIndex = (int) (Math.random() * 3);<NEW_LINE>ClientSide startGrabClient = roomClientList.get(startGrabIndex);<NEW_LINE>room.setCurrentSellClient(startGrabClient.getId());<NEW_LINE>// Push start game messages<NEW_LINE>room.setStatus(RoomStatus.STARTING);<NEW_LINE>room.setCreateTime(System.currentTimeMillis());<NEW_LINE>room.setLastFlushTime(System.currentTimeMillis());<NEW_LINE>// Record the first speaker<NEW_LINE>room.setFirstSellClient(startGrabClient.getId());<NEW_LINE>List<List<Poker>> otherPokers = new ArrayList<>();<NEW_LINE>for (ClientSide client : roomClientList) {<NEW_LINE>client.setType(ClientType.PEASANT);<NEW_LINE>client.setStatus(ClientStatus.PLAYING);<NEW_LINE>for (ClientSide otherClient : roomClientList) {<NEW_LINE>if (otherClient.getId() != client.getId()) {<NEW_LINE>otherPokers.add(otherClient.getPokers());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String lastCards = LastCardsUtils.getLastCards(otherPokers);<NEW_LINE>otherPokers = new ArrayList<>();<NEW_LINE>String result = MapHelper.newInstance().put("roomId", room.getId()).put("roomOwner", room.getRoomOwner()).put("roomClientCount", room.getClientSideList().size()).put("nextClientNickname", startGrabClient.getNickname()).put("nextClientId", startGrabClient.getId()).put("pokers", client.getPokers()).put("lastPokers", lastCards).json();<NEW_LINE>if (client.getRole() == ClientRole.PLAYER) {<NEW_LINE>ChannelUtils.pushToClient(client.getChannel(), ClientEventCode.CODE_GAME_STARTING, result);<NEW_LINE>} else {<NEW_LINE>if (startGrabClient.getId() == client.getId()) {<NEW_LINE>RobotEventListener.get(ClientEventCode.CODE_GAME_LANDLORD_ELECT).call(client, result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>notifyWatcherGameStart(room);<NEW_LINE>}
(pokersList.get(3));
1,674,009
public void failTasksForWorker(long workerId) {<NEW_LINE>synchronized (mPlanInfo) {<NEW_LINE>if (mPlanInfo.getStatus().isFinished()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Long> <MASK><NEW_LINE>if (taskIds == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean statusChanged = false;<NEW_LINE>for (Long taskId : taskIds) {<NEW_LINE>TaskInfo taskInfo = mPlanInfo.getTaskInfo(taskId);<NEW_LINE>if (taskInfo == null || taskInfo.getStatus().isFinished()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>taskInfo.setStatus(Status.FAILED);<NEW_LINE>taskInfo.setErrorType("JobWorkerLost");<NEW_LINE>taskInfo.setErrorMessage(String.format("Job worker(%s) was lost before " + "the task(%d) could complete", taskInfo.getWorkerHost(), taskId));<NEW_LINE>statusChanged = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (statusChanged) {<NEW_LINE>updateStatus();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
taskIds = mWorkerIdToTaskIds.get(workerId);
416,524
protected void doClose() throws Throwable {<NEW_LINE>final long st = System.currentTimeMillis();<NEW_LINE>try {<NEW_LINE>if (channel != null) {<NEW_LINE>// unbind.<NEW_LINE>channel.close();<NEW_LINE>channel = null;<NEW_LINE>}<NEW_LINE>if (channelGroup != null) {<NEW_LINE>ChannelGroupFuture closeFuture = channelGroup.close();<NEW_LINE>closeFuture.await(serverShutdownTimeoutMills);<NEW_LINE>}<NEW_LINE>final long cost = System.currentTimeMillis() - st;<NEW_LINE>logger.info("Port unification server closed. cost:" + cost);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>for (WireProtocol protocol : protocols) {<NEW_LINE>protocol.close();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (bootstrap != null) {<NEW_LINE>long timeout = serverShutdownTimeoutMills;<NEW_LINE>long quietPeriod = Math.min(2000L, timeout);<NEW_LINE>Future<?> bossGroupShutdownFuture = bossGroup.shutdownGracefully(quietPeriod, timeout, MILLISECONDS);<NEW_LINE>Future<?> workerGroupShutdownFuture = workerGroup.shutdownGracefully(quietPeriod, timeout, MILLISECONDS);<NEW_LINE>bossGroupShutdownFuture.awaitUninterruptibly(timeout, MILLISECONDS);<NEW_LINE>workerGroupShutdownFuture.awaitUninterruptibly(timeout, MILLISECONDS);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>logger.warn(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
logger.warn("Interrupted while shutting down", e);
712,049
public CompletableFuture<byte[]> readMemory(long addr, int len) {<NEW_LINE>AssertionError defaultErr = new AssertionError("No data available even after a successful read?");<NEW_LINE>AtomicReference<Throwable> exc = new AtomicReference<>(defaultErr);<NEW_LINE>// Msg.debug(this, "Reading " + len + " bytes at " + Long.toUnsignedString(addr, 16));<NEW_LINE>return waitForReads(addr, len).handle((v, e) -> {<NEW_LINE>int available = memory.contiguousAvailableAfter(addr);<NEW_LINE>if (available == 0) {<NEW_LINE>if (e == null) {<NEW_LINE>// TODO: This is happening. Fix it!<NEW_LINE>throw new AssertionError("No data available at " + Long.toUnsignedString<MASK><NEW_LINE>} else {<NEW_LINE>return ExceptionUtils.rethrow(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (e != null && !isTimeout(e)) {<NEW_LINE>Msg.error(this, "Some reads requested by the cache failed. Returning a partial result: " + exc.get());<NEW_LINE>}<NEW_LINE>byte[] result = new byte[Math.min(len, available)];<NEW_LINE>memory.getData(addr, result);<NEW_LINE>return result;<NEW_LINE>});<NEW_LINE>}
(addr, 16) + " even after a successful read?");
1,287,617
protected void acquireExclusiveLock() {<NEW_LINE>if (concurrent)<NEW_LINE>if (timeout > 0) {<NEW_LINE>try {<NEW_LINE>if (lock.writeLock().tryLock(timeout, TimeUnit.MILLISECONDS))<NEW_LINE>// OK<NEW_LINE>return;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>if (ignoreThreadInterruption) {<NEW_LINE>// IGNORE THE THREAD IS INTERRUPTED: TRY TO RE-LOCK AGAIN<NEW_LINE>try {<NEW_LINE>if (lock.writeLock().tryLock(timeout, TimeUnit.MILLISECONDS)) {<NEW_LINE>// OK, RESET THE INTERRUPTED STATE<NEW_LINE>Thread<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ignore) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final OLockException exception = new OLockException("Thread interrupted while waiting for resource of class '" + getClass() + "' with timeout=" + timeout);<NEW_LINE>throw OException.wrapException(exception, e);<NEW_LINE>}<NEW_LINE>throwTimeoutException(lock.writeLock());<NEW_LINE>} else {<NEW_LINE>lock.writeLock().lock();<NEW_LINE>}<NEW_LINE>}
.currentThread().interrupt();
753,088
public DescribeJobTemplateResult describeJobTemplate(DescribeJobTemplateRequest describeJobTemplateRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeJobTemplateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeJobTemplateRequest> request = null;<NEW_LINE>Response<DescribeJobTemplateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new <MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DescribeJobTemplateResult, JsonUnmarshallerContext> unmarshaller = new DescribeJobTemplateResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DescribeJobTemplateResult> responseHandler = new JsonResponseHandler<DescribeJobTemplateResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
DescribeJobTemplateRequestMarshaller().marshall(describeJobTemplateRequest);
1,073,026
private Object toCommon(Class srcClass, Class targetClass, BigDecimal value) {<NEW_LINE>if (targetClass == srcClass) {<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>if (targetClass == Double.class || targetClass == double.class || targetClass == Float.class || targetClass == float.class) {<NEW_LINE>return toCommon(srcClass, <MASK><NEW_LINE>}<NEW_LINE>if (targetClass == Decimal.class) {<NEW_LINE>return Decimal.fromBigDecimal(value);<NEW_LINE>}<NEW_LINE>if (value.precision() - value.scale() > 100) {<NEW_LINE>throw new ConvertorException("BigDecimal overflow: [" + value.toString() + "]");<NEW_LINE>}<NEW_LINE>if (targetClass == BigInteger.class) {<NEW_LINE>return value.setScale(0, BigDecimal.ROUND_HALF_UP).toBigInteger();<NEW_LINE>}<NEW_LINE>BigDecimal rounded = value.setScale(0, BigDecimal.ROUND_HALF_UP);<NEW_LINE>return toCommon(srcClass, targetClass, rounded.longValue());<NEW_LINE>}
targetClass, value.doubleValue());
1,235,615
private boolean isClinitAlreadyDesugared(ImmutableList<String> companionsToAccessToTriggerInterfaceClinit) {<NEW_LINE>InsnList instructions = clInitMethodNode.instructions;<NEW_LINE>if (instructions.size() <= companionsToAccessToTriggerInterfaceClinit.size()) {<NEW_LINE>// The <clinit> must end with RETURN, so if the instruction count is less than or equal to<NEW_LINE>// the companion class count, this <clinit> has not been desugared.<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Iterator<AbstractInsnNode<MASK><NEW_LINE>for (String companion : companionsToAccessToTriggerInterfaceClinit) {<NEW_LINE>if (!iterator.hasNext()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>AbstractInsnNode insn = iterator.next();<NEW_LINE>if (!(insn instanceof MethodInsnNode)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>MethodInsnNode methodInsnNode = (MethodInsnNode) insn;<NEW_LINE>if (methodInsnNode.getOpcode() != Opcodes.INVOKESTATIC || !methodInsnNode.owner.equals(companion) || !methodInsnNode.name.equals(InterfaceDesugaring.COMPANION_METHOD_TO_TRIGGER_INTERFACE_CLINIT_NAME)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>checkState(methodInsnNode.desc.equals(InterfaceDesugaring.COMPANION_METHOD_TO_TRIGGER_INTERFACE_CLINIT_DESC), "Inconsistent method desc: %s vs %s", methodInsnNode.desc, InterfaceDesugaring.COMPANION_METHOD_TO_TRIGGER_INTERFACE_CLINIT_DESC);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
> iterator = instructions.iterator();
1,274,817
public static <T> SizeEstimator<T> create(DataType<?> type) {<NEW_LINE>switch(type.id()) {<NEW_LINE>case UndefinedType.ID:<NEW_LINE>return (SizeEstimator<T>) new ConstSizeEstimator(UNKNOWN_DEFAULT_RAM_BYTES_USED);<NEW_LINE>case ObjectType.ID:<NEW_LINE>case GeoShapeType.ID:<NEW_LINE>return (SizeEstimator<T>) new SamplingSizeEstimator<>(SAMPLE_EVERY_NTH, MapSizeEstimator.INSTANCE);<NEW_LINE>case StringType.ID:<NEW_LINE>case IpType.ID:<NEW_LINE>case JsonType.ID:<NEW_LINE>return (SizeEstimator<T>) StringSizeEstimator.INSTANCE;<NEW_LINE>case ArrayType.ID:<NEW_LINE>var innerEstimator = create(((ArrayType<?>) type).innerType());<NEW_LINE>return (SizeEstimator<T>) ArraySizeEstimator.create(innerEstimator);<NEW_LINE>case OidVectorType.ID:<NEW_LINE>return (SizeEstimator<T>) ArraySizeEstimator.create(create(DataTypes.INTEGER));<NEW_LINE>case RowType.ID:<NEW_LINE>return (SizeEstimator<T>) new RecordSizeEstimator(Lists2.map(((RowType) type).fieldTypes(), SizeEstimatorFactory::create));<NEW_LINE>case RegprocType.ID:<NEW_LINE>return (<MASK><NEW_LINE>case RegclassType.ID:<NEW_LINE>return (SizeEstimator<T>) RegclassSizeEstimator.INSTANCE;<NEW_LINE>case NumericType.ID:<NEW_LINE>return (SizeEstimator<T>) NumericSizeEstimator.INSTANCE;<NEW_LINE>default:<NEW_LINE>if (type instanceof FixedWidthType) {<NEW_LINE>return (SizeEstimator<T>) new ConstSizeEstimator(((FixedWidthType) type).fixedSize());<NEW_LINE>}<NEW_LINE>throw new UnsupportedOperationException(String.format(Locale.ENGLISH, "Cannot get SizeEstimator for type %s", type));<NEW_LINE>}<NEW_LINE>}
SizeEstimator<T>) RegprocSizeEstimator.INSTANCE;
897,632
private void unsollicitedUpdate(String data) {<NEW_LINE>// Example of<NEW_LINE>// I=00000000000000000000000000000000&O=10000000000000000000000000000000&\<NEW_LINE>// A0=0&A1=0&A2=0&A3=0&A4=0&A5=0&A6=0&A7=0&A8=0&A9=0&A10=0&A11=0&A12=0&A13=0&A14=0&A15=0&C1=47&C2=0&C3=0&C4=0&C5=0&C6=0&C7=0&C8=0<NEW_LINE>final Pattern VALIDATION_PATTERN = Pattern.compile("I=(\\d{32})&O=(\\d{32})&([AC]\\d{1,2}=\\d+&)*[^I]*");<NEW_LINE>final Matcher matcher = VALIDATION_PATTERN.matcher(data);<NEW_LINE>while (matcher.find()) {<NEW_LINE>// Workaround of an IPX800 bug<NEW_LINE>String completeCommand = matcher.group();<NEW_LINE>logger.debug("Command : " + completeCommand);<NEW_LINE>for (String command : completeCommand.split("&")) {<NEW_LINE>int <MASK><NEW_LINE>if (sepIndex == -1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String prefix = command.substring(0, sepIndex);<NEW_LINE>Ipx800PortType slotType = Ipx800PortType.getSlotByPrefix(prefix.substring(0, 1));<NEW_LINE>if (slotType == null) {<NEW_LINE>logger.error("Not supported type for now '{}'", prefix);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (sepIndex == 1) {<NEW_LINE>onBitUpdate(command.substring(sepIndex + 1), slotType);<NEW_LINE>} else {<NEW_LINE>onBitUpdate(command.substring(sepIndex + 1), slotType, Integer.parseInt(prefix.substring(1)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
sepIndex = command.indexOf("=");
476,835
private void captureImage() {<NEW_LINE>errorTextView.setVisibility(View.GONE);<NEW_LINE>Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);<NEW_LINE>// We give the camera an absolute filename/path where to put the<NEW_LINE>// picture because of bug:<NEW_LINE>// http://code.google.com/p/android/issues/detail?id=1480<NEW_LINE>// The bug appears to be fixed in Android 2.0+, but as of feb 2,<NEW_LINE>// 2010, G1 phones only run 1.6. Without specifying the path the<NEW_LINE>// images returned by the camera in 1.6 (and earlier) are ~1/4<NEW_LINE>// the size. boo.<NEW_LINE>try {<NEW_LINE>Uri uri = new ContentUriProvider().getUriForFile(getContext(), BuildConfig.APPLICATION_ID + ".provider", new File(tmpImageFilePath));<NEW_LINE>// if this gets modified, the onActivityResult in<NEW_LINE>// FormEntyActivity will also need to be updated.<NEW_LINE>intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, uri);<NEW_LINE>FileUtils.grantFilePermissions(<MASK><NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>Timber.e(e);<NEW_LINE>}<NEW_LINE>imageCaptureHandler.captureImage(intent, RequestCodes.IMAGE_CAPTURE, R.string.annotate_image);<NEW_LINE>}
intent, uri, getContext());
835,972
public static DescribeApplicationInstancesResponse unmarshall(DescribeApplicationInstancesResponse describeApplicationInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeApplicationInstancesResponse.setRequestId(_ctx.stringValue("DescribeApplicationInstancesResponse.RequestId"));<NEW_LINE>describeApplicationInstancesResponse.setMessage(_ctx.stringValue("DescribeApplicationInstancesResponse.Message"));<NEW_LINE>describeApplicationInstancesResponse.setTraceId(_ctx.stringValue("DescribeApplicationInstancesResponse.TraceId"));<NEW_LINE>describeApplicationInstancesResponse.setErrorCode(_ctx.stringValue("DescribeApplicationInstancesResponse.ErrorCode"));<NEW_LINE>describeApplicationInstancesResponse.setCode(_ctx.stringValue("DescribeApplicationInstancesResponse.Code"));<NEW_LINE>describeApplicationInstancesResponse.setSuccess(_ctx.booleanValue("DescribeApplicationInstancesResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCurrentPage(_ctx.integerValue("DescribeApplicationInstancesResponse.Data.CurrentPage"));<NEW_LINE>data.setTotalSize(_ctx.integerValue("DescribeApplicationInstancesResponse.Data.TotalSize"));<NEW_LINE>data.setPageSize(_ctx.integerValue("DescribeApplicationInstancesResponse.Data.PageSize"));<NEW_LINE>List<Instance> instances = new ArrayList<Instance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeApplicationInstancesResponse.Data.Instances.Length"); i++) {<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setCreateTimeStamp(_ctx.longValue("DescribeApplicationInstancesResponse.Data.Instances[" + i + "].CreateTimeStamp"));<NEW_LINE>instance.setVSwitchId(_ctx.stringValue("DescribeApplicationInstancesResponse.Data.Instances[" + i + "].VSwitchId"));<NEW_LINE>instance.setInstanceContainerStatus(_ctx.stringValue("DescribeApplicationInstancesResponse.Data.Instances[" + i + "].InstanceContainerStatus"));<NEW_LINE>instance.setInstanceHealthStatus(_ctx.stringValue("DescribeApplicationInstancesResponse.Data.Instances[" + i + "].InstanceHealthStatus"));<NEW_LINE>instance.setInstanceContainerRestarts(_ctx.longValue("DescribeApplicationInstancesResponse.Data.Instances[" + i + "].InstanceContainerRestarts"));<NEW_LINE>instance.setGroupId(_ctx.stringValue("DescribeApplicationInstancesResponse.Data.Instances[" + i + "].GroupId"));<NEW_LINE>instance.setInstanceContainerIp(_ctx.stringValue("DescribeApplicationInstancesResponse.Data.Instances[" + i + "].InstanceContainerIp"));<NEW_LINE>instance.setInstanceId(_ctx.stringValue("DescribeApplicationInstancesResponse.Data.Instances[" + i + "].InstanceId"));<NEW_LINE>instance.setImageUrl(_ctx.stringValue("DescribeApplicationInstancesResponse.Data.Instances[" + i + "].ImageUrl"));<NEW_LINE>instance.setPackageVersion(_ctx.stringValue<MASK><NEW_LINE>instance.setEip(_ctx.stringValue("DescribeApplicationInstancesResponse.Data.Instances[" + i + "].Eip"));<NEW_LINE>instance.setFinishTimeStamp(_ctx.longValue("DescribeApplicationInstancesResponse.Data.Instances[" + i + "].FinishTimeStamp"));<NEW_LINE>instances.add(instance);<NEW_LINE>}<NEW_LINE>data.setInstances(instances);<NEW_LINE>describeApplicationInstancesResponse.setData(data);<NEW_LINE>return describeApplicationInstancesResponse;<NEW_LINE>}
("DescribeApplicationInstancesResponse.Data.Instances[" + i + "].PackageVersion"));
963,553
public int parseContentLength() {<NEW_LINE>try {<NEW_LINE>byte[] byteBufferForContentLength = new byte[ContentLengthBufferSize];<NEW_LINE>inputStream().read(byteBufferForContentLength, 0, TWO_CRLF.length());<NEW_LINE>for (int pos = TWO_CRLF.length(); pos < ContentLengthBufferSize; pos++) {<NEW_LINE>inputStream().read(byteBufferForContentLength, pos, 1);<NEW_LINE>if (((char) byteBufferForContentLength[pos] == TWO_CRLF.charAt(3)) && ((char) byteBufferForContentLength[pos - 3] == TWO_CRLF.charAt(0)) && ((char) byteBufferForContentLength[pos - 2] == TWO_CRLF.charAt(1)) && ((char) byteBufferForContentLength[pos - 1] == TWO_CRLF.charAt(2))) {<NEW_LINE>// now make int out of byteBufferForContentLength[0:pos - 3)<NEW_LINE>return Integer.parseInt(new String(byteBufferForContentLength, 0, pos - 3));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>System.err.<MASK><NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>}
println(ex.toString());
867,458
private static BatchOperator<?> unpackBatchOp(BatchOperator<?> data, TableSchema schema) {<NEW_LINE>DataSet<Row> rows = data.getDataSet();<NEW_LINE>final TypeInformation<?>[] types = schema.getFieldTypes();<NEW_LINE>rows = rows.map(new RichMapFunction<Row, Row>() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 7791442624358724472L;<NEW_LINE><NEW_LINE>private transient CsvParser parser;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void open(Configuration parameters) throws Exception {<NEW_LINE>parser = new CsvParser(types, "^", '\'');<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Row map(Row value) throws Exception {<NEW_LINE>return parser.parse((String) value<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>return BatchOperator.fromTable(DataSetConversionUtil.toTable(data.getMLEnvironmentId(), rows, schema)).setMLEnvironmentId(data.getMLEnvironmentId());<NEW_LINE>}
.getField(1)).f1;
4,668
public void remove(final QualifiedName name, final Set<String> tags, final boolean updateUserMetadata) {<NEW_LINE>try {<NEW_LINE>final List<SqlParameterValue> params = Lists.newArrayList();<NEW_LINE>params.add(new SqlParameterValue(Types.VARCHAR, name.toString()));<NEW_LINE>jdbcTemplate.update(String.format(SQL_DELETE_TAG_ITEM_TAGS_BY_NAME_TAGS, buildParametrizedInClause(tags, params, params.size())), params.toArray());<NEW_LINE>if (updateUserMetadata) {<NEW_LINE>final TagItem tagItem = get(name);<NEW_LINE>tagItem.<MASK><NEW_LINE>final Map<String, Set<String>> data = Maps.newHashMap();<NEW_LINE>data.put(NAME_TAGS, tagItem.getValues());<NEW_LINE>userMetadataService.saveDefinitionMetadata(name, "admin", Optional.of(metacatJson.toJsonObject(data)), true);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>final String message = String.format("Failed to remove tags for name %s", name);<NEW_LINE>log.error(message, e);<NEW_LINE>throw new UserMetadataServiceException(message, e);<NEW_LINE>}<NEW_LINE>}
getValues().removeAll(tags);
1,456,464
public UpdateServicePipelineResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateServicePipelineResult updateServicePipelineResult = new UpdateServicePipelineResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return updateServicePipelineResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("pipeline", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateServicePipelineResult.setPipeline(ServicePipelineJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return updateServicePipelineResult;<NEW_LINE>}
().unmarshall(context));
891,200
// Find subtraction of 2 Matrices and store it in matrix3<NEW_LINE>public static void subtract_matrices(int[][] matrix1, int[][] matrix2) {<NEW_LINE>int index1, index2 = 0;<NEW_LINE>int[][] matrix3 = new int[matrix1.length][matrix1[0].length];<NEW_LINE>for (index1 = 0; index1 < matrix1.length; index1++) {<NEW_LINE>for (index2 = 0; index2 < matrix1[0].length; index2++) {<NEW_LINE>matrix3[index1][index2] = matrix1[index1][index2] - matrix2[index1][index2];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Print the calculated matrix<NEW_LINE>for (index1 = 0; index1 < matrix3.length; index1++) {<NEW_LINE>for (index2 = 0; index2 < matrix3[0].length; index2++) {<NEW_LINE>System.out.print(matrix3[<MASK><NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>}
index1][index2] + " ");
1,345,291
public ListThingRegistrationTaskReportsResult listThingRegistrationTaskReports(ListThingRegistrationTaskReportsRequest listThingRegistrationTaskReportsRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listThingRegistrationTaskReportsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListThingRegistrationTaskReportsRequest> request = null;<NEW_LINE>Response<ListThingRegistrationTaskReportsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListThingRegistrationTaskReportsRequestMarshaller().marshall(listThingRegistrationTaskReportsRequest);<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<ListThingRegistrationTaskReportsResult, JsonUnmarshallerContext> unmarshaller = new ListThingRegistrationTaskReportsResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListThingRegistrationTaskReportsResult> responseHandler = new JsonResponseHandler<ListThingRegistrationTaskReportsResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(<MASK><NEW_LINE>}<NEW_LINE>}
awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
1,368,232
public void marshall(CreateDevEndpointRequest createDevEndpointRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createDevEndpointRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createDevEndpointRequest.getEndpointName(), ENDPOINTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDevEndpointRequest.getRoleArn(), ROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDevEndpointRequest.getSecurityGroupIds(), SECURITYGROUPIDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDevEndpointRequest.getSubnetId(), SUBNETID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDevEndpointRequest.getPublicKey(), PUBLICKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDevEndpointRequest.getPublicKeys(), PUBLICKEYS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDevEndpointRequest.getNumberOfNodes(), NUMBEROFNODES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDevEndpointRequest.getWorkerType(), WORKERTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDevEndpointRequest.getGlueVersion(), GLUEVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDevEndpointRequest.getNumberOfWorkers(), NUMBEROFWORKERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDevEndpointRequest.getExtraPythonLibsS3Path(), EXTRAPYTHONLIBSS3PATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createDevEndpointRequest.getSecurityConfiguration(), SECURITYCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDevEndpointRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDevEndpointRequest.getArguments(), ARGUMENTS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createDevEndpointRequest.getExtraJarsS3Path(), EXTRAJARSS3PATH_BINDING);
1,363,032
/*<NEW_LINE>public Set<VariableExprToken> addLocalScope(){<NEW_LINE>return addLocalScope(false);<NEW_LINE>}<NEW_LINE><NEW_LINE>public Set<VariableExprToken> addLocalScope(boolean isRoot){<NEW_LINE>Set<VariableExprToken> local = new HashSet<VariableExprToken>();<NEW_LINE>localStack.push(local);<NEW_LINE>if (isRoot)<NEW_LINE>rootLocalStack.push(local);<NEW_LINE>return local;<NEW_LINE>}<NEW_LINE><NEW_LINE>public Set<VariableExprToken> removeLocalScope(){<NEW_LINE>Set<VariableExprToken> scope = getLocalScope();<NEW_LINE>if (rootLocalStack.peek() == scope){<NEW_LINE>rootLocalStack.pop();<NEW_LINE>} else<NEW_LINE>rootLocalStack.peek().addAll(getLocalScope());<NEW_LINE>return localStack.pop();<NEW_LINE>}<NEW_LINE><NEW_LINE>public Set<VariableExprToken> getLocalScope(){<NEW_LINE>return localStack.peek();<NEW_LINE>} */<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public <T extends Generator> T generator(Class<T> clazz) {<NEW_LINE>Generator generator = map.get(clazz);<NEW_LINE>if (generator == null)<NEW_LINE>throw new AssertionError("Generator '" + <MASK><NEW_LINE>if (generator.isSingleton())<NEW_LINE>return (T) generator;<NEW_LINE>Constructor<T> constructor = null;<NEW_LINE>try {<NEW_LINE>constructor = clazz.getConstructor(SyntaxAnalyzer.class);<NEW_LINE>return constructor.newInstance(this);<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (InstantiationException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
clazz.getName() + "' not found");
1,740,939
public static void fixServiceArgument(@NotNull YAMLKeyValue yamlKeyValue) {<NEW_LINE>YAMLKeyValue argumentsKeyValue = YamlHelper.getYamlKeyValue(yamlKeyValue, "arguments");<NEW_LINE>List<String> yamlMissingArgumentTypes = ServiceActionUtil.getYamlMissingArgumentTypes(yamlKeyValue.getProject(), ServiceActionUtil.ServiceYamlContainer.create(yamlKeyValue), false, new ContainerCollectionResolver.LazyServiceCollector(yamlKeyValue.getProject()));<NEW_LINE>if (yamlMissingArgumentTypes.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InsertServicesCallback insertServicesCallback;<NEW_LINE>if (argumentsKeyValue == null) {<NEW_LINE>// there is no "arguments" key so provide one<NEW_LINE>insertServicesCallback = new YamlCreateServiceArgumentsCallback(yamlKeyValue);<NEW_LINE>} else {<NEW_LINE>insertServicesCallback = new YamlUpdateArgumentServicesCallback(yamlKeyValue.<MASK><NEW_LINE>}<NEW_LINE>ServiceActionUtil.fixServiceArgument(yamlKeyValue.getProject(), yamlMissingArgumentTypes, insertServicesCallback);<NEW_LINE>}
getProject(), argumentsKeyValue, yamlKeyValue);
1,666,192
public List<T> doShrink(SourceOfRandomness random, T largestGeneric) {<NEW_LINE>if (largestGeneric.equals(leastMagnitude()))<NEW_LINE>return emptyList();<NEW_LINE>// We work with BigDecimal, so convert all inputs<NEW_LINE>BigDecimal largest = widen().apply(largestGeneric);<NEW_LINE>BigDecimal least = widen().apply(leastMagnitude());<NEW_LINE>List<T> results = new ArrayList<>();<NEW_LINE>// Positive numbers are considered easier than negative ones<NEW_LINE>if (negative(largestGeneric))<NEW_LINE>results.add(negate(largestGeneric));<NEW_LINE>// Try your luck by testing the smallest possible value<NEW_LINE><MASK><NEW_LINE>// Try values between smallest and largest, with smaller and smaller<NEW_LINE>// increments as we approach the largest<NEW_LINE>// Integrals are considered easier than decimals<NEW_LINE>results.addAll(shrunkenIntegrals(largest, least));<NEW_LINE>results.addAll(shrunkenDecimals(largest, least));<NEW_LINE>return results;<NEW_LINE>}
results.add(leastMagnitude());
304,182
protected void stopAllDownloads(boolean for_close, GlobalMangerProgressListener listener) {<NEW_LINE>if (for_close) {<NEW_LINE>if (progress_listener != null) {<NEW_LINE>progress_listener.reportCurrentTask(MessageText.getString("splash.unloadingTorrents"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long lastListenerUpdate = 0;<NEW_LINE>List<DownloadManager> managers = sortForStop();<NEW_LINE>int nbDownloads = managers.size();<NEW_LINE>String prefix = MessageText.getString("label.stopping.downloads");<NEW_LINE>for (int i = 0; i < nbDownloads; i++) {<NEW_LINE>DownloadManager manager = managers.get(i);<NEW_LINE>long now = SystemTime.getCurrentTime();<NEW_LINE>if (progress_listener != null && now - lastListenerUpdate > 100) {<NEW_LINE>lastListenerUpdate = now;<NEW_LINE>int currentDownload = i + 1;<NEW_LINE>progress_listener.<MASK><NEW_LINE>progress_listener.reportCurrentTask(MessageText.getString("splash.unloadingTorrent") + " " + currentDownload + " " + MessageText.getString("splash.of") + " " + nbDownloads + " : " + manager.getTorrentFileName());<NEW_LINE>}<NEW_LINE>int state = manager.getState();<NEW_LINE>if (state != DownloadManager.STATE_STOPPED && state != DownloadManager.STATE_STOPPING) {<NEW_LINE>listener.reportCurrentTask(prefix + ": " + manager.getDisplayName());<NEW_LINE>;<NEW_LINE>manager.stopIt(for_close ? DownloadManager.STATE_CLOSED : DownloadManager.STATE_STOPPED, false, false);<NEW_LINE>listener.reportPercent((i * 100) / nbDownloads);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>listener.reportPercent(100);<NEW_LINE>}
reportPercent(100 * currentDownload / nbDownloads);
758,431
public Object decodeFrame(ByteBuf frame) {<NEW_LINE>byte b0 = frame.readByte();<NEW_LINE>byte b1 = frame.readByte();<NEW_LINE>if (ProtocolConstants.MAGIC_CODE_BYTES[0] != b0 || ProtocolConstants.MAGIC_CODE_BYTES[1] != b1) {<NEW_LINE>throw new IllegalArgumentException("Unknown magic code: " + b0 + ", " + b1);<NEW_LINE>}<NEW_LINE>byte version = frame.readByte();<NEW_LINE>// TODO check version compatible here<NEW_LINE>int fullLength = frame.readInt();<NEW_LINE>short headLength = frame.readShort();<NEW_LINE>byte messageType = frame.readByte();<NEW_LINE>byte codecType = frame.readByte();<NEW_LINE>byte compressorType = frame.readByte();<NEW_LINE>int requestId = frame.readInt();<NEW_LINE>RpcMessage rpcMessage = new RpcMessage();<NEW_LINE>rpcMessage.setCodec(codecType);<NEW_LINE>rpcMessage.setId(requestId);<NEW_LINE>rpcMessage.setCompressor(compressorType);<NEW_LINE>rpcMessage.setMessageType(messageType);<NEW_LINE>// direct read head with zero-copy<NEW_LINE>int headMapLength = headLength - ProtocolConstants.V1_HEAD_LENGTH;<NEW_LINE>if (headMapLength > 0) {<NEW_LINE>Map<String, String> map = HeadMapSerializer.getInstance().decode(frame, headMapLength);<NEW_LINE>rpcMessage.getHeadMap().putAll(map);<NEW_LINE>}<NEW_LINE>// read body<NEW_LINE>if (messageType == ProtocolConstants.MSGTYPE_HEARTBEAT_REQUEST) {<NEW_LINE>rpcMessage.setBody(HeartbeatMessage.PING);<NEW_LINE>} else if (messageType == ProtocolConstants.MSGTYPE_HEARTBEAT_RESPONSE) {<NEW_LINE>rpcMessage.setBody(HeartbeatMessage.PONG);<NEW_LINE>} else {<NEW_LINE>int bodyLength = fullLength - headLength;<NEW_LINE>if (bodyLength > 0) {<NEW_LINE>byte[] bs = new byte[bodyLength];<NEW_LINE>frame.readBytes(bs);<NEW_LINE>Compressor compressor = CompressorFactory.getCompressor(compressorType);<NEW_LINE>bs = compressor.decompress(bs);<NEW_LINE>Serializer serializer = SerializerServiceLoader.load(SerializerType.getByCode(rpcMessage.getCodec()));<NEW_LINE>rpcMessage.setBody<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rpcMessage;<NEW_LINE>}
(serializer.deserialize(bs));
727,327
private <T> void genCreateObject(MethodWriter mw, String classNameType, String TYPE_OBJECT, int FEATURES, boolean fieldBased) {<NEW_LINE>final int JSON_READER = 1;<NEW_LINE>if (fieldBased) {<NEW_LINE>mw.visitVarInsn(Opcodes.ALOAD, THIS);<NEW_LINE>mw.visitVarInsn(Opcodes.ALOAD, JSON_READER);<NEW_LINE>mw.<MASK><NEW_LINE>mw.visitMethodInsn(Opcodes.INVOKEVIRTUAL, TYPE_JSON_READER, "features", "(J)J", false);<NEW_LINE>mw.visitMethodInsn(Opcodes.INVOKEVIRTUAL, classNameType, "createInstance", "(J)Ljava/lang/Object;", false);<NEW_LINE>} else {<NEW_LINE>mw.visitTypeInsn(Opcodes.NEW, TYPE_OBJECT);<NEW_LINE>mw.visitInsn(Opcodes.DUP);<NEW_LINE>mw.visitMethodInsn(Opcodes.INVOKESPECIAL, TYPE_OBJECT, "<init>", "()V", false);<NEW_LINE>}<NEW_LINE>}
visitVarInsn(Opcodes.LLOAD, FEATURES);
627,822
protected Expression asExpression(AST node) {<NEW_LINE>AST leftNode = node.getFirstChild();<NEW_LINE>Expression leftExpression = expression(leftNode);<NEW_LINE>AST rightNode = leftNode.getNextSibling();<NEW_LINE>ClassNode type = makeTypeWithArguments(rightNode);<NEW_LINE>CastExpression asExpression = CastExpression.asExpression(type, leftExpression);<NEW_LINE>asExpression.setStart(leftExpression.getStart());<NEW_LINE>asExpression.setLineNumber(leftExpression.getLineNumber());<NEW_LINE>asExpression.setColumnNumber(leftExpression.getColumnNumber());<NEW_LINE>int typeStart;<NEW_LINE>if (type.getEnd() > 0) {<NEW_LINE>typeStart = type.getStart();<NEW_LINE>asExpression.setEnd(type.getEnd());<NEW_LINE>asExpression.setLastLineNumber(type.getLastLineNumber());<NEW_LINE>asExpression.setLastColumnNumber(type.getLastColumnNumber());<NEW_LINE>} else {<NEW_LINE>SourceInfo typeNode = (SourceInfo) rightNode.getFirstChild();<NEW_LINE>typeStart = locations.findOffset(typeNode.getLine(), typeNode.getColumn());<NEW_LINE>asExpression.setEnd(locations.findOffset(typeNode.getLineLast(), typeNode.getColumnLast()));<NEW_LINE>asExpression.setLastLineNumber(typeNode.getLineLast());<NEW_LINE>asExpression.setLastColumnNumber(typeNode.getColumnLast());<NEW_LINE>}<NEW_LINE>// set the range of the type by itself<NEW_LINE>asExpression.setNameStart(typeStart);<NEW_LINE>asExpression.setNameEnd(asExpression.getEnd());<NEW_LINE>if (leftExpression instanceof VariableExpression && ((VariableExpression) leftExpression).isSuperExpression())<NEW_LINE>// GROOVY-9391<NEW_LINE>getController().addError(<MASK><NEW_LINE>// GRECLIPSE end<NEW_LINE>return asExpression;<NEW_LINE>}
new SyntaxException("Cannot cast or coerce `super`", asExpression));
190,862
// BenchMark IntStack vs ArrayDeque.<NEW_LINE>private static void benchMarkTest() {<NEW_LINE>int n = 10000000;<NEW_LINE>IntStack intStack = new IntStack(n);<NEW_LINE>// IntStack times at around 0.0324 seconds<NEW_LINE>long start = System.nanoTime();<NEW_LINE>for (int i = 0; i < n; i++) intStack.push(i);<NEW_LINE>for (int i = 0; i < n; i++) intStack.pop();<NEW_LINE>long end = System.nanoTime();<NEW_LINE>System.out.println("IntStack Time: " + (end - start) / 1e9);<NEW_LINE>// ArrayDeque times at around 1.438 seconds<NEW_LINE>// java.util.ArrayDeque<Integer> arrayDeque = new java.util.ArrayDeque<>();<NEW_LINE>// java.util.Stack<Integer> arrayDeque = new java.util.Stack<>();<NEW_LINE>// strangely the<NEW_LINE>java.util.ArrayDeque<Integer> arrayDeque = new java.util.ArrayDeque<>(n);<NEW_LINE>// ArrayQueue is slower when you give it an initial capacity.<NEW_LINE>start = System.nanoTime();<NEW_LINE>for (int i = 0; i < n; i++) arrayDeque.push(i);<NEW_LINE>for (int i = 0; i < n; i++) arrayDeque.pop();<NEW_LINE>end = System.nanoTime();<NEW_LINE>System.out.println("ArrayDeque Time: " + (end - start) / 1e9);<NEW_LINE>Stack<Integer> listStack = new ListStack<>();<NEW_LINE>start = System.nanoTime();<NEW_LINE>for (int i = 0; i < n; i++) listStack.push(i);<NEW_LINE>for (int i = 0; i < n; i++) listStack.pop();<NEW_LINE>end = System.nanoTime();<NEW_LINE>System.out.println("ListStack Time: " + <MASK><NEW_LINE>Stack<Integer> arrayStack = new ArrayStack<>();<NEW_LINE>start = System.nanoTime();<NEW_LINE>for (int i = 0; i < n; i++) arrayStack.push(i);<NEW_LINE>for (int i = 0; i < n; i++) arrayStack.pop();<NEW_LINE>end = System.nanoTime();<NEW_LINE>System.out.println("ArrayStack Time: " + (end - start) / 1e9);<NEW_LINE>}
(end - start) / 1e9);
668,535
protected DataFlowOperations dataFlowOperations() {<NEW_LINE>final RestTemplate restTemplate = DataFlowTemplate.getDefaultDataflowRestTemplate();<NEW_LINE>validateUsernamePassword(this.composedTaskProperties.getDataflowServerUsername(), this.composedTaskProperties.getDataflowServerPassword());<NEW_LINE>HttpClientConfigurer clientHttpRequestFactoryBuilder = null;<NEW_LINE>if (this.composedTaskProperties.getOauth2ClientCredentialsClientId() != null || StringUtils.hasText(this.composedTaskProperties.getDataflowServerAccessToken()) || (StringUtils.hasText(this.composedTaskProperties.getDataflowServerUsername()) && StringUtils.hasText(this.composedTaskProperties.getDataflowServerPassword()))) {<NEW_LINE>clientHttpRequestFactoryBuilder = HttpClientConfigurer.create(this.composedTaskProperties.getDataflowServerUri());<NEW_LINE>}<NEW_LINE>String accessTokenValue = null;<NEW_LINE>if (this.composedTaskProperties.getOauth2ClientCredentialsClientId() != null) {<NEW_LINE>final ClientRegistration clientRegistration = this.clientRegistrations.findByRegistrationId("default");<NEW_LINE>final OAuth2ClientCredentialsGrantRequest grantRequest = new OAuth2ClientCredentialsGrantRequest(clientRegistration);<NEW_LINE>final OAuth2AccessTokenResponse res = this.clientCredentialsTokenResponseClient.getTokenResponse(grantRequest);<NEW_LINE>accessTokenValue = res.getAccessToken().getTokenValue();<NEW_LINE>logger.debug("Configured OAuth2 Client Credentials for accessing the Data Flow Server");<NEW_LINE>} else if (StringUtils.hasText(this.composedTaskProperties.getDataflowServerAccessToken())) {<NEW_LINE>accessTokenValue <MASK><NEW_LINE>logger.debug("Configured OAuth2 Access Token for accessing the Data Flow Server");<NEW_LINE>} else if (StringUtils.hasText(this.composedTaskProperties.getDataflowServerUsername()) && StringUtils.hasText(this.composedTaskProperties.getDataflowServerPassword())) {<NEW_LINE>accessTokenValue = null;<NEW_LINE>clientHttpRequestFactoryBuilder.basicAuthCredentials(composedTaskProperties.getDataflowServerUsername(), composedTaskProperties.getDataflowServerPassword());<NEW_LINE>logger.debug("Configured basic security for accessing the Data Flow Server");<NEW_LINE>} else {<NEW_LINE>logger.debug("Not configuring basic security for accessing the Data Flow Server");<NEW_LINE>}<NEW_LINE>if (accessTokenValue != null) {<NEW_LINE>restTemplate.getInterceptors().add(new OAuth2AccessTokenProvidingClientHttpRequestInterceptor(accessTokenValue));<NEW_LINE>}<NEW_LINE>if (this.composedTaskProperties.isSkipTlsCertificateVerification()) {<NEW_LINE>if (clientHttpRequestFactoryBuilder == null) {<NEW_LINE>clientHttpRequestFactoryBuilder = HttpClientConfigurer.create(this.composedTaskProperties.getDataflowServerUri());<NEW_LINE>}<NEW_LINE>clientHttpRequestFactoryBuilder.skipTlsCertificateVerification();<NEW_LINE>}<NEW_LINE>if (clientHttpRequestFactoryBuilder != null) {<NEW_LINE>restTemplate.setRequestFactory(clientHttpRequestFactoryBuilder.buildClientHttpRequestFactory());<NEW_LINE>}<NEW_LINE>return new DataFlowTemplate(this.composedTaskProperties.getDataflowServerUri(), restTemplate);<NEW_LINE>}
= this.composedTaskProperties.getDataflowServerAccessToken();
1,183,164
public void showHint(@Nonnull final JComponent component, @Nonnull RelativePoint p, int flags, int timeout) {<NEW_LINE>LOG.assertTrue(SwingUtilities.isEventDispatchThread());<NEW_LINE>myHideAlarm.cancelAllRequests();<NEW_LINE><MASK><NEW_LINE>final JBPopup popup = JBPopupFactory.getInstance().createComponentPopupBuilder(component, null).setRequestFocus(false).setResizable(false).setMovable(false).createPopup();<NEW_LINE>popup.show(p);<NEW_LINE>ListenerUtil.addMouseListener(component, new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mousePressed(MouseEvent e) {<NEW_LINE>myHideAlarm.cancelAllRequests();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ListenerUtil.addFocusListener(component, new FocusAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void focusGained(FocusEvent e) {<NEW_LINE>myHideAlarm.cancelAllRequests();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final HintInfo info = new HintInfo(new LightweightHint(component) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void hide() {<NEW_LINE>popup.cancel();<NEW_LINE>}<NEW_LINE>}, flags, false);<NEW_LINE>myHintsStack.add(info);<NEW_LINE>if (timeout > 0) {<NEW_LINE>Timer timer = TimerUtil.createNamedTimer("Popup timeout", timeout, event -> Disposer.dispose(popup));<NEW_LINE>timer.setRepeats(false);<NEW_LINE>timer.start();<NEW_LINE>}<NEW_LINE>}
hideHints(HIDE_BY_OTHER_HINT, false, false);
1,697,273
private void updateShowOnMap(final OsmandApplication app, final File f, final View pView, final ImageButton showOnMap) {<NEW_LINE>final <MASK><NEW_LINE>final SelectedGpxFile selected = selectedGpxHelper.getSelectedFileByPath(f.getAbsolutePath());<NEW_LINE>if (selected != null) {<NEW_LINE>showOnMap.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_show_on_map, R.color.color_distance));<NEW_LINE>showOnMap.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>selectedGpxHelper.selectGpxFile(selected.getGpxFile(), false, false);<NEW_LINE>AvailableGPXFragment.GpxInfo info = new AvailableGPXFragment.GpxInfo();<NEW_LINE>info.subfolder = "";<NEW_LINE>info.file = f;<NEW_LINE>AvailableGPXFragment.updateGpxInfoView(pView, info, app, true, null);<NEW_LINE>updateShowOnMap(app, f, v, showOnMap);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>showOnMap.setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_show_on_map));<NEW_LINE>showOnMap.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>Runnable run = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>showOnMap(GPXUtilities.loadGPXFile(f));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>run.run();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
GpxSelectionHelper selectedGpxHelper = app.getSelectedGpxHelper();