Ignore:
Timestamp:
2015-05-19T00:05:33+02:00 (10 years ago)
Author:
Don-vip
Message:

convention - An open curly brace should be located at the end of a line

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java

    r8393 r8395  
    277277                            if (playingUrl != command.url() ||
    278278                                    stateChange != State.PAUSED ||
    279                                     offset != 0)
    280                             {
     279                                    offset != 0) {
    281280                                if (audioInputStream != null) {
    282281                                    Utils.close(audioInputStream);
  • trunk/src/org/openstreetmap/josm/tools/Diff.java

    r8378 r8395  
    170170        bd[bdiagoff + bmid] = xlim;
    171171
    172         for (int c = 1;; ++c)
    173         {
     172        for (int c = 1;; ++c) {
    174173            int d;          /* Active diagonal. */
    175174            boolean big_snake = false;
     
    186185                --fmax;
    187186            }
    188             for (d = fmax; d >= fmin; d -= 2)
    189             {
     187            for (d = fmax; d >= fmin; d -= 2) {
    190188                int x, y, oldx, tlo = fd[fdiagoff + d - 1], thi = fd[fdiagoff + d + 1];
    191189
     
    204202                }
    205203                fd[fdiagoff + d] = x;
    206                 if (odd && bmin <= d && d <= bmax && bd[bdiagoff + d] <= fd[fdiagoff + d])
    207                 {
     204                if (odd && bmin <= d && d <= bmax && bd[bdiagoff + d] <= fd[fdiagoff + d]) {
    208205                    cost = 2 * c - 1;
    209206                    return d;
     
    222219                --bmax;
    223220            }
    224             for (d = bmax; d >= bmin; d -= 2)
    225             {
     221            for (d = bmax; d >= bmin; d -= 2) {
    226222                int x, y, oldx, tlo = bd[bdiagoff + d - 1], thi = bd[bdiagoff + d + 1];
    227223
     
    240236                }
    241237                bd[bdiagoff + d] = x;
    242                 if (!odd && fmin <= d && d <= fmax && bd[bdiagoff + d] <= fd[fdiagoff + d])
    243                 {
     238                if (!odd && fmin <= d && d <= fmax && bd[bdiagoff + d] <= fd[fdiagoff + d]) {
    244239                    cost = 2 * c;
    245240                    return d;
     
    255250       of changes, the algorithm is linear in the file size.  */
    256251
    257             if (c > 200 && big_snake && heuristic)
    258             {
     252            if (c > 200 && big_snake && heuristic) {
    259253                int best = 0;
    260254                int bestpos = -1;
    261255
    262                 for (d = fmax; d >= fmin; d -= 2)
    263                 {
     256                for (d = fmax; d >= fmin; d -= 2) {
    264257                    int dd = d - fmid;
    265258                    int x = fd[fdiagoff + d];
    266259                    int y = x - d;
    267260                    int v = (x - xoff) * 2 - dd;
    268                     if (v > 12 * (c + (dd < 0 ? -dd : dd)))
    269                     {
     261                    if (v > 12 * (c + (dd < 0 ? -dd : dd))) {
    270262                        if (v > best
    271263                                && xoff + SNAKE_LIMIT <= x && x < xlim
    272                                 && yoff + SNAKE_LIMIT <= y && y < ylim)
    273                         {
     264                                && yoff + SNAKE_LIMIT <= y && y < ylim) {
    274265                            /* We have a good enough best diagonal.
    275266                               now insist that it end with a significant snake.  */
     
    277268
    278269                            for (k = 1; xvec[x - k] == yvec[y - k]; k++)
    279                                 if (k == SNAKE_LIMIT)
    280                                 {
     270                                if (k == SNAKE_LIMIT) {
    281271                                    best = v;
    282272                                    bestpos = d;
     
    286276                    }
    287277                }
    288                 if (best > 0)
    289                 {
     278                if (best > 0) {
    290279                    cost = 2 * c - 1;
    291280                    return bestpos;
     
    293282
    294283                best = 0;
    295                 for (d = bmax; d >= bmin; d -= 2)
    296                 {
     284                for (d = bmax; d >= bmin; d -= 2) {
    297285                    int dd = d - bmid;
    298286                    int x = bd[bdiagoff + d];
    299287                    int y = x - d;
    300288                    int v = (xlim - x) * 2 + dd;
    301                     if (v > 12 * (c + (dd < 0 ? -dd : dd)))
    302                     {
     289                    if (v > 12 * (c + (dd < 0 ? -dd : dd))) {
    303290                        if (v > best
    304291                                && xoff < x && x <= xlim - SNAKE_LIMIT
    305                                 && yoff < y && y <= ylim - SNAKE_LIMIT)
    306                         {
     292                                && yoff < y && y <= ylim - SNAKE_LIMIT) {
    307293                            /* We have a good enough best diagonal.
    308294                               now insist that it end with a significant snake.  */
     
    310296
    311297                            for (k = 0; xvec[x + k] == yvec[y + k]; k++)
    312                                 if (k == SNAKE_LIMIT)
    313                                 {
     298                                if (k == SNAKE_LIMIT) {
    314299                                    best = v;
    315300                                    bestpos = d;
     
    319304                    }
    320305                }
    321                 if (best > 0)
    322                 {
     306                if (best > 0) {
    323307                    cost = 2 * c - 1;
    324308                    return bestpos;
     
    371355                   Let's verify that this is true.  */
    372356                throw new IllegalArgumentException("Empty subsequence");
    373             else
    374             {
     357            else {
    375358                /* Use that point to split this problem into two subproblems.  */
    376359                compareseq (xoff, b, yoff, b - d);
     
    425408        public  Change build_script(
    426409                final boolean[] changed0,int len0,
    427                 final boolean[] changed1,int len1)
    428         {
     410                final boolean[] changed1,int len1) {
    429411            Change script = null;
    430412            int i0 = 0, i1 = 0;
     
    459441        public Change build_script(
    460442                final boolean[] changed0,int len0,
    461                 final boolean[] changed1,int len1)
    462         {
     443                final boolean[] changed1,int len1) {
    463444            Change script = null;
    464445            int i0 = len0, i1 = len1;
    465446
    466             while (i0 >= 0 || i1 >= 0)
    467             {
    468                 if (changed0[i0] || changed1[i1])
    469                 {
     447            while (i0 >= 0 || i1 >= 0) {
     448                if (changed0[i0] || changed1[i1]) {
    470449                    int line0 = i0, line1 = i1;
    471450
     
    670649            }
    671650
    672             for (int i = 0; i < end; i++)
    673             {
     651            for (int i = 0; i < end; i++) {
    674652                int nmatch;
    675653                if (equivs[i] == 0) {
     
    694672            final int end = bufferedLines;
    695673
    696             for (int i = 0; i < end; i++)
    697             {
     674            for (int i = 0; i < end; i++) {
    698675                /* Cancel provisional discards not in middle of run of discards.  */
    699676                if (discards[i] == 2) {
    700677                    discards[i] = 0;
    701                 } else if (discards[i] != 0)
    702                 {
     678                } else if (discards[i] != 0) {
    703679                    /* We have found a nonprovisional discard.  */
    704680                    int j;
     
    708684                    /* Find end of this run of discardable lines.
    709685                       Count how many are provisionally discardable.  */
    710                     for (j = i; j < end; j++)
    711                     {
     686                    for (j = i; j < end; j++) {
    712687                        if (discards[j] == 0) {
    713688                            break;
     
    811786            int j = 0;
    812787            for (int i = 0; i < end; ++i)
    813                 if (noDiscards || discards[i] == 0)
    814                 {
     788                if (noDiscards || discards[i] == 0) {
    815789                    undiscarded[j] = equivs[i];
    816790                    realindexes[j++] = i;
     
    853827      @param f the file being compared against
    854828         */
    855 
    856829        void shift_boundaries(FileData f) {
    857830            final boolean[] changed = changedFlag;
     
    863836            int other_preceding = -1;
    864837
    865             for (;;)
    866             {
     838            for (;;) {
    867839                int start, end, other_start;
    868840
     
    870842                   Also keep track of the corresponding point in the other file.  */
    871843
    872                 while (i < i_end && !changed[1+i])
    873                 {
     844                while (i < i_end && !changed[1+i]) {
    874845                    while (other_changed[1+j++]) {
    875846                        /* Non-corresponding lines in the other file
     
    887858                other_start = j;
    888859
    889                 for (;;)
    890                 {
     860                for (;;) {
    891861                    /* Now find the end of this run of changes.  */
    892862
     
    905875                       Only because the previous run was shifted here.  */
    906876
    907                     if (end != i_end
    908                             && equivs[start] == equivs[end]
    909                                                        && !other_changed[1+j]
    910                                                                          && !((preceding >= 0 && start == preceding)
    911                                                                                  || (other_preceding >= 0
    912                                                                                          && other_start == other_preceding)))
    913                     {
     877                    if (end != i_end && equivs[start] == equivs[end] && !other_changed[1+j]
     878                         && !((preceding >= 0 && start == preceding) || (other_preceding >= 0 && other_start == other_preceding))) {
    914879                        changed[1+end++] = true;
    915880                        changed[1+start++] = false;
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r8393 r8395  
    601601            if ((newPoint.getEastNorth().getY() < point.getEastNorth().getY()) == (point.getEastNorth().getY() <= oldPoint.getEastNorth().getY())
    602602                    && (point.getEastNorth().getX() - p1.getEastNorth().getX()) * (p2.getEastNorth().getY() - p1.getEastNorth().getY())
    603                     < (p2.getEastNorth().getX() - p1.getEastNorth().getX()) * (point.getEastNorth().getY() - p1.getEastNorth().getY()))
    604             {
     603                    < (p2.getEastNorth().getX() - p1.getEastNorth().getX()) * (point.getEastNorth().getY() - p1.getEastNorth().getY())) {
    605604                inside = !inside;
    606605            }
     
    638637    }
    639638
    640     protected static double calcX(Node p1){
     639    protected static double calcX(Node p1) {
    641640        double lat1, lon1, lat2, lon2;
    642641        double dlon, dlat;
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r8393 r8395  
    935935                        return svg == null ? null : new ImageResource(svg);
    936936                    case OTHER:
    937                         while(size > 0)
    938                         {
     937                        while(size > 0) {
    939938                            int l = is.read(buf, offs, size);
    940939                            offs += l;
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r8380 r8395  
    253253    public static List<Shortcut> listAll() {
    254254        List<Shortcut> l = new ArrayList<>();
    255         for(Shortcut c : shortcuts.values())
    256         {
    257             if(!"core:none".equals(c.shortText)) {
     255        for (Shortcut c : shortcuts.values()) {
     256            if (!"core:none".equals(c.shortText)) {
    258257                l.add(c);
    259258            }
Note: See TracChangeset for help on using the changeset viewer.