Examples of IllegalArgumentException


Examples of com.sun.star.lang.IllegalArgumentException

        public int getRaiseAttr1() {
            throw new com.sun.star.uno.RuntimeException();
        }

        public void setRaiseAttr1(int n) throws IllegalArgumentException {
            throw new IllegalArgumentException();
        }
View Full Code Here

Examples of com.sun.star.lang.IllegalArgumentException

        public void setRaiseAttr1(int n) throws IllegalArgumentException {
            throw new IllegalArgumentException();
        }

        public int getRaiseAttr2() throws IllegalArgumentException {
            throw new IllegalArgumentException();
        }
View Full Code Here

Examples of com.sun.star.lang.IllegalArgumentException

            xPropertySet.setPropertyValue("Text", sText);
        }
        else if (xPropertySet.getPropertySetInfo().hasPropertyByName("Label"))
            xPropertySet.setPropertyValue("Label", sText);
        else
            throw new IllegalArgumentException();
       
        return getPeer().getPreferredSize();
    } catch (Exception e) {
        e.printStackTrace(System.out);
        return null;
View Full Code Here

Examples of com.sun.star.lang.IllegalArgumentException

    public XInvocation initResources() {
        try {
            com.sun.star.uno.XInterface xResource = (com.sun.star.uno.XInterface) xMSF.createInstance("com.sun.star.resource.VclStringResourceLoader");
            if (xResource == null) {
                showCommonResourceError(xMSF);
                throw new IllegalArgumentException();
            } else {
                XInvocation xResInvoke = (XInvocation) com.sun.star.uno.UnoRuntime.queryInterface(XInvocation.class, xResource);
                xResInvoke.setValue("FileName", Module);
                return xResInvoke;
            }
View Full Code Here

Examples of hamsam.exception.IllegalArgumentException

   * @throws IllegalArgumentException if the data does not form a valid packet.
   */
  public Packet(char[] data) throws IllegalArgumentException
  {
    if(data.length < 20)
      throw new IllegalArgumentException("Yahoo packet is too small, size = " + data.length);

    /* header starts with 'YMSG' */
    if(data[0] != 'Y' || data[1] != 'M' || data[2] != 'S' || data[3] != 'G')
      throw new IllegalArgumentException("Invalid yahoo packet header (No YMSG found)");

    /* get the version */
    version = ((long)toUnsigned(data[4]) << 24) +
          ((long)toUnsigned(data[5]) << 16) +
          ((long)toUnsigned(data[6]) << 8) +
          toUnsigned(data[7]);

    /* get the length of the data portion */
    int dataLength = (toUnsigned(data[8]) << 8) + toUnsigned(data[9]);

    if(data.length != dataLength + 20)
      throw new IllegalArgumentException("Yahoo packet size is not correct, header specifies a packet size of " + (dataLength + 20) + ", but actual packet size is " + data.length);

    /* get the service type */
    service = (toUnsigned(data[10]) << 8) + toUnsigned(data[11]);

    /* get the status */
    status = ((long)toUnsigned(data[12]) << 24) +
          ((long)toUnsigned(data[13]) << 16) +
          ((long)toUnsigned(data[14]) << 8) +
          toUnsigned(data[15]);

    /* get the status */
    sessionID = ((long)toUnsigned(data[16]) << 24) +
          ((long)toUnsigned(data[17]) << 16) +
          ((long)toUnsigned(data[18]) << 8) +
          toUnsigned(data[19]);

    /* create the hashtable */
    boolean gettingKey = true;
    int key = 0, valueStart = 20;
    String value;

    int i = 20;
    while(i < data.length - 1)
    {
      int dataCurrent = toUnsigned(data[i]);
      int dataNext = toUnsigned(data[i + 1]);

      if(gettingKey)
      {
        // check for a key
        if(dataCurrent != 0xc0)
          key = key * 10 + dataCurrent - '0';
        else if(dataNext == 0x80)
        {
          gettingKey = false;
          valueStart = i + 2;
          i++;
        }
        else
          throw new IllegalArgumentException("Invalid packet (No end signature found)");
      }
      else
      {
        // get value
        if(dataCurrent == 0xc0 && dataNext == 0x80)
View Full Code Here

Examples of hamsam.exception.IllegalArgumentException

    /* Read the header */
    while(count != header.length)
    {
      int ret = conn.read(header, count, header.length - count);
      if(ret == -1)
        throw new IllegalArgumentException("Stream closed without enough data");
      count += ret;
    }

    /* header starts with 'YMSG' */
    if(header[0] != 'Y' || header[1] != 'M' || header[2] != 'S' || header[3] != 'G')
      throw new IllegalArgumentException("Invalid yahoo packet header (No YMSG found)");

    /* get the version */
    version = ((long)toUnsigned(header[4]) << 24) +
          ((long)toUnsigned(header[5]) << 16) +
          ((long)toUnsigned(header[6]) << 8) +
          toUnsigned(header[7]);

    /* get the length of the data portion */
    int dataLength = (toUnsigned(header[8]) << 8) + toUnsigned(header[9]);

    /* get the service type */
    service = (toUnsigned(header[10]) << 8) + toUnsigned(header[11]);

    /* get the status */
    status = ((long)toUnsigned(header[12]) << 24) +
          ((long)toUnsigned(header[13]) << 16) +
          ((long)toUnsigned(header[14]) << 8) +
          toUnsigned(header[15]);

    /* get the status */
    sessionID = ((long)toUnsigned(header[16]) << 24) +
          ((long)toUnsigned(header[17]) << 16) +
          ((long)toUnsigned(header[18]) << 8) +
          toUnsigned(header[19]);

    /* now load the data portion */
    byte[] dataArray = new byte[dataLength];
    count = 0;

    while(count != dataArray.length)
    {
      count += conn.read(dataArray, count, dataArray.length - count);
    }

    /* create the hashtable */
    boolean gettingKey = true;
    int key = 0, valueStart = 0;
    String value;

    int i = 0;
    while(i < count - 1)
    {
      int data = toUnsigned(dataArray[i]);
      int dataNext = toUnsigned(dataArray[i + 1]);

      if(gettingKey)
      {
        // check for a key
        if(data != 0xc0)
          key = key * 10 + data - '0';
        else if(dataNext == 0x80)
        {
          gettingKey = false;
          valueStart = i + 2;
          i++;
        }
        else
          throw new IllegalArgumentException("Invalid packet (No end signature found)");
      }
      else
      {
        // get value
        if(data == 0xc0 && dataNext == 0x80)
View Full Code Here

Examples of hamsam.exception.IllegalArgumentException

   */
  void addBuddyToForwardList(Buddy buddy) throws IllegalArgumentException
  {
    String group = buddy.getGroup();
    if(group == null)
      throw new IllegalArgumentException("Group name of the buddy is not specified");

    Command add = new Command("ADD");
    add.addParam("FL");

    String username = buddy.getUsername();
View Full Code Here

Examples of hamsam.exception.IllegalArgumentException

   */
  void removeBuddyFromForwardList(Buddy buddy) throws IllegalArgumentException
  {
    String group = buddy.getGroup();
    if(group == null)
      throw new IllegalArgumentException("Group name of the buddy is not specified");

    Command add = new Command("REM");
    add.addParam("FL");

    String username = buddy.getUsername();
View Full Code Here

Examples of hamsam.exception.IllegalArgumentException

    pack.putData(1, yahooID);
    pack.putData(7, buddy.getUsername());

    String group = buddy.getGroup();
    if(group == null)
      throw new IllegalArgumentException("Buddy's group is unknown.");
     
    pack.putData(65, group);

    sendToWriterThread(pack);
  }
View Full Code Here

Examples of hamsam.exception.IllegalArgumentException

    pack.putData(1, yahooID);
    pack.putData(7, buddy.getUsername());

    String group = buddy.getGroup();
    if(group == null)
      throw new IllegalArgumentException("Buddy's group is unknown.");
     
    pack.putData(65, group);

    sendToWriterThread(pack);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.