idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,430,121
private static boolean waitForStreams(FileObject fo, int timeInMs, Set<?> streams) {<NEW_LINE>synchronized (StreamPool.class) {<NEW_LINE>if (isStreamOpen(streams)) {<NEW_LINE>long till = System.currentTimeMillis() + timeInMs;<NEW_LINE>boolean interrupted = false;<NEW_LINE>for (; ; ) {<NEW_LINE>long wait = till - System.currentTimeMillis();<NEW_LINE>if (wait <= 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>StreamPool.class.wait(wait);<NEW_LINE>break;<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>interrupted = true;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (interrupted) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>if (isStreamOpen(streams)) {<NEW_LINE>LOG.log(Level.FINE, "Open streams {0} for {1}", new Object<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}
[] { streams, fo });
80,262
private void onRenderTickStart() {<NEW_LINE>if (ShaderReflection.shaders_beginRender == null)<NEW_LINE>return;<NEW_LINE>if (ShaderReflection.config_isShaders == null)<NEW_LINE>return;<NEW_LINE>try {<NEW_LINE>// check if video is being rendered<NEW_LINE>if (((EntityRendererHandler.IEntityRenderer) mc.gameRenderer).replayModRender_getHandler() == null)<NEW_LINE>return;<NEW_LINE>// check if Shaders are enabled<NEW_LINE>if (!(boolean) (ShaderReflection.config_isShaders.invoke(null)))<NEW_LINE>return;<NEW_LINE>// #if MC>=11400<NEW_LINE>ShaderReflection.shaders_beginRender.// #if MC>=11400<NEW_LINE>invoke(// #if MC>=11400<NEW_LINE>null, // #if MC>=11400<NEW_LINE>mc, // #endif<NEW_LINE>mc.gameRenderer.getCamera(), <MASK><NEW_LINE>} catch (IllegalAccessException | InvocationTargetException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
mc.getTickDelta(), 0);
1,630,281
public com.amazonaws.services.directory.model.ShareLimitExceededException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.directory.model.ShareLimitExceededException shareLimitExceededException = new com.amazonaws.services.directory.model.ShareLimitExceededException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("RequestId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>shareLimitExceededException.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 shareLimitExceededException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,457,321
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Application application = emc.<MASK><NEW_LINE>if (null == application) {<NEW_LINE>throw new ExceptionApplicationNotExist(id);<NEW_LINE>}<NEW_LINE>if (!effectivePerson.isSecurityManager() && !business.editable(effectivePerson, application)) {<NEW_LINE>throw new ExceptionInsufficientPermission(effectivePerson.getDistinguishedName());<NEW_LINE>}<NEW_LINE>emc.beginTransaction(Application.class);<NEW_LINE>Wi.copier.copy(wi, application);<NEW_LINE>application.setLastUpdatePerson(effectivePerson.getDistinguishedName());<NEW_LINE>application.setLastUpdateTime(new Date());<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(Application.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(application.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>MessageFactory.application_update(application);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
find(id, Application.class);
803,635
public final QualifiedClassNameListContext qualifiedClassNameList() throws RecognitionException {<NEW_LINE>QualifiedClassNameListContext _localctx = new <MASK><NEW_LINE>enterRule(_localctx, 92, RULE_qualifiedClassNameList);<NEW_LINE>try {<NEW_LINE>int _alt;<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(752);<NEW_LINE>annotatedQualifiedClassName();<NEW_LINE>setState(759);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 64, _ctx);<NEW_LINE>while (_alt != 2 && _alt != groovyjarjarantlr4.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {<NEW_LINE>if (_alt == 1) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(753);<NEW_LINE>match(COMMA);<NEW_LINE>setState(754);<NEW_LINE>nls();<NEW_LINE>setState(755);<NEW_LINE>annotatedQualifiedClassName();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(761);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 64, _ctx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
QualifiedClassNameListContext(_ctx, getState());
1,435,670
private boolean checkSubclassImpl(ClassCallExpression classCall1, ClassCallExpression classCall2, boolean correctOrder) {<NEW_LINE>CMP origCMP = myCMP;<NEW_LINE>for (ClassField field : classCall2.getDefinition().getFields()) {<NEW_LINE>if (field.isProperty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Expression impl2 = classCall2.getAbsImplementationHere(field);<NEW_LINE>if (impl2 == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Expression impl1 = classCall1.getAbsImplementationHere(field);<NEW_LINE>Binding binding = classCall1.getThisBinding();<NEW_LINE>if (impl1 == null) {<NEW_LINE>AbsExpression absImpl1 = classCall1.<MASK><NEW_LINE>if (absImpl1 != null) {<NEW_LINE>impl1 = absImpl1.apply(new ReferenceExpression(binding), classCall1.getLevelSubstitution());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (impl1 == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (field == Prelude.ARRAY_ELEMENTS_TYPE && !classCall2.isImplemented(Prelude.ARRAY_LENGTH) && classCall1.isImplemented(Prelude.ARRAY_LENGTH)) {<NEW_LINE>impl2 = impl2.subst(classCall2.getThisBinding(), new NewExpression(null, classCall1));<NEW_LINE>}<NEW_LINE>if (!classCall2.getDefinition().isCovariantField(field)) {<NEW_LINE>myCMP = CMP.EQ;<NEW_LINE>}<NEW_LINE>mySubstitution.put(classCall2.getThisBinding(), binding);<NEW_LINE>boolean ok = compare(correctOrder ? impl1 : impl2, correctOrder ? impl2 : impl1, field.getType(classCall2.getLevels(field.getParentClass())).applyExpression(new ReferenceExpression(binding)), true);<NEW_LINE>mySubstitution.remove(classCall2.getThisBinding());<NEW_LINE>if (!ok) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>myCMP = origCMP;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getDefinition().getImplementation(field);
1,314,537
public boolean transform() throws Throwable {<NEW_LINE>DelegatingProvider provider = new DelegatingProvider();<NEW_LINE>provider.register(new JVMMethodProvider());<NEW_LINE>provider.register(new JVMComparisonProvider());<NEW_LINE>provider.register(new MappedMethodProvider(classes));<NEW_LINE>provider.register(new MappedFieldProvider());<NEW_LINE>AtomicInteger fixed = new AtomicInteger();<NEW_LINE>System.out.println("[Allatori] [LightFlowObfuscationTransformer] Starting");<NEW_LINE>for (ClassNode classNode : classNodes()) for (MethodNode method : classNode.methods) {<NEW_LINE>boolean modified;<NEW_LINE>do {<NEW_LINE>modified = false;<NEW_LINE>for (AbstractInsnNode ain : method.instructions.toArray()) if ((willPush(ain) || ain.getOpcode() == Opcodes.DUP) && ain.getNext() != null && (willPush(ain.getNext()) || ain.getNext().getOpcode() == Opcodes.DUP) && ain.getNext().getNext() != null && ain.getNext().getNext().getOpcode() == Opcodes.POP2) {<NEW_LINE>method.instructions.remove(ain.getNext().getNext());<NEW_LINE>method.instructions.remove(ain.getNext());<NEW_LINE><MASK><NEW_LINE>modified = true;<NEW_LINE>fixed.incrementAndGet();<NEW_LINE>}<NEW_LINE>} while (modified);<NEW_LINE>}<NEW_LINE>System.out.println("[Allatori] [LightFlowObfuscationTransformer] Removed " + fixed + " dead instructions");<NEW_LINE>System.out.println("[Allatori] [LightFlowObfuscationTransformer] Done");<NEW_LINE>return fixed.get() > 0;<NEW_LINE>}
method.instructions.remove(ain);
232,523
public Pair<Boolean, byte[]> execute(byte[] data) {<NEW_LINE>if (data == null)<NEW_LINE>data = EMPTY_BYTE_ARRAY;<NEW_LINE>// fail if input len is not a multiple of PAIR_SIZE<NEW_LINE>if (data.length % PAIR_SIZE > 0)<NEW_LINE>return Pair.of(false, EMPTY_BYTE_ARRAY);<NEW_LINE>PairingCheck check = PairingCheck.create();<NEW_LINE>// iterating over all pairs<NEW_LINE>for (int offset = 0; offset < data.length; offset += PAIR_SIZE) {<NEW_LINE>Pair<BN128G1, BN128G2> pair = decodePair(data, offset);<NEW_LINE>// fail if decoding has failed<NEW_LINE>if (pair == null)<NEW_LINE>return <MASK><NEW_LINE>check.addPair(pair.getLeft(), pair.getRight());<NEW_LINE>}<NEW_LINE>check.run();<NEW_LINE>int result = check.result();<NEW_LINE>return Pair.of(true, DataWord.of(result).getData());<NEW_LINE>}
Pair.of(false, EMPTY_BYTE_ARRAY);
1,795,586
private JComponent createButtonPanel() {<NEW_LINE>JPanel fileChooserPanel = new JPanel(<MASK><NEW_LINE>fileChooserPanel.setBorder(new TitledBorder("Actions"));<NEW_LINE>fileChooser = new JFileChooser();<NEW_LINE>final JButton chooseFileButton = new JButton("Open...");<NEW_LINE>chooseFileButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent arg0) {<NEW_LINE>int returnVal = fileChooser.showOpenDialog(ConstantQAudioPlayer.this);<NEW_LINE>if (returnVal == JFileChooser.APPROVE_OPTION) {<NEW_LINE>File file = fileChooser.getSelectedFile();<NEW_LINE>PlayerState currentState = player.getState();<NEW_LINE>player.load(file);<NEW_LINE>if (currentState == PlayerState.NO_FILE_LOADED || currentState == PlayerState.PLAYING) {<NEW_LINE>player.play();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// canceled<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fileChooserPanel.add(chooseFileButton);<NEW_LINE>stopButton = new JButton("Stop");<NEW_LINE>fileChooserPanel.add(stopButton);<NEW_LINE>stopButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent arg0) {<NEW_LINE>player.stop();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>playButton = new JButton("Play");<NEW_LINE>playButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent arg0) {<NEW_LINE>player.play();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fileChooserPanel.add(playButton);<NEW_LINE>pauzeButton = new JButton("Pauze");<NEW_LINE>pauzeButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent arg0) {<NEW_LINE>player.pauze();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fileChooserPanel.add(pauzeButton);<NEW_LINE>return fileChooserPanel;<NEW_LINE>}
new GridLayout(1, 0));
1,586,243
public Assembler unbox(String desc) {<NEW_LINE>int <MASK><NEW_LINE>switch(typeCode) {<NEW_LINE>case '[':<NEW_LINE>case 'L':<NEW_LINE>mv.visitTypeInsn(CHECKCAST, Type.getType(desc).getInternalName());<NEW_LINE>break;<NEW_LINE>case 'Z':<NEW_LINE>mv.visitTypeInsn(CHECKCAST, BOOLEAN_BOXED_INTERNAL);<NEW_LINE>invokeVirtual(BOOLEAN_BOXED_INTERNAL, BOOLEAN_VALUE, BOOLEAN_VALUE_DESC);<NEW_LINE>break;<NEW_LINE>case 'C':<NEW_LINE>mv.visitTypeInsn(CHECKCAST, CHARACTER_BOXED_INTERNAL);<NEW_LINE>invokeVirtual(CHARACTER_BOXED_INTERNAL, CHAR_VALUE, CHAR_VALUE_DESC);<NEW_LINE>break;<NEW_LINE>case 'B':<NEW_LINE>mv.visitTypeInsn(CHECKCAST, NUMBER_INTERNAL);<NEW_LINE>invokeVirtual(NUMBER_INTERNAL, BYTE_VALUE, BYTE_VALUE_DESC);<NEW_LINE>break;<NEW_LINE>case 'S':<NEW_LINE>mv.visitTypeInsn(CHECKCAST, NUMBER_INTERNAL);<NEW_LINE>invokeVirtual(NUMBER_INTERNAL, SHORT_VALUE, SHORT_VALUE_DESC);<NEW_LINE>break;<NEW_LINE>case 'I':<NEW_LINE>mv.visitTypeInsn(CHECKCAST, NUMBER_INTERNAL);<NEW_LINE>invokeVirtual(NUMBER_INTERNAL, INT_VALUE, INT_VALUE_DESC);<NEW_LINE>break;<NEW_LINE>case 'J':<NEW_LINE>mv.visitTypeInsn(CHECKCAST, NUMBER_INTERNAL);<NEW_LINE>invokeVirtual(NUMBER_INTERNAL, LONG_VALUE, LONG_VALUE_DESC);<NEW_LINE>break;<NEW_LINE>case 'F':<NEW_LINE>mv.visitTypeInsn(CHECKCAST, NUMBER_INTERNAL);<NEW_LINE>invokeVirtual(NUMBER_INTERNAL, FLOAT_VALUE, FLOAT_VALUE_DESC);<NEW_LINE>break;<NEW_LINE>case 'D':<NEW_LINE>mv.visitTypeInsn(CHECKCAST, NUMBER_INTERNAL);<NEW_LINE>invokeVirtual(NUMBER_INTERNAL, DOUBLE_VALUE, DOUBLE_VALUE_DESC);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
typeCode = desc.charAt(0);
594,576
public static CustomerShortNames[] fromCustomers(Customer[] customers) {<NEW_LINE>CustomerShortNames[] feedback = new CustomerShortNames[customers.length];<NEW_LINE>for (int i = 0; i < customers.length; i++) {<NEW_LINE>Customer aCustomer = customers[i];<NEW_LINE>CustomerShortNames newOne = new CustomerShortNames();<NEW_LINE>newOne.setId(aCustomer.getId());<NEW_LINE>newOne.setFirstName(aCustomer.getFirstName());<NEW_LINE>newOne.setLastName(aCustomer.getLastName());<NEW_LINE>newOne.setStreet(aCustomer.getStreet());<NEW_LINE>newOne.setCity(aCustomer.getCity());<NEW_LINE>newOne.<MASK><NEW_LINE>newOne.setState(aCustomer.getState());<NEW_LINE>newOne.setPhoneNumber(aCustomer.getPhoneNumber());<NEW_LINE>newOne.setEmail(aCustomer.getEmail());<NEW_LINE>feedback[i] = newOne;<NEW_LINE>}<NEW_LINE>return feedback;<NEW_LINE>}
setPostalCode(aCustomer.getPostalCode());
1,536,739
public EmbeddedDestinationSettings unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>EmbeddedDestinationSettings embeddedDestinationSettings = new EmbeddedDestinationSettings();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("destination608ChannelNumber", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>embeddedDestinationSettings.setDestination608ChannelNumber(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("destination708ServiceNumber", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>embeddedDestinationSettings.setDestination708ServiceNumber(context.getUnmarshaller(Integer.<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 embeddedDestinationSettings;<NEW_LINE>}
class).unmarshall(context));
1,037,580
public void addObserver(final ServiceObserverPrx observer, Current current) {<NEW_LINE>java.util.List<String> activeServices = new java<MASK><NEW_LINE>//<NEW_LINE>// Null observers and duplicate registrations are ignored<NEW_LINE>//<NEW_LINE>synchronized (this) {<NEW_LINE>if (observer != null && _observers.add(observer)) {<NEW_LINE>if (_traceServiceObserver >= 1) {<NEW_LINE>_logger.trace("IceBox.ServiceObserver", "Added service observer " + _communicator.proxyToString(observer));<NEW_LINE>}<NEW_LINE>for (ServiceInfo info : _services) {<NEW_LINE>if (info.status == StatusStarted) {<NEW_LINE>activeServices.add(info.name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (activeServices.size() > 0) {<NEW_LINE>observer.servicesStartedAsync(activeServices.toArray(new String[0])).exceptionally(ex -> {<NEW_LINE>observerFailed(observer, ex);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
.util.LinkedList<>();
1,136,805
private int localizedWOWBY(TemporalAccessor temporal) {<NEW_LINE>int sow = weekDef<MASK><NEW_LINE>int isoDow = temporal.get(DAY_OF_WEEK);<NEW_LINE>int dow = Jdk8Methods.floorMod(isoDow - sow, 7) + 1;<NEW_LINE>long woy = localizedWeekOfYear(temporal, dow);<NEW_LINE>if (woy == 0) {<NEW_LINE>ChronoLocalDate previous = Chronology.from(temporal).date(temporal).minus(1, ChronoUnit.WEEKS);<NEW_LINE>return (int) localizedWeekOfYear(previous, dow) + 1;<NEW_LINE>} else if (woy >= 53) {<NEW_LINE>int offset = startOfWeekOffset(temporal.get(DAY_OF_YEAR), dow);<NEW_LINE>int year = temporal.get(YEAR);<NEW_LINE>int yearLen = Year.isLeap(year) ? 366 : 365;<NEW_LINE>int weekIndexOfFirstWeekNextYear = computeWeek(offset, yearLen + weekDef.getMinimalDaysInFirstWeek());<NEW_LINE>if (woy >= weekIndexOfFirstWeekNextYear) {<NEW_LINE>return (int) (woy - (weekIndexOfFirstWeekNextYear - 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (int) woy;<NEW_LINE>}
.getFirstDayOfWeek().getValue();
517,848
// sends diagnostic frames to initialize the system<NEW_LINE>public void initSystem() {<NEW_LINE>try {<NEW_LINE>logger.info("Sending frames to (re)initialize subsystems");<NEW_LINE>logger.debug("Sending {} frame to (re)initialize LIGHTING", LIGHTING_DIAGNOSTIC_FRAME);<NEW_LINE>myPlant.sendCommandSync(LIGHTING_DIAGNOSTIC_FRAME);<NEW_LINE>logger.debug("Sending {} frame to (re)initialize AUTOMATIONS", AUTOMATIONS_DIAGNOSTIC_FRAME);<NEW_LINE>myPlant.sendCommandSync(AUTOMATIONS_DIAGNOSTIC_FRAME);<NEW_LINE>logger.debug("Sending {} frame to (re)initialize ALARM", ALARM_DIAGNOSTIC_FRAME);<NEW_LINE>myPlant.sendCommandSync(ALARM_DIAGNOSTIC_FRAME);<NEW_LINE><MASK><NEW_LINE>myPlant.sendCommandSync(POWER_MANAGEMENT_DIAGNOSTIC_FRAME);<NEW_LINE>// *#4*#1*20## Diagnostic Frame Actors<NEW_LINE>logger.debug("Sending Diagnostic Frame Actors to (re)initialize HEATING");<NEW_LINE>myPlant.sendCommandSync("*#4*#1*20##");<NEW_LINE>// *#4*#0## Diagnostic Frame Program Main Unit<NEW_LINE>logger.debug("Sending Diagnostic Frame Main Unit to (re)initialize HEATING");<NEW_LINE>myPlant.sendCommandSync("*#4*#0##");<NEW_LINE>Calendar rightNow = Calendar.getInstance();<NEW_LINE>if (m_heating_zones > 0 && rightNow.get(Calendar.MINUTE) == 59) {<NEW_LINE>logger.debug("Sending Diagnostic Frame Heat Zones 1 .. {} to (re)initialize HEATING", m_heating_zones);<NEW_LINE>for (int i = 1; i <= m_heating_zones; i++) {<NEW_LINE>logger.debug("Sending Diagnostic Frame Heat Zone {} to (re)initialize HEATING", i);<NEW_LINE>// *4#*#xx## Diagnostic Frame Main Unit<NEW_LINE>myPlant.sendCommandSync("*#4*#" + i + "##");<NEW_LINE>// *4#*xx## Diagnostic Frame Thermostat<NEW_LINE>myPlant.sendCommandSync("*#4*" + i + "##");<NEW_LINE>}<NEW_LINE>logger.debug("Sending Diagnostic Frames to (re)initialize HEATING finished");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("initSystem failed : {}", e.getMessage());<NEW_LINE>}<NEW_LINE>}
logger.debug("Sending {} frame to (re)initialize POWER MANAGEMENT", POWER_MANAGEMENT_DIAGNOSTIC_FRAME);
749,321
ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>List<String> applicationIds = emc.ids(Application.class);<NEW_LINE>List<String> processIds = emc.ids(Process.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setProcessList(emc.fetch(this.listOrphanProcess(business, applicationIds), WoProcess.copier));<NEW_LINE>wo.setAgentList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoAgent.copier), WoAgent.copier));<NEW_LINE>wo.setBeginList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoBegin.copier), WoBegin.copier));<NEW_LINE>wo.setCancelList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoCancel.copier), WoCancel.copier));<NEW_LINE>wo.setChoiceList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoChoice.copier), WoChoice.copier));<NEW_LINE>wo.setDelayList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoDelay.copier), WoDelay.copier));<NEW_LINE>wo.setEmbedList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoEmbed.copier), WoEmbed.copier));<NEW_LINE>wo.setEndList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoEnd.copier), WoEnd.copier));<NEW_LINE>wo.setInvokeList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoInvoke.copier), WoInvoke.copier));<NEW_LINE>wo.setManualList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoManual.copier), WoManual.copier));<NEW_LINE>wo.setMergeList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoMerge.copier), WoMerge.copier));<NEW_LINE>wo.setParallelList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoParallel.<MASK><NEW_LINE>wo.setServiceList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoService.copier), WoService.copier));<NEW_LINE>wo.setSplitList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoSplit.copier), WoSplit.copier));<NEW_LINE>wo.setRouteList(emc.fetch(this.listOrphanProcessElement(business, processIds, WoRoute.copier), WoRoute.copier));<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
copier), WoParallel.copier));
834,329
public static void main(String[] args) {<NEW_LINE>final DropShadow ds = new DropShadow();<NEW_LINE>final JPanel canvas = new JPanel() {<NEW_LINE><NEW_LINE>BufferedImage image = null;<NEW_LINE><NEW_LINE>Image shadow = null;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void paintComponent(Graphics g) {<NEW_LINE>Graphics2D g2d = (Graphics2D) g;<NEW_LINE>Color background = Color.WHITE;<NEW_LINE>g.setColor(background);<NEW_LINE>Dimension size = getSize();<NEW_LINE>g.fillRect(0, 0, size.width, size.height);<NEW_LINE>// if (image == null) {<NEW_LINE>GraphicsConfiguration gc = g2d.getDeviceConfiguration();<NEW_LINE>VolatileImage newImage = gc.createCompatibleVolatileImage(size.width, size.height, Transparency.TRANSLUCENT);<NEW_LINE>g2d = (Graphics2D) newImage.getGraphics();<NEW_LINE>// update all pixels to have 0 alpha<NEW_LINE>g2d.setComposite(AlphaComposite.Clear);<NEW_LINE>g2d.fillRect(0, 0, size.width, size.height);<NEW_LINE>// render the clip shape into the image<NEW_LINE>g2d.setComposite(AlphaComposite.Src);<NEW_LINE>g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>g2d.setColor(Color.WHITE);<NEW_LINE>g2d.fillOval(size.width / 4, size.height / 4, size.width / 2, size.height / 2);<NEW_LINE>// Using ScrAtop uses the alpha value as a coverage for each pixel stored in<NEW_LINE>// the destination. For the areas outside the clip shape, the destination alpha will<NEW_LINE>// be zero, so nothing is rendered in those areas.<NEW_LINE>g2d.setComposite(AlphaComposite.SrcAtop);<NEW_LINE>g2d.setPaint(new GradientPaint(0, 0, Color.RED, 0, size.height, Color.YELLOW));<NEW_LINE>g2d.fillRect(0, 0, size.width, size.height);<NEW_LINE>g2d.dispose();<NEW_LINE>BufferedImage bufferedImage = new BufferedImage(size.width, <MASK><NEW_LINE>Graphics graphics = bufferedImage.getGraphics();<NEW_LINE>graphics.drawImage(newImage, 0, 0, null);<NEW_LINE>graphics.dispose();<NEW_LINE>image = bufferedImage;<NEW_LINE>shadow = ds.createDrowShadow(bufferedImage, 5);<NEW_LINE>// }<NEW_LINE>g.drawImage(shadow, 10, 10, null);<NEW_LINE>g.drawImage(image, 0, 0, null);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>canvas.setPreferredSize(new Dimension(600, 600));<NEW_LINE>JFrame frame = new JFrame("Test");<NEW_LINE>Container contentPane = frame.getContentPane();<NEW_LINE>contentPane.setLayout(new BorderLayout());<NEW_LINE>contentPane.add(canvas);<NEW_LINE>canvas.addMouseMotionListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseDragged(MouseEvent e) {<NEW_LINE>// lastPoint.x = e.getX();<NEW_LINE>// lastPoint.y = e.getY();<NEW_LINE>canvas.repaint();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<NEW_LINE>frame.setVisible(true);<NEW_LINE>frame.pack();<NEW_LINE>}
size.height, BufferedImage.TYPE_INT_ARGB);
860,244
public void split() {<NEW_LINE>if (chord.isVip()) {<NEW_LINE>logger.info("VIP split {}, {} origins on {}", chord, origins.size(), side.opposite());<NEW_LINE>}<NEW_LINE>// Detect all partitions of consistent heads in this chord<NEW_LINE>getAllPartitions();<NEW_LINE>logger.debug("allPartitions: {}", allPartitions);<NEW_LINE>if (rootStem != null) {<NEW_LINE>// Detect all sub-stems of the (root) chord stem<NEW_LINE>Map<StemInter, List<Partition>> subStems = getSubStems();<NEW_LINE>if (subStems != null) {<NEW_LINE>StemInter lastSubStem = null;<NEW_LINE>for (Entry<StemInter, List<Partition>> entry : subStems.entrySet()) {<NEW_LINE>lastSubStem = entry.getKey();<NEW_LINE>processStem(<MASK><NEW_LINE>}<NEW_LINE>// Beams attached to last sub-stem?<NEW_LINE>for (Relation rel : sig.getRelations(rootStem, BeamStemRelation.class)) {<NEW_LINE>BeamStemRelation oldRel = (BeamStemRelation) rel;<NEW_LINE>BeamStemRelation newRel = new BeamStemRelation();<NEW_LINE>newRel.setGrade(oldRel.getGrade());<NEW_LINE>newRel.setBeamPortion(oldRel.getBeamPortion());<NEW_LINE>newRel.setExtensionPoint(oldRel.getExtensionPoint());<NEW_LINE>sig.addEdge(sig.getEdgeSource(oldRel), lastSubStem, newRel);<NEW_LINE>sig.removeEdge(oldRel);<NEW_LINE>}<NEW_LINE>rootStem.remove();<NEW_LINE>} else {<NEW_LINE>// Shared mode<NEW_LINE>processStem(rootStem, allPartitions);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// No stem involved, hence dispatch the whole heads<NEW_LINE>// TODO: to be implemented<NEW_LINE>}<NEW_LINE>chord.remove();<NEW_LINE>}
lastSubStem, entry.getValue());
131,602
protected XFormDialog buildDialog(Interface modelItem) {<NEW_LINE>XFormDialogBuilder builder = XFormFactory.createDialogBuilder(messages.get("Dialog.Title"));<NEW_LINE>XForm mainForm = builder.createForm(messages.get("Dialog.Basic.Label"));<NEW_LINE>addWSDLFields(mainForm, modelItem);<NEW_LINE>mainForm.addTextField(OUTPUT, messages.get("Dialog.Basic.Output"), XForm.FieldType.PROJECT_FOLDER);<NEW_LINE>mainForm.addCheckBox(SERVER_SIDE, messages.get("Dialog.Basic.ServerSide"));<NEW_LINE>mainForm.addCheckBox(ALL, messages.get("Dialog.Basic.All"));<NEW_LINE>mainForm.addComboBox(DEPLOY_SCOPE, new String[] { "none", "Application", "Session", "Request" }, messages.get("Axis1XWSDL2JavaAction.Dialog.Basic.AddScope"));<NEW_LINE>mainForm.addComboBox(SKELETON_DEPLOY, new String[] { "none", "true", "false" }, messages.get("Dialog.Basic.DeploySkeleton"));<NEW_LINE>mainForm.addCheckBox(NO_IMPORTS, messages.get("Dialog.Basic.NoImports"));<NEW_LINE>mainForm.addCheckBox(NO_WRAPPED, messages.get("Dialog.Basic.NoWrapped"));<NEW_LINE>mainForm.addCheckBox(TEST_CASE, messages.get("Dialog.Basic.TestCase"));<NEW_LINE>mainForm.addCheckBox(HELPER_GEN<MASK><NEW_LINE>mainForm.addCheckBox(WRAP_ARRAYS, messages.get("Dialog.Basic.WrapArrays"));<NEW_LINE>XForm advForm = builder.createForm(messages.get("Dialog.Advanced.Label"));<NEW_LINE>advForm.addComboBox(TYPE_MAPPING_VERSION, new String[] { "1.2", "1.1" }, messages.get("Dialog.Advanced.TypeMappingVersion"));<NEW_LINE>advForm.addTextField(IMPLCLASS, messages.get("Dialog.Advanced.ImplClass"), XForm.FieldType.JAVA_CLASS);<NEW_LINE>advForm.addTextField(FACTORY, messages.get("Dialog.Advanced.Factory"), XForm.FieldType.JAVA_CLASS);<NEW_LINE>advForm.addTextField(PACKAGE, messages.get("Dialog.Advanced.Package"), XForm.FieldType.JAVA_PACKAGE);<NEW_LINE>advForm.addNameSpaceTable(NAMESPACE_MAPPING, modelItem);<NEW_LINE>advForm.addTextField(USERNAME, messages.get("Dialog.Advanced.Username"), XForm.FieldType.TEXT);<NEW_LINE>advForm.addTextField(PASSWORD, messages.get("Dialog.Advanced.Password"), XForm.FieldType.PASSWORD);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>buildArgsForm(builder, true, "WSDL2Java");<NEW_LINE>return builder.buildDialog(buildDefaultActions(HelpUrls.AXIS1X_HELP_URL, modelItem), messages.get("Dialog.Description"), UISupport.TOOL_ICON);<NEW_LINE>}
, messages.get("Dialog.Basic.HelperGen"));
723,351
public void loadContactImage(CircleImageView imageView, TextView textView, Contact contact) {<NEW_LINE>try {<NEW_LINE>textView.setVisibility(View.VISIBLE);<NEW_LINE>imageView.setVisibility(View.GONE);<NEW_LINE>String contactNumber = "";<NEW_LINE>char firstLetter = 0;<NEW_LINE>contactNumber = contact.getDisplayName().toUpperCase();<NEW_LINE>firstLetter = contact.getDisplayName().toUpperCase().charAt(0);<NEW_LINE>if (firstLetter != '+') {<NEW_LINE>textView.setText(String.valueOf(firstLetter));<NEW_LINE>} else if (contactNumber.length() >= 2) {<NEW_LINE>textView.setText(String.valueOf(contactNumber.charAt(1)));<NEW_LINE>}<NEW_LINE>Character colorKey = AlphaNumberColorUtil.alphabetBackgroundColorMap.containsKey(firstLetter) ? firstLetter : null;<NEW_LINE>GradientDrawable bgShape = <MASK><NEW_LINE>bgShape.setColor(context.getResources().getColor(AlphaNumberColorUtil.alphabetBackgroundColorMap.get(colorKey)));<NEW_LINE>if (contact.isDrawableResources()) {<NEW_LINE>textView.setVisibility(View.GONE);<NEW_LINE>imageView.setVisibility(View.VISIBLE);<NEW_LINE>int drawableResourceId = context.getResources().getIdentifier(contact.getrDrawableName(), "drawable", context.getPackageName());<NEW_LINE>imageView.setImageResource(drawableResourceId);<NEW_LINE>} else if (contact.getImageURL() != null) {<NEW_LINE>loadImage(imageView, textView, contact.getImageURL(), 0);<NEW_LINE>} else {<NEW_LINE>textView.setVisibility(View.VISIBLE);<NEW_LINE>imageView.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}
(GradientDrawable) textView.getBackground();
350,415
private Map<String, String> formatDynamicCodeMessage(Event event, PromoCodeDiscount promoCodeDiscount) {<NEW_LINE>Validate.isTrue(promoCodeDiscount != null && promoCodeDiscount.getDiscountType() != PromoCodeDiscount.DiscountType.NONE);<NEW_LINE>var messageSource = messageSourceManager.getMessageSourceFor(event);<NEW_LINE>Map<String, String> res = new HashMap<>();<NEW_LINE>String code;<NEW_LINE>String amount;<NEW_LINE>switch(promoCodeDiscount.getDiscountType()) {<NEW_LINE>case PERCENTAGE:<NEW_LINE>code = "reservation.dynamic.discount.confirmation.percentage.message";<NEW_LINE>amount = String.valueOf(promoCodeDiscount.getDiscountAmount());<NEW_LINE>break;<NEW_LINE>case FIXED_AMOUNT:<NEW_LINE>amount = event.getCurrency() + " " + MonetaryUtil.formatCents(promoCodeDiscount.getDiscountAmount(), event.getCurrency());<NEW_LINE>code = "reservation.dynamic.discount.confirmation.fix-per-ticket.message";<NEW_LINE>break;<NEW_LINE>case FIXED_AMOUNT_RESERVATION:<NEW_LINE>amount = event.getCurrency() + " " + MonetaryUtil.formatCents(promoCodeDiscount.getDiscountAmount(<MASK><NEW_LINE>code = "reservation.dynamic.discount.confirmation.fix-per-reservation.message";<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unexpected discount code type");<NEW_LINE>}<NEW_LINE>for (ContentLanguage cl : event.getContentLanguages()) {<NEW_LINE>res.put(cl.getLocale().getLanguage(), messageSource.getMessage(code, new Object[] { amount }, cl.getLocale()));<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
), event.getCurrency());
783,646
public static void finalSetup(Context ctx, boolean resetFileTree, boolean emulateFileTree) throws IOException {<NEW_LINE>if (resetFileTree) {<NEW_LINE>Logger.T(TAG, "Removing bundle upgrade");<NEW_LINE>removeBundleUpgrade();<NEW_LINE>copy("apps/rhoconfig.txt");<NEW_LINE>File libDir = new File(getRootPath(), "lib");<NEW_LINE>File testLib = new File(<MASK><NEW_LINE>if (libDir.isDirectory() && testLib.isFile()) {<NEW_LINE>Logger.W(TAG, "Updating from very old rhodes version, clean filesystem.");<NEW_LINE>Utils.deleteChildrenIgnoreFirstLevel(new File(getRootPath(), "apps"), "rhoconfig.txt");<NEW_LINE>Utils.deleteRecursively(libDir);<NEW_LINE>}<NEW_LINE>ApplicationInfo appInfo = ctx.getApplicationInfo();<NEW_LINE>Logger.T(TAG, "Reinitializing root path");<NEW_LINE>initRootPath(appInfo.dataDir, appInfo.sourceDir, sharedPath);<NEW_LINE>}<NEW_LINE>processStatTable(emulateFileTree, resetFileTree && !emulateFileTree);<NEW_LINE>}
libDir.getPath(), "rhoframework.iseq");
1,282,121
// create a new instance atomically, broken out to aid inlining<NEW_LINE>private static HolidayCalendarId create(String name) {<NEW_LINE>// parse names once and build resolver function to aid performance<NEW_LINE>// name BBB+CCC+AAA changed to sorted form of AAA+BBB+CCC<NEW_LINE>// dedicated resolver function created<NEW_LINE>if (name.indexOf('~') >= 0) {<NEW_LINE>List<HolidayCalendarId> ids = SPLITTER_WIGGLE.splitToList(name).stream().map(n -> HolidayCalendarId.of(n)).distinct().sorted(comparing(HolidayCalendarId::getName)).collect(toList());<NEW_LINE>if (ids.contains(HolidayCalendarIds.NO_HOLIDAYS)) {<NEW_LINE>return HolidayCalendarIds.NO_HOLIDAYS;<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>return create(name, ids, normalizedName, HolidayCalendar::linkedWith);<NEW_LINE>} else if (name.indexOf('+') >= 0) {<NEW_LINE>List<HolidayCalendarId> ids = SPLITTER_PLUS.splitToList(name).stream().filter(n -> !n.equals(HolidayCalendarIds.NO_HOLIDAYS.getName())).map(n -> HolidayCalendarId.of(n)).distinct().sorted(comparing(HolidayCalendarId::getName)).collect(toList());<NEW_LINE>String normalizedName = JOINER_PLUS.join(ids);<NEW_LINE>return create(name, ids, normalizedName, HolidayCalendar::combinedWith);<NEW_LINE>} else {<NEW_LINE>return CACHE.computeIfAbsent(name, n -> new HolidayCalendarId(name));<NEW_LINE>}<NEW_LINE>}
normalizedName = JOINER_WIGGLE.join(ids);
900,681
@PutMapping(value = "/cmmn-runtime/case-instances/{caseInstanceId}", produces = "application/json")<NEW_LINE>public CaseInstanceResponse updateCaseInstance(@ApiParam(name = "caseInstanceId") @PathVariable String caseInstanceId, @RequestBody CaseInstanceUpdateRequest updateRequest, HttpServletRequest request, HttpServletResponse response) {<NEW_LINE>CaseInstance caseInstance = getCaseInstanceFromRequest(caseInstanceId);<NEW_LINE>if (StringUtils.isNotEmpty(updateRequest.getAction())) {<NEW_LINE>if (restApiInterceptor != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (RestActionRequest.EVALUATE_CRITERIA.equals(updateRequest.getAction())) {<NEW_LINE>runtimeService.evaluateCriteria(caseInstance.getId());<NEW_LINE>} else {<NEW_LINE>throw new FlowableIllegalArgumentException("Invalid action: '" + updateRequest.getAction() + "'.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// regular update<NEW_LINE>if (restApiInterceptor != null) {<NEW_LINE>restApiInterceptor.updateCaseInstance(caseInstance, updateRequest);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(updateRequest.getName())) {<NEW_LINE>runtimeService.setCaseInstanceName(caseInstanceId, updateRequest.getName());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(updateRequest.getBusinessKey())) {<NEW_LINE>runtimeService.updateBusinessKey(caseInstanceId, updateRequest.getBusinessKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Re-fetch the case instance, could have changed due to action or even completed<NEW_LINE>caseInstance = runtimeService.createCaseInstanceQuery().caseInstanceId(caseInstance.getId()).singleResult();<NEW_LINE>if (caseInstance == null) {<NEW_LINE>// Case instance is finished, return empty body to inform user<NEW_LINE>response.setStatus(HttpStatus.NO_CONTENT.value());<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>return restResponseFactory.createCaseInstanceResponse(caseInstance);<NEW_LINE>}<NEW_LINE>}
restApiInterceptor.doCaseInstanceAction(caseInstance, updateRequest);
1,803,157
private void ReadTime(Vector dataVector, long type) throws IOException {<NEW_LINE>BoolVector boolVector = this.inStream.ReadBoolVector2(this.Files.size());<NEW_LINE>StreamSwitch streamSwitch = new StreamSwitch();<NEW_LINE>streamSwitch.Set(this.inStream, dataVector);<NEW_LINE>for (int i = 0; i < this.Files.size(); i++) {<NEW_LINE>FileItem file = (FileItem) <MASK><NEW_LINE>int low = 0;<NEW_LINE>int high = 0;<NEW_LINE>boolean defined = boolVector.get(i);<NEW_LINE>if (defined) {<NEW_LINE>low = this.inStream.ReadUInt32();<NEW_LINE>high = this.inStream.ReadUInt32();<NEW_LINE>}<NEW_LINE>switch((int) type) {<NEW_LINE>case Header.NID.kCreationTime:<NEW_LINE>// file.IsCreationTimeDefined = defined;<NEW_LINE>if (defined)<NEW_LINE>file.CreationTime = InStream.FileTimeToLong(high, low);<NEW_LINE>break;<NEW_LINE>case Header.NID.kLastWriteTime:<NEW_LINE>// file.IsLastWriteTimeDefined = defined;<NEW_LINE>if (defined)<NEW_LINE>file.LastWriteTime = InStream.FileTimeToLong(high, low);<NEW_LINE>break;<NEW_LINE>case Header.NID.kLastAccessTime:<NEW_LINE>// file.IsLastAccessTimeDefined = defined;<NEW_LINE>if (defined)<NEW_LINE>file.LastAccessTime = InStream.FileTimeToLong(high, low);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>streamSwitch.close();<NEW_LINE>}
this.Files.get(i);
1,689,078
public CACertificate unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CACertificate cACertificate = new CACertificate();<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("certificateArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>cACertificate.setCertificateArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("certificateId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>cACertificate.setCertificateId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>cACertificate.setStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("creationDate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>cACertificate.setCreationDate(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").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 cACertificate;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,025,328
private <V> void doSchedule(ScheduledTaskDescriptor descriptor) {<NEW_LINE>assert descriptor.getScheduledFuture() == null;<NEW_LINE>TaskDefinition definition = descriptor.getDefinition();<NEW_LINE>ScheduledFuture future;<NEW_LINE>TaskRunner<V> runner;<NEW_LINE>try {<NEW_LINE>switch(definition.getType()) {<NEW_LINE>case SINGLE_RUN:<NEW_LINE>runner = new TaskRunner<>(this, descriptor, SINGLE_RUN);<NEW_LINE>future = new DelegatingScheduledFutureStripper<V>(executionService.scheduleDurable(name, (Callable) runner, definition.getInitialDelay()<MASK><NEW_LINE>break;<NEW_LINE>case AT_FIXED_RATE:<NEW_LINE>runner = new TaskRunner<>(this, descriptor, AT_FIXED_RATE);<NEW_LINE>future = executionService.scheduleDurableWithRepetition(name, runner, definition.getInitialDelay(), definition.getPeriod(), definition.getUnit());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>} catch (RejectedExecutionException e) {<NEW_LINE>if (statisticsEnabled) {<NEW_LINE>getExecutorStats().rejectExecution(name);<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>descriptor.setScheduledFuture(future);<NEW_LINE>if (logger.isFinestEnabled()) {<NEW_LINE>log(FINEST, definition.getName(), "Scheduled");<NEW_LINE>}<NEW_LINE>}
, definition.getUnit()));
92,973
public static void init() {<NEW_LINE>INSTANCE.registerMessage(MessageKeyPressed.MessageHandler.class, MessageKeyPressed.class, 4, Side.SERVER);<NEW_LINE>INSTANCE.registerMessage(MessageSyncEnergyValues.MessageHandler.class, MessageSyncEnergyValues.<MASK><NEW_LINE>INSTANCE.registerMessage(MessageSetEnergyValue.MessageHandler.class, MessageSetEnergyValue.class, 7, Side.CLIENT);<NEW_LINE>INSTANCE.registerMessage(MessageGuiElementClicked.MessageHandler.class, MessageGuiElementClicked.class, 8, Side.SERVER);<NEW_LINE>INSTANCE.registerMessage(MessageGuiElementTextFieldUpdate.MessageHandler.class, MessageGuiElementTextFieldUpdate.class, 9, Side.SERVER);<NEW_LINE>INSTANCE.registerMessage(MessageChalkSettings.MessageHandler.class, MessageChalkSettings.class, 10, Side.CLIENT);<NEW_LINE>INSTANCE.registerMessage(MessageSingleParticleEvent.MessageHandler.class, MessageSingleParticleEvent.class, 14, Side.CLIENT);<NEW_LINE>INSTANCE.registerMessage(MessageSliderElementUpdated.MessageHandler.class, MessageSliderElementUpdated.class, 15, Side.SERVER);<NEW_LINE>INSTANCE.registerMessage(MessagePlayerKnowledge.MessageHandler.class, MessagePlayerKnowledge.class, 16, Side.CLIENT);<NEW_LINE>INSTANCE.registerMessage(MessageSyncBlacklist.MessageHandler.class, MessageSyncBlacklist.class, 18, Side.CLIENT);<NEW_LINE>INSTANCE.registerMessage(MessageSetBlacklistEntry.MessageHandler.class, MessageSetBlacklistEntry.class, 19, Side.CLIENT);<NEW_LINE>}
class, 6, Side.CLIENT);
1,362,317
private void pullImage(final String image) throws DockerException, InterruptedException {<NEW_LINE>listener.pulling();<NEW_LINE>DockerTimeoutException wasTimeout = null;<NEW_LINE>final Stopwatch pullTime = Stopwatch.createStarted();<NEW_LINE>// Attempt to pull. Failure, while less than ideal, is ok.<NEW_LINE>try {<NEW_LINE>docker.pull(image);<NEW_LINE>listener.pulled();<NEW_LINE>log.info("Pulled image {} in {}s", image, pullTime.elapsed(SECONDS));<NEW_LINE>} catch (DockerTimeoutException e) {<NEW_LINE>log.warn("Pulling image {} failed with timeout after {}s", image, pullTime.elapsed(SECONDS), e);<NEW_LINE>listener.pullFailed();<NEW_LINE>wasTimeout = e;<NEW_LINE>} catch (DockerException e) {<NEW_LINE>log.warn("Pulling image {} failed after {}s", image, pullTime.elapsed(SECONDS), e);<NEW_LINE>listener.pullFailed();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// If we don't have the image by now, fail.<NEW_LINE>docker.inspectImage(image);<NEW_LINE>} catch (ImageNotFoundException e) {<NEW_LINE>// If we get not found, see if we timed out above, since that's what we actually care<NEW_LINE>// to know, as the pull should have fixed the not found-ness.<NEW_LINE>if (wasTimeout != null) {<NEW_LINE>throw new ImagePullFailedException(<MASK><NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
"Failed pulling image " + image + " because of timeout", wasTimeout);
822,863
public Set<FileObject> extend(WebModule webModule) {<NEW_LINE>CreateSpringConfig createSpringConfig = new CreateSpringConfig(webModule);<NEW_LINE>FileObject webInf = webModule.getWebInf();<NEW_LINE>if (webInf == null) {<NEW_LINE>try {<NEW_LINE>FileObject documentBase = webModule.getDocumentBase();<NEW_LINE>if (documentBase == null) {<NEW_LINE>LOGGER.<MASK><NEW_LINE>return Collections.<FileObject>emptySet();<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>webInf = FileUtil.createFolder(documentBase, "WEB-INF");<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.log(Level.WARNING, "Exception during creating WEB-INF directory", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (webInf != null) {<NEW_LINE>try {<NEW_LINE>FileSystem fs = webInf.getFileSystem();<NEW_LINE>fs.runAtomicAction(createSpringConfig);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Logger.getLogger("global").log(Level.INFO, null, e);<NEW_LINE>return Collections.<FileObject>emptySet();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return createSpringConfig.getFilesToOpen();<NEW_LINE>}
log(Level.INFO, "WebModule does not have valid documentBase");
1,048,171
public SJavaInfo convertToSObject(JavaInfo input) {<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SJavaInfo result = new SJavaInfo();<NEW_LINE>result.setOid(input.getOid());<NEW_LINE>result.setUuid(input.getUuid());<NEW_LINE>result.setRid(input.getRid());<NEW_LINE>result.setHeapTotal(input.getHeapTotal());<NEW_LINE>result.setHeapUsed(input.getHeapUsed());<NEW_LINE>result.setHeapFree(input.getHeapFree());<NEW_LINE>result.setHeapMax(input.getHeapMax());<NEW_LINE>result.setThreads(input.getThreads());<NEW_LINE>result.setJavaHome(input.getJavaHome());<NEW_LINE>result.setJavaVersion(input.getJavaVersion());<NEW_LINE>result.setJavaVendor(input.getJavaVendor());<NEW_LINE>result.setJavaVendorurl(input.getJavaVendorurl());<NEW_LINE>result.setJavavmVersion(input.getJavavmVersion());<NEW_LINE>result.setJavavmVendor(input.getJavavmVendor());<NEW_LINE>result.setJavavmName(input.getJavavmName());<NEW_LINE>result.setJavaspecVersion(input.getJavaspecVersion());<NEW_LINE>result.setJavaspecVendor(input.getJavaspecVendor());<NEW_LINE>result.setJavaspecName(input.getJavaspecName());<NEW_LINE>result.setJavaClassVersion(input.getJavaClassVersion());<NEW_LINE>result.getJavaClasspath().addAll(input.getJavaClasspath());<NEW_LINE>result.getJavaLibrarypath().addAll(input.getJavaLibrarypath());<NEW_LINE>result.setJavaIoTmp(input.getJavaIoTmp());<NEW_LINE>result.<MASK><NEW_LINE>result.setJavaFileSeparator(input.getJavaFileSeparator());<NEW_LINE>result.setJavaPathSeparator(input.getJavaPathSeparator());<NEW_LINE>result.setJavaLineSeparator(input.getJavaLineSeparator());<NEW_LINE>return result;<NEW_LINE>}
setJavaExtdir(input.getJavaExtdir());
1,389,266
private synchronized void writeMessage(byte[] message, OutputStream os) throws IOException {<NEW_LINE>// prepare data for encryption<NEW_LINE>int bytesCount = 6 + message.length;<NEW_LINE>if (bytesCount < 16) {<NEW_LINE>bytesCount = 16;<NEW_LINE>}<NEW_LINE>byte[] data = new byte[bytesCount];<NEW_LINE>int randomValue = this.rand.nextInt();<NEW_LINE>data[0] = (byte) (randomValue >> 8);<NEW_LINE>data[1] = (byte) (randomValue & 0xff);<NEW_LINE>data[2] = (byte) <MASK><NEW_LINE>data[3] = (byte) (this.rollingCounter & 0xff);<NEW_LINE>data[4] = this.id_s = (byte) this.rand.nextInt();<NEW_LINE>data[5] = this.id_r;<NEW_LINE>++this.rollingCounter;<NEW_LINE>System.arraycopy(message, 0, data, 6, message.length);<NEW_LINE>// encrypt data<NEW_LINE>logger.debug("Encrypting data: {}", bytesToHex(data));<NEW_LINE>try {<NEW_LINE>this.aesHelper.encrypt(data);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IOException("Encryption exception", e);<NEW_LINE>}<NEW_LINE>logger.trace("Encrypted data: {}", bytesToHex(data));<NEW_LINE>// write encrypted data to output stream<NEW_LINE>os.write(bytesCount);<NEW_LINE>os.write(data);<NEW_LINE>os.flush();<NEW_LINE>}
(this.rollingCounter >> 8);
1,646,753
public void fill(int start, int end, byte val) {<NEW_LINE>start += _start;<NEW_LINE>end += _start;<NEW_LINE>while (start < end) {<NEW_LINE>int chunk = start / growAmount;<NEW_LINE>int off = start % growAmount;<NEW_LINE>if (chunk < chunks.size()) {<NEW_LINE>int toFill = Math.min(end - start, growAmount - off);<NEW_LINE>Arrays.fill(chunks.get(chunk), off, off + toFill, val);<NEW_LINE>start += toFill;<NEW_LINE>} else if (chunk == chunks.size()) {<NEW_LINE>int toFill = Math.min(end - start, growAmount - off);<NEW_LINE>Arrays.fill(storage, <MASK><NEW_LINE>_size = Math.max(_size, off + toFill);<NEW_LINE>start += toFill;<NEW_LINE>if (_size == growAmount) {<NEW_LINE>chunks.add(storage);<NEW_LINE>_size = 0;<NEW_LINE>storage = new byte[growAmount];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>chunks.add(storage);<NEW_LINE>_size = 0;<NEW_LINE>storage = new byte[growAmount];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
off, off + toFill, val);
1,629,270
public static void apiManagementCreateApiWithOpenIdConnect(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {<NEW_LINE>manager.apis().define("tempgroup").withExistingService("rg1", "apimService1").withDisplayName("Swagger Petstore").withServiceUrl("http://petstore.swagger.io/v2").withPath("petstore").withProtocols(Arrays.asList(Protocol.HTTPS)).withDescription("This is a sample server Petstore server. You can find out more about Swagger at" + " [http://swagger.io](http://swagger.io) or on [irc.freenode.net," + " #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to" + " test the authorization filters.").withAuthenticationSettings(new AuthenticationSettingsContract().withOpenid(new OpenIdAuthenticationSettingsContract().withOpenidProviderId("testopenid").withBearerTokenSendingMethods(Arrays.asList(BearerTokenSendingMethods.AUTHORIZATION_HEADER)))).withSubscriptionKeyParameterNames(new SubscriptionKeyParameterNamesContract().withHeaderProperty("Ocp-Apim-Subscription-Key").withQuery<MASK><NEW_LINE>}
("subscription-key")).create();
576,355
public Iterator<String> call(Integer partitionIdx, Iterator<MultiDataSet> iterator) throws Exception {<NEW_LINE>List<String> outputPaths = new ArrayList<>();<NEW_LINE>LinkedList<MultiDataSet> tempList = new LinkedList<>();<NEW_LINE>int count = 0;<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>MultiDataSet next = iterator.next();<NEW_LINE>if (next.getFeatures(0).size(0) == minibatchSize) {<NEW_LINE>outputPaths.add(export(next, partitionIdx, count++));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// DataSet must be either smaller or larger than minibatch size...<NEW_LINE>tempList.add(next);<NEW_LINE>Pair<Integer, List<String>> countAndPaths = processList(tempList, partitionIdx, count, false);<NEW_LINE>if (countAndPaths.getSecond() != null && !countAndPaths.getSecond().isEmpty()) {<NEW_LINE>outputPaths.addAll(countAndPaths.getSecond());<NEW_LINE>}<NEW_LINE>count = countAndPaths.getFirst();<NEW_LINE>}<NEW_LINE>// We might have some left-over examples...<NEW_LINE>Pair<Integer, List<String>> countAndPaths = processList(<MASK><NEW_LINE>if (countAndPaths.getSecond() != null && !countAndPaths.getSecond().isEmpty()) {<NEW_LINE>outputPaths.addAll(countAndPaths.getSecond());<NEW_LINE>}<NEW_LINE>return outputPaths.iterator();<NEW_LINE>}
tempList, partitionIdx, count, true);
260,285
public void execute(PyCursor cursor, PyObject params, PyObject bindings) throws SQLException {<NEW_LINE>if (closed) {<NEW_LINE>throw zxJDBC.makeException(zxJDBC.ProgrammingError, "statement is closed");<NEW_LINE>}<NEW_LINE>prepare(cursor, params, bindings);<NEW_LINE>Fetch fetch = cursor.fetch;<NEW_LINE>switch(style) {<NEW_LINE>case STATEMENT_STATIC:<NEW_LINE>if (statement.execute((String) sql)) {<NEW_LINE>fetch.add(statement.getResultSet());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case STATEMENT_PREPARED:<NEW_LINE>final PreparedStatement preparedStatement = (PreparedStatement) statement;<NEW_LINE>if (preparedStatement.execute()) {<NEW_LINE>fetch.add(preparedStatement.getResultSet());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case STATEMENT_CALLABLE:<NEW_LINE><MASK><NEW_LINE>if (callableStatement.execute()) {<NEW_LINE>fetch.add(callableStatement.getResultSet());<NEW_LINE>}<NEW_LINE>fetch.add(callableStatement, (Procedure) sql, params);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw zxJDBC.makeException(zxJDBC.ProgrammingError, zxJDBC.getString("invalidStyle"));<NEW_LINE>}<NEW_LINE>}
final CallableStatement callableStatement = (CallableStatement) statement;
1,127,452
public static Iterator<BOp> preOrderIteratorWithAnnotations(final BOp op) {<NEW_LINE>return new Striterator(preOrderIterator(op)).addFilter(new Expander() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Iterator expand(final Object arg0) {<NEW_LINE>final BOp op = (BOp) arg0;<NEW_LINE>// visit the node.<NEW_LINE>final Striterator itr = new <MASK><NEW_LINE>// visit the node's operator annotations.<NEW_LINE>final Striterator itr2 = new Striterator(annotationOpIterator(op));<NEW_LINE>// expand each operator annotation with a pre-order traversal.<NEW_LINE>itr2.addFilter(new Expander() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Iterator expand(final Object ann) {<NEW_LINE>return preOrderIteratorWithAnnotations((BOp) ann);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// append the pre-order traversal of each annotation.<NEW_LINE>itr.append(itr2);<NEW_LINE>return itr;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
Striterator(new SingleValueIterator(op));
1,621,756
public Documentation scan(DocumentationContext context) {<NEW_LINE>ApiListingReferenceScanResult result = apiListingReferenceScanner.scan(context);<NEW_LINE>ApiListingScanningContext listingContext = new ApiListingScanningContext(context, result.getResourceGroupRequestMappings());<NEW_LINE>Map<String, List<ApiListing>> apiListings = apiListingScanner.scan(listingContext);<NEW_LINE>Set<Tag> tags = toTags(apiListings);<NEW_LINE>tags.addAll(context.getTags());<NEW_LINE>DocumentationBuilder group = new DocumentationBuilder().name(context.getGroupName()).apiListingsByResourceGroupName(apiListings).produces(context.getProduces()).consumes(context.getConsumes()).host(context.getHost()).schemes(context.getProtocols()).basePath(ROOT).extensions(context.getVendorExtentions()).tags(tags);<NEW_LINE>Set<ApiListingReference> apiReferenceSet = new TreeSet<>(listingReferencePathComparator());<NEW_LINE>apiReferenceSet.addAll<MASK><NEW_LINE>group.resourceListing(r -> r.apiVersion(context.getApiInfo().getVersion()).apis(apiReferenceSet.stream().sorted(context.getListingReferenceOrdering()).collect(toList())).securitySchemes(context.getSecuritySchemes()).info(context.getApiInfo()).servers(context.getServers()));<NEW_LINE>return group.build();<NEW_LINE>}
(apiListingReferences(apiListings, context));
867,346
private EditorEx createEditor(Project project, IdeDocumentHistoryImpl.PlaceInfo placeInfo) {<NEW_LINE>RangeMarker positionOffset = placeInfo.getCaretPosition();<NEW_LINE>if (positionOffset == null || !positionOffset.isValid()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>assert positionOffset.getStartOffset() == positionOffset.getEndOffset();<NEW_LINE><MASK><NEW_LINE>int lineNumber = fileDocument.getLineNumber(positionOffset.getStartOffset());<NEW_LINE>TextRange actualTextRange = getTrimmedRange(fileDocument, lineNumber);<NEW_LINE>CharSequence documentText = fileDocument.getText(actualTextRange);<NEW_LINE>if (actualTextRange.isEmpty()) {<NEW_LINE>documentText = RecentLocationsAction.EMPTY_FILE_TEXT;<NEW_LINE>}<NEW_LINE>EditorFactory editorFactory = EditorFactory.getInstance();<NEW_LINE>Document editorDocument = editorFactory.createDocument(documentText);<NEW_LINE>EditorEx editor = (EditorEx) editorFactory.createEditor(editorDocument, project);<NEW_LINE>EditorGutterComponentEx gutterComponentEx = editor.getGutterComponentEx();<NEW_LINE>int linesShift = fileDocument.getLineNumber(actualTextRange.getStartOffset());<NEW_LINE>gutterComponentEx.setLineNumberConvertor(index -> index + linesShift);<NEW_LINE>gutterComponentEx.setPaintBackground(false);<NEW_LINE>JScrollPane scrollPane = editor.getScrollPane();<NEW_LINE>scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);<NEW_LINE>scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);<NEW_LINE>fillEditorSettings(editor.getSettings());<NEW_LINE>setHighlighting(project, editor, fileDocument, placeInfo, actualTextRange);<NEW_LINE>return editor;<NEW_LINE>}
Document fileDocument = positionOffset.getDocument();
41,897
private void jstackAndRespond(CentralRequest request, StreamObserver<AgentResponse> responseObserver) {<NEW_LINE>String jstack;<NEW_LINE>try {<NEW_LINE>jstack = liveJvmService.getJstack("");<NEW_LINE>} catch (UnavailableDueToRunningInJreException e) {<NEW_LINE>logger.debug(e.getMessage(), e);<NEW_LINE>responseObserver.onNext(AgentResponse.newBuilder().setRequestId(request.getRequestId()).setJstackResponse(JstackResponse.newBuilder().setUnavailableDueToRunningInJre(<MASK><NEW_LINE>return;<NEW_LINE>} catch (UnavailableDueToRunningInJ9JvmException e) {<NEW_LINE>// Eclipse OpenJ9 VM or IBM J9 VM<NEW_LINE>logger.debug(e.getMessage(), e);<NEW_LINE>responseObserver.onNext(AgentResponse.newBuilder().setRequestId(request.getRequestId()).setJstackResponse(JstackResponse.newBuilder().setUnavailableDueToRunningInJ9Jvm(true)).build());<NEW_LINE>return;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>sendExceptionResponse(request, responseObserver);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>responseObserver.onNext(AgentResponse.newBuilder().setRequestId(request.getRequestId()).setJstackResponse(JstackResponse.newBuilder().setJstack(jstack)).build());<NEW_LINE>}
true)).build());
484,551
public Project createProject(String name, Long namespaceId, String description, Boolean issuesEnabled, Boolean mergeRequestsEnabled, Boolean wikiEnabled, Boolean snippetsEnabled, Visibility visibility, Integer visibilityLevel, String importUrl) throws GitLabApiException {<NEW_LINE>if (isApiVersion(ApiVersion.V3)) {<NEW_LINE>Boolean isPublic = Visibility.PUBLIC == visibility;<NEW_LINE>return (createProject(name, namespaceId, description, issuesEnabled, mergeRequestsEnabled, wikiEnabled, snippetsEnabled, isPublic, visibilityLevel, importUrl));<NEW_LINE>}<NEW_LINE>if (name == null || name.trim().length() == 0) {<NEW_LINE>return (null);<NEW_LINE>}<NEW_LINE>GitLabApiForm formData = new GitLabApiForm().withParam("name", name, true).withParam("namespace_id", namespaceId).withParam("description", description).withParam("issues_enabled", issuesEnabled).withParam("merge_requests_enabled", mergeRequestsEnabled).withParam("wiki_enabled", wikiEnabled).withParam("snippets_enabled", snippetsEnabled).withParam("visibility_level", visibilityLevel).withParam("visibility", visibility).withParam("import_url", importUrl);<NEW_LINE>Response response = post(Response.Status.CREATED, formData, "projects");<NEW_LINE>return (response<MASK><NEW_LINE>}
.readEntity(Project.class));
1,731,513
private static void insertAlignedRecords() throws IoTDBConnectionException, StatementExecutionException {<NEW_LINE>List<String> multiSeriesIds = new ArrayList<>();<NEW_LINE>List<List<String>> multiMeasurementComponentsList = new ArrayList<>();<NEW_LINE>List<List<TSDataType>> typeList = new ArrayList<>();<NEW_LINE>List<Long> times = new ArrayList<>();<NEW_LINE>List<List<Object>> valueList = new ArrayList<>();<NEW_LINE>for (long time = 1; time < 5; time++) {<NEW_LINE>List<String> multiMeasurementComponents = new ArrayList<>();<NEW_LINE>multiMeasurementComponents.add("s1");<NEW_LINE>multiMeasurementComponents.add("s2");<NEW_LINE>List<TSDataType> types = new ArrayList<>();<NEW_LINE>types.add(TSDataType.INT64);<NEW_LINE>types.add(TSDataType.INT32);<NEW_LINE>List<Object> <MASK><NEW_LINE>values.add(1L);<NEW_LINE>values.add(2);<NEW_LINE>multiSeriesIds.add(ROOT_SG2_D1_VECTOR4);<NEW_LINE>times.add(time);<NEW_LINE>multiMeasurementComponentsList.add(multiMeasurementComponents);<NEW_LINE>typeList.add(types);<NEW_LINE>valueList.add(values);<NEW_LINE>}<NEW_LINE>session.insertAlignedRecords(multiSeriesIds, times, multiMeasurementComponentsList, typeList, valueList);<NEW_LINE>}
values = new ArrayList<>();
1,761,768
private static void foldSequentialComments(List<FoldingDescriptor> descriptors, ASTNode node) {<NEW_LINE>// need to skip previous comments in sequence<NEW_LINE><MASK><NEW_LINE>while (curNode != null) {<NEW_LINE>if (curNode.getElementType() == BuildToken.COMMENT) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>curNode = isWhitespaceOrNewline(curNode) ? curNode.getTreePrev() : null;<NEW_LINE>}<NEW_LINE>// fold sequence comments in one block<NEW_LINE>curNode = node.getTreeNext();<NEW_LINE>ASTNode lastCommentNode = node;<NEW_LINE>while (curNode != null) {<NEW_LINE>if (curNode.getElementType() == BuildToken.COMMENT) {<NEW_LINE>lastCommentNode = curNode;<NEW_LINE>curNode = curNode.getTreeNext();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>curNode = isWhitespaceOrNewline(curNode) ? curNode.getTreeNext() : null;<NEW_LINE>}<NEW_LINE>if (lastCommentNode != node) {<NEW_LINE>descriptors.add(new FoldingDescriptor(node, TextRange.create(node.getStartOffset(), lastCommentNode.getTextRange().getEndOffset())));<NEW_LINE>}<NEW_LINE>}
ASTNode curNode = node.getTreePrev();
649,815
public static HashMap<String, Double> determineEntityMentionConfidences(CoreMap entityMention) {<NEW_LINE>// get a list of labels that have probability values from the first token<NEW_LINE>Map<String, Double> tagProbs = entityMention.get(CoreAnnotations.TokensAnnotation.class).get(0).<MASK><NEW_LINE>if (tagProbs == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Set<String> labelsWithProbs = tagProbs.keySet();<NEW_LINE>// build the label values hash map for the entity mention<NEW_LINE>HashMap<String, Double> entityLabelProbVals = new HashMap<>();<NEW_LINE>// initialize to 1.1<NEW_LINE>for (String labelWithProb : labelsWithProbs) {<NEW_LINE>entityLabelProbVals.put(labelWithProb, 1.1);<NEW_LINE>}<NEW_LINE>// go through each token, see if you can find a smaller prob value for that label<NEW_LINE>for (CoreLabel token : entityMention.get(CoreAnnotations.TokensAnnotation.class)) {<NEW_LINE>Map<String, Double> labelProbsForToken = token.get(CoreAnnotations.NamedEntityTagProbsAnnotation.class);<NEW_LINE>for (String label : labelProbsForToken.keySet()) {<NEW_LINE>if (entityLabelProbVals.containsKey(label) && labelProbsForToken.get(label) < entityLabelProbVals.get(label))<NEW_LINE>entityLabelProbVals.put(label, labelProbsForToken.get(label));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if anything is still at 1.1, set it to -1.0<NEW_LINE>for (String label : entityLabelProbVals.keySet()) {<NEW_LINE>if (entityLabelProbVals.get(label) >= 1.1) {<NEW_LINE>entityLabelProbVals.put(label, -1.0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// return the hash map of label probs<NEW_LINE>return entityLabelProbVals;<NEW_LINE>}
get(CoreAnnotations.NamedEntityTagProbsAnnotation.class);
1,616,340
public ArrayList<SearchResult> search(String query, SearchSite site, SearchSortOrder sortBy) {<NEW_LINE>// Try to query the TorrentSearchProvider to search for torrents on the web<NEW_LINE>Uri uri = Uri.parse("content://org.transdroid.search.torrentsearchprovider/search/" + query);<NEW_LINE>Cursor cursor;<NEW_LINE>if (site == null) {<NEW_LINE>// If no explicit site was supplied, rely on the Torrent Search package's default<NEW_LINE>cursor = context.getContentResolver().query(uri, null, null, null, sortBy.name());<NEW_LINE>} else {<NEW_LINE>cursor = context.getContentResolver().query(uri, null, "SITE = ?", new String[] { site.getKey() }, sortBy.name());<NEW_LINE>}<NEW_LINE>if (cursor == null) {<NEW_LINE>// The content provider could not load any content (for example when there is no connection)<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (cursor.moveToFirst()) {<NEW_LINE>ArrayList<SearchResult> results = new ArrayList<>();<NEW_LINE>do {<NEW_LINE>// Read the cursor fields into the SearchResult object<NEW_LINE>results.add(new SearchResult(cursor.getInt(CURSOR_SEARCH_ID), cursor.getString(CURSOR_SEARCH_NAME), cursor.getString(CURSOR_SEARCH_TORRENTURL), cursor.getString(CURSOR_SEARCH_DETAILSURL), cursor.getString(CURSOR_SEARCH_SIZE), cursor.getLong(CURSOR_SEARCH_ADDED), cursor.getString(CURSOR_SEARCH_SEEDERS), cursor.getString(CURSOR_SEARCH_LEECHERS)));<NEW_LINE>} <MASK><NEW_LINE>cursor.close();<NEW_LINE>return results;<NEW_LINE>}<NEW_LINE>// Torrent Search package is not yet installed<NEW_LINE>cursor.close();<NEW_LINE>return null;<NEW_LINE>}
while (cursor.moveToNext());
1,623,660
public void flush() {<NEW_LINE>final int nbSegments = getSize() / 4;<NEW_LINE>if (nbSegments == 0) {<NEW_LINE>additionalFlush();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final float[] lines = getLines();<NEW_LINE>final <MASK><NEW_LINE>if (paint != null) {<NEW_LINE>// monochromatic: that's enough<NEW_LINE>final int size = compact(lines, nbSegments * 4);<NEW_LINE>if (size > 0) {<NEW_LINE>mCanvas.drawLines(lines, 0, size, paint);<NEW_LINE>}<NEW_LINE>additionalFlush();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < nbSegments * 4; i += 4) {<NEW_LINE>final float x0 = lines[i];<NEW_LINE>final float y0 = lines[i + 1];<NEW_LINE>final float x1 = lines[i + 2];<NEW_LINE>final float y1 = lines[i + 3];<NEW_LINE>if (x0 == x1 && y0 == y1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final int segmentIndex = mIntegerAccepter.getValue(i / 2);<NEW_LINE>mCanvas.drawLine(x0, y0, x1, y1, mPaintList.getPaint(segmentIndex, x0, y0, x1, y1));<NEW_LINE>}<NEW_LINE>additionalFlush();<NEW_LINE>}
Paint paint = mPaintList.getPaint();
107,142
public void testThenApplyWithPreContextualizedAction() throws Exception {<NEW_LINE>ThreadContext cityContextPropagator = ThreadContext.builder().propagated(TestContextTypes.CITY).build();<NEW_LINE>ManagedExecutor executor = ManagedExecutor.builder().propagated(TestContextTypes.CITY).build();<NEW_LINE>try {<NEW_LINE>CurrentLocation.setLocation("Stewartville", "Minnesota");<NEW_LINE>Function<String, String> addCity = s -> s + ',' + CurrentLocation.getCity();<NEW_LINE>Function<String, String> <MASK><NEW_LINE>CurrentLocation.setLocation("Eyota", "Minnesota");<NEW_LINE>CompletableFuture<String> cf = executor.supplyAsync(CurrentLocation::getCity).thenApplyAsync(preContextualizedAddCity).thenApplyAsync(addCity);<NEW_LINE>assertEquals("Eyota,Stewartville,Eyota", cf.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>} finally {<NEW_LINE>CurrentLocation.clear();<NEW_LINE>executor.shutdownNow();<NEW_LINE>}<NEW_LINE>}
preContextualizedAddCity = cityContextPropagator.contextualFunction(addCity);
1,318,272
public Object visit(Object context, OfOperatorExpression expr, boolean strict) {<NEW_LINE>LabelNode typeError = new LabelNode();<NEW_LINE>LabelNode end = new LabelNode();<NEW_LINE>expr.getLhs().<MASK><NEW_LINE>// obj(lhs)<NEW_LINE>append(jsGetValue());<NEW_LINE>// val(lhs)<NEW_LINE>expr.getRhs().accept(context, this, strict);<NEW_LINE>// val(lhs) obj(rhs)<NEW_LINE>append(jsGetValue());<NEW_LINE>// val(lhs) val(rhs)<NEW_LINE>dup();<NEW_LINE>// val(lhs) val(rhs) val(rhs)<NEW_LINE>instance_of(p(JSObject.class));<NEW_LINE>// val(lhs) val(rhs) bool<NEW_LINE>iffalse(typeError);<NEW_LINE>// val(lhs) val(rhs)<NEW_LINE>checkcast(p(JSObject.class));<NEW_LINE>// val(lhs) obj(rhs)<NEW_LINE>swap();<NEW_LINE>// obj(rhs) val(lhs)<NEW_LINE>append(jsToString());<NEW_LINE>// obj(rhs) str(lhs)<NEW_LINE>aload(Arities.EXECUTION_CONTEXT);<NEW_LINE>// obj(rhs) str(lhs) context<NEW_LINE>swap();<NEW_LINE>// object(rhs) context str(lhs);<NEW_LINE>invokeinterface(p(JSObject.class), "hasProperty", sig(boolean.class, ExecutionContext.class, String.class));<NEW_LINE>// bool<NEW_LINE>go_to(end);<NEW_LINE>label(typeError);<NEW_LINE>// val(lhs) val(rhs)<NEW_LINE>pop();<NEW_LINE>pop();<NEW_LINE>iconst_0();<NEW_LINE>i2b();<NEW_LINE>// bool<NEW_LINE>append(jsThrowTypeError("not an object"));<NEW_LINE>label(end);<NEW_LINE>invokestatic(p(Boolean.class), "valueOf", sig(Boolean.class, boolean.class));<NEW_LINE>// Boolean<NEW_LINE>return null;<NEW_LINE>}
accept(context, this, strict);
156,846
protected BeanDefinitionBuilder parseHandler(Element element, ParserContext parserContext) {<NEW_LINE>final BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(ContentEnricher.class);<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "request-channel");<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "reply-channel");<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "error-channel");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "request-timeout");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "reply-timeout");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "requires-reply");<NEW_LINE>propertySubElements(element, parserContext, builder);<NEW_LINE>headerSubElements(element, parserContext, builder);<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "should-clone-payload");<NEW_LINE>String requestPayloadExpression = element.getAttribute("request-payload-expression");<NEW_LINE>if (StringUtils.hasText(requestPayloadExpression)) {<NEW_LINE>BeanDefinitionBuilder expressionBuilder = BeanDefinitionBuilder.genericBeanDefinition(ExpressionFactoryBean<MASK><NEW_LINE>builder.addPropertyValue("requestPayloadExpression", expressionBuilder.getBeanDefinition());<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
.class).addConstructorArgValue(requestPayloadExpression);
1,131,166
private FieldDTO makeDTO(DatasetFieldType dataverseFieldType, FieldDTO value, String dataverseFieldName) {<NEW_LINE>if (dataverseFieldType.isAllowMultiples()) {<NEW_LINE>if (dataverseFieldType.isCompound()) {<NEW_LINE>value = <MASK><NEW_LINE>} else if (dataverseFieldType.isControlledVocabulary()) {<NEW_LINE>value = FieldDTO.createMultipleVocabFieldDTO(dataverseFieldName, Arrays.asList(value.getSinglePrimitive()));<NEW_LINE>} else {<NEW_LINE>value = FieldDTO.createMultiplePrimitiveFieldDTO(dataverseFieldName, Arrays.asList(value.getSinglePrimitive()));<NEW_LINE>}<NEW_LINE>if (dataverseFieldType.isChild()) {<NEW_LINE>DatasetFieldType parentDatasetFieldType = dataverseFieldType.getParentDatasetFieldType();<NEW_LINE>if (parentDatasetFieldType.isAllowMultiples()) {<NEW_LINE>value = FieldDTO.createMultipleCompoundFieldDTO(parentDatasetFieldType.getName(), value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (dataverseFieldType.isCompound()) {<NEW_LINE>value = FieldDTO.createCompoundFieldDTO(dataverseFieldName, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO:<NEW_LINE>// it looks like the code below has already been executed, in one of the<NEW_LINE>// if () blocks above... is this ok to be doing it again?? -- L.A. 4.5<NEW_LINE>if (dataverseFieldType.isChild()) {<NEW_LINE>DatasetFieldType parentDatasetFieldType = dataverseFieldType.getParentDatasetFieldType();<NEW_LINE>if (parentDatasetFieldType.isAllowMultiples()) {<NEW_LINE>value = FieldDTO.createMultipleCompoundFieldDTO(parentDatasetFieldType.getName(), value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
FieldDTO.createMultipleCompoundFieldDTO(dataverseFieldName, value);
1,796,225
public <V> Future<V> immediateExecuteCallableInNewThread(final Callable<V> callable, final String threadName) {<NEW_LINE>if (checkIfSchedulerClosed()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Objects.requireNonNull(callable);<NEW_LINE>final String name = "runtime thread #" + THREAD_ID_COUNTER.next() + " " + threadName;<NEW_LINE>final ScheduledExecutorService executor = makeSingleThreadExecutorService(pwmApplication.getInstanceID(<MASK><NEW_LINE>final Callable<V> runnableWrapper = () -> {<NEW_LINE>final Instant itemStartTime = Instant.now();<NEW_LINE>LOGGER.trace(() -> "started " + name);<NEW_LINE>try {<NEW_LINE>final V result = callable.call();<NEW_LINE>LOGGER.trace(() -> "completed " + name, () -> TimeDuration.fromCurrent(itemStartTime));<NEW_LINE>executor.shutdown();<NEW_LINE>return result;<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOGGER.error(() -> "error running scheduled immediate task: " + name + ", error: " + e.getMessage(), e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return executor.submit(runnableWrapper);<NEW_LINE>}
), callable.getClass());
874,340
private Either<ErrorResponseWriter, CommandApiResponseWriter> handleExecuteCommandRequest(final int partitionId, final long requestId, final CommandApiRequestReader reader, final CommandApiResponseWriter responseWriter, final ErrorResponseWriter errorWriter) {<NEW_LINE>if (!isDiskSpaceAvailable) {<NEW_LINE>errorWriter.resourceExhausted(String.format("Cannot accept requests for partition %d. Broker is out of disk space", partitionId));<NEW_LINE>return Either.left(errorWriter);<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>final var logStreamWriter = leadingStreams.get(partitionId);<NEW_LINE>final var limiter = partitionLimiters.get(partitionId);<NEW_LINE>final var eventType = command.valueType();<NEW_LINE>final var intent = Intent.fromProtocolValue(eventType, command.intent());<NEW_LINE>final var event = reader.event();<NEW_LINE>final var metadata = reader.metadata();<NEW_LINE>metadata.requestId(requestId);<NEW_LINE>metadata.requestStreamId(partitionId);<NEW_LINE>metadata.recordType(RecordType.COMMAND);<NEW_LINE>metadata.intent(intent);<NEW_LINE>metadata.valueType(eventType);<NEW_LINE>if (logStreamWriter == null) {<NEW_LINE>errorWriter.partitionLeaderMismatch(partitionId);<NEW_LINE>return Either.left(errorWriter);<NEW_LINE>}<NEW_LINE>if (event == null) {<NEW_LINE>errorWriter.unsupportedMessage(eventType.name(), CommandApiRequestReader.RECORDS_BY_TYPE.keySet().toArray());<NEW_LINE>return Either.left(errorWriter);<NEW_LINE>}<NEW_LINE>metrics.receivedRequest(partitionId);<NEW_LINE>if (!limiter.tryAcquire(partitionId, requestId, intent)) {<NEW_LINE>metrics.dropped(partitionId);<NEW_LINE>LOG.trace("Partition-{} receiving too many requests. Current limit {} inflight {}, dropping request {} from gateway", partitionId, limiter.getLimit(), limiter.getInflightCount(), requestId);<NEW_LINE>errorWriter.resourceExhausted();<NEW_LINE>return Either.left(errorWriter);<NEW_LINE>}<NEW_LINE>boolean written = false;<NEW_LINE>try {<NEW_LINE>written = writeCommand(command.key(), metadata, event, logStreamWriter);<NEW_LINE>return Either.right(responseWriter);<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>LOG.error("Unexpected error on writing {} command", intent, ex);<NEW_LINE>errorWriter.internalError("Failed writing response: %s", ex);<NEW_LINE>return Either.left(errorWriter);<NEW_LINE>} finally {<NEW_LINE>if (!written) {<NEW_LINE>limiter.onIgnore(partitionId, requestId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
var command = reader.getMessageDecoder();
885,620
private EllipticCurveOverFp computeWeierstrassEquivalent() {<NEW_LINE>BigInteger weierstrassA = new BigInteger("3").subtract(this.getFieldA().getData().modPow(new BigInteger("2"), this.getModulus()));<NEW_LINE>weierstrassA = weierstrassA.multiply(new BigInteger("3").multiply(this.getFieldB().getData().modPow(new BigInteger("2"), this.getModulus())).modInverse(this.getModulus())).mod(this.getModulus());<NEW_LINE>BigInteger weierstrassB = new BigInteger("2").multiply(this.getFieldA().getData().modPow(new BigInteger("3"), this.getModulus())).subtract(new BigInteger("9").multiply(this.getFieldA().getData()));<NEW_LINE>weierstrassB = weierstrassB.multiply(new BigInteger("27").multiply(this.getFieldB().getData().modPow(new BigInteger("3"), this.getModulus())).modInverse(this.getModulus())).mod(this.getModulus());<NEW_LINE>Point weierstrassGen = <MASK><NEW_LINE>return new EllipticCurveOverFp(weierstrassA, weierstrassB, this.getModulus(), weierstrassGen.getFieldX().getData(), weierstrassGen.getFieldY().getData(), this.getBasePointOrder());<NEW_LINE>}
toWeierstrass(this.getBasePoint());
1,156
protected CachedValue<PsiReference[]> compute(final PsiElement element, Object p) {<NEW_LINE>return CachedValuesManager.getManager(element.getProject()).createCachedValue(() -> {<NEW_LINE>IssueNavigationConfiguration navigationConfiguration = IssueNavigationConfiguration.getInstance(element.getProject());<NEW_LINE>if (navigationConfiguration == null) {<NEW_LINE>return CachedValueProvider.Result.<MASK><NEW_LINE>}<NEW_LINE>List<PsiReference> refs = null;<NEW_LINE>GlobalPathReferenceProvider provider = myReferenceProvider.get();<NEW_LINE>CharSequence commentText = StringUtil.newBombedCharSequence(element.getText(), 500);<NEW_LINE>for (IssueNavigationConfiguration.LinkMatch link : navigationConfiguration.findIssueLinks(commentText)) {<NEW_LINE>if (refs == null)<NEW_LINE>refs = new SmartList<>();<NEW_LINE>if (provider == null) {<NEW_LINE>provider = (GlobalPathReferenceProvider) PathReferenceManager.getInstance().getGlobalWebPathReferenceProvider();<NEW_LINE>myReferenceProvider.lazySet(provider);<NEW_LINE>}<NEW_LINE>provider.createUrlReference(element, link.getTargetUrl(), link.getRange(), refs);<NEW_LINE>}<NEW_LINE>PsiReference[] references = refs != null ? refs.toArray(new PsiReference[refs.size()]) : PsiReference.EMPTY_ARRAY;<NEW_LINE>return new CachedValueProvider.Result<>(references, element, navigationConfiguration);<NEW_LINE>}, false);<NEW_LINE>}
create(PsiReference.EMPTY_ARRAY, element);
1,402,810
private static void updateEntry(SQLiteDatabase db, long taskId, long propertyId, int type, String searchableText) {<NEW_LINE>// generate nGrams<NEW_LINE>Set<String> propertyNgrams = TRIGRAM_GENERATOR.getNgrams(searchableText);<NEW_LINE>propertyNgrams.addAll(TETRAGRAM_GENERATOR.getNgrams(searchableText));<NEW_LINE>// get an ID for each of the Ngrams.<NEW_LINE>Set<Long> ngramIds = ngramIds(db, propertyNgrams);<NEW_LINE>// unlink unused ngrams from the task and get the missing ones we have to link to the tak<NEW_LINE>Set<Long> missing = syncNgrams(db, taskId, propertyId, type, ngramIds);<NEW_LINE>// insert ngram relations for all new ngrams<NEW_LINE>addNgrams(db, <MASK><NEW_LINE>}
missing, taskId, propertyId, type);
587,209
public void updateTimelime(final Timeline timeline) throws InconsistentStateException, RepositoryProblemException {<NEW_LINE>if (null == timeline.getId()) {<NEW_LINE>throw new IllegalArgumentException("Timeline id can not be null on update (" + timeline + ")");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>jdbcTemplate.update("UPDATE zn_data.timeline SET " + " et_name=?, " + " tl_order=?, " + " st_id=?, " + " tl_topic=?, " + " tl_created_at=?, " + " tl_switched_at=?, " + " tl_cleanup_at=?, " + " tl_latest_position=?::jsonb, " + " tl_deleted=? " + " WHERE tl_id=?", timeline.getEventType(), timeline.getOrder(), timeline.getStorage().getId(), timeline.getTopic(), timeline.getCreatedAt(), timeline.getSwitchedAt(), timeline.getCleanedUpAt(), timeline.getLatestPosition() == null ? null : jsonMapper.writer().writeValueAsString(timeline.getLatestPosition()), timeline.isDeleted(<MASK><NEW_LINE>} catch (final JsonProcessingException ex) {<NEW_LINE>throw new InconsistentStateException("Can not serialize timeline latest position to json", ex);<NEW_LINE>} catch (final DataAccessException ex) {<NEW_LINE>throw new RepositoryProblemException("Repository problem occurred when updating timeline", ex);<NEW_LINE>}<NEW_LINE>}
), timeline.getId());
1,245,913
public static ZNRecord toZNRecord(TableConfig tableConfig) throws JsonProcessingException {<NEW_LINE>Map<String, String> <MASK><NEW_LINE>// Mandatory fields<NEW_LINE>simpleFields.put(TableConfig.TABLE_NAME_KEY, tableConfig.getTableName());<NEW_LINE>simpleFields.put(TableConfig.TABLE_TYPE_KEY, tableConfig.getTableType().toString());<NEW_LINE>simpleFields.put(TableConfig.VALIDATION_CONFIG_KEY, tableConfig.getValidationConfig().toJsonString());<NEW_LINE>simpleFields.put(TableConfig.TENANT_CONFIG_KEY, tableConfig.getTenantConfig().toJsonString());<NEW_LINE>simpleFields.put(TableConfig.INDEXING_CONFIG_KEY, tableConfig.getIndexingConfig().toJsonString());<NEW_LINE>simpleFields.put(TableConfig.CUSTOM_CONFIG_KEY, tableConfig.getCustomConfig().toJsonString());<NEW_LINE>simpleFields.put(TableConfig.IS_DIM_TABLE_KEY, Boolean.toString(tableConfig.isDimTable()));<NEW_LINE>// Optional fields<NEW_LINE>QuotaConfig quotaConfig = tableConfig.getQuotaConfig();<NEW_LINE>if (quotaConfig != null) {<NEW_LINE>simpleFields.put(TableConfig.QUOTA_CONFIG_KEY, quotaConfig.toJsonString());<NEW_LINE>}<NEW_LINE>TableTaskConfig taskConfig = tableConfig.getTaskConfig();<NEW_LINE>if (taskConfig != null) {<NEW_LINE>simpleFields.put(TableConfig.TASK_CONFIG_KEY, taskConfig.toJsonString());<NEW_LINE>}<NEW_LINE>RoutingConfig routingConfig = tableConfig.getRoutingConfig();<NEW_LINE>if (routingConfig != null) {<NEW_LINE>simpleFields.put(TableConfig.ROUTING_CONFIG_KEY, routingConfig.toJsonString());<NEW_LINE>}<NEW_LINE>QueryConfig queryConfig = tableConfig.getQueryConfig();<NEW_LINE>if (queryConfig != null) {<NEW_LINE>simpleFields.put(TableConfig.QUERY_CONFIG_KEY, queryConfig.toJsonString());<NEW_LINE>}<NEW_LINE>Map<InstancePartitionsType, InstanceAssignmentConfig> instanceAssignmentConfigMap = tableConfig.getInstanceAssignmentConfigMap();<NEW_LINE>if (instanceAssignmentConfigMap != null) {<NEW_LINE>simpleFields.put(TableConfig.INSTANCE_ASSIGNMENT_CONFIG_MAP_KEY, JsonUtils.objectToString(instanceAssignmentConfigMap));<NEW_LINE>}<NEW_LINE>List<FieldConfig> fieldConfigList = tableConfig.getFieldConfigList();<NEW_LINE>if (fieldConfigList != null) {<NEW_LINE>simpleFields.put(TableConfig.FIELD_CONFIG_LIST_KEY, JsonUtils.objectToString(fieldConfigList));<NEW_LINE>}<NEW_LINE>UpsertConfig upsertConfig = tableConfig.getUpsertConfig();<NEW_LINE>if (upsertConfig != null) {<NEW_LINE>simpleFields.put(TableConfig.UPSERT_CONFIG_KEY, JsonUtils.objectToString(upsertConfig));<NEW_LINE>}<NEW_LINE>IngestionConfig ingestionConfig = tableConfig.getIngestionConfig();<NEW_LINE>if (ingestionConfig != null) {<NEW_LINE>simpleFields.put(TableConfig.INGESTION_CONFIG_KEY, JsonUtils.objectToString(ingestionConfig));<NEW_LINE>}<NEW_LINE>List<TierConfig> tierConfigList = tableConfig.getTierConfigsList();<NEW_LINE>if (tierConfigList != null) {<NEW_LINE>simpleFields.put(TableConfig.TIER_CONFIGS_LIST_KEY, JsonUtils.objectToString(tierConfigList));<NEW_LINE>}<NEW_LINE>List<TunerConfig> tunerConfigList = tableConfig.getTunerConfigsList();<NEW_LINE>if (tunerConfigList != null) {<NEW_LINE>simpleFields.put(TableConfig.TUNER_CONFIG_LIST_KEY, JsonUtils.objectToString(tunerConfigList));<NEW_LINE>}<NEW_LINE>ZNRecord znRecord = new ZNRecord(tableConfig.getTableName());<NEW_LINE>znRecord.setSimpleFields(simpleFields);<NEW_LINE>return znRecord;<NEW_LINE>}
simpleFields = new HashMap<>();
413,261
public Publisher<Buffer> serialize(final Publisher<T> toSerialize, final BufferAllocator allocator) {<NEW_LINE>return compressor == null ? toSerialize.map(t -> {<NEW_LINE>final int <MASK><NEW_LINE>Buffer buffer = allocator.newBuffer(METADATA_SIZE + sizeEstimate);<NEW_LINE>final int writerIndexBefore = buffer.writerIndex();<NEW_LINE>buffer.writerIndex(writerIndexBefore + METADATA_SIZE);<NEW_LINE>serializer.serialize(t, allocator, buffer);<NEW_LINE>buffer.setByte(writerIndexBefore, FLAG_UNCOMPRESSED);<NEW_LINE>buffer.setInt(writerIndexBefore + 1, buffer.writerIndex() - writerIndexBefore - METADATA_SIZE);<NEW_LINE>return buffer;<NEW_LINE>}) : toSerialize.map(t -> {<NEW_LINE>// First do the serialization.<NEW_LINE>final int sizeEstimate = serializedBytesEstimator.applyAsInt(t);<NEW_LINE>Buffer serializedBuffer = allocator.newBuffer(sizeEstimate);<NEW_LINE>serializer.serialize(t, allocator, serializedBuffer);<NEW_LINE>// Next do the compression, pessimistically assume the size won't decrease when allocating.<NEW_LINE>Buffer resultBuffer = allocator.newBuffer(METADATA_SIZE + sizeEstimate);<NEW_LINE>// Compress into the same buffer that we return, so advance the writer index metadata<NEW_LINE>// bytes and then we fill in the meta data after compression is done and the final size is known.<NEW_LINE>final int writerIndexBefore = resultBuffer.writerIndex();<NEW_LINE>resultBuffer.writerIndex(writerIndexBefore + METADATA_SIZE);<NEW_LINE>compressor.encoder().serialize(serializedBuffer, allocator, resultBuffer);<NEW_LINE>resultBuffer.setByte(writerIndexBefore, FLAG_COMPRESSED);<NEW_LINE>resultBuffer.setInt(writerIndexBefore + 1, resultBuffer.writerIndex() - writerIndexBefore - METADATA_SIZE);<NEW_LINE>return resultBuffer;<NEW_LINE>});<NEW_LINE>}
sizeEstimate = serializedBytesEstimator.applyAsInt(t);
126,700
private void addGroup3(Composite composite) {<NEW_LINE>final Group container3 = new Group(composite, SWT.None);<NEW_LINE>container3.setLayout(new GridLayout(3, false));<NEW_LINE>GridData innergrid3 = new GridData(GridData.FILL_HORIZONTAL);<NEW_LINE>innergrid3.horizontalSpan = 3;<NEW_LINE>container3.setLayoutData(innergrid3);<NEW_LINE>container3.setText("Generate Signed Enclave (Step-2):");<NEW_LINE>final Label messageLabel4 = new <MASK><NEW_LINE>messageLabel4.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));<NEW_LINE>messageLabel4.setText("To Generate Signed Enclave Now: Click OK");<NEW_LINE>final Label messageLabel5 = new Label(container3, SWT.NONE);<NEW_LINE>messageLabel5.setLayoutData(new GridData(GridData.CENTER, GridData.END, false, false, 3, 1));<NEW_LINE>messageLabel5.setText("To Generate Signed Enclave Later: Click Cancel");<NEW_LINE>}
Label(container3, SWT.NONE);
198,556
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {<NEW_LINE>PsiElement element = descriptor.getPsiElement();<NEW_LINE>if (!element.isValid() || !(element instanceof GoConstDefinition)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String name = ((GoConstDefinition) element).getName();<NEW_LINE>if (StringUtil.isEmpty(name)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GoType type = ((<MASK><NEW_LINE>GoExpression value = ((GoConstDefinition) element).getValue();<NEW_LINE>WriteCommandAction.runWriteCommandAction(project, () -> {<NEW_LINE>PsiElement parent = element.getParent();<NEW_LINE>PsiElement grandParent = parent != null ? parent.getParent() : null;<NEW_LINE>if (parent instanceof GoConstSpec && grandParent instanceof GoConstDeclaration) {<NEW_LINE>if (!parent.isValid() || ((GoConstSpec) parent).getConstDefinitionList().indexOf(element) <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String typeText = type != null ? type.getText() : "";<NEW_LINE>String valueText = value != null ? value.getText() : "";<NEW_LINE>((GoConstSpec) parent).deleteDefinition((GoConstDefinition) element);<NEW_LINE>if (grandParent.isValid()) {<NEW_LINE>((GoConstDeclaration) grandParent).addSpec(name, typeText, valueText, (GoConstSpec) parent);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.error("Cannot run quick fix", AttachmentFactory.createAttachment(element.getContainingFile().getVirtualFile()));<NEW_LINE>});<NEW_LINE>}
GoConstDefinition) element).findSiblingType();
83,650
public Map<String, String> parse(final char[] chars, int offset, int length, char separator) {<NEW_LINE>if (chars == null) {<NEW_LINE>return emptyMap();<NEW_LINE>}<NEW_LINE>Map<String, String> params = newMap();<NEW_LINE>this.chars = chars;<NEW_LINE>this.pos = offset;<NEW_LINE>this.len = length;<NEW_LINE>String paramName = null;<NEW_LINE>String paramValue = null;<NEW_LINE>while (hasChar()) {<NEW_LINE>paramName = parseToken(new char[] { '=', separator });<NEW_LINE>paramValue = null;<NEW_LINE>if (hasChar() && (chars[pos] == '=')) {<NEW_LINE>// skip '='<NEW_LINE>pos++;<NEW_LINE>paramValue = parseQuotedToken(<MASK><NEW_LINE>}<NEW_LINE>if (hasChar() && (chars[pos] == separator)) {<NEW_LINE>// skip separator<NEW_LINE>pos++;<NEW_LINE>}<NEW_LINE>if ((paramName != null) && (paramName.length() > 0)) {<NEW_LINE>if (this.lowerCaseNames) {<NEW_LINE>paramName = paramName.toLowerCase();<NEW_LINE>}<NEW_LINE>params.put(paramName, paramValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return params;<NEW_LINE>}
new char[] { separator });
1,655,396
public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>Dialog <MASK><NEW_LINE>res.requestWindowFeature(Window.FEATURE_NO_TITLE);<NEW_LINE>res.setCancelable(false);<NEW_LINE>hanldeOnboardingSteps();<NEW_LINE>mContentView = View.inflate(getActivity(), R.layout.fragment_welcome, null);<NEW_LINE>res.setContentView(mContentView);<NEW_LINE>mAcceptBtn = mContentView.findViewById(R.id.accept_btn);<NEW_LINE>mAcceptBtn.setOnClickListener(this);<NEW_LINE>mImage = mContentView.findViewById(R.id.iv__image);<NEW_LINE>mImage.setImageResource(R.drawable.img_welcome);<NEW_LINE>mTitle = mContentView.findViewById(R.id.tv__title);<NEW_LINE>List<String> headers = Arrays.asList(getString(R.string.new_onboarding_step1_header), getString(R.string.new_onboarding_step1_header_2));<NEW_LINE>String titleText = TextUtils.join(UiUtils.NEW_STRING_DELIMITER, headers);<NEW_LINE>mTitle.setText(titleText);<NEW_LINE>mSubtitle = mContentView.findViewById(R.id.tv__subtitle1);<NEW_LINE>mSubtitle.setText(R.string.sign_message_gdpr);<NEW_LINE>initUserAgreementViews();<NEW_LINE>bindWelcomeScreenType();<NEW_LINE>if (savedInstanceState == null)<NEW_LINE>trackStatisticEvent(Statistics.EventName.ONBOARDING_SCREEN_SHOW);<NEW_LINE>return res;<NEW_LINE>}
res = super.onCreateDialog(savedInstanceState);
1,409,923
private void applyToWST_XMLEditor(Theme theme, boolean revertToDefaults) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode("org.eclipse.wst.xml.ui");<NEW_LINE>setGeneralEditorValues(theme, prefs, revertToDefaults);<NEW_LINE>// FIXME These were adapted from our scopes for DTD, but those don't appear correct to me!<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "punctuation.definition.tag.xml", "tagBorder", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "entity.name.tag.xml", "tagName", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "entity.other.attribute-name.xml", "tagAttributeName", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "punctuation.separator.key-value.xml", "tagAttributeEquals", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "string.quoted.xml", "tagAttributeValue", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "text.xml", "xmlContent", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "comment.block.xml", "commentBorder", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "comment.block.xml", "commentText", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "constant.character.entity.xml", "entityReference", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "source.dtd", "doctypeName", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "keyword.operator.dtd", "doctypeExternalPubref", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "keyword.operator.dtd", "doctypeExtrenalSysref", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "keyword.operator.dtd", "doctypeExternalId", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "source.dtd", "declBorder", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, <MASK><NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "string.unquoted.cdata.xml", "cdataText", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "meta.tag.preprocessor.xml", "piBorder", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "meta.tag.preprocessor.xml", "piContent", revertToDefaults);<NEW_LINE>try {<NEW_LINE>prefs.flush();<NEW_LINE>} catch (BackingStoreException e) {<NEW_LINE>IdeLog.logError(ThemePlugin.getDefault(), e);<NEW_LINE>}<NEW_LINE>}
theme, "string.unquoted.cdata.xml", "cdataBorder", revertToDefaults);
876,144
public static WindowObjectInfo display(String p_title, Collection<Printable> p_object_list, BoardFrame p_board_frame, app.freerouting.board.CoordinateTransform p_coordinate_transform) {<NEW_LINE>WindowObjectInfo new_window <MASK><NEW_LINE>new_window.setTitle(p_title);<NEW_LINE>if (p_object_list.isEmpty()) {<NEW_LINE>new_window.append(new_window.resources.getString("list_empty"));<NEW_LINE>}<NEW_LINE>for (Printable curr_object : p_object_list) {<NEW_LINE>curr_object.print_info(new_window, p_board_frame.get_locale());<NEW_LINE>}<NEW_LINE>new_window.pack();<NEW_LINE>java.awt.Dimension size = new_window.getSize();<NEW_LINE>// make the window smaller, if its heicht gets bigger than MAX_WINDOW_HEIGHT<NEW_LINE>if (size.getHeight() > MAX_WINDOW_HEIGHT) {<NEW_LINE>new_window.setPreferredSize(new java.awt.Dimension((int) size.getWidth() + SCROLLBAR_ADD, MAX_WINDOW_HEIGHT));<NEW_LINE>new_window.pack();<NEW_LINE>}<NEW_LINE>new_window.setVisible(true);<NEW_LINE>return new_window;<NEW_LINE>}
= new WindowObjectInfo(p_board_frame, p_coordinate_transform);
86,637
public void onSendMessage(Participant participant, JsonObject message, Set<Participant> participants, String sessionId, String uniqueSessionId, Integer transactionId, OpenViduException error) {<NEW_LINE>boolean isRpcCall = transactionId != null;<NEW_LINE>if (isRpcCall) {<NEW_LINE>if (error != null) {<NEW_LINE>rpcNotificationService.sendErrorResponse(participant.getParticipantPrivateId(), transactionId, null, error);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String from = null;<NEW_LINE>String type = null;<NEW_LINE>String data = null;<NEW_LINE>JsonObject params = new JsonObject();<NEW_LINE>if (message.has("data")) {<NEW_LINE>data = message.get("data").getAsString();<NEW_LINE>params.addProperty(ProtocolElements.PARTICIPANTSENDMESSAGE_DATA_PARAM, data);<NEW_LINE>}<NEW_LINE>if (message.has("type")) {<NEW_LINE>type = message.get("type").getAsString();<NEW_LINE>params.addProperty(ProtocolElements.PARTICIPANTSENDMESSAGE_TYPE_PARAM, type);<NEW_LINE>}<NEW_LINE>if (participant != null) {<NEW_LINE>from = participant.getParticipantPublicId();<NEW_LINE>params.addProperty(ProtocolElements.PARTICIPANTSENDMESSAGE_FROM_PARAM, from);<NEW_LINE>}<NEW_LINE>Set<String> toSet <MASK><NEW_LINE>if (message.has("to")) {<NEW_LINE>JsonArray toJson = message.get("to").getAsJsonArray();<NEW_LINE>for (int i = 0; i < toJson.size(); i++) {<NEW_LINE>JsonElement el = toJson.get(i);<NEW_LINE>if (el.isJsonNull()) {<NEW_LINE>throw new OpenViduException(Code.SIGNAL_TO_INVALID_ERROR_CODE, "Signal \"to\" field invalid format: null");<NEW_LINE>}<NEW_LINE>toSet.add(el.getAsString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (toSet.isEmpty()) {<NEW_LINE>for (Participant p : participants) {<NEW_LINE>toSet.add(p.getParticipantPublicId());<NEW_LINE>rpcNotificationService.sendNotification(p.getParticipantPrivateId(), ProtocolElements.PARTICIPANTSENDMESSAGE_METHOD, params);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Set<String> participantPublicIds = participants.stream().map(Participant::getParticipantPublicId).collect(Collectors.toSet());<NEW_LINE>if (participantPublicIds.containsAll(toSet)) {<NEW_LINE>for (String to : toSet) {<NEW_LINE>Optional<Participant> p = participants.stream().filter(x -> to.equals(x.getParticipantPublicId())).findFirst();<NEW_LINE>rpcNotificationService.sendNotification(p.get().getParticipantPrivateId(), ProtocolElements.PARTICIPANTSENDMESSAGE_METHOD, params);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new OpenViduException(Code.SIGNAL_TO_INVALID_ERROR_CODE, "Signal \"to\" field invalid format: some connectionId does not exist in this session");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isRpcCall) {<NEW_LINE>rpcNotificationService.sendResponse(participant.getParticipantPrivateId(), transactionId, new JsonObject());<NEW_LINE>}<NEW_LINE>CDR.recordSignalSent(sessionId, uniqueSessionId, from, toSet.toArray(new String[toSet.size()]), type, data);<NEW_LINE>}
= new HashSet<String>();
1,508,818
public EnableVpcClassicLinkResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>EnableVpcClassicLinkResult enableVpcClassicLinkResult = new EnableVpcClassicLinkResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return enableVpcClassicLinkResult;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("return", targetDepth)) {<NEW_LINE>enableVpcClassicLinkResult.setReturn(BooleanStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return enableVpcClassicLinkResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
1,238,726
public static int askInput(String message, int timeout, int defaultValue, String... options) {<NEW_LINE>ConsoleInput con = ConsoleInput.get(1, timeout, TimeUnit.SECONDS);<NEW_LINE>if (con != null) {<NEW_LINE>StringBuilder msg = new StringBuilder(message + "\n\n");<NEW_LINE>for (int i = 0; i < options.length; i++) {<NEW_LINE>msg.append("(").append(i + 1).append(") ").append(options[<MASK><NEW_LINE>}<NEW_LINE>msg.append("(0) Cancel\n");<NEW_LINE>Util.infoMsg(msg.toString());<NEW_LINE>while (true) {<NEW_LINE>Util.infoMsg("Type in your choice and hit enter. Will automatically select option (" + defaultValue + ") after " + timeout + " seconds.");<NEW_LINE>String input = con.readLine();<NEW_LINE>if (input == null) {<NEW_LINE>Util.infoMsg("Timeout reached, selecting option (" + defaultValue + ")");<NEW_LINE>return defaultValue;<NEW_LINE>}<NEW_LINE>if (input.isEmpty()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>int result = Integer.parseInt(input);<NEW_LINE>if (result >= 0 && result <= options.length) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException ef) {<NEW_LINE>Util.errorMsg("Could not parse answer as a number. Canceling");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (!GraphicsEnvironment.isHeadless()) {<NEW_LINE>infoMsg("Please make your selection in the pop-up dialog.");<NEW_LINE>String defOpt = defaultValue > 0 ? options[defaultValue - 1] : "";<NEW_LINE>setupApplicationIcon();<NEW_LINE>Object selected = JOptionPane.showInputDialog(null, message, "Select your choice", JOptionPane.QUESTION_MESSAGE, getJbangIcon(), options, defOpt);<NEW_LINE>if (selected == null) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < options.length; i++) {<NEW_LINE>if (options[i] == selected) {<NEW_LINE>return i + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>errorMsg("No console and no graphical interface, we can't ask for feedback!");<NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>}
i]).append("\n");
1,396,308
private int rewriteExpressionOptionalQualifier(SwitchCase parent, StructuralPropertyDescriptor property, int startPos) {<NEW_LINE>RewriteEvent event = getEvent(parent, property);<NEW_LINE>if (event != null) {<NEW_LINE>switch(event.getChangeKind()) {<NEW_LINE>case RewriteEvent.INSERTED:<NEW_LINE>{<NEW_LINE>ASTNode node = (ASTNode) event.getNewValue();<NEW_LINE>TextEditGroup editGroup = getEditGroup(event);<NEW_LINE>doTextInsert(startPos, node, getIndent(startPos), true, editGroup);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>doTextInsert(startPos, ".", editGroup);<NEW_LINE>return startPos;<NEW_LINE>}<NEW_LINE>case RewriteEvent.REMOVED:<NEW_LINE>{<NEW_LINE>try {<NEW_LINE>ASTNode node = (ASTNode) event.getOriginalValue();<NEW_LINE>TextEditGroup editGroup = getEditGroup(event);<NEW_LINE>int dotEnd = getScanner().getTokenEndOffset(TerminalTokens.TokenNameCOLON, node.getStartPosition() + node.getLength());<NEW_LINE>doTextRemoveAndVisit(startPos, dotEnd - startPos, node, editGroup);<NEW_LINE>return dotEnd;<NEW_LINE>} catch (CoreException e) {<NEW_LINE>handleException(e);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case RewriteEvent.REPLACED:<NEW_LINE>{<NEW_LINE>ASTNode node = (ASTNode) event.getOriginalValue();<NEW_LINE>TextEditGroup editGroup = getEditGroup(event);<NEW_LINE>SourceRange range = getExtendedRange(node);<NEW_LINE>int offset = range.getStartPosition();<NEW_LINE>int length = range.getLength();<NEW_LINE>doTextRemoveAndVisit(offset, length, node, editGroup);<NEW_LINE>doTextInsert(offset, (ASTNode) event.getNewValue(), getIndent(startPos), true, editGroup);<NEW_LINE>try {<NEW_LINE>return getScanner().getTokenEndOffset(TerminalTokens.TokenNameCOLON, offset + length);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>handleException(e);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Object node = getOriginalValue(parent, property);<NEW_LINE>if (node == null) {<NEW_LINE>return startPos;<NEW_LINE>}<NEW_LINE>int pos <MASK><NEW_LINE>try {<NEW_LINE>return getScanner().getTokenEndOffset(TerminalTokens.TokenNameCOLON, pos);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>handleException(e);<NEW_LINE>}<NEW_LINE>return pos;<NEW_LINE>}
= doVisit((ASTNode) node);
918,564
public static ListOTAModuleVersionsByDeviceResponse unmarshall(ListOTAModuleVersionsByDeviceResponse listOTAModuleVersionsByDeviceResponse, UnmarshallerContext _ctx) {<NEW_LINE>listOTAModuleVersionsByDeviceResponse.setRequestId(_ctx.stringValue("ListOTAModuleVersionsByDeviceResponse.RequestId"));<NEW_LINE>listOTAModuleVersionsByDeviceResponse.setSuccess(_ctx.booleanValue("ListOTAModuleVersionsByDeviceResponse.Success"));<NEW_LINE>listOTAModuleVersionsByDeviceResponse.setCode(_ctx.stringValue("ListOTAModuleVersionsByDeviceResponse.Code"));<NEW_LINE>listOTAModuleVersionsByDeviceResponse.setErrorMessage(_ctx.stringValue("ListOTAModuleVersionsByDeviceResponse.ErrorMessage"));<NEW_LINE>listOTAModuleVersionsByDeviceResponse.setTotal(_ctx.integerValue("ListOTAModuleVersionsByDeviceResponse.Total"));<NEW_LINE>listOTAModuleVersionsByDeviceResponse.setPageSize(_ctx.integerValue("ListOTAModuleVersionsByDeviceResponse.PageSize"));<NEW_LINE>listOTAModuleVersionsByDeviceResponse.setPageCount(_ctx.integerValue("ListOTAModuleVersionsByDeviceResponse.PageCount"));<NEW_LINE>listOTAModuleVersionsByDeviceResponse.setCurrentPage(_ctx.integerValue("ListOTAModuleVersionsByDeviceResponse.CurrentPage"));<NEW_LINE>List<SimpleOTAModuleInfo> data = new ArrayList<SimpleOTAModuleInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListOTAModuleVersionsByDeviceResponse.Data.Length"); i++) {<NEW_LINE>SimpleOTAModuleInfo simpleOTAModuleInfo = new SimpleOTAModuleInfo();<NEW_LINE>simpleOTAModuleInfo.setProductKey(_ctx.stringValue<MASK><NEW_LINE>simpleOTAModuleInfo.setDeviceName(_ctx.stringValue("ListOTAModuleVersionsByDeviceResponse.Data[" + i + "].DeviceName"));<NEW_LINE>simpleOTAModuleInfo.setIotId(_ctx.stringValue("ListOTAModuleVersionsByDeviceResponse.Data[" + i + "].IotId"));<NEW_LINE>simpleOTAModuleInfo.setModuleVersion(_ctx.stringValue("ListOTAModuleVersionsByDeviceResponse.Data[" + i + "].ModuleVersion"));<NEW_LINE>simpleOTAModuleInfo.setModuleName(_ctx.stringValue("ListOTAModuleVersionsByDeviceResponse.Data[" + i + "].ModuleName"));<NEW_LINE>data.add(simpleOTAModuleInfo);<NEW_LINE>}<NEW_LINE>listOTAModuleVersionsByDeviceResponse.setData(data);<NEW_LINE>return listOTAModuleVersionsByDeviceResponse;<NEW_LINE>}
("ListOTAModuleVersionsByDeviceResponse.Data[" + i + "].ProductKey"));
1,453,979
void showHideControlButtons() {<NEW_LINE>Component tabComponent = null;<NEW_LINE>boolean tcSlidingEnabled = true;<NEW_LINE>boolean tcClosingEnabled = true;<NEW_LINE>int selIndex = Math.max(0, displayer.getSelectionModel().getSelectedIndex());<NEW_LINE>if (selIndex >= 0 && selIndex < displayer.getModel().size()) {<NEW_LINE>TabData tab = displayer.getModel().getTab(selIndex);<NEW_LINE>tabComponent = tab.getComponent();<NEW_LINE>if (tabComponent instanceof TopComponent) {<NEW_LINE>tcSlidingEnabled = displayer.getContainerWinsysInfo()<MASK><NEW_LINE>tcClosingEnabled = displayer.getContainerWinsysInfo().isTopComponentClosingEnabled((TopComponent) tabComponent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>btnAutoHidePin.setVisible(tabComponent != null && !TabDisplayer.ORIENTATION_INVISIBLE.equals(displayer.getContainerWinsysInfo().getOrientation(tabComponent)) && displayer.getContainerWinsysInfo().isTopComponentSlidingEnabled() && tcSlidingEnabled);<NEW_LINE>if (null != btnClose) {<NEW_LINE>btnClose.setVisible(tabComponent != null && tcClosingEnabled);<NEW_LINE>}<NEW_LINE>}
.isTopComponentSlidingEnabled((TopComponent) tabComponent);
1,339,033
public void open(Configuration parameters) throws Exception {<NEW_LINE>List<Row> bc = getRuntimeContext().getBroadcastVariable("allLabels");<NEW_LINE>Integer[] order = new Integer[bc.size()];<NEW_LINE>for (int i = 0; i < order.length; i++) {<NEW_LINE>order[i] = i;<NEW_LINE>}<NEW_LINE>Arrays.sort(order, new Comparator<Integer>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Integer o1, Integer o2) {<NEW_LINE>Comparable v1 = (Comparable) bc.get(o1).getField(0);<NEW_LINE>Comparable v2 = (Comparable) bc.get<MASK><NEW_LINE>return v1.compareTo(v2);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (iLabel >= bc.size()) {<NEW_LINE>throw new RuntimeException("the specified numClasses is larger than the number of distinct labels.: " + String.format("iLabel = %d, num lables = %d", iLabel, bc.size()));<NEW_LINE>}<NEW_LINE>this.label = bc.get(order[iLabel]).getField(0);<NEW_LINE>}
(o2).getField(0);
1,304,314
public void insertPushEquals(int opcode, JumpInsnNode position, InsnList list) {<NEW_LINE>MethodInsnNode equalCheck = new MethodInsnNode(Opcodes.INVOKESTATIC, Type.getInternalName(BooleanHelper.class), "isEqual", Type.getMethodDescriptor(Type.INT_TYPE, Type.getType(Object.class), Type.getType(Object.class), Type.INT_TYPE), false);<NEW_LINE>list.insertBefore(position, new InsnNode(Opcodes.DUP2));<NEW_LINE>list.insertBefore(position, new LdcInsnNode(opcode));<NEW_LINE>list.insertBefore(position, equalCheck);<NEW_LINE>// list.insertBefore(position,<NEW_LINE>// new LdcInsnNode(getBranchID(currentMethodNode, position)));<NEW_LINE>insertBranchIdPlaceholder(currentMethodNode, position);<NEW_LINE>MethodInsnNode push = new MethodInsnNode(Opcodes.INVOKESTATIC, Type.getInternalName(BooleanHelper.class), "pushPredicate", Type.getMethodDescriptor(Type.VOID_TYPE, Type.INT_TYPE<MASK><NEW_LINE>list.insertBefore(position, push);<NEW_LINE>}
, Type.INT_TYPE), false);
1,462,026
default void emitValue(@Nullable T value, Sinks.EmitFailureHandler failureHandler) {<NEW_LINE>if (value == null) {<NEW_LINE>emitEmpty(failureHandler);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (; ; ) {<NEW_LINE>Sinks.EmitResult emitResult = tryEmitValue(value);<NEW_LINE>if (emitResult.isSuccess()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean shouldRetry = failureHandler.<MASK><NEW_LINE>if (shouldRetry) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>switch(emitResult) {<NEW_LINE>case FAIL_ZERO_SUBSCRIBER:<NEW_LINE>// we want to "discard" without rendering the sink terminated.<NEW_LINE>// effectively NO-OP cause there's no subscriber, so no context :(<NEW_LINE>return;<NEW_LINE>case FAIL_OVERFLOW:<NEW_LINE>Operators.onDiscard(value, currentContext());<NEW_LINE>// the emitError will onErrorDropped if already terminated<NEW_LINE>emitError(Exceptions.failWithOverflow("Backpressure overflow during Sinks.One#emitValue"), failureHandler);<NEW_LINE>return;<NEW_LINE>case FAIL_CANCELLED:<NEW_LINE>Operators.onDiscard(value, currentContext());<NEW_LINE>return;<NEW_LINE>case FAIL_TERMINATED:<NEW_LINE>Operators.onNextDropped(value, currentContext());<NEW_LINE>return;<NEW_LINE>case FAIL_NON_SERIALIZED:<NEW_LINE>throw new EmissionException(emitResult, "Spec. Rule 1.3 - onSubscribe, onNext, onError and onComplete signaled to a Subscriber MUST be signaled serially.");<NEW_LINE>default:<NEW_LINE>throw new EmissionException(emitResult, "Unknown emitResult value");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
onEmitFailure(SignalType.ON_NEXT, emitResult);
1,718,256
public ProcessStatus restWriteSetting(final PwmRequest pwmRequest) throws PwmUnrecoverableException, IOException {<NEW_LINE>final String profileID = "default";<NEW_LINE>final String settingKey = pwmRequest.readParameterAsString("key");<NEW_LINE>final String bodyString = pwmRequest.readRequestBodyAsString();<NEW_LINE>final PwmSetting pwmSetting = PwmSetting.forKey(settingKey).orElseThrow(() -> new IllegalStateException("invalid setting parameter value"));<NEW_LINE>final ConfigGuideBean configGuideBean = getBean(pwmRequest);<NEW_LINE>final StoredConfiguration storedConfiguration = ConfigGuideForm.generateStoredConfig(configGuideBean);<NEW_LINE>final StoredConfigKey key = StoredConfigKey.forSetting(<MASK><NEW_LINE>final LinkedHashMap<String, Object> returnMap = new LinkedHashMap<>();<NEW_LINE>try {<NEW_LINE>final StoredValue storedValue = ValueFactory.fromJson(pwmSetting, bodyString);<NEW_LINE>final List<String> errorMsgs = storedValue.validateValue(pwmSetting);<NEW_LINE>if (errorMsgs != null && !errorMsgs.isEmpty()) {<NEW_LINE>returnMap.put("errorMessage", pwmSetting.getLabel(pwmRequest.getLocale()) + ": " + errorMsgs.get(0));<NEW_LINE>}<NEW_LINE>if (pwmSetting == PwmSetting.CHALLENGE_RANDOM_CHALLENGES) {<NEW_LINE>configGuideBean.getFormData().put(ConfigGuideFormField.CHALLENGE_RESPONSE_DATA, JsonFactory.get().serialize((Serializable) storedValue.toNativeObject()));<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>final String errorMsg = "error writing default value for setting " + pwmSetting + ", error: " + e.getMessage();<NEW_LINE>LOGGER.error(() -> errorMsg, e);<NEW_LINE>throw new IllegalStateException(errorMsg, e);<NEW_LINE>}<NEW_LINE>returnMap.put("key", settingKey);<NEW_LINE>returnMap.put("category", pwmSetting.getCategory().toString());<NEW_LINE>returnMap.put("syntax", pwmSetting.getSyntax().toString());<NEW_LINE>returnMap.put("isDefault", StoredConfigurationUtil.isDefaultValue(storedConfiguration, key));<NEW_LINE>pwmRequest.outputJsonResult(RestResultBean.withData(returnMap, Map.class));<NEW_LINE>return ProcessStatus.Halt;<NEW_LINE>}
pwmSetting, profileID, DomainID.DOMAIN_ID_DEFAULT);
1,535,554
protected ClusterState.Builder becomeMasterAndTrimConflictingNodes(ClusterState currentState, List<Task> joiningNodes) {<NEW_LINE>assert currentState.nodes().getMasterNodeId() == null : currentState;<NEW_LINE>DiscoveryNodes currentNodes = currentState.nodes();<NEW_LINE>DiscoveryNodes.Builder nodesBuilder = DiscoveryNodes.builder(currentNodes);<NEW_LINE>nodesBuilder.masterNodeId(currentState.<MASK><NEW_LINE>for (final Task joinTask : joiningNodes) {<NEW_LINE>if (joinTask.isBecomeMasterTask() || joinTask.isFinishElectionTask()) {<NEW_LINE>// noop<NEW_LINE>} else {<NEW_LINE>final DiscoveryNode joiningNode = joinTask.node();<NEW_LINE>final DiscoveryNode nodeWithSameId = nodesBuilder.get(joiningNode.getId());<NEW_LINE>if (nodeWithSameId != null && nodeWithSameId.equals(joiningNode) == false) {<NEW_LINE>logger.debug("removing existing node [{}], which conflicts with incoming join from [{}]", nodeWithSameId, joiningNode);<NEW_LINE>nodesBuilder.remove(nodeWithSameId.getId());<NEW_LINE>}<NEW_LINE>final DiscoveryNode nodeWithSameAddress = currentNodes.findByAddress(joiningNode.getAddress());<NEW_LINE>if (nodeWithSameAddress != null && nodeWithSameAddress.equals(joiningNode) == false) {<NEW_LINE>logger.debug("removing existing node [{}], which conflicts with incoming join from [{}]", nodeWithSameAddress, joiningNode);<NEW_LINE>nodesBuilder.remove(nodeWithSameAddress.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now trim any left over dead nodes - either left there when the previous master stepped down<NEW_LINE>// or removed by us above<NEW_LINE>ClusterState tmpState = ClusterState.builder(currentState).nodes(nodesBuilder).blocks(ClusterBlocks.builder().blocks(currentState.blocks()).removeGlobalBlock(NoMasterBlockService.NO_MASTER_BLOCK_ID)).build();<NEW_LINE>logger.trace("becomeMasterAndTrimConflictingNodes: {}", tmpState.nodes());<NEW_LINE>allocationService.cleanCaches();<NEW_LINE>return ClusterState.builder(allocationService.disassociateDeadNodes(tmpState, false, "removed dead nodes on election"));<NEW_LINE>}
nodes().getLocalNodeId());
35,610
public void mouseDown(MouseEvent e) {<NEW_LINE>double x = xyGraph.primaryXAxis.getPositionValue(e.x, false);<NEW_LINE>double y = xyGraph.primaryYAxis.getPositionValue(e.y, false);<NEW_LINE>if (x < 0 || y < 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>double minDistance = 30.0d;<NEW_LINE>long time = 0;<NEW_LINE>double value = 0;<NEW_LINE>for (Trace t : traces) {<NEW_LINE>ISample s = ScouterUtil.getNearestPoint(t.getDataProvider(), x);<NEW_LINE>if (s != null) {<NEW_LINE>int x2 = xyGraph.primaryXAxis.getValuePosition(s.getXValue(), false);<NEW_LINE>int y2 = xyGraph.primaryYAxis.getValuePosition(s.getYValue(), false);<NEW_LINE>double distance = ScouterUtil.getPointDistance(e.x, e.y, x2, y2);<NEW_LINE>if (minDistance > distance) {<NEW_LINE>minDistance = distance;<NEW_LINE>nearestTrace = t;<NEW_LINE>time = (long) s.getXValue();<NEW_LINE>value = s.getYValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (nearestTrace != null) {<NEW_LINE>int width = PManager.getInstance(<MASK><NEW_LINE>nearestTrace.setLineWidth(width + 2);<NEW_LINE>toolTip.setText(nearestTrace.getName() + "\nTime : " + DateUtil.format(time, "HH:mm") + "\nValue : " + FormatUtil.print(value, "#,###.##"));<NEW_LINE>toolTip.show(new Point(e.x, e.y));<NEW_LINE>}<NEW_LINE>}
).getInt(PreferenceConstants.P_CHART_LINE_WIDTH);
1,302,640
public static DescribeLiveRealtimeDeliveryAccResponse unmarshall(DescribeLiveRealtimeDeliveryAccResponse describeLiveRealtimeDeliveryAccResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLiveRealtimeDeliveryAccResponse.setRequestId<MASK><NEW_LINE>List<AccData> realTimeDeliveryAccData = new ArrayList<AccData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLiveRealtimeDeliveryAccResponse.RealTimeDeliveryAccData.Length"); i++) {<NEW_LINE>AccData accData = new AccData();<NEW_LINE>accData.setTimeStamp(_ctx.stringValue("DescribeLiveRealtimeDeliveryAccResponse.RealTimeDeliveryAccData[" + i + "].TimeStamp"));<NEW_LINE>accData.setFailedNum(_ctx.integerValue("DescribeLiveRealtimeDeliveryAccResponse.RealTimeDeliveryAccData[" + i + "].FailedNum"));<NEW_LINE>accData.setSuccessNum(_ctx.integerValue("DescribeLiveRealtimeDeliveryAccResponse.RealTimeDeliveryAccData[" + i + "].SuccessNum"));<NEW_LINE>realTimeDeliveryAccData.add(accData);<NEW_LINE>}<NEW_LINE>describeLiveRealtimeDeliveryAccResponse.setRealTimeDeliveryAccData(realTimeDeliveryAccData);<NEW_LINE>return describeLiveRealtimeDeliveryAccResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeLiveRealtimeDeliveryAccResponse.RequestId"));
933,217
IRubyObject selectEnd(ThreadContext context) throws IOException {<NEW_LINE>if (selectors != null) {<NEW_LINE>for (int i = 0; i < selectors.size(); i++) {<NEW_LINE>Selector <MASK><NEW_LINE>// if it is a JDK selector, cache it<NEW_LINE>if (selector.provider() == SelectorProvider.provider()) {<NEW_LINE>// return to pool<NEW_LINE>context.runtime.getSelectorPool().put(selector);<NEW_LINE>} else {<NEW_LINE>selector.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO: pool ENXIOSelector impls<NEW_LINE>for (ENXIOSelector enxioSelector : enxioSelectors) {<NEW_LINE>enxioSelector.cleanup();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO: reset blocking status<NEW_LINE>// if (readBlocking != null) {<NEW_LINE>// for (int i = 0; i < readBlocking.length; i++) {<NEW_LINE>// if (readBlocking[i] != null) {<NEW_LINE>// try {<NEW_LINE>// ((SelectableChannel) readIOs[i].getChannel()).configureBlocking(readBlocking[i]);<NEW_LINE>// } catch (IllegalBlockingModeException ibme) {<NEW_LINE>// throw runtime.newConcurrencyError("can not set IO blocking after select; concurrent select detected?");<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// if (writeBlocking != null) {<NEW_LINE>// for (int i = 0; i < writeBlocking.length; i++) {<NEW_LINE>// if (writeBlocking[i] != null) {<NEW_LINE>// try {<NEW_LINE>// ((SelectableChannel) writeIOs[i].getChannel()).configureBlocking(writeBlocking[i]);<NEW_LINE>// } catch (IllegalBlockingModeException ibme) {<NEW_LINE>// throw runtime.newConcurrencyError("can not set IO blocking after select; concurrent select detected?");<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>return context.nil;<NEW_LINE>}
selector = selectors.get(i);
1,286,557
private void initializeActiveRegionEvaluationGenotyperEngine() {<NEW_LINE>final StandardCallerArgumentCollection activeRegionArgs = new StandardCallerArgumentCollection();<NEW_LINE><MASK><NEW_LINE>activeRegionArgs.outputMode = OutputMode.EMIT_VARIANTS_ONLY;<NEW_LINE>// low values used for isActive determination only, default/user-specified values used for actual calling<NEW_LINE>activeRegionArgs.genotypeArgs.standardConfidenceForCalling = Math.min(MAXMIN_CONFIDENCE_FOR_CONSIDERING_A_SITE_AS_POSSIBLE_VARIANT_IN_ACTIVE_REGION_DISCOVERY, hcArgs.standardArgs.genotypeArgs.standardConfidenceForCalling);<NEW_LINE>activeRegionArgs.CONTAMINATION_FRACTION = 0.0;<NEW_LINE>activeRegionArgs.CONTAMINATION_FRACTION_FILE = null;<NEW_LINE>// Seems that at least with some test data we can lose genuine haploid variation if we use ploidy == 1<NEW_LINE>activeRegionArgs.genotypeArgs.samplePloidy = Math.max(MINIMUM_PUTATIVE_PLOIDY_FOR_ACTIVE_REGION_DISCOVERY, hcArgs.standardArgs.genotypeArgs.samplePloidy);<NEW_LINE>activeRegionEvaluationGenotyperEngine = new MinimalGenotypingEngine(activeRegionArgs, samplesList);<NEW_LINE>activeRegionEvaluationGenotyperEngine.setLogger(logger);<NEW_LINE>}
activeRegionArgs.copyStandardCallerArgsFrom(hcArgs.standardArgs);
1,704,950
public static boolean showCustomizer() {<NEW_LINE>JSTestDriverCustomizerPanel panel = new JSTestDriverCustomizerPanel();<NEW_LINE>DialogDescriptor descriptor = new DialogDescriptor(panel, org.openide.util.NbBundle.getMessage(JSTestDriverCustomizerPanel.class, "MSG_CONFIGURE"));<NEW_LINE>panel.setDescriptor(descriptor);<NEW_LINE>Dialog dialog = DialogDisplayer.getDefault().createDialog(descriptor);<NEW_LINE>dialog.setModal(true);<NEW_LINE>dialog.setVisible(true);<NEW_LINE>dialog.dispose();<NEW_LINE>if (descriptor.getValue() == DialogDescriptor.OK_OPTION) {<NEW_LINE>if (JSTestDriverSupport.getDefault().isRunning() && JSTestDriverSupport.getDefault().wasStartedExternally()) {<NEW_LINE>// forget current server:<NEW_LINE>JSTestDriverSupport.getDefault().forgetCurrentServer();<NEW_LINE>}<NEW_LINE>Preferences prefs = <MASK><NEW_LINE>prefs.put(LOCATION, panel.jLocationTextField.getText());<NEW_LINE>prefs.put(SERVER_URL, panel.jServerURLTextField.getText());<NEW_LINE>prefs.putBoolean(STRICT_MODE, panel.jStrictCheckBox.isSelected());<NEW_LINE>boolean usesIntegratedBrowser = false;<NEW_LINE>for (TableRow row : ((BrowsersTableModel) panel.jBrowsersTable.getModel()).model) {<NEW_LINE>prefs.putBoolean(getBrowserPropertyName(row.getBrowser()), row.isSelected());<NEW_LINE>if (row.isSelected() && row.hasNbIntegration()) {<NEW_LINE>usesIntegratedBrowser = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean externalServer = (getPort(panel.jServerURLTextField.getText()) == -1);<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>JSTestDriverSupport.// NOI18N<NEW_LINE>logUsage(// NOI18N<NEW_LINE>JSTestDriverCustomizerPanel.class, // NOI18N<NEW_LINE>"USG_JSTESTDRIVER_CONFIGURED", new Object[] { externalServer ? "YES" : "NO", usesIntegratedBrowser ? "YES" : "NO" });<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
NbPreferences.forModule(JSTestDriverCustomizerPanel.class);
939,052
public void scrollTo(float x, float y, float width, float height, boolean centerHorizontal, boolean centerVertical) {<NEW_LINE>validate();<NEW_LINE>float amountX = this.amountX;<NEW_LINE>if (centerHorizontal) {<NEW_LINE>amountX = x - widgetArea.width / 2 + width / 2;<NEW_LINE>} else {<NEW_LINE>if (x + width > amountX + widgetArea.width)<NEW_LINE>amountX = x + width - widgetArea.width;<NEW_LINE>if (x < amountX)<NEW_LINE>amountX = x;<NEW_LINE>}<NEW_LINE>scrollX(MathUtils.clamp(amountX, 0, maxX));<NEW_LINE>float amountY = this.amountY;<NEW_LINE>if (centerVertical) {<NEW_LINE>amountY = maxY - y + widgetArea<MASK><NEW_LINE>} else {<NEW_LINE>if (amountY > maxY - y - height + widgetArea.height)<NEW_LINE>amountY = maxY - y - height + widgetArea.height;<NEW_LINE>if (amountY < maxY - y)<NEW_LINE>amountY = maxY - y;<NEW_LINE>}<NEW_LINE>scrollY(MathUtils.clamp(amountY, 0, maxY));<NEW_LINE>}
.height / 2 - height / 2;
70,381
public NetworkOfferingResponse newNetworkOfferingResponse(NetworkOffering offering) {<NEW_LINE>NetworkOfferingResponse networkOfferingResponse = new NetworkOfferingResponse();<NEW_LINE>networkOfferingResponse.setId(offering.getUuid());<NEW_LINE>networkOfferingResponse.setName(offering.getName());<NEW_LINE>networkOfferingResponse.setDisplayText(offering.getDisplayText());<NEW_LINE>networkOfferingResponse.<MASK><NEW_LINE>networkOfferingResponse.setTrafficType(offering.getTrafficType().toString());<NEW_LINE>networkOfferingResponse.setIsDefault(offering.isDefault());<NEW_LINE>networkOfferingResponse.setSpecifyVlan(offering.isSpecifyVlan());<NEW_LINE>networkOfferingResponse.setConserveMode(offering.isConserveMode());<NEW_LINE>networkOfferingResponse.setSpecifyIpRanges(offering.isSpecifyIpRanges());<NEW_LINE>networkOfferingResponse.setAvailability(offering.getAvailability().toString());<NEW_LINE>networkOfferingResponse.setIsPersistent(offering.isPersistent());<NEW_LINE>networkOfferingResponse.setEgressDefaultPolicy(offering.isEgressDefaultPolicy());<NEW_LINE>networkOfferingResponse.setConcurrentConnections(offering.getConcurrentConnections());<NEW_LINE>networkOfferingResponse.setSupportsStrechedL2Subnet(offering.isSupportingStrechedL2());<NEW_LINE>networkOfferingResponse.setSupportsPublicAccess(offering.isSupportingPublicAccess());<NEW_LINE>networkOfferingResponse.setCreated(offering.getCreated());<NEW_LINE>if (offering.getGuestType() != null) {<NEW_LINE>networkOfferingResponse.setGuestIpType(offering.getGuestType().toString());<NEW_LINE>}<NEW_LINE>networkOfferingResponse.setState(offering.getState().name());<NEW_LINE>if (offering instanceof NetworkOfferingJoinVO) {<NEW_LINE>networkOfferingResponse.setDomainId(((NetworkOfferingJoinVO) offering).getDomainUuid());<NEW_LINE>networkOfferingResponse.setDomain(((NetworkOfferingJoinVO) offering).getDomainPath());<NEW_LINE>networkOfferingResponse.setZoneId(((NetworkOfferingJoinVO) offering).getZoneUuid());<NEW_LINE>networkOfferingResponse.setZone(((NetworkOfferingJoinVO) offering).getZoneName());<NEW_LINE>}<NEW_LINE>networkOfferingResponse.setObjectName("networkoffering");<NEW_LINE>return networkOfferingResponse;<NEW_LINE>}
setTags(offering.getTags());
1,751,369
// Builds an ordered map of timezones sorted first by the timezone offset (keys of the TreeMap) and then<NEW_LINE>// alphabetically the timezones in that specific offset. Iterating over the map and keys maintains that order<NEW_LINE>@SuppressForbidden("Intentionally use system default timezone")<NEW_LINE>private static Map<Integer, List<DateTimeZone>> buildSortedTimeZoneMap() {<NEW_LINE>// get a sorted list of DateTimeZones based on their IDs<NEW_LINE>List<DateTimeZone> dtzList = DateTimeZone.getAvailableIDs().stream().map(DateTimeZone::forID).sorted(Comparator.comparing(DateTimeZone::getID, String.CASE_INSENSITIVE_ORDER)).collect(Collectors.toList());<NEW_LINE>// iterate over the sorted list and group each DateTimeZone by offset<NEW_LINE>// TreeMap is an implementation of an OrderedMap where keys are ordered<NEW_LINE>Map<Integer, List<DateTimeZone>> offsetsAndTimezones = new TreeMap<>();<NEW_LINE>Instant now = new DateTime(DateTimeZone.<MASK><NEW_LINE>for (DateTimeZone dtz : dtzList) {<NEW_LINE>int rawOffset = dtz.getOffset(now);<NEW_LINE>List<DateTimeZone> timezonesForOffset = offsetsAndTimezones.getOrDefault(rawOffset, new ArrayList<>());<NEW_LINE>timezonesForOffset.add(dtz);<NEW_LINE>offsetsAndTimezones.put(rawOffset, timezonesForOffset);<NEW_LINE>}<NEW_LINE>return offsetsAndTimezones;<NEW_LINE>}
getDefault()).toInstant();
1,467,606
private GenerateXcodeWorkspaceFileTask createWorkspaceTask(Project project, DefaultXcodeWorkspace workspace) {<NEW_LINE>File xcodeWorkspacePackageDir = project.file(project.getName() + ".xcworkspace");<NEW_LINE>workspace.getLocation().set(xcodeWorkspacePackageDir);<NEW_LINE>GenerateWorkspaceSettingsFileTask workspaceSettingsFileTask = project.getTasks().create("xcodeWorkspaceWorkspaceSettings", GenerateWorkspaceSettingsFileTask.class);<NEW_LINE>workspaceSettingsFileTask.setOutputFile(new File(xcodeWorkspacePackageDir, "xcshareddata/WorkspaceSettings.xcsettings"));<NEW_LINE>GenerateXcodeWorkspaceFileTask workspaceFileTask = project.getTasks().<MASK><NEW_LINE>workspaceFileTask.dependsOn(workspaceSettingsFileTask);<NEW_LINE>workspaceFileTask.setOutputFile(new File(xcodeWorkspacePackageDir, "contents.xcworkspacedata"));<NEW_LINE>workspaceFileTask.setXcodeProjectLocations(artifactRegistry.getIdeProjectFiles(XcodeProjectMetadata.class));<NEW_LINE>return workspaceFileTask;<NEW_LINE>}
create("xcodeWorkspace", GenerateXcodeWorkspaceFileTask.class);
221,199
public void executeWriteAction(Editor editor, Caret caret, DataContext dataContext) {<NEW_LINE>final Document doc = editor.getDocument();<NEW_LINE>LogicalPosition caretPosition = caret.getLogicalPosition();<NEW_LINE>int startLine = caretPosition.line;<NEW_LINE>int endLine = startLine + 1;<NEW_LINE>if (caret.hasSelection()) {<NEW_LINE>startLine = doc.getLineNumber(caret.getSelectionStart());<NEW_LINE>endLine = doc.getLineNumber(caret.getSelectionEnd());<NEW_LINE>if (doc.getLineStartOffset(endLine) == caret.getSelectionEnd())<NEW_LINE>endLine--;<NEW_LINE>}<NEW_LINE>int[] caretRestoreOffset = new int[] { -1 };<NEW_LINE>int lineCount = endLine - startLine;<NEW_LINE>final int line = startLine;<NEW_LINE>DocumentUtil.executeInBulk(doc, lineCount > 1000, () -> {<NEW_LINE>for (int i = 0; i < lineCount; i++) {<NEW_LINE>if (line >= doc.getLineCount() - 1)<NEW_LINE>break;<NEW_LINE>CharSequence text = doc.getCharsSequence();<NEW_LINE>int end = doc.getLineEndOffset(line) + doc.getLineSeparatorLength(line);<NEW_LINE>int start = end - doc.getLineSeparatorLength(line);<NEW_LINE>while (start > 0 && (text.charAt(start) == ' ' || text.charAt(start) == '\t')) start--;<NEW_LINE>if (caretRestoreOffset[0] == -1)<NEW_LINE>caretRestoreOffset[0] = start + 1;<NEW_LINE>while (end < doc.getTextLength() && (text.charAt(end) == ' ' || text.charAt(end) == '\t')) end++;<NEW_LINE>doc.replaceString(start, end, " ");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (caret.hasSelection()) {<NEW_LINE>caret.moveToOffset(caret.getSelectionEnd());<NEW_LINE>} else {<NEW_LINE>if (caretRestoreOffset[0] != -1) {<NEW_LINE>caret.moveToOffset(caretRestoreOffset[0]);<NEW_LINE>editor.getScrollingModel(<MASK><NEW_LINE>caret.removeSelection();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).scrollToCaret(ScrollType.RELATIVE);
204,786
/* Build call for throttlingPoliciesAdvancedPolicyIdPut */<NEW_LINE>private com.squareup.okhttp.Call throttlingPoliciesAdvancedPolicyIdPutCall(String policyId, AdvancedThrottlePolicy body, String contentType, String ifMatch, String ifUnmodifiedSince, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/throttling/policies/advanced/{policyId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "policyId" + "\\}", apiClient.escapeString(policyId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>if (contentType != null)<NEW_LINE>localVarHeaderParams.put("Content-Type", apiClient.parameterToString(contentType));<NEW_LINE>if (ifMatch != null)<NEW_LINE>localVarHeaderParams.put("If-Match", apiClient.parameterToString(ifMatch));<NEW_LINE>if (ifUnmodifiedSince != null)<NEW_LINE>localVarHeaderParams.put("If-Unmodified-Since", apiClient.parameterToString(ifUnmodifiedSince));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>}
HashMap<String, String>();
1,848,425
public void timeLimitedExport(Collection<SpanData> spanDataList) throws Exception {<NEW_LINE>List<String> jsonList = JsonConversionUtils.convertToJson(appName, spanDataList);<NEW_LINE>if (jsonList.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (String json : jsonList) {<NEW_LINE>OutputStream outputStream = null;<NEW_LINE>InputStream inputStream = null;<NEW_LINE>try {<NEW_LINE>HttpURLConnection connection = (HttpURLConnection) indexUrl.openConnection();<NEW_LINE>if (elasticsearchTraceConfiguration.getUserName() != null) {<NEW_LINE>String parameters = BaseEncoding.base64().encode((elasticsearchTraceConfiguration.getUserName() + ":" + elasticsearchTraceConfiguration.getPassword()).getBytes("UTF-8"));<NEW_LINE>connection.setRequestProperty("Authorization", "Basic " + parameters);<NEW_LINE>}<NEW_LINE>connection.setRequestMethod(REQUEST_METHOD);<NEW_LINE>connection.setDoOutput(true);<NEW_LINE>connection.setConnectTimeout(CONNECTION_TIMEOUT_MILLISECONDS);<NEW_LINE>connection.setRequestProperty("Content-Type", CONTENT_TYPE);<NEW_LINE>outputStream = connection.getOutputStream();<NEW_LINE>outputStream.write(json.getBytes<MASK><NEW_LINE>outputStream.flush();<NEW_LINE>inputStream = connection.getInputStream();<NEW_LINE>if (connection.getResponseCode() != 200) {<NEW_LINE>throw new Exception("Response " + connection.getResponseCode());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>closeStream(inputStream);<NEW_LINE>closeStream(outputStream);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(Charset.defaultCharset()));
637,761
public HistoricCaseInstanceResponse createHistoricCaseInstanceResponse(HistoricCaseInstance caseInstance, RestUrlBuilder urlBuilder) {<NEW_LINE>HistoricCaseInstanceResponse result = new HistoricCaseInstanceResponse();<NEW_LINE>result.<MASK><NEW_LINE>result.setBusinessStatus(caseInstance.getBusinessStatus());<NEW_LINE>result.setName(caseInstance.getName());<NEW_LINE>result.setEndTime(caseInstance.getEndTime());<NEW_LINE>result.setId(caseInstance.getId());<NEW_LINE>result.setCaseDefinitionId(caseInstance.getCaseDefinitionId());<NEW_LINE>result.setCaseDefinitionUrl(urlBuilder.buildUrl(CmmnRestUrls.URL_CASE_DEFINITION, caseInstance.getCaseDefinitionId()));<NEW_LINE>result.setStartTime(caseInstance.getStartTime());<NEW_LINE>result.setStartUserId(caseInstance.getStartUserId());<NEW_LINE>result.setUrl(urlBuilder.buildUrl(CmmnRestUrls.URL_HISTORIC_CASE_INSTANCE, caseInstance.getId()));<NEW_LINE>if (caseInstance.getCaseVariables() != null) {<NEW_LINE>Map<String, Object> variableMap = caseInstance.getCaseVariables();<NEW_LINE>for (String name : variableMap.keySet()) {<NEW_LINE>result.addVariable(createRestVariable(name, variableMap.get(name), RestVariableScope.LOCAL, caseInstance.getId(), VARIABLE_HISTORY_CASE, false, urlBuilder));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.setTenantId(caseInstance.getTenantId());<NEW_LINE>result.setState(caseInstance.getState());<NEW_LINE>result.setReferenceId(caseInstance.getReferenceId());<NEW_LINE>result.setReferenceType(caseInstance.getReferenceType());<NEW_LINE>result.setCallbackId(caseInstance.getCallbackId());<NEW_LINE>result.setCallbackType(caseInstance.getCallbackType());<NEW_LINE>return result;<NEW_LINE>}
setBusinessKey(caseInstance.getBusinessKey());
909,005
public RunState startTracking(IProgressMonitor monitor) throws Exception, OperationCanceledException {<NEW_LINE>// fetch an updated Cloud Application that reflects changes that<NEW_LINE>// were<NEW_LINE>// performed on it. Make sure the element element reference is updated<NEW_LINE>// as<NEW_LINE>// run state of the element depends on the element being up to date.<NEW_LINE>// Wait for application to be started<NEW_LINE>RunState runState = RunState.UNKNOWN;<NEW_LINE>long currentTime = System.currentTimeMillis();<NEW_LINE>long roughEstimateFetchStatsms = 5000;<NEW_LINE>long totalTime = currentTime + timeout;<NEW_LINE>String checkingMessage = "Checking if the application is running";<NEW_LINE>int estimatedAttempts = (int) (timeout / (WAIT_TIME + roughEstimateFetchStatsms));<NEW_LINE>monitor.beginTask(checkingMessage, estimatedAttempts);<NEW_LINE>model.getElementConsoleManager().writeToConsole(element, checkingMessage + ". Please wait...", LogType.STDOUT);<NEW_LINE>CFApplicationDetail app = requests.getApplication(appName);<NEW_LINE>if (app == null) {<NEW_LINE>throw new OperationCanceledException();<NEW_LINE>}<NEW_LINE>// Get the guid, as it is more efficient for lookup<NEW_LINE>// UUID appGuid = element.getGuid();<NEW_LINE>while (runState != RunState.RUNNING && runState != RunState.FLAPPING && runState != RunState.CRASHED && currentTime < totalTime) {<NEW_LINE>int timeLeft = (int) ((totalTime - currentTime) / 1000);<NEW_LINE>// Don't log this. Only update the monitor<NEW_LINE>monitor.setTaskName(checkingMessage + ". Time left before timeout: " + timeLeft + 's');<NEW_LINE>checkTerminate(monitor);<NEW_LINE>monitor.worked(1);<NEW_LINE>runState = getRunState(app.getInstanceDetails());<NEW_LINE>try {<NEW_LINE>Thread.sleep(WAIT_TIME);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>}<NEW_LINE>app = requests.<MASK><NEW_LINE>// App no longer exists<NEW_LINE>if (app == null) {<NEW_LINE>throw new OperationCanceledException();<NEW_LINE>}<NEW_LINE>currentTime = System.currentTimeMillis();<NEW_LINE>}<NEW_LINE>if (runState != RunState.RUNNING) {<NEW_LINE>String warning = "Timed out waiting for application - " + appName + " to start. Please wait and manually refresh the target, or check if the application logs show any errors.";<NEW_LINE>model.getElementConsoleManager().writeToConsole(this.element, warning, LogType.STDERROR);<NEW_LINE>throw ExceptionUtil.coreException(warning);<NEW_LINE>} else {<NEW_LINE>model.getElementConsoleManager().writeToConsole(this.element, "Application appears to have started - " + appName, LogType.STDOUT);<NEW_LINE>}<NEW_LINE>return runState;<NEW_LINE>}
getApplication(app.getName());
770,675
private void addCSSClasses(SVGPlot svgp) {<NEW_LINE>final StyleLibrary style = context.getStyleLibrary();<NEW_LINE>// Class for the cube<NEW_LINE>if (!svgp.getCSSClassManager().contains(MARKER)) {<NEW_LINE>CSSClass cls = new CSSClass(this, MARKER);<NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_VALUE, style.getColor(StyleLibrary.SELECTION));<NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_OPACITY_PROPERTY, style<MASK><NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_WIDTH_PROPERTY, style.getLineWidth(StyleLibrary.PLOT) * 2.);<NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_LINECAP_PROPERTY, SVGConstants.CSS_ROUND_VALUE);<NEW_LINE>cls.setStatement(SVGConstants.CSS_STROKE_LINEJOIN_PROPERTY, SVGConstants.CSS_ROUND_VALUE);<NEW_LINE>cls.setStatement(SVGConstants.CSS_FILL_PROPERTY, SVGConstants.CSS_NONE_VALUE);<NEW_LINE>svgp.addCSSClassOrLogError(cls);<NEW_LINE>}<NEW_LINE>}
.getOpacity(StyleLibrary.SELECTION));
1,015,598
private void verifyResults(PrintWriter pw, long execId, String testName) throws TestFailureException {<NEW_LINE>// Common stuff<NEW_LINE>JobOperator jobOp = BatchRuntime.getJobOperator();<NEW_LINE>// Tests<NEW_LINE>if (testName.equals("flowTransitionIllegal")) {<NEW_LINE>JobWaiter waiter = new JobWaiter(JobWaiter.STARTED_OR_STARTING, JobWaiter.FAILED_STATE_ONLY);<NEW_LINE>JobExecution jobExec = waiter.waitForAfterJobNotificationThenFinalState(EndOfJobNotificationListener.class, execId);<NEW_LINE>// We've already asserted the job failed. Ensure that the steps themselves completed successfully, letting us<NEW_LINE>// conclude it was the illegal transition causing the job failure.<NEW_LINE>Map<String, StepExecution> stepMap = BatchFatUtils.getStepExecutionMap(jobOp.getStepExecutions(execId));<NEW_LINE>assertEquals("Check status of first step", BatchStatus.COMPLETED, stepMap.get("flow1step1").getBatchStatus());<NEW_LINE>assertEquals("Check status of second step", BatchStatus.COMPLETED, stepMap.get("flow1step2").getBatchStatus());<NEW_LINE>assertEquals("num steps", 2, stepMap.<MASK><NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Not expecting testName = " + testName);<NEW_LINE>}<NEW_LINE>}
entrySet().size());
1,327,736
private void renderMinimizeButton(MatrixStack matrixStack, int x1, int y1, int x2, int y2, boolean hovering, boolean minimized) {<NEW_LINE>renderTitleBarButton(matrixStack, x1, y1, x2, y2, hovering);<NEW_LINE>Matrix4f matrix = matrixStack.peek().getPositionMatrix();<NEW_LINE>BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();<NEW_LINE>float xa1 = x1 + 1;<NEW_LINE>float xa2 = (x1 + x2) / 2.0F;<NEW_LINE>float xa3 = x2 - 1;<NEW_LINE>float ya1;<NEW_LINE>float ya2;<NEW_LINE>if (minimized) {<NEW_LINE>ya1 = y1 + 3;<NEW_LINE>ya2 = y2 - 2.5F;<NEW_LINE>RenderSystem.setShaderColor(0, hovering ? 1 : 0.85F, 0, 1);<NEW_LINE>} else {<NEW_LINE>ya1 = y2 - 3;<NEW_LINE>ya2 = y1 + 2.5F;<NEW_LINE>RenderSystem.setShaderColor(hovering ? 1 : 0.85F, 0, 0, 1);<NEW_LINE>}<NEW_LINE>// arrow<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION);<NEW_LINE>bufferBuilder.vertex(matrix, xa1, ya1, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, xa3, ya1, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, xa2, <MASK><NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>// outline<NEW_LINE>RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F);<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION);<NEW_LINE>bufferBuilder.vertex(matrix, xa1, ya1, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, xa3, ya1, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, xa2, ya2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, xa1, ya1, 0).next();<NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>}
ya2, 0).next();
1,060,081
public ConstructorExecutor resolve(EvaluationContext context, String typeName, List<TypeDescriptor> argumentTypes) throws AccessException {<NEW_LINE>try {<NEW_LINE>TypeConverter typeConverter = context.getTypeConverter();<NEW_LINE>Class<?> type = context.getTypeLocator().findType(typeName);<NEW_LINE>Constructor<?>[<MASK><NEW_LINE>Arrays.sort(ctors, Comparator.comparingInt(Constructor::getParameterCount));<NEW_LINE>Constructor<?> closeMatch = null;<NEW_LINE>Constructor<?> matchRequiringConversion = null;<NEW_LINE>for (Constructor<?> ctor : ctors) {<NEW_LINE>int paramCount = ctor.getParameterCount();<NEW_LINE>List<TypeDescriptor> paramDescriptors = new ArrayList<>(paramCount);<NEW_LINE>for (int i = 0; i < paramCount; i++) {<NEW_LINE>paramDescriptors.add(new TypeDescriptor(new MethodParameter(ctor, i)));<NEW_LINE>}<NEW_LINE>ReflectionHelper.ArgumentsMatchInfo matchInfo = null;<NEW_LINE>if (ctor.isVarArgs() && argumentTypes.size() >= paramCount - 1) {<NEW_LINE>// *sigh* complicated<NEW_LINE>// Basically.. we have to have all parameters match up until the varargs one, then the rest of what is<NEW_LINE>// being provided should be<NEW_LINE>// the same type whilst the final argument to the method must be an array of that (oh, how easy...not) -<NEW_LINE>// or the final parameter<NEW_LINE>// we are supplied does match exactly (it is an array already).<NEW_LINE>matchInfo = ReflectionHelper.compareArgumentsVarargs(paramDescriptors, argumentTypes, typeConverter);<NEW_LINE>} else if (paramCount == argumentTypes.size()) {<NEW_LINE>// worth a closer look<NEW_LINE>matchInfo = ReflectionHelper.compareArguments(paramDescriptors, argumentTypes, typeConverter);<NEW_LINE>}<NEW_LINE>if (matchInfo != null) {<NEW_LINE>if (matchInfo.isExactMatch()) {<NEW_LINE>return new ReflectiveConstructorExecutor(ctor);<NEW_LINE>} else if (matchInfo.isCloseMatch()) {<NEW_LINE>closeMatch = ctor;<NEW_LINE>} else if (matchInfo.isMatchRequiringConversion()) {<NEW_LINE>matchRequiringConversion = ctor;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (closeMatch != null) {<NEW_LINE>return new ReflectiveConstructorExecutor(closeMatch);<NEW_LINE>} else if (matchRequiringConversion != null) {<NEW_LINE>return new ReflectiveConstructorExecutor(matchRequiringConversion);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} catch (EvaluationException ex) {<NEW_LINE>throw new AccessException("Failed to resolve constructor", ex);<NEW_LINE>}<NEW_LINE>}
] ctors = type.getConstructors();
172,452
private Properties createOverridingProperties() {<NEW_LINE>final Properties returnValue = new Properties();<NEW_LINE>// Load the properties file if specified<NEW_LINE>if (properties != null) {<NEW_LINE>try (InputStream inStream = Files.newInputStream(properties.toPath())) {<NEW_LINE>returnValue.load(inStream);<NEW_LINE>} catch (final IOException ex) {<NEW_LINE>throw new BuildException("Error loading Properties file '" + properties + "'", ex, getLocation());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// override with Ant properties like ${basedir}<NEW_LINE>final Map<String, Object> antProps <MASK><NEW_LINE>for (Map.Entry<String, Object> entry : antProps.entrySet()) {<NEW_LINE>final String value = String.valueOf(entry.getValue());<NEW_LINE>returnValue.setProperty(entry.getKey(), value);<NEW_LINE>}<NEW_LINE>// override with properties specified in subelements<NEW_LINE>for (Property p : overrideProps) {<NEW_LINE>returnValue.setProperty(p.getKey(), p.getValue());<NEW_LINE>}<NEW_LINE>return returnValue;<NEW_LINE>}
= getProject().getProperties();
1,796,167
public void handleEvent(Event event) {<NEW_LINE>TableItem item = (TableItem) event.item;<NEW_LINE>int index = table.indexOf(item);<NEW_LINE>PluginInterface pluginIF = pluginIFs.get(index);<NEW_LINE>for (int i = 0; i < COLUMN_HEADERS.length; i++) {<NEW_LINE>if (i == FilterComparator.FIELD_NAME)<NEW_LINE>item.setImage(i, pluginIF.getPluginState().<MASK><NEW_LINE>String sText = comparator.getFieldValue(i, pluginIF);<NEW_LINE>if (sText == null)<NEW_LINE>sText = "";<NEW_LINE>item.setText(i, sText);<NEW_LINE>}<NEW_LINE>item.setGrayed(pluginIF.getPluginState().isMandatory());<NEW_LINE>boolean bEnabled = pluginIF.getPluginState().isLoadedAtStartup();<NEW_LINE>Utils.setCheckedInSetData(item, bEnabled);<NEW_LINE>item.setData("PluginID", pluginIF.getPluginID());<NEW_LINE>Utils.alternateRowBackground(item);<NEW_LINE>}
isOperational() ? imgGreenLed : imgRedLed);
1,640,950
public boolean write() throws IOException {<NEW_LINE>Send send = networkSend.getPayload();<NEW_LINE>if (send == null) {<NEW_LINE>throw new IllegalStateException("Registered for write interest but no response attached to key.");<NEW_LINE>}<NEW_LINE>if (!closing && handshakeComplete) {<NEW_LINE>if (!flush(netWriteBuffer)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (networkSend.maySetSendStartTimeInMs()) {<NEW_LINE>metrics.transmissionSendPendingTime.update(time.milliseconds() - networkSend.getSendCreateTimeInMs());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>long bytesWritten = send.writeTo(this);<NEW_LINE>long writeTimeMs = time.milliseconds() - startTimeMs;<NEW_LINE>logger.trace("Bytes written {} to {} using key {} Time: {} ms", bytesWritten, socketChannel.socket().getRemoteSocketAddress(), getConnectionId(), writeTimeMs);<NEW_LINE>if (bytesWritten > 0) {<NEW_LINE>metrics.transmissionSendTime.update(writeTimeMs);<NEW_LINE>metrics.transmissionSendSize.update(bytesWritten);<NEW_LINE>}<NEW_LINE>return (send.isSendComplete() && netWriteBuffer.remaining() == 0);<NEW_LINE>}
long startTimeMs = time.milliseconds();
522,121
private CloseSessionResponse closeSession(ServiceRequest service) throws UaException {<NEW_LINE>CloseSessionRequest request = (CloseSessionRequest) service.getRequest();<NEW_LINE>long secureChannelId = service.getSecureChannelId();<NEW_LINE>NodeId authToken = service.getRequest().getRequestHeader().getAuthenticationToken();<NEW_LINE>Session session = activeSessions.get(authToken);<NEW_LINE>if (session != null) {<NEW_LINE>if (session.getSecureChannelId() != secureChannelId) {<NEW_LINE>throw new UaException(StatusCodes.Bad_SecureChannelIdInvalid);<NEW_LINE>} else {<NEW_LINE>activeSessions.remove(authToken);<NEW_LINE>session.close(request.getDeleteSubscriptions());<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>session = createdSessions.get(authToken);<NEW_LINE>if (session == null) {<NEW_LINE>throw new UaException(StatusCodes.Bad_SessionIdInvalid);<NEW_LINE>} else if (session.getSecureChannelId() != secureChannelId) {<NEW_LINE>throw new UaException(StatusCodes.Bad_SecureChannelIdInvalid);<NEW_LINE>} else {<NEW_LINE>createdSessions.remove(authToken);<NEW_LINE>session.close(request.getDeleteSubscriptions());<NEW_LINE>return new CloseSessionResponse(service.createResponseHeader());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
CloseSessionResponse(service.createResponseHeader());
560,510
protected Message createMessage(Object objectToConvert, MessageProperties messageProperties, @Nullable Type genericType) throws MessageConversionException {<NEW_LINE>byte[] bytes;<NEW_LINE>try {<NEW_LINE>if (this.charsetIsUtf8 && this.supportedCTCharset == null) {<NEW_LINE>bytes = this.objectMapper.writeValueAsBytes(objectToConvert);<NEW_LINE>} else {<NEW_LINE>String jsonString = this.objectMapper.writeValueAsString(objectToConvert);<NEW_LINE>String encoding = this.supportedCTCharset != null ? this.supportedCTCharset : getDefaultCharset();<NEW_LINE>bytes = jsonString.getBytes(encoding);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new MessageConversionException("Failed to convert Message content", e);<NEW_LINE>}<NEW_LINE>messageProperties.setContentType(this.supportedContentType.toString());<NEW_LINE>if (this.supportedCTCharset == null) {<NEW_LINE>messageProperties.setContentEncoding(getDefaultCharset());<NEW_LINE>}<NEW_LINE>messageProperties.setContentLength(bytes.length);<NEW_LINE>if (getClassMapper() == null) {<NEW_LINE>JavaType type = this.objectMapper.constructType(genericType == null ? objectToConvert.getClass() : genericType);<NEW_LINE>if (genericType != null && !type.isContainerType() && Modifier.isAbstract(type.getRawClass().getModifiers())) {<NEW_LINE>type = this.objectMapper.constructType(objectToConvert.getClass());<NEW_LINE>}<NEW_LINE>getJavaTypeMapper().fromJavaType(type, messageProperties);<NEW_LINE>} else {<NEW_LINE>// NOSONAR never null<NEW_LINE>getClassMapper().fromClass(<MASK><NEW_LINE>}<NEW_LINE>return new Message(bytes, messageProperties);<NEW_LINE>}
objectToConvert.getClass(), messageProperties);
181,200
public static void splitHyphenatedToken(Tree tree) {<NEW_LINE>List<Tree> childrenList = tree.getChildrenAsList();<NEW_LINE>for (int i = 0; i < childrenList.size(); i++) {<NEW_LINE>if (childrenList.get(i).isPreTerminal()) {<NEW_LINE>String potentialHyphenatedWord = childrenList.get(i).getLeaves().get(0).value();<NEW_LINE>Matcher m = hyphenatedWordPattern.matcher(potentialHyphenatedWord);<NEW_LINE>if (m.find()) {<NEW_LINE>tree.removeChild(i);<NEW_LINE>String wordTag = childrenList.get(i).value();<NEW_LINE>String[] splitUpWord = potentialHyphenatedWord.split("-");<NEW_LINE>for (int j = 0; j < splitUpWord.length - 1; j++) {<NEW_LINE>Tree newNode = createTagAndWordNode(wordTag, splitUpWord[splitUpWord.length - 1 - j]);<NEW_LINE>tree.addChild(i, newNode);<NEW_LINE>Tree hyphenNode = createTagAndWordNode("$[", "-");<NEW_LINE>tree.addChild(i, hyphenNode);<NEW_LINE>}<NEW_LINE>Tree newNode = createTagAndWordNode<MASK><NEW_LINE>tree.addChild(i, newNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(wordTag, splitUpWord[0]);
1,094,209
private static void buildCollisionConvexHulls(TileSet tileSet, BufferedImage image, TextureSet.Builder textureSet) {<NEW_LINE>if (image != null) {<NEW_LINE>ConvexHulls convexHulls = TileSetUtil.calculateConvexHulls(image.getAlphaRaster(), 16, image.getWidth(), image.getHeight(), tileSet.getTileWidth(), tileSet.getTileHeight(), tileSet.getTileMargin(), tileSet.getTileSpacing());<NEW_LINE>for (int i = 0; i < convexHulls.hulls.length; ++i) {<NEW_LINE>ConvexHull convexHull = convexHulls.hulls[i];<NEW_LINE>Tile.ConvexHull.Builder hullBuilder = Tile.ConvexHull.newBuilder();<NEW_LINE>String collisionGroup = "";<NEW_LINE>if (i < tileSet.getConvexHullsCount()) {<NEW_LINE>collisionGroup = tileSet.getConvexHulls(i).getCollisionGroup();<NEW_LINE>}<NEW_LINE>hullBuilder.setCollisionGroup(collisionGroup).setCount(convexHull.getCount()).setIndex(convexHull.getIndex());<NEW_LINE>textureSet.addConvexHulls(hullBuilder);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < convexHulls.points.length; ++i) {<NEW_LINE>textureSet.addCollisionHullPoints(convexHulls.points[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>textureSet.<MASK><NEW_LINE>}
addAllCollisionGroups(tileSet.getCollisionGroupsList());