Commit 08f360881260b671daf19c8305a5dcaae7a01289
Fix some findbugs problems.
git-svn-id: http://jnode.svn.sourceforge.net/svnroot/jnode/trunk@5687 407389f7-7c16-0410-9eee-ad85acb55d7f
| |   |
| 561 | 561 | final SocketBuffer skbuf = null; // rxRing.getPacket(pktLen); |
| 562 | 562 | |
| 563 | 563 | try { |
| // FIXME ... this always throws an NPE since skbuf is null |
| if (skbuf.getSize() > 0) { |
| |
| if (skbuf != null && skbuf.getSize() > 0) { |
| 566 | 566 | driver.onReceive(skbuf); |
| 567 | 567 | } |
| 568 | 568 | } catch (NetworkException e) { |
| e.printStackTrace(); // To change body of catch statement |
| // use Options | File |
| // Templates. |
| e.printStackTrace(); |
| 572 | 570 | } finally { |
| 573 | 571 | // FIXME |
| 574 | 572 | } |
| |   |
| 177 | 177 | for (y = 0, x = 0, sum = 0; x < eeSize; x++) { |
| 178 | 178 | int value = doEepromCmd((eeReadCmd | (x << 16)), 27); |
| 179 | 179 | eeprom[x] = value; |
| sum += new Integer(value).shortValue(); |
| sum += (short)value; |
| 181 | 181 | if (x < 3) { |
| 182 | 182 | hwAddrArr[y++] = (byte) value; |
| 183 | 183 | hwAddrArr[y++] = (byte) (value >> 8); |
| … | … | |
| 407 | 407 | regs.setReg16(SCBeeprom, EE_ENB); |
| 408 | 408 | eepromDelay(2); |
| 409 | 409 | regs.setReg16(SCBeeprom, (EE_ENB & ~EE_CS)); |
| return NumberUtils.toUnsigned(new Integer(retVal).shortValue()); |
| return NumberUtils.toUnsigned((short)retVal); |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | // --- OTHER METHODS |
| |   |
| 217 | 217 | if (code == MESSAGE_TYPE_OPTION) { |
| 218 | 218 | messageType = value[0]; |
| 219 | 219 | } else { |
| options.put(new Integer(code), value); |
| options.put(Integer.valueOf(code), value); |
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | 223 | |
| … | … | |
| 254 | 254 | if (code == MESSAGE_TYPE_OPTION) |
| 255 | 255 | return new byte[] {(byte) messageType}; |
| 256 | 256 | else |
| return (byte[]) options.get(new Integer(code)); |
| return (byte[]) options.get(Integer.valueOf(code)); |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | /** |
| |   |
| 84 | 84 | /** |
| 85 | 85 | * for random listener ports |
| 86 | 86 | */ |
| private final Integer zero = new Integer(0); |
| private final Integer zero = Integer.valueOf(0); |
| 88 | 88 | private final Random random = new Random(); |
| 89 | 89 | |
| 90 | 90 | private final int startRandom = 1024; |
| … | … | |
| 199 | 199 | * @param skbuf |
| 200 | 200 | */ |
| 201 | 201 | private synchronized void deliver(UDPHeader hdr, SocketBuffer skbuf) throws SocketException { |
| final Integer lport = new Integer(hdr.getDstPort()); |
| final Integer lport = Integer.valueOf(hdr.getDstPort()); |
| 203 | 203 | final IPv4Header ipHdr = (IPv4Header) skbuf.getNetworkLayerHeader(); |
| 204 | 204 | final UDPDatagramSocketImpl socket = (UDPDatagramSocketImpl) sockets.get(lport); |
| 205 | 205 | if (socket != null) { |
| … | … | |
| 232 | 232 | Integer ran; |
| 233 | 233 | |
| 234 | 234 | while (lport.compareTo(zero) == 0) { |
| ran = new Integer(random.nextInt(stopRandom) + startRandom); |
| ran = Integer.valueOf(random.nextInt(stopRandom) + startRandom); |
| 236 | 236 | |
| 237 | 237 | if (!sockets.containsKey(ran)) { |
| // hmmm..... should we have one stop condition more?? |
| // Should we have one stop condition more?? |
| 239 | 239 | lport = ran; |
| 240 | 240 | socket.setLocalPort(lport.intValue()); |
| 241 | 241 | } |
| … | … | |
| 251 | 251 | * @param socket |
| 252 | 252 | */ |
| 253 | 253 | protected synchronized void unbind(UDPDatagramSocketImpl socket) { |
| final Integer lport = new Integer(socket.getLocalPort()); |
| final Integer lport = Integer.valueOf(socket.getLocalPort()); |
| 255 | 255 | if (sockets.get(lport) == socket) { |
| 256 | 256 | sockets.remove(lport); |
| 257 | 257 | } |
| |   |
| 109 | 109 | * @throws NoSuchProtocolException |
| 110 | 110 | */ |
| 111 | 111 | public NetworkLayer getNetworkLayer(int protocolID) throws NoSuchProtocolException { |
| final NetworkLayer pt = (NetworkLayer) layers.get(new Integer(protocolID)); |
| final NetworkLayer pt = (NetworkLayer) layers.get(Integer.valueOf(protocolID)); |
| 113 | 113 | if (pt == null) { |
| 114 | 114 | throw new NoSuchProtocolException("protocolID " + protocolID); |
| 115 | 115 | } |