id
stringlengths
7
14
text
stringlengths
1
106k
1595052_6
@Override public boolean isShouldRemove(Throwable throwable) { Throwable current = throwable; while (current != null) { if (current.getClass().getName().equals(JDBC_COMMUNICATIONS_EXCEPTION_NAME)) { return true; } if (current.getClass().getName().equals(JDBC_4_COMMUNICATIONS_...
1597325_0
@Override @SuppressWarnings("unchecked") public <T> T convert(Object source, Type type) { return (T) DataConversion.convert(source, erase(type)); }
1597325_1
@Override @SuppressWarnings("unchecked") public <T> T convert(final Object source, Type type) { / special case for handling a null source values if (source == null) { return (T) nullValue(type); } // check we already have the exact type if (source.getClass() == type) { return (T) source; } // che...
1597325_2
@Override @SuppressWarnings("unchecked") public <T> T convert(final Object source, Type type) { / special case for handling a null source values if (source == null) { return (T) nullValue(type); } // check we already have the exact type if (source.getClass() == type) { return (T) source; } // che...
1597325_3
@Override @SuppressWarnings("unchecked") public <T> T convert(final Object source, Type type) { / special case for handling a null source values if (source == null) { return (T) nullValue(type); } // check we already have the exact type if (source.getClass() == type) { return (T) source; } // che...
1597325_4
@Override @SuppressWarnings("unchecked") public <T> T convert(final Object source, Type type) { / special case for handling a null source values if (source == null) { return (T) nullValue(type); } // check we already have the exact type if (source.getClass() == type) { return (T) source; } // che...
1597325_5
@Override @SuppressWarnings("unchecked") public <T> T convert(final Object source, Type type) { / special case for handling a null source values if (source == null) { return (T) nullValue(type); } // check we already have the exact type if (source.getClass() == type) { return (T) source; } // che...
1597325_6
@Override @SuppressWarnings("unchecked") public <T> T convert(final Object source, Type type) { / special case for handling a null source values if (source == null) { return (T) nullValue(type); } // check we already have the exact type if (source.getClass() == type) { return (T) source; } // che...
1597325_7
private void processMessage(String message) throws Exception { Boolean toStdOut = logAllMessagesForUsers.get(config.getUsername()); if (toStdOut != null) { if (toStdOut) System.out.println("IMAPrcv[" + config.getUsername() + "]: " + message); else log.info("IMAPrcv[{}]: {}", config.getUsername()...
1597325_8
static String normalizeDateToken(String token) { return token.replaceAll(" \\(.+\\)$", "").replaceAll("[ ]+", " ").trim(); }
1597325_9
@Override public List<Integer> extract(List<String> messages) { final List<Integer> uids = Lists.newArrayList(); for (int i = 0, messagesSize = messages.size(); i < messagesSize; i++) { String message = messages.get(i); if (null == message || message.isEmpty()) continue; // Discard the success tok...
1603876_0
public String getHtmlForFlag(FeatureFlags flag, String userName) { ingBuilder content = new StringBuilder(); userName == null) { content.append(getHtmlForUserFlag(flag, userName,null)); ing[] userNames = flagManager.getUsersForFlag(flag); (userNames.length > 0) { for (String user : userNames) { (userName == null || ...
1603876_1
public String getHtmlForFlag(FeatureFlags flag, String userName) { ingBuilder content = new StringBuilder(); userName == null) { content.append(getHtmlForUserFlag(flag, userName,null)); ing[] userNames = flagManager.getUsersForFlag(flag); (userNames.length > 0) { for (String user : userNames) { (userName == null || ...
1603876_2
public FeatureFlags getFlag(String flagName) { urn (FeatureFlags) invokeStaticMethod("valueOf", new Object[] { flagName }, String.class); }
1603876_3
public Result flipFlag(String flagName) { tureFlags flag = getFlag(flagName); (flag == null) { return Result.NOT_FOUND; urn flipFlag(flag); }
1603876_4
public Result flipFlagForUser(String userName, String flagName) { ThreadUserName(userName); <FeatureFlags, FlagState> userFlagsState = getOrCreateUser(userName); tureFlags flag = getFlag(flagName); gState newFlagState = flag.isUp() ? FlagState.DOWN : FlagState.UP; etThreadUserName(); urn setFlagStateToAndPersist(userFl...
1604565_0
public Iterable<Vertex> getVertices() { Collection<Iterable<Vertex>> base = new LinkedList<Iterable<Vertex>>(); for (int pos = 0; pos < bases.length; pos++) { base.add(new MultiVertexIterable(pos)); } return new MultiIterable<Vertex>(base); }
1604565_1
public Vertex getVertex(Object id) { Collection<Vertex> baseVertices = new LinkedList<Vertex>(); // TODO: allow bases to be refreshed for (Graph g : bases) { Vertex v = g.getVertex(id); if (null != v) { baseVertices.add(v); } } if (baseVertices.size() > 0) { ...
1604565_2
public Edge getEdge(Object id) { Collection<Edge> baseEdges = new LinkedList<Edge>(); // TODO: allow bases to be refreshed for (Graph g : bases) { Edge e = g.getEdge(id); if (null != e) { baseEdges.add(e); } } if (baseEdges.size() > 0) { return new MultiEd...
1604565_3
public void clear() { throw new UnsupportedOperationException(READONLY_MSG); }
1604565_4
public Vertex addVertex(Object id) { throw new UnsupportedOperationException(READONLY_MSG); }
1604565_5
public Edge addEdge(Object id, Vertex outVertex, Vertex inVertex, String label) { throw new UnsupportedOperationException(READONLY_MSG); }
1604565_6
public void removeEdge(Edge edge) { throw new UnsupportedOperationException(READONLY_MSG); }
1604565_7
public void removeVertex(Vertex vertex) { throw new UnsupportedOperationException(READONLY_MSG); }
1604565_8
public Vertex getVertex(Object id) { Collection<Vertex> baseVertices = new LinkedList<Vertex>(); // TODO: allow bases to be refreshed for (Graph g : bases) { Vertex v = g.getVertex(id); if (null != v) { baseVertices.add(v); } } if (baseVertices.size() > 0) { ...
1604565_9
public Edge getEdge(Object id) { Collection<Edge> baseEdges = new LinkedList<Edge>(); // TODO: allow bases to be refreshed for (Graph g : bases) { Edge e = g.getEdge(id); if (null != e) { baseEdges.add(e); } } if (baseEdges.size() > 0) { return new MultiEd...
1605107_0
@Override public void defineFilter() throws Exception { /// local variables /// /// define parameters /// int notFiltered = 0; final long outputLines = nRows - nlMean + 1; final long firstLine = ((nlMean - 1) / 2); // indices in matrix system final long lastLine = firstLine + outputLines ...
1605107_1
@Deprecated public static void filterBlock(ComplexDoubleMatrix masterDataBlock, // updated ComplexDoubleMatrix slaveDataBlock, // updated int nlMean, double SNRthreshold, double RSR, // in MHz double...
1605107_2
@Deprecated public static void filterBlock(ComplexDoubleMatrix masterDataBlock, // updated ComplexDoubleMatrix slaveDataBlock, // updated int nlMean, double SNRthreshold, double RSR, // in MHz double...
1605107_3
@Deprecated public static void filterBlock(ComplexDoubleMatrix masterDataBlock, // updated ComplexDoubleMatrix slaveDataBlock, // updated int nlMean, double SNRthreshold, double RSR, // in MHz double...
1605107_4
@Deprecated public static void filterBlock(ComplexDoubleMatrix masterDataBlock, // updated ComplexDoubleMatrix slaveDataBlock, // updated int nlMean, double SNRthreshold, double RSR, // in MHz double...
1605107_5
@Deprecated public static void filterBlock(ComplexDoubleMatrix masterDataBlock, // updated ComplexDoubleMatrix slaveDataBlock, // updated int nlMean, double SNRthreshold, double RSR, // in MHz double...
1605107_6
public static DoubleMatrix arrangeKernel2d(DoubleMatrix kernel2dIn, final double scaleFactor) { final int kernelLines = kernel2dIn.rows; final int kernelPixels = kernel2dIn.columns; final int size = kernelLines; final int hbsL = (kernelLines / 2); final int hbsP = (kernelPixels / 2); final int e...
1605107_7
private void constructRectKernel() { // 1d kernel final DoubleMatrix kernel1d = new DoubleMatrix(1, blockSize); // init to zeros final int overlapLines = (int) Math.floor(kernelArray.length / 2.); // 1d kernel function for (int ii = -overlapLines; ii <= overlapLines; ++ii) { kernel1d.put(0, ...
1605107_8
private void constructRectKernel() { // 1d kernel final DoubleMatrix kernel1d = new DoubleMatrix(1, blockSize); // init to zeros final int overlapLines = (int) Math.floor(kernelArray.length / 2.); // 1d kernel function for (int ii = -overlapLines; ii <= overlapLines; ++ii) { kernel1d.put(0, ...
1605107_9
public void buildConfFile() throws Exception { // Mid point final double lineMid = 0.5d * dataWindow.lines() + 0.5; final double pixelMid = 0.5d * dataWindow.pixels() + 0.5; Point pointSAR = new Point(pixelMid, lineMid, 0); final double earthRadius = masterOrbit.computeEarthRadius(pointSAR, masterSL...
1608936_0
public static List<Tuple> extractTuplesFromObject(Object obj) { if ( obj instanceof Iterable ) { Iterable<?> it = (Iterable) obj; return StreamSupport.stream( it.spliterator(), false ) .map( TupleExtractor::extractFromObject ) .collect( Collectors.toList() ); } Tuple tuple = new Tuple(); tuple.put( "res...
1608936_1
public static List<Tuple> extractTuplesFromObject(Object obj) { if ( obj instanceof Iterable ) { Iterable<?> it = (Iterable) obj; return StreamSupport.stream( it.spliterator(), false ) .map( TupleExtractor::extractFromObject ) .collect( Collectors.toList() ); } Tuple tuple = new Tuple(); tuple.put( "res...
1608936_2
public static List<Tuple> extractTuplesFromObject(Object obj) { if ( obj instanceof Iterable ) { Iterable<?> it = (Iterable) obj; return StreamSupport.stream( it.spliterator(), false ) .map( TupleExtractor::extractFromObject ) .collect( Collectors.toList() ); } Tuple tuple = new Tuple(); tuple.put( "res...
1608936_3
public static String[] toStringArray(Collection coll) { return (String[]) coll.toArray( new String[coll.size()] ); }
1608936_4
public static String[][] to2DStringArray(Collection coll) { return (String[][]) coll.toArray( new String[coll.size()][] ); }
1608936_5
public static String[] slice(String[] strings, int begin, int length) { String[] result = new String[length]; System.arraycopy( strings, begin, result, 0, length ); return result; }
1608936_6
public static <T> int indexOf(T[] array, T element) { for ( int i = 0; i < array.length; i++ ) { if ( array[i].equals( element ) ) { return i; } } return -1; }
1608936_7
public static boolean contains(Object[] array, Object element) { return indexOf( array, element ) != -1; }
1608936_8
public static <T> T[] concat(T[] first, T... second) { int firstLength = first.length; int secondLength = second.length; @SuppressWarnings("unchecked") T[] result = (T[]) Array.newInstance( first.getClass().getComponentType(), firstLength + secondLength ); System.arraycopy( first, 0, result, 0, firstLength ); Sys...
160996_10
public synchronized void add( AlarmListener listener, Object state, int delay ) { if (listener == null) throw new NullPointerException( "listener == null" ); if (delay <= 0) throw new IllegalArgumentException( "delay <= 0" ); checkIsStarted(); long due = Timer.getNanos() + delay * Timer.NANOS_PER_MILLI; ...
160996_11
public synchronized void add( AlarmListener listener, Object state, int delay ) { if (listener == null) throw new NullPointerException( "listener == null" ); if (delay <= 0) throw new IllegalArgumentException( "delay <= 0" ); checkIsStarted(); long due = Timer.getNanos() + delay * Timer.NANOS_PER_MILLI; ...
160996_12
public synchronized void add( AlarmListener listener, Object state, int delay ) { if (listener == null) throw new NullPointerException( "listener == null" ); if (delay <= 0) throw new IllegalArgumentException( "delay <= 0" ); checkIsStarted(); long due = Timer.getNanos() + delay * Timer.NANOS_PER_MILLI; ...
160996_13
@Override public String toString() { return "Monitor "+description+": "+value; }
160996_14
public synchronized T set( T newValue ) { T oldValue = value; value = newValue; notifyAll(); return oldValue; }
160996_15
public synchronized T set( T newValue ) { T oldValue = value; value = newValue; notifyAll(); return oldValue; }
160996_16
public synchronized T set( T newValue ) { T oldValue = value; value = newValue; notifyAll(); return oldValue; }
160996_17
public void waitUntilEq( T desiredValue ) throws InterruptedException, TimeoutException { waitUntilEq( desiredValue, 0 ); }
160996_18
public void waitUntilEq( T desiredValue ) throws InterruptedException, TimeoutException { waitUntilEq( desiredValue, 0 ); }
160996_19
public void waitUntilEq( T desiredValue ) throws InterruptedException, TimeoutException { waitUntilEq( desiredValue, 0 ); }
160996_20
public T waitUntilNotEq( T undesiredValue ) throws InterruptedException, TimeoutException { return waitUntilNotEq( undesiredValue, 0 ); }
160996_21
public T waitUntilNotEq( T undesiredValue ) throws InterruptedException, TimeoutException { return waitUntilNotEq( undesiredValue, 0 ); }
160996_22
public T waitUntilEqAndSet( T desiredValue, T newValue ) throws InterruptedException, TimeoutException { return waitUntilEqAndSet( desiredValue, 0, newValue ); }
160996_23
public T waitUntilNotEqAndSet( T undesiredValue, T newValue ) throws InterruptedException, TimeoutException { return waitUntilNotEqAndSet( undesiredValue, 0, newValue ); }
160996_24
public void transportPacket( Who recipient, FlexBuffer buf ) throws IOException { SocketAddress recipientAddress = remoteAddress; if (recipient != null && recipient instanceof InetWho) { InetWho inetWho = (InetWho)recipient; recipientAddress = new InetSocketAddress( inetWho.getInetAddress(), inetWho.getPort() )...
160996_25
@Override public void close( boolean reset ) throws Exception { ServerSocket ss = serverSocket; if (ss != null) { serverSocket = null; ss.close(); } }
160996_26
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_27
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_28
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_29
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_30
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_31
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_32
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_33
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_34
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_35
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_36
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_37
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_38
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_39
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_40
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_41
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_42
public void sessionData( Who sender, FlexBuffer buf ) throws Exception { // there are two options here. one is that we have no buffered data // and the entire packet is contained within the buf. in that case // we could optimize the daylights out of the process and directly // drop the packet on the handler. whi...
160996_43
public Object sessionQuery( Object query ) throws Exception { return session.sessionQuery( query ); }
160996_44
public void sessionControl( Object control, Object value ) throws Exception { session.sessionControl( control, value ); }
160996_45
public void sessionNotify( Object event ) throws Exception { session.sessionNotify( event ); }
160996_46
public Object transportQuery( Object query ) throws Exception { return transport.transportQuery( query ); }
160996_47
public void transportControl( Object control, Object value ) throws Exception { transport.transportControl( control, value ); }
160996_48
public void transportNotify( Object event ) throws Exception { transport.transportNotify( event ); }
160996_49
public ByteBuffer alloc( Notify notify ) throws IOException { synchronized (saved) { if (!history.used( 1 )) { if (notify == null) throw new IOException( "out of buffers" ); // notify != null register( notify ); return null; } try { return allocBuf(); } catch ( Error e ) { histor...
160996_50
public boolean used( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newUsed = used + k; if (newUsed > limit) return false; // overflow if (newUsed < 0) throw new IllegalStateException( "newUsed < 0" ); used = newUsed; bump( used ); return true; }
160996_51
public boolean used( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newUsed = used + k; if (newUsed > limit) return false; // overflow if (newUsed < 0) throw new IllegalStateException( "newUsed < 0" ); used = newUsed; bump( used ); return true; }
160996_52
public boolean used( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newUsed = used + k; if (newUsed > limit) return false; // overflow if (newUsed < 0) throw new IllegalStateException( "newUsed < 0" ); used = newUsed; bump( used ); return true; }
160996_53
public boolean used( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newUsed = used + k; if (newUsed > limit) return false; // overflow if (newUsed < 0) throw new IllegalStateException( "newUsed < 0" ); used = newUsed; bump( used ); return true; }
160996_54
public boolean used( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newUsed = used + k; if (newUsed > limit) return false; // overflow if (newUsed < 0) throw new IllegalStateException( "newUsed < 0" ); used = newUsed; bump( used ); return true; }
160996_55
public boolean used( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newUsed = used + k; if (newUsed > limit) return false; // overflow if (newUsed < 0) throw new IllegalStateException( "newUsed < 0" ); used = newUsed; bump( used ); return true; }
160996_56
public boolean used( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newUsed = used + k; if (newUsed > limit) return false; // overflow if (newUsed < 0) throw new IllegalStateException( "newUsed < 0" ); used = newUsed; bump( used ); return true; }
160996_57
public boolean used( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newUsed = used + k; if (newUsed > limit) return false; // overflow if (newUsed < 0) throw new IllegalStateException( "newUsed < 0" ); used = newUsed; bump( used ); return true; }
160996_58
public boolean used( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newUsed = used + k; if (newUsed > limit) return false; // overflow if (newUsed < 0) throw new IllegalStateException( "newUsed < 0" ); used = newUsed; bump( used ); return true; }
160996_59
public void alloc( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newAlloc = alloc + k; if (newAlloc > limit) throw new IllegalStateException( "newAlloc > limit" ); if (newAlloc < 0) throw new IllegalStateException( "newAlloc < 0" ); alloc = newAlloc; }
160996_60
public void alloc( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newAlloc = alloc + k; if (newAlloc > limit) throw new IllegalStateException( "newAlloc > limit" ); if (newAlloc < 0) throw new IllegalStateException( "newAlloc < 0" ); alloc = newAlloc; }
160996_61
public void alloc( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newAlloc = alloc + k; if (newAlloc > limit) throw new IllegalStateException( "newAlloc > limit" ); if (newAlloc < 0) throw new IllegalStateException( "newAlloc < 0" ); alloc = newAlloc; }
160996_62
public void alloc( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newAlloc = alloc + k; if (newAlloc > limit) throw new IllegalStateException( "newAlloc > limit" ); if (newAlloc < 0) throw new IllegalStateException( "newAlloc < 0" ); alloc = newAlloc; }
160996_63
public void alloc( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newAlloc = alloc + k; if (newAlloc > limit) throw new IllegalStateException( "newAlloc > limit" ); if (newAlloc < 0) throw new IllegalStateException( "newAlloc < 0" ); alloc = newAlloc; }
160996_64
public void alloc( int k ) { if (k == 0) throw new IllegalArgumentException( "k == 0" ); int newAlloc = alloc + k; if (newAlloc > limit) throw new IllegalStateException( "newAlloc > limit" ); if (newAlloc < 0) throw new IllegalStateException( "newAlloc < 0" ); alloc = newAlloc; }