From 59bb06a90248defb4c0be98f10afae88c2251fe7 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 10 Feb 2011 16:18:50 +0100 Subject: Eliminated Dialyzer warnings when using exit or throw. --- lib/orber/doc/src/notes.xml | 18 +++++++++++++++++- lib/orber/include/ifr_types.hrl | 4 ++-- lib/orber/src/orber.app.src | 2 +- lib/orber/src/orber.erl | 4 +++- lib/orber/vsn.mk | 2 +- 5 files changed, 24 insertions(+), 6 deletions(-) (limited to 'lib/orber') diff --git a/lib/orber/doc/src/notes.xml b/lib/orber/doc/src/notes.xml index ba16682f0b..589123ef73 100644 --- a/lib/orber/doc/src/notes.xml +++ b/lib/orber/doc/src/notes.xml @@ -4,7 +4,7 @@
- 19972010 + 19972011 Ericsson AB. All Rights Reserved. @@ -32,6 +32,22 @@ notes.xml
+
+ Orber 3.6.20 + +
+ Improvements and New Features + + +

+ Eliminated Dialyzer warnings when using exit or throw.

+

+ Own Id: OTP-9050 Aux Id:

+
+
+
+
+
Orber 3.6.19 diff --git a/lib/orber/include/ifr_types.hrl b/lib/orber/include/ifr_types.hrl index d982850e98..f4a1c533e1 100644 --- a/lib/orber/include/ifr_types.hrl +++ b/lib/orber/include/ifr_types.hrl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -54,7 +54,7 @@ id = Obj#Object_type.id, defined_in = Obj#Object_type.defined_in, version = Obj#Object_type.version, - type = Obj#Object_type.type}. + type = Obj#Object_type.type}). -record(exceptiondescription, {name, id, defined_in, version, type}). diff --git a/lib/orber/src/orber.app.src b/lib/orber/src/orber.app.src index fe911d65a4..88df4162b6 100644 --- a/lib/orber/src/orber.app.src +++ b/lib/orber/src/orber.app.src @@ -101,7 +101,7 @@ orber_iiop_insup, orber_init, orber_reqno, orber_objkeyserver, orber_iiop_socketsup, orber_iiop_pm, orber_env]}, - {applications, [stdlib, kernel]}, + {applications, [stdlib, kernel, mnesia]}, {env, []}, {mod, {orber, []}} ]}. diff --git a/lib/orber/src/orber.erl b/lib/orber/src/orber.erl index c3d37ad1fb..9902306161 100644 --- a/lib/orber/src/orber.erl +++ b/lib/orber/src/orber.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -1029,6 +1029,8 @@ remove_node(Node) when is_atom(Node) -> remove_tables(Tables, Node) -> remove_tables(Tables, Node, []). +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(remove_tables/3 :: (_, _, _) -> no_return()). remove_tables([], _, []) -> ok; remove_tables([], Node, Failed) -> ?EFORMAT("orber:remove_node(~p) failed. Unable to remove table(s): ~p", diff --git a/lib/orber/vsn.mk b/lib/orber/vsn.mk index c265db188f..5f17cda229 100644 --- a/lib/orber/vsn.mk +++ b/lib/orber/vsn.mk @@ -1,3 +1,3 @@ -ORBER_VSN = 3.6.19 +ORBER_VSN = 3.6.20 -- cgit v1.2.3 From 27d6af0ed32a25d7ea1dcd83a4163f8e6ec67844 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Mon, 14 Feb 2011 10:31:00 +0100 Subject: Corrected spec usage. --- lib/orber/src/corba.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/orber') diff --git a/lib/orber/src/corba.erl b/lib/orber/src/corba.erl index ea1363742c..f4a17c10e9 100644 --- a/lib/orber/src/corba.erl +++ b/lib/orber/src/corba.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -620,6 +620,8 @@ get_pid(Objkey) -> %% Returns : Throws the exception. %% Description: %%---------------------------------------------------------------------- +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(raise/1 :: (_) -> no_return()). raise(E) -> throw({'EXCEPTION', E}). @@ -629,6 +631,8 @@ raise(E) -> %% Returns : Throws the exception. %% Description: %%---------------------------------------------------------------------- +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(raise_with_state/2 :: (_, _) -> no_return()). raise_with_state(E, State) -> throw({reply, {'EXCEPTION', E}, State}). -- cgit v1.2.3 From d2bb03ce3a6a99f3e3f0abe1f74a355879437c4f Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Mon, 14 Feb 2011 14:34:00 +0100 Subject: Updsated macro EFORMAT exit handling. --- lib/orber/src/orber.erl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/orber') diff --git a/lib/orber/src/orber.erl b/lib/orber/src/orber.erl index 9902306161..f0820811f5 100644 --- a/lib/orber/src/orber.erl +++ b/lib/orber/src/orber.erl @@ -95,7 +95,13 @@ -define(DEBUG_LEVEL, 5). -define(FORMAT(_F, _A), lists:flatten(io_lib:format(_F, _A))). --define(EFORMAT(_F, _A), exit(lists:flatten(io_lib:format(_F, _A)))). +-define(EFORMAT(_F, _A), do_exit(lists:flatten(io_lib:format(_F, _A)))). + + +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(do_exit/1 :: (_) -> no_return()). +do_exit(Reason) -> + exit(Reason). %%----------------------------------------------------------------- @@ -1029,8 +1035,6 @@ remove_node(Node) when is_atom(Node) -> remove_tables(Tables, Node) -> remove_tables(Tables, Node, []). -%% To avoid dialyzer warnings due to the use of exit/throw. --spec(remove_tables/3 :: (_, _, _) -> no_return()). remove_tables([], _, []) -> ok; remove_tables([], Node, Failed) -> ?EFORMAT("orber:remove_node(~p) failed. Unable to remove table(s): ~p", -- cgit v1.2.3 From 5ee6233265d6d8e6a3d2e079908dd9f12235fe70 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Tue, 15 Feb 2011 12:46:53 +0100 Subject: Updated light weight tests. --- lib/orber/test/multi_ORB_SUITE.erl | 4 ++-- lib/orber/test/orber_test_lib.erl | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/orber') diff --git a/lib/orber/test/multi_ORB_SUITE.erl b/lib/orber/test/multi_ORB_SUITE.erl index d1931f5393..810e09836f 100644 --- a/lib/orber/test/multi_ORB_SUITE.erl +++ b/lib/orber/test/multi_ORB_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -1372,7 +1372,7 @@ light_orber2_api(_Config) -> LocalHost = net_adm:localhost(), {ok, Node, _Host} = ?match({ok,_,_}, orber_test_lib:js_node([], - {lightweigth, ["iiop://"++LocalHost++":"++integer_to_list(orber:iiop_port())]})), + {lightweight, ["iiop://"++LocalHost++":"++integer_to_list(orber:iiop_port())]})), ?match(ok, orber:info(io)), ?match([_], orber_test_lib:remote_apply(Node, orber_env, get_lightweight_nodes,[])), diff --git a/lib/orber/test/orber_test_lib.erl b/lib/orber/test/orber_test_lib.erl index b95cf4b0ec..e22e3bdb0a 100644 --- a/lib/orber/test/orber_test_lib.erl +++ b/lib/orber/test/orber_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -287,9 +287,11 @@ start_ssl(true, Node) -> start_ssl(_, _) -> ok. -start_orber({lightweigth, Options}, Node) -> +start_orber({lightweight, Options}, Node) -> + ok = rpc:call(Node, mnesia, start, []), ok = rpc:call(Node, orber, start_lightweight, [Options]); start_orber(lightweight, Node) -> + ok = rpc:call(Node, mnesia, start, []), ok = rpc:call(Node, orber, start_lightweight, []); start_orber(_, Node) -> ok = rpc:call(Node, orber, jump_start, []). -- cgit v1.2.3 From cd8c12a5c1e7ecb4bef85f23629bd1efe6a5968a Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 17 Feb 2011 10:33:14 +0100 Subject: Removed spec:s that wasn't needed. --- lib/orber/src/corba.erl | 4 ++-- lib/orber/src/orber.erl | 24 +++++++++++------------- lib/orber/src/orber_socket.erl | 12 ++---------- 3 files changed, 15 insertions(+), 25 deletions(-) (limited to 'lib/orber') diff --git a/lib/orber/src/corba.erl b/lib/orber/src/corba.erl index f4a17c10e9..ecec768544 100644 --- a/lib/orber/src/corba.erl +++ b/lib/orber/src/corba.erl @@ -621,7 +621,7 @@ get_pid(Objkey) -> %% Description: %%---------------------------------------------------------------------- %% To avoid dialyzer warnings due to the use of exit/throw. --spec(raise/1 :: (_) -> no_return()). +-spec raise(term()) -> no_return(). raise(E) -> throw({'EXCEPTION', E}). @@ -632,7 +632,7 @@ raise(E) -> %% Description: %%---------------------------------------------------------------------- %% To avoid dialyzer warnings due to the use of exit/throw. --spec(raise_with_state/2 :: (_, _) -> no_return()). +-spec raise_with_state(term(), term()) -> no_return(). raise_with_state(E, State) -> throw({reply, {'EXCEPTION', E}, State}). diff --git a/lib/orber/src/orber.erl b/lib/orber/src/orber.erl index f0820811f5..665b3cb383 100644 --- a/lib/orber/src/orber.erl +++ b/lib/orber/src/orber.erl @@ -95,13 +95,7 @@ -define(DEBUG_LEVEL, 5). -define(FORMAT(_F, _A), lists:flatten(io_lib:format(_F, _A))). --define(EFORMAT(_F, _A), do_exit(lists:flatten(io_lib:format(_F, _A)))). - - -%% To avoid dialyzer warnings due to the use of exit/throw. --spec(do_exit/1 :: (_) -> no_return()). -do_exit(Reason) -> - exit(Reason). +-define(EFORMAT(_F, _A), exit(lists:flatten(io_lib:format(_F, _A)))). %%----------------------------------------------------------------- @@ -1033,12 +1027,18 @@ remove_node(Node) when is_atom(Node) -> remove_tables(Tables, Node) -> - remove_tables(Tables, Node, []). + case remove_tables(Tables, Node, []) of + ok -> + ok; + {error, Node, Failed} -> + ?EFORMAT("orber:remove_node(~p) failed. Unable to remove table(s): ~p", + [Node, Failed]) + end. -remove_tables([], _, []) -> ok; +remove_tables([], _, []) -> + ok; remove_tables([], Node, Failed) -> - ?EFORMAT("orber:remove_node(~p) failed. Unable to remove table(s): ~p", - [Node, Failed]); + {error, Node, Failed}; remove_tables([T1|Trest], Node, Failed) -> case mnesia:del_table_copy(T1, Node) of {atomic, ok} -> @@ -1047,8 +1047,6 @@ remove_tables([T1|Trest], Node, Failed) -> remove_tables(Trest, Node, [{T1, Reason}|Failed]) end. - - %%----------------------------------------------------------------- %% Internal interface functions %%----------------------------------------------------------------- diff --git a/lib/orber/src/orber_socket.erl b/lib/orber/src/orber_socket.erl index 84ed193ebb..ec2cf8f42a 100644 --- a/lib/orber/src/orber_socket.erl +++ b/lib/orber/src/orber_socket.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -37,7 +37,7 @@ %%----------------------------------------------------------------- -export([start/0, connect/4, listen/3, listen/4, accept/2, accept/3, write/3, controlling_process/3, close/2, peername/2, sockname/2, - peerdata/2, peercert/2, peercert/3, sockdata/2, setopts/3, + peerdata/2, peercert/2, sockdata/2, setopts/3, clear/2, shutdown/3, post_accept/2, post_accept/3]). %%----------------------------------------------------------------- @@ -366,14 +366,6 @@ peercert(Type, _Socket) -> [?LINE, Type], ?DEBUG_LEVEL), {error, ebadsocket}. -peercert(ssl, Socket, Opts) -> - ssl:peercert(Socket, Opts); -peercert(Type, _Socket, Opts) -> - orber:dbg("[~p] orber_socket:peercert(~p, ~p);~n" - "Only available for SSL sockets.", - [?LINE, Type, Opts], ?DEBUG_LEVEL), - {error, ebadsocket}. - %%----------------------------------------------------------------- %% Get peerdata %% -- cgit v1.2.3 From f5a6e678c9044896782230368ff8de266bfd9415 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 17 Feb 2011 12:28:17 +0100 Subject: Removed more spec:s that wasn't needed. --- lib/orber/test/csiv2_SUITE.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/orber') diff --git a/lib/orber/test/csiv2_SUITE.erl b/lib/orber/test/csiv2_SUITE.erl index 8103fd81ac..855c1b6b3f 100644 --- a/lib/orber/test/csiv2_SUITE.erl +++ b/lib/orber/test/csiv2_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2010. All Rights Reserved. +%% Copyright Ericsson AB 2005-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -694,8 +694,8 @@ ssl_server_peercert_api(_Config) -> {ok, Socket} = ?match({ok, _}, fake_client_ORB(ssl, ServerHost, ServerPort, SSLOptions)), {ok, _PeerCert} = ?match({ok, _}, orber_socket:peercert(ssl, Socket)), - ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [pkix, subject])), - ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [ssl, subject])), +%% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [pkix, subject])), +%% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [ssl, subject])), % ?match({ok, #'Certificate'{}}, % 'OrberCSIv2':decode('Certificate', PeerCert)), destroy_fake_ORB(ssl, Socket), @@ -734,8 +734,8 @@ ssl_client_peercert_api(_Config) -> ?match(ok, ssl:ssl_accept(Socket)), {ok, _PeerCert} = ?match({ok, _}, orber_socket:peercert(ssl, Socket)), - ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [pkix, subject])), - ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [ssl, subject])), +%% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [pkix, subject])), +%% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [ssl, subject])), % ?match({ok, #'Certificate'{}}, % 'OrberCSIv2':decode('Certificate', PeerCert)), ssl:close(Socket), -- cgit v1.2.3