Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
junichi11 committed Feb 2, 2014
1 parent f32b5ac commit 315bf5f
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ protected List<CompletionItem> getCompletionItems() {
}

ArrayList<CompletionItem> items = new ArrayList<CompletionItem>();
TokenSequence ts = CakePhpDocUtils.getTokenSequence(getDocument(), getOffset());
TokenSequence<PHPTokenId> ts = CakePhpDocUtils.getTokenSequence(getDocument(), getOffset());
ts.movePrevious();
Token token = ts.token();
Token<PHPTokenId> token = ts.token();
TokenId id = token.id();
String caretPosigionText = ""; // NOI18N
int insertStart = getOffset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public FieldImpl(String name, Document doc, int offset, PhpModule phpModule) {
this.doc = doc;
this.offset = offset;
this.phpModule = phpModule;
TokenSequence ts = CakePhpDocUtils.getTokenSequence(doc, offset);
TokenSequence<PHPTokenId> ts = CakePhpDocUtils.getTokenSequence(doc, offset);
caretPositionToken = ts != null ? ts.token() : null;
caretPositionText = caretPositionToken != null ? caretPositionToken.text().toString() : null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private FILE_TYPE getFileType(String fieldName) {

@Override
public List<CompletionItem> getCompletionItems() {
TokenSequence ts = CakePhpDocUtils.getTokenSequence(getDocument(), getOffset());
TokenSequence<PHPTokenId> ts = CakePhpDocUtils.getTokenSequence(getDocument(), getOffset());
if (ts == null) {
return Collections.emptyList();
}
Expand All @@ -97,7 +97,7 @@ public List<CompletionItem> getCompletionItems() {
}

// caret position information
Token caretToken = ts.token();
Token<PHPTokenId> caretToken = ts.token();
String caretInputString = CakePhpUtils.detachQuotes(caretToken.text().toString());
int insertStart = ts.offset() + 1;
int removeLength = caretInputString.length();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public boolean verifyState(Document doc, int offset) {
AbstractDocument ad = (AbstractDocument) doc;
ad.readLock();
try {
TokenHierarchy hierarchy = TokenHierarchy.get(doc);
TokenHierarchy<Document> hierarchy = TokenHierarchy.get(doc);
ts = hierarchy.tokenSequence(PHPTokenId.language());
} finally {
ad.readUnlock();
Expand Down
10 changes: 5 additions & 5 deletions src/org/cakephp/netbeans/ui/CakePhpStatusLineElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ public class CakePhpStatusLineElement implements StatusLineElementProvider {
private final JLabel debugLabel = new JLabel(""); // NOI18N
private final JLabel cakeVersionLabel = new JLabel("");
private static final Map<String, String> debugLevels = new HashMap<String, String>();
private Lookup.Result result = null;
private Lookup.Result<FileObject> result = null;
private PhpModule phpModule = null;
private String level = ""; // NOI18N
private JList list;
private final DefaultListModel model;
private JList<String> list;
private final DefaultListModel<String> model;
private Popup popup;
private boolean popupFlg = false;
private FileChangeAdapterImpl fileChangeListener;
Expand All @@ -122,11 +122,11 @@ public CakePhpStatusLineElement() {
result.addLookupListener(new LookupListenerImpl());

// create list
model = new DefaultListModel();
model = new DefaultListModel<String>();
for (String debugLv : debugLevels.keySet()) {
model.addElement(debugLv);
}
list = new JList(model);
list = new JList<String>(model);

// add mouse listener
debugLabel.addMouseListener(new MouseAdapter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected void actionPerformed(PhpModule phpModule) {
hasNamespace = false;
ts.moveStart();
while (ts.moveNext()) {
Token token = ts.token();
Token<PHPTokenId> token = ts.token();
TokenId id = token.id();
if (id == PHPTokenId.PHP_CLASS) {
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
<StringArray count="0"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JCheckBox" name="databaseCheckBox">
<Properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private void initUnzipping() {
String[] names = githubTags.getNames();
Arrays.sort(names, new ComparatorImpl());
versionComboBox.setEnabled(true);
versionComboBox.setModel(new DefaultComboBoxModel(names));
versionComboBox.setModel(new DefaultComboBoxModel<String>(names));
}

private void initLocalUnzipping() {
Expand Down Expand Up @@ -251,7 +251,7 @@ private void initComponents() {
composerRadioButton = new javax.swing.JRadioButton();
gitCloneRadioButton = new javax.swing.JRadioButton();
progressTextField = new javax.swing.JTextField();
versionComboBox = new javax.swing.JComboBox();
versionComboBox = new javax.swing.JComboBox<String>();
databaseCheckBox = new javax.swing.JCheckBox();
dbDetailButton = new javax.swing.JButton();
emptyCheckBox = new javax.swing.JCheckBox();
Expand Down Expand Up @@ -402,7 +402,7 @@ private void unzipRadioButtonStateChanged(javax.swing.event.ChangeEvent evt) {//
private javax.swing.JTextField progressTextField;
private javax.swing.JRadioButton unzipLocalFileRadioButton;
private javax.swing.JRadioButton unzipRadioButton;
private javax.swing.JComboBox versionComboBox;
private javax.swing.JComboBox<String> versionComboBox;
// End of variables declaration//GEN-END:variables

//~ inner class
Expand Down
4 changes: 2 additions & 2 deletions src/org/cakephp/netbeans/util/CakePhpDocUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ public void run() {
}

@SuppressWarnings("unchecked")
public static TokenSequence getTokenSequence(Document doc, int offset) {
public static TokenSequence<PHPTokenId> getTokenSequence(Document doc, int offset) {
DocUtils.atomicLock(doc);
TokenSequence<PHPTokenId> tokenSequence = null;
try {
TokenHierarchy hierarchy = TokenHierarchy.get(doc);
TokenHierarchy<Document> hierarchy = TokenHierarchy.get(doc);
tokenSequence = hierarchy.tokenSequence(PHPTokenId.language());
} finally {
DocUtils.atomicUnlock(doc);
Expand Down

0 comments on commit 315bf5f

Please sign in to comment.