• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2011 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 import java.io.Reader;
18 import java.io.StreamTokenizer;
19 import java.util.AbstractList;
20 import java.util.ArrayList;
21 
22 public final class Foo {
23 
writeStreamTokenizerNval()24     public void writeStreamTokenizerNval() {
25         new StreamTokenizer((Reader) null).nval = 5;
26     }
27 
readStreamTokenizerNval()28     public double readStreamTokenizerNval() {
29         return new StreamTokenizer((Reader) null).nval;
30     }
31 
callStringValueOf()32     public void callStringValueOf() {
33         String.valueOf(5);
34     }
35 
callIntegerValueOf()36     public void callIntegerValueOf() {
37         Integer.valueOf("5");
38     }
39 
callArrayListRemoveIndex()40     public void callArrayListRemoveIndex() {
41         new ArrayList<String>().remove(5);
42     }
43 
callArrayListRemoveValue()44     public void callArrayListRemoveValue() {
45         new ArrayList<String>().remove("5");
46     }
47 
48     static class MyList<T> extends AbstractList<T> {
get(int index)49         @Override public T get(int index) {
50             return null;
51         }
size()52         @Override public int size() {
53             return 0;
54         }
remove(Object o)55         @Override public boolean remove(Object o) {
56             return false;
57         }
58     }
59 }
60