• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

i-net-software / jlessc / 281

pending completion
281

push

travis-ci-com

volker
Handle doubled rule correctly in the compressed formatter if previous
rule ends with an block

5 of 5 new or added lines in 1 file covered. (100.0%)

3586 of 3873 relevant lines covered (92.59%)

2.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.57
/src/com/inet/lib/less/LessFilePosition.java
1
/**
2
 * MIT License (MIT)
3
 *
4
 * Copyright (c) 2017 Herr Ritschwumm
5
 *
6
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7
 * of this software and associated documentation files (the "Software"), to deal
8
 * in the Software without restriction, including without limitation the rights
9
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
 * copies of the Software, and to permit persons to whom the Software is
11
 * furnished to do so, subject to the following conditions:
12
 * 
13
 * The above copyright notice and this permission notice shall be included in
14
 * all copies or substantial portions of the Software.
15
 * 
16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
 * UT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
 * THE SOFTWARE.
23
 *
24
 * @author Herr Ritschwumm
25
 * @license: The MIT license <http://opensource.org/licenses/MIT>
26
 */
27
package com.inet.lib.less;
28

29
import java.util.Objects;
30

31
/** the Position of an error in a less file */
32
public final class LessFilePosition {
33
    private String filename;
34

35
    private int    line;
36

37
    private int    column;
38

39
    /**
40
     * filename may be null to indicate a file name is unavailable
41
     * 
42
     * @param filename
43
     *            the less file, can be null if a string was parsed
44
     * @param line
45
     *            the line number in the less file
46
     * @param column
47
     *            the column in the less file
48
     */
49
    public LessFilePosition( String filename, int line, int column ) {
3✔
50
        this.filename = filename;
3✔
51
        this.line = line;
3✔
52
        this.column = column;
3✔
53
    }
3✔
54

55
    /**
56
     * Get the file name.
57
     * 
58
     * @return the file name or null if in memory
59
     */
60
    public String getFilename() {
61
        return filename;
3✔
62
    }
63

64
    /**
65
     * Get the line in the source file
66
     * 
67
     * @return the line number
68
     */
69
    public int getLine() {
70
        return line;
3✔
71
    }
72

73
    /**
74
     * Get the column in the source file.
75
     * 
76
     * @return the column number
77
     */
78
    public int getColumn() {
79
        return column;
3✔
80
    }
81

82
    /**
83
     * {@inheritDoc}
84
     */
85
    @Override
86
    public boolean equals( Object o ) {
87
        if( !(o instanceof LessFilePosition) ) {
3✔
88
            return false;
×
89
        }
90
        final LessFilePosition that = (LessFilePosition)o;
3✔
91
        return Objects.equals( filename, that.filename ) && this.line == that.line && this.column == that.column;
3✔
92
    }
93

94
    /**
95
     * {@inheritDoc}
96
     */
97
    @Override
98
    public int hashCode() {
99
        return (filename == null ? 0 : filename.hashCode()) ^ line ^ column;
×
100
    }
101

102
    /**
103
     * {@inheritDoc}
104
     */
105
    @Override
106
    public String toString() {
107
        return (filename != null ? filename + ":" : "") + line + ":" + column;
×
108
    }
109
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc