idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,684,995 | public int literalIndexForModule(final char[] moduleName) {<NEW_LINE>int index;<NEW_LINE>if ((index = this.moduleCache.putIfAbsent(moduleName, this.currentIndex)) < 0) {<NEW_LINE>// The entry doesn't exit yet<NEW_LINE>this.currentIndex++;<NEW_LINE>if ((index = -index) > 0xFFFF) {<NEW_LINE>this.classFile.referenceBinding.scope.problemReporter().noMoreAvailableSpaceInConstantPool(this.classFile.<MASK><NEW_LINE>}<NEW_LINE>// Write the tag first<NEW_LINE>int length = this.offsets.length;<NEW_LINE>if (length <= index) {<NEW_LINE>// resize<NEW_LINE>System.arraycopy(this.offsets, 0, (this.offsets = new int[index * 2]), 0, length);<NEW_LINE>}<NEW_LINE>this.offsets[index] = this.currentOffset;<NEW_LINE>writeU1(ModuleTag);<NEW_LINE>// Then the string index<NEW_LINE>int stringIndexOffset = this.currentOffset;<NEW_LINE>if (this.currentOffset + 2 >= this.poolContent.length) {<NEW_LINE>resizePoolContents(2);<NEW_LINE>}<NEW_LINE>this.currentOffset += 2;<NEW_LINE>final int stringIndex = literalIndex(moduleName);<NEW_LINE>this.poolContent[stringIndexOffset++] = (byte) (stringIndex >> 8);<NEW_LINE>this.poolContent[stringIndexOffset] = (byte) stringIndex;<NEW_LINE>}<NEW_LINE>return index;<NEW_LINE>} | referenceBinding.scope.referenceType()); |
783,593 | protected JFreeChart createXyLineChart() throws JRException {<NEW_LINE>JFreeChart jfreeChart = super.createXyLineChart();<NEW_LINE>XYPlot xyPlot = (XYPlot) jfreeChart.getPlot();<NEW_LINE>XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer) jfreeChart.getXYPlot().getRenderer();<NEW_LINE>XYLine3DRenderer line3DRenderer = new XYLine3DRenderer();<NEW_LINE>line3DRenderer.setBaseToolTipGenerator(lineRenderer.getBaseToolTipGenerator());<NEW_LINE>line3DRenderer.<MASK><NEW_LINE>line3DRenderer.setBaseStroke(new BasicStroke(2, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));<NEW_LINE>line3DRenderer.setBaseLinesVisible(lineRenderer.getBaseLinesVisible());<NEW_LINE>line3DRenderer.setBaseShapesVisible(lineRenderer.getBaseShapesVisible());<NEW_LINE>Stroke stroke = new BasicStroke(2f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);<NEW_LINE>XYDataset xyDataset = xyPlot.getDataset();<NEW_LINE>if (xyDataset != null) {<NEW_LINE>for (int i = 0; i < xyDataset.getSeriesCount(); i++) {<NEW_LINE>line3DRenderer.setSeriesStroke(i, stroke);<NEW_LINE>line3DRenderer.setSeriesLinesVisible(i, lineRenderer.getBaseLinesVisible());<NEW_LINE>line3DRenderer.setSeriesShapesVisible(i, lineRenderer.getBaseShapesVisible());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>line3DRenderer.setXOffset(2);<NEW_LINE>line3DRenderer.setYOffset(2);<NEW_LINE>line3DRenderer.setWallPaint(ChartThemesConstants.GRAY_PAINT_134);<NEW_LINE>xyPlot.setRenderer(line3DRenderer);<NEW_LINE>return jfreeChart;<NEW_LINE>} | setURLGenerator(lineRenderer.getURLGenerator()); |
1,224,404 | public static ArrayList<Integer> a(byte[] buf, byte[] target) {<NEW_LINE>ArrayList<Integer> rets = new ArrayList<>();<NEW_LINE>int[] ret = new int[1];<NEW_LINE>ret[0] = DexFlow.arrayIndexOf(buf, target, 0, buf.length);<NEW_LINE>ret[0] = DexFlow.arrayIndexOf(buf, DexFlow.int2u4le(ret[0]), 0, buf.length);<NEW_LINE>int strIdx = (ret[0] - DexFlow.readLe32<MASK><NEW_LINE>if (strIdx > 0xFFFF) {<NEW_LINE>target = DexFlow.int2u4le(strIdx);<NEW_LINE>} else {<NEW_LINE>target = DexFlow.int2u2le(strIdx);<NEW_LINE>}<NEW_LINE>int off = 0;<NEW_LINE>while (true) {<NEW_LINE>off = DexFlow.arrayIndexOf(buf, target, off + 1, buf.length);<NEW_LINE>if (off == -1) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (buf[off - 2] == (byte) 26 || /*Opcodes.OP_CONST_STRING*/<NEW_LINE>buf[off - 2] == (byte) 27) /* Opcodes.OP_CONST_STRING_JUMBO*/<NEW_LINE>{<NEW_LINE>ret[0] = off - 2;<NEW_LINE>int opcodeOffset = ret[0];<NEW_LINE>if (buf[off - 2] == (byte) 27 && strIdx < 0x10000) {<NEW_LINE>if (DexFlow.readLe32(buf, opcodeOffset + 2) != strIdx) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rets.add(opcodeOffset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rets;<NEW_LINE>} | (buf, 0x3c)) / 4; |
829,321 | protected void deleteAllCacheEntry(Set<Data> keys) {<NEW_LINE>if (isWriteThrough() && keys != null && !keys.isEmpty()) {<NEW_LINE>try (TenantControl.Closeable ctx = cacheWriter.getTenantControl().setTenant()) {<NEW_LINE>if (cacheWriter.exists()) {<NEW_LINE>Map<Object, Data> keysToDelete = createHashMap(keys.size());<NEW_LINE>for (Data key : keys) {<NEW_LINE>Object localKeyObj = dataToValue(key);<NEW_LINE>keysToDelete.put(localKeyObj, key);<NEW_LINE>}<NEW_LINE>Set<Object> keysObject = keysToDelete.keySet();<NEW_LINE>try {<NEW_LINE>cacheWriter.get().deleteAll(keysObject);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (!(e instanceof CacheWriterException)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>throw (CacheWriterException) e;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>for (Object undeletedKey : keysObject) {<NEW_LINE>Data undeletedKeyData = keysToDelete.get(undeletedKey);<NEW_LINE>keys.remove(undeletedKeyData);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | throw new CacheWriterException("Exception in CacheWriter during deleteAll", e); |
281,269 | public synchronized void beep(Map<String, Integer> propertyMap, IMethodResult result) {<NEW_LINE>if (audioTrack != null) {<NEW_LINE>try {<NEW_LINE>audioTrack.stop();<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>Logger.D(TAG, "AudioTrack did not need to be stopped here");<NEW_LINE>} finally {<NEW_LINE>audioTrack.release();<NEW_LINE>}<NEW_LINE>audioTrack = null;<NEW_LINE>}<NEW_LINE>Integer userFrequency = propertyMap.get(HK_FREQUENCY);<NEW_LINE>Integer userVolume = propertyMap.get(HK_VOLUME);<NEW_LINE>Integer <MASK><NEW_LINE>int frequency = (userFrequency != null ? userFrequency : 2000);<NEW_LINE>int volume = (userVolume != null && userVolume >= 0 && userVolume <= 3 ? userVolume : 1);<NEW_LINE>int duration = (userDuration != null ? userDuration : 1000);<NEW_LINE>(new NotificationBeep(frequency)).play(duration, volume);<NEW_LINE>} | userDuration = propertyMap.get(HK_DURATION); |
1,628,895 | private Label iconLabel(String img, Supplier<Tag<?>> tagSupplier, NBTTreeView nbtTreeView, BorderPane treeViewHolder, Consumer<CompoundTag> consumer) {<NEW_LINE>ImageView icon = new ImageView(FileHelper.getIconFromResources(img));<NEW_LINE>Label label <MASK><NEW_LINE>icon.setPreserveRatio(true);<NEW_LINE>label.setOnMouseEntered(e -> icon.setFitWidth(18));<NEW_LINE>label.setOnMouseExited(e -> icon.setFitWidth(16));<NEW_LINE>label.getStyleClass().add("nbt-editor-add-tag-label");<NEW_LINE>label.setOnMouseClicked(e -> {<NEW_LINE>treeViewHolder.setCenter(nbtTreeView);<NEW_LINE>Tag<?> newTag = tagSupplier.get();<NEW_LINE>if (nbtTreeView.addItem(nbtTreeView.getSelectionModel().getSelectedItem(), "Unknown", newTag)) {<NEW_LINE>// if we created a root tag, it is always a compound tag<NEW_LINE>consumer.accept((CompoundTag) newTag);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return label;<NEW_LINE>} | = new Label("", icon); |
388,070 | public static ResolvedVariant toResolvedVariant(VariantResolveMetadata variant, ModuleVersionIdentifier ownerId, ModuleSources moduleSources, ExcludeSpec exclusions, ArtifactResolver artifactResolver, Map<ComponentArtifactIdentifier, ResolvableArtifact> allResolvedArtifacts, ImmutableAttributes variantAttributes, CalculatedValueContainerFactory calculatedValueContainerFactory) {<NEW_LINE>List<? extends ComponentArtifactMetadata> artifacts = variant.getArtifacts();<NEW_LINE>// artifactsToResolve are those not excluded by their owning module<NEW_LINE>List<? extends ComponentArtifactMetadata> artifactsToResolve = CollectionUtils.filter(artifacts, artifact -> !exclusions.excludesArtifact(ownerId.getModule(), artifact.getName()));<NEW_LINE>boolean hasExcludedArtifact = artifactsToResolve.size() < artifacts.size();<NEW_LINE>VariantResolveMetadata.Identifier identifier = variant.getIdentifier();<NEW_LINE>if (hasExcludedArtifact) {<NEW_LINE>// An ad hoc variant, has no identifier<NEW_LINE>identifier = null;<NEW_LINE>}<NEW_LINE>return ArtifactBackedResolvedVariant.create(identifier, variant.asDescribable(), variantAttributes, withImplicitCapability(variant, ownerId), supplyLazilyResolvedArtifacts(ownerId, moduleSources, artifactsToResolve<MASK><NEW_LINE>} | , artifactResolver, allResolvedArtifacts, calculatedValueContainerFactory)); |
1,352,537 | public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {<NEW_LINE>if (args.length == 0) {<NEW_LINE>printUsage(out);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());<NEW_LINE>ClassSegmentIterator iterator = new ClassSegmentIterator(vm.classMemorySegments());<NEW_LINE>int hitCount = 0;<NEW_LINE>String searchClassName = args[0];<NEW_LINE>PatternString pattern = new PatternString(searchClassName);<NEW_LINE>out.println(String.format("Searching for classes named '%1$s' in VM=%2$s", searchClassName, Long.toHexString(vm.getAddress())));<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>J9ClassPointer classPointer = <MASK><NEW_LINE>String javaName = J9ClassHelper.getJavaName(classPointer);<NEW_LINE>if (pattern.isMatch(javaName)) {<NEW_LINE>hitCount++;<NEW_LINE>String hexString = classPointer.getHexAddress();<NEW_LINE>out.println(String.format("!j9class %1$s named %2$s", hexString, javaName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.println(String.format("Found %1$d class(es) named %2$s", hitCount, searchClassName));<NEW_LINE>} catch (CorruptDataException e) {<NEW_LINE>throw new DDRInteractiveCommandException(e);<NEW_LINE>}<NEW_LINE>} | (J9ClassPointer) iterator.next(); |
1,096,097 | void init(ServletContext context) {<NEW_LINE>String serializedConfig = context.getInitParameter(ConfigUtils.class.getName() + ".serialized");<NEW_LINE>Objects.requireNonNull(serializedConfig);<NEW_LINE>this.config = ConfigUtils.deserialize(serializedConfig);<NEW_LINE>this.updateTopic = config.getString("oryx.update-topic.message.topic");<NEW_LINE>this.maxMessageSize = config.getInt("oryx.update-topic.message.max-size");<NEW_LINE>this.updateTopicLockMaster = config.getString("oryx.update-topic.lock.master");<NEW_LINE>this.<MASK><NEW_LINE>this.readOnly = config.getBoolean("oryx.serving.api.read-only");<NEW_LINE>if (!readOnly) {<NEW_LINE>this.inputTopic = config.getString("oryx.input-topic.message.topic");<NEW_LINE>this.inputTopicLockMaster = config.getString("oryx.input-topic.lock.master");<NEW_LINE>this.inputTopicBroker = config.getString("oryx.input-topic.broker");<NEW_LINE>}<NEW_LINE>this.modelManagerClassName = config.getString("oryx.serving.model-manager-class");<NEW_LINE>this.updateDecoderClass = (Class<? extends Deserializer<U>>) ClassUtils.loadClass(config.getString("oryx.update-topic.message.decoder-class"), Deserializer.class);<NEW_LINE>Preconditions.checkArgument(maxMessageSize > 0);<NEW_LINE>} | updateTopicBroker = config.getString("oryx.update-topic.broker"); |
1,712,439 | protected long freePhysTake(int size, boolean ensureAvail, boolean recursive) {<NEW_LINE>assert (structuralLock.isHeldByCurrentThread());<NEW_LINE>assert (size > 0);<NEW_LINE>// check free space<NEW_LINE>if (spaceReclaimReuse) {<NEW_LINE>long ret = longStackTake(size2ListIoRecid(size), recursive);<NEW_LINE>if (ret != 0) {<NEW_LINE>freeSize -= roundTo16(size);<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// try to take large record and split it into two<NEW_LINE>if (!recursive && spaceReclaimSplit) {<NEW_LINE>for (long s = roundTo16(size) + 16; s < MAX_REC_SIZE; s += 16) {<NEW_LINE>final long ioList = size2ListIoRecid(s);<NEW_LINE>if (ioList > maxUsedIoList)<NEW_LINE>break;<NEW_LINE>long ret = longStackTake(ioList, recursive);<NEW_LINE>if (ret != 0) {<NEW_LINE>// found larger record, split in two chunks, take first, mark second free<NEW_LINE>final long offset = ret & MASK_OFFSET;<NEW_LINE>long remaining = s - roundTo16(size);<NEW_LINE>long markFree = (remaining << 48) | (offset + s - remaining);<NEW_LINE>freePhysPut(markFree, recursive);<NEW_LINE>freeSize -= roundTo16(s);<NEW_LINE>return (((long) size) << 48) | offset;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// not available, increase file size<NEW_LINE>if ((physSize & CHUNK_SIZE_MOD_MASK) + size > CHUNK_SIZE)<NEW_LINE>physSize += CHUNK_SIZE - (physSize & CHUNK_SIZE_MOD_MASK);<NEW_LINE>long physSize2 = physSize;<NEW_LINE><MASK><NEW_LINE>if (ensureAvail)<NEW_LINE>phys.ensureAvailable(physSize);<NEW_LINE>return physSize2;<NEW_LINE>} | physSize = roundTo16(physSize + size); |
163,420 | public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<ModelMap> allModels) {<NEW_LINE>Map<String, Object> operations = (Map<String, Object>) objs.get("operations");<NEW_LINE>List<CodegenOperation> os = (List<CodegenOperation>) operations.get("operation");<NEW_LINE>List<ExtendedCodegenOperation> newOs = new ArrayList<ExtendedCodegenOperation>();<NEW_LINE>Pattern pattern = Pattern.compile("\\{([^\\}]+)\\}");<NEW_LINE>for (CodegenOperation o : os) {<NEW_LINE>// force http method to lower case<NEW_LINE>o.httpMethod = o.httpMethod.toLowerCase(Locale.ROOT);<NEW_LINE>if (o.isArray) {<NEW_LINE>o.returnType = "[" + o.returnBaseType + "]";<NEW_LINE>}<NEW_LINE>ArrayList<String> pathTemplateNames = new ArrayList<String>();<NEW_LINE>Matcher matcher = pattern.matcher(o.path);<NEW_LINE>StringBuffer buffer = new StringBuffer();<NEW_LINE>while (matcher.find()) {<NEW_LINE>String pathTemplateName = matcher.group(1);<NEW_LINE>matcher.appendReplacement(buffer, "\", " + camelize(pathTemplateName) + ", \"");<NEW_LINE>pathTemplateNames.add(pathTemplateName);<NEW_LINE>}<NEW_LINE>matcher.appendTail(buffer);<NEW_LINE><MASK><NEW_LINE>if (buffer.toString().isEmpty()) {<NEW_LINE>eco.setReplacedPathName(o.path);<NEW_LINE>} else {<NEW_LINE>eco.setReplacedPathName(buffer.toString());<NEW_LINE>}<NEW_LINE>eco.setPathTemplateNames(pathTemplateNames);<NEW_LINE>newOs.add(eco);<NEW_LINE>}<NEW_LINE>operations.put("operation", newOs);<NEW_LINE>return objs;<NEW_LINE>} | ExtendedCodegenOperation eco = new ExtendedCodegenOperation(o); |
787,705 | public void execute(JobExecutionContext arg0) {<NEW_LINE>returnValue = new ArrayList<Map>();<NEW_LINE>List<Class<?>> runOnce;<NEW_LINE>Comparator<Class<?>> comparator = new Comparator<Class<?>>() {<NEW_LINE><NEW_LINE>public int compare(Class<?> o1, Class<?> o2) {<NEW_LINE>String name = o1.getName();<NEW_LINE>String name2 = o2.getName();<NEW_LINE>if (!name.matches("(\\D+)(\\d{5})(.*)")) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>return o1.getName().compareTo(o2.getName());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>try {<NEW_LINE>runOnce = TaskLocatorUtil.getFixTaskClasses();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DotRuntimeException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>Collections.sort(runOnce, comparator);<NEW_LINE>// PreparedStatement update = null;<NEW_LINE>int taskId = 0;<NEW_LINE>try {<NEW_LINE>for (Class<?> c : runOnce) {<NEW_LINE>String name = c.getCanonicalName();<NEW_LINE>name = name.substring(name.lastIndexOf(".") + 1);<NEW_LINE>String id = name.substring(7, 12);<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>taskId++;<NEW_LINE>}<NEW_LINE>if (FixTask.class.isAssignableFrom(c)) {<NEW_LINE>FixTask task;<NEW_LINE>try {<NEW_LINE>task = (FixTask) c.newInstance();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DotRuntimeException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>HibernateUtil.startTransaction();<NEW_LINE>Boolean shouldrun = task.shouldRun();<NEW_LINE>if (shouldrun) {<NEW_LINE>Logger.info(this, "Running: " + name);<NEW_LINE>returnValue.addAll(task.executeFix());<NEW_LINE>}<NEW_LINE>String executed = "";<NEW_LINE>if (shouldrun)<NEW_LINE>executed = "was Executed";<NEW_LINE>else<NEW_LINE>executed = "was not Executed";<NEW_LINE>Logger.info(this, "fix assets and inconsistencies task: " + name + " " + executed);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.fatal(this, "Unable to execute the fix assets and inconsistencies tasks", e);<NEW_LINE>try {<NEW_LINE>throw new DotDataException("Unable to execute fix assets inconsistencies task : ", e);<NEW_LINE>} catch (DotDataException e1) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Logger.info(this, "Finishing tasks.");<NEW_LINE>} | taskId = Integer.parseInt(id); |
919,698 | public void refresh(TableCell cell) {<NEW_LINE>DownloadManager dm = <MASK><NEW_LINE>if (cell.isValid() && map.containsKey(dm)) {<NEW_LINE>long lNextUpdate = map.get(dm);<NEW_LINE>if (SystemTime.getMonotonousTime() < lNextUpdate) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long value = (dm == null) ? 0 : dm.getTrackerTime();<NEW_LINE>if (value < -1) {<NEW_LINE>value = -1;<NEW_LINE>}<NEW_LINE>long skip_secs = value > 60 ? (value % 60) : 1;<NEW_LINE>long lNextUpdate = SystemTime.getMonotonousTime() + (skip_secs * 1000);<NEW_LINE>map.put(dm, new Long(lNextUpdate));<NEW_LINE>if (!cell.setSortValue(value) && cell.isValid())<NEW_LINE>return;<NEW_LINE>String sText = TimeFormatter.formatColon(value);<NEW_LINE>if (value > 60)<NEW_LINE>sText = "< " + sText;<NEW_LINE>TrackerCellUtils.updateColor(cell, dm, false);<NEW_LINE>cell.setText(sText);<NEW_LINE>} | (DownloadManager) cell.getDataSource(); |
760,465 | final DescribeTransitGatewaysResult executeDescribeTransitGateways(DescribeTransitGatewaysRequest describeTransitGatewaysRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeTransitGatewaysRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeTransitGatewaysRequest> request = null;<NEW_LINE>Response<DescribeTransitGatewaysResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeTransitGatewaysRequestMarshaller().marshall(super.beforeMarshalling(describeTransitGatewaysRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeTransitGateways");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeTransitGatewaysResult> responseHandler = new StaxResponseHandler<DescribeTransitGatewaysResult>(new DescribeTransitGatewaysResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,209,440 | public static void drawLine(double x1, double y1, double z1, double x2, double y2, double z2) {<NEW_LINE>double vpX = renderManager.viewerPosX;<NEW_LINE>double vpY = renderManager.viewerPosY;<NEW_LINE>double vpZ = renderManager.viewerPosZ;<NEW_LINE>boolean renderPathAsFrickinThingy = !settings.renderPathAsLine.value;<NEW_LINE>buffer.begin(renderPathAsFrickinThingy ? GL_LINE_STRIP : GL_LINES, DefaultVertexFormats.POSITION);<NEW_LINE>buffer.pos(x1 + 0.5D - vpX, y1 + 0.5D - vpY, z1 + 0.5D - vpZ).endVertex();<NEW_LINE>buffer.pos(x2 + 0.5D - vpX, y2 + 0.5D - vpY, z2 + 0.5D - vpZ).endVertex();<NEW_LINE>if (renderPathAsFrickinThingy) {<NEW_LINE>buffer.pos(x2 + 0.5D - vpX, y2 + 0.53D - vpY, z2 + 0.5D - vpZ).endVertex();<NEW_LINE>buffer.pos(x1 + 0.5D - vpX, y1 + 0.53D - vpY, z1 + <MASK><NEW_LINE>buffer.pos(x1 + 0.5D - vpX, y1 + 0.5D - vpY, z1 + 0.5D - vpZ).endVertex();<NEW_LINE>}<NEW_LINE>} | 0.5D - vpZ).endVertex(); |
1,016,940 | protected void prepareFileTypeAnalyzer(Engine engine) throws InitializationException {<NEW_LINE>super.prepareFileTypeAnalyzer(engine);<NEW_LINE>if (!isEnabled()) {<NEW_LINE>LOGGER.debug("{} Analyzer is disabled skipping yarn executable check", getName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<String> args = new ArrayList<>();<NEW_LINE>args.add(getYarn());<NEW_LINE>args.add("--help");<NEW_LINE>final ProcessBuilder builder = new ProcessBuilder(args);<NEW_LINE>LOGGER.debug("Launching: {}", args);<NEW_LINE>try {<NEW_LINE>final <MASK><NEW_LINE>try (ProcessReader processReader = new ProcessReader(process)) {<NEW_LINE>processReader.readAll();<NEW_LINE>final int exitValue = process.waitFor();<NEW_LINE>final int expectedExitValue = 0;<NEW_LINE>final int yarnExecutableNotFoundExitValue = 127;<NEW_LINE>switch(exitValue) {<NEW_LINE>case expectedExitValue:<NEW_LINE>LOGGER.debug("{} is enabled.", getName());<NEW_LINE>break;<NEW_LINE>case yarnExecutableNotFoundExitValue:<NEW_LINE>this.setEnabled(false);<NEW_LINE>LOGGER.warn("The {} has been disabled. Yarn executable was not found.", getName());<NEW_LINE>default:<NEW_LINE>this.setEnabled(false);<NEW_LINE>LOGGER.warn("The {} has been disabled. Yarn executable was not found.", getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>this.setEnabled(false);<NEW_LINE>LOGGER.debug("The {} has been disabled. Yarn executable was not found.", ex);<NEW_LINE>LOGGER.warn("The {} has been disabled. Yarn executable was not found.", getName());<NEW_LINE>throw new InitializationException("Unable to read yarn audit output.", ex);<NEW_LINE>}<NEW_LINE>} | Process process = builder.start(); |
1,280,507 | public void restoreInstanceState(@NonNull Bundle state) {<NEW_LINE>int checkedItem = state.getInt(STATE_CHECKED_ITEM, 0);<NEW_LINE>if (checkedItem != 0) {<NEW_LINE>updateSuspended = true;<NEW_LINE>for (int i = 0, size = items.size(); i < size; i++) {<NEW_LINE>NavigationMenuItem item = items.get(i);<NEW_LINE>if (item instanceof NavigationMenuTextItem) {<NEW_LINE>MenuItemImpl menuItem = ((NavigationMenuTextItem) item).getMenuItem();<NEW_LINE>if (menuItem != null && menuItem.getItemId() == checkedItem) {<NEW_LINE>setCheckedItem(menuItem);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateSuspended = false;<NEW_LINE>prepareMenuItems();<NEW_LINE>}<NEW_LINE>// Restore the states of the action views.<NEW_LINE>SparseArray<ParcelableSparseArray> actionViewStates = state.getSparseParcelableArray(STATE_ACTION_VIEWS);<NEW_LINE>if (actionViewStates != null) {<NEW_LINE>for (int i = 0, size = items.size(); i < size; i++) {<NEW_LINE>NavigationMenuItem navigationMenuItem = items.get(i);<NEW_LINE>if (!(navigationMenuItem instanceof NavigationMenuTextItem)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>MenuItemImpl item = ((<MASK><NEW_LINE>if (item == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>View actionView = item.getActionView();<NEW_LINE>if (actionView == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ParcelableSparseArray container = actionViewStates.get(item.getItemId());<NEW_LINE>if (container == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>actionView.restoreHierarchyState(container);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | NavigationMenuTextItem) navigationMenuItem).getMenuItem(); |
1,181,123 | private void putPlaceOrPublisherOrDate(Map<Field, String> fields, String elementName, Object object) {<NEW_LINE>Optional<IssuanceDefinition> issuanceDefinition = getElement(object, IssuanceDefinition.class);<NEW_LINE>Optional<PlaceDefinition> placeDefinition = getElement(object, PlaceDefinition.class);<NEW_LINE>Optional<DateDefinition> dateDefinition = getElement(object, DateDefinition.class);<NEW_LINE>Optional<StringPlusLanguagePlusSupplied> publisherOrEdition = getElement(object, StringPlusLanguagePlusSupplied.class);<NEW_LINE>issuanceDefinition.ifPresent(issuance -> putIfValueNotNull(fields, new UnknownField("issuance"), issuance.value()));<NEW_LINE>List<String> <MASK><NEW_LINE>placeDefinition.ifPresent(place -> place.getPlaceTerm().stream().filter(placeTerm -> placeTerm.getValue() != null).map(PlaceTermDefinition::getValue).forEach(element -> places.add(element)));<NEW_LINE>putIfListIsNotEmpty(fields, places, StandardField.ADDRESS, ", ");<NEW_LINE>dateDefinition.ifPresent(date -> putDate(fields, elementName, date));<NEW_LINE>publisherOrEdition.ifPresent(pubOrEd -> putPublisherOrEdition(fields, elementName, pubOrEd));<NEW_LINE>} | places = new ArrayList<>(); |
797,359 | private static void logStats(Collection<? extends IndexResult> result, boolean hit, String... fieldsToLoad) {<NEW_LINE>if (!LOG.isLoggable(Level.FINEST)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int size = 0;<NEW_LINE>for (String field : fieldsToLoad) {<NEW_LINE>for (IndexResult r : result) {<NEW_LINE>String val = r.getValue(field);<NEW_LINE>size += val == null ? 0 : val.length();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>synchronized (QUERY_STATS) {<NEW_LINE>if (hit) {<NEW_LINE>cacheHit++;<NEW_LINE>} else {<NEW_LINE>cacheMiss++;<NEW_LINE>}<NEW_LINE>StatsKey statsKey = new StatsKey(fieldsToLoad);<NEW_LINE>StatsValue statsValue = QUERY_STATS.get(statsKey);<NEW_LINE>if (statsValue == null) {<NEW_LINE>QUERY_STATS.put(statsKey, new StatsValue(1, result.size(), size));<NEW_LINE>} else {<NEW_LINE>QUERY_STATS.put(statsKey, new StatsValue(statsValue.getRequests() + 1, statsValue.getCount() + result.size(), statsValue.getSize() + size));<NEW_LINE>}<NEW_LINE>if ((cacheHit + cacheMiss) % 500 == 0) {<NEW_LINE>LOG.log(Level.FINEST, "Cache hit: " + cacheHit + ", Cache miss: " + cacheMiss + ", Ratio: " + (cacheHit / cacheMiss));<NEW_LINE>for (Map.Entry<StatsKey, StatsValue> entry : QUERY_STATS.entrySet()) {<NEW_LINE>LOG.log(Level.FINEST, entry.getKey() + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ": " + entry.getValue()); |
1,569,879 | /* This method implements the cyclic sort recursive version<NEW_LINE>* @param array The array to be sorted<NEW_LINE>* @param the left boundary of the part currently being sorted<NEW_LINE>* @param the right boundary of the part currently being sorted<NEW_LINE>*/<NEW_LINE>private <T extends Comparable<T>> Boolean doSort(T[] array, int left, int right) {<NEW_LINE>Boolean swapped = false;<NEW_LINE>if (left == right) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int low = left;<NEW_LINE>int high = right;<NEW_LINE>while (low < high) {<NEW_LINE>if (array[low].compareTo(array[high]) > 0) {<NEW_LINE>swap(array, low, high);<NEW_LINE>swapped = true;<NEW_LINE>}<NEW_LINE>low++;<NEW_LINE>high--;<NEW_LINE>}<NEW_LINE>if (low == high && array[low].compareTo(array[high + 1]) > 0) {<NEW_LINE>swap(array, low, high + 1);<NEW_LINE>swapped = true;<NEW_LINE>}<NEW_LINE>int mid = left + (right - left) / 2;<NEW_LINE>Boolean leftHalf = <MASK><NEW_LINE>Boolean rightHalf = doSort(array, mid + 1, right);<NEW_LINE>return swapped || leftHalf || rightHalf;<NEW_LINE>} | doSort(array, left, mid); |
881,591 | void decode(Decoder decoder, Instruction instruction) {<NEW_LINE>instruction.setCode(code);<NEW_LINE>instruction.setOp0Register(decoder.state_vvvv + Register.ZMM0);<NEW_LINE>int sss = decoder.getSss();<NEW_LINE>if (decoder.state_mod == 3) {<NEW_LINE>instruction.setOp1Register(decoder.state_rm + decoder.state_extraBaseRegisterBaseEVEX + Register.ZMM0);<NEW_LINE>if ((decoder.state_zs_flags & StateFlags.MVEX_EH) != 0) {<NEW_LINE>if (MvexInfo.canUseSuppressAllExceptions(code)) {<NEW_LINE>if ((sss & 4) != 0)<NEW_LINE>instruction.setSuppressAllExceptions(true);<NEW_LINE>if (MvexInfo.canUseRoundingControl(code)) {<NEW_LINE>instruction.setRoundingControl((sss & 3) + RoundingControl.ROUND_TO_NEAREST);<NEW_LINE>}<NEW_LINE>} else if (MvexInfo.getNoSaeRc(code) && (sss & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>} else {<NEW_LINE>if ((MvexInfo.getInvalidSwizzleFns(code) & (1 << sss) & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>assert Integer.compareUnsigned(sss, 7) <= 0 : sss;<NEW_LINE>instruction.setMvexRegMemConv(MvexRegMemConv.REG_SWIZZLE_NONE + sss);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>instruction.setOp1Kind(OpKind.MEMORY);<NEW_LINE>if ((decoder.state_zs_flags & StateFlags.MVEX_EH) != 0)<NEW_LINE>instruction.setMvexEvictionHint(true);<NEW_LINE>if ((MvexInfo.getInvalidConvFns(code) & (1 << sss) & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>instruction.<MASK><NEW_LINE>decoder.readOpMem(instruction, MvexInfo.getTupleType(code, sss));<NEW_LINE>}<NEW_LINE>instruction.setOp2Kind(OpKind.IMMEDIATE8);<NEW_LINE>instruction.setImmediate8((byte) decoder.readByte());<NEW_LINE>} | setMvexRegMemConv(MvexRegMemConv.MEM_CONV_NONE + sss); |
863,368 | public WorkflowGraph unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>WorkflowGraph workflowGraph = new WorkflowGraph();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Nodes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>workflowGraph.setNodes(new ListUnmarshaller<Node>(NodeJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Edges", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>workflowGraph.setEdges(new ListUnmarshaller<Edge>(EdgeJsonUnmarshaller.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 workflowGraph;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,466,170 | public Expression expression(TableSchema<?> tableSchema, String indexName) {<NEW_LINE>QueryConditionalKeyValues queryConditionalKeyValues1 = QueryConditionalKeyValues.from(key1, tableSchema, indexName);<NEW_LINE>QueryConditionalKeyValues queryConditionalKeyValues2 = QueryConditionalKeyValues.from(key2, tableSchema, indexName);<NEW_LINE>if (queryConditionalKeyValues1.sortValue().equals(nullAttributeValue()) || queryConditionalKeyValues2.sortValue().equals(nullAttributeValue())) {<NEW_LINE>throw new IllegalArgumentException("Attempt to query using a 'between' condition operator where one " + "of the items has a null sort key.");<NEW_LINE>}<NEW_LINE>String partitionKeyToken = EXPRESSION_KEY_MAPPER.apply(queryConditionalKeyValues1.partitionKey());<NEW_LINE>String partitionValueToken = EXPRESSION_VALUE_KEY_MAPPER.apply(queryConditionalKeyValues1.partitionKey());<NEW_LINE>String sortKeyToken = EXPRESSION_KEY_MAPPER.apply(queryConditionalKeyValues1.sortKey());<NEW_LINE>String sortKeyValueToken1 = EXPRESSION_VALUE_KEY_MAPPER.apply(queryConditionalKeyValues1.sortKey());<NEW_LINE>String sortKeyValueToken2 = EXPRESSION_OTHER_VALUE_KEY_MAPPER.apply(queryConditionalKeyValues2.sortKey());<NEW_LINE>String queryExpression = String.format("%s = %s AND %s BETWEEN %s AND %s", partitionKeyToken, partitionValueToken, sortKeyToken, sortKeyValueToken1, sortKeyValueToken2);<NEW_LINE>Map<String, AttributeValue> expressionAttributeValues = new HashMap<>();<NEW_LINE>expressionAttributeValues.put(partitionValueToken, queryConditionalKeyValues1.partitionValue());<NEW_LINE>expressionAttributeValues.put(<MASK><NEW_LINE>expressionAttributeValues.put(sortKeyValueToken2, queryConditionalKeyValues2.sortValue());<NEW_LINE>Map<String, String> expressionAttributeNames = new HashMap<>();<NEW_LINE>expressionAttributeNames.put(partitionKeyToken, queryConditionalKeyValues1.partitionKey());<NEW_LINE>expressionAttributeNames.put(sortKeyToken, queryConditionalKeyValues1.sortKey());<NEW_LINE>return Expression.builder().expression(queryExpression).expressionValues(Collections.unmodifiableMap(expressionAttributeValues)).expressionNames(expressionAttributeNames).build();<NEW_LINE>} | sortKeyValueToken1, queryConditionalKeyValues1.sortValue()); |
1,737,109 | private void writeConfigureMethod(ClassVisitor visitor, Type generatedType, ModelProperty<?> property, boolean writable) {<NEW_LINE>if (!writable && property.getSchema() instanceof CompositeSchema) {<NEW_LINE>// Adds a void $propName(Closure<?> cl) method that delegates to model state<NEW_LINE>MethodVisitor methodVisitor = declareMethod(visitor, property.getName(), Type.getMethodDescriptor(Type.VOID_TYPE, CLOSURE_TYPE), null);<NEW_LINE>putNodeStateFieldValueOnStack(methodVisitor, generatedType);<NEW_LINE>putConstantOnStack(methodVisitor, property.getName());<NEW_LINE>putFirstMethodArgumentOnStack(methodVisitor);<NEW_LINE>methodVisitor.visitMethodInsn(INVOKEINTERFACE, MODEL_ELEMENT_STATE_TYPE_INTERNAL_NAME, "apply", STATE_APPLY_METHOD_DESCRIPTOR, true);<NEW_LINE>finishVisitingMethod(methodVisitor);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!writable && property.getSchema() instanceof UnmanagedImplStructSchema) {<NEW_LINE>UnmanagedImplStructSchema<?> structSchema = (UnmanagedImplStructSchema<?>) property.getSchema();<NEW_LINE>if (!structSchema.isAnnotated()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Adds a void $propName(Closure<?> cl) method that executes the closure<NEW_LINE>MethodVisitor methodVisitor = declareMethod(visitor, property.getName(), Type.getMethodDescriptor(Type.VOID_TYPE, CLOSURE_TYPE), null);<NEW_LINE>putThisOnStack(methodVisitor);<NEW_LINE>methodVisitor.visitMethodInsn(INVOKEVIRTUAL, generatedType.getInternalName(), property.getGetter().getName(), Type.getMethodDescriptor(Type.getType(property.getType().getConcreteClass())), false);<NEW_LINE>putFirstMethodArgumentOnStack(methodVisitor);<NEW_LINE>methodVisitor.visitMethodInsn(INVOKESTATIC, Type.getInternalName(ClosureBackedAction.class), "execute", Type.getMethodDescriptor(Type.VOID_TYPE, OBJECT_TYPE, CLOSURE_TYPE), false);<NEW_LINE>finishVisitingMethod(methodVisitor);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Adds a void $propName(Closure<?> cl) method that throws MME, to avoid attempts to convert closure to something else<NEW_LINE>MethodVisitor methodVisitor = declareMethod(visitor, property.getName(), Type.getMethodDescriptor(Type.VOID_TYPE, CLOSURE_TYPE), null);<NEW_LINE>putThisOnStack(methodVisitor);<NEW_LINE>putConstantOnStack(methodVisitor, property.getName());<NEW_LINE>methodVisitor.visitInsn(Opcodes.ICONST_1);<NEW_LINE>methodVisitor.visitTypeInsn(Opcodes.<MASK><NEW_LINE>methodVisitor.visitInsn(Opcodes.DUP);<NEW_LINE>methodVisitor.visitInsn(Opcodes.ICONST_0);<NEW_LINE>putFirstMethodArgumentOnStack(methodVisitor);<NEW_LINE>methodVisitor.visitInsn(Opcodes.AASTORE);<NEW_LINE>methodVisitor.visitMethodInsn(INVOKEVIRTUAL, generatedType.getInternalName(), "methodMissing", METHOD_MISSING_METHOD_DESCRIPTOR, false);<NEW_LINE>finishVisitingMethod(methodVisitor);<NEW_LINE>} | ANEWARRAY, OBJECT_TYPE.getInternalName()); |
188,532 | public Dialog createView(@NonNull AlertDialog fragment, @NonNull Bundle args) {<NEW_LINE>AppCompatDialog appCompatDialog = new AppCompatDialog(fragment.getContext());<NEW_LINE>LayoutInflater inflater = LayoutInflater.from(fragment.getContext());<NEW_LINE>View root = inflater.inflate(fragment.getLayoutId(), null, false);<NEW_LINE>TextView declineBtn = root.findViewById(R.id.decline_btn);<NEW_LINE>int declineBtnTextId = args.getInt(ARG_NEGATIVE_BUTTON_ID);<NEW_LINE>if (declineBtnTextId != INVALID_ID) {<NEW_LINE>declineBtn.setText(args.getInt(ARG_NEGATIVE_BUTTON_ID));<NEW_LINE>declineBtn.setOnClickListener(v -> fragment.onNegativeClicked(DialogInterface.BUTTON_NEGATIVE));<NEW_LINE>} else {<NEW_LINE>UiUtils.hide(declineBtn);<NEW_LINE>}<NEW_LINE>TextView acceptBtn = root.findViewById(R.id.accept_btn);<NEW_LINE>acceptBtn.setText(args.getInt(ARG_POSITIVE_BUTTON_ID));<NEW_LINE>acceptBtn.setOnClickListener(v -> fragment.onPositiveClicked(DialogInterface.BUTTON_POSITIVE));<NEW_LINE>TextView descriptionView = root.findViewById(R.id.description);<NEW_LINE>descriptionView.setText(args.getInt(ARG_MESSAGE_ID));<NEW_LINE>TextView titleView = root.<MASK><NEW_LINE>titleView.setText(args.getInt(ARG_TITLE_ID));<NEW_LINE>ImageView imageView = root.findViewById(R.id.image);<NEW_LINE>int imageResId = args.getInt(ARG_IMAGE_RES_ID);<NEW_LINE>boolean hasImage = imageResId != INVALID_ID;<NEW_LINE>imageView.setImageDrawable(hasImage ? fragment.getResources().getDrawable(imageResId) : null);<NEW_LINE>int negativeBtnTextColor = args.getInt(ARG_NEGATIVE_BTN_TEXT_COLOR_RES_ID);<NEW_LINE>boolean hasNegativeBtnCustomColor = negativeBtnTextColor != INVALID_ID;<NEW_LINE>if (hasNegativeBtnCustomColor)<NEW_LINE>declineBtn.setTextColor(fragment.getResources().getColor(negativeBtnTextColor));<NEW_LINE>UiUtils.showIf(hasImage, imageView);<NEW_LINE>appCompatDialog.setContentView(root);<NEW_LINE>return appCompatDialog;<NEW_LINE>} | findViewById(R.id.title); |
1,261,413 | // search related extensions<NEW_LINE>private void buildSearchIndex() {<NEW_LINE>synchronized (searchIndex) {<NEW_LINE>if (searchIndex.size() > 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final ArrayList<BasePreferenceFragment> fragments = new ArrayList<>();<NEW_LINE>fragments.add(new PreferenceServicesFragment().setIcon(R.drawable.settings_cloud));<NEW_LINE>fragments.add(new PreferenceAppearanceFragment().setIcon(R.drawable.settings_eye));<NEW_LINE>fragments.add(new PreferenceCachedetailsFragment().setIcon(R.drawable.settings_details));<NEW_LINE>fragments.add(new PreferenceMapFragment().setIcon<MASK><NEW_LINE>fragments.add(new PreferenceLoggingFragment().setIcon(R.drawable.settings_pen));<NEW_LINE>fragments.add(new PreferenceOfflinedataFragment().setIcon(R.drawable.settings_sdcard));<NEW_LINE>fragments.add(new PreferenceNavigationFragment().setIcon(R.drawable.settings_arrow));<NEW_LINE>fragments.add(new PreferenceSystemFragment().setIcon(R.drawable.settings_nut));<NEW_LINE>fragments.add(new PreferenceBackupFragment().setIcon(R.drawable.settings_backup));<NEW_LINE>for (BasePreferenceFragment f : fragments) {<NEW_LINE>f.setSearchdataCallback(this::collectSearchdataCallback);<NEW_LINE>}<NEW_LINE>final FragmentTransaction t = getSupportFragmentManager().beginTransaction();<NEW_LINE>for (Fragment f : fragments) {<NEW_LINE>t.add(R.id.settings_fragment_root, f);<NEW_LINE>}<NEW_LINE>t.commit();<NEW_LINE>getSupportFragmentManager().beginTransaction().replace(R.id.settings_fragment_root, new PreferencesFragment()).commit();<NEW_LINE>} | (R.drawable.settings_map)); |
497,104 | public static void verifyOptionsEqualsHashcode(ParserOptions options1, ParserOptions options2, ParserOptions options3, ParserOptions options4) {<NEW_LINE>// Objects should be different<NEW_LINE>Assert.assertNotSame(options1, options2);<NEW_LINE>Assert.assertNotSame(options1, options2);<NEW_LINE>Assert.assertNotSame(options1, options3);<NEW_LINE>Assert.assertNotSame(options2, options3);<NEW_LINE><MASK><NEW_LINE>Assert.assertNotSame(options3, options4);<NEW_LINE>// Check all 16 equality combinations<NEW_LINE>Assert.assertEquals(options1, options1);<NEW_LINE>Assert.assertFalse(options1.equals(options2));<NEW_LINE>Assert.assertEquals(options1, options3);<NEW_LINE>Assert.assertFalse(options1.equals(options4));<NEW_LINE>Assert.assertFalse(options2.equals(options1));<NEW_LINE>Assert.assertEquals(options2, options2);<NEW_LINE>Assert.assertFalse(options2.equals(options3));<NEW_LINE>Assert.assertEquals(options2, options4);<NEW_LINE>Assert.assertEquals(options3, options1);<NEW_LINE>Assert.assertFalse(options3.equals(options2));<NEW_LINE>Assert.assertEquals(options3, options3);<NEW_LINE>Assert.assertFalse(options3.equals(options4));<NEW_LINE>Assert.assertFalse(options4.equals(options1));<NEW_LINE>Assert.assertEquals(options4, options2);<NEW_LINE>Assert.assertFalse(options4.equals(options3));<NEW_LINE>Assert.assertEquals(options4, options4);<NEW_LINE>// Hashcodes should match up<NEW_LINE>Assert.assertNotEquals(options1.hashCode(), options2.hashCode());<NEW_LINE>Assert.assertEquals(options1.hashCode(), options3.hashCode());<NEW_LINE>Assert.assertNotEquals(options1.hashCode(), options4.hashCode());<NEW_LINE>Assert.assertNotEquals(options2.hashCode(), options3.hashCode());<NEW_LINE>Assert.assertEquals(options2.hashCode(), options4.hashCode());<NEW_LINE>Assert.assertNotEquals(options3.hashCode(), options4.hashCode());<NEW_LINE>} | Assert.assertNotSame(options2, options4); |
965,055 | public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {<NEW_LINE>if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE && viewHolder instanceof MapMarkerItemViewHolder) {<NEW_LINE>OsmandApplication app = mapActivity.getMyApplication();<NEW_LINE>if (!iconHidden && isCurrentlyActive) {<NEW_LINE>((MapMarkerItemViewHolder) viewHolder).optionsBtn.setVisibility(View.GONE);<NEW_LINE>iconHidden = true;<NEW_LINE>adapter.onSwipeStarted();<NEW_LINE>}<NEW_LINE>View itemView = viewHolder.itemView;<NEW_LINE>int colorIcon;<NEW_LINE>int colorText;<NEW_LINE>if (Math.abs(dX) > itemView.getWidth() / 2) {<NEW_LINE>colorIcon = R.color.map_widget_blue;<NEW_LINE>colorText = R.color.map_widget_blue;<NEW_LINE>} else {<NEW_LINE>colorIcon = ColorUtilities.getDefaultIconColorId(night);<NEW_LINE>colorText = ColorUtilities.getSecondaryTextColorId(night);<NEW_LINE>}<NEW_LINE>textPaint.setColor(ContextCompat.getColor(mapActivity, colorText));<NEW_LINE>Drawable icon = app.getUIUtilities().getIcon(R.drawable.ic_action_history, colorIcon);<NEW_LINE>int iconWidth = icon.getIntrinsicWidth();<NEW_LINE>int iconHeight = icon.getIntrinsicHeight();<NEW_LINE>float textMarginTop = ((float) itemView.getHeight() - (float) textHeight) / 2;<NEW_LINE>float iconMarginTop = ((float) itemView.getHeight() - (float) iconHeight) / 2;<NEW_LINE>int iconTopY = itemView.getTop() + (int) iconMarginTop;<NEW_LINE>int iconLeftX = itemView.getLeft() + (int) marginSides;<NEW_LINE>c.drawRect(itemView.getLeft(), itemView.getTop(), dX, itemView.getBottom(), backgroundPaint);<NEW_LINE>c.drawText(moveToHistoryStr, itemView.getLeft() + 2 * marginSides + iconWidth, itemView.getTop() + textMarginTop + textHeight, textPaint);<NEW_LINE>icon.setBounds(iconLeftX, iconTopY, iconLeftX + iconWidth, iconTopY + iconHeight);<NEW_LINE>icon.draw(c);<NEW_LINE>}<NEW_LINE>super.onChildDraw(c, recyclerView, viewHolder, <MASK><NEW_LINE>} | dX, dY, actionState, isCurrentlyActive); |
115,440 | public void main() {<NEW_LINE>RVec4 color = (RVec4) getGlobal(DefaultShaderVar.G_COLOR);<NEW_LINE>RVec3 eyeDir = (RVec3) getGlobal(DefaultShaderVar.V_EYE_DIR);<NEW_LINE>RVec3 normal = (RVec3) getGlobal(DefaultShaderVar.G_NORMAL);<NEW_LINE>RFloat k = (RFloat) getGlobal(SpecularShaderVar.U_EXTINCTION_COEFFICIENT);<NEW_LINE>RFloat F0 = new RFloat("F0");<NEW_LINE>F0.assign("0.8");<NEW_LINE>RFloat nDotV = new RFloat("nDotV");<NEW_LINE>nDotV.assign("max(0., dot(gNormal, normalize(-vEyeDir)))");<NEW_LINE>RFloat Rs = new RFloat("Rs");<NEW_LINE>RVec3 specular = new RVec3("specular");<NEW_LINE>for (int i = 0; i < mLights.size(); ++i) {<NEW_LINE>Rs.assign("0.0");<NEW_LINE>specular.assign("vec3(0.,0.,0.)");<NEW_LINE>RFloat attenuation = (RFloat) getGlobal(LightsShaderVar.V_LIGHT_ATTENUATION, i);<NEW_LINE>RFloat lightPower = (RFloat) getGlobal(LightsShaderVar.U_LIGHT_POWER, i);<NEW_LINE>RVec3 lightColor = (RVec3) getGlobal(LightsShaderVar.U_LIGHT_COLOR, i);<NEW_LINE>RVec3 lightDir = new RVec3("lightDir" + i);<NEW_LINE>RFloat NdotL = (RFloat) getGlobal(DiffuseShaderVar.L_NDOTL, i);<NEW_LINE>startif(new Condition(NdotL, Operator.GREATER_THAN, "0.0"));<NEW_LINE>{<NEW_LINE>RVec3 H = new RVec3("H" + i);<NEW_LINE>H.assign("normalize(lightDir" + i + " + normalize(-vEyeDir))");<NEW_LINE>RFloat NdotH = new RFloat("NdotH");<NEW_LINE>NdotH.assign("max(0., dot(gNormal, H" + i + "))");<NEW_LINE>RFloat VdotH = new RFloat("VdotH");<NEW_LINE>VdotH.assign("max(0., dot(normalize(-vEyeDir), H" + i + "))");<NEW_LINE>// Fresnel reflectance<NEW_LINE>RFloat F = new RFloat("F");<NEW_LINE>F.assign("pow(1.0 - VdotH, 5.0)");<NEW_LINE>F.assignMultiply("1.0 - F0");<NEW_LINE>F.assignAdd(F0);<NEW_LINE>// Microfacet distribution by Beckmann<NEW_LINE>RFloat m_squared = new RFloat("m_squared");<NEW_LINE>m_squared.assign(muRoughness.multiply(muRoughness));<NEW_LINE>RFloat r1 = new RFloat("r1");<NEW_LINE>r1.assign("1.0 / (4.0 * m_squared * pow(NdotH, 4.0))");<NEW_LINE>RFloat r2 = new RFloat("r2");<NEW_LINE>r2.assign("(NdotH * NdotH - 1.0) / (m_squared * NdotH * NdotH)");<NEW_LINE>RFloat D = new RFloat("D");<NEW_LINE>D.assign("r1 * exp(r2)");<NEW_LINE>// Geometric shadowing<NEW_LINE>RFloat two_NdotH = new RFloat("two_NdotH");<NEW_LINE>two_NdotH.assign("2.0 * NdotH");<NEW_LINE>RFloat g1 = new RFloat("g1");<NEW_LINE>g1.assign("(two_NdotH * nDotV) / VdotH");<NEW_LINE>RFloat g2 = new RFloat("g2");<NEW_LINE>g2.assign("(two_NdotH * NdotL" + i + ") / VdotH");<NEW_LINE>RFloat G = new RFloat("G");<NEW_LINE>G.assign("min(1.0, min(g1, g2))");<NEW_LINE>Rs.assign("(F * D * G) / (" + Math.<MASK><NEW_LINE>specular.assign("uSpecularColor * NdotL" + i);<NEW_LINE>specular.assignMultiply("(uK + Rs * (1. - uK))");<NEW_LINE>specular.assignMultiply(lightColor.multiply(lightPower).multiply(attenuation));<NEW_LINE>}<NEW_LINE>endif();<NEW_LINE>color.rgb().assignAdd(specular);<NEW_LINE>}<NEW_LINE>} | PI + " * NdotL" + i + " * nDotV)"); |
1,179,798 | public Builder mergeFrom(io.kubernetes.client.proto.V1beta1Rbac.ClusterRoleBindingList other) {<NEW_LINE>if (other == io.kubernetes.client.proto.V1beta1Rbac.ClusterRoleBindingList.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (other.hasMetadata()) {<NEW_LINE>mergeMetadata(other.getMetadata());<NEW_LINE>}<NEW_LINE>if (itemsBuilder_ == null) {<NEW_LINE>if (!other.items_.isEmpty()) {<NEW_LINE>if (items_.isEmpty()) {<NEW_LINE>items_ = other.items_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>} else {<NEW_LINE>ensureItemsIsMutable();<NEW_LINE>items_.addAll(other.items_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.items_.isEmpty()) {<NEW_LINE>if (itemsBuilder_.isEmpty()) {<NEW_LINE>itemsBuilder_.dispose();<NEW_LINE>itemsBuilder_ = null;<NEW_LINE>items_ = other.items_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>itemsBuilder_ = com.google.protobuf.GeneratedMessageV3<MASK><NEW_LINE>} else {<NEW_LINE>itemsBuilder_.addAllMessages(other.items_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>} | .alwaysUseFieldBuilders ? getItemsFieldBuilder() : null; |
1,000,945 | public void initialize() {<NEW_LINE>listener = (viewPath, data) -> {<NEW_LINE>if (viewPath.size() != 4 || viewPath.indexOf(bisq.desktop.main.dao.bonding.BondingView.class) != 2)<NEW_LINE>return;<NEW_LINE>selectedViewClass = viewPath.tip();<NEW_LINE>loadView(selectedViewClass, data);<NEW_LINE>};<NEW_LINE>toggleGroup = new ToggleGroup();<NEW_LINE>final List<Class<? extends View>> baseNavPath = Arrays.asList(MainView.class, DaoView.class, bisq.desktop.main.dao.bonding.BondingView.class);<NEW_LINE>dashboard = new MenuItem(navigation, toggleGroup, Res.get("shared.dashboard"), BondingDashboardView.class, baseNavPath);<NEW_LINE>bondedRoles = new MenuItem(navigation, toggleGroup, Res.get("dao.bond.menuItem.bondedRoles"), RolesView.class, baseNavPath);<NEW_LINE>reputation = new MenuItem(navigation, toggleGroup, Res.get("dao.bond.menuItem.reputation"), MyReputationView.class, baseNavPath);<NEW_LINE>bonds = new MenuItem(navigation, toggleGroup, Res.get("dao.bond.menuItem.bonds"<MASK><NEW_LINE>leftVBox.getChildren().addAll(dashboard, bondedRoles, reputation, bonds);<NEW_LINE>} | ), BondsView.class, baseNavPath); |
384,076 | void peerComponentShowing() {<NEW_LINE>MultiViewElement el = model.getActiveElement();<NEW_LINE>el.componentShowing();<NEW_LINE>delegatingMap.setDelegateMap(el.getVisualRepresentation().getActionMap());<NEW_LINE>assignLookup(el);<NEW_LINE>JComponent jc = el.getToolbarRepresentation();<NEW_LINE>// NOI18N<NEW_LINE>assert jc != null : "MultiViewElement " + el.getClass() + " returns null as toolbar component.";<NEW_LINE>jc.setOpaque(false);<NEW_LINE>boolean isSplitDescription = false;<NEW_LINE>MultiViewDescription desc = model.getActiveDescription();<NEW_LINE>if (desc instanceof ContextAwareDescription) {<NEW_LINE>isSplitDescription = ((ContextAwareDescription) desc).isSplitDescription();<NEW_LINE>}<NEW_LINE>tabs.setInnerToolBar(jc, isSplitDescription);<NEW_LINE><MASK><NEW_LINE>if (editorSettingsPreferences != null) {<NEW_LINE>editorSettingsPreferences.addPreferenceChangeListener(editorSettingsListener);<NEW_LINE>}<NEW_LINE>if (initialSplitOrientation != -1) {<NEW_LINE>splitOrientation = initialSplitOrientation;<NEW_LINE>tabs.peerSplitComponent(splitOrientation, MultiViewPeer.this, getModel().getActiveDescription(), initialSplitDescription, -1);<NEW_LINE>initialSplitDescription = null;<NEW_LINE>initialSplitOrientation = -1;<NEW_LINE>}<NEW_LINE>} | tabs.setToolbarBarVisible(isToolbarVisible()); |
340,295 | private ListMultimap<String, TextHit> query(Node subj, StrMatch match, ExecutionContext execCxt) {<NEW_LINE>String graphURI = chooseGraphURI(execCxt);<NEW_LINE><MASK><NEW_LINE>int limit = match.getQueryLimit();<NEW_LINE>String lang = match.getLang();<NEW_LINE>String highlight = match.getHighlight();<NEW_LINE>explainQuery(qs, limit, execCxt, graphURI);<NEW_LINE>if (textIndex.getDocDef().areQueriesCached()) {<NEW_LINE>// Cache-key does not matter if lang or graphURI are null<NEW_LINE>String cacheKey = subj + " " + limit + " " + match.getProps() + " " + qs + " " + lang + " " + graphURI;<NEW_LINE>Cache<String, ListMultimap<String, TextHit>> queryCache = prepareCache(execCxt);<NEW_LINE>log.trace("Caching Text query: {} with key: >>{}<< in cache: {}", qs, cacheKey, queryCache);<NEW_LINE>return queryCache.getOrFill(cacheKey, () -> performQuery(subj, match, qs, graphURI, lang, limit, highlight));<NEW_LINE>} else {<NEW_LINE>log.trace("Executing w/o cache Text query: {}", qs);<NEW_LINE>return performQuery(subj, match, qs, graphURI, lang, limit, highlight);<NEW_LINE>}<NEW_LINE>} | String qs = match.getQueryString(); |
1,730,538 | public Description matchNewClass(NewClassTree tree, VisitorState state) {<NEW_LINE>ClassTree body = tree.getClassBody();<NEW_LINE>if (body == null) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>ImmutableList<? extends Tree> members = body.getMembers().stream().filter(m -> !(m instanceof MethodTree && ASTHelpers.isGeneratedConstructor((MethodTree) m))).collect(toImmutableList());<NEW_LINE>if (members.size() != 1) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>Tree member = Iterables.getOnlyElement(members);<NEW_LINE>if (!(member instanceof BlockTree)) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>BlockTree block = (BlockTree) member;<NEW_LINE>Optional<CollectionTypes> collectionType = Arrays.stream(CollectionTypes.values()).filter(type -> type.constructorMatcher.matches(tree, state)).findFirst();<NEW_LINE>if (!collectionType.isPresent()) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>Description.Builder description = buildDescription(tree);<NEW_LINE>collectionType.get().maybeFix(tree, state, block<MASK><NEW_LINE>return description.build();<NEW_LINE>} | ).ifPresent(description::addFix); |
1,112,461 | public static void execListAddOperation(BNewArray array, long index, BRefType refType) {<NEW_LINE>if (array.getType().getTag() != TypeTags.ARRAY_TAG) {<NEW_LINE>BValueArray bRefValueArray = (BValueArray) array;<NEW_LINE>bRefValueArray.add(index, refType);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BValueArray bValueArray = (BValueArray) array;<NEW_LINE>switch(((BArrayType) array.getType()).getElementType().getTag()) {<NEW_LINE>case TypeTags.BOOLEAN_TAG:<NEW_LINE>bValueArray.add(index, ((BBoolean) refType).value() ? 1 : 0);<NEW_LINE>return;<NEW_LINE>case TypeTags.BYTE_TAG:<NEW_LINE>bValueArray.add(index, (byte) refType.value());<NEW_LINE>return;<NEW_LINE>case TypeTags.FLOAT_TAG:<NEW_LINE>bValueArray.add(index, (<MASK><NEW_LINE>return;<NEW_LINE>case TypeTags.INT_TAG:<NEW_LINE>bValueArray.add(index, (long) refType.value());<NEW_LINE>return;<NEW_LINE>case TypeTags.STRING_TAG:<NEW_LINE>bValueArray.add(index, (String) refType.value());<NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>bValueArray.add(index, refType);<NEW_LINE>}<NEW_LINE>} | double) refType.value()); |
132,302 | private // This is based heavily on the Apple sample code for dealing with this issue<NEW_LINE>void macOSXRegistration() {<NEW_LINE>if (isMacOSX()) {<NEW_LINE>try {<NEW_LINE>Class<?> osxAdapter = ClassLoader.getSystemClassLoader().loadClass("edu.stanford.nlp.trees.tregex.gui.OSXAdapter");<NEW_LINE>Class<?>[] defArgs = { TregexGUI.class };<NEW_LINE>Method registerMethod = osxAdapter.getDeclaredMethod("registerMacOSXApplication", defArgs);<NEW_LINE>if (registerMethod != null) {<NEW_LINE>Object[] args = { this };<NEW_LINE>registerMethod.invoke(osxAdapter, args);<NEW_LINE>}<NEW_LINE>defArgs[0] = boolean.class;<NEW_LINE>Method prefsEnableMethod = osxAdapter.getDeclaredMethod("enablePrefs", defArgs);<NEW_LINE>if (prefsEnableMethod != null) {<NEW_LINE>Object[] args = { Boolean.TRUE };<NEW_LINE>prefsEnableMethod.invoke(osxAdapter, args);<NEW_LINE>}<NEW_LINE>} catch (NoClassDefFoundError e) {<NEW_LINE>// This will be thrown first if the OSXAdapter is loaded on a system without the EAWT<NEW_LINE>// because OSXAdapter extends ApplicationAdapter in its def<NEW_LINE>log.<MASK><NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>// This shouldn't be reached; if there's a problem with the OSXAdapter we should get the<NEW_LINE>// above NoClassDefFoundError first.<NEW_LINE>log.info("This version of Mac OS X does not support the Apple EAWT. Application Menu handling has been disabled (" + e + ")");<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.info("Exception while loading the OSXAdapter:");<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | info("This version of Mac OS X does not support the Apple EAWT. Application Menu handling has been disabled (" + e + ")"); |
258,216 | public List<GeoRadiusResponse> build(Object data) {<NEW_LINE>if (data == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<Object> objectList <MASK><NEW_LINE>List<GeoRadiusResponse> responses = new ArrayList<>(objectList.size());<NEW_LINE>if (objectList.isEmpty()) {<NEW_LINE>return responses;<NEW_LINE>}<NEW_LINE>if (objectList.get(0) instanceof List<?>) {<NEW_LINE>// list of members with additional informations<NEW_LINE>GeoRadiusResponse resp;<NEW_LINE>for (Object obj : objectList) {<NEW_LINE>List<Object> informations = (List<Object>) obj;<NEW_LINE>resp = new GeoRadiusResponse((byte[]) informations.get(0));<NEW_LINE>int size = informations.size();<NEW_LINE>for (int idx = 1; idx < size; idx++) {<NEW_LINE>Object info = informations.get(idx);<NEW_LINE>if (info instanceof List<?>) {<NEW_LINE>// coordinate<NEW_LINE>List<Object> coord = (List<Object>) info;<NEW_LINE>resp.setCoordinate(new GeoCoordinate(DOUBLE.build(coord.get(0)), DOUBLE.build(coord.get(1))));<NEW_LINE>} else if (info instanceof Long) {<NEW_LINE>// score<NEW_LINE>resp.setRawScore(LONG.build(info));<NEW_LINE>} else {<NEW_LINE>// distance<NEW_LINE>resp.setDistance(DOUBLE.build(info));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>responses.add(resp);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// list of members<NEW_LINE>for (Object obj : objectList) {<NEW_LINE>responses.add(new GeoRadiusResponse((byte[]) obj));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return responses;<NEW_LINE>} | = (List<Object>) data; |
1,827,968 | protected void deserializeData(TypeSpec<K> keyType, Map<String, CompoundKey.TypeInfo> keyParts, ComplexKeySpec<?, ?> complexKeyType, ProtocolVersion version) {<NEW_LINE>DataMap dataMap = data();<NEW_LINE>final DataMap convertedData = new DataMap();<NEW_LINE>final DataMap mergedResults = new DataMap();<NEW_LINE>final DataMap inputResults = dataMap.containsKey(BatchResponse.RESULTS) ? dataMap.getDataMap(BatchResponse.RESULTS) : new DataMap();<NEW_LINE>final DataMap inputStatuses = dataMap.containsKey(BatchResponse.STATUSES) ? dataMap.getDataMap(BatchResponse.STATUSES) : new DataMap();<NEW_LINE>final DataMap inputErrors = dataMap.containsKey(BatchResponse.ERRORS) ? dataMap.getDataMap(BatchResponse.ERRORS) : new DataMap();<NEW_LINE>final Set<String> mergedKeys = new HashSet<>(inputResults.keySet());<NEW_LINE>mergedKeys.addAll(inputStatuses.keySet());<NEW_LINE>mergedKeys.addAll(inputErrors.keySet());<NEW_LINE>for (String key : mergedKeys) {<NEW_LINE>final DataMap entityResponseData = new DataMap();<NEW_LINE>final Object <MASK><NEW_LINE>if (entityData != null) {<NEW_LINE>CheckedUtil.putWithoutChecking(entityResponseData, EntityResponse.ENTITY, entityData);<NEW_LINE>}<NEW_LINE>final Object statusData = inputStatuses.get(key);<NEW_LINE>if (statusData != null) {<NEW_LINE>CheckedUtil.putWithoutChecking(entityResponseData, EntityResponse.STATUS, statusData);<NEW_LINE>}<NEW_LINE>final Object errorData = inputErrors.get(key);<NEW_LINE>if (errorData != null) {<NEW_LINE>CheckedUtil.putWithoutChecking(entityResponseData, EntityResponse.ERROR, errorData);<NEW_LINE>}<NEW_LINE>CheckedUtil.putWithoutChecking(mergedResults, key, entityResponseData);<NEW_LINE>}<NEW_LINE>CheckedUtil.putWithoutChecking(convertedData, RESULTS, mergedResults);<NEW_LINE>CheckedUtil.putWithoutChecking(convertedData, ERRORS, inputErrors);<NEW_LINE>super.deserializeData(convertedData, keyType, keyParts, complexKeyType, version);<NEW_LINE>} | entityData = inputResults.get(key); |
1,536,356 | public static void showTable(SqlShowTables sqlNode) throws SQLException {<NEW_LINE>String tableName = sqlNode.getLikePattern() != null ? sqlNode.getLikePattern().toString().replaceAll("\'", "") : "";<NEW_LINE>MetadataClient metadataClient = new MetadataClient();<NEW_LINE>List<TableValue> tableSchemas = metadataClient.getTableSchemaByTbl(tableName);<NEW_LINE>// for (TableValue tableValue : tableSchemas) {<NEW_LINE>// System.out.println(tableValue.getTblName());<NEW_LINE>// }<NEW_LINE>String[][] tableNames = new String[tableSchemas.size()][1];<NEW_LINE>for (int i = 0; i < tableSchemas.size(); i++) {<NEW_LINE>tableNames[i][0] = tableSchemas.get(i).getTblName();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>TextTable tt = new TextTable(columnNames, tableNames);<NEW_LINE>tt.printTable();<NEW_LINE>} | String[] columnNames = { "name" }; |
1,555,352 | public static int chooseAListenPort(Configuration conf) throws IOException {<NEW_LINE>String portRangeStr = conf.get(AngelConf.ANGEL_LISTEN_PORT_RANGE, AngelConf.DEFAULT_ANGEL_LISTEN_PORT_RANGE);<NEW_LINE>String[] portRangeArray = null;<NEW_LINE>int startPort = -1;<NEW_LINE>int endPort = -1;<NEW_LINE>try {<NEW_LINE>portRangeArray = portRangeStr.split(",");<NEW_LINE>startPort = Integer.valueOf(portRangeArray[0]);<NEW_LINE>endPort = Integer.valueOf(portRangeArray[1]);<NEW_LINE>if (startPort <= 1024 || startPort > 65535 || endPort <= 1024 || endPort > 65535 || startPort > endPort) {<NEW_LINE>throw new InvalidParameterException(AngelConf.ANGEL_LISTEN_PORT_RANGE, portRangeStr, "port should in range 1024~63335");<NEW_LINE>}<NEW_LINE>} catch (Exception x) {<NEW_LINE>LOG.error("use port set for " + AngelConf.ANGEL_LISTEN_PORT_RANGE + " is unvalid, we use default value now. error msg = " + x.getMessage());<NEW_LINE>portRangeArray = <MASK><NEW_LINE>startPort = Integer.valueOf(portRangeArray[0]);<NEW_LINE>endPort = Integer.valueOf(portRangeArray[1]);<NEW_LINE>}<NEW_LINE>int maxTryTime = 100;<NEW_LINE>Random r = new Random();<NEW_LINE>int port = -1;<NEW_LINE>for (int i = 0; i < maxTryTime; i++) {<NEW_LINE>port = Math.abs(r.nextInt()) % (endPort - startPort) + startPort;<NEW_LINE>if (isPortAvailable(port)) {<NEW_LINE>return port;<NEW_LINE>}<NEW_LINE>LOG.error("workerservice:port " + port + " is not available, try agine");<NEW_LINE>}<NEW_LINE>throw new IOException("can not find a avaliable port for workerservice");<NEW_LINE>} | AngelConf.DEFAULT_ANGEL_LISTEN_PORT_RANGE.split(","); |
190,442 | private static void extractRecordKeyPk(final String tableName, final List<String> configuredPkFields, final Schema keySchema, final Map<String, SinkRecordField> allFields, final Set<String> keyFieldNames) {<NEW_LINE>{<NEW_LINE>if (keySchema == null) {<NEW_LINE>throw new ConnectException(String.format("PK mode for table '%s' is %s, but record key schema is missing", tableName, JdbcSinkConfig.PrimaryKeyMode.RECORD_KEY));<NEW_LINE>}<NEW_LINE>final Schema.Type keySchemaType = keySchema.type();<NEW_LINE>if (keySchemaType.isPrimitive()) {<NEW_LINE>if (configuredPkFields.size() != 1) {<NEW_LINE>throw new ConnectException(String.format<MASK><NEW_LINE>}<NEW_LINE>final String fieldName = configuredPkFields.get(0);<NEW_LINE>keyFieldNames.add(fieldName);<NEW_LINE>allFields.put(fieldName, new SinkRecordField(keySchema, fieldName, true));<NEW_LINE>} else if (keySchemaType == Schema.Type.STRUCT) {<NEW_LINE>if (configuredPkFields.isEmpty()) {<NEW_LINE>for (Field keyField : keySchema.fields()) {<NEW_LINE>keyFieldNames.add(keyField.name());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (String fieldName : configuredPkFields) {<NEW_LINE>final Field keyField = keySchema.field(fieldName);<NEW_LINE>if (keyField == null) {<NEW_LINE>throw new ConnectException(String.format("PK mode for table '%s' is %s with configured PK fields %s, but record key " + "schema does not contain field: %s", tableName, JdbcSinkConfig.PrimaryKeyMode.RECORD_KEY, configuredPkFields, fieldName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>keyFieldNames.addAll(configuredPkFields);<NEW_LINE>}<NEW_LINE>for (String fieldName : keyFieldNames) {<NEW_LINE>final Schema fieldSchema = keySchema.field(fieldName).schema();<NEW_LINE>allFields.put(fieldName, new SinkRecordField(fieldSchema, fieldName, true));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new ConnectException("Key schema must be primitive type or Struct, but is of type: " + keySchemaType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ("Need exactly one PK column defined since the key schema for records is a " + "primitive type, defined columns are: %s", configuredPkFields)); |
138,479 | public void processSearchCall(String query) {<NEW_LINE>final ProgressDialog dialog = new ProgressDialog(this);<NEW_LINE>dialog.setCancelable(false);<NEW_LINE>dialog.setMessage(getResources().getString<MASK><NEW_LINE>dialog.show();<NEW_LINE>AlTask.execute(new AlUserSearchTask(this, query, new AlUserSearchTask.AlUserSearchHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(List<Contact> contacts, Context context) {<NEW_LINE>if (dialog != null) {<NEW_LINE>dialog.dismiss();<NEW_LINE>}<NEW_LINE>if (!contacts.isEmpty() && appContactFragment != null) {<NEW_LINE>appContactFragment.restartLoader();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Exception e, Context context) {<NEW_LINE>if (dialog != null) {<NEW_LINE>dialog.dismiss();<NEW_LINE>}<NEW_LINE>Toast.makeText(context, R.string.applozic_server_error, Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>} | (R.string.applozic_contacts_loading_info)); |
1,373,834 | protected void paintBackground(Graphics g) {<NEW_LINE>Graphics2D g2d = (Graphics2D) g;<NEW_LINE><MASK><NEW_LINE>int h = displayer.getHeight();<NEW_LINE>javax.swing.Painter painter = null;<NEW_LINE>if (displayer.isActive()) {<NEW_LINE>painter = (javax.swing.Painter) UIManager.get("TabbedPane:TabbedPaneTabArea[Enabled+MouseOver].backgroundPainter");<NEW_LINE>}<NEW_LINE>if (!displayer.isActive() || null == painter) {<NEW_LINE>painter = (javax.swing.Painter) UIManager.get("TabbedPane:TabbedPaneTabArea[Enabled].backgroundPainter");<NEW_LINE>}<NEW_LINE>if (null != painter)<NEW_LINE>painter.paint(g2d, null, w, h);<NEW_LINE>Color c = (Color) UIManager.get("nimbusBorder");<NEW_LINE>g.setColor(c);<NEW_LINE>g.drawLine(0, h - 5, 0, h);<NEW_LINE>g.drawLine(w - 1, h - 5, w - 1, h);<NEW_LINE>} | int w = displayer.getWidth(); |
1,495,099 | private void handleReportEvent(Object[] args) {<NEW_LINE>XLog.d("UsageStatsManagerInternalHooks handleReportEvent %s"<MASK><NEW_LINE>try {<NEW_LINE>int type = (int) args[2];<NEW_LINE>ComponentName component = (ComponentName) args[0];<NEW_LINE>if (type == UsageEvents.Event.MOVE_TO_BACKGROUND) {<NEW_LINE>XLog.d("UsageStatsManagerInternalHooks, MOVE_TO_BACKGROUND: %s", component);<NEW_LINE>BootStrap.THANOS_X.getActivityStackSupervisor().reportOnActivityStopped(new Intent().setComponent(component));<NEW_LINE>} else if (type == UsageEvents.Event.MOVE_TO_FOREGROUND) {<NEW_LINE>XLog.d("UsageStatsManagerInternalHooks, MOVE_TO_FOREGROUND: %s", component);<NEW_LINE>BootStrap.THANOS_X.getActivityStackSupervisor().reportOnActivityResumed(new Intent().setComponent(component));<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>XLog.e("UsageStatsManagerInternalHooks reportEvent error", e);<NEW_LINE>}<NEW_LINE>} | , Arrays.toString(args)); |
86,376 | final GetRouteResult executeGetRoute(GetRouteRequest getRouteRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRouteRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRouteRequest> request = null;<NEW_LINE>Response<GetRouteResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRouteRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRouteRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ApiGatewayV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetRoute");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRouteResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRouteResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
933,893 | // {4}, {T}: Roll a d20. Each opponent exiles cards from the top of their library until<NEW_LINE>// they exile an instant or sorcery card, then shuffles the rest into their library.<NEW_LINE>// You may cast up to X instant and/or sorcery spells from among cards exiled this way without paying their mana costs.<NEW_LINE>@Override<NEW_LINE>public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Cards cards = new CardsImpl();<NEW_LINE>Cards toCast = new CardsImpl();<NEW_LINE>for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {<NEW_LINE>Player opponent = game.getPlayer(playerId);<NEW_LINE>if (opponent == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (Card card : opponent.getLibrary().getCards(game)) {<NEW_LINE>opponent.moveCards(card, <MASK><NEW_LINE>if (card.isInstantOrSorcery(game)) {<NEW_LINE>toCast.add(card);<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>cards.add(card);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>opponent.putCardsOnBottomOfLibrary(cards, game, source, false);<NEW_LINE>opponent.shuffleLibrary(source, game);<NEW_LINE>cards.clear();<NEW_LINE>}<NEW_LINE>CardUtil.castMultipleWithAttributeForFree(controller, source, game, toCast, StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, xValue);<NEW_LINE>return true;<NEW_LINE>} | Zone.EXILED, source, game); |
393,772 | public void loadLocalMediaMessageBackward(String chatId, boolean isGroup, TUIMessageBean locateMessageInfo, IUIKitCallback<List<TUIMessageBean>> callBack) {<NEW_LINE>loadLocalMediaMessageList(chatId, isGroup, SCAN_MESSAGE_REQUEST_NUM, locateMessageInfo, TUIChatConstants.GET_MESSAGE_BACKWARD, new IUIKitCallback<List<TUIMessageBean>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(List<TUIMessageBean> firstData) {<NEW_LINE>TUIChatUtils.callbackOnSuccess(callBack, firstData);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(String module, int errCode, String errMsg) {<NEW_LINE>TUIChatUtils.callbackOnError(<MASK><NEW_LINE>TUIChatLog.e(TAG, "loadChatMessages loadLocalMediaMessageBackward failed, code = " + errCode + ", desc = " + errMsg);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | callBack, TAG, errCode, errMsg); |
290,050 | protected StringBuilder promptTo(String header, StringBuilder sb) {<NEW_LINE>sb.append(header).append(StringUtils.LINE_SEPARATOR).append(" calledAET: ").append(calledAET).append(StringUtils.LINE_SEPARATOR).append(" callingAET: ").append(callingAET).append(StringUtils.LINE_SEPARATOR).append(" applicationContext: ");<NEW_LINE>UIDUtils.promptTo(applicationContext, sb).append(StringUtils.LINE_SEPARATOR).append(" implClassUID: ").append(implClassUID).append(StringUtils.LINE_SEPARATOR).append(" implVersionName: ").append(implVersionName).append(StringUtils.LINE_SEPARATOR).append(" maxPDULength: ").append(maxPDULength).append(StringUtils.LINE_SEPARATOR).append(" maxOpsInvoked/maxOpsPerformed: ").append(maxOpsInvoked).append("/").append(maxOpsPerformed<MASK><NEW_LINE>if (userIdentityRQ != null)<NEW_LINE>userIdentityRQ.promptTo(sb).append(StringUtils.LINE_SEPARATOR);<NEW_LINE>if (userIdentityAC != null)<NEW_LINE>userIdentityAC.promptTo(sb).append(StringUtils.LINE_SEPARATOR);<NEW_LINE>for (PresentationContext pc : pcs) pc.promptTo(sb).append(StringUtils.LINE_SEPARATOR);<NEW_LINE>for (RoleSelection rs : roleSelMap.values()) rs.promptTo(sb).append(StringUtils.LINE_SEPARATOR);<NEW_LINE>for (ExtendedNegotiation extNeg : extNegMap.values()) extNeg.promptTo(sb).append(StringUtils.LINE_SEPARATOR);<NEW_LINE>for (CommonExtendedNegotiation extNeg : commonExtNegMap.values()) extNeg.promptTo(sb).append(StringUtils.LINE_SEPARATOR);<NEW_LINE>return sb.append("]");<NEW_LINE>} | ).append(StringUtils.LINE_SEPARATOR); |
1,588,174 | private void gwFieldValueInt64V(MethodWriterContext mwc, FieldWriter fieldWriter, int OBJECT, int i, boolean jsonb) {<NEW_LINE>MethodWriter mw = mwc.mw;<NEW_LINE>String format = fieldWriter.getFormat();<NEW_LINE>String classNameType = mwc.classNameType;<NEW_LINE>int FIELD_VALUE = mwc.var(long.class);<NEW_LINE>int WRITE_DEFAULT_VALUE = mwc.var(NOT_WRITE_DEFAULT_VALUE);<NEW_LINE>Label notDefaultValue_ = new Label(), endWriteValue_ = new Label();<NEW_LINE>genGetObject(mwc, fieldWriter, OBJECT);<NEW_LINE><MASK><NEW_LINE>mw.visitVarInsn(Opcodes.LSTORE, FIELD_VALUE);<NEW_LINE>mw.visitInsn(Opcodes.LCONST_0);<NEW_LINE>mw.visitInsn(Opcodes.LCMP);<NEW_LINE>mw.visitJumpInsn(Opcodes.IFNE, notDefaultValue_);<NEW_LINE>mw.visitVarInsn(Opcodes.ILOAD, WRITE_DEFAULT_VALUE);<NEW_LINE>mw.visitJumpInsn(Opcodes.IFEQ, notDefaultValue_);<NEW_LINE>mw.visitJumpInsn(Opcodes.GOTO, endWriteValue_);<NEW_LINE>mw.visitLabel(notDefaultValue_);<NEW_LINE>if (jsonb) {<NEW_LINE>gwFieldName(mwc, i);<NEW_LINE>mw.visitVarInsn(Opcodes.ALOAD, JSON_WRITER);<NEW_LINE>mw.visitVarInsn(Opcodes.LLOAD, FIELD_VALUE);<NEW_LINE>mw.visitMethodInsn(Opcodes.INVOKEVIRTUAL, TYPE_JSON_WRITER, "writeInt64", "(J)V", false);<NEW_LINE>} else {<NEW_LINE>// Int32FieldWriter.writeInt64(JSONWriter w, long value);<NEW_LINE>mw.visitVarInsn(Opcodes.ALOAD, THIS);<NEW_LINE>mw.visitFieldInsn(Opcodes.GETFIELD, classNameType, fieldWriter(i), DESC_FIELD_WRITER);<NEW_LINE>mw.visitVarInsn(Opcodes.ALOAD, JSON_WRITER);<NEW_LINE>mw.visitVarInsn(Opcodes.LLOAD, FIELD_VALUE);<NEW_LINE>if ("iso8601".equals(format)) {<NEW_LINE>mw.visitMethodInsn(Opcodes.INVOKEINTERFACE, TYPE_FIELD_WRITER, "writeDate", METHOD_DESC_WRITE_J, true);<NEW_LINE>} else {<NEW_LINE>mw.visitMethodInsn(Opcodes.INVOKEINTERFACE, TYPE_FIELD_WRITER, "writeInt64", METHOD_DESC_WRITE_J, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mw.visitLabel(endWriteValue_);<NEW_LINE>} | mw.visitInsn(Opcodes.DUP2); |
1,804,702 | final ListInferenceRecommendationsJobsResult executeListInferenceRecommendationsJobs(ListInferenceRecommendationsJobsRequest listInferenceRecommendationsJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listInferenceRecommendationsJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListInferenceRecommendationsJobsRequest> request = null;<NEW_LINE>Response<ListInferenceRecommendationsJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListInferenceRecommendationsJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listInferenceRecommendationsJobsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListInferenceRecommendationsJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListInferenceRecommendationsJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListInferenceRecommendationsJobsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
628,275 | public NfaFragment visitNumber(NumberExpression numberExpression, GrammarRule rule) {<NEW_LINE>int exprId = nextExprId();<NEW_LINE>int minNum = numberExpression.min;<NEW_LINE>int maxNum = numberExpression.max;<NEW_LINE>if (minNum < 0 || maxNum < minNum)<NEW_LINE>throw new IllegalArgumentException("Max loop number can't be 0");<NEW_LINE>GrammarNfaState from = nfa.createState(rule);<NEW_LINE>GrammarNfaState to = nfa.createState(rule);<NEW_LINE>NfaFragment part = numberExpression.child.apply(this, rule);<NEW_LINE>if (maxNum == 1) {<NEW_LINE>nfa.createTransition(from, part.from, GrammarNfaOperation.makeEmpty(exprId));<NEW_LINE>nfa.createTransition(part.to, to, GrammarNfaOperation.makeEmpty(exprId));<NEW_LINE>} else {<NEW_LINE>nfa.createTransition(from, part.from, GrammarNfaOperation.makeSequenceOperation(exprId, ParseOperationKind.LOOP_ENTER, minNum, maxNum, null));<NEW_LINE>nfa.createTransition(part.to, part.from, GrammarNfaOperation.makeSequenceOperation(exprId, ParseOperationKind.LOOP_INCREMENT, minNum, maxNum, null));<NEW_LINE>nfa.createTransition(part.to, to, GrammarNfaOperation.makeSequenceOperation(exprId, ParseOperationKind.LOOP_EXIT<MASK><NEW_LINE>}<NEW_LINE>if (minNum == 0) {<NEW_LINE>nfa.createTransition(from, to, GrammarNfaOperation.makeEmpty(exprId));<NEW_LINE>}<NEW_LINE>return new NfaFragment(from, to);<NEW_LINE>} | , minNum, maxNum, null)); |
381,937 | protected int runWithJob(final Namespace options, final HeliosClient client, final PrintStream out, final boolean json, final Job job, final BufferedReader stdin) throws IOException, ExecutionException, InterruptedException {<NEW_LINE>final boolean yes = options.getBoolean(yesArg.getDest());<NEW_LINE>final JobId jobId = job.getId();<NEW_LINE>if (!yes) {<NEW_LINE>out.printf("This will remove the job %s%n", jobId);<NEW_LINE>final boolean confirmed = Utils.userConfirmed(out, stdin);<NEW_LINE>if (!confirmed) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!json) {<NEW_LINE>out.printf("Removing job %s%n", jobId);<NEW_LINE>}<NEW_LINE>int code = 0;<NEW_LINE>final String token = options.<MASK><NEW_LINE>final JobDeleteResponse response = client.deleteJob(jobId, token).get();<NEW_LINE>if (!json) {<NEW_LINE>out.printf("%s: ", jobId);<NEW_LINE>}<NEW_LINE>if (response.getStatus() == JobDeleteResponse.Status.OK) {<NEW_LINE>if (json) {<NEW_LINE>out.print(response.toJsonString());<NEW_LINE>} else {<NEW_LINE>out.printf("done%n");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (json) {<NEW_LINE>out.print(response.toJsonString());<NEW_LINE>} else {<NEW_LINE>out.printf("failed: %s%n", response);<NEW_LINE>}<NEW_LINE>code = 1;<NEW_LINE>}<NEW_LINE>return code;<NEW_LINE>} | getString(tokenArg.getDest()); |
105,511 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String managedInstanceName, String databaseName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (managedInstanceName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (databaseName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2019-06-01-preview";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, managedInstanceName, databaseName, this.client.getSubscriptionId(), apiVersion, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); |
226,571 | private List<Node> toNodeSequence(String output) {<NEW_LINE>// First of all, get rid of all XML markup that HeidelTime inserts.<NEW_LINE>output = timeMLOpen.matcher(output).replaceAll("").trim();<NEW_LINE>output = timeMLClose.matcher(output).replaceAll("").trim();<NEW_LINE>// Now go through and chunk sequence into <TIMEX3> tag regions.<NEW_LINE>Matcher <MASK><NEW_LINE>Matcher attrMatcher = attr.matcher(output);<NEW_LINE>Matcher closeMatcher = timexTagClose.matcher(output);<NEW_LINE>List<Node> ret = new ArrayList<>();<NEW_LINE>// TODO: save metadata of TIMEX token positions or stuff.<NEW_LINE>int charIdx = 0;<NEW_LINE>HashMap<String, String> attrs = new HashMap<>();<NEW_LINE>while (openMatcher.find(charIdx)) {<NEW_LINE>int tagBegin = openMatcher.start();<NEW_LINE>int tagBeginEnd = openMatcher.end();<NEW_LINE>// Add everything before this tagBegin to a node.<NEW_LINE>if (charIdx < tagBegin) {<NEW_LINE>ret.add(new Node(output.substring(charIdx, tagBegin), charIdx, tagBegin));<NEW_LINE>}<NEW_LINE>attrs.clear();<NEW_LINE>// Get the attributes<NEW_LINE>while (attrMatcher.find(tagBegin + 1) && attrMatcher.end() < tagBeginEnd) {<NEW_LINE>attrs.put(attrMatcher.group("key"), attrMatcher.group("value"));<NEW_LINE>tagBegin = attrMatcher.end();<NEW_LINE>}<NEW_LINE>// Ok, move to the close tag.<NEW_LINE>boolean matched = closeMatcher.find(tagBeginEnd);<NEW_LINE>// Assert statements are sometimes ignored.<NEW_LINE>assert matched;<NEW_LINE>int tagEndBegin = closeMatcher.start();<NEW_LINE>int tagEnd = closeMatcher.end();<NEW_LINE>String text = output.substring(tagBeginEnd, tagEndBegin);<NEW_LINE>Timex timex = toTimex(text, attrs);<NEW_LINE>ret.add(new TimexNode(text, tagBeginEnd, tagEndBegin, timex));<NEW_LINE>charIdx = closeMatcher.end();<NEW_LINE>}<NEW_LINE>// Add everything before this tagBegin to a node. to the<NEW_LINE>if (charIdx < output.length()) {<NEW_LINE>ret.add(new Node(output.substring(charIdx, output.length()), charIdx, output.length()));<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | openMatcher = timexTagOpen.matcher(output); |
323,243 | public void read(org.apache.thrift.protocol.TProtocol iprot, BuckCacheDeleteResponse struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // DEBUG_INFO<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {<NEW_LINE>struct.debugInfo = new DeleteDebugInfo();<NEW_LINE>struct.debugInfo.read(iprot);<NEW_LINE>struct.setDebugInfoIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.<MASK><NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>// check for required fields of primitive type, which can't be checked in the validate method<NEW_LINE>struct.validate();<NEW_LINE>} | skip(iprot, schemeField.type); |
1,637,907 | private static MultiHandlerDefinition findDelegates(ClassLoader classLoader) {<NEW_LINE>Iterator<HandlerDefinition> iterator = load(HandlerDefinition.class, classLoader == null ? Thread.currentThread().getContextClassLoader() : classLoader).iterator();<NEW_LINE>// noinspection WhileLoopReplaceableByForEach<NEW_LINE>final List<HandlerDefinition> <MASK><NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>try {<NEW_LINE>HandlerDefinition factory = iterator.next();<NEW_LINE>definitions.add(factory);<NEW_LINE>} catch (ServiceConfigurationError e) {<NEW_LINE>LOGGER.info("HandlerDefinition instance ignored, as one of the required classes is not available" + "on the classpath: {}", e.getMessage());<NEW_LINE>} catch (NoClassDefFoundError e) {<NEW_LINE>LOGGER.info("HandlerDefinition instance ignored. It relies on a class that cannot be found: {}", e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new MultiHandlerDefinition(definitions);<NEW_LINE>} | definitions = new ArrayList<>(); |
367,321 | public static int HSLtoRGB(int hue, int saturation, int lightness) {<NEW_LINE>int red = 0;<NEW_LINE>int green = 0;<NEW_LINE>int blue = 0;<NEW_LINE>float hueRatio = hue / 360f;<NEW_LINE>float saturationRatio = saturation / 100f;<NEW_LINE>float lightnessRatio = lightness / 100f;<NEW_LINE>if (saturationRatio == 0) {<NEW_LINE>red = green = blue = (int) (lightnessRatio * 255.0f + 0.5f);<NEW_LINE>} else {<NEW_LINE>float p = lightnessRatio < 0.5f ? lightnessRatio * (1f + saturationRatio) <MASK><NEW_LINE>float q = 2 * lightnessRatio - p;<NEW_LINE>red = hslComponentToRgbComponent(p, q, hueRatio + (1f / 3f));<NEW_LINE>green = hslComponentToRgbComponent(p, q, hueRatio);<NEW_LINE>blue = hslComponentToRgbComponent(p, q, hueRatio - (1f / 3f));<NEW_LINE>}<NEW_LINE>return 0xff000000 | (red << 16) | (green << 8) | (blue << 0);<NEW_LINE>} | : lightnessRatio + saturationRatio - lightnessRatio * saturationRatio; |
1,036,672 | final GetInvitationsCountResult executeGetInvitationsCount(GetInvitationsCountRequest getInvitationsCountRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getInvitationsCountRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetInvitationsCountRequest> request = null;<NEW_LINE>Response<GetInvitationsCountResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetInvitationsCountRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getInvitationsCountRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Macie2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetInvitationsCount");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetInvitationsCountResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetInvitationsCountResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
19,139 | public EGLConfig chooseConfig(final EGL10 egl, final EGLDisplay display, final EGLConfig[] configs) {<NEW_LINE>EGLConfig bestConfig = null;<NEW_LINE>int bestDepth = 0;<NEW_LINE>int bestStencil = 0;<NEW_LINE>for (final EGLConfig config : configs) {<NEW_LINE>final int d = findConfigAttrib(egl, display, config, EGL10.EGL_DEPTH_SIZE);<NEW_LINE>final int s = findConfigAttrib(egl, display, config, EGL10.EGL_STENCIL_SIZE);<NEW_LINE>// We need at least mDepthSize and mStencilSize bits<NEW_LINE>if (d < mDepthSize || s < mStencilSize) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// We want an *exact* match for red/green/blue/alpha<NEW_LINE>final int r = findConfigAttrib(egl, <MASK><NEW_LINE>final int g = findConfigAttrib(egl, display, config, EGL10.EGL_GREEN_SIZE);<NEW_LINE>final int b = findConfigAttrib(egl, display, config, EGL10.EGL_BLUE_SIZE);<NEW_LINE>final int a = findConfigAttrib(egl, display, config, EGL10.EGL_ALPHA_SIZE);<NEW_LINE>if (r == mRedSize && g == mGreenSize && b == mBlueSize && a == mAlphaSize && d >= bestDepth && s >= bestStencil) {<NEW_LINE>bestConfig = config;<NEW_LINE>bestDepth = d;<NEW_LINE>bestStencil = s;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bestConfig;<NEW_LINE>} | display, config, EGL10.EGL_RED_SIZE); |
1,257,997 | public static Query<List<String>> topWeaponsOfServer(long after, long before, ServerUUID serverUUID, int limit) {<NEW_LINE>String innerSQL = SELECT + KillsTable.WEAPON + ", COUNT(1) as kills" + FROM + KillsTable.TABLE_NAME + WHERE + KillsTable.SERVER_UUID + "=?" + AND + KillsTable.DATE + ">=?" + AND + KillsTable.DATE + "<=?" + GROUP_BY + KillsTable.WEAPON;<NEW_LINE>String sql = SELECT + KillsTable.WEAPON + FROM + '(' + innerSQL + ") q1" + ORDER_BY + "kills DESC LIMIT ?";<NEW_LINE>return new QueryStatement<List<String>>(sql, limit) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void prepare(PreparedStatement statement) throws SQLException {<NEW_LINE>statement.setString(1, serverUUID.toString());<NEW_LINE><MASK><NEW_LINE>statement.setLong(3, before);<NEW_LINE>statement.setInt(4, limit);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public List<String> processResults(ResultSet set) throws SQLException {<NEW_LINE>List<String> weapons = new ArrayList<>();<NEW_LINE>while (set.next()) weapons.add(set.getString(KillsTable.WEAPON));<NEW_LINE>return weapons;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | statement.setLong(2, after); |
1,474,936 | public static GuidePartFactory loadGroup(XmlTag tag, Profiler prof) {<NEW_LINE>String domain = tag.get("domain");<NEW_LINE>String group = tag.get("group");<NEW_LINE>if (domain == null) {<NEW_LINE>BCLog.logger.warn("[lib.guide.loader.xml] Missing domain tag in " + tag);<NEW_LINE>}<NEW_LINE>if (group == null) {<NEW_LINE>BCLog.logger.warn("[lib.guide.loader.xml] Missing group tag in " + tag);<NEW_LINE>}<NEW_LINE>if (domain == null || group == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>GuideGroupSet set = <MASK><NEW_LINE>if (set == null) {<NEW_LINE>BCLog.logger.warn("[lib.guide.loader.xml] Unknown group " + domain + ":" + group);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return gui -> new GuidePartGroup(gui, set, GroupDirection.SRC_TO_ENTRY);<NEW_LINE>} | GuideGroupManager.get(domain, group); |
889,831 | public okhttp3.Call call123testSpecialTagsCall(Client client, final ApiCallback _callback) throws ApiException {<NEW_LINE>String basePath = null;<NEW_LINE>// Operation Servers<NEW_LINE>String[] localBasePaths = new String[] {};<NEW_LINE>// Determine Base Path to Use<NEW_LINE>if (localCustomBaseUrl != null) {<NEW_LINE>basePath = localCustomBaseUrl;<NEW_LINE>} else if (localBasePaths.length > 0) {<NEW_LINE>basePath = localBasePaths[localHostIndex];<NEW_LINE>} else {<NEW_LINE>basePath = null;<NEW_LINE>}<NEW_LINE>Object localVarPostBody = client;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/another-fake/dummy";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>Map<String, String> localVarCookieParams = 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 = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>if (localVarContentType != null) {<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | HashMap<String, String>(); |
646,882 | // GEN-LAST:event_btnSaveActionPerformed<NEW_LINE>// GEN-FIRST:event_btnPrintActionPerformed<NEW_LINE>// GEN-FIRST:event_btnPrintActionPerformed<NEW_LINE>void // GEN-FIRST:event_btnPrintActionPerformed<NEW_LINE>btnPrintActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-HEADEREND:event_btnPrintActionPerformed<NEW_LINE>// Add your handling code here:<NEW_LINE>Thread thread = new Thread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>btnPrint.setEnabled(false);<NEW_LINE>JasperPrintManager.getInstance(viewerContext.getJasperReportsContext()).print(viewerContext.getJasperPrint(), true);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (log.isErrorEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>JOptionPane.showMessageDialog(JRViewerToolbar.this, viewerContext.getBundleString("error.printing"));<NEW_LINE>} finally {<NEW_LINE>btnPrint.setEnabled(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>thread.start();<NEW_LINE>} | log.error("Print error.", ex); |
735,870 | private void handleDcmp(int opcode) {<NEW_LINE>Item it = pop();<NEW_LINE>Item it2 = pop();<NEW_LINE>if ((it.getConstant() != null) && it2.getConstant() != null) {<NEW_LINE>double d = constantToDouble(it);<NEW_LINE>double d2 = constantToDouble(it2);<NEW_LINE>if (Double.isNaN(d) || Double.isNaN(d2)) {<NEW_LINE>if (opcode == Const.DCMPG) {<NEW_LINE>push(new Item("I", Integer.valueOf(1)));<NEW_LINE>} else {<NEW_LINE>push(new Item("I", Integer.valueOf(-1)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (d2 < d) {<NEW_LINE>push(new Item("I", Integer.valueOf(-1)));<NEW_LINE>} else if (d2 > d) {<NEW_LINE>push(new Item("I", Integer.valueOf(1)));<NEW_LINE>} else {<NEW_LINE>push(new Item("I", <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>push(new Item("I"));<NEW_LINE>}<NEW_LINE>} | Integer.valueOf(0))); |
52,913 | public List<ValidateError> validate(Map<String, String> values) {<NEW_LINE>List<ValidateError> errors = new ArrayList<>();<NEW_LINE>Validator validator;<NEW_LINE>ValidateError error;<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(values.get("systemName"), convLabelName("System Name"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(values.get("systemName")<MASK><NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(values.get("configName"), convLabelName("Config Name"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(values.get("configName"), convLabelName("Config Name"), 256);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(values.get("rowId"), convLabelName("Row Id"), 64);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(values.get("insertUser"), convLabelName("Insert User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(values.get("updateUser"), convLabelName("Update User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(values.get("deleteFlag"), convLabelName("Delete Flag"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>} | , convLabelName("System Name"), 64); |
901,007 | public Object decode(Channel channel, String remoteIp, byte[] data) throws IOException {<NEW_LINE>if (data.length <= RpcProtocolVersion.VERSION_1.getHeaderLength()) {<NEW_LINE>throw new MotanFrameworkException("decode error: format problem", MotanErrorMsgConstant.FRAMEWORK_DECODE_ERROR);<NEW_LINE>}<NEW_LINE>short type = <MASK><NEW_LINE>if (type != MAGIC) {<NEW_LINE>throw new MotanFrameworkException("decode error: magic error", MotanErrorMsgConstant.FRAMEWORK_DECODE_ERROR);<NEW_LINE>}<NEW_LINE>if (data[2] != RpcProtocolVersion.VERSION_1.getVersion()) {<NEW_LINE>throw new MotanFrameworkException("decode error: version error", MotanErrorMsgConstant.FRAMEWORK_DECODE_ERROR);<NEW_LINE>}<NEW_LINE>int bodyLength = ByteUtil.bytes2int(data, 12);<NEW_LINE>if (RpcProtocolVersion.VERSION_1.getHeaderLength() + bodyLength != data.length) {<NEW_LINE>throw new MotanFrameworkException("decode error: content length error", MotanErrorMsgConstant.FRAMEWORK_DECODE_ERROR);<NEW_LINE>}<NEW_LINE>byte flag = data[3];<NEW_LINE>byte dataType = (byte) (flag & MASK);<NEW_LINE>boolean isResponse = (dataType != MotanConstants.FLAG_REQUEST);<NEW_LINE>CodedInputStream body = CodedInputStream.newInstance(data, RpcProtocolVersion.VERSION_1.getHeaderLength(), bodyLength);<NEW_LINE>long requestId = ByteUtil.bytes2long(data, 4);<NEW_LINE>Serialization serialization = ExtensionLoader.getExtensionLoader(Serialization.class).getExtension(channel.getUrl().getParameter(URLParamType.serialize.getName(), URLParamType.serialize.getValue()));<NEW_LINE>try {<NEW_LINE>if (isResponse) {<NEW_LINE>// response<NEW_LINE>return decodeResponse(body, dataType, requestId, serialization);<NEW_LINE>} else {<NEW_LINE>return decodeRequest(body, requestId, serialization);<NEW_LINE>}<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new MotanFrameworkException("decode " + (isResponse ? "response" : "request") + " error: class not found", e, MotanErrorMsgConstant.FRAMEWORK_DECODE_ERROR);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (ExceptionUtil.isMotanException(e)) {<NEW_LINE>throw (RuntimeException) e;<NEW_LINE>} else {<NEW_LINE>throw new MotanFrameworkException("decode error: isResponse=" + isResponse, e, MotanErrorMsgConstant.FRAMEWORK_DECODE_ERROR);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ByteUtil.bytes2short(data, 0); |
468,485 | public static void installApk(Context context, DownloadsUtil.DownloadInfo info) {<NEW_LINE>Intent installIntent = new Intent(Intent.ACTION_INSTALL_PACKAGE);<NEW_LINE>installIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>Uri uri;<NEW_LINE>if (Build.VERSION.SDK_INT >= 24) {<NEW_LINE>uri = FileProvider.getUriForFile(context, "de.robv.android.xposed.installer.fileprovider", new File(info.localFilename));<NEW_LINE>installIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);<NEW_LINE>} else {<NEW_LINE>uri = Uri.fromFile(new File(info.localFilename));<NEW_LINE>}<NEW_LINE>installIntent.<MASK><NEW_LINE>installIntent.putExtra(Intent.EXTRA_INSTALLER_PACKAGE_NAME, context.getApplicationInfo().packageName);<NEW_LINE>context.startActivity(installIntent);<NEW_LINE>} | setDataAndType(uri, DownloadsUtil.MIME_TYPE_APK); |
658,169 | public void init(FilterConfig config) throws ServletException {<NEW_LINE>String associatePeriod = config.getInitParameter("associatePeriod");<NEW_LINE>if (associatePeriod != null)<NEW_LINE>_associatePeriod = Long.parseLong(associatePeriod);<NEW_LINE>String maxAssociations = config.getInitParameter("maxAssociations");<NEW_LINE>if (maxAssociations != null)<NEW_LINE>_maxAssociations = Integer.parseInt(maxAssociations);<NEW_LINE>String hosts = config.getInitParameter("hosts");<NEW_LINE>if (hosts != null)<NEW_LINE>Collections.addAll(_hosts, StringUtil.csvSplit(hosts));<NEW_LINE>String ports = config.getInitParameter("ports");<NEW_LINE>if (ports != null)<NEW_LINE>for (String p : StringUtil.csvSplit(ports)) {<NEW_LINE>_ports.add(Integer.parseInt(p));<NEW_LINE>}<NEW_LINE>_useQueryInKey = Boolean.parseBoolean(config.getInitParameter("useQueryInKey"));<NEW_LINE>// Expose for JMX.<NEW_LINE>config.getServletContext().setAttribute(<MASK><NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("period={} max={} hosts={} ports={}", _associatePeriod, _maxAssociations, _hosts, _ports);<NEW_LINE>} | config.getFilterName(), this); |
260,479 | public Page<Article> search(String keyword, int pageNum, int pageSize) {<NEW_LINE>BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder();<NEW_LINE>boolQueryBuilder.should(new MatchQueryBuilder("title", keyword));<NEW_LINE>boolQueryBuilder.should(new MatchQueryBuilder("content", keyword));<NEW_LINE>SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();<NEW_LINE>sourceBuilder.from(pageNum * pageSize - pageSize);<NEW_LINE>sourceBuilder.size(pageSize);<NEW_LINE>sourceBuilder.query(boolQueryBuilder);<NEW_LINE>SearchRequest searchRequest = new SearchRequest();<NEW_LINE>searchRequest.source(sourceBuilder);<NEW_LINE>searchRequest.indices(index);<NEW_LINE>searchRequest.types(type);<NEW_LINE>try {<NEW_LINE>SearchResponse response = getClient().search(searchRequest, RequestOptions.DEFAULT);<NEW_LINE>if (response == null || response.getHits() == null || response.getHits().getTotalHits().value <= 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int total = (int) response.getHits().getTotalHits().value;<NEW_LINE>List<Article> articles = new ArrayList<>();<NEW_LINE>response.getHits().forEach(hit -> {<NEW_LINE>Article article = new Article();<NEW_LINE>article.put(hit.getSourceAsMap());<NEW_LINE>articles.add(article);<NEW_LINE>});<NEW_LINE>return new Page<>(articles, pageNum, pageSize, total / pageSize, total);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(<MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | e.toString(), e); |
205,380 | public static void fitToScreen(Rectangle r) {<NEW_LINE>Rectangle screen = getScreenRectangle(<MASK><NEW_LINE>int xOverdraft = r.x + r.width - screen.x - screen.width;<NEW_LINE>if (xOverdraft > 0) {<NEW_LINE>int shift = Math.min(xOverdraft, r.x - screen.x);<NEW_LINE>xOverdraft -= shift;<NEW_LINE>r.x -= shift;<NEW_LINE>if (xOverdraft > 0) {<NEW_LINE>r.width -= xOverdraft;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int yOverdraft = r.y + r.height - screen.y - screen.height;<NEW_LINE>if (yOverdraft > 0) {<NEW_LINE>int shift = Math.min(yOverdraft, r.y - screen.y);<NEW_LINE>yOverdraft -= shift;<NEW_LINE>r.y -= shift;<NEW_LINE>if (yOverdraft > 0) {<NEW_LINE>r.height -= yOverdraft;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | r.x, r.y); |
358,685 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>sourcePanel = new javax.swing.JPanel();<NEW_LINE>sourceInfoPanel = new javax.swing.JPanel();<NEW_LINE>sourceNamePanel = <MASK><NEW_LINE>sourceNameLabel = new javax.swing.JLabel();<NEW_LINE>sourceComponentName = new javax.swing.JTextField();<NEW_LINE>eventSelectLabelPanel = new javax.swing.JPanel();<NEW_LINE>eventSelectLabel = new javax.swing.JLabel();<NEW_LINE>eventSelectScroll = new javax.swing.JScrollPane();<NEW_LINE>eventSelectTree = new javax.swing.JTree();<NEW_LINE>eventHandlerPanel = new javax.swing.JPanel();<NEW_LINE>eventNameLabel = new javax.swing.JLabel();<NEW_LINE>eventNameCombo = new javax.swing.JComboBox();<NEW_LINE>setLayout(new java.awt.BorderLayout(0, 11));<NEW_LINE>sourcePanel.setLayout(new java.awt.BorderLayout());<NEW_LINE>sourceInfoPanel.setLayout(new java.awt.GridLayout(2, 1));<NEW_LINE>sourceNamePanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 0));<NEW_LINE>sourceNameLabel.setLabelFor(sourceComponentName);<NEW_LINE>sourceNameLabel.setText("Source Component:");<NEW_LINE>sourceNameLabel.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 6));<NEW_LINE>sourceNamePanel.add(sourceNameLabel);<NEW_LINE>sourceComponentName.setEditable(false);<NEW_LINE>sourceComponentName.setColumns(30);<NEW_LINE>sourceNamePanel.add(sourceComponentName);<NEW_LINE>sourceInfoPanel.add(sourceNamePanel);<NEW_LINE>eventSelectLabelPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 3));<NEW_LINE>eventSelectLabel.setLabelFor(eventSelectTree);<NEW_LINE>eventSelectLabel.setText("Events");<NEW_LINE>eventSelectLabelPanel.add(eventSelectLabel);<NEW_LINE>sourceInfoPanel.add(eventSelectLabelPanel);<NEW_LINE>sourcePanel.add(sourceInfoPanel, java.awt.BorderLayout.NORTH);<NEW_LINE>eventSelectScroll.setMaximumSize(new java.awt.Dimension(32767, 100));<NEW_LINE>eventSelectTree.setRootVisible(false);<NEW_LINE>eventSelectTree.setShowsRootHandles(true);<NEW_LINE>eventSelectScroll.setViewportView(eventSelectTree);<NEW_LINE>sourcePanel.add(eventSelectScroll, java.awt.BorderLayout.CENTER);<NEW_LINE>add(sourcePanel, java.awt.BorderLayout.CENTER);<NEW_LINE>eventHandlerPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Event Handler Method"));<NEW_LINE>eventHandlerPanel.setLayout(new java.awt.BorderLayout(8, 0));<NEW_LINE>eventNameLabel.setLabelFor(eventNameCombo);<NEW_LINE>eventNameLabel.setText("Method Name:");<NEW_LINE>eventHandlerPanel.add(eventNameLabel, java.awt.BorderLayout.WEST);<NEW_LINE>eventNameCombo.setEditable(true);<NEW_LINE>eventHandlerPanel.add(eventNameCombo, java.awt.BorderLayout.CENTER);<NEW_LINE>add(eventHandlerPanel, java.awt.BorderLayout.SOUTH);<NEW_LINE>} | new javax.swing.JPanel(); |
1,215,284 | protected ProcessInstanceBatchMigrationPartResult convertFromBatchPart(BatchPart batchPart, ObjectMapper objectMapper) {<NEW_LINE>ProcessInstanceBatchMigrationPartResult partResult = new ProcessInstanceBatchMigrationPartResult();<NEW_LINE>partResult.setBatchId(batchPart.getId());<NEW_LINE>partResult.setProcessInstanceId(batchPart.getScopeId());<NEW_LINE>partResult.setSourceProcessDefinitionId(batchPart.getBatchSearchKey());<NEW_LINE>partResult.setTargetProcessDefinitionId(batchPart.getBatchSearchKey2());<NEW_LINE>if (batchPart.getCompleteTime() != null) {<NEW_LINE>partResult.setStatus(ProcessInstanceBatchMigrationResult.STATUS_COMPLETED);<NEW_LINE>}<NEW_LINE>partResult.setResult(batchPart.getStatus());<NEW_LINE>ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();<NEW_LINE>if (ProcessInstanceBatchMigrationResult.RESULT_FAIL.equals(batchPart.getStatus()) && batchPart.getResultDocumentJson(processEngineConfiguration.getEngineCfgKey()) != null) {<NEW_LINE>try {<NEW_LINE>JsonNode resultNode = objectMapper.readTree(batchPart.getResultDocumentJson<MASK><NEW_LINE>if (resultNode.has(BATCH_RESULT_MESSAGE_LABEL)) {<NEW_LINE>String resultMessage = resultNode.get(BATCH_RESULT_MESSAGE_LABEL).asText();<NEW_LINE>partResult.setMigrationMessage(resultMessage);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new FlowableException("Error reading batch part " + batchPart.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return partResult;<NEW_LINE>} | (processEngineConfiguration.getEngineCfgKey())); |
1,819,669 | public Set<String> parse(String s) {<NEW_LINE>Set<String> result = new HashSet<>();<NEW_LINE>StringBuilder currentToken = new StringBuilder();<NEW_LINE>boolean inEscapeMode = false;<NEW_LINE>for (int i = 0; i < s.length(); i++) {<NEW_LINE>if (inEscapeMode) {<NEW_LINE>inEscapeMode = false;<NEW_LINE>currentToken.append(s.charAt(i));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (s.charAt(i) == ESCAPE_CHAR) {<NEW_LINE>inEscapeMode = true;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (s.charAt(i) == delimiter) {<NEW_LINE>result.<MASK><NEW_LINE>currentToken = new StringBuilder();<NEW_LINE>} else {<NEW_LINE>currentToken.append(s.charAt(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (currentToken.length() > 0) {<NEW_LINE>result.add(currentToken.toString());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | add(currentToken.toString()); |
1,340,248 | public static void grayToBuffered(GrayF32 src, DataBufferByte buffer, WritableRaster dst) {<NEW_LINE>final float[] srcData = src.data;<NEW_LINE>final byte[] dstData = buffer.getData();<NEW_LINE>final int numBands = dst.getNumBands();<NEW_LINE>if (numBands == 3) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, src.height, y -> {<NEW_LINE>for (int y = 0; y < src.height; y++) {<NEW_LINE>int indexSrc = src.startIndex + src.stride * y;<NEW_LINE>int indexSrcEnd = indexSrc + src.width;<NEW_LINE>int indexDst = y * src.width * numBands;<NEW_LINE>for (; indexSrc < indexSrcEnd; indexSrc++) {<NEW_LINE>byte val = (byte) srcData[indexSrc];<NEW_LINE>dstData[indexDst++] = val;<NEW_LINE>dstData[indexDst++] = val;<NEW_LINE>dstData[indexDst++] = val;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else if (numBands == 1) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, src.height, y -> {<NEW_LINE>for (int y = 0; y < src.height; y++) {<NEW_LINE>int indexSrc = src.startIndex + src.stride * y;<NEW_LINE>int indexSrcEnd = indexSrc + src.width;<NEW_LINE>int indexDst = y * src.width * numBands;<NEW_LINE>for (; indexSrc < indexSrcEnd; indexSrc++) {<NEW_LINE>dstData[indexDst++] <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else if (numBands == 4) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, src.height, y -> {<NEW_LINE>for (int y = 0; y < src.height; y++) {<NEW_LINE>int indexSrc = src.startIndex + src.stride * y;<NEW_LINE>int indexSrcEnd = indexSrc + src.width;<NEW_LINE>int indexDst = y * src.width * numBands;<NEW_LINE>for (; indexSrc < indexSrcEnd; indexSrc++) {<NEW_LINE>byte val = (byte) srcData[indexSrc];<NEW_LINE>indexDst++;<NEW_LINE>dstData[indexDst++] = val;<NEW_LINE>dstData[indexDst++] = val;<NEW_LINE>dstData[indexDst++] = val;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Code more here");<NEW_LINE>}<NEW_LINE>} | = (byte) srcData[indexSrc]; |
1,517,742 | public static String utf8SubString_old(String str, int len) {<NEW_LINE>if (len < 0 || StringUtils.isEmpty(str) || utf8Length(str) <= len) {<NEW_LINE>return str;<NEW_LINE>}<NEW_LINE>byte[] bs = ArrayUtils.subarray(str.getBytes(Charset.forName("UTF-8")), 0, len);<NEW_LINE>String cut = new String(bs, Charset.forName("UTF-8"));<NEW_LINE>if (!cut.isEmpty()) {<NEW_LINE>cut = cut.substring(0, <MASK><NEW_LINE>}<NEW_LINE>for (int i = cut.length(); i < str.length(); i++) {<NEW_LINE>String buf = cut + str.charAt(i);<NEW_LINE>if (utf8Length(buf) == len) {<NEW_LINE>return buf;<NEW_LINE>} else if (utf8Length(buf) > len) {<NEW_LINE>return cut;<NEW_LINE>} else {<NEW_LINE>cut = buf;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>} | cut.length() - 1); |
537,231 | private void init(Map<String, String> requestMap, CompiledQueryProfile queryProfile, Map<String, Embedder> embedders, ZoneInfo zoneInfo) {<NEW_LINE>startTime = httpRequest.getJDiscRequest().creationTime(TimeUnit.MILLISECONDS);<NEW_LINE>if (queryProfile != null) {<NEW_LINE>// Move all request parameters to the query profile<NEW_LINE>Properties queryProfileProperties = new QueryProfileProperties(queryProfile, embedders);<NEW_LINE>properties().chain(queryProfileProperties);<NEW_LINE>setPropertiesFromRequestMap(requestMap, properties(), true);<NEW_LINE>// Create the full chain<NEW_LINE>properties().chain(new QueryProperties(this, queryProfile.getRegistry(), embedders)).chain(new ModelObjectMap()).chain(new RequestContextProperties(requestMap, zoneInfo)).chain(queryProfileProperties)<MASK><NEW_LINE>// Pass the values from the query profile which maps through a field in the Query object model<NEW_LINE>// through the property chain to cause those values to be set in the Query object model<NEW_LINE>setFieldsFrom(queryProfileProperties, requestMap);<NEW_LINE>// We need special handling for "select" because it can be both the prefix of the nested JSON select<NEW_LINE>// parameters, and a plain select expression. The latter will be disallowed by query profile types<NEW_LINE>// since they contain the former.<NEW_LINE>String select = requestMap.get(Select.SELECT);<NEW_LINE>if (select != null)<NEW_LINE>properties().set(Select.SELECT, select);<NEW_LINE>} else {<NEW_LINE>// bypass these complications if there is no query profile to get values from and validate against<NEW_LINE>properties().chain(new QueryProperties(this, CompiledQueryProfileRegistry.empty, embedders)).chain(new PropertyMap()).chain(new DefaultProperties());<NEW_LINE>setPropertiesFromRequestMap(requestMap, properties(), false);<NEW_LINE>}<NEW_LINE>properties().setParentQuery(this);<NEW_LINE>traceProperties();<NEW_LINE>} | .chain(new DefaultProperties()); |
373,319 | public ObjectMatrix3D assign(Object[][][] values) {<NEW_LINE>if (values.length != slices)<NEW_LINE>throw new IllegalArgumentException("Must have same number of slices: slices=" + values.length + "slices()=" + slices());<NEW_LINE>for (int slice = slices; --slice >= 0; ) {<NEW_LINE>Object[][] currentSlice = values[slice];<NEW_LINE>if (currentSlice.length != rows)<NEW_LINE>throw new IllegalArgumentException("Must have same number of rows in every slice: rows=" + currentSlice.<MASK><NEW_LINE>for (int row = rows; --row >= 0; ) {<NEW_LINE>Object[] currentRow = currentSlice[row];<NEW_LINE>if (currentRow.length != columns)<NEW_LINE>throw new IllegalArgumentException("Must have same number of columns in every row: columns=" + currentRow.length + "columns()=" + columns());<NEW_LINE>for (int column = columns; --column >= 0; ) {<NEW_LINE>setQuick(slice, row, column, currentRow[column]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | length + "rows()=" + rows()); |
938,674 | public AssociationStatus unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AssociationStatus associationStatus = new AssociationStatus();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Date", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associationStatus.setDate(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associationStatus.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Message", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associationStatus.setMessage(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("AdditionalInfo", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associationStatus.setAdditionalInfo(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return associationStatus;<NEW_LINE>} | class).unmarshall(context)); |
1,682,335 | public static void checkForDirectoryAndTryToDownloadToTmpDirAndUnzip(String directoryName) {<NEW_LINE>String outputDirectoryPath = tmpDirPath + "/" + directoryName;<NEW_LINE>File directory = new File(outputDirectoryPath);<NEW_LINE>if (!directory.exists() || directoryIsEmpty(directory)) {<NEW_LINE>String lastName = directory.getName();<NEW_LINE>String zipFileName = lastName + ".zip";<NEW_LINE>String urlPath = "http://truthsite.org/music/" + zipFileName;<NEW_LINE>String outputZipFilePath = tmpDirPath + "/" + zipFileName;<NEW_LINE>try {<NEW_LINE>PlayMelodyStrings.copyURLContentsToFile(new URL(urlPath), new File(outputZipFilePath));<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Unable to download zip file from " + urlPath + " into " + tmpDirPath);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>// It may already exist but be empty.<NEW_LINE>directory.mkdir();<NEW_LINE>if (!directory.exists()) {<NEW_LINE>System.<MASK><NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ArchiveUtils.unzipFileTo(outputZipFilePath, outputDirectoryPath);<NEW_LINE>} catch (IOException e) {<NEW_LINE>directory.delete();<NEW_LINE>System.err.println("Unable to unzip file from " + outputZipFilePath + " into " + tmpDirPath + " due to " + e.getMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | err.println("Could not create " + directory); |
758,411 | public static BufferedImage regionsColor(GrayS32 pixelToRegion, DogArray<float[]> segmentColor, @Nullable BufferedImage output) {<NEW_LINE>if (output == null)<NEW_LINE>output = new BufferedImage(pixelToRegion.width, pixelToRegion.height, BufferedImage.TYPE_INT_RGB);<NEW_LINE>for (int y = 0; y < pixelToRegion.height; y++) {<NEW_LINE>for (int x = 0; x < pixelToRegion.width; x++) {<NEW_LINE>int index = pixelToRegion.unsafe_get(x, y);<NEW_LINE>float[] cv = segmentColor.get(index);<NEW_LINE>int r, g, b;<NEW_LINE>if (cv.length == 3) {<NEW_LINE>r = (int) cv[0];<NEW_LINE>g <MASK><NEW_LINE>b = (int) cv[2];<NEW_LINE>} else {<NEW_LINE>r = g = b = (int) cv[0];<NEW_LINE>}<NEW_LINE>int rgb = r << 16 | g << 8 | b;<NEW_LINE>output.setRGB(x, y, rgb);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>} | = (int) cv[1]; |
218,453 | private void addDisallowedConstructors(TypeDeclaration node) {<NEW_LINE>TypeElement typeElement = node.getTypeElement();<NEW_LINE>TypeElement <MASK><NEW_LINE>if (// If we're not emitting constructors we don't need to disallow anything unless our<NEW_LINE>ElementUtil.isPrivateInnerType(typeElement) || superClass == null || // superclass is NSObject.<NEW_LINE>(!options.emitWrapperMethods() && typeUtil.getObjcClass(superClass) != TypeUtil.NS_OBJECT)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, ExecutableElement> inheritedConstructors = new HashMap<>();<NEW_LINE>// Add super constructors that have unique parameter lists.<NEW_LINE>for (ExecutableElement superC : ElementUtil.getConstructors(superClass)) {<NEW_LINE>if (ElementUtil.isPrivate(superC)) {<NEW_LINE>// Skip private super constructors since they're already unavailable.<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String selector = nameTable.getMethodSelector(superC);<NEW_LINE>inheritedConstructors.put(selector, superC);<NEW_LINE>}<NEW_LINE>// Don't disallow this class' constructors if we're emitting wrapper methods.<NEW_LINE>if (options.emitWrapperMethods()) {<NEW_LINE>for (ExecutableElement constructor : ElementUtil.getConstructors(typeElement)) {<NEW_LINE>inheritedConstructors.remove(nameTable.getMethodSelector(constructor));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, ExecutableElement> entry : inheritedConstructors.entrySet()) {<NEW_LINE>ExecutableElement oldConstructor = entry.getValue();<NEW_LINE>GeneratedExecutableElement newConstructor = GeneratedExecutableElement.newConstructorWithSelector(entry.getKey(), typeElement, typeUtil);<NEW_LINE>MethodDeclaration decl = new MethodDeclaration(newConstructor).setUnavailable(true);<NEW_LINE>decl.addModifiers(Modifier.ABSTRACT);<NEW_LINE>int count = 0;<NEW_LINE>for (VariableElement param : oldConstructor.getParameters()) {<NEW_LINE>VariableElement newParam = GeneratedVariableElement.newParameter("arg" + count++, param.asType(), newConstructor);<NEW_LINE>newConstructor.addParameter(newParam);<NEW_LINE>decl.addParameter(new SingleVariableDeclaration(newParam));<NEW_LINE>}<NEW_LINE>addImplicitParameters(decl, ElementUtil.getDeclaringClass(oldConstructor));<NEW_LINE>node.addBodyDeclaration(decl);<NEW_LINE>}<NEW_LINE>} | superClass = ElementUtil.getSuperclass(typeElement); |
1,562,577 | static <// / @Generated("This method was generated using jOOQ-tools")<NEW_LINE>T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Seq<Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>> crossApply(Iterable<? extends T1> iterable, Function<? super T1, ? extends Iterable<? extends T2>> function2, Function<? super T2, ? extends Iterable<? extends T3>> function3, Function<? super T3, ? extends Iterable<? extends T4>> function4, Function<? super T4, ? extends Iterable<? extends T5>> function5, Function<? super T5, ? extends Iterable<? extends T6>> function6, Function<? super T6, ? extends Iterable<? extends T7>> function7, Function<? super T7, ? extends Iterable<? extends T8>> function8, Function<? super T8, ? extends Iterable<? extends T9>> function9, Function<? super T9, ? extends Iterable<? extends T10>> function10, Function<? super T10, ? extends Iterable<? extends T11>> function11) {<NEW_LINE>return crossApply(seq(iterable), t -> seq(function2.apply(t)), t -> seq(function3.apply(t)), t -> seq(function4.apply(t)), t -> seq(function5.apply(t)), t -> seq(function6.apply(t)), t -> seq(function7.apply(t)), t -> seq(function8.apply(t)), t -> seq(function9.apply(t)), t -> seq(function10.apply(t)), t -> seq(<MASK><NEW_LINE>} | function11.apply(t))); |
355,801 | public void processUserInfo(TLRPC.User user, TLRPC.UserFull info, boolean fromCache, boolean force, int classGuid, ArrayList<Integer> pinnedMessages, HashMap<Integer, MessageObject> pinnedMessagesMap, int totalPinnedCount, boolean pinnedEndReached) {<NEW_LINE>AndroidUtilities.runOnUIThread(() -> {<NEW_LINE>if (fromCache) {<NEW_LINE>loadFullUser(user, classGuid, force);<NEW_LINE>}<NEW_LINE>if (info != null) {<NEW_LINE>if (fullUsers.get(user.id) == null) {<NEW_LINE>fullUsers.<MASK><NEW_LINE>int index = blockePeers.indexOfKey(user.id);<NEW_LINE>if (info.blocked) {<NEW_LINE>if (index < 0) {<NEW_LINE>blockePeers.put(user.id, 1);<NEW_LINE>getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (index >= 0) {<NEW_LINE>blockePeers.removeAt(index);<NEW_LINE>getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>getNotificationCenter().postNotificationName(NotificationCenter.userInfoDidLoad, user.id, info);<NEW_LINE>}<NEW_LINE>if (pinnedMessages != null) {<NEW_LINE>getNotificationCenter().postNotificationName(NotificationCenter.pinnedInfoDidLoad, user.id, pinnedMessages, pinnedMessagesMap, totalPinnedCount, pinnedEndReached);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | put(user.id, info); |
331,812 | public final void allReduce(Object sendbuf, Object recvbuf, int count, Datatype type, Op op) throws MPIException {<NEW_LINE>MPI.check();<NEW_LINE>op.setDatatype(type);<NEW_LINE>int sendoff = 0, recvoff = 0;<NEW_LINE>boolean sdb = false, rdb = false;<NEW_LINE>if (sendbuf instanceof Buffer && !(sdb = ((Buffer) sendbuf).isDirect())) {<NEW_LINE>sendoff = type.getOffset(sendbuf);<NEW_LINE>sendbuf = ((Buffer) sendbuf).array();<NEW_LINE>}<NEW_LINE>if (recvbuf instanceof Buffer && !(rdb = ((Buffer) recvbuf).isDirect())) {<NEW_LINE><MASK><NEW_LINE>recvbuf = ((Buffer) recvbuf).array();<NEW_LINE>}<NEW_LINE>allReduce(handle, sendbuf, sdb, sendoff, recvbuf, rdb, recvoff, count, type.handle, type.baseType, op, op.handle);<NEW_LINE>} | recvoff = type.getOffset(recvbuf); |
530,357 | private String generateForOneCommand(String message) {<NEW_LINE>if (!extensionLoader.hasExtension(message)) {<NEW_LINE>return "No such command " + message;<NEW_LINE>}<NEW_LINE>TelnetHandler <MASK><NEW_LINE>Help help = handler.getClass().getAnnotation(Help.class);<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>buf.append("Command:\r\n ");<NEW_LINE>buf.append(message + " " + help.parameter().replace("\r\n", " ").replace("\n", " "));<NEW_LINE>buf.append("\r\nSummary:\r\n ");<NEW_LINE>buf.append(help.summary().replace("\r\n", " ").replace("\n", " "));<NEW_LINE>buf.append("\r\nDetail:\r\n ");<NEW_LINE>buf.append(help.detail().replace("\r\n", " \r\n").replace("\n", " \n"));<NEW_LINE>return buf.toString();<NEW_LINE>} | handler = extensionLoader.getExtension(message); |
1,537,200 | // Handle show resources<NEW_LINE>private void handleShowResources() {<NEW_LINE>ShowResourcesStmt showStmt = (ShowResourcesStmt) stmt;<NEW_LINE>List<List<Comparable>> resourcesInfos = Env.getCurrentEnv().getResourceMgr().getResourcesInfo(showStmt.getNameValue(), showStmt.isAccurateMatch(), showStmt.getTypeSet());<NEW_LINE>// order the result of List<LoadInfo> by orderByPairs in show stmt<NEW_LINE>List<OrderByPair> orderByPairs = showStmt.getOrderByPairs();<NEW_LINE>ListComparator<List<Comparable>> comparator = null;<NEW_LINE>if (orderByPairs != null) {<NEW_LINE>OrderByPair[] orderByPairArr = new OrderByPair[orderByPairs.size()];<NEW_LINE>comparator = new ListComparator<List<Comparable>>(orderByPairs.toArray(orderByPairArr));<NEW_LINE>} else {<NEW_LINE>// sort by name asc<NEW_LINE>comparator = new ListComparator<<MASK><NEW_LINE>}<NEW_LINE>Collections.sort(resourcesInfos, comparator);<NEW_LINE>List<List<String>> rows = Lists.newArrayList();<NEW_LINE>for (List<Comparable> resourceInfo : resourcesInfos) {<NEW_LINE>List<String> oneResource = new ArrayList<String>(resourceInfo.size());<NEW_LINE>for (Comparable element : resourceInfo) {<NEW_LINE>oneResource.add(element.toString());<NEW_LINE>}<NEW_LINE>rows.add(oneResource);<NEW_LINE>}<NEW_LINE>// filter by limit<NEW_LINE>long limit = showStmt.getLimit();<NEW_LINE>long offset = showStmt.getOffset() == -1L ? 0 : showStmt.getOffset();<NEW_LINE>if (offset >= rows.size()) {<NEW_LINE>rows = Lists.newArrayList();<NEW_LINE>} else if (limit != -1L) {<NEW_LINE>if ((limit + offset) < rows.size()) {<NEW_LINE>rows = rows.subList((int) offset, (int) (limit + offset));<NEW_LINE>} else {<NEW_LINE>rows = rows.subList((int) offset, rows.size());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Only success<NEW_LINE>resultSet = new ShowResultSet(showStmt.getMetaData(), rows);<NEW_LINE>} | List<Comparable>>(0); |
1,124,218 | // XXX should be moved into the GeneratorUtils:<NEW_LINE>private static BlockTree createDefaultMethodBody(WorkingCopy wc, TreePath targetTree, TypeMirror returnType, String name) {<NEW_LINE>TreeUtilities tu = wc.getTreeUtilities();<NEW_LINE>TypeElement targetClazz = (TypeElement) wc.getTrees().getElement(targetTree);<NEW_LINE>// NOI18N<NEW_LINE>StatementTree st = tu.parseStatement("{class ${abstract " + (returnType != null ? returnType.toString() : "void") + " " + ("<init>".equals(name) ? targetClazz.getSimpleName() : name) + "();}}", new SourcePositions[1]);<NEW_LINE>Trees trees = wc.getTrees();<NEW_LINE>List<? extends Tree> members = ((ClassTree) targetTree.getLeaf()).getMembers();<NEW_LINE>Scope scope = members.isEmpty() ? trees.getScope(targetTree) : trees.getScope(new TreePath(targetTree, <MASK><NEW_LINE>tu.attributeTree(st, scope);<NEW_LINE>Tree first = null;<NEW_LINE>for (Tree t : ((ClassTree) ((BlockTree) st).getStatements().get(0)).getMembers()) {<NEW_LINE>if (t.getKind() == Tree.Kind.METHOD && !"<init>".contentEquals(((MethodTree) t).getName())) {<NEW_LINE>// NOI19N<NEW_LINE>first = t;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ExecutableElement ee = (ExecutableElement) wc.getTrees().getElement(new TreePath(targetTree, first));<NEW_LINE>return GeneratorUtilities.get(wc).createAbstractMethodImplementation(targetClazz, ee).getBody();<NEW_LINE>} | members.get(0))); |
1,510,366 | public void map(InfoMap infoMap) {<NEW_LINE>infoMap.put(new Info("std::set<std::string>").pointerTypes("StringSet").define());<NEW_LINE>infoMap.put(new Info("std::list<std::string>").pointerTypes("StringList").define());<NEW_LINE>infoMap.put(new Info("std::list<modsecurity::RuleMessage>").pointerTypes<MASK><NEW_LINE>infoMap.put(new Info("ModSecurityIntervention_t").pointerTypes("ModSecurityIntervention").define());<NEW_LINE>infoMap.put(new Info("modsecurity").pointerTypes("ModSecurity").define());<NEW_LINE>infoMap.put(new Info("std::basic_string<char>").annotations("@StdString").valueTypes("BytePointer").pointerTypes("@Cast({\"char*\", \"std::string\"}) BytePointer"));<NEW_LINE>infoMap.put(new Info("string", "std::string").annotations("@StdString").valueTypes("BytePointer", "String").pointerTypes("@Cast({\"char*\", \"std::string*\"}) BytePointer"));<NEW_LINE>infoMap.put(new Info("clock_t").skip());<NEW_LINE>infoMap.put(new Info("std::list<int>").skip());<NEW_LINE>infoMap.put(new Info("std::list<std::pair<int,int> >").skip());<NEW_LINE>infoMap.put(new Info("std::list<std::pair<std::string,std::string> >").skip());<NEW_LINE>infoMap.put(new Info("std::list<std::pair<int,std::string> >").skip());<NEW_LINE>infoMap.put(new Info("std::ostringstream").skip());<NEW_LINE>infoMap.put(new Info("Collections").skip());<NEW_LINE>infoMap.put(new Info("collection::Collections").skip());<NEW_LINE>infoMap.put(new Info("Collection").skip());<NEW_LINE>infoMap.put(new Info("std::map<std::string,std::string>").skip());<NEW_LINE>infoMap.put(new Info("std::shared_ptr<modsecurity::RequestBodyProcessor::MultipartPartTmpFile>").skip());<NEW_LINE>infoMap.put(new Info("AnchoredSetVariable").skip());<NEW_LINE>infoMap.put(new Info("AnchoredSetVariableTranslationProxy").skip());<NEW_LINE>infoMap.put(new Info("TransactionSecMarkerManagement").skip());<NEW_LINE>infoMap.put(new Info("TransactionAnchoredVariables").skip());<NEW_LINE>infoMap.put(new Info("AnchoredVariable").skip());<NEW_LINE>infoMap.put(new Info("VariableOrigin").skip());<NEW_LINE>infoMap.put(new Info("VariableValue").skip());<NEW_LINE>infoMap.put(new Info("Origins").skip());<NEW_LINE>infoMap.put(new Info("Rules").skip());<NEW_LINE>infoMap.put(new Info("Rule").skip());<NEW_LINE>infoMap.put(new Info("RulesSetPhases").skip());<NEW_LINE>infoMap.put(new Info("RuleWithActions").skip());<NEW_LINE>infoMap.put(new Info("std::shared_ptr<std::string>").skip());<NEW_LINE>infoMap.put(new Info("std::shared_ptr<RuleMessage>").skip());<NEW_LINE>infoMap.put(new Info("std::unique_ptr<std::string>").skip());<NEW_LINE>infoMap.put(new Info("std::shared_ptr<actions::Action>").skip());<NEW_LINE>} | ("RuleMessageList").define()); |
1,238,727 | protected RemoteOperationResult run(OwnCloudClient client) {<NEW_LINE>RemoteOperationResult result = null;<NEW_LINE>RemoteOperation operation;<NEW_LINE>if (MimeTypeUtil.isImage(fileToRemove.getMimeType())) {<NEW_LINE>// store resized image<NEW_LINE>ThumbnailsCacheManager.generateResizedImage(fileToRemove);<NEW_LINE>}<NEW_LINE>boolean localRemovalFailed = false;<NEW_LINE>if (!onlyLocalCopy) {<NEW_LINE>if (fileToRemove.isEncrypted()) {<NEW_LINE>OCFile parent = getStorageManager().getFileByPath(fileToRemove.getParentRemotePath());<NEW_LINE>operation = new RemoveRemoteEncryptedFileOperation(fileToRemove.getRemotePath(), parent.getLocalId(), account, context, fileToRemove.getEncryptedFileName());<NEW_LINE>} else {<NEW_LINE>operation = new RemoveFileRemoteOperation(fileToRemove.getRemotePath());<NEW_LINE>}<NEW_LINE>result = operation.execute(client);<NEW_LINE>if (result.isSuccess() || result.getCode() == ResultCode.FILE_NOT_FOUND) {<NEW_LINE>localRemovalFailed = !(getStorageManager().removeFile<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>localRemovalFailed = !(getStorageManager().removeFile(fileToRemove, false, true));<NEW_LINE>if (!localRemovalFailed) {<NEW_LINE>result = new RemoteOperationResult(ResultCode.OK);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (localRemovalFailed) {<NEW_LINE>result = new RemoteOperationResult(ResultCode.LOCAL_STORAGE_NOT_REMOVED);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | (fileToRemove, true, true)); |
199,720 | public void verify(Component component, JRVerifier verifier) {<NEW_LINE>ListComponent listComponent = (ListComponent) component;<NEW_LINE>JRDatasetRun datasetRun = listComponent.getDatasetRun();<NEW_LINE>if (datasetRun == null) {<NEW_LINE>verifier.addBrokenRule("No list subdataset run set", listComponent);<NEW_LINE>} else {<NEW_LINE>verifier.verifyDatasetRun(datasetRun);<NEW_LINE>}<NEW_LINE>ListContents listContents = listComponent.getContents();<NEW_LINE>if (listContents == null) {<NEW_LINE>verifier.addBrokenRule("No list contents set", listComponent);<NEW_LINE>} else {<NEW_LINE>PrintOrderEnum listPrintOrder = listComponent.getPrintOrderValue() == null ? PrintOrderEnum.VERTICAL : listComponent.getPrintOrderValue();<NEW_LINE><MASK><NEW_LINE>boolean ignoreWidth = listIgnoreWidth != null && listIgnoreWidth;<NEW_LINE>if (listContents.getHeight() < 0) {<NEW_LINE>verifier.addBrokenRule("List contents height must be positive.", listContents);<NEW_LINE>}<NEW_LINE>int elementWidth = verifier.getCurrentComponentElement().getWidth();<NEW_LINE>Integer width = listContents.getWidth();<NEW_LINE>int contentsWidth;<NEW_LINE>if (width == null) {<NEW_LINE>contentsWidth = elementWidth;<NEW_LINE>if (listPrintOrder == PrintOrderEnum.HORIZONTAL) {<NEW_LINE>verifier.addBrokenRule("List contents width must be set for horizontal lists", listContents);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>contentsWidth = width;<NEW_LINE>if (width <= 0) {<NEW_LINE>verifier.addBrokenRule("List contents width must be positive.", listContents);<NEW_LINE>}<NEW_LINE>if (!ignoreWidth && listPrintOrder == PrintOrderEnum.HORIZONTAL && width > elementWidth) {<NEW_LINE>verifier.addBrokenRule("List contents width is larger than the list element width", listComponent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String subdataset = datasetRun == null ? null : datasetRun.getDatasetName();<NEW_LINE>if (subdataset != null) {<NEW_LINE>verifier.pushSubdatasetContext(subdataset);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>verifyContents(verifier, listContents, contentsWidth);<NEW_LINE>} finally {<NEW_LINE>if (subdataset != null) {<NEW_LINE>verifier.popSubdatasetContext();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Boolean listIgnoreWidth = listComponent.getIgnoreWidth(); |
583,710 | private List<Work> listWork(EntityManagerContainer emc, Date threshold, String sequence) throws Exception {<NEW_LINE>EntityManager em = emc.get(Work.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Tuple> cq = cb.createQuery(Tuple.class);<NEW_LINE>Root<Work> root = cq.from(Work.class);<NEW_LINE>Path<String> id_path = root.get(Work_.id);<NEW_LINE>Path<String> job_path = root.get(Work_.job);<NEW_LINE>Path<String> sequence_path = root.get(Work_.sequence);<NEW_LINE>Path<String> title_path = root.get(Work_.title);<NEW_LINE>Path<Date> activityArrivedTime_path = root.get(Work_.activityArrivedTime);<NEW_LINE>Predicate p = cb.lessThan(activityArrivedTime_path, threshold);<NEW_LINE>if (StringUtils.isNotEmpty(sequence)) {<NEW_LINE>p = cb.and(p, cb.greaterThan(sequence_path, sequence));<NEW_LINE>}<NEW_LINE>cq.multiselect(id_path, job_path, sequence_path, title_path, activityArrivedTime_path).where(p).orderBy(cb.asc(sequence_path));<NEW_LINE>List<Tuple> os = em.createQuery(cq).setMaxResults(200).getResultList();<NEW_LINE>List<Work> <MASK><NEW_LINE>for (Tuple o : os) {<NEW_LINE>Work work = new Work();<NEW_LINE>work.setId(o.get(id_path));<NEW_LINE>work.setJob(o.get(job_path));<NEW_LINE>work.setSequence(o.get(sequence_path));<NEW_LINE>work.setTitle(o.get(title_path));<NEW_LINE>work.setStartTime(o.get(activityArrivedTime_path));<NEW_LINE>list.add(work);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} | list = new ArrayList<>(); |
1,515,367 | /*<NEW_LINE>* Generate artificial tangent for un-textured face<NEW_LINE>*/<NEW_LINE>static void generateTB(Vec3f v0, Vec3f v1, Vec3f v2, Vec3f[] ntb) {<NEW_LINE>MeshTempState instance = MeshTempState.getInstance();<NEW_LINE>Vec3f a = instance.vec3f1;<NEW_LINE><MASK><NEW_LINE>Vec3f b = instance.vec3f2;<NEW_LINE>b.sub(v2, v0);<NEW_LINE>if (a.dot(a) > b.dot(b)) {<NEW_LINE>ntb[1].set(a);<NEW_LINE>// TODO: make sure each triangle area (size) will be considered<NEW_LINE>ntb[1].normalize();<NEW_LINE>ntb[2].cross(ntb[0], ntb[1]);<NEW_LINE>} else {<NEW_LINE>ntb[2].set(b);<NEW_LINE>// TODO: make sure each triangle area (size) will be considered<NEW_LINE>ntb[2].normalize();<NEW_LINE>ntb[1].cross(ntb[2], ntb[0]);<NEW_LINE>}<NEW_LINE>} | a.sub(v1, v0); |
824,491 | private void initEntityClass() {<NEW_LINE>if (from == null) {<NEW_LINE>throw new JPQLParseException("Bad query format FROM clause is mandatory for SELECT queries");<NEW_LINE>}<NEW_LINE>String[] fromArray = from.split(" ");<NEW_LINE>if (!this.isDeleteUpdate) {<NEW_LINE>if (fromArray.length == 3 && fromArray[1].equalsIgnoreCase("as")) {<NEW_LINE>fromArray = new String[] { fromArray[0], fromArray[2] };<NEW_LINE>}<NEW_LINE>if (fromArray.length != 2) {<NEW_LINE>throw new JPQLParseException("Bad query format: " + from + ". Identification variable is mandatory in FROM clause for SELECT queries");<NEW_LINE>}<NEW_LINE>// TODO<NEW_LINE>StringTokenizer tokenizer = new StringTokenizer(result[0], ",");<NEW_LINE>while (tokenizer.hasMoreTokens()) {<NEW_LINE>String token = tokenizer.nextToken();<NEW_LINE>if (!StringUtils.containsAny(fromArray[1] + ".", token)) {<NEW_LINE>throw new QueryHandlerException("bad query format with invalid alias:" + token);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (fromArray.length == 2)<NEW_LINE>this.entityAlias = fromArray[1];<NEW_LINE>persistenceUnit = kunderaMetadata.getApplicationMetadata().getMappedPersistenceUnit(entityName);<NEW_LINE>// Get specific metamodel.<NEW_LINE>MetamodelImpl model = getMetamodel(persistenceUnit);<NEW_LINE>if (model != null) {<NEW_LINE>entityClass = model.getEntityClass(entityName);<NEW_LINE>}<NEW_LINE>if (null == entityClass) {<NEW_LINE>logger.error("No entity {} found, please verify it is properly annotated with @Entity and not a mapped Super class", entityName);<NEW_LINE>throw new QueryHandlerException("No entity found by the name: " + entityName);<NEW_LINE>}<NEW_LINE>EntityMetadata metadata = model.getEntityMetadata(entityClass);<NEW_LINE>if (metadata != null && !metadata.isIndexable()) {<NEW_LINE>throw new QueryHandlerException(entityClass + " is not indexed. Not possible to run a query on it." + " Check whether it was properly annotated for indexing.");<NEW_LINE>}<NEW_LINE>} | this.entityName = fromArray[0]; |
1,714,174 | private void updateView(NeededMapsVH holder) {<NEW_LINE>boolean paidVersion = Version.isPaidVersion(app);<NEW_LINE>for (int i = 0; i < items.size(); i++) {<NEW_LINE>IndexItem item = items.get(i);<NEW_LINE>boolean downloading = downloadThread.isDownloading(item);<NEW_LINE>boolean currentDownloading = downloading && downloadThread.getCurrentDownloadingItem() == item;<NEW_LINE>boolean lastItem = i == items.size() - 1;<NEW_LINE>final View view = holder.itemsContainer.getChildAt(i);<NEW_LINE>if (item.isDownloaded()) {<NEW_LINE>view.setOnClickListener(null);<NEW_LINE>} else {<NEW_LINE>view.setTag(item);<NEW_LINE>view.setOnClickListener(onItemClickListener);<NEW_LINE>}<NEW_LINE>((ImageView) view.findViewById(R.id.icon)).setImageDrawable(getActiveIcon(item.getType().getIconResource()));<NEW_LINE>((TextView) view.findViewById(R.id.title)).setText(item.getVisibleName(app, app.getRegions(), false));<NEW_LINE>((TextView) view.findViewById(R.id.description)).setText(getItemDescription(item));<NEW_LINE>ImageView iconAction = (ImageView) view.findViewById(R.id.icon_action);<NEW_LINE>Button buttonAction = (Button) view.findViewById(R.id.button_action);<NEW_LINE>if (item.isDownloaded()) {<NEW_LINE>iconAction.setVisibility(View.GONE);<NEW_LINE>buttonAction.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>boolean showBtn = !paidVersion && (item.getType() == DownloadActivityType.WIKIPEDIA_FILE || item.getType() == DownloadActivityType.TRAVEL_FILE);<NEW_LINE>iconAction.setVisibility(showBtn ? <MASK><NEW_LINE>buttonAction.setVisibility(showBtn ? View.VISIBLE : View.GONE);<NEW_LINE>if (showBtn) {<NEW_LINE>buttonAction.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>view.callOnClick();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>iconAction.setImageDrawable(downloading ? cancelIcon : downloadIcon);<NEW_LINE>buttonAction.setOnClickListener(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.progress_bar);<NEW_LINE>progressBar.setVisibility(downloading ? View.VISIBLE : View.GONE);<NEW_LINE>if (currentDownloading) {<NEW_LINE>int progress = downloadThread.getCurrentDownloadingItemProgress();<NEW_LINE>progressBar.setProgress(progress < 0 ? 0 : progress);<NEW_LINE>} else {<NEW_LINE>progressBar.setProgress(0);<NEW_LINE>}<NEW_LINE>view.findViewById(R.id.divider).setVisibility(lastItem ? View.GONE : View.VISIBLE);<NEW_LINE>}<NEW_LINE>} | View.GONE : View.VISIBLE); |
1,616,211 | public AuthConfig updateAuthConfig(AuthConfig body, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling updateAuthConfig");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/system/config/settings/auth";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<AuthConfig> localVarReturnType = new GenericType<AuthConfig>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | HashMap<String, String>(); |
510,702 | private static void processCommandOutput(Process process, Processor<String> processor, boolean skipFirstLine, boolean throwOnError) throws IOException {<NEW_LINE>BufferedReader stdOutput = new BufferedReader(new InputStreamReader(process.getInputStream()));<NEW_LINE>try {<NEW_LINE>BufferedReader stdError = new BufferedReader(new InputStreamReader<MASK><NEW_LINE>try {<NEW_LINE>if (skipFirstLine) {<NEW_LINE>// ps output header<NEW_LINE>stdOutput.readLine();<NEW_LINE>}<NEW_LINE>String s;<NEW_LINE>while ((s = stdOutput.readLine()) != null) {<NEW_LINE>processor.process(s);<NEW_LINE>}<NEW_LINE>StringBuilder errorStr = new StringBuilder();<NEW_LINE>while ((s = stdError.readLine()) != null) {<NEW_LINE>if (s.contains("environment variables being ignored")) {<NEW_LINE>// PY-8160<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>errorStr.append(s).append("\n");<NEW_LINE>}<NEW_LINE>if (throwOnError && errorStr.length() > 0) {<NEW_LINE>throw new IOException("Error reading ps output:" + errorStr.toString());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>stdError.close();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>stdOutput.close();<NEW_LINE>}<NEW_LINE>} | (process.getErrorStream())); |
401,353 | public void handle(AnnotationValues<NoArgsConstructor> annotation, JCAnnotation ast, JavacNode annotationNode) {<NEW_LINE>handleFlagUsage(annotationNode, ConfigurationKeys.NO_ARGS_CONSTRUCTOR_FLAG_USAGE, "@NoArgsConstructor", ConfigurationKeys.ANY_CONSTRUCTOR_FLAG_USAGE, "any @xArgsConstructor");<NEW_LINE>deleteAnnotationIfNeccessary(annotationNode, NoArgsConstructor.class);<NEW_LINE>deleteImportFromCompilationUnit(annotationNode, "lombok.AccessLevel");<NEW_LINE>JavacNode typeNode = annotationNode.up();<NEW_LINE>if (!checkLegality(typeNode, annotationNode, NAME))<NEW_LINE>return;<NEW_LINE>List<JCAnnotation> onConstructor = unboxAndRemoveAnnotationParameter(<MASK><NEW_LINE>NoArgsConstructor ann = annotation.getInstance();<NEW_LINE>AccessLevel level = ann.access();<NEW_LINE>if (level == AccessLevel.NONE)<NEW_LINE>return;<NEW_LINE>String staticName = ann.staticName();<NEW_LINE>boolean force = ann.force();<NEW_LINE>handleConstructor.generateConstructor(typeNode, level, onConstructor, List.<JavacNode>nil(), force, staticName, SkipIfConstructorExists.NO, annotationNode);<NEW_LINE>} | ast, "onConstructor", "@NoArgsConstructor(onConstructor", annotationNode); |
762,283 | public void addExtensionFactory(ExtensionFactory factory) {<NEW_LINE>List l = factory.getPatternList();<NEW_LINE>Iterator it = l.iterator();<NEW_LINE>StringBuilder mapStr = new StringBuilder(' ');<NEW_LINE>while (it.hasNext()) {<NEW_LINE>String mapping = (String) it.next();<NEW_LINE>mapStr.append(mapping);<NEW_LINE>mapStr.append(' ');<NEW_LINE>}<NEW_LINE>logger.logp(Level.INFO, CLASS_NAME, "addExtensionFactory", "ExtensionFactory.[{0}].registered.successfully", new Object[] { factory.getClass().toString() });<NEW_LINE>logger.logp(Level.INFO, CLASS_NAME, "addExtensionFactory", "ExtensionFactory.[{0}].associated.with.patterns.[{1}]", new Object[] { factory.getClass().toString(), mapStr.toString() });<NEW_LINE>if (!appInstallBegun)<NEW_LINE>extensionFactories.add(factory);<NEW_LINE>else {<NEW_LINE>// LIBERTY: add to existing apps now?<NEW_LINE>Iterator<VirtualHost> vhosts = getVirtualHosts();<NEW_LINE>while (vhosts.hasNext()) {<NEW_LINE>com.ibm.ws.webcontainer.osgi.DynamicVirtualHost vhost = (com.ibm.ws.webcontainer.osgi<MASK><NEW_LINE>Iterator webApps = vhost.getWebApps();<NEW_LINE>while (webApps.hasNext()) {<NEW_LINE>WebApp webApp = (WebApp) webApps.next();<NEW_LINE>webApp.addExtensionFactory(factory);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// LIBERTY synchronized(extensionFactories){<NEW_LINE>// LIBERTY if (postInitExtensionFactories==null){<NEW_LINE>// LIBERTY postInitExtensionFactories = Collections.synchronizedList(new<NEW_LINE>// ArrayList<ExtensionFactory>());<NEW_LINE>// LIBERTY }<NEW_LINE>// LIBERTY }<NEW_LINE>// LIBERTY postInitExtensionFactories.add(factory);<NEW_LINE>}<NEW_LINE>} | .DynamicVirtualHost) vhosts.next(); |
1,624,343 | private // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>plafName = new javax.swing.JLabel();<NEW_LINE>plafNameValue = new javax.swing.JTextField();<NEW_LINE>filler = new javax.swing.JLabel();<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(plafName, org.openide.util.NbBundle.getMessage(PlatformInfoVisualPanel.class, "LBL_PlatformName_P"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(<MASK><NEW_LINE>add(plafName, gridBagConstraints);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 1;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>add(plafNameValue, gridBagConstraints);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 1;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>add(filler, gridBagConstraints);<NEW_LINE>} | 0, 0, 0, 12); |
637,493 | void createFromTemplate(boolean iconBlock) {<NEW_LINE>// NOI18N ;<NEW_LINE>FileObject foTemplates = FileUtil.getConfigFile("Templates");<NEW_LINE>if (foTemplates == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>FileObject foClassTemplates = foTemplates.getFileObject("Beans");<NEW_LINE>if (foClassTemplates == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FileObject foBiTemplate = null;<NEW_LINE>if (iconBlock) {<NEW_LINE>// NOI18N<NEW_LINE>foBiTemplate = <MASK><NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>foBiTemplate = foClassTemplates.getFileObject("NoIconBeanInfo", "java");<NEW_LINE>}<NEW_LINE>if (foBiTemplate == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>DataObject doBiTemplate = DataObject.find(foBiTemplate);<NEW_LINE>DataFolder folder = this.javaDataObject.getFolder();<NEW_LINE>biDataObject = doBiTemplate.createFromTemplate(folder, this.javaDataObject.getName() + BEANINFO_NAME_EXT);<NEW_LINE>if (!(biDataObject instanceof BIDataObject)) {<NEW_LINE>try {<NEW_LINE>biDataObject.setValid(false);<NEW_LINE>} catch (PropertyVetoException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>biDataObject = DataObject.find(biDataObject.getPrimaryFile());<NEW_LINE>}<NEW_LINE>javaEditor = biDataObject.getLookup().lookup(BIEditorSupport.class);<NEW_LINE>} catch (org.openide.loaders.DataObjectNotFoundException e) {<NEW_LINE>// System.out.println ( e );<NEW_LINE>// Do nothing if no data object is found<NEW_LINE>} catch (java.io.IOException e) {<NEW_LINE>// System.out.println ( e );<NEW_LINE>// Do nothing if no data object is found<NEW_LINE>}<NEW_LINE>} | foClassTemplates.getFileObject("BeanInfo", "java"); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.