Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed bug Exception launched when it had no fields #26

Merged
merged 1 commit into from

3 participants

@joaquinmag

Check if numFields is 0, set the fieldWidth to 0 instead of making a division with that number.
This way it avoids a division by zero.

@joaquinmag joaquinmag Fixed bug Exception launched when it had no fields
Check if numFields is 0, set the fieldWidth to 0 instead of making a division with that number.
This way it avoids a division by zero.
167f17a
@timwindsor
Owner

Joaquin, thanks for your contribution! Please forgive me for asking this of you, for what is a nice concise code contribution, but we need you to sign our Contributor Agreement before I can merge in your code. If I don't there will probably be some fire-breathing lawyer all over me within minutes - or at least I think that's what happens.

Even worse is that it requires you to print off the pdf and scan or take a picture of it and then send it back in to us. I think there's even a fax number offered if you can believe it. Please bear with me and just pretend it's not the year 2012 - maybe go looking at some antique shops first so you can appreciate this process properly :)

After that I can happily merge in your code and hopefully lots more of it.

Thanks
Tim

@pelegri

Hola, Joaquin. Si firmas el CA, te pongo en la pagina de signatarios - y te damos un poco de propaganda gratis.

Si no, como dice el Tim, es un cambio muy pequeño y da un poco de pena solicitar la firma... Tengo un "todo" pendiente desde hace tiempo de diseñar una forma de aceptar contribuciones pequeñas - lo que pasa es que tengo que trabajar con el grupo legal para preparar algo y siempre hay algo más importante...

Contéstanos que quieres hacer, OK? Gracias.

@joaquinmag

Eduardo, Tim, necesito el tiempo necesario para leer el documento que me han mandado y en caso de aceptar, necesitaré el tiempo para enviarles la documentación. Tal como dijo Eduardo, lo urgente siempre sobrepasa a lo importante y no logro encontrar ese tiempo para realizar estas tareas. Apenas pueda leerlo detenidamente les daré la respuesta. Muchas gracias por su interés.

Saludos,

@pelegri

Un recordatorio para @joaquinmag en el dia de Sant Esteve/Boxing Day :)

@pelegri

Estoy haciendo un paso de los pull pendientes en preparación para el BBJam en Amsterdam y veo que este todavía está pendiente...

Joaquín... Que tal si me pones un comentario como: "I grant pemission to incorporate this change", y lo interpretare como un permiso local, y lo acepto?

@pelegri

Ah, y de paso, recién terminé creando la primera versión del geoMap y me encantaria añadir un 'push-pin' en Argentina. Sud América no está muy bien representada en estos momentos - sólo Colombia... :)

Gracias

@joaquinmag

I grant pemission to incorporate this change

@joaquinmag

Espero que sirva :+1: !

Suerte.

@pelegri

Venía a añadir un comentario con una resolución positiva y veo tu comentario. Déjame aceptar el pull request y luego añadir la nota en inglés.

@pelegri pelegri merged commit 3adf263 into blackberry:master
@pelegri

And now in english and with more details...

I checked with our legal team and they indicated that section 5 of the ASL2 covers intentional submissions into the code base and that small contributions like this can be accepted under that clause. The good news is that we now can use this clause for small changes.

There are some benefits to signing the Individual Contribution Agreement (and the CCLA for corporations) even for small contributions - we track all contributors in the list of signatories page, and many people share their approximate location and we create this geomap - but section 5 means the next time we will be able to give people that send small changes a quick response.

And thanks, Joaquín, your contribution not only helped as code but helped us streamline the process!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 9, 2012
  1. @joaquinmag

    Fixed bug Exception launched when it had no fields

    joaquinmag authored
    Check if numFields is 0, set the fieldWidth to 0 instead of making a division with that number.
    This way it avoids a division by zero.
This page is out of date. Refresh to see the latest.
View
8 ... UI/src/com/samples/toolkit/ui/container/JustifiedEvenlySpacedHorizontalFieldManager.java
@@ -46,7 +46,13 @@ protected void sublayout( int width, int height )
// There may be a few remaining pixels after dividing up the space
// we must split up the space between the first and last buttons
- int fieldWidth = width / numFields;
+
+ //if there are no fields the current fieldWidth should be 0
+ final int fieldWidth;
+ if (numFields == 0)
+ fieldWidth = 0;
+ else
+ fieldWidth = width / numFields;
int firstFieldExtra = 0;
int lastFieldExtra = 0;
Something went wrong with that request. Please try again.