idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,788,893
private void writeXML(Document doc, PreviewPreset preset) {<NEW_LINE>Element presetE = doc.createElement("previewpreset");<NEW_LINE>presetE.setAttribute("name", preset.getName());<NEW_LINE>presetE.setAttribute("version", "0.8.1");<NEW_LINE>for (Entry<String, Object> entry : preset.getProperties().entrySet()) {<NEW_LINE>String propertyName = entry.getKey();<NEW_LINE>try {<NEW_LINE>Object propertyValue = entry.getValue();<NEW_LINE>if (propertyValue != null) {<NEW_LINE>String serialized = PreviewProperties.getValueAsText(propertyValue);<NEW_LINE>if (serialized != null) {<NEW_LINE>Element propertyE = doc.createElement("previewproperty");<NEW_LINE><MASK><NEW_LINE>propertyE.setAttribute("class", propertyValue.getClass().getName());<NEW_LINE>propertyE.setTextContent(serialized);<NEW_LINE>presetE.appendChild(propertyE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>doc.appendChild(presetE);<NEW_LINE>}
propertyE.setAttribute("name", propertyName);
332,152
public Stream<NodeResult> neighborsAtHop(@Name("node") Node node, @Name(value = "types", defaultValue = "") String types, @Name(value = "distance", defaultValue = "1") Long distance) {<NEW_LINE>if (distance < 1)<NEW_LINE>return Stream.empty();<NEW_LINE>if (types == null || types.isEmpty())<NEW_LINE>return Stream.empty();<NEW_LINE>// Initialize bitmaps for iteration<NEW_LINE>Roaring64NavigableMap[] seen = new Roaring64NavigableMap[distance.intValue()];<NEW_LINE>for (int i = 0; i < distance; i++) {<NEW_LINE>seen[i] = new Roaring64NavigableMap();<NEW_LINE>}<NEW_LINE>long nodeId = node.getId();<NEW_LINE>Iterator<Long> iterator;<NEW_LINE>List<Pair<RelationshipType, Direction<MASK><NEW_LINE>// First Hop<NEW_LINE>for (Pair<RelationshipType, Direction> pair : typesAndDirections) {<NEW_LINE>for (Relationship r : getRelationshipsByTypeAndDirection(node, pair)) {<NEW_LINE>seen[0].add(r.getOtherNodeId(nodeId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 1; i < distance; i++) {<NEW_LINE>iterator = seen[i - 1].iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>node = tx.getNodeById(iterator.next());<NEW_LINE>for (Pair<RelationshipType, Direction> pair : typesAndDirections) {<NEW_LINE>for (Relationship r : getRelationshipsByTypeAndDirection(node, pair)) {<NEW_LINE>seen[i].add(r.getOtherNodeId(node.getId()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int j = 0; j < i; j++) {<NEW_LINE>seen[i].andNot(seen[j]);<NEW_LINE>seen[i].removeLong(nodeId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return StreamSupport.stream(Spliterators.spliteratorUnknownSize(seen[distance.intValue() - 1].iterator(), Spliterator.SORTED), false).map(y -> new NodeResult(tx.getNodeById(y)));<NEW_LINE>}
>> typesAndDirections = parse(types);
145,409
protected double matchScale(List<Point3D_F64> nullPts, DogArray<Point3D_F64> controlWorldPts) {<NEW_LINE>Point3D_F64 meanNull = UtilPoint3D_F64.mean(nullPts, numControl, null);<NEW_LINE>Point3D_F64 meanWorld = UtilPoint3D_F64.mean(controlWorldPts.toList(), numControl, null);<NEW_LINE>// compute the ratio of distance between world and null points from the centroid<NEW_LINE>double top = 0;<NEW_LINE>double bottom = 0;<NEW_LINE>for (int i = 0; i < numControl; i++) {<NEW_LINE>Point3D_F64 wi = controlWorldPts.get(i);<NEW_LINE>Point3D_F64 ni = nullPts.get(i);<NEW_LINE>double dwx = wi.x - meanWorld.x;<NEW_LINE>double dwy = wi.y - meanWorld.y;<NEW_LINE>double dwz = wi.z - meanWorld.z;<NEW_LINE>double dnx = ni.x - meanNull.x;<NEW_LINE>double dny = ni.y - meanNull.y;<NEW_LINE>double dnz = ni.z - meanNull.z;<NEW_LINE>double n2 = dnx * dnx + dny * dny + dnz * dnz;<NEW_LINE>double w2 = dwx * dwx <MASK><NEW_LINE>top += w2;<NEW_LINE>bottom += n2;<NEW_LINE>}<NEW_LINE>// compute beta<NEW_LINE>return Math.sqrt(top / bottom);<NEW_LINE>}
+ dwy * dwy + dwz * dwz;
179,568
public void stop(boolean mpOnly, int shutdownMode, boolean closeConnection) throws Exception {<NEW_LINE>if (callback != null)<NEW_LINE>callback.stop(mpOnly, shutdownMode, closeConnection);<NEW_LINE>if (!mpOnly) {<NEW_LINE>if (UnitTestMEStarter.me.getWSRMEngineComponent() != null) {<NEW_LINE>UnitTestMEStarter.me.getWSRMEngineComponent().stop(shutdownMode);<NEW_LINE>UnitTestMEStarter.me.getWSRMEngineComponent().destroy();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>UnitTestMEStarter.me.getMessageProcessor().serverStopping();<NEW_LINE>UnitTestMEStarter.me.getMessageProcessor().stop(shutdownMode);<NEW_LINE>UnitTestMEStarter.me.getMessageProcessor().destroy();<NEW_LINE>if (!mpOnly) {<NEW_LINE>((JsEngineComponent) UnitTestMEStarter.me.getMessageStore<MASK><NEW_LINE>((JsEngineComponent) UnitTestMEStarter.me.getMessageStore()).destroy();<NEW_LINE>if (reintTRM) {<NEW_LINE>trm.stop(shutdownMode);<NEW_LINE>trm.destroy();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
()).stop(shutdownMode);
979,347
public void listMetricSeriesDataWithContext() {<NEW_LINE>// BEGIN: com.azure.ai.metricsadvisor.MetricsAdvisorClient.listMetricSeriesData#String-List-OffsetDateTime-OffsetDateTime-Context<NEW_LINE>final OffsetDateTime startTime = OffsetDateTime.parse("2020-09-09T00:00:00Z");<NEW_LINE>final OffsetDateTime <MASK><NEW_LINE>metricsAdvisorClient.listMetricSeriesData("metricId", Arrays.asList(new DimensionKey(new HashMap<String, String>() {<NEW_LINE><NEW_LINE>{<NEW_LINE>put("Dim1", "value1");<NEW_LINE>}<NEW_LINE>})), startTime, endTime).forEach(metricSeriesData -> {<NEW_LINE>System.out.printf("Data feed Id: %s%n", metricSeriesData.getMetricId());<NEW_LINE>System.out.printf("Data feed description: %s%n", metricSeriesData.getSeriesKey());<NEW_LINE>System.out.printf("Data feed source type: %.2f%n", metricSeriesData.getTimestamps());<NEW_LINE>System.out.printf("Data feed creator: %.2f%n", metricSeriesData.getMetricValues());<NEW_LINE>});<NEW_LINE>// END: com.azure.ai.metricsadvisor.MetricsAdvisorClient.listMetricSeriesData#String-List-OffsetDateTime-OffsetDateTime-Context<NEW_LINE>}
endTime = OffsetDateTime.parse("2020-09-09T12:00:00Z");
1,317,848
public List<ImageUrl> parseImages(String html, Chapter chapter) {<NEW_LINE>List<ImageUrl> list = new LinkedList<>();<NEW_LINE>Node body = new Node(html);<NEW_LINE>int i = 1;<NEW_LINE>for (Node node : body.list("div#_imageList > img")) {<NEW_LINE><MASK><NEW_LINE>Long id = Long.parseLong(comicChapter + "000" + i);<NEW_LINE>String url = node.attr("img", "data-url");<NEW_LINE>list.add(new ImageUrl(id, comicChapter, i++, url, false));<NEW_LINE>}<NEW_LINE>if (!list.isEmpty())<NEW_LINE>return list;<NEW_LINE>String docUrl = StringUtils.match("documentURL:.*?'(.*?)'", html, 0);<NEW_LINE>String motiontoonPath = StringUtils.match("jpg:.*?'(.*?)\\{", html, 0);<NEW_LINE>try {<NEW_LINE>if (docUrl == null)<NEW_LINE>return list;<NEW_LINE>String html1 = getResponseBody(App.getHttpClient(), new Request.Builder().url(docUrl).addHeader("Referer", "www.dongmanmanhua.cn").build());<NEW_LINE>JSONObject motiontoonJson = new JSONObject(html1).getJSONObject("assets").getJSONObject("image");<NEW_LINE>Iterator<String> Json_Iterator = motiontoonJson.keys();<NEW_LINE>i = 1;<NEW_LINE>while (Json_Iterator.hasNext()) {<NEW_LINE>String key = Json_Iterator.next();<NEW_LINE>if (key.contains("layer")) {<NEW_LINE>Long comicChapter = chapter.getId();<NEW_LINE>Long id = Long.parseLong(comicChapter + "000" + i);<NEW_LINE>list.add(new ImageUrl(id, comicChapter, i++, motiontoonPath + motiontoonJson.getString(key), false));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Manga.NetworkErrorException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}
Long comicChapter = chapter.getId();
1,377,459
public List<String> resolve(List<String> names) {<NEW_LINE>if (names == null) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>final String defaultRack = defaultRackSupplier.get();<NEW_LINE>checkNotNull(defaultRack, "Default rack cannot be null");<NEW_LINE>List<String> rNames = resolver.resolve(names);<NEW_LINE>if (rNames != null && rNames.size() == names.size()) {<NEW_LINE>for (int i = 0; i < rNames.size(); ++i) {<NEW_LINE>if (rNames.get(i) == null) {<NEW_LINE>LOG.warn("Failed to resolve network location for {}, using default rack for it : {}.", names.get(i), defaultRack);<NEW_LINE>failedToResolveNetworkLocationCounter.inc();<NEW_LINE>rNames.set(i, defaultRack);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rNames;<NEW_LINE>}<NEW_LINE>LOG.warn("Failed to resolve network location for {}, using default rack for them : {}.", names, defaultRack);<NEW_LINE>rNames = new ArrayList<<MASK><NEW_LINE>for (int i = 0; i < names.size(); ++i) {<NEW_LINE>failedToResolveNetworkLocationCounter.inc();<NEW_LINE>rNames.add(defaultRack);<NEW_LINE>}<NEW_LINE>return rNames;<NEW_LINE>}
>(names.size());
150,607
public void visit(TypeDefBuilder builder) {<NEW_LINE>TypeDef type = builder.build();<NEW_LINE>final List<Property> props = type.getProperties();<NEW_LINE>for (Property p : props) {<NEW_LINE>if (parents.contains(p)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<Property> newParents = new ArrayList<>(parents);<NEW_LINE>boolean match = p.getAnnotations().stream().anyMatch(a -> a.getClassRef().getName().equals(annotationName));<NEW_LINE>if (match) {<NEW_LINE>newParents.add(p);<NEW_LINE>this.properties.put(newParents.stream().map(Property::getName).collect(Collectors.joining(DOT, prefix, "")), p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>props.stream().filter(p -> p.getTypeRef() instanceof ClassRef).forEach(p -> {<NEW_LINE>if (!parents.contains(p)) {<NEW_LINE>ClassRef classRef = <MASK><NEW_LINE>TypeDef propertyType = Types.typeDefFrom(classRef);<NEW_LINE>if (!propertyType.isEnum()) {<NEW_LINE>List<Property> newParents = new ArrayList<>(parents);<NEW_LINE>newParents.add(p);<NEW_LINE>new TypeDefBuilder(propertyType).accept(new AnnotatedMultiPropertyPathDetector(prefix, annotationName, newParents, this.properties)).build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
(ClassRef) p.getTypeRef();
521,906
public ResponseEntity<?> importArtifact(@RequestParam(value = "url", required = true) String url, @RequestParam(value = "mainArtifact", defaultValue = "true") boolean mainArtifact) {<NEW_LINE>if (!url.isEmpty()) {<NEW_LINE>List<Service> services = null;<NEW_LINE>try {<NEW_LINE>// Download remote to local file before import.<NEW_LINE>File localFile = HTTPDownloader.<MASK><NEW_LINE>// Now try importing services.<NEW_LINE>services = serviceService.importServiceDefinition(localFile, new ReferenceResolver(url, null, true), new ArtifactInfo(url, mainArtifact));<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>log.error("Exception while retrieving remote item " + url, ioe);<NEW_LINE>return new ResponseEntity<Object>("Exception while retrieving remote item", HttpStatus.INTERNAL_SERVER_ERROR);<NEW_LINE>} catch (MockRepositoryImportException mrie) {<NEW_LINE>return new ResponseEntity<Object>(mrie.getMessage(), HttpStatus.BAD_REQUEST);<NEW_LINE>}<NEW_LINE>if (services != null && services.size() > 0) {<NEW_LINE>return new ResponseEntity<Object>("{\"name\": \"" + services.get(0).getName() + ":" + services.get(0).getVersion() + "\"}", HttpStatus.CREATED);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ResponseEntity<Object>(HttpStatus.NO_CONTENT);<NEW_LINE>}
handleHTTPDownloadToFile(url, null, true);
55,552
public void generate(NodeLIRBuilderTool gen) {<NEW_LINE>// New OpenCL nodes for atomic add<NEW_LINE>OCLStamp oclStamp = null;<NEW_LINE>switch(elementKind) {<NEW_LINE>case Int:<NEW_LINE>oclStamp = getStampInt();<NEW_LINE>break;<NEW_LINE>case Long:<NEW_LINE>// DUE TO UNSUPPORTED FEATURE IN INTEL OpenCL PLATFORM<NEW_LINE>oclStamp <MASK><NEW_LINE>break;<NEW_LINE>case Float:<NEW_LINE>oclStamp = getStampFloat();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Data type for reduction not supported yet: " + elementKind);<NEW_LINE>}<NEW_LINE>LIRKind writeKind = gen.getLIRGeneratorTool().getLIRKind(oclStamp);<NEW_LINE>LIRKind accKind = gen.getLIRGeneratorTool().getLIRKind(accStamp);<NEW_LINE>// Atomic Store<NEW_LINE>gen.getLIRGeneratorTool().getArithmetic().emitStore(writeKind, gen.operand(address), gen.operand(value()), gen.state(this));<NEW_LINE>// Update the accumulator<NEW_LINE>gen.getLIRGeneratorTool().getArithmetic().emitStore(accKind, gen.operand(accumulator), gen.operand(value()), gen.state(this));<NEW_LINE>}
= new OCLStamp(OCLKind.ATOMIC_ADD_INT);
260,059
public com.amazonaws.services.codecommit.model.ActorDoesNotExistException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.codecommit.model.ActorDoesNotExistException actorDoesNotExistException = new com.amazonaws.services.<MASK><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>} 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 actorDoesNotExistException;<NEW_LINE>}
codecommit.model.ActorDoesNotExistException(null);
1,689,972
public static // modified for performance and to allow parsing numbers with leading '+'<NEW_LINE>Integer tryParse(String string, int begin, int end) {<NEW_LINE>if (begin < 0 || end > string.length() || end - begin < 1)<NEW_LINE>return null;<NEW_LINE>int radix = 10;<NEW_LINE>char <MASK><NEW_LINE>boolean negative = firstChar == '-';<NEW_LINE>int index = negative || firstChar == '+' ? begin + 1 : begin;<NEW_LINE>if (index == end)<NEW_LINE>return null;<NEW_LINE>int digit = Character.digit(string.charAt(index++), 10);<NEW_LINE>if (digit < 0 || digit >= radix)<NEW_LINE>return null;<NEW_LINE>int accum = -digit;<NEW_LINE>int cap = Integer.MIN_VALUE / radix;<NEW_LINE>while (index < end) {<NEW_LINE>digit = Character.digit(string.charAt(index++), 10);<NEW_LINE>if (digit < 0 || digit >= radix || accum < cap)<NEW_LINE>return null;<NEW_LINE>accum *= radix;<NEW_LINE>if (accum < Integer.MIN_VALUE + digit)<NEW_LINE>return null;<NEW_LINE>accum -= digit;<NEW_LINE>}<NEW_LINE>if (negative)<NEW_LINE>return accum;<NEW_LINE>else if (accum == Integer.MIN_VALUE)<NEW_LINE>return null;<NEW_LINE>else<NEW_LINE>return -accum;<NEW_LINE>}
firstChar = string.charAt(begin);
1,527,331
public AddAssociationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AddAssociationResult addAssociationResult = new AddAssociationResult();<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 addAssociationResult;<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("SourceArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>addAssociationResult.setSourceArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DestinationArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>addAssociationResult.setDestinationArn(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 addAssociationResult;<NEW_LINE>}
class).unmarshall(context));
1,703,116
private void transfer(JMSSampler element) {<NEW_LINE>element.setQueueConnectionFactory(queueConnectionFactory.getText());<NEW_LINE>element.setSendQueue(sendQueue.getText());<NEW_LINE>element.setReceiveQueue(receiveQueue.getText());<NEW_LINE>element.setProperty(JMSSampler.JMS_COMMUNICATION_STYLE, jmsCommunicationStyle.getSelectedIndex());<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>String isOneWay = JMSSampler.IS_ONE_WAY;<NEW_LINE>element.removeProperty(isOneWay);<NEW_LINE>element.setNonPersistent(useNonPersistentDelivery.isSelected());<NEW_LINE>element.setUseReqMsgIdAsCorrelId(useReqMsgIdAsCorrelId.isSelected());<NEW_LINE>element.setUseResMsgIdAsCorrelId(useResMsgIdAsCorrelId.isSelected());<NEW_LINE>element.setTimeout(timeout.getText());<NEW_LINE>element.setExpiration(expiration.getText());<NEW_LINE>element.setPriority(priority.getText());<NEW_LINE>element.setJMSSelector(jmsSelector.getText());<NEW_LINE>element.setNumberOfSamplesToAggregate(numberOfSamplesToAggregate.getText());<NEW_LINE>element.setContent(messageContent.getText());<NEW_LINE>element.setInitialContextFactory(initialContextFactory.getText());<NEW_LINE>element.setContextProvider(providerUrl.getText());<NEW_LINE>Arguments jndiArgs = (Arguments) jndiPropertiesPanel.createTestElement();<NEW_LINE>element.setJNDIProperties(jndiArgs);<NEW_LINE>JMSProperties args = <MASK><NEW_LINE>element.setJMSProperties(args);<NEW_LINE>}
(JMSProperties) jmsPropertiesPanel.createTestElement();
885,103
private void mountGlobalRestFailureHandler(Router mainRouter) {<NEW_LINE>GlobalRestFailureHandler globalRestFailureHandler = <MASK><NEW_LINE>Handler<RoutingContext> failureHandler = null == globalRestFailureHandler ? ctx -> {<NEW_LINE>if (ctx.response().closed() || ctx.response().ended()) {<NEW_LINE>// response has been sent, do nothing<NEW_LINE>LOGGER.error("get a failure with closed response", ctx.failure());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HttpServerResponse response = ctx.response();<NEW_LINE>if (ctx.failure() instanceof InvocationException) {<NEW_LINE>// ServiceComb defined exception<NEW_LINE>InvocationException exception = (InvocationException) ctx.failure();<NEW_LINE>response.setStatusCode(exception.getStatusCode());<NEW_LINE>response.setStatusMessage(exception.getReasonPhrase());<NEW_LINE>response.end(exception.getErrorData().toString());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOGGER.error("unexpected failure happened", ctx.failure());<NEW_LINE>try {<NEW_LINE>// unknown exception<NEW_LINE>CommonExceptionData unknownError = new CommonExceptionData("unknown error");<NEW_LINE>ctx.response().setStatusCode(500).putHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).end(RestObjectMapperFactory.getRestObjectMapper().writeValueAsString(unknownError));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("failed to send error response!", e);<NEW_LINE>}<NEW_LINE>} : globalRestFailureHandler;<NEW_LINE>// this handler does nothing, just ensure the failure handler can catch exception<NEW_LINE>mainRouter.route().handler(RoutingContext::next).failureHandler(failureHandler);<NEW_LINE>}
SPIServiceUtils.getPriorityHighestService(GlobalRestFailureHandler.class);
88,353
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {<NEW_LINE>List<String> messages = new ArrayList<>();<NEW_LINE>if (canEnvironmentallyAware) {<NEW_LINE>messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.0"), LocaleLoader.getString("Taming.Ability.Bonus.1")));<NEW_LINE>}<NEW_LINE>if (canFastFood) {<NEW_LINE>messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.8"), LocaleLoader.getString("Taming.Ability.Bonus.9", percent.format(Taming.fastFoodServiceActivationChance / 100D))));<NEW_LINE>}<NEW_LINE>if (canGore) {<NEW_LINE>messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Combat.Chance.Gore"), goreChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", goreChanceLucky) : ""));<NEW_LINE>}<NEW_LINE>if (canHolyHound) {<NEW_LINE>messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.10"), LocaleLoader.getString("Taming.Ability.Bonus.11")));<NEW_LINE>}<NEW_LINE>if (canSharpenedClaws) {<NEW_LINE>messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.6"), LocaleLoader.getString(<MASK><NEW_LINE>}<NEW_LINE>if (canShockProof) {<NEW_LINE>messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.4"), LocaleLoader.getString("Taming.Ability.Bonus.5", Taming.shockProofModifier)));<NEW_LINE>}<NEW_LINE>if (canThickFur) {<NEW_LINE>messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.2"), LocaleLoader.getString("Taming.Ability.Bonus.3", Taming.thickFurModifier)));<NEW_LINE>}<NEW_LINE>return messages;<NEW_LINE>}
"Taming.Ability.Bonus.7", Taming.sharpenedClawsBonusDamage)));
433,821
public GetDevEndpointResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetDevEndpointResult getDevEndpointResult = new GetDevEndpointResult();<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 getDevEndpointResult;<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("DevEndpoint", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getDevEndpointResult.setDevEndpoint(DevEndpointJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getDevEndpointResult;<NEW_LINE>}
().unmarshall(context));
1,341,843
public boolean uniqueKeyCode(Element element, String targetAnnotationClass) {<NEW_LINE>int[] elementsKeyCodes = extractKeyCode(element);<NEW_LINE>if (elementsKeyCodes.length == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Set<Integer> uniqueKeyCodes = new <MASK><NEW_LINE>for (int keyCode : elementsKeyCodes) {<NEW_LINE>uniqueKeyCodes.add(keyCode);<NEW_LINE>}<NEW_LINE>Element enclosingElement = element.getEnclosingElement();<NEW_LINE>List<? extends Element> enclosedMethodElements = ElementFilter.methodsIn(enclosingElement.getEnclosedElements());<NEW_LINE>for (Element oneEnclosedElement : enclosedMethodElements) {<NEW_LINE>if (oneEnclosedElement != element) {<NEW_LINE>List<? extends AnnotationMirror> annotationMirrors = oneEnclosedElement.getAnnotationMirrors();<NEW_LINE>for (AnnotationMirror annotationMirror : annotationMirrors) {<NEW_LINE>if (annotationMirror.getAnnotationType().asElement().toString().equals(targetAnnotationClass)) {<NEW_LINE>int[] keyCodes = extractKeyCode(oneEnclosedElement);<NEW_LINE>for (int keyCode : keyCodes) {<NEW_LINE>if (uniqueKeyCodes.contains(keyCode)) {<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>uniqueKeyCodes.add(keyCode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
HashSet<>(elementsKeyCodes.length);
1,395,822
static Optional<io.swagger.models.parameters.Parameter> create(springfox.documentation.service.Parameter source) {<NEW_LINE>String safeSourceParamType = ofNullable(source.getParamType()).map(String::toLowerCase).orElse("");<NEW_LINE>SerializableParameterFactory factory = SerializableParameterFactories.FACTORY_MAP.getOrDefault(safeSourceParamType, new NullSerializableParameterFactory());<NEW_LINE>SerializableParameter toReturn = factory.create(source);<NEW_LINE>if (toReturn == null) {<NEW_LINE>return empty();<NEW_LINE>}<NEW_LINE>springfox.documentation.schema.ModelReference paramModel = source.getModelRef();<NEW_LINE>toReturn.<MASK><NEW_LINE>toReturn.setDescription(source.getDescription());<NEW_LINE>toReturn.setAccess(source.getParamAccess());<NEW_LINE>toReturn.setPattern(source.getPattern());<NEW_LINE>toReturn.setRequired(source.isRequired());<NEW_LINE>toReturn.setAllowEmptyValue(source.isAllowEmptyValue());<NEW_LINE>toReturn.getVendorExtensions().putAll(VENDOR_EXTENSIONS_MAPPER.mapExtensions(source.getVendorExtentions()));<NEW_LINE>Property property = springfox.documentation.swagger2.mappers.Properties.property(paramModel.getType());<NEW_LINE>maybeAddAllowableValuesToParameter(toReturn, property, source.getAllowableValues());<NEW_LINE>if (paramModel.isCollection()) {<NEW_LINE>if (paramModel.getItemType().equals("byte")) {<NEW_LINE>toReturn.setType("string");<NEW_LINE>toReturn.setFormat("byte");<NEW_LINE>} else {<NEW_LINE>toReturn.setCollectionFormat(collectionFormat(source));<NEW_LINE>toReturn.setType("array");<NEW_LINE>springfox.documentation.schema.ModelReference paramItemModelRef = paramModel.itemModel().orElseThrow(() -> new IllegalStateException("ModelRef that is a collection should have an itemModel"));<NEW_LINE>Property itemProperty = maybeAddAllowableValues(springfox.documentation.swagger2.mappers.Properties.itemTypeProperty(paramItemModelRef), paramItemModelRef.getAllowableValues());<NEW_LINE>toReturn.setItems(itemProperty);<NEW_LINE>maybeAddAllowableValuesToParameter(toReturn, itemProperty, paramItemModelRef.getAllowableValues());<NEW_LINE>}<NEW_LINE>} else if (paramModel.isMap()) {<NEW_LINE>springfox.documentation.schema.ModelReference paramItemModelRef = paramModel.itemModel().orElseThrow(() -> new IllegalStateException("ModelRef that is a map should have an itemModel"));<NEW_LINE>Property itemProperty = new MapProperty(springfox.documentation.swagger2.mappers.Properties.itemTypeProperty(paramItemModelRef));<NEW_LINE>toReturn.setItems(itemProperty);<NEW_LINE>} else {<NEW_LINE>((AbstractSerializableParameter) toReturn).setDefaultValue(source.getDefaultValue());<NEW_LINE>if (source.getScalarExample() != null) {<NEW_LINE>((AbstractSerializableParameter) toReturn).setExample(String.valueOf(source.getScalarExample()));<NEW_LINE>}<NEW_LINE>toReturn.setType(property.getType());<NEW_LINE>toReturn.setFormat(property.getFormat());<NEW_LINE>}<NEW_LINE>return of(toReturn);<NEW_LINE>}
setName(source.getName());
228,336
public static int runExternalAndWait(Ruby runtime, IRubyObject[] rawArgs, Map mergeEnv) {<NEW_LINE>OutputStream output = runtime.getOutputStream();<NEW_LINE>OutputStream error = runtime.getErrorStream();<NEW_LINE>InputStream input = runtime.getInputStream();<NEW_LINE>File pwd = new File(runtime.getCurrentDirectory());<NEW_LINE>LaunchConfig cfg = new <MASK><NEW_LINE>try {<NEW_LINE>Process process;<NEW_LINE>try {<NEW_LINE>if (cfg.shouldRunInShell()) {<NEW_LINE>log(runtime, "Launching with shell");<NEW_LINE>// execute command with sh -c ... this does shell expansion of wildcards<NEW_LINE>cfg.verifyExecutableForShell();<NEW_LINE>process = buildProcess(runtime, cfg.getExecArgs(), getCurrentEnv(runtime, mergeEnv), pwd);<NEW_LINE>} else {<NEW_LINE>log(runtime, "Launching directly (no shell)");<NEW_LINE>cfg.verifyExecutableForDirect();<NEW_LINE>}<NEW_LINE>final String[] execArgs = cfg.getExecArgs();<NEW_LINE>if (changeDirInsideJar(runtime, execArgs)) {<NEW_LINE>pwd = new File(System.getProperty("user.dir"));<NEW_LINE>}<NEW_LINE>process = buildProcess(runtime, execArgs, getCurrentEnv(runtime, mergeEnv), pwd);<NEW_LINE>} catch (SecurityException se) {<NEW_LINE>throw runtime.newSecurityError(se.getLocalizedMessage());<NEW_LINE>}<NEW_LINE>handleStreams(runtime, process, input, output, error);<NEW_LINE>return process.waitFor();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw runtime.newIOErrorFromException(e);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>throw runtime.newThreadError("unexpected interrupt");<NEW_LINE>}<NEW_LINE>}
LaunchConfig(runtime, rawArgs, true);
803,383
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject sourceObject = game.getObject(source);<NEW_LINE>if (sourceObject != null && controller != null) {<NEW_LINE>FilterCard filter = new FilterCard("card with mana value " + sourceObject.getManaValue());<NEW_LINE>filter.add(new ManaValuePredicate(ComparisonType.EQUAL_TO, sourceObject.getManaValue()));<NEW_LINE>TargetCardInLibrary target = new TargetCardInLibrary(1, filter);<NEW_LINE>if (controller.searchLibrary(target, source, game)) {<NEW_LINE>if (!target.getTargets().isEmpty()) {<NEW_LINE>Cards revealed = new CardsImpl(target.getTargets());<NEW_LINE>controller.revealCards(sourceObject.<MASK><NEW_LINE>controller.moveCards(revealed, Zone.HAND, source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>controller.shuffleLibrary(source, game);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getIdName(), revealed, game);
825,842
public static String encode(String message, String cipherSmall) {<NEW_LINE>StringBuilder encoded = new StringBuilder();<NEW_LINE>// This map is used to encode<NEW_LINE>Map<Character, Character> cipherMap = new HashMap<>();<NEW_LINE>char beginSmallLetter = 'a';<NEW_LINE>char beginCapitalLetter = 'A';<NEW_LINE>cipherSmall = cipherSmall.toLowerCase();<NEW_LINE><MASK><NEW_LINE>// To handle Small and Capital letters<NEW_LINE>for (int i = 0; i < cipherSmall.length(); i++) {<NEW_LINE>cipherMap.put(beginSmallLetter++, cipherSmall.charAt(i));<NEW_LINE>cipherMap.put(beginCapitalLetter++, cipherCapital.charAt(i));<NEW_LINE>}<NEW_LINE>for (int i = 0; i < message.length(); i++) {<NEW_LINE>if (Character.isAlphabetic(message.charAt(i))) {<NEW_LINE>encoded.append(cipherMap.get(message.charAt(i)));<NEW_LINE>} else {<NEW_LINE>encoded.append(message.charAt(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return encoded.toString();<NEW_LINE>}
String cipherCapital = cipherSmall.toUpperCase();
152,651
private void copyGapInsideGroup(LayoutInterval gap, int gapSize, LayoutInterval group, int alignment) {<NEW_LINE>assert gap.isEmptySpace() && (alignment == LEADING || alignment == TRAILING);<NEW_LINE>if (alignment == LEADING)<NEW_LINE>gapSize = -gapSize;<NEW_LINE>group.getCurrentSpace().positions[dimension][alignment] += gapSize;<NEW_LINE>List<LayoutInterval> originalGroup = new ArrayList<LayoutInterval>(group.getSubIntervalCount());<NEW_LINE>for (Iterator<LayoutInterval> it = group.getSubIntervals(); it.hasNext(); ) {<NEW_LINE>originalGroup.add(it.next());<NEW_LINE>}<NEW_LINE>for (LayoutInterval sub : originalGroup) {<NEW_LINE>LayoutInterval gapClone = LayoutInterval.cloneInterval(gap, null);<NEW_LINE>if (sub.isSequential()) {<NEW_LINE>sub.getCurrentSpace().positions<MASK><NEW_LINE>int index = alignment == LEADING ? 0 : sub.getSubIntervalCount();<NEW_LINE>operations.insertGapIntoSequence(gapClone, sub, index, dimension);<NEW_LINE>} else {<NEW_LINE>LayoutInterval seq = new LayoutInterval(SEQUENTIAL);<NEW_LINE>seq.getCurrentSpace().set(dimension, sub.getCurrentSpace());<NEW_LINE>seq.getCurrentSpace().positions[dimension][alignment] += gapSize;<NEW_LINE>seq.setAlignment(sub.getRawAlignment());<NEW_LINE>layoutModel.addInterval(seq, group, layoutModel.removeInterval(sub));<NEW_LINE>layoutModel.setIntervalAlignment(sub, DEFAULT);<NEW_LINE>layoutModel.addInterval(sub, seq, 0);<NEW_LINE>layoutModel.addInterval(gapClone, seq, alignment == LEADING ? 0 : 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
[dimension][alignment] += gapSize;
550,146
public static Endpoint decodeInline(final RLPInput in, final int fieldCount) {<NEW_LINE>checkGuard(fieldCount == 2 || fieldCount == 3, PeerDiscoveryPacketDecodingException::new, "Invalid number of components in RLP representation of an endpoint: expected 2 or 3 elements but got %s", fieldCount);<NEW_LINE>String hostAddress = null;<NEW_LINE>if (!in.nextIsNull()) {<NEW_LINE>InetAddress addr = in.readInetAddress();<NEW_LINE>hostAddress = addr.getHostAddress();<NEW_LINE>} else {<NEW_LINE>in.skipNext();<NEW_LINE>}<NEW_LINE>final int udpPort = in.readIntScalar();<NEW_LINE>// Some mainnet packets have been shown to either not have the TCP port field at all,<NEW_LINE>// or to have an RLP NULL value for it.<NEW_LINE>Optional<Integer> tcpPort = Optional.empty();<NEW_LINE>if (fieldCount == 3) {<NEW_LINE>if (in.nextIsNull()) {<NEW_LINE>in.skipNext();<NEW_LINE>} else {<NEW_LINE>tcpPort = Optional.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Endpoint(hostAddress, udpPort, tcpPort);<NEW_LINE>}
of(in.readIntScalar());
1,023,484
private TableMetaData findTableMetaData(@Nullable String schemaName, @Nullable String tableName, Map<String, TableMetaData> tableMeta) {<NEW_LINE>if (schemaName != null) {<NEW_LINE>TableMetaData tmd = tableMeta.<MASK><NEW_LINE>if (tmd == null) {<NEW_LINE>throw new DataAccessResourceFailureException("Unable to locate table meta-data for '" + tableName + "' in the '" + schemaName + "' schema");<NEW_LINE>}<NEW_LINE>return tmd;<NEW_LINE>} else if (tableMeta.size() == 1) {<NEW_LINE>return tableMeta.values().iterator().next();<NEW_LINE>} else {<NEW_LINE>TableMetaData tmd = tableMeta.get(getDefaultSchema());<NEW_LINE>if (tmd == null) {<NEW_LINE>tmd = tableMeta.get(this.userName != null ? this.userName.toUpperCase() : "");<NEW_LINE>}<NEW_LINE>if (tmd == null) {<NEW_LINE>tmd = tableMeta.get("PUBLIC");<NEW_LINE>}<NEW_LINE>if (tmd == null) {<NEW_LINE>tmd = tableMeta.get("DBO");<NEW_LINE>}<NEW_LINE>if (tmd == null) {<NEW_LINE>throw new DataAccessResourceFailureException("Unable to locate table meta-data for '" + tableName + "' in the default schema");<NEW_LINE>}<NEW_LINE>return tmd;<NEW_LINE>}<NEW_LINE>}
get(schemaName.toUpperCase());
389,127
private RADComponent copyAndApplyBorder(RADComponent sourceComp, RADComponent targetComp) {<NEW_LINE>try {<NEW_LINE>Border borderInstance = <MASK><NEW_LINE>BorderDesignSupport designBorder = new BorderDesignSupport(borderInstance);<NEW_LINE>Node.Property[] sourceProps = sourceComp.getKnownBeanProperties();<NEW_LINE>Node.Property[] targetProps = designBorder.getProperties();<NEW_LINE>int copyMode = FormUtils.CHANGED_ONLY | FormUtils.DISABLE_CHANGE_FIRING;<NEW_LINE>if (formModel == sourceComp.getFormModel())<NEW_LINE>copyMode |= FormUtils.PASS_DESIGN_VALUES;<NEW_LINE>FormUtils.copyProperties(sourceProps, targetProps, copyMode);<NEW_LINE>setComponentBorderProperty(designBorder, targetComp);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>// ignore<NEW_LINE>ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);<NEW_LINE>} catch (LinkageError ex) {<NEW_LINE>// ignore<NEW_LINE>ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);<NEW_LINE>}<NEW_LINE>return targetComp;<NEW_LINE>}
(Border) sourceComp.createBeanInstance();
1,064,652
public static void main(String[] args) throws Exception {<NEW_LINE>WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();<NEW_LINE>String path_in = System.getProperty("user.dir") + "/src/test/resources/parts/";<NEW_LINE>// Need to know how what type of part to map to<NEW_LINE>InputStream in = new FileInputStream(path_in + "[Content_Types].xml");<NEW_LINE>ContentTypeManager externalCtm = new ContentTypeManager();<NEW_LINE>externalCtm.parseContentTypesFile(in);<NEW_LINE>// Example of a part which become a rel of the word document<NEW_LINE>in = new FileInputStream(path_in + "settings.xml");<NEW_LINE>attachForeignPart(wordMLPackage, wordMLPackage.getMainDocumentPart(), externalCtm, "word/settings.xml", in);<NEW_LINE>// Example of a part which become a rel of the package<NEW_LINE>in = new FileInputStream(path_in + "app.xml");<NEW_LINE>attachForeignPart(wordMLPackage, <MASK><NEW_LINE>wordMLPackage.save(new java.io.File(System.getProperty("user.dir") + "/OUT_PartLoadFromFileSystem.docx"));<NEW_LINE>}
wordMLPackage, externalCtm, "docProps/app.xml", in);
1,737,911
private void extractPoiAdditionals(Collection<PoiType> poiAdditionals, Map<String, List<PoiType>> additionalsMap, Set<String> excludedPoiAdditionalCategories, boolean extractAll) {<NEW_LINE>for (PoiType poiType : poiAdditionals) {<NEW_LINE>String category = poiType.getPoiAdditionalCategory();<NEW_LINE>if (category == null) {<NEW_LINE>category = "";<NEW_LINE>}<NEW_LINE>if (excludedPoiAdditionalCategories != null && excludedPoiAdditionalCategories.contains(category)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (collapsedCategories.contains(category) && !extractAll) {<NEW_LINE>if (!additionalsMap.containsKey(category)) {<NEW_LINE>additionalsMap.put(category, new ArrayList<PoiType>());<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>boolean showAll = showAllCategories.contains(category) || extractAll;<NEW_LINE>String keyName = poiType.getKeyName().replace(<MASK><NEW_LINE>if (!poiAdditionalsTranslations.containsKey(poiType)) {<NEW_LINE>poiAdditionalsTranslations.put(poiType, poiType.getTranslation());<NEW_LINE>}<NEW_LINE>if (showAll || poiType.isTopVisible() || selectedPoiAdditionals.contains(keyName.replace(' ', ':'))) {<NEW_LINE>List<PoiType> adds = additionalsMap.get(category);<NEW_LINE>if (adds == null) {<NEW_LINE>adds = new ArrayList<>();<NEW_LINE>additionalsMap.put(category, adds);<NEW_LINE>}<NEW_LINE>if (!adds.contains(poiType)) {<NEW_LINE>adds.add(poiType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
'_', ':').toLowerCase();
1,480,309
public void refreshRow() throws SQLException {<NEW_LINE>loggerExternal.<MASK><NEW_LINE>if (loggerExternal.isLoggable(Level.FINER) && Util.isActivityTraceOn()) {<NEW_LINE>loggerExternal.finer(toString() + " ActivityId: " + ActivityCorrelator.getNext().toString());<NEW_LINE>}<NEW_LINE>if (logger.isLoggable(java.util.logging.Level.FINER))<NEW_LINE>logger.finer(toString() + logCursorState());<NEW_LINE>checkClosed();<NEW_LINE>// From JDBC spec:<NEW_LINE>// This method is not supported for ResultSet objects that are type TYPE_FORWARD_ONLY.<NEW_LINE>verifyResultSetIsScrollable();<NEW_LINE>// From JDBC spec:<NEW_LINE>// Throws SQLException if the concurrency of this ResultSet object is CONCUR_READ_ONLY.<NEW_LINE>verifyResultSetIsUpdatable();<NEW_LINE>// From JDBC spec:<NEW_LINE>// Throws SQLException if this method is called when the cursor is on the insert row.<NEW_LINE>verifyResultSetIsNotOnInsertRow();<NEW_LINE>// Verify that the cursor is not before the first row, after the last row, or on a deleted row.<NEW_LINE>verifyResultSetHasCurrentRow();<NEW_LINE>verifyCurrentRowIsNotDeleted("R_cantUpdateDeletedRow");<NEW_LINE>// From the JDBC spec:<NEW_LINE>// [This method] does nothing for [ResultSet objects] that are type TYPE_SCROLL_INSENSITIVE.<NEW_LINE>//<NEW_LINE>// Included in that definition is result sets for which the server was asked to return a server cursor,<NEW_LINE>// but ended up returning the results directly instead.<NEW_LINE>if (ResultSet.TYPE_SCROLL_INSENSITIVE == stmt.getResultSetType() || 0 == serverCursorId)<NEW_LINE>return;<NEW_LINE>// From JDBC spec:<NEW_LINE>// If refreshRow is called after calling updater [methods] but before calling updateRow,<NEW_LINE>// then the updates made to the row are lost.<NEW_LINE>cancelUpdates();<NEW_LINE>doRefreshRow();<NEW_LINE>loggerExternal.exiting(getClassNameLogging(), "refreshRow");<NEW_LINE>}
entering(getClassNameLogging(), "refreshRow");
761,283
private Element createNode(Document document, Graph graph, Node n) throws Exception {<NEW_LINE>Element <MASK><NEW_LINE>nodeE.setAttribute("id", n.getId().toString());<NEW_LINE>// Label<NEW_LINE>if (n.getLabel() != null && !n.getLabel().isEmpty()) {<NEW_LINE>Element labelE = createNodeLabel(document, n);<NEW_LINE>nodeE.appendChild(labelE);<NEW_LINE>}<NEW_LINE>// Attribute values<NEW_LINE>if (exportAttributes) {<NEW_LINE>for (Column column : n.getAttributeColumns()) {<NEW_LINE>if (!column.isProperty()) {<NEW_LINE>// Data or computed<NEW_LINE>Element attvalueE = createNodeAttvalue(document, column, graph, n);<NEW_LINE>if (attvalueE != null) {<NEW_LINE>nodeE.appendChild(attvalueE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Viz<NEW_LINE>if (exportSize) {<NEW_LINE>Element sizeE = createNodeSize(document, n);<NEW_LINE>nodeE.appendChild(sizeE);<NEW_LINE>}<NEW_LINE>if (exportColors) {<NEW_LINE>Element colorE = createNodeColorR(document, n);<NEW_LINE>nodeE.appendChild(colorE);<NEW_LINE>colorE = createNodeColorG(document, n);<NEW_LINE>nodeE.appendChild(colorE);<NEW_LINE>colorE = createNodeColorB(document, n);<NEW_LINE>nodeE.appendChild(colorE);<NEW_LINE>}<NEW_LINE>if (exportPosition) {<NEW_LINE>Element positionXE = createNodePositionX(document, n);<NEW_LINE>nodeE.appendChild(positionXE);<NEW_LINE>Element positionYE = createNodePositionY(document, n);<NEW_LINE>nodeE.appendChild(positionYE);<NEW_LINE>if (minZ != 0f || maxZ != 0f) {<NEW_LINE>Element positionZE = createNodePositionZ(document, n);<NEW_LINE>nodeE.appendChild(positionZE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Progress.progress(progressTicket);<NEW_LINE>return nodeE;<NEW_LINE>}
nodeE = document.createElement("node");
1,327,798
public void receiveData(final Context pebbleContext, final int transactionId, final PebbleDictionary data) {<NEW_LINE>try {<NEW_LINE>int newState = data.getUnsignedIntegerAsLong(Constants.SPORTS_STATE_KEY).intValue();<NEW_LINE><MASK><NEW_LINE>if (newState == Constants.SPORTS_STATE_PAUSED || newState == Constants.SPORTS_STATE_RUNNING) {<NEW_LINE>if (tracker.getWorkout() == null) {<NEW_LINE>Intent startBroadcastIntent = new Intent().setAction(org.runnerup.common.util.Constants.Intents.START_WORKOUT);<NEW_LINE>context.sendBroadcast(startBroadcastIntent);<NEW_LINE>} else if (tracker.getWorkout().isPaused()) {<NEW_LINE>sendLocalBroadcast(org.runnerup.common.util.Constants.Intents.RESUME_WORKOUT);<NEW_LINE>} else {<NEW_LINE>sendLocalBroadcast(org.runnerup.common.util.Constants.Intents.PAUSE_WORKOUT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Toast.makeText(context, ex.toString(), Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>}
PebbleKit.sendAckToPebble(context, transactionId);
649,280
private JToggleButton createPlacesSelectedNodeToggleButton() {<NEW_LINE>final JToggleButton checkBoxOnlySpecificNodes = createToggleButtonWithIconAndLabel("PlaceSelectedNodeOnSlide.icon", "slide.placenode");<NEW_LINE>checkBoxOnlySpecificNodes.setAlignmentX(Component.CENTER_ALIGNMENT);<NEW_LINE>checkBoxOnlySpecificNodes.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>final String centeredNodeId = slide.getPlacedNodeId();<NEW_LINE>final IMapSelection selection = Controller.getCurrentController().getSelection();<NEW_LINE>if (centeredNodeId == null) {<NEW_LINE>final NodeModel selected = selection.getSelected();<NEW_LINE>if (selected != null) {<NEW_LINE>UndoableSlide.of(slide).setPlacedNodeId(selected.getID());<NEW_LINE>setNodePlacementControlsEnabled(true, slide.getPlacedNodePosition());<NEW_LINE>} else {<NEW_LINE>UndoableSlide.of(slide).setPlacedNodeId(null);<NEW_LINE>setNodePlacementControlsEnabled(false, slide.getPlacedNodePosition());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>UndoableSlide.of<MASK><NEW_LINE>setNodePlacementControlsEnabled(false, slide.getPlacedNodePosition());<NEW_LINE>final MapModel map = Controller.getCurrentController().getMap();<NEW_LINE>final NodeModel node = map.getNodeForID(centeredNodeId);<NEW_LINE>if (node != null)<NEW_LINE>selection.selectAsTheOnlyOneSelected(node);<NEW_LINE>}<NEW_LINE>checkBoxOnlySpecificNodes.setSelected(slide.getPlacedNodeId() != null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return checkBoxOnlySpecificNodes;<NEW_LINE>}
(slide).setPlacedNodeId(null);
910,888
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>((Infinity) getApplication()).getAppComponent().inject(this);<NEW_LINE>setImmersiveModeNotApplicable();<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_edit_comment);<NEW_LINE>ButterKnife.bind(this);<NEW_LINE>EventBus.getDefault().register(this);<NEW_LINE>applyCustomTheme();<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && isChangeStatusBarIconColor()) {<NEW_LINE>addOnOffsetChangedListener(appBarLayout);<NEW_LINE>}<NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>getSupportActionBar().setDisplayHomeAsUpEnabled(true);<NEW_LINE>mFullName = getIntent().getStringExtra(EXTRA_FULLNAME);<NEW_LINE>mAccessToken = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, null);<NEW_LINE>mCommentContent = getIntent().getStringExtra(EXTRA_CONTENT);<NEW_LINE>contentEditText.setText(mCommentContent);<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>uploadedImages = savedInstanceState.getParcelableArrayList(UPLOADED_IMAGES_STATE);<NEW_LINE>}<NEW_LINE>MarkdownBottomBarRecyclerViewAdapter adapter = new MarkdownBottomBarRecyclerViewAdapter(mCustomThemeWrapper, new MarkdownBottomBarRecyclerViewAdapter.ItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(int item) {<NEW_LINE>MarkdownBottomBarRecyclerViewAdapter.bindEditTextWithItemClickListener(EditCommentActivity.this, contentEditText, item);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onUploadImage() {<NEW_LINE>Utils.hideKeyboard(EditCommentActivity.this);<NEW_LINE>UploadedImagesBottomSheetFragment fragment = new UploadedImagesBottomSheetFragment();<NEW_LINE>Bundle arguments = new Bundle();<NEW_LINE>arguments.putParcelableArrayList(UploadedImagesBottomSheetFragment.EXTRA_UPLOADED_IMAGES, uploadedImages);<NEW_LINE>fragment.setArguments(arguments);<NEW_LINE>fragment.show(getSupportFragmentManager(), fragment.getTag());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>markdownBottomBarRecyclerView.setLayoutManager(new LinearLayoutManagerBugFixed(this, LinearLayoutManager.HORIZONTAL, false));<NEW_LINE>markdownBottomBarRecyclerView.setAdapter(adapter);<NEW_LINE>contentEditText.requestFocus();<NEW_LINE>InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<NEW_LINE>if (imm != null) {<NEW_LINE>imm.<MASK><NEW_LINE>}<NEW_LINE>}
toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
441,215
public com.amazonaws.services.iotwireless.model.TooManyTagsException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.iotwireless.model.TooManyTagsException tooManyTagsException = new com.amazonaws.services.iotwireless.model.TooManyTagsException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ResourceName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>tooManyTagsException.setResourceName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return tooManyTagsException;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
636,986
public IfcModel execute() throws UserException, BimserverDatabaseException, BimserverLockConflictException {<NEW_LINE>DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm");<NEW_LINE>User user = getUserByUoid(getAuthorization().getUoid());<NEW_LINE>Revision revision = getRevisionByRoid(roid);<NEW_LINE>Project project = revision.getProject();<NEW_LINE>if (user.getHasRightsOn().contains(project)) {<NEW_LINE>for (Checkout checkout : revision.getCheckouts()) {<NEW_LINE>if (checkout.getRevision() == revision && checkout.getUser() == user && checkout.getActive()) {<NEW_LINE>throw new UserException("This revision has already been checked out by you on " + dateFormat.format(checkout.getDate()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Checkout checkout : project.getCheckouts()) {<NEW_LINE>if (checkout.getUser() == user && checkout.getActive()) {<NEW_LINE>checkout.setActive(false);<NEW_LINE>Checkout newCheckout = getDatabaseSession().create(Checkout.class);<NEW_LINE>newCheckout.setActive(true);<NEW_LINE>newCheckout.setDate(new Date());<NEW_LINE>newCheckout.setUser(user);<NEW_LINE>newCheckout.setProject(project);<NEW_LINE>newCheckout.setRevision(revision);<NEW_LINE>getDatabaseSession().store(checkout);<NEW_LINE>getDatabaseSession().store(newCheckout);<NEW_LINE>getDatabaseSession().store(project);<NEW_LINE>return realCheckout(project, revision, getDatabaseSession(), user);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Checkout checkout = getDatabaseSession(<MASK><NEW_LINE>checkout.setActive(true);<NEW_LINE>checkout.setDate(new Date());<NEW_LINE>checkout.setUser(user);<NEW_LINE>checkout.setProject(project);<NEW_LINE>checkout.setRevision(revision);<NEW_LINE>getDatabaseSession().store(checkout);<NEW_LINE>getDatabaseSession().store(project);<NEW_LINE>return realCheckout(project, revision, getDatabaseSession(), user);<NEW_LINE>} else {<NEW_LINE>throw new UserException("Insufficient rights to checkout this project");<NEW_LINE>}<NEW_LINE>}
).create(Checkout.class);
1,785,565
public static IMessage create(PacketSequence packetSequence) {<NEW_LINE>if (packetSequence != null && packetSequence.isComplete()) {<NEW_LINE>PacketSequenceHeader primaryHeader = packetSequence.getPacketSequenceHeader();<NEW_LINE>CorrectedBinaryMessage packet = getPacket(<MASK><NEW_LINE>if (packet != null) {<NEW_LINE>switch(primaryHeader.getServiceAccessPoint()) {<NEW_LINE>case IP_PACKET_DATA:<NEW_LINE>return createIPPacketData(packetSequence, packet);<NEW_LINE>case PROPRIETARY_DATA:<NEW_LINE>return createProprietary(packetSequence, packet);<NEW_LINE>case SHORT_DATA:<NEW_LINE>return createDefinedShortData(packetSequence, packet);<NEW_LINE>default:<NEW_LINE>mLog.info("Unknown Packet SAP: " + primaryHeader.getServiceAccessPoint() + " - returning unknown packet");<NEW_LINE>return new DMRPacketMessage(packetSequence, new UnknownPacket(packet, 0), packet, packetSequence.getTimeslot(), packetSequence.getPacketSequenceHeader().getTimestamp());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO: NOTE: Don't create a DMRPacketMessage unless we have a)Packet and b)Packet Sequence Header<NEW_LINE>return null;<NEW_LINE>}
packetSequence, primaryHeader.isConfirmedData());
1,346,912
// B.3 pg 62<NEW_LINE>public ECPoint twice() {<NEW_LINE>if (this.isInfinity()) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>ECCurve curve = this.getCurve();<NEW_LINE>SecP224K1FieldElement Y1 = (SecP224K1FieldElement) this.y;<NEW_LINE>if (Y1.isZero()) {<NEW_LINE>return curve.getInfinity();<NEW_LINE>}<NEW_LINE>SecP224K1FieldElement X1 = (SecP224K1FieldElement) this.x, Z1 = (SecP224K1FieldElement) this.zs[0];<NEW_LINE>int c;<NEW_LINE>int[] Y1Squared = Nat224.create();<NEW_LINE>SecP224K1Field.square(Y1.x, Y1Squared);<NEW_LINE>int[] T = Nat224.create();<NEW_LINE>SecP224K1Field.square(Y1Squared, T);<NEW_LINE>int[] M = Nat224.create();<NEW_LINE>SecP224K1Field.square(X1.x, M);<NEW_LINE>c = Nat224.<MASK><NEW_LINE>SecP224K1Field.reduce32(c, M);<NEW_LINE>int[] S = Y1Squared;<NEW_LINE>SecP224K1Field.multiply(Y1Squared, X1.x, S);<NEW_LINE>c = Nat.shiftUpBits(7, S, 2, 0);<NEW_LINE>SecP224K1Field.reduce32(c, S);<NEW_LINE>int[] t1 = Nat224.create();<NEW_LINE>c = Nat.shiftUpBits(7, T, 3, 0, t1);<NEW_LINE>SecP224K1Field.reduce32(c, t1);<NEW_LINE>SecP224K1FieldElement X3 = new SecP224K1FieldElement(T);<NEW_LINE>SecP224K1Field.square(M, X3.x);<NEW_LINE>SecP224K1Field.subtract(X3.x, S, X3.x);<NEW_LINE>SecP224K1Field.subtract(X3.x, S, X3.x);<NEW_LINE>SecP224K1FieldElement Y3 = new SecP224K1FieldElement(S);<NEW_LINE>SecP224K1Field.subtract(S, X3.x, Y3.x);<NEW_LINE>SecP224K1Field.multiply(Y3.x, M, Y3.x);<NEW_LINE>SecP224K1Field.subtract(Y3.x, t1, Y3.x);<NEW_LINE>SecP224K1FieldElement Z3 = new SecP224K1FieldElement(M);<NEW_LINE>SecP224K1Field.twice(Y1.x, Z3.x);<NEW_LINE>if (!Z1.isOne()) {<NEW_LINE>SecP224K1Field.multiply(Z3.x, Z1.x, Z3.x);<NEW_LINE>}<NEW_LINE>return new SecP224K1Point(curve, X3, Y3, new ECFieldElement[] { Z3 });<NEW_LINE>}
addBothTo(M, M, M);
1,229,483
public void contextInitialized(ServletContextEvent sce) {<NEW_LINE>WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();<NEW_LINE>ComponentEnvManager compEnvManager = wscImpl.getComponentEnvManager();<NEW_LINE>JndiNameEnvironment jndiNameEnv = compEnvManager.getCurrentJndiNameEnvironment();<NEW_LINE>WebBundleDescriptor webBundle = null;<NEW_LINE>if (jndiNameEnv != null && jndiNameEnv instanceof BundleDescriptor && ((BundleDescriptor) jndiNameEnv).getModuleType().equals(DOLUtils.warType())) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>throw new WebServiceException("Cannot intialize the JAXWSServlet for " + jndiNameEnv);<NEW_LINE>}<NEW_LINE>contextRoot = webBundle.getContextRoot();<NEW_LINE>WebServicesDescriptor webServices = webBundle.getWebServices();<NEW_LINE>try {<NEW_LINE>for (WebServiceEndpoint endpoint : webServices.getEndpoints()) {<NEW_LINE>registerEndpoint(endpoint, sce.getServletContext());<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// TODO Fix Rama<NEW_LINE>logger.log(Level.WARNING, LogUtils.DEPLOYMENT_FAILED, t);<NEW_LINE>sce.getServletContext().removeAttribute("ADAPTER_LIST");<NEW_LINE>throw new RuntimeException("Servlet web service endpoint '" + "' failure", t);<NEW_LINE>}<NEW_LINE>}
webBundle = ((WebBundleDescriptor) jndiNameEnv);
1,388,971
protected boolean trackFeature() {<NEW_LINE>pairs.reset();<NEW_LINE>// total number of tracks which contribute to FB error<NEW_LINE>int numTracksFB = 0;<NEW_LINE>// tracks which are not dropped<NEW_LINE>int numTracksRemaining = 0;<NEW_LINE>for (int i = 0; i < tracks.length; i++) {<NEW_LINE>Track t = tracks[i];<NEW_LINE>if (!t.active)<NEW_LINE>continue;<NEW_LINE>float prevX = t.klt.x;<NEW_LINE>float prevY = t.klt.y;<NEW_LINE>// track in forwards direction<NEW_LINE>tracker.setImage(currentImage, currentDerivX, currentDerivY);<NEW_LINE>KltTrackFault result = tracker.track(t.klt);<NEW_LINE>if (result != KltTrackFault.SUCCESS) {<NEW_LINE>t.active = false;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>float currX = t.klt.x;<NEW_LINE>float currY = t.klt.y;<NEW_LINE>// track in reverse direction<NEW_LINE>tracker.setDescription(t.klt);<NEW_LINE>tracker.setImage(previousImage, previousDerivX, previousDerivY);<NEW_LINE>result = tracker.track(t.klt);<NEW_LINE>if (result != KltTrackFault.SUCCESS) {<NEW_LINE>t.active = false;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// compute forward-backwards error<NEW_LINE>double errorForwardBackwards = UtilPoint2D_F32.distanceSq(prevX, prevY, t.klt.x, t.klt.y);<NEW_LINE>// put into lists for computing the median error<NEW_LINE>errorsFB[numTracksFB++] = errorForwardBackwards;<NEW_LINE>// discard if error is too large<NEW_LINE>if (errorForwardBackwards > maxErrorFB) {<NEW_LINE>t.active = false;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// create data structure used for group motion estimation<NEW_LINE>AssociatedPair p = pairs.grow();<NEW_LINE>p.p1.setTo(prevX, prevY);<NEW_LINE>p.<MASK><NEW_LINE>numTracksRemaining++;<NEW_LINE>}<NEW_LINE>// if the forward-backwards error is too large, give up<NEW_LINE>double medianFB = QuickSelect.select(errorsFB, numTracksFB / 2, numTracksFB);<NEW_LINE>// System.out.println("Median tracking error FB: "+medianFB);<NEW_LINE>if (medianFB > maxErrorFB || numTracksRemaining < 4)<NEW_LINE>return false;<NEW_LINE>return true;<NEW_LINE>}
p2.setTo(currX, currY);
1,351,920
public void marshall(FleetSummary fleetSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (fleetSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(fleetSummary.getCreatedTime(), CREATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleetSummary.getLastUpdatedTime(), LASTUPDATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleetSummary.getFleetName(), FLEETNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleetSummary.getDisplayName(), DISPLAYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleetSummary.getCompanyCode(), COMPANYCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleetSummary.getFleetStatus(), FLEETSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleetSummary.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
fleetSummary.getFleetArn(), FLEETARN_BINDING);
261,969
private void demoIndexByTableWithElementsAsMapOfEntries(Connection conn) throws SQLException {<NEW_LINE>// Initialize the map. The indices of Associative Array can be sparse and negative.<NEW_LINE>final Map<Integer, String> map = new HashMap<>();<NEW_LINE>map.put(-10, "str1");<NEW_LINE>map.put(20, "str2");<NEW_LINE>map.put(-30, "str3str3str3str3str3str3str3str3str3");<NEW_LINE>map.put(10, null);<NEW_LINE>map.put(-20, null);<NEW_LINE>map.put(40, "str444444444444444444444444444");<NEW_LINE>map.put(45, null);<NEW_LINE><MASK><NEW_LINE>map.put(-15, " ");<NEW_LINE>map.put(15, "\n");<NEW_LINE>map.put(18, " hi ");<NEW_LINE>// Create Oracle Array.<NEW_LINE>final Array inParam = ((OracleConnection) conn).createOracleArray(FULLY_QUALIFIED_INDEX_BY_TYPE_NAME, map);<NEW_LINE>// Prepare CallableStatement with stored procedure call SQL and execute.<NEW_LINE>try (CallableStatement cStmt = prepareCallAndExecute(conn, inParam)) {<NEW_LINE>// Read values of OUT/IN OUT parameter as an array of elements.<NEW_LINE>readOutParamsAsArray(cStmt);<NEW_LINE>// Read values of OUT/IN OUT parameter as an array of elements.<NEW_LINE>readOutParamsAsMap(cStmt);<NEW_LINE>}<NEW_LINE>}
map.put(33, "");
1,384,795
private static Lookup findLookupFor(NavigationHistory.Waypoint wpt) {<NEW_LINE>// try component first<NEW_LINE>JTextComponent component = wpt.getComponent();<NEW_LINE>if (component != null) {<NEW_LINE>for (java.awt.Component c = component; c != null; c = c.getParent()) {<NEW_LINE>if (c instanceof Lookup.Provider) {<NEW_LINE>Lookup lookup = ((Lookup.Provider) c).getLookup();<NEW_LINE>if (lookup != null) {<NEW_LINE>return lookup;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now try DataObject<NEW_LINE>URL url = wpt.getUrl();<NEW_LINE>FileObject f = url == null ? null : URLMapper.findFileObject(url);<NEW_LINE>if (f != null) {<NEW_LINE>try {<NEW_LINE>return DataObject.<MASK><NEW_LINE>} catch (DataObjectNotFoundException e) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.WARNING, "Can't get DataObject for " + f, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
find(f).getLookup();
485,009
private void tableSelect() {<NEW_LINE>BlacklistRule bl = null;<NEW_LINE>int selectedTableRow = jTableBlacklist.getSelectedRow();<NEW_LINE>if (selectedTableRow >= 0) {<NEW_LINE>int del = jTableBlacklist.convertRowIndexToModel(selectedTableRow);<NEW_LINE>String delNr = jTableBlacklist.getModel().getValueAt(del, BlacklistRule.BLACKLIST_NR).toString();<NEW_LINE>bl = daten.getListeBlacklist().getRuleByNr(delNr);<NEW_LINE>}<NEW_LINE>if (bl != null) {<NEW_LINE>jComboBoxSender.setSelectedItem(bl.arr[BlacklistRule.BLACKLIST_SENDER]);<NEW_LINE>jComboBoxThema.setSelectedItem(bl.arr[BlacklistRule.BLACKLIST_THEMA]);<NEW_LINE>jTextFieldTitel.setText(bl<MASK><NEW_LINE>jTextFieldThemaTitel.setText(bl.arr[BlacklistRule.BLACKLIST_THEMA_TITEL]);<NEW_LINE>}<NEW_LINE>}
.arr[BlacklistRule.BLACKLIST_TITEL]);
773,785
public static boolean isOnXParameterAnnotation(HighlightInfo highlightInfo, PsiFile file) {<NEW_LINE>final String description = StringUtil.notNullize(highlightInfo.getDescription());<NEW_LINE>if (!(ANNOTATION_TYPE_EXPECTED.equals(description) || CANNOT_RESOLVE_SYMBOL_UNDERSCORES_MESSAGE.matcher(description).matches() || CANNOT_RESOLVE_METHOD_UNDERSCORES_MESSAGE.matcher(description).matches())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>PsiElement highlightedElement = file.findElementAt(highlightInfo.getStartOffset());<NEW_LINE>PsiNameValuePair nameValuePair = findContainingNameValuePair(highlightedElement);<NEW_LINE>if (nameValuePair == null || !(nameValuePair.getContext() instanceof PsiAnnotationParameterList)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (null != parameterName && parameterName.contains("_")) {<NEW_LINE>parameterName = parameterName.substring(0, parameterName.indexOf('_'));<NEW_LINE>}<NEW_LINE>if (!ONX_PARAMETERS.contains(parameterName)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>PsiElement containingAnnotation = nameValuePair.getContext().getContext();<NEW_LINE>return containingAnnotation instanceof PsiAnnotation && ONXABLE_ANNOTATIONS.contains(((PsiAnnotation) containingAnnotation).getQualifiedName());<NEW_LINE>}
String parameterName = nameValuePair.getName();
1,833,828
protected void removeObsoleteBackupFiles(String dbFolderName) {<NEW_LINE>File dbFolder = new File(dbFolderName);<NEW_LINE>if (dbFolder.exists() && dbFolder.isDirectory()) {<NEW_LINE>File[] backupFiles = dbFolder.listFiles(new FilenameFilter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean accept(File dir, String name) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>Arrays.sort(backupFiles);<NEW_LINE>if (backupFiles.length > maxBackups) {<NEW_LINE>logger.debug("found {} backup files but only {} are allowed. will remove the oldest {} file(s) now", new Object[] { backupFiles.length, maxBackups, backupFiles.length - maxBackups });<NEW_LINE>for (int index = 0; index < backupFiles.length - maxBackups; index++) {<NEW_LINE>boolean successful = backupFiles[index].delete();<NEW_LINE>if (successful) {<NEW_LINE>logger.trace("successfully deleted file '{}'", backupFiles[index]);<NEW_LINE>} else {<NEW_LINE>logger.debug("couldn't delete file '{}'", backupFiles[index]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
name.endsWith(DB_FILE_NAME + ".bak");
1,850,129
public static ListRepositoryTagsResponse unmarshall(ListRepositoryTagsResponse listRepositoryTagsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listRepositoryTagsResponse.setRequestId(_ctx.stringValue("ListRepositoryTagsResponse.RequestId"));<NEW_LINE>listRepositoryTagsResponse.setErrorCode(_ctx.stringValue("ListRepositoryTagsResponse.ErrorCode"));<NEW_LINE>listRepositoryTagsResponse.setSuccess(_ctx.booleanValue("ListRepositoryTagsResponse.Success"));<NEW_LINE>listRepositoryTagsResponse.setErrorMessage(_ctx.stringValue("ListRepositoryTagsResponse.ErrorMessage"));<NEW_LINE>listRepositoryTagsResponse.setTotal(_ctx.longValue("ListRepositoryTagsResponse.Total"));<NEW_LINE>List<ResultItem> result = new ArrayList<ResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListRepositoryTagsResponse.Result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setId(_ctx.stringValue<MASK><NEW_LINE>resultItem.setName(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Name"));<NEW_LINE>resultItem.setMessage(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Message"));<NEW_LINE>Commit commit = new Commit();<NEW_LINE>commit.setId(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.Id"));<NEW_LINE>commit.setShortId(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.ShortId"));<NEW_LINE>commit.setTitle(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.Title"));<NEW_LINE>commit.setAuthorName(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.AuthorName"));<NEW_LINE>commit.setAuthorEmail(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.AuthorEmail"));<NEW_LINE>commit.setCreatedAt(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.CreatedAt"));<NEW_LINE>commit.setMessage(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.Message"));<NEW_LINE>commit.setAuthoredDate(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.AuthoredDate"));<NEW_LINE>commit.setCommittedDate(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.CommittedDate"));<NEW_LINE>commit.setCommitterEmail(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.CommitterEmail"));<NEW_LINE>commit.setCommitterName(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.CommitterName"));<NEW_LINE>List<String> parentIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.ParentIds.Length"); j++) {<NEW_LINE>parentIds.add(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.ParentIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>commit.setParentIds(parentIds);<NEW_LINE>Signature1 signature1 = new Signature1();<NEW_LINE>signature1.setGpgKeyId(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.Signature.GpgKeyId"));<NEW_LINE>signature1.setVerificationStatus(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Commit.Signature.VerificationStatus"));<NEW_LINE>commit.setSignature1(signature1);<NEW_LINE>resultItem.setCommit(commit);<NEW_LINE>Signature signature = new Signature();<NEW_LINE>signature.setGpgKeyId(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Signature.GpgKeyId"));<NEW_LINE>signature.setVerificationStatus(_ctx.stringValue("ListRepositoryTagsResponse.Result[" + i + "].Signature.VerificationStatus"));<NEW_LINE>resultItem.setSignature(signature);<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>listRepositoryTagsResponse.setResult(result);<NEW_LINE>return listRepositoryTagsResponse;<NEW_LINE>}
("ListRepositoryTagsResponse.Result[" + i + "].Id"));
1,077,186
public void componentMoved(ComponentEvent e) {<NEW_LINE>int newWidth = e.getComponent().getWidth();<NEW_LINE>int newHeight = e.getComponent().getHeight();<NEW_LINE>boolean sizeChanged = newWidth != width || newHeight != height;<NEW_LINE>width = newWidth;<NEW_LINE>height = newHeight;<NEW_LINE>int newX = e.getComponent().getX();<NEW_LINE>int newY = e<MASK><NEW_LINE>int movedX = newX - x;<NEW_LINE>int movedY = newY - y;<NEW_LINE>x = newX;<NEW_LINE>y = newY;<NEW_LINE>if (ignoreOnce.contains(e.getComponent().getLocation(temp))) {<NEW_LINE>ignoreOnce.remove(temp);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (sizeChanged) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!enabled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Component comp : components) {<NEW_LINE>temp2.x = comp.getX() + movedX;<NEW_LINE>temp2.y = comp.getY() + movedY;<NEW_LINE>if (GuiUtil.isPointOnScreen(temp2, comp.getWidth() / 2, 10)) {<NEW_LINE>comp.setLocation(temp2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getComponent().getY();
555,718
public String processMeCommand(ChatMessage chatMessage) {<NEW_LINE>String contentType = chatMessage.getContentType();<NEW_LINE>String message = chatMessage.getMessage();<NEW_LINE>if (message.length() <= 4 || !message.startsWith("/me ")) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>String msgID = ChatHtmlUtils.MESSAGE_TEXT_ID + chatMessage.getMessageUID();<NEW_LINE><MASK><NEW_LINE>String endHeaderTag = "</I></B></DIV>";<NEW_LINE>chatString += GuiUtils.escapeHTMLChars("*** " + chatMessage.getContactName() + " " + message.substring(4)) + endHeaderTag;<NEW_LINE>Map<String, ReplacementService> listSources = GuiActivator.getReplacementSources();<NEW_LINE>for (ReplacementService source : listSources.values()) {<NEW_LINE>boolean isSmiley = source instanceof SmiliesReplacementService;<NEW_LINE>if (!isSmiley) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String sourcePattern = source.getPattern();<NEW_LINE>Pattern p = Pattern.compile(sourcePattern, Pattern.CASE_INSENSITIVE | Pattern.DOTALL);<NEW_LINE>Matcher m = p.matcher(chatString);<NEW_LINE>chatString = m.replaceAll(ChatHtmlUtils.HTML_CONTENT_TYPE.equalsIgnoreCase(contentType) ? "$0" : StringEscapeUtils.escapeHtml4("$0"));<NEW_LINE>}<NEW_LINE>return chatString;<NEW_LINE>}
String chatString = "<DIV ID='" + msgID + "'><B><I>";
725,687
private Task<Map<String, Object>> linkUserWithCredential(Map<String, Object> arguments) {<NEW_LINE>return Tasks.call(cachedThreadPool, () -> {<NEW_LINE>FirebaseUser firebaseUser = getCurrentUser(arguments);<NEW_LINE>AuthCredential credential = getCredential(arguments);<NEW_LINE>if (firebaseUser == null) {<NEW_LINE>throw FlutterFirebaseAuthPluginException.noUser();<NEW_LINE>}<NEW_LINE>if (credential == null) {<NEW_LINE>throw FlutterFirebaseAuthPluginException.invalidCredential();<NEW_LINE>}<NEW_LINE>AuthResult authResult;<NEW_LINE>try {<NEW_LINE>authResult = Tasks.await(firebaseUser.linkWithCredential(credential));<NEW_LINE>} catch (Exception exception) {<NEW_LINE><MASK><NEW_LINE>if (message != null && message.contains("User has already been linked to the given provider.")) {<NEW_LINE>throw FlutterFirebaseAuthPluginException.alreadyLinkedProvider();<NEW_LINE>}<NEW_LINE>throw exception;<NEW_LINE>}<NEW_LINE>return parseAuthResult(authResult);<NEW_LINE>});<NEW_LINE>}
String message = exception.getMessage();
559,698
public Set<Map<String, List<String>>> searchForMultipleAttributeValues(String base, String filter, Object[] params, String[] attributeNames) {<NEW_LINE>// Escape the params acording to RFC2254<NEW_LINE>Object[] encodedParams = new String[params.length];<NEW_LINE>for (int i = 0; i < params.length; i++) {<NEW_LINE>encodedParams[i] = LdapEncoder.filterEncode(params[i].toString());<NEW_LINE>}<NEW_LINE>String formattedFilter = MessageFormat.format(filter, encodedParams);<NEW_LINE>logger.trace(LogMessage.format("Using filter: %s", formattedFilter));<NEW_LINE>HashSet<Map<String, List<String>>> result = new HashSet<>();<NEW_LINE>ContextMapper roleMapper = (ctx) -> {<NEW_LINE>DirContextAdapter adapter = (DirContextAdapter) ctx;<NEW_LINE>Map<String, List<String>> <MASK><NEW_LINE>if (ObjectUtils.isEmpty(attributeNames)) {<NEW_LINE>try {<NEW_LINE>for (NamingEnumeration enumeration = adapter.getAttributes().getAll(); enumeration.hasMore(); ) {<NEW_LINE>Attribute attr = (Attribute) enumeration.next();<NEW_LINE>extractStringAttributeValues(adapter, record, attr.getID());<NEW_LINE>}<NEW_LINE>} catch (NamingException ex) {<NEW_LINE>org.springframework.ldap.support.LdapUtils.convertLdapException(ex);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (String attributeName : attributeNames) {<NEW_LINE>extractStringAttributeValues(adapter, record, attributeName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>record.put(DN_KEY, Arrays.asList(getAdapterDN(adapter)));<NEW_LINE>result.add(record);<NEW_LINE>return null;<NEW_LINE>};<NEW_LINE>SearchControls ctls = new SearchControls();<NEW_LINE>ctls.setSearchScope(this.searchControls.getSearchScope());<NEW_LINE>ctls.setReturningAttributes((attributeNames != null && attributeNames.length > 0) ? attributeNames : null);<NEW_LINE>search(base, formattedFilter, ctls, roleMapper);<NEW_LINE>return result;<NEW_LINE>}
record = new HashMap<>();
1,708,634
protected EnvironmentSensorAsset createDemoEnvironmentAsset(String name, Asset<?> area, GeoJSONPoint location, Supplier<AgentLink<?>> agentLinker) {<NEW_LINE>EnvironmentSensorAsset environmentAsset = new EnvironmentSensorAsset(name);<NEW_LINE>environmentAsset.setParent(area);<NEW_LINE>environmentAsset.getAttributes().addOrReplace(new Attribute<>(Asset.LOCATION, location));<NEW_LINE>environmentAsset.getAttributes().getOrCreate(EnvironmentSensorAsset.TEMPERATURE).addMeta(new MetaItem<>(AGENT_LINK, agentLinker.get()));<NEW_LINE>environmentAsset.getAttributes().getOrCreate(EnvironmentSensorAsset.NO2).addMeta(new MetaItem<>(AGENT_LINK<MASK><NEW_LINE>environmentAsset.getAttributes().getOrCreate(EnvironmentSensorAsset.RELATIVE_HUMIDITY).addMeta(new MetaItem<>(AGENT_LINK, agentLinker.get()));<NEW_LINE>environmentAsset.getAttributes().getOrCreate(EnvironmentSensorAsset.PM1).addMeta(new MetaItem<>(AGENT_LINK, agentLinker.get()));<NEW_LINE>environmentAsset.getAttributes().getOrCreate(EnvironmentSensorAsset.PM2_5).addMeta(new MetaItem<>(AGENT_LINK, agentLinker.get()));<NEW_LINE>environmentAsset.getAttributes().getOrCreate(EnvironmentSensorAsset.PM10).addMeta(new MetaItem<>(AGENT_LINK, agentLinker.get()));<NEW_LINE>return environmentAsset;<NEW_LINE>}
, agentLinker.get()));
159,180
protected final Map<TKey, TValue> deserializeValue(UntaggedDeserializationContext context, TypeDef typeDef) throws IOException {<NEW_LINE>final int count = context.reader.readContainerBegin();<NEW_LINE>final Map<TKey, TValue> value = newDefaultValue();<NEW_LINE>final TypeDef keyType = typeDef.key;<NEW_LINE>final TypeDef valueType = typeDef.element;<NEW_LINE>for (int i = 0; i < count; ++i) {<NEW_LINE>TKey mapEntryKey = null;<NEW_LINE>try {<NEW_LINE>mapEntryKey = this.<MASK><NEW_LINE>} catch (InvalidBondDataException e) {<NEW_LINE>Throw.raiseMapContainerElementSerializationError(true, this.getFullName(), i, null, e, null);<NEW_LINE>}<NEW_LINE>TValue mapEntryValue = null;<NEW_LINE>try {<NEW_LINE>mapEntryValue = this.valueType.deserializeValue(context, valueType);<NEW_LINE>} catch (InvalidBondDataException e) {<NEW_LINE>Throw.raiseMapContainerElementSerializationError(true, this.getFullName(), i, mapEntryKey, e, null);<NEW_LINE>}<NEW_LINE>value.put(mapEntryKey, mapEntryValue);<NEW_LINE>}<NEW_LINE>context.reader.readContainerEnd();<NEW_LINE>return value;<NEW_LINE>}
keyType.deserializeValue(context, keyType);
1,447,733
private void saveProperty(EventObject e) {<NEW_LINE>if (e.getSource() == chkBackupDnsEnabled) {<NEW_LINE>boolean enabled = chkBackupDnsEnabled.isSelected();<NEW_LINE>configService.setProperty(PNAME_BACKUP_RESOLVER_ENABLED, enabled);<NEW_LINE>updateButtonsState();<NEW_LINE>} else if (e.getSource() == txtBackupResolver) {<NEW_LINE>configService.setProperty(PNAME_BACKUP_RESOLVER, txtBackupResolver.getText());<NEW_LINE>} else if (e.getSource() == spnBackupResolverPort) {<NEW_LINE>configService.setProperty(PNAME_BACKUP_RESOLVER_PORT, spnBackupResolverPort.<MASK><NEW_LINE>} else if (e.getSource() == spnDnsTimeout) {<NEW_LINE>configService.setProperty(PNAME_DNS_PATIENCE, spnDnsTimeout.getValue().toString());<NEW_LINE>} else if (e.getSource() == spnDnsRedemption) {<NEW_LINE>configService.setProperty(PNAME_DNS_REDEMPTION, spnDnsRedemption.getValue().toString());<NEW_LINE>}<NEW_LINE>}
getValue().toString());
41,142
private void createJournal(MJournalBatch journalBatch, int conversionTypeId, int calendarId, int budgetId) {<NEW_LINE>int noPeriods = 0;<NEW_LINE>if (getNoOfPeriods() == 0 || getNoOfPeriods() > 12)<NEW_LINE>noPeriods = 12;<NEW_LINE>else<NEW_LINE>noPeriods = getNoOfPeriods();<NEW_LINE>definePeriods(calendarId);<NEW_LINE>if (noPeriods > glPeriods.size())<NEW_LINE>noPeriods = glPeriods.size();<NEW_LINE>for (int periodNo = 0; periodNo < noPeriods; periodNo++) {<NEW_LINE>MJournal journal = new MJournal(getCtx(), 0, journalBatch.get_TrxName());<NEW_LINE>journal.setGL_JournalBatch_ID(journalBatch.getGL_JournalBatch_ID());<NEW_LINE>DateFormat dateFormat = new SimpleDateFormat("yyyy-MM");<NEW_LINE>String formattedDate = dateFormat.format(glPeriods.get(periodNo).getStartDate());<NEW_LINE>journal.setDocumentNo(journalBatch.getDocumentNo() + "-" + formattedDate);<NEW_LINE>journal.setDescription(getBatchDescription());<NEW_LINE>journal.setDateAcct(glPeriodsDates.get(periodNo));<NEW_LINE>journal.setDateDoc(glPeriodsDates.get(periodNo));<NEW_LINE>journal.setC_Period_ID(glPeriods.get(periodNo).getC_Period_ID());<NEW_LINE>journal.setClientOrg(journal.getGL_JournalBatch().getAD_Client_ID(), journal.getGL_JournalBatch().getAD_Org_ID());<NEW_LINE>journal.setPostingType(MJournalBatch.POSTINGTYPE_Budget);<NEW_LINE>journal.setGL_Category_ID(journalBatch.getGL_Category_ID());<NEW_LINE>journal.setC_Currency_ID(journalBatch.getC_Currency_ID());<NEW_LINE>journal.setC_DocType_ID(journalBatch.getC_DocType_ID());<NEW_LINE><MASK><NEW_LINE>journal.setC_ConversionType_ID(conversionTypeId);<NEW_LINE>journal.setGL_Budget_ID(budgetId);<NEW_LINE>journal.setC_AcctSchema_ID(getAccountingSchemaId());<NEW_LINE>journal.saveEx();<NEW_LINE>createJournalLine(journal, journalBatch.getDocumentNo(), periodNo);<NEW_LINE>}<NEW_LINE>}
journal.setCurrencyRate(BigDecimal.ONE);
219,141
private List<FetchedValue> extractBatchedValues(FetchedValue fetchedValueContainingList, int expectedSize) {<NEW_LINE>List<Object> list = (List<Object>) fetchedValueContainingList.getFetchedValue();<NEW_LINE>Assert.assertTrue(list.size() <MASK><NEW_LINE>List<FetchedValue> result = new ArrayList<>();<NEW_LINE>for (int i = 0; i < list.size(); i++) {<NEW_LINE>List<GraphQLError> errors;<NEW_LINE>if (i == 0) {<NEW_LINE>errors = fetchedValueContainingList.getErrors();<NEW_LINE>} else {<NEW_LINE>errors = Collections.emptyList();<NEW_LINE>}<NEW_LINE>FetchedValue fetchedValue = FetchedValue.newFetchedValue().fetchedValue(list.get(i)).rawFetchedValue(fetchedValueContainingList.getRawFetchedValue()).errors(errors).localContext(fetchedValueContainingList.getLocalContext()).build();<NEW_LINE>result.add(fetchedValue);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
== expectedSize, () -> "Unexpected result size");
88,220
public void serialize(DataOutputStream stream) throws IOException {<NEW_LINE>stream.writeByte((byte) PhysicalPlanType.APPEND_TEMPLATE.ordinal());<NEW_LINE>ReadWriteIOUtils.write(name, stream);<NEW_LINE>ReadWriteIOUtils.write(isAligned, stream);<NEW_LINE>// measurements<NEW_LINE>ReadWriteIOUtils.write(measurements.length, stream);<NEW_LINE>for (String measurement : measurements) {<NEW_LINE>ReadWriteIOUtils.write(measurement, stream);<NEW_LINE>}<NEW_LINE>// datatype<NEW_LINE>ReadWriteIOUtils.write(dataTypes.length, stream);<NEW_LINE>for (TSDataType dataType : dataTypes) {<NEW_LINE>ReadWriteIOUtils.write(dataType.ordinal(), stream);<NEW_LINE>}<NEW_LINE>// encoding<NEW_LINE>ReadWriteIOUtils.<MASK><NEW_LINE>for (TSEncoding encoding : encodings) {<NEW_LINE>ReadWriteIOUtils.write(encoding.ordinal(), stream);<NEW_LINE>}<NEW_LINE>// compressor<NEW_LINE>ReadWriteIOUtils.write(compressors.length, stream);<NEW_LINE>for (CompressionType type : compressors) {<NEW_LINE>ReadWriteIOUtils.write(type.ordinal(), stream);<NEW_LINE>}<NEW_LINE>stream.writeLong(index);<NEW_LINE>}
write(encodings.length, stream);
58,656
public void clear() {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>domain.setText("");<NEW_LINE>if (notConfigOnly) {<NEW_LINE>followRedirects.setSelected(<MASK><NEW_LINE>autoRedirects.setSelected(getUrlConfigDefaults().isAutoRedirects());<NEW_LINE>method.setText(getUrlConfigDefaults().getDefaultMethod());<NEW_LINE>useKeepAlive.setSelected(getUrlConfigDefaults().isUseKeepAlive());<NEW_LINE>useMultipart.setSelected(getUrlConfigDefaults().isUseMultipart());<NEW_LINE>useBrowserCompatibleMultipartMode.setSelected(getUrlConfigDefaults().isUseBrowserCompatibleMultipartMode());<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>path.setText("");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>port.setText("");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>protocol.setText("");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>contentEncoding.setText("");<NEW_LINE>argsPanel.clear();<NEW_LINE>if (showFileUploadPane) {<NEW_LINE>filesPanel.clear();<NEW_LINE>}<NEW_LINE>if (showRawBodyPane) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>postBodyContent.setInitialText("");<NEW_LINE>}<NEW_LINE>postContentTabbedPane.setSelectedIndex(TAB_PARAMETERS, false);<NEW_LINE>}
getUrlConfigDefaults().isFollowRedirects());
1,789,696
static Protos.BluetoothCharacteristic from(BluetoothDevice device, BluetoothGattCharacteristic characteristic, BluetoothGatt gatt) {<NEW_LINE>Protos.BluetoothCharacteristic.Builder p = Protos.BluetoothCharacteristic.newBuilder();<NEW_LINE>p.setRemoteId(device.getAddress());<NEW_LINE>p.setUuid(characteristic.getUuid().toString());<NEW_LINE>p.setProperties(from<MASK><NEW_LINE>if (characteristic.getValue() != null)<NEW_LINE>p.setValue(ByteString.copyFrom(characteristic.getValue()));<NEW_LINE>for (BluetoothGattDescriptor d : characteristic.getDescriptors()) {<NEW_LINE>p.addDescriptors(from(device, d));<NEW_LINE>}<NEW_LINE>if (characteristic.getService().getType() == BluetoothGattService.SERVICE_TYPE_PRIMARY) {<NEW_LINE>p.setServiceUuid(characteristic.getService().getUuid().toString());<NEW_LINE>} else {<NEW_LINE>// Reverse search to find service<NEW_LINE>for (BluetoothGattService s : gatt.getServices()) {<NEW_LINE>for (BluetoothGattService ss : s.getIncludedServices()) {<NEW_LINE>if (ss.getUuid().equals(characteristic.getService().getUuid())) {<NEW_LINE>p.setServiceUuid(s.getUuid().toString());<NEW_LINE>p.setSecondaryServiceUuid(ss.getUuid().toString());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return p.build();<NEW_LINE>}
(characteristic.getProperties()));
1,378,519
private boolean isSLAStale(ResourceFile slaFile) {<NEW_LINE>String slafilename = slaFile.getName();<NEW_LINE>int <MASK><NEW_LINE>String slabase = slafilename.substring(0, index);<NEW_LINE>String slaspecfilename = slabase + ".slaspec";<NEW_LINE>ResourceFile slaspecFile = new ResourceFile(slaFile.getParentFile(), slaspecfilename);<NEW_LINE>File resourceAsFile = slaspecFile.getFile(true);<NEW_LINE>SleighPreprocessor preprocessor = new SleighPreprocessor(new ModuleDefinitionsAdapter(), resourceAsFile);<NEW_LINE>long sourceTimestamp = Long.MAX_VALUE;<NEW_LINE>try {<NEW_LINE>sourceTimestamp = preprocessor.scanForTimestamp();<NEW_LINE>} catch (Exception e) {<NEW_LINE>// squash the error because we will force recompilation and errors<NEW_LINE>// will propagate elsewhere<NEW_LINE>}<NEW_LINE>long compiledTimestamp = slaFile.lastModified();<NEW_LINE>return (sourceTimestamp > compiledTimestamp);<NEW_LINE>}
index = slafilename.lastIndexOf('.');
1,418,452
public Mono<Void> onMessageCreate(int shardIndex, MessageCreate dispatch) {<NEW_LINE>ImmutableMessageData message = ImmutableMessageData.copyOf(dispatch.message());<NEW_LINE>long channelId = message.channelId().asLong();<NEW_LINE>long messageId = message.id().asLong();<NEW_LINE>Long2 id = new Long2(channelId, messageId);<NEW_LINE>return Mono.fromRunnable(() -> {<NEW_LINE>ChannelContent <MASK><NEW_LINE>channels.computeIfPresent(id.a, (k, channel) -> channel.withLastMessageIdOrNull(id.b));<NEW_LINE>channelContent.messageIds.add(id);<NEW_LINE>AtomicReference<ImmutableUserData> userRef = computeUserRef(message.author().id().asLong(), message, (m, old) -> ImmutableUserData.copyOf(m.author()));<NEW_LINE>messages.put(id, new WithUser<>(message.withAuthor(EmptyUser.INSTANCE), userRef, ImmutableMessageData::withAuthor));<NEW_LINE>});<NEW_LINE>}
channelContent = computeChannelContent(id.a);
376,916
private void introspectSelfIntrospectable() {<NEW_LINE>try {<NEW_LINE>String[] strings = ((FFDCSelfIntrospectable) _member).introspectSelf();<NEW_LINE>if (strings != null) {<NEW_LINE>for (int i = 0; i < strings.length; i++) {<NEW_LINE>// If the string has an equals sign in it, split it there<NEW_LINE>if (strings[i] != null) {<NEW_LINE>int equalsLoc = strings[i].indexOf(EQUALS);<NEW_LINE>if (equalsLoc > 0 && equalsLoc < strings[i].length() - EQUALS_LENGTH) {<NEW_LINE>// Of the form "x = y"<NEW_LINE>addNewChild(strings[i].substring(0, equalsLoc), strings[i].substring(equalsLoc + EQUALS_LENGTH));<NEW_LINE>} else if (equalsLoc > 0) {<NEW_LINE>// Of the form "X = "<NEW_LINE>addNewChild(strings[i].substring(0, equalsLoc), "");<NEW_LINE>} else {<NEW_LINE>// There's a string (but it's not got a = in it)<NEW_LINE>addNewChild("strings[" + i + "]", strings[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// The string reference is null<NEW_LINE>addNewChild(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>// No FFDC code needed - we're doing an FFDC already<NEW_LINE>// Do nothing - we don't want to cause even more trouble :-)<NEW_LINE>}<NEW_LINE>}
"strings[" + i + "]", null);
430,545
protected ExecutableDdlJob doCreate() {<NEW_LINE>final TableMeta primaryTableMeta = OptimizerContext.getContext(schemaName).getLatestSchemaManager().getTable(primaryTableName);<NEW_LINE>checkLocalPartitionColumnInUk(primaryTableMeta);<NEW_LINE>List<TableMeta> gsiList = GlobalIndexMeta.getIndex(primaryTableName, schemaName, executionContext);<NEW_LINE>if (CollectionUtils.isNotEmpty(gsiList)) {<NEW_LINE>for (TableMeta gsiMeta : gsiList) {<NEW_LINE>checkLocalPartitionColumnInUk(gsiMeta);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MysqlDateTime pivotDate = definitionInfo.evalPivotDate(executionContext);<NEW_LINE>SQLPartitionByRange partitionByRange = <MASK><NEW_LINE>SQLAlterTableStatement alterTableStatement = new SQLAlterTableStatement();<NEW_LINE>alterTableStatement.setPartition(partitionByRange);<NEW_LINE>alterTableStatement.setTableSource(new SQLExprTableSource(new SQLIdentifierExpr("?")));<NEW_LINE>alterTableStatement.setDbType(DbType.mysql);<NEW_LINE>final String phySql = alterTableStatement.toString();<NEW_LINE>Map<String, GsiMetaManager.GsiIndexMetaBean> publishedGsi = primaryTableMeta.getGsiPublished();<NEW_LINE>ExecutableDdlJob executableDdlJob = new ExecutableDdlJob();<NEW_LINE>List<DdlTask> taskList = new ArrayList<>();<NEW_LINE>if (primaryTableMeta.getLocalPartitionDefinitionInfo() != null) {<NEW_LINE>LocalPartitionValidateTask localPartitionValidateTask = new LocalPartitionValidateTask(schemaName, primaryTableName);<NEW_LINE>taskList.add(localPartitionValidateTask);<NEW_LINE>}<NEW_LINE>taskList.add(genPhyDdlTask(schemaName, primaryTableName, phySql));<NEW_LINE>if (publishedGsi != null) {<NEW_LINE>publishedGsi.forEach((gsiName, gsiIndexMetaBean) -> {<NEW_LINE>taskList.add(genPhyDdlTask(schemaName, gsiName, phySql));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (primaryTableMeta.getLocalPartitionDefinitionInfo() != null) {<NEW_LINE>taskList.add(new RemoveLocalPartitionTask(schemaName, primaryTableName));<NEW_LINE>}<NEW_LINE>taskList.add(new AddLocalPartitionTask(definitionInfo));<NEW_LINE>taskList.add(new TableSyncTask(schemaName, primaryTableName));<NEW_LINE>executableDdlJob.addSequentialTasks(taskList);<NEW_LINE>return executableDdlJob;<NEW_LINE>}
LocalPartitionDefinitionInfo.generateLocalPartitionStmtForCreate(definitionInfo, pivotDate);
1,270,375
private static NativeContinuation captureContinuation(Context cx, CallFrame frame, boolean requireContinuationsTopFrame) {<NEW_LINE>NativeContinuation c = new NativeContinuation();<NEW_LINE>ScriptRuntime.setObjectProtoAndParent(c<MASK><NEW_LINE>// Make sure that all frames are frozen<NEW_LINE>CallFrame x = frame;<NEW_LINE>CallFrame outermost = frame;<NEW_LINE>while (x != null && !x.frozen) {<NEW_LINE>x.frozen = true;<NEW_LINE>// Allow to GC unused stack space<NEW_LINE>for (int i = x.savedStackTop + 1; i != x.stack.length; ++i) {<NEW_LINE>// Allow to GC unused stack space<NEW_LINE>x.stack[i] = null;<NEW_LINE>x.stackAttributes[i] = ScriptableObject.EMPTY;<NEW_LINE>}<NEW_LINE>if (x.savedCallOp == Token.CALL) {<NEW_LINE>// the call will always overwrite the stack top with the result<NEW_LINE>x.stack[x.savedStackTop] = null;<NEW_LINE>} else {<NEW_LINE>if (x.savedCallOp != Token.NEW)<NEW_LINE>Kit.codeBug();<NEW_LINE>// the new operator uses stack top to store the constructed<NEW_LINE>// object so it shall not be cleared: see comments in<NEW_LINE>// setCallResult<NEW_LINE>}<NEW_LINE>outermost = x;<NEW_LINE>x = x.parentFrame;<NEW_LINE>}<NEW_LINE>if (requireContinuationsTopFrame) {<NEW_LINE>while (outermost.parentFrame != null) outermost = outermost.parentFrame;<NEW_LINE>if (!outermost.isContinuationsTopFrame) {<NEW_LINE>throw new IllegalStateException("Cannot capture continuation " + "from JavaScript code not called directly by " + "executeScriptWithContinuations or " + "callFunctionWithContinuations");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>c.initImplementation(frame);<NEW_LINE>return c;<NEW_LINE>}
, ScriptRuntime.getTopCallScope(cx));
557,901
private boolean processKeyEventOnWindows(KeyEvent e) {<NEW_LINE>if (e.getKeyCode() != KeyEvent.VK_ALT) {<NEW_LINE>selectMenuOnAltReleased = false;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (e.getID() == KeyEvent.KEY_PRESSED) {<NEW_LINE>altPressedEventCount++;<NEW_LINE>if (altPressedEventCount == 1 && !e.isConsumed()) {<NEW_LINE>MenuSelectionManager menuSelectionManager = MenuSelectionManager.defaultManager();<NEW_LINE>selectMenuOnAltReleased = (menuSelectionManager.getSelectedPath().length == 0);<NEW_LINE>// if menu is selected when Alt key is pressed then clear menu selection<NEW_LINE>if (!selectMenuOnAltReleased)<NEW_LINE>menuSelectionManager.clearSelectedPath();<NEW_LINE>}<NEW_LINE>// show mnemonics<NEW_LINE>showMnemonics(shouldShowMnemonics(e), e.getComponent());<NEW_LINE>// avoid that the system menu of the window gets focus<NEW_LINE>e.consume();<NEW_LINE>return true;<NEW_LINE>} else if (e.getID() == KeyEvent.KEY_RELEASED) {<NEW_LINE>altPressedEventCount = 0;<NEW_LINE>boolean mnemonicsShown = false;<NEW_LINE>if (selectMenuOnAltReleased && !e.isConsumed()) {<NEW_LINE>MenuSelectionManager menuSelectionManager = MenuSelectionManager.defaultManager();<NEW_LINE>if (menuSelectionManager.getSelectedPath().length == 0) {<NEW_LINE>// get menu bar and first menu<NEW_LINE><MASK><NEW_LINE>JRootPane rootPane = SwingUtilities.getRootPane(c);<NEW_LINE>JMenuBar menuBar = (rootPane != null) ? rootPane.getJMenuBar() : null;<NEW_LINE>if (menuBar == null) {<NEW_LINE>// get menu bar from frame/dialog because there<NEW_LINE>// may be multiple nested root panes in a frame/dialog<NEW_LINE>// (e.g. each internal frame has its own root pane)<NEW_LINE>Window window = SwingUtilities.getWindowAncestor(c);<NEW_LINE>if (window instanceof JFrame)<NEW_LINE>menuBar = ((JFrame) window).getJMenuBar();<NEW_LINE>else if (window instanceof JDialog)<NEW_LINE>menuBar = ((JDialog) window).getJMenuBar();<NEW_LINE>}<NEW_LINE>JMenu firstMenu = (menuBar != null) ? menuBar.getMenu(0) : null;<NEW_LINE>// select first menu and show mnemonics<NEW_LINE>if (firstMenu != null) {<NEW_LINE>menuSelectionManager.setSelectedPath(new MenuElement[] { menuBar, firstMenu });<NEW_LINE>showMnemonics(true, c);<NEW_LINE>mnemonicsShown = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>selectMenuOnAltReleased = false;<NEW_LINE>// hide mnemonics<NEW_LINE>if (!mnemonicsShown)<NEW_LINE>showMnemonics(shouldShowMnemonics(e), e.getComponent());<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
Component c = e.getComponent();
66,722
public void marshall(Tape tape, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (tape == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(tape.getTapeARN(), TAPEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(tape.getTapeBarcode(), TAPEBARCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(tape.getTapeCreatedDate(), TAPECREATEDDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(tape.getTapeStatus(), TAPESTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(tape.getVTLDevice(), VTLDEVICE_BINDING);<NEW_LINE>protocolMarshaller.marshall(tape.getProgress(), PROGRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(tape.getTapeUsedInBytes(), TAPEUSEDINBYTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(tape.getKMSKey(), KMSKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(tape.getPoolId(), POOLID_BINDING);<NEW_LINE>protocolMarshaller.marshall(tape.getWorm(), WORM_BINDING);<NEW_LINE>protocolMarshaller.marshall(tape.getRetentionStartDate(), RETENTIONSTARTDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(tape.getPoolEntryDate(), POOLENTRYDATE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
tape.getTapeSizeInBytes(), TAPESIZEINBYTES_BINDING);
1,124,486
private static void assertNonBreakingMigration(final JobPersistence jobPersistence, final AirbyteVersion airbyteVersion) throws IOException {<NEW_LINE>// version in the database when the server main method is called. may be empty if this is the first<NEW_LINE>// time the server is started.<NEW_LINE>LOGGER.info("Checking illegal upgrade..");<NEW_LINE>final Optional<AirbyteVersion> initialAirbyteDatabaseVersion = jobPersistence.getVersion(<MASK><NEW_LINE>if (!isLegalUpgrade(initialAirbyteDatabaseVersion.orElse(null), airbyteVersion)) {<NEW_LINE>final String attentionBanner = MoreResources.readResource("banner/attention-banner.txt");<NEW_LINE>LOGGER.error(attentionBanner);<NEW_LINE>final String message = String.format("Cannot upgrade from version %s to version %s directly. First you must upgrade to version %s. After that upgrade is complete, you may upgrade to version %s", initialAirbyteDatabaseVersion.get().serialize(), airbyteVersion.serialize(), VERSION_BREAK.serialize(), airbyteVersion.serialize());<NEW_LINE>LOGGER.error(message);<NEW_LINE>throw new RuntimeException(message);<NEW_LINE>}<NEW_LINE>}
).map(AirbyteVersion::new);
1,245,055
protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite area = (Composite) super.createDialogArea(parent);<NEW_LINE>Composite container = Widgets.createComposite(area, new GridLayout(2, false));<NEW_LINE>container.setLayoutData(new GridData(SWT.FILL, SWT<MASK><NEW_LINE>for (API.Parameter param : command.getParametersList()) {<NEW_LINE>Service.ConstantSet constants = models.constants.getConstants(param.getConstants());<NEW_LINE>String typeString = Editor.getTypeString(param);<NEW_LINE>typeString = typeString.isEmpty() ? "" : " (" + typeString + ")";<NEW_LINE>createLabel(container, param.getName() + typeString + ":");<NEW_LINE>Editor<?> editor = Editor.getFor(container, param, constants);<NEW_LINE>editor.control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));<NEW_LINE>editors.add(editor);<NEW_LINE>}<NEW_LINE>return area;<NEW_LINE>}
.FILL, true, true));
1,630,275
public void testAsyncBulkheadTimeout() throws Exception {<NEW_LINE>syntheticTaskManager.runTest(() -> {<NEW_LINE>// runTaskWithTimeout has a timeout of 2s<NEW_LINE>// These tasks should run in parallel but should time out after 2s<NEW_LINE>SyntheticTask<Void> task1 = syntheticTaskManager.newTask();<NEW_LINE>task1.onInterruption(RETURN);<NEW_LINE>SyntheticTask<Void> task2 = syntheticTaskManager.newTask();<NEW_LINE>task2.onInterruption(RETURN);<NEW_LINE>Future<Void> future1 = bean1.runTaskWithTimeout(task1);<NEW_LINE>Future<Void> <MASK><NEW_LINE>// Check both tasks start<NEW_LINE>task1.assertStarts();<NEW_LINE>task2.assertStarts();<NEW_LINE>// Check they're running in parallel<NEW_LINE>assertFalse(future1.isDone());<NEW_LINE>assertFalse(future2.isDone());<NEW_LINE>// Check they eventually time out<NEW_LINE>assertFutureThrowsException(future1, org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException.class);<NEW_LINE>assertFutureThrowsException(future2, org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException.class);<NEW_LINE>SyntheticTask<Void> task3 = syntheticTaskManager.newTask();<NEW_LINE>Future<Void> future3 = bean1.runTaskWithTimeout(task3);<NEW_LINE>task3.complete();<NEW_LINE>assertFutureHasResult(future3, null);<NEW_LINE>});<NEW_LINE>}
future2 = bean1.runTaskWithTimeout(task2);
1,016,838
private void startReader(String path, boolean preview) {<NEW_LINE>List<Chapter> <MASK><NEW_LINE>int i = 0;<NEW_LINE>for (Task t : mTaskAdapter.getDateSet()) {<NEW_LINE>Long sourceComic = Long.parseLong(t.getSource() + "000" + t.getId());<NEW_LINE>Long id = Long.parseLong(sourceComic + "" + i);<NEW_LINE>if (preview && t.getProgress() > 0) {<NEW_LINE>list.add(new Chapter(id, sourceComic, t.getTitle(), t.getPath(), t.getProgress(), true, true, t.getId()));<NEW_LINE>} else if (t.getState() == Task.STATE_FINISH) {<NEW_LINE>list.add(new Chapter(id, sourceComic, t.getTitle(), t.getPath(), t.getMax(), true, true, t.getId()));<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>if (mTaskOrder) {<NEW_LINE>Collections.reverse(list);<NEW_LINE>}<NEW_LINE>mTaskAdapter.setLast(path);<NEW_LINE>long id = mPresenter.updateLast(path);<NEW_LINE>int mode = mPreference.getInt(PreferenceManager.PREF_READER_MODE, PreferenceManager.READER_MODE_PAGE);<NEW_LINE>Intent readerIntent = ReaderActivity.createIntent(this, id, list, mode);<NEW_LINE>startActivity(readerIntent);<NEW_LINE>}
list = new ArrayList<>();
1,782,372
protected EnumMap<KeyIndex, String> initContentProviderKeys() {<NEW_LINE>EnumMap<KeyIndex, String> keys = new EnumMap<KeyIndex, String>(KeyIndex.class);<NEW_LINE>keys.put(<MASK><NEW_LINE>keys.put(KeyIndex.IS_PRIMARY, Calendars.IS_PRIMARY);<NEW_LINE>keys.put(KeyIndex.CALENDARS_NAME, Calendars.NAME);<NEW_LINE>keys.put(KeyIndex.CALENDARS_DISPLAY_NAME, Calendars.CALENDAR_DISPLAY_NAME);<NEW_LINE>keys.put(KeyIndex.CALENDARS_VISIBLE, Calendars.VISIBLE);<NEW_LINE>keys.put(KeyIndex.EVENTS_ID, Events._ID);<NEW_LINE>keys.put(KeyIndex.EVENTS_CALENDAR_ID, Events.CALENDAR_ID);<NEW_LINE>keys.put(KeyIndex.EVENTS_DESCRIPTION, Events.DESCRIPTION);<NEW_LINE>keys.put(KeyIndex.EVENTS_LOCATION, Events.EVENT_LOCATION);<NEW_LINE>keys.put(KeyIndex.EVENTS_SUMMARY, Events.TITLE);<NEW_LINE>keys.put(KeyIndex.EVENTS_START, Events.DTSTART);<NEW_LINE>keys.put(KeyIndex.EVENTS_END, Events.DTEND);<NEW_LINE>keys.put(KeyIndex.EVENTS_RRULE, Events.RRULE);<NEW_LINE>keys.put(KeyIndex.EVENTS_ALL_DAY, Events.ALL_DAY);<NEW_LINE>keys.put(KeyIndex.INSTANCES_ID, Instances._ID);<NEW_LINE>keys.put(KeyIndex.INSTANCES_EVENT_ID, Instances.EVENT_ID);<NEW_LINE>keys.put(KeyIndex.INSTANCES_BEGIN, Instances.BEGIN);<NEW_LINE>keys.put(KeyIndex.INSTANCES_END, Instances.END);<NEW_LINE>keys.put(KeyIndex.ATTENDEES_ID, Attendees._ID);<NEW_LINE>keys.put(KeyIndex.ATTENDEES_EVENT_ID, Attendees.EVENT_ID);<NEW_LINE>keys.put(KeyIndex.ATTENDEES_NAME, Attendees.ATTENDEE_NAME);<NEW_LINE>keys.put(KeyIndex.ATTENDEES_EMAIL, Attendees.ATTENDEE_EMAIL);<NEW_LINE>keys.put(KeyIndex.ATTENDEES_STATUS, Attendees.ATTENDEE_STATUS);<NEW_LINE>return keys;<NEW_LINE>}
KeyIndex.CALENDARS_ID, Calendars._ID);
1,630,536
private Map<Column, Collection<ShardingConditionValue>> createShardingConditionValueMap(final Collection<ExpressionSegment> predicates, final List<Object> parameters, final Map<String, String> columnTableNames) {<NEW_LINE>Map<Column, Collection<ShardingConditionValue>> result = new HashMap<>(predicates.size(), 1);<NEW_LINE>for (ExpressionSegment each : predicates) {<NEW_LINE>for (ColumnSegment columnSegment : ColumnExtractor.extract(each)) {<NEW_LINE>Optional<String> tableName = Optional.ofNullable(columnTableNames.get<MASK><NEW_LINE>Optional<String> shardingColumn = tableName.flatMap(optional -> shardingRule.findShardingColumn(columnSegment.getIdentifier().getValue(), optional));<NEW_LINE>if (!tableName.isPresent() || !shardingColumn.isPresent()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Column column = new Column(shardingColumn.get(), tableName.get());<NEW_LINE>Optional<ShardingConditionValue> shardingConditionValue = ConditionValueGeneratorFactory.generate(each, column, parameters);<NEW_LINE>if (!shardingConditionValue.isPresent()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>result.computeIfAbsent(column, unused -> new LinkedList<>()).add(shardingConditionValue.get());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
(columnSegment.getExpression()));
561,734
public static DescribeEpnInstancesResponse unmarshall(DescribeEpnInstancesResponse describeEpnInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeEpnInstancesResponse.setRequestId(_ctx.stringValue("DescribeEpnInstancesResponse.RequestId"));<NEW_LINE>describeEpnInstancesResponse.setPageNumber(_ctx.integerValue("DescribeEpnInstancesResponse.PageNumber"));<NEW_LINE>describeEpnInstancesResponse.setPageSize(_ctx.integerValue("DescribeEpnInstancesResponse.PageSize"));<NEW_LINE>describeEpnInstancesResponse.setTotalCount(_ctx.integerValue("DescribeEpnInstancesResponse.TotalCount"));<NEW_LINE>List<EPNInstance> ePNInstances = new ArrayList<EPNInstance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeEpnInstancesResponse.EPNInstances.Length"); i++) {<NEW_LINE>EPNInstance ePNInstance = new EPNInstance();<NEW_LINE>ePNInstance.setCreationTime(_ctx.stringValue("DescribeEpnInstancesResponse.EPNInstances[" + i + "].CreationTime"));<NEW_LINE>ePNInstance.setEPNInstanceId(_ctx.stringValue("DescribeEpnInstancesResponse.EPNInstances[" + i + "].EPNInstanceId"));<NEW_LINE>ePNInstance.setEPNInstanceName(_ctx.stringValue("DescribeEpnInstancesResponse.EPNInstances[" + i + "].EPNInstanceName"));<NEW_LINE>ePNInstance.setEPNInstanceType(_ctx.stringValue("DescribeEpnInstancesResponse.EPNInstances[" + i + "].EPNInstanceType"));<NEW_LINE>ePNInstance.setEndTime(_ctx.stringValue("DescribeEpnInstancesResponse.EPNInstances[" + i + "].EndTime"));<NEW_LINE>ePNInstance.setInternetMaxBandwidthOut(_ctx.integerValue<MASK><NEW_LINE>ePNInstance.setModifyTime(_ctx.stringValue("DescribeEpnInstancesResponse.EPNInstances[" + i + "].ModifyTime"));<NEW_LINE>ePNInstance.setNetworkingModel(_ctx.stringValue("DescribeEpnInstancesResponse.EPNInstances[" + i + "].NetworkingModel"));<NEW_LINE>ePNInstance.setStartTime(_ctx.stringValue("DescribeEpnInstancesResponse.EPNInstances[" + i + "].StartTime"));<NEW_LINE>ePNInstance.setStatus(_ctx.stringValue("DescribeEpnInstancesResponse.EPNInstances[" + i + "].Status"));<NEW_LINE>ePNInstances.add(ePNInstance);<NEW_LINE>}<NEW_LINE>describeEpnInstancesResponse.setEPNInstances(ePNInstances);<NEW_LINE>return describeEpnInstancesResponse;<NEW_LINE>}
("DescribeEpnInstancesResponse.EPNInstances[" + i + "].InternetMaxBandwidthOut"));
1,117,477
private ST_Agedge_s createEdge(ST_Agnode_s a0, ST_Agnode_s a1, int num) {<NEW_LINE>final ST_Agedge_s edge = agedge(g, a0, a1, null, true);<NEW_LINE>edge.NAME = a0.NAME + "-" + a1.NAME;<NEW_LINE>agsafeset(edge, new CString("arrowsize"), new CString(".75"), new CString(""));<NEW_LINE>agsafeset(edge, new CString("arrowtail"), new CString("none"<MASK><NEW_LINE>agsafeset(edge, new CString("arrowhead"), new CString("normal"), new CString(""));<NEW_LINE>agsafeset(edge, new CString("tailport"), new CString("P" + num), new CString(""));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("N" + a0.UID + " -> N" + a1.UID + " [tailport=\"P" + num + "\", arrowsize=.75]");<NEW_LINE>if (NUM == 0 && printFirst)<NEW_LINE>System.err.println(sb);<NEW_LINE>return edge;<NEW_LINE>}
), new CString(""));
1,573,609
public static KeyValuePart[] split(MatrixMeta matrixMeta, int rowId, long[] keys, double[] values, boolean isSorted) {<NEW_LINE>if (!isSorted) {<NEW_LINE>Sort.quickSort(keys, values, 0, keys.length - 1);<NEW_LINE>}<NEW_LINE>PartitionKey[<MASK><NEW_LINE>KeyValuePart[] dataParts = new KeyValuePart[matrixParts.length];<NEW_LINE>int keyIndex = 0;<NEW_LINE>int partIndex = 0;<NEW_LINE>while (keyIndex < keys.length || partIndex < matrixParts.length) {<NEW_LINE>int length = 0;<NEW_LINE>long endOffset = matrixParts[partIndex].getEndCol();<NEW_LINE>while (keyIndex < keys.length && keys[keyIndex] < endOffset) {<NEW_LINE>keyIndex++;<NEW_LINE>length++;<NEW_LINE>}<NEW_LINE>dataParts[partIndex] = new RangeViewLongKeysDoubleValuesPart(rowId, keys, values, keyIndex - length, keyIndex);<NEW_LINE>partIndex++;<NEW_LINE>}<NEW_LINE>return dataParts;<NEW_LINE>}
] matrixParts = matrixMeta.getPartitionKeys();
1,312,886
public static void findProfileViolations(@NonNull final Profile profileToCheck, @NonNull final Iterable<URL> bootClassPath, @NonNull final Iterable<URL> compileClassPath, @NonNull final Iterable<URL> sourcePath, @NonNull final Set<Validation> check, @NonNull final ViolationCollectorFactory collectorFactory, @NonNull final Executor executor) {<NEW_LINE>// NOI18N<NEW_LINE>Parameters.notNull("profileToCheck", profileToCheck);<NEW_LINE>// NOI18N<NEW_LINE>Parameters.notNull("compileClassPath", compileClassPath);<NEW_LINE>// NOI18N<NEW_LINE>Parameters.notNull("sourcePath", sourcePath);<NEW_LINE>// NOI18N<NEW_LINE>Parameters.notNull("check", check);<NEW_LINE>// NOI18N<NEW_LINE><MASK><NEW_LINE>// NOI18N<NEW_LINE>Parameters.notNull("executor", executor);<NEW_LINE>final Context ctx = new Context(profileToCheck, bootClassPath, collectorFactory, check);<NEW_LINE>if (check.contains(Validation.BINARIES_BY_MANIFEST) || check.contains(Validation.BINARIES_BY_CLASS_FILES)) {<NEW_LINE>for (final URL compileRoot : compileClassPath) {<NEW_LINE>executor.execute(Validator.forBinary(compileRoot, ctx));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (check.contains(Validation.SOURCES)) {<NEW_LINE>for (final URL sourceRoot : sourcePath) {<NEW_LINE>executor.execute(Validator.forSource(sourceRoot, ctx));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Parameters.notNull("collectorFactory", collectorFactory);
673,236
// Must init at first<NEW_LINE>public static void allClasses() throws HackAssertionException {<NEW_LINE>if (android.os.Build.VERSION.SDK_INT <= 8) {<NEW_LINE>LoadedApk = Hack.into("android.app.ActivityThread$PackageInfo");<NEW_LINE>} else {<NEW_LINE>LoadedApk = Hack.into("android.app.LoadedApk");<NEW_LINE>}<NEW_LINE>ActivityThread = Hack.into("android.app.ActivityThread");<NEW_LINE>Resources = Hack.into(Resources.class);<NEW_LINE>Application = Hack.into(Application.class);<NEW_LINE>AssetManager = Hack.into(android.<MASK><NEW_LINE>IPackageManager = Hack.into("android.content.pm.IPackageManager");<NEW_LINE>Service = Hack.into(android.app.Service.class);<NEW_LINE>ContextImpl = Hack.into("android.app.ContextImpl");<NEW_LINE>ContextThemeWrapper = Hack.into(ContextThemeWrapper.class);<NEW_LINE>ContextWrapper = Hack.into("android.content.ContextWrapper");<NEW_LINE>sIsIgnoreFailure = true;<NEW_LINE>ClassLoader = Hack.into(java.lang.ClassLoader.class);<NEW_LINE>DexClassLoader = Hack.into(dalvik.system.DexClassLoader.class);<NEW_LINE>LexFile = Hack.into("dalvik.system.LexFile");<NEW_LINE>PackageParser$Component = Hack.into("android.content.pm.PackageParser$Component");<NEW_LINE>PackageParser$Activity = Hack.into("android.content.pm.PackageParser$Activity");<NEW_LINE>PackageParser$Service = Hack.into("android.content.pm.PackageParser$Service");<NEW_LINE>PackageParser$Provider = Hack.into("android.content.pm.PackageParser$Provider");<NEW_LINE>PackageParser = Hack.into("android.content.pm.PackageParser");<NEW_LINE>PackageParser$Package = Hack.into("android.content.pm.PackageParser$Package");<NEW_LINE>PackageParser$ActivityIntentInfo = Hack.into("android.content.pm.PackageParser$ActivityIntentInfo");<NEW_LINE>PackageParser$ServiceIntentInfo = Hack.into("android.content.pm.PackageParser$ServiceIntentInfo");<NEW_LINE>PackageParser$ProviderIntentInfo = Hack.into("android.content.pm.PackageParser$ProviderIntentInfo");<NEW_LINE>ActivityManagerNative = Hack.into("android.app.ActivityManagerNative");<NEW_LINE>Singleton = Hack.into("android.util.Singleton");<NEW_LINE>ActivityThread$AppBindData = Hack.into("android.app.ActivityThread$AppBindData");<NEW_LINE>ActivityManager = Hack.into("android.app.ActivityManager");<NEW_LINE>StringBlock = Hack.into("android.content.res.StringBlock");<NEW_LINE>ApplicationLoaders = Hack.into("android.app.ApplicationLoaders");<NEW_LINE>sIsIgnoreFailure = false;<NEW_LINE>}
content.res.AssetManager.class);
737,231
public void changed(Event event) {<NEW_LINE>log.debug("claspath event received {}", event);<NEW_LINE>server.doOnInitialized(() -> {<NEW_LINE>// log.info("initialized.thenRun block entered");<NEW_LINE>try {<NEW_LINE>synchronized (table) {<NEW_LINE>String uri = UriUtil.normalize(event.projectUri);<NEW_LINE>log.debug("uri = {}", uri);<NEW_LINE>if (event.deleted) {<NEW_LINE>log.debug("event.deleted = true");<NEW_LINE>IJavaProject <MASK><NEW_LINE>if (deleted != null) {<NEW_LINE>log.debug("removed from table = true");<NEW_LINE>notifyDelete(deleted);<NEW_LINE>} else {<NEW_LINE>log.warn("Deleted project not removed because uri {} not found in {}", uri, table.keySet());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.debug("deleted = false");<NEW_LINE>URI projectUri = new URI(uri);<NEW_LINE>ClasspathData classpath = new ClasspathData(event.name, event.classpath.getEntries());<NEW_LINE>IJavaProject newProject = IS_JANDEX_INDEX ? new JavaProject(getFileObserver(), projectUri, classpath, JdtLsProjectCache.this) : new JdtLsJavaProject(server.getClient(), projectUri, classpath, JdtLsProjectCache.this);<NEW_LINE>IJavaProject oldProject = table.put(uri, newProject);<NEW_LINE>if (oldProject != null) {<NEW_LINE>notifyChanged(newProject);<NEW_LINE>} else {<NEW_LINE>notifyCreated(newProject);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("", e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
deleted = table.remove(uri);
976,883
private static void parseMethods(String id, NodeList nodeList, RootBeanDefinition beanDefinition, ParserContext parserContext) throws ClassNotFoundException {<NEW_LINE>if (nodeList != null && nodeList.getLength() > 0) {<NEW_LINE>ManagedList methods = null;<NEW_LINE>for (int i = 0; i < nodeList.getLength(); i++) {<NEW_LINE>Node node = nodeList.item(i);<NEW_LINE>if (node instanceof Element) {<NEW_LINE>Element element = (Element) node;<NEW_LINE>if ("method".equals(node.getNodeName()) || "method".equals(node.getLocalName())) {<NEW_LINE>String methodName = element.getAttribute("name");<NEW_LINE>if (methodName == null || methodName.length() == 0) {<NEW_LINE>throw new IllegalStateException("<motan:method> name attribute == null");<NEW_LINE>}<NEW_LINE>if (methods == null) {<NEW_LINE>methods = new ManagedList();<NEW_LINE>}<NEW_LINE>BeanDefinition methodBeanDefinition = parse((Element) node, <MASK><NEW_LINE>String name = id + "." + methodName;<NEW_LINE>BeanDefinitionHolder methodBeanDefinitionHolder = new BeanDefinitionHolder(methodBeanDefinition, name);<NEW_LINE>methods.add(methodBeanDefinitionHolder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (methods != null) {<NEW_LINE>beanDefinition.getPropertyValues().addPropertyValue("methods", methods);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
parserContext, MethodConfig.class, false);
771,625
public Map<String, Object> toMap() throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {<NEW_LINE>final Map<String, Object> map = new HashMap<>();<NEW_LINE>map.put("active", this.getActive());<NEW_LINE>map.put("actualCompanyId", this.getActualCompanyId());<NEW_LINE>map.put("birthday", this.getBirthday());<NEW_LINE>map.put("comments", this.getComments());<NEW_LINE>map.put("companyId", this.getCompanyId());<NEW_LINE>map.put("createDate", this.getCreateDate());<NEW_LINE>map.put("modificationDate", this.getModificationDate());<NEW_LINE>String emailAddress = this.getEmailAddress();<NEW_LINE>if (!UtilMethods.isSet(this.getEmailAddress())) {<NEW_LINE>emailAddress = StringPool.BLANK;<NEW_LINE>Logger.warn(this, String.format("Email address for user '%s' is null. Returning an empty value instead.", getUserId()));<NEW_LINE>map.put("gravitar", StringPool.BLANK);<NEW_LINE>} else {<NEW_LINE>map.put("gravitar", DigestUtils.md5Hex(emailAddress.toLowerCase()));<NEW_LINE>}<NEW_LINE>map.put("emailAddress", emailAddress);<NEW_LINE>map.put("emailaddress", emailAddress);<NEW_LINE>map.put("failedLoginAttempts", this.getFailedLoginAttempts());<NEW_LINE>map.put("male", this.getMale());<NEW_LINE>map.put("firstName", this.getFirstName());<NEW_LINE>map.put("fullName", this.getFullName());<NEW_LINE>map.put("name", getFullName());<NEW_LINE>map.put("languageId", this.getLanguageId());<NEW_LINE>map.put("lastLoginDate", this.getLastLoginDate());<NEW_LINE>map.put("lastLoginIP", this.getLastLoginIP());<NEW_LINE>map.put("lastName", this.getLastName());<NEW_LINE>map.put("middleName", this.getMiddleName());<NEW_LINE>map.put("female", this.getFemale());<NEW_LINE>map.put("nickname", this.getNickName());<NEW_LINE>map.put("timeZoneId", this.getTimeZoneId());<NEW_LINE>map.put("deleteInProgress", getDeleteInProgress());<NEW_LINE>map.put("deleteDate", getDeleteDate());<NEW_LINE>map.put("passwordExpirationDate", getPasswordExpirationDate());<NEW_LINE>map.put("passwordExpired", isPasswordExpired());<NEW_LINE>map.<MASK><NEW_LINE>map.put("userId", getUserId());<NEW_LINE>map.put("backendUser", isBackendUser());<NEW_LINE>map.put("frontendUser", isFrontendUser());<NEW_LINE>map.put("hasConsoleAccess", hasConsoleAccess());<NEW_LINE>map.put("id", getUserId());<NEW_LINE>map.put("type", UserAjax.USER_TYPE_VALUE);<NEW_LINE>map.put("additionalInfo", getAdditionalInfo());<NEW_LINE>return map;<NEW_LINE>}
put("passwordReset", isPasswordReset());
114,169
private static void addSerialized(StringBuilder result, String key, Object value) {<NEW_LINE>result.append(key.replace(SERIALIZATION_SEPARATOR, SEPARATOR_ESCAPE)).append(SERIALIZATION_SEPARATOR);<NEW_LINE>if (value instanceof Integer) {<NEW_LINE>result.append('i').append(value);<NEW_LINE>} else if (value instanceof Double) {<NEW_LINE>result.append('d').append(value);<NEW_LINE>} else if (value instanceof Long) {<NEW_LINE>result.append('l').append(value);<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>result.append('s').append(value.toString().replace(SERIALIZATION_SEPARATOR, SEPARATOR_ESCAPE));<NEW_LINE>} else if (value instanceof Boolean) {<NEW_LINE>result.append('b').append(value);<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException(value.<MASK><NEW_LINE>}<NEW_LINE>result.append(SERIALIZATION_SEPARATOR);<NEW_LINE>}
getClass().toString());
1,590,943
public int offsetToVisualColumnInFoldRegion(@Nonnull FoldRegion region, int offset, boolean leanTowardsLargerOffsets) {<NEW_LINE>if (offset < 0 || offset == 0 && !leanTowardsLargerOffsets)<NEW_LINE>return 0;<NEW_LINE><MASK><NEW_LINE>if (offset > text.length()) {<NEW_LINE>offset = text.length();<NEW_LINE>leanTowardsLargerOffsets = true;<NEW_LINE>}<NEW_LINE>int logicalColumn = LogicalPositionCache.calcColumn(text, 0, 0, offset, getTabSize());<NEW_LINE>int maxColumn = 0;<NEW_LINE>for (LineLayout.VisualFragment fragment : getFoldRegionLayout(region).getFragmentsInVisualOrder(0)) {<NEW_LINE>int startLC = fragment.getStartLogicalColumn();<NEW_LINE>int endLC = fragment.getEndLogicalColumn();<NEW_LINE>if (logicalColumn > startLC && logicalColumn < endLC || logicalColumn == startLC && leanTowardsLargerOffsets || logicalColumn == endLC && !leanTowardsLargerOffsets) {<NEW_LINE>return fragment.logicalToVisualColumn(logicalColumn);<NEW_LINE>}<NEW_LINE>maxColumn = fragment.getEndVisualColumn();<NEW_LINE>}<NEW_LINE>return maxColumn;<NEW_LINE>}
String text = region.getPlaceholderText();
610,792
final TransactGetItemsResult executeTransactGetItems(TransactGetItemsRequest transactGetItemsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(transactGetItemsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TransactGetItemsRequest> request = null;<NEW_LINE>Response<TransactGetItemsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TransactGetItemsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(transactGetItemsRequest));<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, "DynamoDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TransactGetItems");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI cachedEndpoint = null;<NEW_LINE>if (endpointDiscoveryEnabled) {<NEW_LINE>cachedEndpoint = cache.get(awsCredentialsProvider.getCredentials().getAWSAccessKeyId(), false, endpoint);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TransactGetItemsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext, cachedEndpoint, null);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new TransactGetItemsResultJsonUnmarshaller());
647,467
public void requestTeleport(double d0, double d1, double d2, float f, float f1, Set<PlayerPositionLookS2CPacket.Flag> set, boolean flag) {<NEW_LINE>// CraftBukkit - Return event status<NEW_LINE>Player player = this.getPlayer();<NEW_LINE>Location from = player.getLocation();<NEW_LINE>double x = d0;<NEW_LINE>double y = d1;<NEW_LINE>double z = d2;<NEW_LINE>float yaw = f;<NEW_LINE>float pitch = f1;<NEW_LINE>Location to = new Location(this.getPlayer().getWorld(), x, y, z, yaw, pitch);<NEW_LINE>// SPIGOT-5171: Triggered on join<NEW_LINE>if (from.equals(to)) {<NEW_LINE>this.internalTeleport(d0, d1, d2, f, f1, set, flag);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), PlayerTeleportEvent.TeleportCause.UNKNOWN);<NEW_LINE>Bukkit.getPluginManager().callEvent(event);<NEW_LINE>if (event.isCancelled() || !to.equals(event.getTo())) {<NEW_LINE>// Can't relative teleport<NEW_LINE>set.clear();<NEW_LINE>to = event.isCancelled() ? event.getFrom() : event.getTo();<NEW_LINE>d0 = to.getX();<NEW_LINE>d1 = to.getY();<NEW_LINE>d2 = to.getZ();<NEW_LINE>f = to.getYaw();<NEW_LINE>f1 = to.getPitch();<NEW_LINE>}<NEW_LINE>this.internalTeleport(d0, d1, d2, <MASK><NEW_LINE>return;<NEW_LINE>}
f, f1, set, flag);
1,148,490
public static void populateCopyObjectHeaders(CopyObjectRequest copyObjectRequest, Map<String, String> headers) {<NEW_LINE>String copySourceHeader = "/" + copyObjectRequest.getSourceBucketName() + "/" + HttpUtil.urlEncode(copyObjectRequest.getSourceKey(), OSSConstants.DEFAULT_CHARSET_NAME);<NEW_LINE>headers.put(OSSHeaders.COPY_OBJECT_SOURCE, copySourceHeader);<NEW_LINE>addDateHeader(headers, OSSHeaders.<MASK><NEW_LINE>addDateHeader(headers, OSSHeaders.COPY_OBJECT_SOURCE_IF_UNMODIFIED_SINCE, copyObjectRequest.getUnmodifiedSinceConstraint());<NEW_LINE>addStringListHeader(headers, OSSHeaders.COPY_OBJECT_SOURCE_IF_MATCH, copyObjectRequest.getMatchingETagConstraints());<NEW_LINE>addStringListHeader(headers, OSSHeaders.COPY_OBJECT_SOURCE_IF_NONE_MATCH, copyObjectRequest.getNonmatchingEtagConstraints());<NEW_LINE>addHeader(headers, OSSHeaders.OSS_SERVER_SIDE_ENCRYPTION, copyObjectRequest.getServerSideEncryption());<NEW_LINE>ObjectMetadata newObjectMetadata = copyObjectRequest.getNewObjectMetadata();<NEW_LINE>if (newObjectMetadata != null) {<NEW_LINE>headers.put(OSSHeaders.COPY_OBJECT_METADATA_DIRECTIVE, MetadataDirective.REPLACE.toString());<NEW_LINE>populateRequestMetadata(headers, newObjectMetadata);<NEW_LINE>}<NEW_LINE>// The header of Content-Length should not be specified on copying an object.<NEW_LINE>removeHeader(headers, HttpHeaders.CONTENT_LENGTH);<NEW_LINE>}
COPY_OBJECT_SOURCE_IF_MODIFIED_SINCE, copyObjectRequest.getModifiedSinceConstraint());
1,451,136
public static BarPlot of(int[] data, double[] breaks, boolean prob, Color color) {<NEW_LINE><MASK><NEW_LINE>if (k <= 1) {<NEW_LINE>throw new IllegalArgumentException("Invalid number of bins: " + k);<NEW_LINE>}<NEW_LINE>double[][] hist = smile.math.Histogram.of(data, breaks);<NEW_LINE>double[][] freq = new double[k][2];<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>freq[i][0] = (hist[0][i] + hist[1][i]) / 2.0;<NEW_LINE>freq[i][1] = hist[2][i];<NEW_LINE>}<NEW_LINE>if (prob) {<NEW_LINE>double n = data.length;<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>freq[i][1] /= n;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new BarPlot(new Bar(freq, width(freq), color));<NEW_LINE>}
int k = breaks.length - 1;
487,588
public static void main(String... args) {<NEW_LINE>OrderDTO orderDTO = new OrderDTO();<NEW_LINE>orderDTO.setStreet("1234 Pike Street");<NEW_LINE>orderDTO.setCity("Seattle");<NEW_LINE>// Option 1<NEW_LINE>ModelMapper modelMapper = new ModelMapper();<NEW_LINE>PropertyMap<OrderDTO, Order> orderMap = new PropertyMap<OrderDTO, Order>() {<NEW_LINE><NEW_LINE>protected void configure() {<NEW_LINE>map().getAddress().setStreet(source.getStreet());<NEW_LINE>map().address.setCity(source.city);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>modelMapper.addMappings(orderMap);<NEW_LINE>Order order = modelMapper.<MASK><NEW_LINE>assertEquals(order.getAddress().getStreet(), orderDTO.getStreet());<NEW_LINE>assertEquals(order.getAddress().getCity(), orderDTO.getCity());<NEW_LINE>// Option 2<NEW_LINE>modelMapper.getConfiguration().setMatchingStrategy(MatchingStrategies.LOOSE);<NEW_LINE>order = modelMapper.map(orderDTO, Order.class);<NEW_LINE>assertEquals(order.getAddress().getStreet(), orderDTO.getStreet());<NEW_LINE>assertEquals(order.getAddress().getCity(), orderDTO.getCity());<NEW_LINE>}
map(orderDTO, Order.class);
1,540,673
private void onSearchResponse(SearchResponse sr) {<NEW_LINE>try {<NEW_LINE>if (sr.getHits().getTotalHits().value > StoredFeatureSet.MAX_FEATURES) {<NEW_LINE>throw new IllegalArgumentException("The feature query [" + featureNamesQuery + "] returns too many features");<NEW_LINE>}<NEW_LINE>if (sr.getHits().getTotalHits().value == 0) {<NEW_LINE>throw new IllegalArgumentException("The feature query [" + featureNamesQuery + "] returned no features");<NEW_LINE>}<NEW_LINE>final List<StoredFeature> features = new ArrayList<>(sr.getHits().getHits().length);<NEW_LINE>for (SearchHit hit : sr.getHits().getHits()) {<NEW_LINE>features.add(IndexFeatureStore.parse(StoredFeature.class, StoredFeature.TYPE<MASK><NEW_LINE>}<NEW_LINE>featuresRef.set(features);<NEW_LINE>} catch (Exception e) {<NEW_LINE>searchException.set(e);<NEW_LINE>} finally {<NEW_LINE>maybeFinish();<NEW_LINE>}<NEW_LINE>}
, hit.getSourceRef()));
965,704
public ListDashboardVersionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListDashboardVersionsResult listDashboardVersionsResult = new ListDashboardVersionsResult();<NEW_LINE>listDashboardVersionsResult.setStatus(context.getHttpResponse().getStatusCode());<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 listDashboardVersionsResult;<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("DashboardVersionSummaryList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listDashboardVersionsResult.setDashboardVersionSummaryList(new ListUnmarshaller<DashboardVersionSummary>(DashboardVersionSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listDashboardVersionsResult.setNextToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("RequestId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listDashboardVersionsResult.setRequestId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listDashboardVersionsResult;<NEW_LINE>}
class).unmarshall(context));
367,354
public List<MediaFileEntry> toMediaFileEntryList(List<MediaFile> files, String username, boolean calculateStarred, boolean calculateFolderAccess, Function<MediaFile, String> streamUrlGenerator, Function<MediaFile, String> remoteStreamUrlGenerator, Function<MediaFile, String> remoteCoverArtUrlGenerator) {<NEW_LINE>Locale locale = Optional.ofNullable(username).map(localeResolver::resolveLocale).orElse(null);<NEW_LINE>List<MediaFileEntry> entries = new ArrayList<>(files.size());<NEW_LINE>for (MediaFile file : files) {<NEW_LINE>String streamUrl = Optional.ofNullable(streamUrlGenerator).map(g -> g.apply(<MASK><NEW_LINE>String remoteStreamUrl = Optional.ofNullable(remoteStreamUrlGenerator).map(g -> g.apply(file)).orElse(null);<NEW_LINE>String remoteCoverArtUrl = Optional.ofNullable(remoteCoverArtUrlGenerator).map(g -> g.apply(file)).orElse(null);<NEW_LINE>boolean starred = calculateStarred && username != null && getMediaFileStarredDate(file.getId(), username) != null;<NEW_LINE>boolean folderAccess = !calculateFolderAccess || username == null || securityService.isFolderAccessAllowed(file, username);<NEW_LINE>entries.add(MediaFileEntry.fromMediaFile(file, locale, starred, folderAccess, streamUrl, remoteStreamUrl, remoteCoverArtUrl));<NEW_LINE>}<NEW_LINE>return entries;<NEW_LINE>}
file)).orElse(null);
713,500
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {<NEW_LINE>final AbstractDataProvider.Data item = mProvider.getItem(position);<NEW_LINE>// set listeners<NEW_LINE>// (if the item is *pinned*, click event comes to the mContainer)<NEW_LINE>holder.mContainer.setOnClickListener(mSwipeableViewContainerOnClickListener);<NEW_LINE>holder.mButton.setOnClickListener(mUnderSwipeableViewButtonOnClickListener);<NEW_LINE>// set text<NEW_LINE>holder.mTextView.<MASK><NEW_LINE>// set background resource (target view ID: container)<NEW_LINE>final SwipeableItemState swipeState = holder.getSwipeState();<NEW_LINE>if (swipeState.isUpdated()) {<NEW_LINE>int bgResId;<NEW_LINE>if (swipeState.isActive()) {<NEW_LINE>bgResId = R.drawable.bg_item_swiping_active_state;<NEW_LINE>} else if (swipeState.isSwiping()) {<NEW_LINE>bgResId = R.drawable.bg_item_swiping_state;<NEW_LINE>} else {<NEW_LINE>bgResId = R.drawable.bg_item_normal_state;<NEW_LINE>}<NEW_LINE>holder.mContainer.setBackgroundResource(bgResId);<NEW_LINE>}<NEW_LINE>// set swiping properties<NEW_LINE>holder.setMaxLeftSwipeAmount(-0.5f);<NEW_LINE>holder.setMaxRightSwipeAmount(0);<NEW_LINE>holder.setSwipeItemHorizontalSlideAmount(item.isPinned() ? -0.5f : 0);<NEW_LINE>// Or, it can be specified in pixels instead of proportional value.<NEW_LINE>// float density = holder.itemView.getResources().getDisplayMetrics().density;<NEW_LINE>// float pinnedDistance = (density * 100); // 100 dp<NEW_LINE>// holder.setProportionalSwipeAmountModeEnabled(false);<NEW_LINE>// holder.setMaxLeftSwipeAmount(-pinnedDistance);<NEW_LINE>// holder.setMaxRightSwipeAmount(0);<NEW_LINE>// holder.setSwipeItemHorizontalSlideAmount(item.isPinned() ? -pinnedDistance: 0);<NEW_LINE>}
setText(item.getText());
944,315
public void initialize() {<NEW_LINE>addTitledGroupBg(root, gridRow, 2, Res.get("dao.factsAndFigures.transactions.genesis"));<NEW_LINE>String genTxHeight = String.valueOf(daoFacade.getGenesisBlockHeight());<NEW_LINE>String genesisTxId = daoFacade.getGenesisTxId();<NEW_LINE>String url = preferences.getBsqBlockChainExplorer().txUrl + genesisTxId;<NEW_LINE>GridPane.setColumnSpan(addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.factsAndFigures.transactions.genesisBlockHeight"), genTxHeight, Layout.FIRST_ROW_DISTANCE).third, 2);<NEW_LINE>// TODO use addTopLabelTxIdTextField<NEW_LINE>Tuple3<Label, HyperlinkWithIcon, VBox> tuple = addTopLabelHyperlinkWithIcon(root, ++gridRow, Res.get("dao.factsAndFigures.transactions.genesisTxId"), genesisTxId, url, 0);<NEW_LINE>HyperlinkWithIcon hyperlinkWithIcon = tuple.second;<NEW_LINE>hyperlinkWithIcon.setTooltip(new Tooltip(Res.<MASK><NEW_LINE>GridPane.setColumnSpan(tuple.third, 2);<NEW_LINE>int startRow = ++gridRow;<NEW_LINE>TitledGroupBg titledGroupBg = addTitledGroupBg(root, gridRow, 3, Res.get("dao.factsAndFigures.transactions.txDetails"), Layout.GROUP_DISTANCE);<NEW_LINE>titledGroupBg.getStyleClass().add("last");<NEW_LINE>allTxTextField = addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.factsAndFigures.transactions.allTx"), genTxHeight, Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;<NEW_LINE>utxoTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.factsAndFigures.transactions.utxo")).second;<NEW_LINE>compensationIssuanceTxTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.factsAndFigures.transactions.compensationIssuanceTx")).second;<NEW_LINE>reimbursementIssuanceTxTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.factsAndFigures.transactions.reimbursementIssuanceTx")).second;<NEW_LINE>int columnIndex = 1;<NEW_LINE>gridRow = startRow;<NEW_LINE>titledGroupBg = addTitledGroupBg(root, startRow, columnIndex, 3, "", Layout.GROUP_DISTANCE);<NEW_LINE>titledGroupBg.getStyleClass().add("last");<NEW_LINE>burntFeeTxsTextField = addTopLabelReadOnlyTextField(root, gridRow, columnIndex, Res.get("dao.factsAndFigures.transactions.burntTx"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;<NEW_LINE>invalidTxsTextField = addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.factsAndFigures.transactions.invalidTx")).second;<NEW_LINE>irregularTxsTextField = addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.factsAndFigures.transactions.irregularTx")).second;<NEW_LINE>gridRow++;<NEW_LINE>}
get("tooltip.openBlockchainForTx", genesisTxId)));
432,187
// This is called when connecting to a Chromecast from this activity. It will tell BaseActivity<NEW_LINE>// to launch the video that was playing on the Chromecast.<NEW_LINE>@Override<NEW_LINE>protected void returnToMainAndResume() {<NEW_LINE>Bundle bundle = new Bundle();<NEW_LINE>bundle.putSerializable(YOUTUBE_VIDEO, fragmentListener.getYouTubeVideo());<NEW_LINE>bundle.putInt(YOUTUBE_VIDEO_POSITION, fragmentListener.getCurrentVideoPosition());<NEW_LINE>if (getIntent() != null && getIntent().getAction() != null && getIntent().getAction().equals(Intent.ACTION_VIEW)) {<NEW_LINE>Intent intent = new Intent(YouTubePlayerActivity.this, MainActivity.class);<NEW_LINE>intent.putExtras(bundle);<NEW_LINE>intent.setData(Uri.parse(fragmentListener.getYouTubeVideo().getVideoUrl()));<NEW_LINE>intent.setAction(Intent.ACTION_VIEW);<NEW_LINE>intent.setFlags(<MASK><NEW_LINE>startActivity(intent);<NEW_LINE>finish();<NEW_LINE>} else {<NEW_LINE>Intent intent = new Intent();<NEW_LINE>intent.putExtras(bundle);<NEW_LINE>setResult(RESULT_OK, intent);<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>}
Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME);
536,209
public void testCreateConsumerWithMsgSelectorWithDD(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>boolean testFailed = false;<NEW_LINE>JMSContext jmsContext = jmsQCFBindings.createContext();<NEW_LINE>emptyQueue(jmsQCFBindings, jmsQueue);<NEW_LINE>JMSProducer jmsProducer = jmsContext.createProducer();<NEW_LINE>JMSConsumer jmsConsumer = <MASK><NEW_LINE>TextMessage message = jmsContext.createTextMessage("testCreateConsumerWithMsgSelector_B_SecOff");<NEW_LINE>message.setStringProperty("Team", "SIB");<NEW_LINE>jmsProducer.setDeliveryDelay(1000).send(jmsQueue, message);<NEW_LINE>TextMessage recMsg = (TextMessage) jmsConsumer.receive(30000);<NEW_LINE>recMsg.getText();<NEW_LINE>recMsg.getStringProperty("Team");<NEW_LINE>if (((recMsg == null) || (recMsg.getText() == null) || !recMsg.getText().equals("testCreateConsumerWithMsgSelector_B_SecOff")) || ((recMsg.getStringProperty("Team") == null) || !recMsg.getStringProperty("Team").equals("SIB"))) {<NEW_LINE>testFailed = true;<NEW_LINE>}<NEW_LINE>jmsConsumer.close();<NEW_LINE>jmsContext.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testCreateConsumerWithMsgSelectorWithDD failed");<NEW_LINE>}<NEW_LINE>}
jmsContext.createConsumer(jmsQueue, "Team = 'SIB'");
959,416
private void addFieldChildren(QueryProfilesConfig.Queryprofile.Builder qpB, QueryProfile profile, String namePrefix) {<NEW_LINE>List<Map.Entry<String, Object>> content = new ArrayList<>(profile.declaredContent().entrySet());<NEW_LINE>Collections.sort(content, new MapEntryKeyComparator());<NEW_LINE>if (profile.getValue() != null) {<NEW_LINE>// Add "prefix with dot removed"=value:<NEW_LINE>QueryProfilesConfig.Queryprofile.Property.Builder propB = new QueryProfilesConfig.Queryprofile.Property.Builder();<NEW_LINE>String fullName = namePrefix.substring(0, namePrefix.length() - 1);<NEW_LINE>Object value = profile.getValue();<NEW_LINE>if (value instanceof SubstituteString)<NEW_LINE>// Send only types understood by configBuilder downwards<NEW_LINE>value = value.toString();<NEW_LINE>propB.name(fullName);<NEW_LINE>if (value != null)<NEW_LINE>propB.<MASK><NEW_LINE>qpB.property(propB);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Object> field : content) {<NEW_LINE>addField(qpB, profile, field, namePrefix);<NEW_LINE>}<NEW_LINE>}
value(value.toString());
930,541
private void performAdditionToUserHistoryDictionary(final SettingsValues settingsValues, final String suggestion, @Nonnull final NgramContext ngramContext) {<NEW_LINE>// If correction is not enabled, we don't add words to the user history dictionary.<NEW_LINE>// That's to avoid unintended additions in some sensitive fields, or fields that<NEW_LINE>// expect to receive non-words.<NEW_LINE>if (!settingsValues.mAutoCorrectionEnabledPerUserSettings || settingsValues.mIncognitoModeEnabled)<NEW_LINE>return;<NEW_LINE>if (mConnection.hasSlowInputConnection()) {<NEW_LINE>// Since we don't unlearn when the user backspaces on a slow InputConnection,<NEW_LINE>// turn off learning to guard against adding typos that the user later deletes.<NEW_LINE>Log.w(TAG, "Skipping learning due to slow InputConnection.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (TextUtils.isEmpty(suggestion))<NEW_LINE>return;<NEW_LINE>final boolean wasAutoCapitalized = mWordComposer.wasAutoCapitalized(<MASK><NEW_LINE>final int timeStampInSeconds = (int) TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis());<NEW_LINE>mDictionaryFacilitator.addToUserHistory(suggestion, wasAutoCapitalized, ngramContext, timeStampInSeconds, settingsValues.mBlockPotentiallyOffensive);<NEW_LINE>}
) && !mWordComposer.isMostlyCaps();
1,558,294
protected FetchedValue unboxPossibleDataFetcherResult(ExecutionContext executionContext, ExecutionStrategyParameters parameters, Object result) {<NEW_LINE>if (result instanceof DataFetcherResult) {<NEW_LINE>// noinspection unchecked<NEW_LINE>DataFetcherResult<?> dataFetcherResult = (DataFetcherResult) result;<NEW_LINE>dataFetcherResult.getErrors().forEach(executionContext::addError);<NEW_LINE><MASK><NEW_LINE>if (localContext == null) {<NEW_LINE>// if the field returns nothing then they get the context of their parent field<NEW_LINE>localContext = parameters.getLocalContext();<NEW_LINE>}<NEW_LINE>return FetchedValue.newFetchedValue().fetchedValue(executionContext.getValueUnboxer().unbox(dataFetcherResult.getData())).rawFetchedValue(dataFetcherResult.getData()).errors(dataFetcherResult.getErrors()).localContext(localContext).build();<NEW_LINE>} else {<NEW_LINE>return FetchedValue.newFetchedValue().fetchedValue(executionContext.getValueUnboxer().unbox(result)).rawFetchedValue(result).localContext(parameters.getLocalContext()).build();<NEW_LINE>}<NEW_LINE>}
Object localContext = dataFetcherResult.getLocalContext();
614,818
public void onChatMessage(ChatMessage chatMessage) {<NEW_LINE>// Start sending old messages right after the welcome message, as that is most reliable source<NEW_LINE>// of information that chat history was reset<NEW_LINE>ChatMessageType chatMessageType = chatMessage.getType();<NEW_LINE>if (chatMessageType == ChatMessageType.WELCOME && StringUtils.startsWithIgnoreCase(chatMessage.getMessage(), WELCOME_MESSAGE)) {<NEW_LINE>if (!config.retainChatHistory()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (MessageNode queuedMessage : messageQueue) {<NEW_LINE>final MessageNode node = client.addChatMessage(queuedMessage.getType(), queuedMessage.getName(), queuedMessage.getValue(), queuedMessage.getSender(), false);<NEW_LINE>node.<MASK><NEW_LINE>node.setTimestamp(queuedMessage.getTimestamp());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(chatMessageType) {<NEW_LINE>case PRIVATECHATOUT:<NEW_LINE>case PRIVATECHAT:<NEW_LINE>case MODPRIVATECHAT:<NEW_LINE>final String name = Text.removeTags(chatMessage.getName());<NEW_LINE>// Remove to ensure uniqueness & its place in history<NEW_LINE>if (!friends.remove(name)) {<NEW_LINE>// If the friend didn't previously exist ensure deque capacity doesn't increase by adding them<NEW_LINE>if (friends.size() >= FRIENDS_MAX_SIZE) {<NEW_LINE>friends.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>friends.add(name);<NEW_LINE>// intentional fall-through<NEW_LINE>case PUBLICCHAT:<NEW_LINE>case MODCHAT:<NEW_LINE>case FRIENDSCHAT:<NEW_LINE>case CLAN_GUEST_CHAT:<NEW_LINE>case CLAN_GUEST_MESSAGE:<NEW_LINE>case CLAN_CHAT:<NEW_LINE>case CLAN_MESSAGE:<NEW_LINE>case CLAN_GIM_CHAT:<NEW_LINE>case CLAN_GIM_MESSAGE:<NEW_LINE>case CONSOLE:<NEW_LINE>messageQueue.offer(chatMessage.getMessageNode());<NEW_LINE>}<NEW_LINE>}
setRuneLiteFormatMessage(queuedMessage.getRuneLiteFormatMessage());
234,442
public String importPermissions(PermissionAssistant permissionAssistant) {<NEW_LINE>try {<NEW_LINE>ResourceBundle bundle = I18n.getBundle(new Locale(permissionAssistant.getLanguage()));<NEW_LINE>MetaFile metaFile = permissionAssistant.getMetaFile();<NEW_LINE>File csvFile = MetaFiles.getPath(metaFile).toFile();<NEW_LINE>try (CSVReader csvReader = new CSVReader(new InputStreamReader(new FileInputStream(csvFile), StandardCharsets.UTF_8), ';')) {<NEW_LINE>String[] groupRow = csvReader.readNext();<NEW_LINE>if (groupRow == null || groupRow.length < 11) {<NEW_LINE>errorLog = I18n.get(IMessage.BAD_FILE);<NEW_LINE>}<NEW_LINE>String[] headerRow = csvReader.readNext();<NEW_LINE>if (headerRow == null) {<NEW_LINE>errorLog = I18n.get(IMessage.NO_HEADER);<NEW_LINE>}<NEW_LINE>if (!checkHeaderRow(Arrays.asList(headerRow), bundle)) {<NEW_LINE>errorLog = I18n.get(IMessage.BAD_HEADER) + " " + Arrays.asList(headerRow);<NEW_LINE>}<NEW_LINE>if (!errorLog.equals("")) {<NEW_LINE>return errorLog;<NEW_LINE>}<NEW_LINE>if (permissionAssistant.getTypeSelect() == PermissionAssistantRepository.TYPE_GROUPS) {<NEW_LINE>Map<String, Group> groupMap = checkBadGroups(groupRow);<NEW_LINE>processGroupCSV(csvReader, groupRow, groupMap, permissionAssistant.getMetaField(), permissionAssistant.getFieldPermission());<NEW_LINE>saveGroups(groupMap);<NEW_LINE>} else if (permissionAssistant.getTypeSelect() == PermissionAssistantRepository.TYPE_ROLES) {<NEW_LINE>Map<String, Role> roleMap = checkBadRoles(groupRow);<NEW_LINE>processRoleCSV(csvReader, groupRow, roleMap, permissionAssistant.getMetaField(), permissionAssistant.getFieldPermission());<NEW_LINE>saveRoles(roleMap);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(e.getLocalizedMessage());<NEW_LINE>TraceBackService.trace(e);<NEW_LINE>errorLog += "\n" + String.format(I18n.get(IMessage.ERR_IMPORT_WITH_MSG<MASK><NEW_LINE>}<NEW_LINE>return errorLog;<NEW_LINE>}
), e.getMessage());
1,377,472
private void handleRegisterRequest(REQID rid, SocketChannel channel, Metrics.MetricPublisherRegisterRequest request) {<NEW_LINE>Metrics.MetricPublisher publisher = request.getPublisher();<NEW_LINE>LOG.log(Level.SEVERE, "Got a new register publisher from hostname: {0}," + " component_name: {1}, port: {2}, instance_id: {3}, instance_index: {4} from {5}", new Object[] { publisher.getHostname(), publisher.getComponentName(), publisher.getPort(), publisher.getInstanceId(), publisher.getInstanceIndex(), channel.socket().getRemoteSocketAddress() });<NEW_LINE>// Check whether publisher has already been registered<NEW_LINE>Common.StatusCode responseStatusCode = Common.StatusCode.NOTOK;<NEW_LINE>if (publisherMap.containsKey(channel.socket().getRemoteSocketAddress())) {<NEW_LINE>LOG.log(Level.SEVERE, "Metrics publisher already exists for hostname: {0}," + " component_name: {1}, port: {2}, instance_id: {3}, instance_index: {4}", new Object[] { publisher.getHostname(), publisher.getComponentName(), publisher.getPort(), publisher.getInstanceId()<MASK><NEW_LINE>} else {<NEW_LINE>publisherMap.put(channel.socket().getRemoteSocketAddress(), publisher);<NEW_LINE>// Add it to the map<NEW_LINE>responseStatusCode = Common.StatusCode.OK;<NEW_LINE>}<NEW_LINE>Common.Status responseStatus = Common.Status.newBuilder().setStatus(responseStatusCode).build();<NEW_LINE>Metrics.MetricPublisherRegisterResponse response = Metrics.MetricPublisherRegisterResponse.newBuilder().setStatus(responseStatus).build();<NEW_LINE>// Send the response<NEW_LINE>sendResponse(rid, channel, response);<NEW_LINE>// Update the Metrics<NEW_LINE>serverMetricsCounters.scope(SERVER_NEW_REGISTER).incr();<NEW_LINE>}
, publisher.getInstanceIndex() });
724,041
public static ListMetricsResponse unmarshall(ListMetricsResponse listMetricsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listMetricsResponse.setRequestId(_ctx.stringValue("ListMetricsResponse.RequestId"));<NEW_LINE>listMetricsResponse.setMessage<MASK><NEW_LINE>listMetricsResponse.setCode(_ctx.stringValue("ListMetricsResponse.Code"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotalPage(_ctx.integerValue("ListMetricsResponse.Data.TotalPage"));<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListMetricsResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListMetricsResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListMetricsResponse.Data.TotalCount"));<NEW_LINE>List<RecordsItem> records = new ArrayList<RecordsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListMetricsResponse.Data.Records.Length"); i++) {<NEW_LINE>RecordsItem recordsItem = new RecordsItem();<NEW_LINE>recordsItem.setTagMetric(_ctx.stringValue("ListMetricsResponse.Data.Records[" + i + "].TagMetric"));<NEW_LINE>recordsItem.setTagCode(_ctx.stringValue("ListMetricsResponse.Data.Records[" + i + "].TagCode"));<NEW_LINE>recordsItem.setTagValue(_ctx.stringValue("ListMetricsResponse.Data.Records[" + i + "].TagValue"));<NEW_LINE>recordsItem.setDateTime(_ctx.stringValue("ListMetricsResponse.Data.Records[" + i + "].DateTime"));<NEW_LINE>records.add(recordsItem);<NEW_LINE>}<NEW_LINE>data.setRecords(records);<NEW_LINE>listMetricsResponse.setData(data);<NEW_LINE>return listMetricsResponse;<NEW_LINE>}
(_ctx.stringValue("ListMetricsResponse.Message"));