@Test public void testCachesResultAfterFirstLookup() throws Exception { ClassLoader ctx_loader = Thread.currentThread().getContextClassLoader(); final AtomicInteger load_count = new AtomicInteger(0); Thread.currentThread() .setContextClassLoader( new AbstractClassLoader(ctx_loader, ctx_loader, null) { @Override public InputStream getResourceAsStream(String s) { // will be called twice, once for raw name, once for name + .sql InputStream in = super.getResourceAsStream(s); load_count.incrementAndGet(); return in; } }); Handle h = openHandle(); h.execute("caches-result-after-first-lookup", 1, "Brian"); assertThat(load_count.get(), equalTo(2)); // two lookups, name and name.sql h.execute("caches-result-after-first-lookup", 2, "Sean"); assertThat(load_count.get(), equalTo(2)); // has not increased since previous Thread.currentThread().setContextClassLoader(ctx_loader); }
protected void removeSelectedHandles() { for (Handle handle : handles) { if (handle.isSelected()) { handle.remove(); } } }
/** @param e */ @Override public void mouseReleased(MouseEvent e) { if (inDrag) { for (Handle handle : handles) { handle.setSelected(false); } // stop dragging an object if (objectEditMode && (selectedObject != null)) { Point coords = toRealCoords(e.getPoint()); selectedObject.setLocation( (int) (coords.getX() - dragDiff.getWidth()), (int) (coords.getY() - (int) dragDiff.getHeight())); } // check if rooms overlap if (roomEditMode && (selectedZone) != null) { setSelectedZone(selectedZone); } } inDrag = false; dragDiff = null; selectedObject = null; originalHandleLocation = null; // removeIndicators(); rebuildShapesCache(); setNeedRepaint(true); }
/** * Gets the scale factor that allows us to translate pixel values to scroll bar values and vice * versa. This assumes that the range of pixels spans from the last pixel of * <tt>scrollUpButton</tt> to the first pixel of <tt>scrollDownButton</tt> and excludes the pixels * taken up by <tt>handle</tt>. * * <p>To map from scroll bar values (<i>real values</i>) to pixel values, you multiply by the * value scale. To map from pixel values back to real values, you divide by the value scale. * * @return <tt><number of legal pixel values> / <number of legal real values></tt> */ private float getValueScale() { ScrollBar scrollBar = (ScrollBar) getComponent(); float valueScale; int start = scrollBar.getStart(); int end = scrollBar.getEnd(); int extent = scrollBar.getExtent(); int maxLegalRealValue = end - extent; int numLegalRealValues = maxLegalRealValue - start + 1; int numLegalPixelValues; if (scrollBar.getOrientation() == Orientation.HORIZONTAL) { int availableWidth = getWidth() - scrollUpButton.getWidth() - scrollDownButton.getWidth() + 2; numLegalPixelValues = availableWidth - handle.getWidth() + 1; } else { int availableHeight = getHeight() - scrollUpButton.getHeight() - scrollDownButton.getHeight() + 2; numLegalPixelValues = availableHeight - handle.getHeight() + 1; } // the number of segments is one less than the number of values valueScale = numLegalPixelValues / ((float) numLegalRealValues - 1); return valueScale; }
@Test public void testScriptStuff() throws Exception { Handle h = openHandle(); Script s = h.createScript("default-data"); s.execute(); assertEquals(2, h.select("select * from something").size()); }
@Test public void testTriesToParseNameIfNothingFound() throws Exception { Handle h = openHandle(); try { h.insert("this-does-not-exist.sql"); fail("Should have raised an exception"); } catch (UnableToCreateStatementException e) { assertTrue(true); } }
/** * Retorna o valor de um campo do registro ou o valor de uma função. * * @param key o campo do registro cujo valor deve ser retornado. * @return o valor de um campo do registro ou o valor de uma função. * @throws ProcessException se houver falha no processamento. */ public String get(String key, boolean updated) throws ProcessException { if (key.equals("owner")) { return owner; } else if (key.equals("ownerid")) { return ownerid; } else if (reduced && updated) { // Ultima consulta com informação reduzida. // Demais campos estão comprometidos. throw new ProcessException("ERROR: WHOIS QUERY LIMIT"); } else if (key.equals("responsible")) { return responsible; } else if (key.equals("country")) { return country; } else if (key.equals("owner-c")) { return owner_c; } else if (key.equals("created")) { if (created == null) { return null; } else { return DATE_FORMATTER.format(created); } } else if (key.equals("changed")) { if (changed == null) { return null; } else { return DATE_FORMATTER.format(changed); } } else if (key.equals("provider")) { return provider; } else if (key.equals("domain")) { return domainList.toString(); } else if (key.startsWith("owner-c/")) { int index = key.indexOf('/') + 1; key = key.substring(index); Handle owner = getOwner(); if (owner == null) { return null; } else { return owner.get(key); } } else if (key.startsWith("domain/")) { int index = key.indexOf('/') + 1; key = key.substring(index); TreeSet<String> resultSet = new TreeSet<String>(); for (String domainName : domainList) { Domain domain = Domain.getDomain(domainName); String result = domain.get(key, updated); resultSet.add(domainName + "=" + result); } return resultSet.toString(); } else { return null; } }
/** * Finds a handle at the given coordinates. * * @return the hit handle, null if no handle is found. */ public Handle findHandle(int x, int y) { Handle handle; HandleEnumeration he = selectionHandles(); while (he.hasNextHandle()) { handle = he.nextHandle(); if (handle.containsPoint(x, y)) { return handle; } } return null; }
@Test public void testUsefulExceptionForBackTracing() throws Exception { Handle h = openHandle(); try { h.createStatement("insert-id-name").bind("id", 1).execute(); fail("should have raised an exception"); } catch (StatementException e) { assertTrue(e.getMessage().contains("insert into something(id, name) values (:id, :name)")); assertTrue(e.getMessage().contains("insert into something(id, name) values (?, ?)")); assertTrue(e.getMessage().contains("insert-id-name")); } }
/** * @param p * @return */ protected Handle mouseOnHandle(Point p) { Point mouse = toRealCoords(p); for (Handle handle : handles) { Rectangle rect = (Rectangle) handle.getHandle(); if (rect.contains(mouse)) { return handle; } } return null; }
/** * Initiates automatic block scrolling. This only happens if the handle is visible since whether * the user clicked before or after the handle determines the direction of the scrolling. * * @param component The scroll bar. * @param button The button that was pressed. * @param x The x-coordinate of the event in the scroll bar's coordinate space. * @param y The y-coordinate of the event in the scroll bar's coordinate space. */ @Override public boolean mouseDown(Component component, Mouse.Button button, int x, int y) { boolean consumed = super.mouseDown(component, button, x, y); if (button == Mouse.Button.LEFT && handle.isVisible()) { ScrollBar scrollBar = (ScrollBar) getComponent(); // Begin automatic block scrolling. Calculate the direction of // the scroll by checking to see if the user pressed the mouse // in the area "before" the handle or "after" it. int direction; int realStopValue; if (scrollBar.getOrientation() == Orientation.HORIZONTAL) { direction = x < handle.getX() ? -1 : 1; int pixelStopValue = x - scrollUpButton.getWidth() + 1; if (direction == 1) { // If we're scrolling down, account for the width of the // handle in our pixel stop value so that we stop as soon // as the *bottom* of the handle reaches our click point pixelStopValue -= handle.getWidth(); } realStopValue = (int) (pixelStopValue / getValueScale()); } else { direction = y < handle.getY() ? -1 : 1; int pixelStopValue = y - scrollUpButton.getHeight() + 1; if (direction == 1) { // If we're scrolling down, account for the height of the // handle in our pixel stop value so that we stop as soon // as the *bottom* of the handle reaches our click point pixelStopValue -= handle.getHeight(); } realStopValue = (int) (pixelStopValue / getValueScale()); } // Start the automatic scroller automaticScroller.start(direction, Mouse.ScrollType.BLOCK, realStopValue); consumed = true; } return consumed; }
@Test public void testDelete() throws Exception { Handle h = openHandle(); Update insert = h.createStatement("insert into something_else (name) values (:name)"); insert.bind("name", "Brian"); Long id1 = insert.executeAndReturnGeneratedKeys(LongColumnMapper.WRAPPER).first(); Assert.assertNotNull(id1); Update delete = h.createStatement("delete from something_else where id = :id"); delete.bind("id", id1); Long id2 = delete.executeAndReturnGeneratedKeys(LongColumnMapper.WRAPPER).first(); Assert.assertNull(id2); }
private void renderHandles() { for (Handle handle : handles) { getContext().setColor(new Color(0, 0, 255, DEFAULT_OPACITY)); if (handle.isSelected()) { getContext().setColor(new Color(255, 0, 0, DEFAULT_OPACITY)); } getContext() .fillRect( (int) handle.getHandle().getBounds().getX(), (int) handle.getHandle().getBounds().getY(), (int) handle.getHandle().getBounds().getWidth(), (int) handle.getHandle().getBounds().getHeight()); } }
@Test public void testInsert() throws Exception { Handle h = openHandle(); Update insert1 = h.createStatement("insert into something_else (name) values (:name)"); insert1.bind("name", "Brian"); Long id1 = insert1.executeAndReturnGeneratedKeys(LongColumnMapper.WRAPPER).first(); Assert.assertNotNull(id1); Update insert2 = h.createStatement("insert into something_else (name) values (:name)"); insert2.bind("name", "Tom"); Long id2 = insert2.executeAndReturnGeneratedKeys(LongColumnMapper.WRAPPER).first(); Assert.assertNotNull(id2); Assert.assertTrue(id2 > id1); }
public void setUp() throws Exception { JdbcDataSource ds = new JdbcDataSource(); ds.setURL("jdbc:h2:mem:test"); dbi = new DBI(ds); handle = dbi.open(); handle.execute("create table something (id int primary key, name varchar(100))"); }
@Override public void valueChanged(ScrollBar scrollBar, int previousValue) { // Invalidating the component would yield the correct behavior but // would be overkill. If all that has changed is the value, we can just // update the handle's location and save the work of full invalidation. if (handle.isVisible()) { int value = scrollBar.getValue(); if (scrollBar.getOrientation() == Orientation.HORIZONTAL) { int handleX = (int) (value * getValueScale()) + scrollUpButton.getWidth() - 1; handle.setLocation(handleX, 0); } else { int handleY = (int) (value * getValueScale()) + scrollUpButton.getHeight() - 1; handle.setLocation(0, handleY); } } }
/** @param e */ @Override public void mousePressed(MouseEvent e) { if (roomEditMode) { Point mouse = toRealCoords(e.getPoint()); Iterator it = handles.iterator(); boolean found = false; while (it.hasNext() && !found) { Handle entry = (Handle) it.next(); entry.setSelected(false); Rectangle handle = (Rectangle) entry.getHandle(); if (handle.contains(mouse)) { entry.setSelected(true); found = true; } } } }
Handle getLambdaAccessMethod(Handle implMethod) { if (!implMethod.getOwner().equals(className)) { return implMethod; } if (Flags.hasFlag(classAccess, ACC_INTERFACE)) { // the method will be relocated to a companion class return implMethod; } // TODO: do not generate an access method if the impl method is not private (probably not // implementable with a single pass) String name = "access$lambda$" + lambdaAccessToImplMethods.size(); String desc = getLambdaAccessMethodDesc(implMethod); Handle accessMethod = new Handle(H_INVOKESTATIC, className, name, desc); lambdaAccessToImplMethods.put(accessMethod, implMethod); return accessMethod; }
private String getLambdaAccessMethodDesc(Handle implMethod) { if (implMethod.getTag() == H_INVOKESTATIC) { // static method call -> keep as-is return implMethod.getDesc(); } else if (implMethod.getTag() == H_NEWINVOKESPECIAL) { // constructor call -> change to a a factory method return Types.changeReturnType( Type.getObjectType(implMethod.getOwner()), implMethod.getDesc()); } else { // instance method call -> change to a static method return Types.prependArgumentType(Type.getObjectType(className), implMethod.getDesc()); } }
public Handle getOwner() { return Handle.getHandle(owner_c); }
/** * Atualiza os campos do registro com resultado do WHOIS. * * @param result o resultado do WHOIS. * @return o ownerid real apresentado no resultado do WHOIS. * @throws QueryException se houver alguma falha da atualização do registro. */ private String refresh(String result) throws ProcessException { try { boolean reducedLocal = false; String owneridResult = null; BufferedReader reader = new BufferedReader(new StringReader(result)); try { String line; while ((line = reader.readLine()) != null) { line = line.trim(); if (line.startsWith("owner:")) { int index = line.indexOf(':') + 1; owner = line.substring(index).trim(); } else if (line.startsWith("ownerid:")) { int index = line.indexOf(':') + 1; owneridResult = line.substring(index).trim(); } else if (line.startsWith("responsible:")) { int index = line.indexOf(':') + 1; responsible = line.substring(index).trim(); } else if (line.startsWith("country:")) { int index = line.indexOf(':') + 1; country = line.substring(index).trim(); } else if (line.startsWith("owner-c:")) { int index = line.indexOf(':') + 1; owner_c = line.substring(index).trim(); } else if (line.startsWith("domain:")) { int index = line.indexOf(':') + 1; String domain = line.substring(index).trim(); domainList.add(domain); } else if (line.startsWith("created:")) { int index = line.indexOf(':') + 1; String valor = line.substring(index).trim(); if (valor.startsWith("before ")) { index = line.indexOf(' '); valor = valor.substring(index); } created = DATE_FORMATTER.parse(valor); } else if (line.startsWith("changed:")) { int index = line.indexOf(':') + 1; changed = DATE_FORMATTER.parse(line.substring(index).trim()); } else if (line.startsWith("provider:")) { int index = line.indexOf(':') + 1; provider = line.substring(index).trim(); } else if (line.startsWith("nic-hdl-br:")) { int index = line.indexOf(':') + 1; String nic_hdl_br = line.substring(index).trim(); line = reader.readLine().trim(); index = line.indexOf(':') + 1; String person = line.substring(index).trim(); line = reader.readLine().trim(); index = line.indexOf(':') + 1; String e_mail; if (reducedLocal) { e_mail = null; } else { e_mail = line.substring(index).trim(); line = reader.readLine().trim(); index = line.indexOf(':') + 1; } String created2 = line.substring(index).trim(); line = reader.readLine().trim(); index = line.indexOf(':') + 1; String changed2 = line.substring(index).trim(); Handle handle = Handle.getHandle(nic_hdl_br); handle.setPerson(person); handle.setEmail(e_mail); handle.setCreated(created2); handle.setChanged(changed2); } else if (line.startsWith("% No match for domain")) { throw new ProcessException("ERROR: OWNER NOT FOUND"); } else if (line.startsWith("% Permission denied.")) { throw new ProcessException("ERROR: WHOIS DENIED"); } else if (line.startsWith("% Permissão negada.")) { throw new ProcessException("ERROR: WHOIS DENIED"); } else if (line.startsWith("% Maximum concurrent connections limit exceeded")) { throw new ProcessException("ERROR: WHOIS CONCURRENT"); } else if (line.startsWith("% Query rate limit exceeded. Reduced information.")) { // Informação reduzida devido ao estouro de limite de consultas. Server.removeWhoisQueryHour(); reducedLocal = true; } else if (line.startsWith("% Query rate limit exceeded")) { // Restrição total devido ao estouro de limite de consultas. Server.removeWhoisQueryDay(); throw new ProcessException("ERROR: WHOIS QUERY LIMIT"); } else if (line.length() > 0 && Character.isLetter(line.charAt(0))) { Server.logError("Linha não reconhecida: " + line); } } } finally { reader.close(); } if (owneridResult == null) { throw new ProcessException("ERROR: OWNER NOT FOUND"); } else { this.lastRefresh = System.currentTimeMillis(); this.reduced = reducedLocal; this.queries = 1; // Atualiza flag de atualização. OWNER_CHANGED = true; // Retorna o ownerid real indicado pelo WHOIS. return owneridResult; } } catch (ProcessException ex) { throw ex; } catch (Exception ex) { Server.logError(ex); throw new ProcessException("ERROR: PARSING", ex); } }
public OptionPanel(Handle hnd) { handle = hnd; setBackground(Color.WHITE); setLayout(new GridLayout(0, 1)); JPanel numPanel = new JPanel(); numPanel.setBackground(Color.WHITE); about = new JButton("About"); about.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { handle.showAbout(); } }); numPanel.add(about); numPanel.add(new JLabel("Levels:")); levels = new JSpinner(new SpinnerNumberModel(handle.getContext().num, 2, 64, 1)); levels.addChangeListener( new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { handle.setLevelCount(((Integer) levels.getValue()).intValue()); handle.update(); } }); numPanel.add(levels); numPanel.add(new JLabel("Grid size:")); gridNumX = new JSpinner(new SpinnerNumberModel(handle.getContext().grid.numX, 1, 256, 1)); gridNumX.addChangeListener( new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { handle.getContext().grid.numX = (((Integer) gridNumX.getValue()).intValue()); handle.update(); } }); numPanel.add(gridNumX); gridNumY = new JSpinner(new SpinnerNumberModel(handle.getContext().grid.numY, 1, 256, 1)); gridNumY.addChangeListener( new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { handle.getContext().grid.numY = (((Integer) gridNumY.getValue()).intValue()); handle.update(); } }); numPanel.add(gridNumY); add(numPanel); JPanel optPanel = new JPanel(new FlowLayout(FlowLayout.LEADING)); optPanel.setBackground(Color.WHITE); optPanel.add(new JLabel("Options:")); contour = new JCheckBox("Contour", true); contour.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { handle.getContext().flags.contour = contour.isSelected(); handle.update(); } }); optPanel.add(contour); cursor = new JCheckBox("Cursor", true); cursor.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { handle.getContext().flags.cursor = cursor.isSelected(); handle.update(); } }); optPanel.add(cursor); grid = new JCheckBox("Grid"); grid.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { handle.getContext().flags.grid = grid.isSelected(); handle.update(); } }); optPanel.add(grid); color = new JCheckBox("Color", true); color.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { handle.getContext().flags.color = color.isSelected(); handle.update(); } }); optPanel.add(color); gradient = new JCheckBox("Gradient"); gradient.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { handle.getContext().flags.gradient = gradient.isSelected(); handle.update(); } }); optPanel.add(gradient); dither = new JCheckBox("Dither"); dither.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { handle.getContext().flags.dither = dither.isSelected(); handle.update(); } }); optPanel.add(dither); add(optPanel); JPanel effects = new JPanel(new FlowLayout(FlowLayout.LEADING)); effects.setBackground(Color.WHITE); effects.add(new JLabel("Effects:")); rainbow = new JButton("Rainbow"); rainbow.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { handle.setLevelCount(7); levels.setValue(new Integer(7)); Context c = handle.getContext(); c.colors[0] = 0xFF0000; c.colors[1] = 0xFFFF00; c.colors[2] = 0x00FF00; c.colors[3] = 0x00FFFF; c.colors[4] = 0x0000FF; c.colors[5] = 0xFF00FF; c.colors[6] = 0xFF0000; handle.update(); } }); effects.add(rainbow); add(effects); }
public void tearDown() throws Exception { handle.execute("drop table something"); handle.close(); }
public void setUp() throws Exception { dbi = new DBI("jdbc:h2:mem:" + UUID.randomUUID()); handle = dbi.open(); handle.execute("create table something (id int primary key, name varchar(100))"); }
@Test public void testNamedPositionalNamedParamsInPrepared() throws Exception { Handle h = openHandle(); h.insert("insert-id-name", 3, "Tip"); assertEquals(1, h.select("select name from something").size()); }
@Test public void testNamedParamsInExternal() throws Exception { Handle h = openHandle(); h.createStatement("insert-id-name").bind("id", 1).bind("name", "Tip").execute(); assertEquals(1, h.select("select name from something").size()); }
static { defaultInstance = new Handle(true); D3.GameBalance.GBHandle.internalForceInit(); defaultInstance.initFields(); }
@Override public void layout() { ScrollBar scrollBar = (ScrollBar) getComponent(); int width = getWidth(); int height = getHeight(); int start = scrollBar.getStart(); int end = scrollBar.getEnd(); int extent = scrollBar.getExtent(); int value = scrollBar.getValue(); int maxLegalRealValue = end - extent; int numLegalRealValues = maxLegalRealValue - start + 1; float extentPercentage = (float) extent / (float) (end - start); if (scrollBar.getOrientation() == Orientation.HORIZONTAL) { scrollUpButton.setSize(scrollUpButton.getPreferredWidth(-1), height); scrollUpButton.setLocation(0, 0); scrollDownButton.setSize(scrollDownButton.getPreferredWidth(-1), height); scrollDownButton.setLocation(width - scrollDownButton.getWidth(), 0); if (scrollBar.isEnabled()) { // Calculate the handle width first, as it dictates how much // room is left to represent the range of legal values. Note // that the handle may overlap each scroll button by 1px so // that its borders merge into the borders of the scroll buttons int availableWidth = width - scrollUpButton.getWidth() - scrollDownButton.getWidth() + 2; int handleWidth = Math.max(minimumHandleLength, Math.round(extentPercentage * availableWidth)); // Calculate the position of the handle by calculating the // scale that maps logical value to pixel value int numLegalPixelValues = availableWidth - handleWidth + 1; float valueScale = (float) numLegalPixelValues / (float) numLegalRealValues; int handleX = (int) (value * valueScale) + scrollUpButton.getWidth() - 1; if (handleWidth > availableWidth) { // If we can't fit the handle, we hide it handle.setVisible(false); } else { handle.setVisible(true); handle.setSize(handleWidth, height); handle.setLocation(handleX, 0); } } else { handle.setVisible(false); } } else { scrollUpButton.setSize(width, scrollUpButton.getPreferredHeight(-1)); scrollUpButton.setLocation(0, 0); scrollDownButton.setSize(width, scrollDownButton.getPreferredHeight(-1)); scrollDownButton.setLocation(0, height - scrollDownButton.getHeight()); if (scrollBar.isEnabled()) { // Calculate the handle height first, as it dictates how much // room is left to represent the range of legal values. Note // that the handle may overlap each scroll button by 1px so // that its borders merge into the borders of the scroll buttons int availableHeight = height - scrollUpButton.getHeight() - scrollDownButton.getHeight() + 2; int handleHeight = Math.max(minimumHandleLength, Math.round(extentPercentage * availableHeight)); // Calculate the position of the handle by calculating the // scale maps logical value to pixel value int numLegalPixelValues = availableHeight - handleHeight + 1; float valueScale = (float) numLegalPixelValues / (float) numLegalRealValues; int handleY = (int) (value * valueScale) + scrollUpButton.getHeight() - 1; if (handleHeight > availableHeight) { // If we can't fit the handle, we hide it handle.setVisible(false); } else { handle.setVisible(true); handle.setSize(width, handleHeight); handle.setLocation(0, handleY); } } else { handle.setVisible(false); } } }
/** * Does the most work for exporting data * * @param variant 0, if no filechooser 1, if filechooser */ public void doIt(int variant) { File outFile; String str; CacheHolder ch; CacheHolderDetail holder; ProgressBarForm pbf = new ProgressBarForm(); Handle h = new Handle(); if (variant == ASK_FILE) { outFile = getOutputFile(); if (outFile == null) return; } else { outFile = new File(tmpFileName); } pbf.showMainTask = false; pbf.setTask(h, "Exporting ..."); pbf.exec(); int counter = 0; int expCount = 0; for (int i = 0; i < cacheDB.size(); i++) { ch = (CacheHolder) cacheDB.get(i); if (ch.is_black == false && ch.is_filtered == false) counter++; } try { PrintWriter outp = new PrintWriter(new BufferedWriter(new FileWriter(outFile))); str = this.header(); if (str != null) outp.print(str); holder = new CacheHolderDetail(); for (int i = 0; i < cacheDB.size(); i++) { ch = (CacheHolder) cacheDB.get(i); if (ch.is_black == false && ch.is_filtered == false) { expCount++; h.progress = (float) expCount / (float) counter; h.changed(); if (needCacheDetails) holder = ch.getCacheDetails(false, false); else holder.update(ch); if (needCacheDetails && holder == null) continue; switch (this.howManyParams) { case NO_PARAMS: str = record(holder); break; case LAT_LON: if (holder.pos.isValid() == false) continue; str = record( holder, holder.pos.getLatDeg(CWPoint.DD).replace('.', this.decimalSeparator), holder.pos.getLonDeg(CWPoint.DD).replace('.', this.decimalSeparator)); break; case LAT_LON | COUNT: if (holder.pos.isValid() == false) continue; str = record( holder, holder.pos.getLatDeg(CWPoint.DD).replace('.', this.decimalSeparator), holder.pos.getLonDeg(CWPoint.DD).replace('.', this.decimalSeparator), i); break; default: str = null; break; } if (str != null) outp.print(str); } // if } // for switch (this.howManyParams & COUNT) { case NO_PARAMS: str = trailer(); break; case COUNT: str = trailer(counter); break; default: str = null; break; } if (str != null) outp.print(str); outp.close(); pbf.exit(0); } catch (IOException ioE) { Vm.debug("Error opening " + outFile.getName()); } // try }
@Override public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) { if (bsm.getOwner().equals(LambdaNaming.LAMBDA_METAFACTORY)) { backportLambda(name, Type.getType(desc), bsm, bsmArgs); } else { super.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs); } }