Skip to content

Commit

Permalink
Fixed Bug 56 : SalesforceFoundation#56
Browse files Browse the repository at this point in the history
  • Loading branch information
JitendraZaa committed Apr 10, 2017
1 parent 94c664e commit a414f50
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
Test Demo
6 changes: 3 additions & 3 deletions src/org/salesforce/apexdoc/ClassModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ public ArrayList<MethodModel> getMethods() {

public ArrayList<MethodModel> getMethodsSorted() {
@SuppressWarnings("unchecked")
List<MethodModel> sorted = (List<MethodModel>)methods.clone();
List<MethodModel> sorted = (List<MethodModel>)methods.clone();
Collections.sort(sorted, new Comparator<MethodModel>(){
@Override
public int compare(MethodModel o1, MethodModel o2) {
String methodName1 = o1.getMethodName();
String methodName2 = o2.getMethodName();
String className = getClassName();

if(methodName1.equals(className)){
if(methodName1 != null && methodName1.equals(className)){
return Integer.MIN_VALUE;
} else if(methodName2.equals(className)){
} else if(methodName2 != null && methodName2.equals(className)){
return Integer.MAX_VALUE;
}
return (methodName1.toLowerCase().compareTo(methodName2.toLowerCase()));
Expand Down
2 changes: 2 additions & 0 deletions src/org/salesforce/apexdoc/FileManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ private String htmlForClassModel(ClassModel cModel, String hostedSourceURL) {
"<h2 class='subsection-title'>Methods</h2>" +
"<div class='subsection-container'> ";



// method Table of Contents (TOC)
contents += "<ul class='methodTOC'>";
for (MethodModel method : cModel.getMethodsSorted()) {
Expand Down
1 change: 1 addition & 0 deletions src/org/salesforce/apexdoc/MethodModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public String getMethodName() {
int lastindex = nameLine.indexOf("(");
if (lastindex >= 0) {
String methodName = ApexDoc.strPrevWord(nameLine, lastindex);
methodName = methodName != null ? methodName : "";
return methodName;
}
}
Expand Down

0 comments on commit a414f50

Please sign in to comment.