Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
4bd52b3c
Commit
4bd52b3c
authored
Sep 04, 2012
by
Jeffrey I. Schiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close the "fixid" mapfile when no longer needed.
Change-Id: Ifa2245e7032ad00b54624ba96de85396af4c1560
parent
25b4566e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
appinventor/appengine/src/com/google/appinventor/server/IdMap.java
...or/appengine/src/com/google/appinventor/server/IdMap.java
+8
-6
No files found.
appinventor/appengine/src/com/google/appinventor/server/IdMap.java
View file @
4bd52b3c
...
...
@@ -40,7 +40,7 @@ import java.util.regex.Pattern;
* entries may be quoted, but do not have to be. The first is the
* email address to map and the other is what it maps to.
*
* @author jis@mit.edu (Jeffrey I. Schiller)
* @author jis@mit.edu (Jeffrey I. Schiller)
*
* Based on code from Whitelist.java authored by kerr@google.com (Debby Wallach)
*
...
...
@@ -64,7 +64,9 @@ public class IdMap {
IdMap
()
{
validfixId
=
false
;
try
{
parseToMap
(
new
CsvParser
(
new
FileInputStream
(
pathTofixId
)));
FileInputStream
mapfile
=
new
FileInputStream
(
pathTofixId
);
parseToMap
(
new
CsvParser
(
mapfile
));
mapfile
.
close
();
// Avoid file descriptor leak, expicitly close the mapfile once we no longer need it.
if
(
addresses
.
size
()
==
0
)
{
LOG
.
severe
(
"fixid list contained no entries."
);
}
else
{
...
...
@@ -80,7 +82,7 @@ public class IdMap {
}
catch
(
IOException
e
)
{
LOG
.
log
(
Level
.
SEVERE
,
"Unexpected fixid list error"
,
e
);
}
catch
(
Exception
e
)
{
LOG
.
log
(
Level
.
SEVERE
,
"Error parsing fixids file."
,
e
);
LOG
.
log
(
Level
.
SEVERE
,
"Error parsing fixids file."
,
e
);
}
}
...
...
@@ -88,7 +90,7 @@ public class IdMap {
public
String
get
(
String
email
)
{
if
(!
validfixId
)
{
if
(
DEBUG
)
LOG
.
info
(
"IdMap.get called for "
+
email
+
" but no valid map exists."
);
LOG
.
info
(
"IdMap.get called for "
+
email
+
" but no valid map exists."
);
// If we have not loaded a valid fixid list, no mappings
return
email
;
}
...
...
@@ -96,9 +98,9 @@ public class IdMap {
String
retval
=
addresses
.
get
(
email
);
if
(
DEBUG
)
{
if
(
retval
==
null
)
{
LOG
.
info
(
"No mapping found for "
+
email
);
LOG
.
info
(
"No mapping found for "
+
email
);
}
else
{
LOG
.
info
(
"Mapping "
+
email
+
" to "
+
retval
);
LOG
.
info
(
"Mapping "
+
email
+
" to "
+
retval
);
}
}
if
(
retval
==
null
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment