Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .github/scripts/generate-quality-report.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,8 @@ def _is_exempt(f: Finding) -> bool:
"LiteralsFirstInComparisons",
"LocalVariableNamingConventions",
"MethodNamingConventions",
"MissingOverride"
"MissingOverride",
"ControlStatementBraces"
}
violations = [f for f in pmd.findings if f.rule in forbidden_pmd_rules]
if violations:
Expand Down
27 changes: 14 additions & 13 deletions CodenameOne/src/com/codename1/ads/package.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<head>
<title></title>
</head>
<body>
<p>
A legacy banner Ads API. This has been replaced by more modern approaches mainly thru <a href="https://www.codenameone.com/cn1libs.html">cn1libs</a>.
</p>
<p>
Currently inner-active ads Network is supported
please refer to
<a href="http://console.inner-active.com/iamp/publisher/register?ref_id=affiliate_CodenameOne">inner-active</a>
for more information
</p>
</body>
</head>
<body>
<p>
A legacy banner Ads API. This has been replaced by more modern approaches mainly thru <a
href="https://www.codenameone.com/cn1libs.html">cn1libs</a>.
</p>
<p>
Currently inner-active ads Network is supported
please refer to
<a href="http://console.inner-active.com/iamp/publisher/register?ref_id=affiliate_CodenameOne">inner-active</a>
for more information
</p>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@
* @author Shai Almog
*/
public class AnalyticsService {
private static final Object INSTANCE_LOCK = new Object();
private static AnalyticsService instance;

private static boolean appsMode = true;
private static boolean failSilently = true;
private static int timeout;
private static int readTimeout;
private static final Object INSTANCE_LOCK = new Object();
private String agent;
private String domain;
private ConnectionRequest lastRequest;
Expand Down
24 changes: 12 additions & 12 deletions CodenameOne/src/com/codename1/analytics/package.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<head>
<title></title>
</head>
<body>
<p>
The analytics API allows tracking your mobile application usage in the field to give you real-time
data on how your application is used. This API currently delegates to the Google analytics service.
</p>
<p>
Notice that analytics is automatically added GUI applications created by the old GUI builder, you only need
to enable Analytics specifically by invoking the init method and the pages will be logged automatically.
</p>
</body>
</head>
<body>
<p>
The analytics API allows tracking your mobile application usage in the field to give you real-time
data on how your application is used. This API currently delegates to the Google analytics service.
</p>
<p>
Notice that analytics is automatically added GUI applications created by the old GUI builder, you only need
to enable Analytics specifically by invoking the init method and the pages will be logged automatically.
</p>
</body>
</html>
13 changes: 8 additions & 5 deletions CodenameOne/src/com/codename1/background/package.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<head>
<title></title>
</head>
<body>
<p>Background fetch is a mechanism whereby an application is granted permission by the operating system to update its data periodically. At times of the native platform's choosing, an app that supports background fetch will be started up (in the background), and its {@link com.codename1.background.BackgroundFetch#performBackgroundFetch(long, com.codename1.util.Callback) } method will be called.</p>
</body>
</head>
<body>
<p>Background fetch is a mechanism whereby an application is granted permission by the operating system to update its
data periodically. At times of the native platform's choosing, an app that supports background fetch will be started
up (in the background), and its {@link com.codename1.background.BackgroundFetch#performBackgroundFetch(long,
com.codename1.util.Callback) } method will be called.</p>
</body>
</html>
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/capture/Capture.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public void run() {
synchronized (this) {
try {
// we need to recheck the condition within the synchronized block (double locking)
if(!completed) {
if (!completed) {
this.wait();
}
} catch (InterruptedException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public class VideoCaptureConstraints {
private int preferredHeight;
private int preferredQuality;
private long preferredMaxFileSize;

/**
* Creates a new video cosntraint with no constraints specified.
*/
Expand Down Expand Up @@ -192,11 +193,7 @@ private String getMaxFileSizeString() {
public boolean equals(Object obj) {
if (obj instanceof VideoCaptureConstraints) {
VideoCaptureConstraints c = (VideoCaptureConstraints) obj;
return c.preferredHeight == preferredHeight &&
c.preferredWidth == preferredWidth &&
c.preferredMaxLength == preferredMaxLength &&
c.preferredQuality == preferredQuality &&
c.preferredMaxFileSize == preferredMaxFileSize;
return c.preferredHeight == preferredHeight && c.preferredWidth == preferredWidth && c.preferredMaxLength == preferredMaxLength && c.preferredQuality == preferredQuality && c.preferredMaxFileSize == preferredMaxFileSize;
}
return false;
}
Expand Down Expand Up @@ -376,7 +373,9 @@ public int getPreferredHeight() {
*/
public boolean isSizeSupported() {
build();
if (preferredWidth == 0 && preferredHeight == 0) return true;
if (preferredWidth == 0 && preferredHeight == 0) {
return true;
}
return (width == preferredWidth && height == preferredHeight);
}

Expand Down Expand Up @@ -479,7 +478,9 @@ public VideoCaptureConstraints preferredQuality(int quality) {
* @return
*/
private VideoCaptureConstraints build() {
if (compiled) return this;
if (compiled) {
return this;
}
if (compiler == null) {
this.height = 0;
this.width = 0;
Expand Down
24 changes: 12 additions & 12 deletions CodenameOne/src/com/codename1/capture/package.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<head>
<title></title>
</head>
<body>
<p>
Package for capturing photos, audio or video from the camera/microphone.
</p>
<p>
The code below demonstrates capturing and playing back audio files using this API:
</p>
<script src="https://gist.github.com/codenameone/a347dc9dcadaa759d0cb.js"></script>
<img src="https://www.codenameone.com/img/developer-guide/capture-audio.png" alt="Captured recordings in the demo" />
</body>
</head>
<body>
<p>
Package for capturing photos, audio or video from the camera/microphone.
</p>
<p>
The code below demonstrates capturing and playing back audio files using this API:
</p>
<script src="https://gist.github.com/codenameone/a347dc9dcadaa759d0cb.js"></script>
<img alt="Captured recordings in the demo" src="https://www.codenameone.com/img/developer-guide/capture-audio.png"/>
</body>
</html>
8 changes: 6 additions & 2 deletions CodenameOne/src/com/codename1/charts/ChartComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,12 @@ public void pointerDragged(int[] x, int[] y) {
} else {
int dx = Math.abs(x[0] - x[1]);
int dy = Math.abs(y[0] - y[1]);
if (dx == 0) dx = 1;
if (dy == 0) dy = 1;
if (dx == 0) {
dx = 1;
}
if (dy == 0) {
dy = 1;
}

double zoomX = (double) zoomDistStartX / dx;
double zoomY = (double) zoomDistStartY / dy;
Expand Down
1 change: 0 additions & 1 deletion CodenameOne/src/com/codename1/charts/compat/Paint.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import com.codename1.ui.Component;
import com.codename1.ui.Font;
import com.codename1.ui.Graphics;
import com.codename1.ui.Stroke;
import com.codename1.ui.geom.Rectangle2D;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public synchronized String[] getSeries() {
/**
* Returns the value at the specific index and category.
*
* @param index the index
* @param index the index
* @param category the category
* @return the value
*/
Expand Down
18 changes: 12 additions & 6 deletions CodenameOne/src/com/codename1/charts/models/CategorySeries.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@
* A series for the category charts like the pie ones.
*/
public class CategorySeries {
/** The series title. */
/**
* The series title.
*/
private final String mTitle;
/** The series categories. */
/**
* The series categories.
*/
private final List<String> mCategories = new ArrayList<String>();
/** The series values. */
/**
* The series values.
*/
private final List<Double> mValues = new ArrayList<Double>();

/**
Expand Down Expand Up @@ -60,7 +66,7 @@ public synchronized void add(double value) {
* Adds a new value to the series.
*
* @param category the category
* @param value the new value
* @param value the new value
*/
public synchronized void add(String category, double value) {
mCategories.add(category);
Expand All @@ -70,9 +76,9 @@ public synchronized void add(String category, double value) {
/**
* Replaces the value at the specific index in the series.
*
* @param index the index in the series
* @param index the index in the series
* @param category the category
* @param value the new value
* @param value the new value
*/
public synchronized void set(int index, String category, double value) {
mCategories.set(index, category);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@
* A series for the multiple category charts like the doughnut.
*/
public class MultipleCategorySeries {
/** The series title. */
/**
* The series title.
*/
private final String mTitle;
/** The series local keys. */
/**
* The series local keys.
*/
private final List<String> mCategories = new ArrayList<String>();
/** The series name. */
/**
* The series name.
*/
private final List<String[]> mTitles = new ArrayList<String[]>();
/** The series values. */
/**
* The series values.
*/
private final List<double[]> mValues = new ArrayList<double[]>();

/**
Expand All @@ -54,8 +62,8 @@ public void add(String[] titles, double[] values) {
* Adds a new value to the series.
*
* @param category the category name
* @param titles the titles to be used as labels
* @param values the new value
* @param titles the titles to be used as labels
* @param values the new value
*/
public void add(String category, String[] titles, double[] values) {
mCategories.add(category);
Expand Down
8 changes: 6 additions & 2 deletions CodenameOne/src/com/codename1/charts/models/Point.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@
* A class to encapsulate the definition of a point.
*/
public final class Point {
/** The X axis coordinate value. */
/**
* The X axis coordinate value.
*/
private float mX;
/** The Y axis coordinate value. */
/**
* The Y axis coordinate value.
*/
private float mY;

public Point() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
* A series for the range category charts like the range bar.
*/
public class RangeCategorySeries extends CategorySeries {
/** The series values. */
/**
* The series values.
*/
private final List<Double> mMaxValues = new ArrayList<Double>();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
* A series that includes 0 to many XYSeries.
*/
public class XYMultipleSeriesDataset {
/** The included series. */
/**
* The included series.
*/
private final List<XYSeries> mSeries = new ArrayList<XYSeries>();

/**
Expand All @@ -37,7 +39,7 @@ public synchronized void addSeries(XYSeries series) {
/**
* Adds a new XY series to the list.
*
* @param index the index in the series list
* @param index the index in the series list
* @param series the XY series to add
*/
public synchronized void addSeries(int index, XYSeries series) {
Expand Down
Loading
Loading